[pypy-svn] r56647 - pypy/dist/pypy/rlib/test

arigo at codespeak.net arigo at codespeak.net
Fri Jul 18 23:01:02 CEST 2008


Author: arigo
Date: Fri Jul 18 23:00:58 2008
New Revision: 56647

Modified:
   pypy/dist/pypy/rlib/test/test_libffi.py
Log:
Port this test to 64 bits.


Modified: pypy/dist/pypy/rlib/test/test_libffi.py
==============================================================================
--- pypy/dist/pypy/rlib/test/test_libffi.py	(original)
+++ pypy/dist/pypy/rlib/test/test_libffi.py	Fri Jul 18 23:00:58 2008
@@ -162,25 +162,26 @@
             a2 = rffi.cast(rffi.INTP, p_a2)[0]
             res = rffi.cast(rffi.INTP, ll_res)
             if a1 > a2:
-                res[0] = 1
+                res[0] = rffi.cast(rffi.INT, 1)
             else:
-                res[0] = -1
+                res[0] = rffi.cast(rffi.INT, -1)
 
         ptr = CallbackFuncPtr([ffi_type_pointer, ffi_type_pointer],
                               ffi_type_sint, callback)
         
         TP = rffi.CArray(rffi.INT)
         to_sort = lltype.malloc(TP, 4, flavor='raw')
-        to_sort[0] = 4
-        to_sort[1] = 3
-        to_sort[2] = 1
-        to_sort[3] = 2
+        to_sort[0] = rffi.cast(rffi.INT, 4)
+        to_sort[1] = rffi.cast(rffi.INT, 3)
+        to_sort[2] = rffi.cast(rffi.INT, 1)
+        to_sort[3] = rffi.cast(rffi.INT, 2)
         qsort.push_arg(rffi.cast(rffi.VOIDP, to_sort))
         qsort.push_arg(rffi.sizeof(rffi.INT))
         qsort.push_arg(4)
         qsort.push_arg(ptr.ll_closure)
         qsort.call(lltype.Void)
-        assert [to_sort[i] for i in range(4)] == [1,2,3,4]
+        assert ([rffi.cast(lltype.Signed, to_sort[i]) for i in range(4)] ==
+                [1,2,3,4])
         lltype.free(to_sort, flavor='raw')
         keepalive_until_here(ptr)  # <= this test is not translated, but don't
                                    #    forget this in code that is meant to be



More information about the Pypy-commit mailing list