[pypy-svn] r77525 - pypy/trunk/pypy/module/test_lib_pypy/ctypes_tests

arigo at codespeak.net arigo at codespeak.net
Fri Oct 1 15:46:29 CEST 2010


Author: arigo
Date: Fri Oct  1 15:46:28 2010
New Revision: 77525

Modified:
   pypy/trunk/pypy/module/test_lib_pypy/ctypes_tests/test_functions.py
Log:
Add a failing test.


Modified: pypy/trunk/pypy/module/test_lib_pypy/ctypes_tests/test_functions.py
==============================================================================
--- pypy/trunk/pypy/module/test_lib_pypy/ctypes_tests/test_functions.py	(original)
+++ pypy/trunk/pypy/module/test_lib_pypy/ctypes_tests/test_functions.py	Fri Oct  1 15:46:28 2010
@@ -29,6 +29,7 @@
 class RECT(Structure):
     _fields_ = [("left", c_int), ("top", c_int),
                 ("right", c_int), ("bottom", c_int)]
+
 class TestFunctions(BaseCTypesTestChecker):
 
     def test_mro(self):
@@ -392,6 +393,18 @@
         result = f("abcd", ord("b"))
         assert result == "bcd"
 
+    def test_caching_bug_1(self):
+        # the same test as test_call_some_args, with two extra lines
+        # in the middle that trigger caching in f._ptr, which then
+        # makes the last two lines fail
+        f = dll.my_strchr
+        f.argtypes = [c_char_p, c_int]
+        f.restype = c_char_p
+        result = f("abcd", ord("b"))
+        assert result == "bcd"
+        result = f("abcd", ord("b"), 42)
+        assert result == "bcd"
+
     def test_sf1651235(self):
         py.test.skip("we are less strict in checking callback parameters")
         # see http://www.python.org/sf/1651235



More information about the Pypy-commit mailing list