[pypy-svn] r77344 - in pypy/trunk/pypy: jit/metainterp/test module/pypyjit/test

antocuni at codespeak.net antocuni at codespeak.net
Fri Sep 24 16:26:40 CEST 2010


Author: antocuni
Date: Fri Sep 24 16:26:39 2010
New Revision: 77344

Modified:
   pypy/trunk/pypy/jit/metainterp/test/oparser.py
   pypy/trunk/pypy/jit/metainterp/test/test_oparser.py
   pypy/trunk/pypy/module/pypyjit/test/test_pypy_c.py
Log:
fix test_pypy_c, which was broken by the merging of the resoperation-refactoring branch


Modified: pypy/trunk/pypy/jit/metainterp/test/oparser.py
==============================================================================
--- pypy/trunk/pypy/jit/metainterp/test/oparser.py	(original)
+++ pypy/trunk/pypy/jit/metainterp/test/oparser.py	Fri Sep 24 16:26:39 2010
@@ -196,7 +196,8 @@
             if opname == 'debug_merge_point':
                 allargs = [argspec]
             else:
-                allargs = argspec.split(",")
+                allargs = [arg for arg in argspec.split(",")
+                           if arg != '']
 
             poss_descr = allargs[-1].strip()
             if poss_descr.startswith('descr='):

Modified: pypy/trunk/pypy/jit/metainterp/test/test_oparser.py
==============================================================================
--- pypy/trunk/pypy/jit/metainterp/test/test_oparser.py	(original)
+++ pypy/trunk/pypy/jit/metainterp/test/test_oparser.py	Fri Sep 24 16:26:39 2010
@@ -174,3 +174,12 @@
 
 def test_parse_no_namespace():
     loop = parse(example_loop_log, no_namespace=True)
+
+def test_parse_new_with_comma():
+    # this is generated by PYPYJITLOG, check that we can handle it
+    x = '''
+    []
+    p0 = new(, descr=<SizeDescr 12>)
+    '''
+    loop = parse(x)
+    assert loop.operations[0].getopname() == 'new'

Modified: pypy/trunk/pypy/module/pypyjit/test/test_pypy_c.py
==============================================================================
--- pypy/trunk/pypy/module/pypyjit/test/test_pypy_c.py	(original)
+++ pypy/trunk/pypy/module/pypyjit/test/test_pypy_c.py	Fri Sep 24 16:26:39 2010
@@ -140,7 +140,7 @@
             for op in loop.operations:
                 if op.getopname() == "debug_merge_point":
                     sliced_loop = BytecodeTrace()
-                    sliced_loop.bytecode = op.args[0]._get_str().rsplit(" ", 1)[1]
+                    sliced_loop.bytecode = op.getarg(0)._get_str().rsplit(" ", 1)[1]
                     self.sliced_loops.append(sliced_loop)
                 else:
                     sliced_loop.append(op)



More information about the Pypy-commit mailing list