summaryrefslogtreecommitdiff
path: root/testing/cffi0
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2015-10-16 09:11:00 +0200
committerArmin Rigo <arigo@tunes.org>2015-10-16 09:11:00 +0200
commitc6a3fb8ec86ed8d54ab36084bd1274c2887a278c (patch)
tree4c34a68de10979c9610a6bd0651d559da502fb5a /testing/cffi0
parentc581eeb9f0b40a50d9c2304afab6f93e30c7870e (diff)
downloadcffi-c6a3fb8ec86ed8d54ab36084bd1274c2887a278c.tar.gz
win64 fix
Diffstat (limited to 'testing/cffi0')
-rw-r--r--testing/cffi0/test_function.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/testing/cffi0/test_function.py b/testing/cffi0/test_function.py
index 1a2995d..b59b688 100644
--- a/testing/cffi0/test_function.py
+++ b/testing/cffi0/test_function.py
@@ -433,6 +433,7 @@ class TestFunction(object):
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 @@ class TestFunction(object):
""")
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 @@ class TestFunction(object):
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)