1from PyObjCTools.TestSupport import *
2import objc
3from PyObjCTest.structpointer2 import *
4from PyObjCTest.structpointer1 import *
5
6class TestOpaqueStructPointer (TestCase):
7    def testPointer(self):
8
9        # Check that the TestPointerStructPtr has a signature that is
10        # different from the one in the method definition. The latter contains
11        # more information.
12        retval = objc.splitSignature(
13                OC_TestStructPointer.returnPointerToStruct.signature)[0]
14        self.assertNotEqual(TestStructPointerStructPtr.__typestr__, retval)
15
16        # And then check that the correct pointer wrapper is created
17        v = OC_TestStructPointer.returnPointerToStruct()
18        self.assertIsInstance(v, TestStructPointerStructPtr)
19
20if __name__ == "__main__":
21    main()
22