Author: Antonio Cuni <[email protected]>
Branch: faster-rstruct
Changeset: r80816:8846f2974ae5
Date: 2015-11-21 15:51 +0100
http://bitbucket.org/pypy/pypy/changeset/8846f2974ae5/

Log:    blindly try to make this test passing on big-endian machines

diff --git a/rpython/jit/metainterp/test/test_strstorage.py 
b/rpython/jit/metainterp/test/test_strstorage.py
--- a/rpython/jit/metainterp/test/test_strstorage.py
+++ b/rpython/jit/metainterp/test/test_strstorage.py
@@ -1,4 +1,5 @@
 import py
+import sys
 import struct
 from rpython.rtyper.lltypesystem import lltype, rffi
 from rpython.rlib.strstorage import str_storage_getitem
@@ -30,9 +31,13 @@
 
 
     def test_force_virtual_str_storage(self):
+        byteorder = sys.byteorder
         size = rffi.sizeof(lltype.Signed)
         def f(val):
-            x = chr(val) + '\x00'*(size-1)
+            if byteorder == 'little':
+                x = chr(val) + '\x00'*(size-1)
+            else:
+                x = '\x00'*(size-1) + chr(val)
             return str_storage_getitem(lltype.Signed, x, 0)
         res = self.interp_operations(f, [42], supports_singlefloats=True)
         assert res == 42
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to