summaryrefslogtreecommitdiff
path: root/c
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2020-12-21 09:17:45 +0100
committerArmin Rigo <arigo@tunes.org>2020-12-21 09:17:45 +0100
commit7053b16654b881a846ee1b4e8f68dcd41b40fb90 (patch)
tree44fbf15ed935e4696154cc206a722bc310d5009c /c
parent58c2520cf1b3910f5f755747088a9f7ca0240543 (diff)
downloadcffi-7053b16654b881a846ee1b4e8f68dcd41b40fb90.tar.gz
A test that passes on CPython but fails on PyPy
Diffstat (limited to 'c')
-rw-r--r--c/test_c.py9
1 files changed, 9 insertions, 0 deletions
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)