Author: Brian Kearns <[email protected]>
Branch:
Changeset: r68523:dfa3a3ad98e7
Date: 2013-12-20 19:52 -0500
http://bitbucket.org/pypy/pypy/changeset/dfa3a3ad98e7/
Log: extra test
diff --git a/pypy/module/micronumpy/test/test_numarray.py
b/pypy/module/micronumpy/test/test_numarray.py
--- a/pypy/module/micronumpy/test/test_numarray.py
+++ b/pypy/module/micronumpy/test/test_numarray.py
@@ -3248,6 +3248,7 @@
d = dtype([("x", "int", 3), ("y", "float", 5)])
a = zeros((), dtype=d)
+ #assert a['x'].dtype == int
#assert a['x'].shape == (3,)
#assert (a['x'] == [0, 0, 0]).all()
@@ -3270,6 +3271,13 @@
a[0]["x"][0] = 200
assert a[0]["x"][0] == 200
+ a[1]["x"][2] = 123
+ assert (a[1]["x"] == [4, 5, 123]).all()
+ a[1]['y'][3] = 4
+ assert a[1]['y'][3] == 4
+ assert a['y'][1][3] == 4
+ a['y'][1][4] = 5
+ assert a[1]['y'][4] == 5
d = dtype([("x", "int64", (2, 3))])
a = array([([[1, 2, 3], [4, 5, 6]],)], dtype=d)
diff --git a/pypy/module/micronumpy/types.py b/pypy/module/micronumpy/types.py
--- a/pypy/module/micronumpy/types.py
+++ b/pypy/module/micronumpy/types.py
@@ -1762,7 +1762,9 @@
@jit.unroll_safe
def store(self, arr, i, ofs, box):
+ assert i == 0
assert isinstance(box, interp_boxes.W_VoidBox)
+ assert box.dtype is box.arr.dtype
for k in range(box.arr.dtype.get_size()):
arr.storage[k + ofs] = box.arr.storage[k + box.ofs]
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit