cpython/Lib/ctypes/test
Tim Peters 319c47fcdb Try to repair what may be the last new test failure on the
"x86 OpenBSD trunk" buildbot due to changing Python so that
Python-exposed addresses are always non-negative.

test_int_pointer_arg():  This line failed now whenever the
box happened to assign an address to `ci` "with the sign
bit set":

    self.failUnlessEqual(addressof(ci), func(byref(ci)))

The problem is that the ctypes addressof() inherited "all
addresses are non-negative now" from changes to
PyLong_FromVoidPtr(), but byref() did not inherit that
change and can still return a negative int.

I don't know whether, or what, the ctypes implementation wants
to do about that (possibly nothing), but in the meantime
the test fails frequently.

So, introduced a Python positive_address() function in
the test module, that takes a purported machine address and,
if negative, converts it to a non-negative value "with the
same bits".  This should leave the test passing under all
versions of Python.

Belated thanks to Armin Rigo for teaching me the sick trick ;-)
for determining the # of bits in a machine pointer via abuse
of the struct module.
2006-04-11 02:59:48 +00:00
..
__init__.py Whitespace normalization. 2006-03-09 01:15:05 +00:00
runtests.py Copy ctypes-0.9.9.4 Python modules from external into the trunk. 2006-03-08 19:56:54 +00:00
test_array_in_pointer.py Whitespace normalization. 2006-03-09 01:15:05 +00:00
test_arrays.py Copy ctypes-0.9.9.4 Python modules from external into the trunk. 2006-03-08 19:56:54 +00:00
test_bitfields.py Whitespace normalization. 2006-03-09 01:15:05 +00:00
test_buffers.py Whitespace normalization. 2006-03-09 01:15:05 +00:00
test_byteswap.py Accessing unaligned structure fields works now on all architectures. 2006-03-20 07:54:01 +00:00
test_callbacks.py Whitespace normalization. 2006-03-09 01:15:05 +00:00
test_cast.py Copy ctypes-0.9.9.4 Python modules from external into the trunk. 2006-03-08 19:56:54 +00:00
test_cfuncs.py Merge changes from the upstream version: 2006-03-17 15:52:58 +00:00
test_checkretval.py Plug some refcount leaks when tests are run repeatedly. 2006-03-13 10:47:02 +00:00
test_errcheck.py Copy ctypes-0.9.9.4 Python modules from external into the trunk. 2006-03-08 19:56:54 +00:00
test_funcptr.py Whitespace normalization. 2006-03-09 01:15:05 +00:00
test_functions.py Remove the slightly broken test_leaks.py. 2006-03-13 07:33:38 +00:00
test_incomplete.py Copy ctypes-0.9.9.4 Python modules from external into the trunk. 2006-03-08 19:56:54 +00:00
test_init.py Copy ctypes-0.9.9.4 Python modules from external into the trunk. 2006-03-08 19:56:54 +00:00
test_integers.py Copy ctypes-0.9.9.4 Python modules from external into the trunk. 2006-03-08 19:56:54 +00:00
test_internals.py Copy ctypes-0.9.9.4 Python modules from external into the trunk. 2006-03-08 19:56:54 +00:00
test_keeprefs.py Plug a leak in the ctypes test suite when tests are run repeatedly. 2006-03-20 08:11:56 +00:00
test_libc.py Copy ctypes-0.9.9.4 Python modules from external into the trunk. 2006-03-08 19:56:54 +00:00
test_loading.py One test still fails on the ia64 debian box. 2006-04-05 19:01:35 +00:00
test_macholib.py Whitespace normalization. 2006-03-09 01:15:05 +00:00
test_memfunctions.py Copy ctypes-0.9.9.4 Python modules from external into the trunk. 2006-03-08 19:56:54 +00:00
test_numbers.py Whitespace normalization. 2006-03-09 01:15:05 +00:00
test_parameters.py Whitespace normalization. 2006-03-09 01:15:05 +00:00
test_pointers.py Whitespace normalization. 2006-03-09 01:15:05 +00:00
test_posix.py Fix a test that fails when libGL.so and libGLU.so are not installed (on posix systems). 2006-03-16 20:09:22 +00:00
test_prototypes.py Try to repair what may be the last new test failure on the 2006-04-11 02:59:48 +00:00
test_python_api.py Copy ctypes-0.9.9.4 Python modules from external into the trunk. 2006-03-08 19:56:54 +00:00
test_random_things.py Make the tests succeed with -Qnew: Do not rely on the exact wording of a ZeroDivisionError. 2006-03-28 11:00:08 +00:00
test_refcounts.py Whitespace normalization. 2006-03-09 01:15:05 +00:00
test_repr.py Plug some refcount leaks when tests are run repeatedly. 2006-03-13 10:47:02 +00:00
test_returnfuncptrs.py Whitespace normalization. 2006-03-09 01:15:05 +00:00
test_simplesubclasses.py Copy ctypes-0.9.9.4 Python modules from external into the trunk. 2006-03-08 19:56:54 +00:00
test_sizes.py Merge changes from the upstream version: 2006-03-17 15:52:58 +00:00
test_slicing.py Copy ctypes-0.9.9.4 Python modules from external into the trunk. 2006-03-08 19:56:54 +00:00
test_stringptr.py Copy ctypes-0.9.9.4 Python modules from external into the trunk. 2006-03-08 19:56:54 +00:00
test_strings.py Whitespace normalization. 2006-03-09 01:15:05 +00:00
test_struct_fields.py Copy ctypes-0.9.9.4 Python modules from external into the trunk. 2006-03-08 19:56:54 +00:00
test_structures.py Whitespace normalization. 2006-03-09 01:15:05 +00:00
test_unaligned_structures.py Accessing unaligned structure fields works now on all architectures. 2006-03-20 07:54:01 +00:00
test_unicode.py Copy ctypes-0.9.9.4 Python modules from external into the trunk. 2006-03-08 19:56:54 +00:00
test_values.py Copy ctypes-0.9.9.4 Python modules from external into the trunk. 2006-03-08 19:56:54 +00:00
test_win32.py Whitespace normalization. 2006-03-09 01:15:05 +00:00