#22732 ctypes tests don't set correct restype for intptr_t functions

This commit is contained in:
Steve Dower 2014-11-01 15:14:27 -07:00
parent 86e9deb5aa
commit 53683965aa
2 changed files with 8 additions and 2 deletions

View file

@ -24,6 +24,9 @@ class PointersTestCase(unittest.TestCase):
def test_pass_pointers(self): def test_pass_pointers(self):
dll = CDLL(_ctypes_test.__file__) dll = CDLL(_ctypes_test.__file__)
func = dll._testfunc_p_p func = dll._testfunc_p_p
if sizeof(c_longlong) == sizeof(c_void_p):
func.restype = c_longlong
else:
func.restype = c_long func.restype = c_long
i = c_int(12345678) i = c_int(12345678)

View file

@ -69,6 +69,9 @@ class CharPointersTestCase(unittest.TestCase):
def test_int_pointer_arg(self): def test_int_pointer_arg(self):
func = testdll._testfunc_p_p func = testdll._testfunc_p_p
if sizeof(c_longlong) == sizeof(c_void_p):
func.restype = c_longlong
else:
func.restype = c_long func.restype = c_long
self.assertEqual(0, func(0)) self.assertEqual(0, func(0))