Skip to content

Commit dc86e04

Browse files
committed
tests: Make float and framebuf tests skip or run on big-endian archs.
Signed-off-by: Damien George <damien@micropython.org>
1 parent e7c0a8b commit dc86e04

5 files changed

Lines changed: 14 additions & 4 deletions

File tree

tests/extmod/framebuf16.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
try:
2-
import framebuf
2+
import framebuf, usys
33
except ImportError:
44
print("SKIP")
55
raise SystemExit
66

7+
# This test and its .exp file is based on a little-endian architecture.
8+
if usys.byteorder != "little":
9+
print("SKIP")
10+
raise SystemExit
11+
712

813
def printbuf():
914
print("--8<--")

tests/extmod/framebuf_subclass.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
# test subclassing framebuf.FrameBuffer
22

33
try:
4-
import framebuf
4+
import framebuf, usys
55
except ImportError:
66
print("SKIP")
77
raise SystemExit
88

9+
# This test and its .exp file is based on a little-endian architecture.
10+
if usys.byteorder != "little":
11+
print("SKIP")
12+
raise SystemExit
13+
914

1015
class FB(framebuf.FrameBuffer):
1116
def __init__(self, n):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# test construction of bytearray from array with float type
1+
# test construction of bytes from array with float type
22

33
try:
44
from uarray import array

tests/float/float_array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ def test(a):
2222
test(array("f"))
2323
test(array("d"))
2424

25-
print("{:.4f}".format(array("f", b"\xcc\xcc\xcc=")[0]))
25+
print("{:.4f}".format(array("f", bytes(array("I", [0x3DCCCCCC])))[0]))

0 commit comments

Comments
 (0)