Skip to content

Commit

Permalink
tests: Make float and framebuf tests skip or run on big-endian archs.
Browse files Browse the repository at this point in the history
Signed-off-by: Damien George <damien@micropython.org>
  • Loading branch information
dpgeorge committed May 20, 2021
1 parent 73363d5 commit a3059cf
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
7 changes: 6 additions & 1 deletion tests/extmod/framebuf16.py
@@ -1,9 +1,14 @@
try:
import framebuf
import framebuf, usys
except ImportError:
print("SKIP")
raise SystemExit

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


def printbuf():
print("--8<--")
Expand Down
7 changes: 6 additions & 1 deletion tests/extmod/framebuf_subclass.py
@@ -1,11 +1,16 @@
# test subclassing framebuf.FrameBuffer

try:
import framebuf
import framebuf, usys
except ImportError:
print("SKIP")
raise SystemExit

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


class FB(framebuf.FrameBuffer):
def __init__(self, n):
Expand Down
File renamed without changes.
@@ -1,4 +1,4 @@
# test construction of bytearray from array with float type
# test construction of bytes from array with float type

try:
from uarray import array
Expand Down
2 changes: 1 addition & 1 deletion tests/float/float_array.py
Expand Up @@ -22,4 +22,4 @@ def test(a):
test(array("f"))
test(array("d"))

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

0 comments on commit a3059cf

Please sign in to comment.