[pypy-commit] cffi default: Add a test.
arigo
noreply at buildbot.pypy.org
Fri Jul 13 19:16:15 CEST 2012
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r632:049850acf777
Date: 2012-07-13 19:06 +0200
http://bitbucket.org/cffi/cffi/changeset/049850acf777/
Log: Add a test.
diff --git a/testing/test_verify.py b/testing/test_verify.py
--- a/testing/test_verify.py
+++ b/testing/test_verify.py
@@ -657,3 +657,16 @@
int foo_func(enum foo_e e) { return e; }
""")
assert lib.foo_func(lib.BB) == 2
+
+def test_opaque_integer_as_function_result():
+ ffi = FFI()
+ ffi.cdef("""
+ typedef ... handle_t;
+ handle_t foo(void);
+ """)
+ lib = ffi.verify("""
+ typedef short handle_t;
+ handle_t foo(void) { return 42; }
+ """)
+ h = lib.foo()
+ assert ffi.sizeof(h) == ffi.sizeof("short")
More information about the pypy-commit
mailing list