ctypes_tests.test_functions:test_issue1655
dll = <[TypeError("unsupported operand type(s) for &: '_rawffi.alt.CDLL' and 'int'") raised in repr()] CDLL object at 0xc029090>
def test_issue1655(dll):
def ret_list_p(icount):
def sz_array_p(obj, func, args):
assert ('.LP_c_int object' in repr(obj) or
'.LP_c_long object' in repr(obj))
assert repr(args) =="(b'testing!', c_int(4))"
assert args[icount].value == 4
return [obj[i] for i in range(args[icount].value)]
return sz_array_p
get_data_prototype = CFUNCTYPE(POINTER(c_int),
c_char_p, POINTER(c_int))
get_data_paramflag = ((1,), (2,))
get_data_signature = ('test_issue1655', dll)
get_data = get_data_prototype(get_data_signature, get_data_paramflag)
assert get_data(b'testing!') == 4
get_data.errcheck = ret_list_p(1)
> assert get_data(b'testing!') == [-1, -2, -3, -4]
../build/extra_tests/ctypes_tests/test_functions.py:219:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../build/lib_pypy/_ctypes/function.py:380: in __call__
result, forced = self._do_errcheck(result, errcheckargs)
../build/lib_pypy/_ctypes/function.py:424: in _do_errcheck
v = self._errcheck_(result, self, args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
obj = <_ctypes.pointer.LP_c_long object at 0xf2c2c8d0>
func = <ctypes.CFUNCTYPE.<locals>.CFunctionType object at 0xf2c2c930>
args = (b'testing!', c_long(4))
def sz_array_p(obj, func, args):
assert ('.LP_c_int object' in repr(obj) or
'.LP_c_long object' in repr(obj))
> assert repr(args) =="(b'testing!', c_int(4))"
E assert "(b'testing!', c_long(4))" == "(b'testing!', c_int(4))"
E - (b'testing!', c_int(4))
E ? ^ ^
E + (b'testing!', c_long(4))
E ? ^^ ^
../build/extra_tests/ctypes_tests/test_functions.py:205: AssertionError
builder: pypy-c-jit-linux-x86-32 build #8379+
test: ctypes_tests.test_functions:test_issue1655