[pypy-svn] r70414 - pypy/branch/jit-trace/pypy/jit/metainterp/test

arigo at codespeak.net arigo at codespeak.net
Tue Jan 5 12:29:14 CET 2010


Author: arigo
Date: Tue Jan  5 12:29:14 2010
New Revision: 70414

Modified:
   pypy/branch/jit-trace/pypy/jit/metainterp/test/test_warmstate.py
Log:
Fix test.


Modified: pypy/branch/jit-trace/pypy/jit/metainterp/test/test_warmstate.py
==============================================================================
--- pypy/branch/jit-trace/pypy/jit/metainterp/test/test_warmstate.py	(original)
+++ pypy/branch/jit-trace/pypy/jit/metainterp/test/test_warmstate.py	Tue Jan  5 12:29:14 2010
@@ -165,6 +165,7 @@
     class FakeWarmRunnerDesc:
         can_inline_ptr = None
         get_printable_location_ptr = None
+        confirm_enter_jit_ptr = None
         green_args_spec = [lltype.Signed, lltype.Float]
     class FakeCell:
         dont_trace_here = False
@@ -192,6 +193,7 @@
         green_args_spec = [lltype.Signed, lltype.Float]
         can_inline_ptr = llhelper(CAN_INLINE, can_inline)
         get_printable_location_ptr = None
+        confirm_enter_jit_ptr = None
     state = WarmEnterState(FakeWarmRunnerDesc())
     def jit_getter(*args):
         return FakeCell()
@@ -212,7 +214,27 @@
         green_args_spec = [lltype.Signed, lltype.Float]
         can_inline_ptr = None
         get_printable_location_ptr = llhelper(GET_LOCATION, get_location)
+        confirm_enter_jit_ptr = None
     state = WarmEnterState(FakeWarmRunnerDesc())
     state.make_jitdriver_callbacks()
     res = state.get_location_str([BoxInt(5), BoxFloat(42.5)])
     assert res == "hi there"
+
+def test_make_jitdriver_callbacks_4():
+    def confirm_enter_jit(x, y, z):
+        assert x == 5
+        assert y == 42.5
+        assert z == 3
+        return True
+    ENTER_JIT = lltype.Ptr(lltype.FuncType([lltype.Signed, lltype.Float,
+                                            lltype.Signed], lltype.Bool))
+    class FakeWarmRunnerDesc:
+        rtyper = None
+        green_args_spec = [lltype.Signed, lltype.Float]
+        can_inline_ptr = None
+        get_printable_location_ptr = None
+        confirm_enter_jit_ptr = llhelper(ENTER_JIT, confirm_enter_jit)
+    state = WarmEnterState(FakeWarmRunnerDesc())
+    state.make_jitdriver_callbacks()
+    res = state.confirm_enter_jit(5, 42.5, 3)
+    assert res is True



More information about the Pypy-commit mailing list