[pypy-svn] r53678 - pypy/branch/io-improvements/pypy/rpython/lltypesystem/test

fijal at codespeak.net fijal at codespeak.net
Thu Apr 10 21:57:27 CEST 2008


Author: fijal
Date: Thu Apr 10 21:57:27 2008
New Revision: 53678

Modified:
   pypy/branch/io-improvements/pypy/rpython/lltypesystem/test/test_ll2ctypes.py
Log:
Failing test for address casting.


Modified: pypy/branch/io-improvements/pypy/rpython/lltypesystem/test/test_ll2ctypes.py
==============================================================================
--- pypy/branch/io-improvements/pypy/rpython/lltypesystem/test/test_ll2ctypes.py	(original)
+++ pypy/branch/io-improvements/pypy/rpython/lltypesystem/test/test_ll2ctypes.py	Thu Apr 10 21:57:27 2008
@@ -372,18 +372,18 @@
         assert not ALLOCATED     # detects memory leaks in the test
 
     def test_adr_cast(self):
-        py.test.skip("XXX")
         from pypy.rpython.annlowlevel import llstr
         from pypy.rpython.lltypesystem.rstr import STR
         def f():
             a = llstr("xyz")
             b = (llmemory.cast_ptr_to_adr(a) + llmemory.offsetof(STR, 'chars')
                  + llmemory.itemoffsetof(STR.chars, 0))
-            rffi.cast(rffi.VOIDP, b)
-        # assert did not crash
-        f()
-        interpret(f, [])
-
+            buf = rffi.cast(rffi.VOIDP, b)
+            return buf[2]
+        assert f() == ord("z")
+        res = interpret(f, [])
+        assert res == 'z'
+    
     def test_funcptr1(self):
         def dummy(n):
             return n+1



More information about the Pypy-commit mailing list