[pypy-svn] r65809 - in pypy/branch/pyjitpl5/pypy/jit/metainterp: . test

arigo at codespeak.net arigo at codespeak.net
Wed Jun 17 19:35:59 CEST 2009


Author: arigo
Date: Wed Jun 17 19:35:59 2009
New Revision: 65809

Modified:
   pypy/branch/pyjitpl5/pypy/jit/metainterp/history.py
   pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_loop.py
Log:
Improve testing by catching 'check_loop(typo=0)'.


Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/history.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/history.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/history.py	Wed Jun 17 19:35:59 2009
@@ -623,6 +623,7 @@
         if expected is not None:
             assert insns == expected
         for insn, expected_count in check.items():
+            getattr(rop, insn.upper())  # fails if 'rop.INSN' does not exist
             assert insns.get(insn, 0) == expected_count
         return insns
 
@@ -635,6 +636,7 @@
         if expected is not None:
             assert insns == expected
         for insn, expected_count in check.items():
+            getattr(rop, insn.upper())  # fails if 'rop.INSN' does not exist
             assert insns.get(insn, 0) == expected_count
         return insns
 

Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_loop.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_loop.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_loop.py	Wed Jun 17 19:35:59 2009
@@ -169,8 +169,8 @@
         res = self.meta_interp(f, [5, 8])
         assert res == 42
         self.check_loop_count(1)
-        # the 'char_eq' and following 'guard' should be constant-folded
-        self.check_loops(char_eq=0, guard_true=1, guard_false=0)
+        # the 'int_eq' and following 'guard' should be constant-folded
+        self.check_loops(int_eq=0, guard_true=1, guard_false=0)
         if self.basic:
             found = 0
             for op in get_stats().loops[0]._all_operations():



More information about the Pypy-commit mailing list