[pypy-commit] cffi default: Add a test
arigo
noreply at buildbot.pypy.org
Sat Jul 7 12:26:28 CEST 2012
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r585:614d1fdd77d3
Date: 2012-07-07 12:26 +0200
http://bitbucket.org/cffi/cffi/changeset/614d1fdd77d3/
Log: Add a test
diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -1303,3 +1303,9 @@
pp[0] = p
s = pp[0][0]
assert repr(s).startswith("<cdata 'struct foo' 0x")
+
+def test_owning_repr():
+ BInt = new_primitive_type("int")
+ BArray = new_array_type(new_pointer_type(BInt), None) # int[]
+ p = newp(BArray, 7)
+ assert repr(p) == "<cdata 'int[]' owning 28 bytes>"
More information about the pypy-commit
mailing list