[pypy-svn] r74919 - pypy/branch/blackhole-improvement/pypy/rpython/lltypesystem/test

arigo at codespeak.net arigo at codespeak.net
Sun May 30 17:19:28 CEST 2010


Author: arigo
Date: Sun May 30 17:19:27 2010
New Revision: 74919

Modified:
   pypy/branch/blackhole-improvement/pypy/rpython/lltypesystem/test/test_ll2ctypes.py
Log:
Fix test.


Modified: pypy/branch/blackhole-improvement/pypy/rpython/lltypesystem/test/test_ll2ctypes.py
==============================================================================
--- pypy/branch/blackhole-improvement/pypy/rpython/lltypesystem/test/test_ll2ctypes.py	(original)
+++ pypy/branch/blackhole-improvement/pypy/rpython/lltypesystem/test/test_ll2ctypes.py	Sun May 30 17:19:27 2010
@@ -1204,17 +1204,14 @@
         res = interpret(f, [])
         assert res == 6
 
-    def test_force_to_int_and_back(self):
+    def test_force_to_int(self):
         S = lltype.Struct('S')
         p = lltype.malloc(S, flavor='raw')
         a = llmemory.cast_ptr_to_adr(p)
-        i = llmemory.cast_adr_to_int(a)
-        i = rffi.get_real_int(i)
-        #
-        a2 = llmemory.cast_int_to_adr(i)
-        assert a2 == a
-        #
-        lltype.free(p)
+        i = rffi.get_real_int(llmemory.cast_adr_to_int(a))
+        assert type(i) is int
+        assert i == rffi.get_real_int(llmemory.cast_adr_to_int(a))
+        lltype.free(p, flavor='raw')
 
 class TestPlatform(object):
     def test_lib_on_libpaths(self):



More information about the Pypy-commit mailing list