4
################################################################
6
# The incomplete pointer example from the tutorial
9
class MyTestCase(unittest.TestCase):
11
def test_incomplete_example(self):
12
lpcell = POINTER("cell")
13
class cell(Structure):
14
_fields_ = [("name", c_char_p),
17
SetPointerType(lpcell, cell)
33
self.failUnlessEqual(result, ["foo", "bar"] * 4)
35
# to not leak references, we must clean _pointer_type_cache
36
from ctypes import _pointer_type_cache
37
del _pointer_type_cache[cell]
39
################################################################
41
if __name__ == '__main__':