[pypy-commit] pypy cffi-1.0: fix more tests
arigo
noreply at buildbot.pypy.org
Fri May 8 16:56:09 CEST 2015
Author: Armin Rigo <arigo at tunes.org>
Branch: cffi-1.0
Changeset: r77216:df63c959460c
Date: 2015-05-08 16:56 +0200
http://bitbucket.org/pypy/pypy/changeset/df63c959460c/
Log: fix more tests
diff --git a/pypy/module/_cffi_backend/test/test_recompiler.py b/pypy/module/_cffi_backend/test/test_recompiler.py
--- a/pypy/module/_cffi_backend/test/test_recompiler.py
+++ b/pypy/module/_cffi_backend/test/test_recompiler.py
@@ -441,24 +441,27 @@
"int foo(int x) { return x + 32; }")
assert lib.foo(10) == 42
- def test_bad_size_of_global_1():
- ffi = FFI()
- ffi.cdef("short glob;")
- lib = verify(ffi, "test_bad_size_of_global_1", "long glob;")
- raises(ffi.error, "lib.glob")
+ def test_bad_size_of_global_1(self):
+ ffi, lib = self.prepare(
+ "short glob;",
+ "test_bad_size_of_global_1",
+ "long glob;")
+ raises(ffi.error, getattr, lib, "glob")
- def test_bad_size_of_global_2():
- ffi = FFI()
- ffi.cdef("int glob[10];")
- lib = verify(ffi, "test_bad_size_of_global_2", "int glob[9];")
- e = raises(ffi.error, "lib.glob")
+ def test_bad_size_of_global_2(self):
+ ffi, lib = self.prepare(
+ "int glob[10];",
+ "test_bad_size_of_global_2",
+ "int glob[9];")
+ e = raises(ffi.error, getattr, lib, "glob")
assert str(e.value) == ("global variable 'glob' should be 40 bytes "
"according to the cdef, but is actually 36")
- def test_unspecified_size_of_global():
- ffi = FFI()
- ffi.cdef("int glob[];")
- lib = verify(ffi, "test_unspecified_size_of_global", "int glob[10];")
+ def test_unspecified_size_of_global(self):
+ ffi, lib = self.prepare(
+ "int glob[];",
+ "test_unspecified_size_of_global",
+ "int glob[10];")
lib.glob # does not crash
def test_include_1():
More information about the pypy-commit
mailing list