Author: Armin Rigo <[email protected]>
Branch:
Changeset: r2341:8baf7de121f6
Date: 2015-10-16 09:11 +0200
http://bitbucket.org/cffi/cffi/changeset/8baf7de121f6/
Log: win64 fix
diff --git a/testing/cffi0/test_function.py b/testing/cffi0/test_function.py
--- a/testing/cffi0/test_function.py
+++ b/testing/cffi0/test_function.py
@@ -433,6 +433,7 @@
py.test.skip("Windows-only test")
if self.Backend is CTypesBackend:
py.test.skip("not with the ctypes backend")
+ win64 = (sys.maxsize > 2**32)
#
ffi = FFI(backend=self.Backend())
ffi.cdef("""
@@ -456,8 +457,11 @@
""")
m = ffi.dlopen("Kernel32.dll")
tps = ffi.typeof(m.QueryPerformanceFrequency)
- assert tps is not tpc
- assert str(tps) == "<ctype 'int(__stdcall *)(long long *)'>"
+ if win64:
+ assert tps is tpc
+ else:
+ assert tps is not tpc
+ assert str(tps) == "<ctype 'int(__stdcall *)(long long *)'>"
#
ffi = FFI(backend=self.Backend())
ffi.cdef("typedef int (__cdecl *fnc_t)(int);")
@@ -465,18 +469,20 @@
tpc = ffi.typeof("fnc_t")
tps = ffi.typeof("fns_t")
assert str(tpc) == "<ctype 'int(*)(int)'>"
- assert str(tps) == "<ctype 'int(__stdcall *)(int)'>"
+ if win64:
+ assert tps is tpc
+ else:
+ assert str(tps) == "<ctype 'int(__stdcall *)(int)'>"
#
fnc = ffi.cast("fnc_t", 0)
fns = ffi.cast("fns_t", 0)
ffi.new("fnc_t[]", [fnc])
- py.test.raises(TypeError, ffi.new, "fnc_t[]", [fns])
- py.test.raises(TypeError, ffi.new, "fns_t[]", [fnc])
+ if not win64:
+ py.test.raises(TypeError, ffi.new, "fnc_t[]", [fns])
+ py.test.raises(TypeError, ffi.new, "fns_t[]", [fnc])
ffi.new("fns_t[]", [fns])
def test_stdcall_only_on_windows(self):
- if sys.platform == 'win32':
- py.test.skip("not-Windows-only test")
ffi = FFI(backend=self.Backend())
ffi.cdef("double __stdcall sin(double x);") # stdcall ignored
m = ffi.dlopen(lib_m)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit