Author: Maciej Fijalkowski <fij...@gmail.com>
Branch: share-guard-info
Changeset: r79799:b23e32603989
Date: 2015-09-23 20:11 +0200
http://bitbucket.org/pypy/pypy/changeset/b23e32603989/

Log:    continue whacking at tests

diff --git a/rpython/jit/metainterp/test/test_ajit.py 
b/rpython/jit/metainterp/test/test_ajit.py
--- a/rpython/jit/metainterp/test/test_ajit.py
+++ b/rpython/jit/metainterp/test/test_ajit.py
@@ -841,7 +841,7 @@
             return a.foo * x
         res = self.interp_operations(f, [42])
         assert res == 210
-        self.check_operations_history(getfield_gc=1)
+        self.check_operations_history(getfield_gc_i=1)
 
     def test_getfield_immutable(self):
         class A:
@@ -858,7 +858,7 @@
             return a.foo * x
         res = self.interp_operations(f, [42])
         assert res == 210
-        self.check_operations_history(getfield_gc=0)
+        self.check_operations_history(getfield_gc_i=0)
 
     def test_setfield_bool(self):
         class A:
@@ -1381,7 +1381,7 @@
             return g(a, b)
         res = self.interp_operations(f, [3, 5])
         assert res == 8
-        self.check_operations_history(int_add=0, call=1)
+        self.check_operations_history(int_add=0, call_i=1)
 
     def test_listcomp(self):
         myjitdriver = JitDriver(greens = [], reds = ['x', 'y', 'lst'])
@@ -1405,7 +1405,7 @@
             return tup[1]
         res = self.interp_operations(f, [3, 5])
         assert res == 5
-        self.check_operations_history(setfield_gc=2, getfield_gc_pure=0)
+        self.check_operations_history(setfield_gc=2, getfield_gc_pure_i=0)
 
     def test_oosend_look_inside_only_one(self):
         class A:
@@ -4030,7 +4030,7 @@
             rgc.ll_arraycopy(a, b, c, d, e)
             return 42
         self.interp_operations(f, [1, 2, 3])
-        self.check_operations_history(call=1, guard_no_exception=0)
+        self.check_operations_history(call_n=1, guard_no_exception=0)
 
     def test_weakref(self):
         import weakref
diff --git a/rpython/jit/metainterp/test/test_fficall.py 
b/rpython/jit/metainterp/test/test_fficall.py
--- a/rpython/jit/metainterp/test/test_fficall.py
+++ b/rpython/jit/metainterp/test/test_fficall.py
@@ -46,7 +46,9 @@
 class FfiCallTests(object):
 
     def _run(self, atypes, rtype, avalues, rvalue,
-             expected_call_release_gil=1,
+             expected_call_release_gil_i=1,
+             expected_call_release_gil_f=0,
+             expected_call_release_gil_n=0,
              supports_floats=True,
              supports_longlong=False,
              supports_singlefloats=False):
@@ -141,8 +143,12 @@
                 # longlong and floats are passed around as longlongs.
                 res = float2longlong(res)
             assert matching_result(res, rvalue)
-            self.check_operations_history(call_may_force=0,
-                                          
call_release_gil=expected_call_release_gil)
+            self.check_operations_history(call_may_force_i=0,
+                                          call_may_force_f=0,
+                                          call_may_force_n=0,
+                            call_release_gil_i=expected_call_release_gil_i,
+                            call_release_gil_f=expected_call_release_gil_f,
+                            call_release_gil_n=expected_call_release_gil_n)
 
             ##################################################
             driver = jit.JitDriver(reds=['i'], greens=[])
@@ -168,10 +174,13 @@
 
     def test_simple_call_float(self, **kwds):
         kwds.setdefault('supports_floats', True)
+        kwds['expected_call_release_gil_f'] = 
kwds.pop('expected_call_release_gil', 1)
+        kwds['expected_call_release_gil_i'] = 0
         self._run([types.double] * 2, types.double, [45.6, 78.9], -4.2, **kwds)
 
     def test_simple_call_longlong(self, **kwds):
         kwds.setdefault('supports_longlong', True)
+        kwds['expected_call_release_gil_i'] = 
kwds.pop('expected_call_release_gil', 1)
         maxint32 = 2147483647
         a = r_longlong(maxint32) + 1
         b = r_longlong(maxint32) + 2
@@ -179,12 +188,15 @@
 
     def test_simple_call_singlefloat_args(self, **kwds):
         kwds.setdefault('supports_singlefloats', True)
+        kwds['expected_call_release_gil_f'] = 
kwds.pop('expected_call_release_gil', 1)
+        kwds['expected_call_release_gil_i'] = 0
         self._run([types.float] * 2, types.double,
                   [r_singlefloat(10.5), r_singlefloat(31.5)],
-                  -4.5)
+                  -4.5, **kwds)
 
     def test_simple_call_singlefloat(self, **kwds):
         kwds.setdefault('supports_singlefloats', True)
+        kwds['expected_call_release_gil_i'] = 
kwds.pop('expected_call_release_gil', 1)
         self._run([types.float] * 2, types.float,
                   [r_singlefloat(10.5), r_singlefloat(31.5)],
                   r_singlefloat(-4.5), **kwds)
@@ -192,10 +204,12 @@
     def test_simple_call_longdouble(self):
         # longdouble is not supported, so we expect NOT to generate a 
call_release_gil
         self._run([types.longdouble] * 2, types.longdouble, [12.3, 45.6], 78.9,
-                  expected_call_release_gil=0)
+                  expected_call_release_gil_i=0, expected_call_release_gil_f=0,
+            )
 
     def test_returns_none(self):
-        self._run([types.signed] * 2, types.void, [456, 789], None)
+        self._run([types.signed] * 2, types.void, [456, 789], None,
+                  expected_call_release_gil_i=0, expected_call_release_gil_n=1)
 
     def test_returns_signedchar(self):
         self._run([types.sint8], types.sint8,
diff --git a/rpython/jit/metainterp/test/test_immutable.py 
b/rpython/jit/metainterp/test/test_immutable.py
--- a/rpython/jit/metainterp/test/test_immutable.py
+++ b/rpython/jit/metainterp/test/test_immutable.py
@@ -19,7 +19,7 @@
             return y.x + 5
         res = self.interp_operations(f, [23])
         assert res == 28
-        self.check_operations_history(getfield_gc=0, getfield_gc_pure=1, 
int_add=1)
+        self.check_operations_history(getfield_gc_i=0, getfield_gc_pure_i=1, 
int_add=1)
 
     def test_fields_subclass(self):
         class X(object):
@@ -41,7 +41,7 @@
             return z.x + z.y + 5
         res = self.interp_operations(f, [23, 11])
         assert res == 39
-        self.check_operations_history(getfield_gc=0, getfield_gc_pure=2,
+        self.check_operations_history(getfield_gc_i=0, getfield_gc_pure_i=2,
                                       int_add=2)
 
         def f(x, y):
@@ -50,7 +50,7 @@
             return z.x + z.y + 5
         res = self.interp_operations(f, [23, 11])
         assert res == 39
-        self.check_operations_history(getfield_gc=0, getfield_gc_pure=2,
+        self.check_operations_history(getfield_gc_i=0, getfield_gc_pure_i=2,
                                       int_add=2)
 
     def test_array(self):
@@ -66,8 +66,8 @@
             return a.y[index]
         res = self.interp_operations(f, [2], listops=True)
         assert res == 30
-        self.check_operations_history(getfield_gc=0, getfield_gc_pure=1,
-                            getarrayitem_gc=0, getarrayitem_gc_pure=1)
+        self.check_operations_history(getfield_gc_r=0, getfield_gc_pure_r=1,
+                            getarrayitem_gc_i=0, getarrayitem_gc_pure_i=1)
 
     def test_array_index_error(self):
         class X(object):
@@ -89,8 +89,8 @@
             return a.get(index)
         res = self.interp_operations(f, [2], listops=True)
         assert res == 30
-        self.check_operations_history(getfield_gc=0, getfield_gc_pure=1,
-                            getarrayitem_gc=0, getarrayitem_gc_pure=1)
+        self.check_operations_history(getfield_gc_r=0, getfield_gc_pure_r=1,
+                            getarrayitem_gc_i=0, getarrayitem_gc_pure_i=1)
 
     def test_array_in_immutable(self):
         class X(object):
@@ -106,8 +106,9 @@
             return y.lst[index] + y.y + 5
         res = self.interp_operations(f, [23, 0], listops=True)
         assert res == 23 + 24 + 5
-        self.check_operations_history(getfield_gc=0, getfield_gc_pure=2,
-                            getarrayitem_gc=0, getarrayitem_gc_pure=1,
+        self.check_operations_history(getfield_gc_r=0, getfield_gc_pure_r=1,
+                                      getfield_gc_pure_i=1,
+                            getarrayitem_gc_i=0, getarrayitem_gc_pure_i=1,
                             int_add=3)
 
 
@@ -135,15 +136,15 @@
         #
         res = self.interp_operations(f, [0], disable_optimizations=True)
         assert res == 42
-        self.check_operations_history(getfield_raw_pure=1,
-                                      getarrayitem_raw_pure=1,
+        self.check_operations_history(getfield_raw_pure_i=1,
+                                      getarrayitem_raw_pure_i=1,
                                       int_mul=1)
         #
         # second try, in which we get num=0 constant-folded through f()
         res = self.interp_operations(f, [-1], disable_optimizations=True)
         assert res == 42
-        self.check_operations_history(getfield_raw_pure=0,
-                                      getarrayitem_raw_pure=0,
+        self.check_operations_history(getfield_raw_pure_i=0,
+                                      getarrayitem_raw_pure_i=0,
                                       int_mul=0)
 
     def test_read_on_promoted(self):
diff --git a/rpython/jit/metainterp/test/test_math.py 
b/rpython/jit/metainterp/test/test_math.py
--- a/rpython/jit/metainterp/test/test_math.py
+++ b/rpython/jit/metainterp/test/test_math.py
@@ -13,31 +13,31 @@
 
         res = self.interp_operations(f, [0.0])
         assert res == 0.0
-        self.check_operations_history(call_pure=1)
+        self.check_operations_history(call_pure_f=1)
         #
         res = self.interp_operations(f, [25.0])
         assert res == 5.0
-        self.check_operations_history(call_pure=1)
+        self.check_operations_history(call_pure_f=1)
         #
         res = self.interp_operations(f, [-0.0])
         assert str(res) == '-0.0'
-        self.check_operations_history(call_pure=1)
+        self.check_operations_history(call_pure_f=1)
         #
         res = self.interp_operations(f, [1000000.0])
         assert res == 1000.0
-        self.check_operations_history(call_pure=1)
+        self.check_operations_history(call_pure_f=1)
         #
         res = self.interp_operations(f, [-1.0])
         assert res == -INFINITY
-        self.check_operations_history(call_pure=0)
+        self.check_operations_history(call_pure_f=0)
         #
         res = self.interp_operations(f, [INFINITY])
         assert isinf(res) and not isnan(res) and res > 0.0
-        self.check_operations_history(call_pure=0)
+        self.check_operations_history(call_pure_f=0)
         #
         res = self.interp_operations(f, [NAN])
         assert isnan(res) and not isinf(res)
-        self.check_operations_history(call_pure=0)
+        self.check_operations_history(call_pure_f=0)
 
 
 class TestLLtype(MathTests, LLJitMixin):
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to