Author: Armin Rigo <[email protected]>
Branch:
Changeset: r89377:4927aa24cb71
Date: 2017-01-05 14:53 +0100
http://bitbucket.org/pypy/pypy/changeset/4927aa24cb71/
Log: Update to latest cffi's test_c.py
diff --git a/pypy/module/_cffi_backend/test/_backend_test_c.py
b/pypy/module/_cffi_backend/test/_backend_test_c.py
--- a/pypy/module/_cffi_backend/test/_backend_test_c.py
+++ b/pypy/module/_cffi_backend/test/_backend_test_c.py
@@ -3419,17 +3419,22 @@
BCharA = new_array_type(BCharP, None)
p1 = from_buffer(BCharA, b"foo")
assert p1 == from_buffer(BCharA, b"foo")
+ import gc; gc.collect()
+ assert p1 == from_buffer(BCharA, b"foo")
py.test.raises(TypeError, from_buffer, BCharA, u+"foo")
try:
from __builtin__ import buffer
except ImportError:
pass
else:
+ # Python 2 only
contents = from_buffer(BCharA, buffer(b"foo"))
+ assert len(contents) == len(p1)
for i in range(len(contents)):
assert contents[i] == p1[i]
- p4 = from_buffer(BCharA, b"f\x00\x00\x00o\x00\x00\x00o\x00\x00\x00")
+ p4 = buffer(u+"foo")
contents = from_buffer(BCharA, buffer(u+"foo"))
+ assert len(contents) == len(p4)
for i in range(len(contents)):
assert contents[i] == p4[i]
try:
@@ -3438,6 +3443,7 @@
pass
else:
contents = from_buffer(BCharA, memoryview(b"foo"))
+ assert len(contents) == len(p1)
for i in range(len(contents)):
assert contents[i] == p1[i]
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit