From 7053b16654b881a846ee1b4e8f68dcd41b40fb90 Mon Sep 17 00:00:00 2001 From: Armin Rigo Date: Mon, 21 Dec 2020 09:17:45 +0100 Subject: A test that passes on CPython but fails on PyPy --- c/test_c.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'c') diff --git a/c/test_c.py b/c/test_c.py index d039edf..7880703 100644 --- a/c/test_c.py +++ b/c/test_c.py @@ -3974,6 +3974,15 @@ def test_from_buffer_types(): with pytest.raises(ValueError): release(pv[0]) +def test_issue483(): + BInt = new_primitive_type("int") + BIntP = new_pointer_type(BInt) + BIntA = new_array_type(BIntP, None) + lst = list(range(25)) + bytestring = bytearray(buffer(newp(BIntA, lst))[:] + b'XYZ') + p1 = from_buffer(BIntA, bytestring) # int[] + assert sizeof(p1) == 25 * size_of_int() + def test_memmove(): Short = new_primitive_type("short") ShortA = new_array_type(new_pointer_type(Short), None) -- cgit v1.2.1