summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.lima@openbossa.org>2010-04-08 14:26:46 -0300
committerHugo Parente Lima <hugo.lima@openbossa.org>2010-04-08 18:37:51 -0300
commit0650666ccfe1ac83b20a4ffffa1d8b61669c2dd8 (patch)
treea3fba95fd0b960c9fe2b4cf35f33bb0db081b5c7
parentf06b4c2dd7b07482c5c465935fccfb56a7f3285b (diff)
downloadshiboken-0650666ccfe1ac83b20a4ffffa1d8b61669c2dd8.tar.gz
shiboken-0650666ccfe1ac83b20a4ffffa1d8b61669c2dd8.tar.xz
shiboken-0650666ccfe1ac83b20a4ffffa1d8b61669c2dd8.zip
Add another test case to multi_cpp_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()