[Python-3000-checkins] r56338 - python/branches/py3k-struni/Lib/ctypes/test/test_functions.py python/branches/py3k-struni/Lib/ctypes/test/test_python_api.py

thomas.heller python-3000-checkins at python.org
Thu Jul 12 22:10:19 CEST 2007


Author: thomas.heller
Date: Thu Jul 12 22:10:18 2007
New Revision: 56338

Modified:
   python/branches/py3k-struni/Lib/ctypes/test/test_functions.py
   python/branches/py3k-struni/Lib/ctypes/test/test_python_api.py
Log:
No crashes on Linux in the ctypes test suite any longer, so we can
remove the 'crash-protection'.


Modified: python/branches/py3k-struni/Lib/ctypes/test/test_functions.py
==============================================================================
--- python/branches/py3k-struni/Lib/ctypes/test/test_functions.py	(original)
+++ python/branches/py3k-struni/Lib/ctypes/test/test_functions.py	Thu Jul 12 22:10:18 2007
@@ -160,17 +160,15 @@
         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")
+    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)
+        result = f(None)
+        self.failUnlessEqual(result, None)
 
     def test_pointers(self):
         f = dll._testfunc_p_p

Modified: python/branches/py3k-struni/Lib/ctypes/test/test_python_api.py
==============================================================================
--- python/branches/py3k-struni/Lib/ctypes/test/test_python_api.py	(original)
+++ python/branches/py3k-struni/Lib/ctypes/test/test_python_api.py	Thu Jul 12 22:10:18 2007
@@ -67,21 +67,19 @@
         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
-
-            buf = c_buffer(256)
-            PyOS_snprintf(buf, sizeof(buf), "Hello from %s", b"ctypes")
-            self.failUnlessEqual(buf.value, "Hello from ctypes")
+    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")
 
-            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>)")


More information about the Python-3000-checkins mailing list