• Tim Peters's avatar
    Try to repair what may be the last new test failure on the · 319c47fc
    Tim Peters yazdı
    "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.
    319c47fc
Adı
Son kayıt (commit)
Son güncelleme
..
__init__.py Loading commit data...
runtests.py Loading commit data...
test_array_in_pointer.py Loading commit data...
test_arrays.py Loading commit data...
test_bitfields.py Loading commit data...
test_buffers.py Loading commit data...
test_byteswap.py Loading commit data...
test_callbacks.py Loading commit data...
test_cast.py Loading commit data...
test_cfuncs.py Loading commit data...
test_checkretval.py Loading commit data...
test_errcheck.py Loading commit data...
test_funcptr.py Loading commit data...
test_functions.py Loading commit data...
test_incomplete.py Loading commit data...
test_init.py Loading commit data...
test_integers.py Loading commit data...
test_internals.py Loading commit data...
test_keeprefs.py Loading commit data...
test_libc.py Loading commit data...
test_loading.py Loading commit data...
test_macholib.py Loading commit data...
test_memfunctions.py Loading commit data...
test_numbers.py Loading commit data...
test_parameters.py Loading commit data...
test_pointers.py Loading commit data...
test_posix.py Loading commit data...
test_prototypes.py Loading commit data...
test_python_api.py Loading commit data...
test_random_things.py Loading commit data...
test_refcounts.py Loading commit data...
test_repr.py Loading commit data...
test_returnfuncptrs.py Loading commit data...
test_simplesubclasses.py Loading commit data...
test_sizes.py Loading commit data...
test_slicing.py Loading commit data...
test_stringptr.py Loading commit data...
test_strings.py Loading commit data...
test_struct_fields.py Loading commit data...
test_structures.py Loading commit data...
test_unaligned_structures.py Loading commit data...
test_unicode.py Loading commit data...
test_values.py Loading commit data...
test_win32.py Loading commit data...