[pypy-svn] r51580 - pypy/dist/pypy/lib/app_test/ctypes

fijal at codespeak.net fijal at codespeak.net
Mon Feb 18 13:20:58 CET 2008


Author: fijal
Date: Mon Feb 18 13:20:57 2008
New Revision: 51580

Modified:
   pypy/dist/pypy/lib/app_test/ctypes/test_base.py
   pypy/dist/pypy/lib/app_test/ctypes/test_keepalive.py
Log:
Fix those tests.


Modified: pypy/dist/pypy/lib/app_test/ctypes/test_base.py
==============================================================================
--- pypy/dist/pypy/lib/app_test/ctypes/test_base.py	(original)
+++ pypy/dist/pypy/lib/app_test/ctypes/test_base.py	Mon Feb 18 13:20:57 2008
@@ -1,6 +1,8 @@
 
 from ctypes import *
 
+# WhiteBoxTests
+
 class TestCTypesBase:
     def test_pointer(self):
         p = pointer(pointer(c_int(2)))
@@ -20,4 +22,4 @@
         X = POINTER(c_int) * 24
         x = X()
         assert x[16]._base is x
-        assert x[16]._index == 16 * sizeof(POINTER(c_int))
+        assert x[16]._index == 16

Modified: pypy/dist/pypy/lib/app_test/ctypes/test_keepalive.py
==============================================================================
--- pypy/dist/pypy/lib/app_test/ctypes/test_keepalive.py	(original)
+++ pypy/dist/pypy/lib/app_test/ctypes/test_keepalive.py	Mon Feb 18 13:20:57 2008
@@ -59,7 +59,6 @@
         assert cf._objects == {'0':cf}
     
     def test_array_of_struct_with_pointer(self):
-        py.test.skip("explodes right now")
         class S(Structure):
             _fields_ = [('x', c_int)]
         PS = POINTER(S)
@@ -73,5 +72,5 @@
         s.x=3
         a[3].p = pointer(s)
 
-        print a._objects
+        assert a._objects['0:3']['1'] is s
         



More information about the Pypy-commit mailing list