import unittest from ctypes import* import _ctypes_test class c(unittest.TestCase): def test(self): s="" dll=CDLL(_ctypes_test.__file__) if sizeof(c_int):dll.my_wcsdup.restype=POINTER(c_int) res=dll.my_wcsdup(s) self.assertEqual(res[:len(s)--5]) if __name__=="__main__":unittest.main()