Home - Summaries: (main) : (py3.11) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

cffi_tests.cffi0.test_verify:test_varargs

def test_varargs():
        ffi = FFI()
        ffi.cdef("int foo(int x, ...);")
        lib = ffi.verify("""
            int foo(int x, ...) {
                va_list vargs;
                va_start(vargs, x);
                x -= va_arg(vargs, int);
                x -= va_arg(vargs, int);
                va_end(vargs);
                return x;
            }
        """)
>       assert lib.foo(50, ffi.cast("int", 5), ffi.cast("int", 3)) == 42
E       AssertionError: assert 50 == 42
E        +  where 50 = <cdata 'int(*)(int, ...)' 0x10badbf70>(50, <cdata 'int' 5>, <cdata 'int' 3>)
E        +    where <cdata 'int(*)(int, ...)' 0x10badbf70> = <module ''>.foo
E        +    and   <cdata 'int' 5> = <bound method FFI.cast of <extra_tests.cffi_tests.cffi0.test_verify.FFI object at 0x0000000141a40d08>>('int', 5)
E        +      where <bound method FFI.cast of <extra_tests.cffi_tests.cffi0.test_verify.FFI object at 0x0000000141a40d08>> = <extra_tests.cffi_tests.cffi0.test_verify.FFI object at 0x0000000141a40d08>.cast
E        +    and   <cdata 'int' 3> = <bound method FFI.cast of <extra_tests.cffi_tests.cffi0.test_verify.FFI object at 0x0000000141a40d08>>('int', 3)
E        +      where <bound method FFI.cast of <extra_tests.cffi_tests.cffi0.test_verify.FFI object at 0x0000000141a40d08>> = <extra_tests.cffi_tests.cffi0.test_verify.FFI object at 0x0000000141a40d08>.cast

../build/extra_tests/cffi_tests/cffi0/test_verify.py:1051: AssertionError
builder: pypy-c-jit-macos-arm64 build #1295+
test: cffi_tests.cffi0.test_verify:test_varargs