[pypy-commit] creflect default: uncomment these tests, now passing

arigo noreply at buildbot.pypy.org
Fri Dec 5 19:46:04 CET 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r178:a3463cd2c8f0
Date: 2014-12-05 19:46 +0100
http://bitbucket.org/cffi/creflect/changeset/a3463cd2c8f0/

Log:	uncomment these tests, now passing

diff --git a/zeffir/test/struct.crx b/zeffir/test/struct.crx
--- a/zeffir/test/struct.crx
+++ b/zeffir/test/struct.crx
@@ -5,7 +5,8 @@
 
 typedef struct {
     int foo[5];
-    //int bar[];
+    int bar[7];
+    int baz[];
 } myarrstr_t;
 
 
@@ -17,7 +18,8 @@
 
 typedef struct {
     int foo[5];
-    //int bar[];
+    int bar[];
+    int baz[];
 } myarrstr_t;
 
 // CREFLECT: end
diff --git a/zeffir/test/test_struct.py b/zeffir/test/test_struct.py
--- a/zeffir/test/test_struct.py
+++ b/zeffir/test/test_struct.py
@@ -32,9 +32,12 @@
     py.test.raises(TypeError, ffi.addressof, p, None)
     #
     p = ffi.new("myarrstr_t *")
+    assert ffi.typeof(p.foo) == ffi.typeof("int[5]")
+    assert ffi.typeof(p.bar) == ffi.typeof("int *")
+    assert ffi.typeof(p.baz) == ffi.typeof("int *")
     assert ffi.typeof(ffi.addressof(p, "foo")) == ffi.typeof("int(*)[5]")
-    assert ffi.typeof(p.foo) == ffi.typeof("int[5]")
-    #assert ffi.typeof(ffi.addressof(p, "bar")) == ffi.typeof("int(*)[]")
+    assert ffi.typeof(ffi.addressof(p, "bar")) == ffi.typeof("int(*)[]")
+    assert ffi.typeof(ffi.addressof(p, "baz")) == ffi.typeof("int(*)[]")
 
 def test_new_nonptr_struct():
     ffi, lib = support.compile_and_open('struct')


More information about the pypy-commit mailing list