[pypy-commit] cffi cffi-1.0: Small fixes to have a few tests pass.
arigo
noreply at buildbot.pypy.org
Sat Apr 18 17:33:23 CEST 2015
Author: Armin Rigo <arigo at tunes.org>
Branch: cffi-1.0
Changeset: r1759:e3236c67b86f
Date: 2015-04-18 17:27 +0200
http://bitbucket.org/cffi/cffi/changeset/e3236c67b86f/
Log: Small fixes to have a few tests pass.
diff --git a/cffi/api.py b/cffi/api.py
--- a/cffi/api.py
+++ b/cffi/api.py
@@ -321,7 +321,9 @@
def verify(self, source='', **kwargs):
from recompiler import verify # XXX must be in the current dir
- return verify(self, 'verify', source, **kwargs)
+ FFI._verify_counter += 1
+ return verify(self, 'verify%d' % FFI._verify_counter, source, **kwargs)
+ _verify_counter = 0
def XXXverify(self, source='', tmpdir=None, **kwargs):
"""Verify that the current ffi signatures compile on this
diff --git a/new/recompiler.py b/new/recompiler.py
--- a/new/recompiler.py
+++ b/new/recompiler.py
@@ -534,6 +534,9 @@
# ----------
# emitting the opcodes for individual types
+ def _emit_bytecode_VoidType(self, tp, index):
+ self.cffi_types[index] = CffiOp(OP_PRIMITIVE, PRIM_VOID)
+
def _emit_bytecode_PrimitiveType(self, tp, index):
prim_index = PRIMITIVE_TO_INDEX[tp.name]
self.cffi_types[index] = CffiOp(OP_PRIMITIVE, prim_index)
diff --git a/new/test_verify1.py b/new/test_verify1.py
--- a/new/test_verify1.py
+++ b/new/test_verify1.py
@@ -1,6 +1,8 @@
-import sys
+import sys, math, py
from cffi1 import FFI, VerificationError, model
+lib_m = ['m']
+
def test_missing_function(ffi=None):
# uses the FFI hacked above with '-Werror'
@@ -9,7 +11,7 @@
ffi.cdef("void some_completely_unknown_function();")
try:
lib = ffi.verify()
- except (VerificationError, OSError):
+ except (VerificationError, OSError, ImportError):
pass # expected case: we get a VerificationError
else:
# but depending on compiler and loader details, maybe
@@ -20,8 +22,8 @@
def test_missing_function_import_error():
# uses the original FFI that just gives a warning during compilation
- import cffi
- test_missing_function(ffi=cffi.FFI())
+ import cffi1
+ test_missing_function(ffi=cffi1.FFI())
def test_simple_case():
ffi = FFI()
More information about the pypy-commit
mailing list