Author: mattip <[email protected]>
Branch: missing-ndarray-attributes
Changeset: r60247:a9de6c414b4d
Date: 2013-01-20 21:03 +0200
http://bitbucket.org/pypy/pypy/changeset/a9de6c414b4d/

Log:    failing test for byteswap on longfloat

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
@@ -1674,6 +1674,12 @@
         s3 = [s1[1], s1[0],s1[3], s1[2], s1[5], s1[4]]
         assert s3 == s2
 
+        a = array([1, -1, 10000], dtype='longfloat')
+        s1 = map(ord,a.tostring())
+        s2 = map(ord, a.byteswap().tostring())
+        n = a.dtype.itemsize
+        assert s1[n-1] == s2[0]
+
     def test_clip(self):
         from _numpypy import array
         a = array([1, 2, 17, -3, 12])
diff --git a/pypy/rlib/rarithmetic.py b/pypy/rlib/rarithmetic.py
--- a/pypy/rlib/rarithmetic.py
+++ b/pypy/rlib/rarithmetic.py
@@ -623,6 +623,8 @@
         is_float = True
         T = rffi.LONGLONG
         arg = float2longlong(arg)
+    elif T == lltype.LongFloat:
+        raise NotImplemented('cannot byteswap LongFloat')
     else:
         # we cannot do arithmetics on small ints
         arg = widen(arg)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to