summaryrefslogtreecommitdiffstats
path: root/tests/samplebinding/multi_cpp_inheritance_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/samplebinding/multi_cpp_inheritance_test.py')
-rwxr-xr-xtests/samplebinding/multi_cpp_inheritance_test.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/samplebinding/multi_cpp_inheritance_test.py b/tests/samplebinding/multi_cpp_inheritance_test.py
index 13f2e769..79f28c19 100755
--- a/tests/samplebinding/multi_cpp_inheritance_test.py
+++ b/tests/samplebinding/multi_cpp_inheritance_test.py
@@ -36,6 +36,11 @@ class SimpleUseCase(ObjectType, Str):
ObjectType.__init__(self)
Str.__init__(self, name)
+class SimpleUseCaseReverse(Str, ObjectType):
+ def __init__(self, name):
+ ObjectType.__init__(self)
+ Str.__init__(self, name)
+
class SimpleUseCase2(SimpleUseCase):
def __init__(self, name):
SimpleUseCase.__init__(self, name)
@@ -45,6 +50,11 @@ class ComplexUseCase(SimpleUseCase2, Point):
SimpleUseCase2.__init__(self, name)
Point.__init__(self)
+class ComplexUseCaseReverse(Point, SimpleUseCase2):
+ def __init__(self, name):
+ SimpleUseCase2.__init__(self, name)
+ Point.__init__(self)
+
class MultipleCppDerivedTest(unittest.TestCase):
def testInstanciation(self):
s = SimpleUseCase("Hi")
@@ -66,5 +76,25 @@ class MultipleCppDerivedTest(unittest.TestCase):
c.setX(2);
self.assertEqual(c.x(), 2)
+class MultipleCppDerivedReverseTest(unittest.TestCase):
+ def testInstanciation(self):
+ s = SimpleUseCaseReverse("Hi")
+ self.assertEqual(s, "Hi")
+ s.setObjectName(s)
+ self.assertEqual(s.objectName(), "Hi")
+
+ def testInstanciation2(self):
+ s = SimpleUseCase2("Hi")
+ self.assertEqual(s, "Hi")
+ s.setObjectName(s)
+ self.assertEqual(s.objectName(), "Hi")
+
+ def testComplexInstanciation(self):
+ c = ComplexUseCaseReverse("Hi")
+ c.setObjectName(c)
+ self.assertEqual(c.objectName(), "Hi")
+ c.setX(2);
+ self.assertEqual(c, Point(2, 0))
+
if __name__ == '__main__':
unittest.main()