[pypy-commit] cffi cffi-1.0: test and fix

arigo noreply at buildbot.pypy.org
Tue May 12 16:14:42 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: cffi-1.0
Changeset: r1996:affd940b95da
Date: 2015-05-12 16:15 +0200
http://bitbucket.org/cffi/cffi/changeset/affd940b95da/

Log:	test and fix

diff --git a/cffi/recompiler.py b/cffi/recompiler.py
--- a/cffi/recompiler.py
+++ b/cffi/recompiler.py
@@ -921,7 +921,7 @@
         else:
             size = 0
         self._lsts["global"].append(
-            GlobalExpr(name, '&%s' % name, type_op, size))
+            GlobalExpr(name, '&%s' % name, type_op, size, 0))
 
     # ----------
     # emitting the opcodes for individual types
diff --git a/testing/cffi1/test_dlopen.py b/testing/cffi1/test_dlopen.py
--- a/testing/cffi1/test_dlopen.py
+++ b/testing/cffi1/test_dlopen.py
@@ -6,7 +6,7 @@
 
 def test_simple():
     ffi = FFI()
-    ffi.cdef("int close(int); static const int BB = 42;")
+    ffi.cdef("int close(int); static const int BB = 42; int somevar;")
     target = udir.join('test_simple.py')
     assert make_py_source(ffi, 'test_simple', str(target))
     assert target.read() == r"""# auto-generated file
@@ -14,7 +14,7 @@
 
 ffi = _cffi_backend.FFI(b'test_simple',
     _types = b'\x00\x00\x01\x0D\x00\x00\x07\x01\x00\x00\x00\x0F',
-    _globals = (b'\xFF\xFF\xFF\x1FBB',42,b'\x00\x00\x00\x23close',0),
+    _globals = (b'\xFF\xFF\xFF\x1FBB',42,b'\x00\x00\x00\x23close',0,b'\x00\x00\x01\x21somevar',0),
 )
 """
 


More information about the pypy-commit mailing list