tests: Make float and framebuf tests skip or run on big-endian archs.
Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
e7c0a8bca3
commit
dc86e04476
|
@ -1,9 +1,14 @@
|
||||||
try:
|
try:
|
||||||
import framebuf
|
import framebuf, usys
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print("SKIP")
|
print("SKIP")
|
||||||
raise SystemExit
|
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():
|
def printbuf():
|
||||||
print("--8<--")
|
print("--8<--")
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
# test subclassing framebuf.FrameBuffer
|
# test subclassing framebuf.FrameBuffer
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import framebuf
|
import framebuf, usys
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print("SKIP")
|
print("SKIP")
|
||||||
raise SystemExit
|
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):
|
class FB(framebuf.FrameBuffer):
|
||||||
def __init__(self, n):
|
def __init__(self, n):
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# test construction of bytearray from array with float type
|
# test construction of bytes from array with float type
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from uarray import array
|
from uarray import array
|
|
@ -22,4 +22,4 @@ def test(a):
|
||||||
test(array("f"))
|
test(array("f"))
|
||||||
test(array("d"))
|
test(array("d"))
|
||||||
|
|
||||||
print("{:.4f}".format(array("f", b"\xcc\xcc\xcc=")[0]))
|
print("{:.4f}".format(array("f", bytes(array("I", [0x3DCCCCCC])))[0]))
|
||||||
|
|
Loading…
Reference in New Issue