diff options
author | Thomas Heller <theller@ctypes.org> | 2007-07-12 20:10:18 (GMT) |
---|---|---|
committer | Thomas Heller <theller@ctypes.org> | 2007-07-12 20:10:18 (GMT) |
commit | 745f5e2de709722e1586df597af59477cb3f6980 (patch) | |
tree | f53be06eda4957a02b3ea15b04bc5b5f506faddf | |
parent | f4f771fe0fd872c5d8ec752a40587e49f4192ff8 (diff) | |
download | cpython-745f5e2de709722e1586df597af59477cb3f6980.zip cpython-745f5e2de709722e1586df597af59477cb3f6980.tar.gz cpython-745f5e2de709722e1586df597af59477cb3f6980.tar.bz2 |
No crashes on Linux in the ctypes test suite any longer, so we can
remove the 'crash-protection'.
-rw-r--r-- | Lib/ctypes/test/test_functions.py | 20 | ||||
-rw-r--r-- | Lib/ctypes/test/test_python_api.py | 22 |
2 files changed, 19 insertions, 23 deletions
diff --git a/Lib/ctypes/test/test_functions.py b/Lib/ctypes/test/test_functions.py index 0cca861..d7a3edf 100644 --- a/Lib/ctypes/test/test_functions.py +++ b/Lib/ctypes/test/test_functions.py @@ -160,17 +160,15 @@ class FunctionTestCase(unittest.TestCase): result = f(1, 2, 3, 4, 5.0, 6.0, 21) self.failUnlessEqual(result, 42) - from ctypes.test import is_resource_enabled - if is_resource_enabled("struni-crash"): - def test_stringresult(self): - f = dll._testfunc_p_p - f.argtypes = None - f.restype = c_char_p - result = f(b"123") - self.failUnlessEqual(result, "123") - - result = f(None) - self.failUnlessEqual(result, None) + def test_stringresult(self): + f = dll._testfunc_p_p + f.argtypes = None + f.restype = c_char_p + result = f(b"123") + self.failUnlessEqual(result, "123") + + result = f(None) + self.failUnlessEqual(result, None) def test_pointers(self): f = dll._testfunc_p_p diff --git a/Lib/ctypes/test/test_python_api.py b/Lib/ctypes/test/test_python_api.py index 8348c8b..f701d54 100644 --- a/Lib/ctypes/test/test_python_api.py +++ b/Lib/ctypes/test/test_python_api.py @@ -67,21 +67,19 @@ class PythonAPITestCase(unittest.TestCase): del pyobj self.failUnlessEqual(grc(s), ref) - from ctypes.test import is_resource_enabled - if is_resource_enabled("struni-crash"): - def test_PyOS_snprintf(self): - PyOS_snprintf = pythonapi.PyOS_snprintf - PyOS_snprintf.argtypes = POINTER(c_char), c_size_t, c_char_p + def test_PyOS_snprintf(self): + PyOS_snprintf = pythonapi.PyOS_snprintf + PyOS_snprintf.argtypes = POINTER(c_char), c_size_t, c_char_p - buf = c_buffer(256) - PyOS_snprintf(buf, sizeof(buf), "Hello from %s", b"ctypes") - self.failUnlessEqual(buf.value, "Hello from ctypes") + buf = c_buffer(256) + PyOS_snprintf(buf, sizeof(buf), "Hello from %s", b"ctypes") + self.failUnlessEqual(buf.value, "Hello from ctypes") - PyOS_snprintf(buf, sizeof(buf), "Hello from %s (%d, %d, %d)", b"ctypes", 1, 2, 3) - self.failUnlessEqual(buf.value, "Hello from ctypes (1, 2, 3)") + PyOS_snprintf(buf, sizeof(buf), "Hello from %s (%d, %d, %d)", b"ctypes", 1, 2, 3) + self.failUnlessEqual(buf.value, "Hello from ctypes (1, 2, 3)") - # not enough arguments - self.failUnlessRaises(TypeError, PyOS_snprintf, buf) + # not enough arguments + self.failUnlessRaises(TypeError, PyOS_snprintf, buf) def test_pyobject_repr(self): self.failUnlessEqual(repr(py_object()), "py_object(<NULL>)") |