[pypy-svn] r64868 - pypy/branch/pyjitpl5/pypy/jit/metainterp/test

arigo at codespeak.net arigo at codespeak.net
Thu Apr 30 17:32:38 CEST 2009


Author: arigo
Date: Thu Apr 30 17:32:36 2009
New Revision: 64868

Modified:
   pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_exception.py
Log:
Improve this test.


Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_exception.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_exception.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_exception.py	Thu Apr 30 17:32:36 2009
@@ -122,17 +122,18 @@
 
     def test_exception_from_outside(self):
         myjitdriver = JitDriver(greens = [], reds = ['n'])
-        def check(n):
-            if n > -100:
+        def check(n, mode):
+            if mode == 0 and n > -100:
                 raise MyError(n)
+            return n - 5
         def f(n):
             while n > 0:
                 myjitdriver.can_enter_jit(n=n)
                 myjitdriver.jit_merge_point(n=n)
                 try:
-                    check(n)
+                    check(n, 0)
                 except MyError, e:
-                    n = e.n - 5
+                    n = check(e.n, 1)
             return n
         assert f(53) == -2
         res = self.meta_interp(f, [53], policy=StopAtXPolicy(check))



More information about the Pypy-commit mailing list