[pypy-commit] cffi default: Draft the future test for calling convention of callbacks
arigo
noreply at buildbot.pypy.org
Wed Jul 18 23:33:17 CEST 2012
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r668:7e683e259cd2
Date: 2012-07-18 23:27 +0200
http://bitbucket.org/cffi/cffi/changeset/7e683e259cd2/
Log: Draft the future test for calling convention of callbacks
diff --git a/testing/test_verify.py b/testing/test_verify.py
--- a/testing/test_verify.py
+++ b/testing/test_verify.py
@@ -682,6 +682,25 @@
""")
assert lib.foo_func(lib.BB) == "BB"
+def test_callback_calling_convention():
+ py.test.skip("later")
+ if sys.platform != 'win32':
+ py.test.skip("Windows only")
+ ffi = FFI()
+ ffi.cdef("""
+ int call1(int(*__cdecl cb)(int));
+ int call2(int(*__stdcall cb)(int));
+ """)
+ lib = ffi.verify("""
+ int call1(int(*__cdecl cb)(int)) {
+ return cb(42) + 1;
+ }
+ int call2(int(*__stdcall cb)(int)) {
+ return cb(-42) - 6;
+ }
+ """)
+ xxx
+
def test_opaque_integer_as_function_result():
# XXX bad abuse of "struct { ...; }". It only works a bit by chance
# anyway. XXX think about something better :-(
More information about the pypy-commit
mailing list