[pypy-svn] r50559 - pypy/branch/applevel-ctypes2/pypy/lib/app_test/ctypes

fijal at codespeak.net fijal at codespeak.net
Sun Jan 13 17:02:07 CET 2008


Author: fijal
Date: Sun Jan 13 17:02:07 2008
New Revision: 50559

Modified:
   pypy/branch/applevel-ctypes2/pypy/lib/app_test/ctypes/test_pointers.py
Log:
Add additional test for pointer to pointer.


Modified: pypy/branch/applevel-ctypes2/pypy/lib/app_test/ctypes/test_pointers.py
==============================================================================
--- pypy/branch/applevel-ctypes2/pypy/lib/app_test/ctypes/test_pointers.py	(original)
+++ pypy/branch/applevel-ctypes2/pypy/lib/app_test/ctypes/test_pointers.py	Sun Jan 13 17:02:07 2008
@@ -102,6 +102,16 @@
 
             py.test.raises(TypeError, delitem, p, 0)
 
+    def test_pointer_to_pointer(self):
+        x = c_int(32)
+        y = c_int(42)
+        p1 = pointer(x)
+        p2 = pointer(p1)
+        assert p2.contents.contents.value == 32
+        p2.contents.contents = y
+        assert p2.contents.contents.value == 42
+        assert p1.contents.value == 42
+
     def test_from_address(self):
         py.test.skip("It cannot work")
         from array import array



More information about the Pypy-commit mailing list