Test failure: test_array_type on cffi 0.8.6 / FreeBSD

Issue #178 closed
Kubilay Kocak
created an issue
platform freebsd9 -- Python 2.7.9 -- py-1.4.23 -- pytest-2.6.1

<snip>

    def test_array_type():
        p = new_primitive_type("int")
        assert repr(p) == "<ctype 'int'>"
        #
        py.test.raises(TypeError, new_array_type, new_pointer_type(p), "foo")
        py.test.raises(ValueError, new_array_type, new_pointer_type(p), -42)
        #
        p1 = new_array_type(new_pointer_type(p), None)
        assert repr(p1) == "<ctype 'int[]'>"
        py.test.raises(ValueError, new_array_type, new_pointer_type(p1), 42)
        #
        p1 = new_array_type(new_pointer_type(p), 42)
        p2 = new_array_type(new_pointer_type(p1), 25)
        assert repr(p2) == "<ctype 'int[25][42]'>"
        p2 = new_array_type(new_pointer_type(p1), None)
        assert repr(p2) == "<ctype 'int[][42]'>"
        #
        py.test.raises(OverflowError,
                       new_array_type, new_pointer_type(p), sys.maxsize+1)
        py.test.raises(OverflowError,
>                      new_array_type, new_pointer_type(p), sys.maxsize // 3)
E       Failed: DID NOT RAISE

c/test_c.py:477: Failed

1 failed, 1033 passed, 80 skipped in 74.36 seconds

Comments (2)

  1. Armin Rigo

    Sorry, no clue why it wouldn't raise OverflowError, and only on FreeBSD. You need to use gdb to follow it step by step. I don't have access to FreeBSD so unless you (or someone else) also give a diagnostic it will remain unfixed.

  2. Log in to comment