[pypy-commit] pypy unsigned-dtypes: fix the test I think

justinpeel noreply at buildbot.pypy.org
Thu Sep 8 21:34:42 CEST 2011


Author: Justin Peel <notmuchtotell at gmail.com>
Branch: unsigned-dtypes
Changeset: r47170:67ef7976413c
Date: 2011-09-08 13:34 -0600
http://bitbucket.org/pypy/pypy/changeset/67ef7976413c/

Log:	fix the test I think

diff --git a/pypy/module/micronumpy/test/test_zjit.py b/pypy/module/micronumpy/test/test_zjit.py
--- a/pypy/module/micronumpy/test/test_zjit.py
+++ b/pypy/module/micronumpy/test/test_zjit.py
@@ -1,7 +1,7 @@
 from pypy.jit.metainterp.test.support import LLJitMixin
 from pypy.module.micronumpy import interp_ufuncs, signature
 from pypy.module.micronumpy.compile import (numpy_compile, FakeSpace,
-    FloatObject)
+    FloatObject, IntObject)
 from pypy.module.micronumpy.interp_dtype import W_Float64Dtype, W_Int64Dtype, W_UInt64Dtype
 from pypy.module.micronumpy.interp_numarray import (BaseArray, SingleDimArray,
     SingleDimSlice, scalar_w)
@@ -311,15 +311,17 @@
 
         def f(n):
             if NonConstant(False):
+                dtype = float64_dtype
+            else:
                 dtype = uint64_dtype
-            else:
-                dtype = float64_dtype
             ar = SingleDimArray(n, dtype=dtype)
-            for i in range(n):
+            i = 0
+            while i < n:
                 ar.get_concrete().setitem(i, uint64_dtype.box(7))
-            v = ar.descr_mod(space, ar).descr_sum(space)
-            assert isinstance(v, FloatObject)
-            return v.floatval
+                i += 1
+            v = ar.descr_add(space, ar).descr_sum(space)
+            assert isinstance(v, IntObject)
+            return v.intval
 
         result = self.meta_interp(f, [5], listops=True, backendopt=True)
         assert result == f(5)


More information about the pypy-commit mailing list