[pypy-svn] r49960 - pypy/dist/pypy/jit/hintannotator/test

antocuni at codespeak.net antocuni at codespeak.net
Thu Dec 20 18:43:28 CET 2007


Author: antocuni
Date: Thu Dec 20 18:43:28 2007
New Revision: 49960

Modified:
   pypy/dist/pypy/jit/hintannotator/test/test_annotator.py
Log:
two more tests pass out of the box :-)



Modified: pypy/dist/pypy/jit/hintannotator/test/test_annotator.py
==============================================================================
--- pypy/dist/pypy/jit/hintannotator/test/test_annotator.py	(original)
+++ pypy/dist/pypy/jit/hintannotator/test/test_annotator.py	Thu Dec 20 18:43:28 2007
@@ -788,7 +788,7 @@
     def test_indirect_sometimes_residual_pure_red_call_oosend(self):
         self.test_indirect_sometimes_residual_pure_red_call(setup_for_oosend)
 
-    def test_indirect_sometimes_residual_red_call(self):
+    def test_indirect_sometimes_residual_red_call(self, setup=setup_for_indirect_call):
         class Stuff:
             pass
         stuff = Stuff()
@@ -797,11 +797,11 @@
             return x-2
         def h2(x):
             return x*4
-        l = [h1, h2]
+        call, lst = setup(h1, h2)
         def f(n, x):
-            frozenl = hint(l, deepfreeze=True)
+            frozenl = hint(lst, deepfreeze=True)
             h = frozenl[n&1]
-            return h(x)
+            return call(h, x)
 
         P = StopAtXPolicy(h1)
         P.oopspec = True
@@ -813,17 +813,19 @@
         hs = hannotator.binding(tsgraph.getargs()[0])
         assert not hs.is_green()
 
+    def test_indirect_sometimes_residual_red_call_oosend(self):
+        self.test_indirect_sometimes_residual_red_call(setup_for_oosend)
 
-    def test_indirect_sometimes_residual_pure_but_fixed_red_call(self):
+    def test_indirect_sometimes_residual_pure_but_fixed_red_call(self, setup=setup_for_indirect_call):
         def h1(x):
             return x-2
         def h2(x):
             return x*4
-        l = [h1, h2]
+        call, lst = setup(h1, h2)
         def f(n, x):
-            frozenl = hint(l, deepfreeze=True)
+            frozenl = hint(lst, deepfreeze=True)
             h = frozenl[n&1]
-            z = h(x)
+            z = call(h, x)
             hint(z, concrete=True)
             return z
 
@@ -843,6 +845,9 @@
         hs = hannotator.binding(tsgraph.getargs()[1])
         assert hs.is_green()
 
+    def test_indirect_sometimes_residual_pure_but_fixed_red_call_oosend(self):
+        self.test_indirect_sometimes_residual_pure_but_fixed_red_call(setup_for_oosend)
+        
     def test_ignore_nonjitted_path(self):
         def f(n):
             if we_are_jitted():



More information about the Pypy-commit mailing list