diff options
Diffstat (limited to 'numpy/core/tests/test_multiarray.py')
-rw-r--r-- | numpy/core/tests/test_multiarray.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py index 6697b8131..5fb53fbb1 100644 --- a/numpy/core/tests/test_multiarray.py +++ b/numpy/core/tests/test_multiarray.py @@ -2650,17 +2650,21 @@ if sys.version_info >= (2, 6): x = np.array([1,2,3], dtype='<i4') self._check_roundtrip(x) + # check long long can be represented as non-native + x = np.array([1, 2, 3], dtype='>q') + self._check_roundtrip(x) + # Native-only data types can be passed through the buffer interface # only in native byte order if sys.byteorder == 'little': - x = np.array([1,2,3], dtype='>q') + x = np.array([1,2,3], dtype='>g') assert_raises(ValueError, self._check_roundtrip, x) - x = np.array([1,2,3], dtype='<q') + x = np.array([1,2,3], dtype='<g') self._check_roundtrip(x) else: - x = np.array([1,2,3], dtype='>q') + x = np.array([1,2,3], dtype='>g') self._check_roundtrip(x) - x = np.array([1,2,3], dtype='<q') + x = np.array([1,2,3], dtype='<g') assert_raises(ValueError, self._check_roundtrip, x) def test_roundtrip_half(self): @@ -2746,9 +2750,9 @@ if sys.version_info >= (2, 6): sz = sum([dtype(b).itemsize for a, b in dt]) if dtype('l').itemsize == 4: - assert_equal(y.format, 'T{b:a:=h:b:i:c:l:d:^q:dx:B:e:@H:f:=I:g:L:h:^Q:hx:=f:i:d:j:^g:k:=Zf:ix:Zd:jx:^Zg:kx:4s:l:=4w:m:3x:n:?:o:@e:p:}') + assert_equal(y.format, 'T{b:a:=h:b:i:c:l:d:q:dx:B:e:@H:f:=I:g:L:h:Q:hx:f:i:d:j:^g:k:=Zf:ix:Zd:jx:^Zg:kx:4s:l:=4w:m:3x:n:?:o:@e:p:}') else: - assert_equal(y.format, 'T{b:a:=h:b:i:c:q:d:^q:dx:B:e:@H:f:=I:g:Q:h:^Q:hx:=f:i:d:j:^g:k:=Zf:ix:Zd:jx:^Zg:kx:4s:l:=4w:m:3x:n:?:o:@e:p:}') + assert_equal(y.format, 'T{b:a:=h:b:i:c:q:d:q:dx:B:e:@H:f:=I:g:Q:h:Q:hx:f:i:d:j:^g:k:=Zf:ix:Zd:jx:^Zg:kx:4s:l:=4w:m:3x:n:?:o:@e:p:}') assert_equal(y.strides, (sz,)) assert_equal(y.itemsize, sz) |