[pypy-svn] r76791 - pypy/branch/better-map-instances/pypy/module/pypyjit/test

cfbolz at codespeak.net cfbolz at codespeak.net
Sun Aug 29 17:51:03 CEST 2010


Author: cfbolz
Date: Sun Aug 29 17:51:00 2010
New Revision: 76791

Modified:
   pypy/branch/better-map-instances/pypy/module/pypyjit/test/test_pypy_c.py
Log:
make tests more detailed


Modified: pypy/branch/better-map-instances/pypy/module/pypyjit/test/test_pypy_c.py
==============================================================================
--- pypy/branch/better-map-instances/pypy/module/pypyjit/test/test_pypy_c.py	(original)
+++ pypy/branch/better-map-instances/pypy/module/pypyjit/test/test_pypy_c.py	Sun Aug 29 17:51:00 2010
@@ -270,7 +270,7 @@
         assert len(ops) == 2
         assert not ops[0].get_opnames("call")
         assert not ops[0].get_opnames("new")
-        assert len(ops[0].get_opnames("guard")) <= 7
+        assert len(ops[0].get_opnames("guard")) <= 2
         assert not ops[1] # second LOOKUP_METHOD folded away
 
         ops = self.get_by_bytecode("CALL_METHOD")
@@ -281,7 +281,7 @@
             else:
                 assert not bytecode.get_opnames("call")
             assert not bytecode.get_opnames("new")
-            assert len(bytecode.get_opnames("guard")) <= 9
+            assert len(bytecode.get_opnames("guard")) <= 6
         assert len(ops[1]) < len(ops[0])
 
         ops = self.get_by_bytecode("LOAD_ATTR")
@@ -315,8 +315,8 @@
         assert len(ops) == 2
         assert not ops[0].get_opnames("call")
         assert not ops[0].get_opnames("new")
-        assert len(ops[0].get_opnames("guard")) <= 7
-        assert len(ops[0].get_opnames("getfield")) < 6
+        assert len(ops[0].get_opnames("guard")) <= 2
+        assert len(ops[0].get_opnames("getfield")) < 5
         assert not ops[1] # second LOOKUP_METHOD folded away
 
     def test_default_and_kw(self):
@@ -380,7 +380,7 @@
                     a.x = 2
                     i = i + a.x
                 return i
-        ''', 67,
+        ''', 69,
                    ([20], 20),
                    ([31], 32))
 
@@ -388,7 +388,7 @@
                 self.get_by_bytecode("CALL_FUNCTION"))
         assert not callA.get_opnames("call")
         assert not callA.get_opnames("new")
-        assert len(callA.get_opnames("guard")) <= 8
+        assert len(callA.get_opnames("guard")) <= 2
         assert not callisinstance1.get_opnames("call")
         assert not callisinstance1.get_opnames("new")
         assert len(callisinstance1.get_opnames("guard")) <= 2
@@ -740,6 +740,8 @@
                     '''%(op1, float(a)/4.0, float(b)/4.0, op2), 109, ([], res))
 
     def test_boolrewrite_ptr(self):
+        # XXX this test is way too imprecise in what it is actually testing
+        # it should count the number of guards instead
         compares = ('a == b', 'b == a', 'a != b', 'b != a', 'a == c', 'c != b')
         for e1 in compares:
             for e2 in compares:
@@ -761,7 +763,7 @@
                     n = 215
 
                 self.run_source('''
-                class tst:
+                class tst(object):
                     pass
                 def main():
                     a = tst()
@@ -825,6 +827,8 @@
             ''', 65, ([], 122880))
 
     def test_array_intimg(self):
+        # XXX this test is way too imprecise in what it is actually testing
+        # it should count the number of guards instead
         for tc, maxops in zip('ilILd', (67, 67, 69, 69, 61)):
             res = 73574560
             if tc in 'IL':



More information about the Pypy-commit mailing list