[pypy-commit] pypy kill-someobject: fix the last 2 remaining tests, yay!

fijal noreply at buildbot.pypy.org
Fri Oct 12 16:58:33 CEST 2012


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: kill-someobject
Changeset: r58059:2f8bacfaf76e
Date: 2012-10-12 16:57 +0200
http://bitbucket.org/pypy/pypy/changeset/2f8bacfaf76e/

Log:	fix the last 2 remaining tests, yay!

diff --git a/pypy/translator/c/test/test_lladdresses.py b/pypy/translator/c/test/test_lladdresses.py
--- a/pypy/translator/c/test/test_lladdresses.py
+++ b/pypy/translator/c/test/test_lladdresses.py
@@ -1,6 +1,5 @@
 import py, sys
 from pypy.rpython.lltypesystem.llmemory import *
-from pypy.annotation.model import SomeAddress, SomeChar
 from pypy.translator.c.test.test_genc import compile
 from pypy.rlib.objectmodel import free_non_gc_object
 
@@ -67,20 +66,22 @@
 
 def test_pointer_arithmetic():
     def f(offset, char):
+        char = chr(char)
         addr = raw_malloc(10000)
         same_offset = (addr + 2 * offset - offset) - addr 
         addr.char[offset] = char
         result = (addr + same_offset).char[0]
         raw_free(addr)
         return result
-    fc = compile(f, [int, SomeChar()])
-    res = fc(10, "c")
+    fc = compile(f, [int, int])
+    res = fc(10, ord("c"))
     assert res == "c"
-    res = fc(12, "x")
+    res = fc(12, ord("x"))
     assert res == "x"
 
 def test_pointer_arithmetic_inplace():
     def f(offset, char):
+        char = chr(char)
         addr = raw_malloc(10000)
         addr += offset
         addr.char[-offset] = char
@@ -88,8 +89,8 @@
         result = addr.char[0]
         raw_free(addr)
         return result
-    fc = compile(f, [int, SomeChar()])
-    res = fc(10, "c")
+    fc = compile(f, [int, int])
+    res = fc(10, ord("c"))
     assert res == "c"
 
 def test_raw_memcopy():


More information about the pypy-commit mailing list