[pypy-svn] r65926 - pypy/branch/pyjitpl5/pypy/jit/tl/spli/test

fijal at codespeak.net fijal at codespeak.net
Wed Jun 24 20:39:51 CEST 2009


Author: fijal
Date: Wed Jun 24 20:39:50 2009
New Revision: 65926

Added:
   pypy/branch/pyjitpl5/pypy/jit/tl/spli/test/test_translated.py   (contents, props changed)
Log:
oops, forgotten to check in translated tests


Added: pypy/branch/pyjitpl5/pypy/jit/tl/spli/test/test_translated.py
==============================================================================
--- (empty file)
+++ pypy/branch/pyjitpl5/pypy/jit/tl/spli/test/test_translated.py	Wed Jun 24 20:39:50 2009
@@ -0,0 +1,24 @@
+
+from pypy.rpython.test.test_llinterp import interpret
+from pypy.jit.tl.spli import interpreter, objects
+from pypy.jit.tl.spli.serializer import serialize, deserialize
+
+class TestSPLITranslated(object):
+
+    def test_one(self):
+        def f(a, b):
+            return a + b
+        data = serialize(f.func_code)
+        space = objects.DumbObjSpace()
+        def run(a, b):
+            co = deserialize(data, space)
+            frame = interpreter.SPLIFrame(co)
+            frame.locals[0] = space.wrap(a)
+            frame.locals[1] = space.wrap(b)
+            w_res = frame.run()
+            assert isinstance(w_res, objects.Int)
+            return w_res.value
+
+        assert run(2, 3) == 5
+        res = interpret(run, [2, 3])
+        assert res == 5



More information about the Pypy-commit mailing list