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 Issue #22060: Clean up/simplify test_ctypes, use test discovery 2014-08-08 13:32:16 -05:00
__main__.py Issue #22060: Clean up/simplify test_ctypes, use test discovery 2014-08-08 13:32:16 -05:00
test_anon.py
test_array_in_pointer.py
test_arrays.py Issue #19023: Document ctypes array and pointer classes 2016-01-29 10:12:19 +00:00
test_as_parameter.py Issue #19235: Add new RecursionError exception. Patch by Georg Brandl. 2015-07-03 01:04:23 -04:00
test_bitfields.py Issue #27355: Removed support for Windows CE. It was never finished, 2016-09-05 15:11:23 -07:00
test_buffers.py Issue #22161: Conformed arguments type checks in ctype to actually supported 2014-08-09 09:33:05 +03:00
test_bytes.py Issue #22161: Conformed arguments type checks in ctype to actually supported 2014-08-09 09:33:05 +03:00
test_byteswap.py Issue #22098: ctypes' BigEndianStructure and LittleEndianStructure now define an empty __slots__ so that subclasses don't always get an instance dict. 2014-08-30 00:37:18 +02:00
test_callbacks.py Fixed bpo-29565: Corrected ctypes passing of large structs by value on Windows AMD64. (#168) (#220) 2017-02-22 06:21:17 +00:00
test_cast.py
test_cfuncs.py
test_checkretval.py
test_delattr.py
test_errno.py
test_find.py Merge test cleanup from 3.5 into 3.6 2016-09-29 04:40:56 +00:00
test_frombuffer.py Issue #25659: Change assert to TypeError in from_buffer/_copy() 2016-11-20 07:58:35 +00:00
test_funcptr.py Issue #27355: Import no longer needed 2016-09-06 02:18:16 +00:00
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 Issue #27626: Spelling fixes in docs, comments and internal names 2016-07-28 01:11:04 +00:00
test_objects.py Issue #23277: Remove unused sys and os imports 2016-04-24 07:31:42 +03:00
test_parameters.py Issue #23277: Remove unused imports in tests. 2016-04-24 21:41:02 +03:00
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 Issue #22777: Test pickling with all protocols. 2014-12-15 14:03:42 +02:00
test_pointers.py Issue #19023: Document ctypes array and pointer classes 2016-01-29 10:12:19 +00:00
test_prototypes.py #22732 ctypes tests don't set correct restype for intptr_t functions 2014-11-01 15:14:27 -07:00
test_python_api.py Issue #22060: Clean up/simplify test_ctypes, use test discovery 2014-08-08 13:32:16 -05:00
test_random_things.py Issue #25523: Further a-to-an corrections. 2015-11-02 14:10:23 +02:00
test_refcounts.py
test_repr.py
test_returnfuncptrs.py Issue #23277: Remove unused sys and os imports 2016-04-24 07:31:42 +03:00
test_simplesubclasses.py
test_sizes.py Issue #23277: Remove unused sys and os imports 2016-04-24 07:31:42 +03:00
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 bpo-29845: Mark tests that use _testcapi as CPython-only (#711) (#725) 2017-03-19 20:53:42 +02:00
test_unaligned_structures.py
test_unicode.py
test_values.py Issue #26647: Python interpreter now uses 16-bit wordcode instead of bytecode. 2016-05-24 09:15:14 +03:00
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