[pypy-commit] cffi cpy-extension: Bah, to fix this test it's actually enough to add parentheses

arigo noreply at buildbot.pypy.org
Wed Jun 13 21:45:32 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: cpy-extension
Changeset: r313:a964b08b9f82
Date: 2012-06-13 21:45 +0200
http://bitbucket.org/cffi/cffi/changeset/a964b08b9f82/

Log:	Bah, to fix this test it's actually enough to add parentheses around
	the C declaration.

diff --git a/cffi/verifier.py b/cffi/verifier.py
--- a/cffi/verifier.py
+++ b/cffi/verifier.py
@@ -265,9 +265,11 @@
                 # accept all integers, but complain on float or double
                 prnt('  (p->%s) << 1;' % fname)
             else:
-                # only accept exactly the type declared
+                # only accept exactly the type declared.  Note the parentheses
+                # around the '*tmp' below.  In most cases they are not needed
+                # but don't hurt --- except test_struct_array_field.
                 prnt('  { %s = &p->%s; }' % (
-                    ftype.get_c_name(' *tmp'), fname))
+                    ftype.get_c_name('(*tmp)'), fname))
         prnt('}')
         prnt()
 
diff --git a/testing/test_verify.py b/testing/test_verify.py
--- a/testing/test_verify.py
+++ b/testing/test_verify.py
@@ -212,7 +212,6 @@
             _check_field_match(typename, real, expect_mismatch=True)
 
 def test_struct_array_field():
-    py.test.skip("in-progress")
     ffi = FFI()
     ffi.cdef("struct foo_s { int a[17]; ...; };")
     ffi.verify("struct foo_s { int x; int a[17]; int y; };")


More information about the pypy-commit mailing list