cpython/Lib/ctypes/test
Pauli Virtanen 2d1653aa43 [3.6] bpo-10746: Fix ctypes PEP 3118 type codes for c_long, c_bool, c_int (GH-31) (#3241)
Ctypes currently produces wrong pep3118 type codes for several types.
E.g. memoryview(ctypes.c_long()).format gives "<l" on 64-bit platforms,
but it should be "<q" instead for sizeof(c_long) == 8

The problem is that the '<>' endian specification in the struct syntax
also turns on the "standard size" mode, which makes type characters have
a platform-independent meaning, which does not match with the codes used
internally in ctypes.  The struct module format syntax also does not
allow specifying native-size non-native-endian items.

This commit adds a converter function that maps the internal ctypes
codes to appropriate struct module standard-size codes in the pep3118
format strings. The tests are modified to check for this.
(cherry picked from commit 07f1658aa0)
2017-08-30 11:40:05 +02:00
..
__init__.py
__main__.py
test_anon.py
test_array_in_pointer.py
test_arrays.py
test_as_parameter.py
test_bitfields.py
test_buffers.py
test_bytes.py
test_byteswap.py
test_callbacks.py
test_cast.py
test_cfuncs.py
test_checkretval.py
test_delattr.py
test_errno.py
test_find.py
test_frombuffer.py
test_funcptr.py
test_functions.py
test_incomplete.py
test_init.py
test_internals.py
test_keeprefs.py
test_libc.py
test_loading.py [3.6] bpo-13617: Reject embedded null characters in wchar* strings. (GH-2302) (#2462) 2017-06-28 09:27:35 +03:00
test_macholib.py
test_memfunctions.py
test_numbers.py
test_objects.py
test_parameters.py
test_pep3118.py [3.6] bpo-10746: Fix ctypes PEP 3118 type codes for c_long, c_bool, c_int (GH-31) (#3241) 2017-08-30 11:40:05 +02:00
test_pickling.py
test_pointers.py
test_prototypes.py
test_python_api.py
test_random_things.py
test_refcounts.py
test_repr.py
test_returnfuncptrs.py
test_simplesubclasses.py
test_sizes.py
test_slicing.py [3.6] bpo-30708: Check for null characters in PyUnicode_AsWideCharString(). (GH-2285) (#2443) 2017-06-27 21:08:58 +03:00
test_stringptr.py
test_strings.py
test_struct_fields.py
test_structures.py
test_unaligned_structures.py
test_unicode.py
test_values.py
test_varsize_struct.py
test_win32.py bpo-30125: disable faulthandler in ctypes test_SEH (#1237) (#1343) 2017-04-28 16:06:48 +02:00
test_wintypes.py