summaryrefslogtreecommitdiff
path: root/tests/micropython/ringio_big.py
blob: d55c4c00b7c0d84a05dc355d47e6d97862401b8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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