[pypy-commit] cffi cpy-extension: A passing test checking a call to a macro.
arigo
noreply at buildbot.pypy.org
Tue Jun 12 17:53:08 CEST 2012
Author: Armin Rigo <arigo at tunes.org>
Branch: cpy-extension
Changeset: r297:7d2ea1c438ec
Date: 2012-06-12 17:52 +0200
http://bitbucket.org/cffi/cffi/changeset/7d2ea1c438ec/
Log: A passing test checking a call to a macro.
diff --git a/testing/test_verify.py b/testing/test_verify.py
--- a/testing/test_verify.py
+++ b/testing/test_verify.py
@@ -78,6 +78,12 @@
lib = ffi.verify("int foo(int a, int b) { return a - b; }")
assert lib.foo(40, -2) == 42
+def test_macro():
+ ffi = FFI()
+ ffi.cdef("int foo(int, int);")
+ lib = ffi.verify("#define foo(a, b) ((a) * (b))")
+ assert lib.foo(-6, -7) == 42
+
def test_verify_typedefs():
py.test.skip("XXX?")
More information about the pypy-commit
mailing list