diff options
author | R David Murray <rdmurray@bitdance.com> | 2014-10-12 17:56:37 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2014-10-12 17:56:37 (GMT) |
commit | 97551744640e9fa855ace8b4d667c4e777cc2913 (patch) | |
tree | b611eb878757153cd64db4db791da2068e92878f /Lib/ctypes | |
parent | 0f032a0456da250feb0c1fbff79fd057568184f8 (diff) | |
parent | 817905b2393b03e035d2bbfc8d92b7bbeaddb118 (diff) | |
download | cpython-97551744640e9fa855ace8b4d667c4e777cc2913.zip cpython-97551744640e9fa855ace8b4d667c4e777cc2913.tar.gz cpython-97551744640e9fa855ace8b4d667c4e777cc2913.tar.bz2 |
Merge: #13096: Fix segfault in CTypes POINTER handling of large values.
Diffstat (limited to 'Lib/ctypes')
-rw-r--r-- | Lib/ctypes/test/test_pointers.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/ctypes/test/test_pointers.py b/Lib/ctypes/test/test_pointers.py index f8ef0ab..4cd3a7a 100644 --- a/Lib/ctypes/test/test_pointers.py +++ b/Lib/ctypes/test/test_pointers.py @@ -7,6 +7,8 @@ ctype_types = [c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, c_long, c_ulong, c_longlong, c_ulonglong, c_double, c_float] python_types = [int, int, int, int, int, int, int, int, int, int, float, float] +LargeNamedType = type('T' * 2 ** 25, (Structure,), {}) +large_string = 'T' * 2 ** 25 class PointersTestCase(unittest.TestCase): @@ -188,5 +190,11 @@ class PointersTestCase(unittest.TestCase): mth = WINFUNCTYPE(None)(42, "name", (), None) self.assertEqual(bool(mth), True) + def test_pointer_type_name(self): + self.assertTrue(POINTER(LargeNamedType)) + + def test_pointer_type_str_name(self): + self.assertTrue(POINTER(large_string)) + if __name__ == '__main__': unittest.main() |