[pypy-svn] r67528 - pypy/trunk/pypy/jit/metainterp/test

arigo at codespeak.net arigo at codespeak.net
Sat Sep 5 18:34:01 CEST 2009


Author: arigo
Date: Sat Sep  5 18:34:00 2009
New Revision: 67528

Modified:
   pypy/trunk/pypy/jit/metainterp/test/test_policy.py
Log:
Fix the test (sorry!).


Modified: pypy/trunk/pypy/jit/metainterp/test/test_policy.py
==============================================================================
--- pypy/trunk/pypy/jit/metainterp/test/test_policy.py	(original)
+++ pypy/trunk/pypy/jit/metainterp/test/test_policy.py	Sat Sep  5 18:34:00 2009
@@ -19,11 +19,29 @@
 
     jitpolicy = policy.JitPolicy()
     translator = rtyper.annotator.translator
-    res = warmspot.find_all_graphs(translator.graphs[0], jitpolicy, translator)
+    res = warmspot.find_all_graphs(translator.graphs[0], jitpolicy, translator,
+                                   True)
 
     funcs = [graph.func for graph in res]
     assert funcs == [i, f]
 
+def test_find_all_graphs_without_floats():
+    def g(x):
+        return int(x * 12.5)
+    def f(x):
+        return g(x) + 1
+    rtyper = support.annotate(f, [7])
+    jitpolicy = policy.JitPolicy()
+    translator = rtyper.annotator.translator
+    res = warmspot.find_all_graphs(translator.graphs[0], jitpolicy, translator,
+                                   supports_floats=True)
+    funcs = [graph.func for graph in res]
+    assert funcs == [f, g]
+    res = warmspot.find_all_graphs(translator.graphs[0], jitpolicy, translator,
+                                   supports_floats=False)
+    funcs = [graph.func for graph in res]
+    assert funcs == [f]
+
 def test_find_all_graphs_str_join():
     def i(x, y):
         return "hello".join([str(x), str(y), "bye"])
@@ -32,7 +50,8 @@
 
     jitpolicy = policy.JitPolicy()
     translator = rtyper.annotator.translator
-    res = warmspot.find_all_graphs(translator.graphs[0], jitpolicy, translator)
+    res = warmspot.find_all_graphs(translator.graphs[0], jitpolicy, translator,
+                                   True)
 
     funcs = [graph.func for graph in res]
     assert funcs[:1] == [i]



More information about the Pypy-commit mailing list