aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-08-03 10:47:58 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-08-03 11:07:25 -0300
commitf2532a7fff116cb825f99b0d6c4032fe054dfde5 (patch)
tree468f2695070aa2d556fab54698c3ecf1fe70d5b1 /tests
parentce4b5f535f43bd2ff800b709f88c6f9c5be68003 (diff)
Added a case for VoidHolder test that uses a native Python object.
The test stores a native Python object as a void pointer in C++ and takes it back.
Diffstat (limited to 'tests')
-rw-r--r--tests/samplebinding/voidholder_test.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/samplebinding/voidholder_test.py b/tests/samplebinding/voidholder_test.py
index a6fce2e0..a350bfee 100644
--- a/tests/samplebinding/voidholder_test.py
+++ b/tests/samplebinding/voidholder_test.py
@@ -40,7 +40,7 @@ class VoidHolderTest(unittest.TestCase):
self.assertEquals(voidptr, voidholder.voidPointer())
def testPutRandomObjectInsideVoidHolder(self):
- '''Passes a C++ pointer for an object created in Python to be kept VoidHolder.'''
+ '''Passes a C++ pointer for an object created in Python to be kept by VoidHolder.'''
obj = Point(1, 2)
voidholder = VoidHolder(obj)
self.assertEquals(obj, voidholder.voidPointer())
@@ -51,6 +51,14 @@ class VoidHolderTest(unittest.TestCase):
voidholder = VoidHolder()
self.assertEquals(voidholder.voidPointer(), None)
+ def testPutPythonObjectInsideVoidHolder(self):
+ '''Passes a native Python object to be kept by VoidHolder.'''
+ obj = 'Foo'
+ voidholder = VoidHolder(obj)
+ self.assertEquals(obj, voidholder.voidPointer())
+
+
+
if __name__ == '__main__':
unittest.main()