summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2021-05-20 10:02:57 +1000
committerDamien George <damien@micropython.org>2021-05-26 16:33:18 +1000
commitdc86e044761a132ddd7026f0f9555f958ba8046a (patch)
treefd1af22fda4afd5a364aff29013ac9af57b3bd92
parente7c0a8bca31063c295afdaf8e49c8ab24b70a90d (diff)
downloadmicropython-dc86e044761a132ddd7026f0f9555f958ba8046a.tar.gz
micropython-dc86e044761a132ddd7026f0f9555f958ba8046a.zip
tests: Make float and framebuf tests skip or run on big-endian archs.
Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--tests/extmod/framebuf16.py7
-rw-r--r--tests/extmod/framebuf_subclass.py7
-rw-r--r--tests/float/bytearray_construct_endian.py (renamed from tests/float/bytearray_construct.py)0
-rw-r--r--tests/float/bytes_construct_endian.py (renamed from tests/float/bytes_construct.py)2
-rw-r--r--tests/float/float_array.py2
5 files changed, 14 insertions, 4 deletions
diff --git a/tests/extmod/framebuf16.py b/tests/extmod/framebuf16.py
index e658f1345a..cd7f5ec015 100644
--- a/tests/extmod/framebuf16.py
+++ b/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<--")
diff --git a/tests/extmod/framebuf_subclass.py b/tests/extmod/framebuf_subclass.py
index aad5d2a1e9..a9e3c5efc7 100644
--- a/tests/extmod/framebuf_subclass.py
+++ b/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):
diff --git a/tests/float/bytearray_construct.py b/tests/float/bytearray_construct_endian.py
index 257d37d1be..257d37d1be 100644
--- a/tests/float/bytearray_construct.py
+++ b/tests/float/bytearray_construct_endian.py
diff --git a/tests/float/bytes_construct.py b/tests/float/bytes_construct_endian.py
index 0806087b0e..208f56162f 100644
--- a/tests/float/bytes_construct.py
+++ b/tests/float/bytes_construct_endian.py
@@ -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
diff --git a/tests/float/float_array.py b/tests/float/float_array.py
index 3c2189869b..219b6b86ae 100644
--- a/tests/float/float_array.py
+++ b/tests/float/float_array.py
@@ -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]))