diff options
author | Matti Airas <matti.p.airas@nokia.com> | 2010-03-17 17:09:15 -0300 |
---|---|---|
committer | Matti Airas <matti.p.airas@nokia.com> | 2010-03-17 17:09:15 -0300 |
commit | 21bcdc289ba9ece35780369a5e86a68498a6ddae (patch) | |
tree | ad2a151f4f810eb8a6e8fc96acb994b3e202cae4 /tests/samplebinding | |
parent | f9b62c6a5b3f7232bb00a5ab39fd8037fc9c7d81 (diff) |
added support for pure virtual methods returning void ptrs
the return statements now have correct values for pure virtual methods
returning void pointers. also added a dummy test for this (can't really
test it properly until the semantics of casting the python return value
into a void pointer is properly defined -- if ever).
Diffstat (limited to 'tests/samplebinding')
-rwxr-xr-x | tests/samplebinding/abstract_test.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/samplebinding/abstract_test.py b/tests/samplebinding/abstract_test.py index 2488c6542..6c2f43f41 100755 --- a/tests/samplebinding/abstract_test.py +++ b/tests/samplebinding/abstract_test.py @@ -44,6 +44,9 @@ class Concrete(Abstract): def pureVirtual(self): self.pure_virtual_called = True + def pureVirtualReturningVoidPtr(self): + return 42 + def unpureVirtual(self): self.unpure_virtual_called = True @@ -67,6 +70,14 @@ class AbstractTest(unittest.TestCase): i = Incomplete() self.assertRaises(NotImplementedError, i.pureVirtual) + def testPureVirtualReturningVoidPtrReturnValue(self): + '''Test if a pure virtual method returning void ptr can be properly reimplemented''' + # Note that the semantics of reimplementing the pure virtual method in + # Python and calling it from C++ is undefined until it's decided how to + # cast the Python data types to void pointers + c = Concrete() + self.assertEqual(c.pureVirtualReturningVoidPtr(),42) + def testReimplementedVirtualMethodCall(self): '''Test if instanciation of an abstract class raises the correct exception.''' i = Concrete() |