Add unit tests for circular reference

dev-new-models
melex750 2016-08-09 14:55:56 -04:00
parent 66218319dd
commit 71aa7e468b
1 changed files with 35 additions and 0 deletions

View File

@ -1006,6 +1006,41 @@ TEST_F(CBotUT, ClassStringAdd_Issue535)
); );
} }
TEST_F(CBotUT, ClassCompileCircularReference_Issue433)
{
ExecuteTest(
"public class OtherClass {\n"
" TestClass testclass;\n"
"}\n"
"public class TestClass {\n"
" int test;\n"
" OtherClass otherclass;\n"
"}\n"
"extern void TestCompileCircularReference()\n"
"{\n"
" TestClass t();\n"
"}\n"
);
}
TEST_F(CBotUT, ClassTestClassDefinedAfterReference)
{
ExecuteTest(
"public class OtherClass {\n"
" TestClass testclass = new TestClass();\n"
"}\n"
"public class TestClass {\n"
" int test = 246;\n"
"}\n"
"extern void TestDefinedAfterReference()\n"
"{\n"
" OtherClass o();\n"
" TestClass t = o.testclass;\n"
" ASSERT(t.test == 246);\n"
"}\n"
);
}
TEST_F(CBotUT, String) TEST_F(CBotUT, String)
{ {
ExecuteTest( ExecuteTest(