summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2020-07-21 20:25:56 +0200
committerArmin Rigo <arigo@tunes.org>2020-07-21 20:25:56 +0200
commit764eadc587f8ab2d67389bb1c1f850921b9f1bae (patch)
tree94586ff582574ccba8cc08871a8aff911bc0ec64 /testing
parent8cc7ea55cdac358b4520d12e86c5882ba4c00824 (diff)
downloadcffi-764eadc587f8ab2d67389bb1c1f850921b9f1bae.tar.gz
more of the same, for win64
Diffstat (limited to 'testing')
-rw-r--r--testing/cffi1/test_function_args.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/testing/cffi1/test_function_args.py b/testing/cffi1/test_function_args.py
index 84c47bb..202015b 100644
--- a/testing/cffi1/test_function_args.py
+++ b/testing/cffi1/test_function_args.py
@@ -1,9 +1,10 @@
-import pytest
+import pytest, sys
try:
# comment out the following line to run this test.
# the latest on x86-64 linux: https://github.com/libffi/libffi/issues/574
- raise ImportError("this test is skipped because it keeps finding "
- "failures in libffi, instead of cffi")
+ if sys.platform != 'win32':
+ raise ImportError("this test is skipped because it keeps finding "
+ "failures in libffi, instead of cffi")
from hypothesis import given, settings, example
from hypothesis import strategies as st
@@ -120,6 +121,7 @@ else:
f.write('lib.testfargs(%s)\n' % aliststr)
f.write('ffi.addressof(lib, "testfargs")(%s)\n' % aliststr)
f.close()
+ print("checking for segfault for direct call...")
rc = subprocess.call([sys.executable, 'run1.py'], cwd=str(udir))
assert rc == 0, rc
@@ -142,6 +144,7 @@ else:
write(ffi.addressof(lib, 'testfargs_result'), returned_value)
## CALL forcing libffi
+ print("CALL forcing libffi")
received_return = ffi.addressof(lib, 'testfargs')(*passed_args)
##
@@ -183,8 +186,9 @@ else:
f.write('def callback(*args): return ffi.new("%s *")[0]\n' % result)
f.write('fptr = ffi.callback("%s(%s)", callback)\n' % (result,
','.join(args)))
- f.write('lib.testfcallback(fptr)\n')
+ f.write('print(lib.testfcallback(fptr))\n')
f.close()
+ print("checking for segfault for callback...")
rc = subprocess.call([sys.executable, 'run1.py'], cwd=str(udir))
assert rc == 0, rc
@@ -194,6 +198,7 @@ else:
return returned_value
fptr = ffi.callback("%s(%s)" % (result, ','.join(args)), callback)
+ print("CALL with callback")
received_return = lib.testfcallback(fptr)
assert len(seen_args) == 1