[pypy-svn] r19998 - pypy/branch/somepbc-refactoring/pypy/translator/test

mwh at codespeak.net mwh at codespeak.net
Fri Nov 18 11:13:24 CET 2005


Author: mwh
Date: Fri Nov 18 11:13:23 2005
New Revision: 19998

Modified:
   pypy/branch/somepbc-refactoring/pypy/translator/test/test_annrpython.py
Log:
fix tests that call build_types with a FunctionGraph to use a lower level interface.


Modified: pypy/branch/somepbc-refactoring/pypy/translator/test/test_annrpython.py
==============================================================================
--- pypy/branch/somepbc-refactoring/pypy/translator/test/test_annrpython.py	(original)
+++ pypy/branch/somepbc-refactoring/pypy/translator/test/test_annrpython.py	Fri Nov 18 11:13:23 2005
@@ -4,7 +4,7 @@
 from pypy.tool.udir import udir
 
 from pypy.translator.annrpython import annmodel
-from pypy.translator.translator import Translator
+from pypy.translator.translator import Translator, TranslationContext
 from pypy.annotation import policy
 from pypy.annotation import specialize
 from pypy.annotation.listdef import ListDef
@@ -79,7 +79,10 @@
         block.operations.append(op)
         block.closeblock(Link([result], fun.returnblock))
         a = self.RPythonAnnotator()
-        a.build_types(fun, [int])
+        a.translator = TranslationContext()
+        a.translator.annotator = a
+        a.addpendingblock(fun, fun.startblock, [annmodel.SomeInteger()])
+        a.complete()
         assert a.gettype(fun.getreturnvar()) == int
 
     def test_while(self):
@@ -108,7 +111,10 @@
         whileblock.closeblock(Link([i3], headerblock))
 
         a = self.RPythonAnnotator()
-        a.build_types(fun, [int])
+        a.translator = TranslationContext()
+        a.translator.annotator = a
+        a.addpendingblock(fun, fun.startblock, [annmodel.SomeInteger()])
+        a.complete()
         assert a.gettype(fun.getreturnvar()) == int
 
     def test_while_sum(self):
@@ -148,7 +154,10 @@
         whileblock.closeblock(Link([i4, sum4], headerblock))
 
         a = self.RPythonAnnotator()
-        a.build_types(fun, [int])
+        a.translator = TranslationContext()
+        a.translator.annotator = a
+        a.addpendingblock(fun, fun.startblock, [annmodel.SomeInteger()])
+        a.complete()
         assert a.gettype(fun.getreturnvar()) == int
 
     def test_f_calls_g(self):



More information about the Pypy-commit mailing list