[pypy-svn] r23160 - pypy/dist/pypy/rpython/test

pedronis at codespeak.net pedronis at codespeak.net
Wed Feb 8 22:21:02 CET 2006


Author: pedronis
Date: Wed Feb  8 22:21:01 2006
New Revision: 23160

Modified:
   pypy/dist/pypy/rpython/test/test_rlist.py
Log:
fix test_list_builder. I'm tempted to move it to some jit tests, more chances to be run when the code is tweaked :(



Modified: pypy/dist/pypy/rpython/test/test_rlist.py
==============================================================================
--- pypy/dist/pypy/rpython/test/test_rlist.py	(original)
+++ pypy/dist/pypy/rpython/test/test_rlist.py	Wed Feb  8 22:21:01 2006
@@ -902,11 +902,13 @@
         return lst
 
     from pypy.rpython import rgenop
+    from pypy.rpython.module import support
 
     class DummyBlockBuilder:
 
         def __init__(self):
             self.newblock = rgenop.newblock()
+            self.bareblock = support.from_opaque_object(self.newblock.obj)
 
         def genop(self, opname, args, RESULT_TYPE):
             return rgenop.genop(self.newblock, opname, args, RESULT_TYPE)
@@ -916,10 +918,10 @@
 
         # inspection
         def __getitem__(self, index):
-            return self.newblock.operations[index]
+            return self.bareblock.operations[index]
 
         def __len__(self):
-            return len(self.newblock.operations)
+            return len(self.bareblock.operations)
 
 
     for fn in [fixed_size_case, variable_size_case]:
@@ -930,9 +932,12 @@
         llop = DummyBlockBuilder()
         v0 = Constant(42)
         v0.concretetype = Signed
+        opq_v0 = support.to_opaque_object(v0)
         v1 = Variable()
         v1.concretetype = Signed
-        vr = LIST.list_builder(llop, [v0, v1])
+        opq_v1 = support.to_opaque_object(v1)
+        vr = LIST.list_builder(llop, [opq_v0, opq_v1])
+        vr = rgenop.reveal(vr)
         assert len(llop) == 3
         assert llop[0].opname == 'direct_call'
         assert len(llop[0].args) == 3



More information about the Pypy-commit mailing list