Author: Dodan Mihai <[email protected]>
Branch: pypy_ctypes_nosegfault_nofastpath
Changeset: r91343:5823134aebb6
Date: 2017-05-19 15:40 +0300
http://bitbucket.org/pypy/pypy/changeset/5823134aebb6/
Log: Removed test_segfault.py. The test was in test_functions.py in
test_argument_conversion_and_checks
diff --git a/pypy/module/test_lib_pypy/ctypes_tests/test_functions.py
b/pypy/module/test_lib_pypy/ctypes_tests/test_functions.py
--- a/pypy/module/test_lib_pypy/ctypes_tests/test_functions.py
+++ b/pypy/module/test_lib_pypy/ctypes_tests/test_functions.py
@@ -478,7 +478,7 @@
raises(ArgumentError, lambda: callback((1, 2, 3, 4), POINT()))
def test_argument_conversion_and_checks(self):
- py.test.skip("XXX currently broken on PyPy, sorry")
+ #This test is designed to check for segfaults if the wrong type of
argument is passed as parameter
strlen = dll.my_strchr
strlen.argtypes = [c_char_p, c_int]
strlen.restype = c_char_p
diff --git a/pypy/module/test_lib_pypy/ctypes_tests/test_segfault.py
b/pypy/module/test_lib_pypy/ctypes_tests/test_segfault.py
deleted file mode 100644
--- a/pypy/module/test_lib_pypy/ctypes_tests/test_segfault.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# The fast path has been removed and so were the tests
-# They have been replaced with a test that shows that passing the wrong
argument to a function that takes a string parameter no longer segfaults.
-# This is why the assertion of an exception below. If it fails then it
segfaults.
-
-import ctypes
-
-class TestFastpath():
-
- def test_fastpath_forbidden(self):
- libc = ctypes.cdll.LoadLibrary("libc.so.6")
- libc.strlen.argtypes = [ctypes.c_char_p]
- libc.strlen.restype = ctypes.c_size_t
- try:
- libc.strlen(False)
- except ctypes.ArgumentError as e:
- assert isinstance(e,ctypes.ArgumentError)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit