summaryrefslogtreecommitdiff
path: root/tests/micropython/ringio_big.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/micropython/ringio_big.py')
-rw-r--r--tests/micropython/ringio_big.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/micropython/ringio_big.py b/tests/micropython/ringio_big.py
new file mode 100644
index 000000000..d55c4c00b
--- /dev/null
+++ b/tests/micropython/ringio_big.py
@@ -0,0 +1,29 @@
+# Check that micropython.RingIO works correctly.
+
+import micropython
+
+try:
+ micropython.RingIO
+except AttributeError:
+ print("SKIP")
+ raise SystemExit
+
+try:
+ # The maximum possible size
+ micropython.RingIO(bytearray(65535))
+ micropython.RingIO(65534)
+
+ try:
+ # Buffer may not be too big
+ micropython.RingIO(bytearray(65536))
+ except ValueError as ex:
+ print(type(ex))
+
+ try:
+ # Size may not be too big
+ micropython.RingIO(65535)
+ except ValueError as ex:
+ print(type(ex))
+except MemoryError:
+ print("SKIP")
+ raise SystemExit