[colobot] 31/74: Add unit tests for circular reference

Didier Raboud odyx at moszumanska.debian.org
Mon Nov 7 07:50:02 UTC 2016


This is an automated email from the git hooks/post-receive script.

odyx pushed a commit to branch debian/master
in repository colobot.

commit 71aa7e468bcca287b1bbe6cb97e242626c2607d7
Author: melex750 <melex750 at users.noreply.github.com>
Date:   Tue Aug 9 14:55:56 2016 -0400

    Add unit tests for circular reference
---
 test/unit/CBot/CBot_test.cpp | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/test/unit/CBot/CBot_test.cpp b/test/unit/CBot/CBot_test.cpp
index 2d96d59..7158bf0 100644
--- a/test/unit/CBot/CBot_test.cpp
+++ b/test/unit/CBot/CBot_test.cpp
@@ -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)
 {
     ExecuteTest(

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git



More information about the Pkg-games-commits mailing list