Author: Justin Peel <[email protected]>
Branch: unsigned-dtypes
Changeset: r47375:6f8397e5f89a
Date: 2011-09-20 19:15 +0000
http://bitbucket.org/pypy/pypy/changeset/6f8397e5f89a/
Log: change the mod test to a simpler int32 sum test while fixing.
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
@@ -2,7 +2,7 @@
from pypy.module.micronumpy import interp_ufuncs, signature
from pypy.module.micronumpy.compile import (numpy_compile, FakeSpace,
FloatObject, IntObject)
-from pypy.module.micronumpy.interp_dtype import W_Float64Dtype, W_Int64Dtype,
W_UInt64Dtype
+from pypy.module.micronumpy.interp_dtype import W_Int32Dtype, W_Float64Dtype,
W_Int64Dtype, W_UInt64Dtype
from pypy.module.micronumpy.interp_numarray import (BaseArray, SingleDimArray,
SingleDimSlice, scalar_w)
from pypy.rlib.nonconst import NonConstant
@@ -16,6 +16,7 @@
cls.float64_dtype = cls.space.fromcache(W_Float64Dtype)
cls.int64_dtype = cls.space.fromcache(W_Int64Dtype)
cls.uint64_dtype = cls.space.fromcache(W_UInt64Dtype)
+ cls.int32_dtype = cls.space.fromcache(W_Int32Dtype)
def test_add(self):
def f(i):
@@ -304,22 +305,22 @@
'int_lt': 1, 'guard_true': 1, 'jump': 1})
assert result == 11.0
- def test_uint64_mod(self):
+ def test_int32_sum(self):
space = self.space
float64_dtype = self.float64_dtype
- uint64_dtype = self.uint64_dtype
+ int32_dtype = self.int32_dtype
def f(n):
if NonConstant(False):
dtype = float64_dtype
else:
- dtype = uint64_dtype
+ dtype = int32_dtype
ar = SingleDimArray(n, dtype=dtype)
i = 0
while i < n:
- ar.get_concrete().setitem(i, uint64_dtype.box(7))
+ ar.get_concrete().setitem(i, int32_dtype.box(7))
i += 1
- v = ar.descr_mod(space, ar).descr_sum(space)
+ v = ar.descr_add(space, ar).descr_sum(space)
assert isinstance(v, IntObject)
return v.intval
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit