summaryrefslogtreecommitdiffstatshomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/extmod/framebuf_bounds.py30
-rw-r--r--tests/extmod/framebuf_bounds.py.exp30
2 files changed, 60 insertions, 0 deletions
diff --git a/tests/extmod/framebuf_bounds.py b/tests/extmod/framebuf_bounds.py
index 3035b365bb..2a7647cfba 100644
--- a/tests/extmod/framebuf_bounds.py
+++ b/tests/extmod/framebuf_bounds.py
@@ -21,11 +21,25 @@ test_constructor(bytearray(20), 10, 10, framebuf.MONO_HLSB, 11)
test_constructor(bytearray(20), 10, 10, framebuf.MONO_HLSB, 10)
test_constructor(bytearray(20), 10, 10, framebuf.MONO_HLSB, 9)
test_constructor(bytearray(20), 10, 10, framebuf.MONO_HLSB, -1)
+test_constructor(bytearray(20), 10, 10, framebuf.MONO_HLSB, 16)
+test_constructor(bytearray(20), 10, 10, framebuf.MONO_HLSB, 17)
+test_constructor(bytearray(19), 8, 10, framebuf.MONO_HLSB, 16)
+test_constructor(bytearray(18), 8, 10, framebuf.MONO_HLSB, 9)
+test_constructor(bytearray(19), 8, 10, framebuf.MONO_HLSB, 16)
print(framebuf.MONO_VLSB)
test_constructor(bytearray(8), 8, 1, framebuf.MONO_VLSB)
test_constructor(bytearray(7), 8, 1, framebuf.MONO_VLSB)
test_constructor(bytearray(8), 8, 8, framebuf.MONO_VLSB)
+test_constructor(bytearray(1), 1, 8, framebuf.MONO_VLSB)
+test_constructor(bytearray(1), 1, 9, framebuf.MONO_VLSB)
+test_constructor(bytearray(2), 1, 9, framebuf.MONO_VLSB)
+test_constructor(bytearray(1), 1, 8, framebuf.MONO_VLSB, 10)
+test_constructor(bytearray(8), 8, 8, framebuf.MONO_VLSB, 10)
+test_constructor(bytearray(8), 8, 8, framebuf.MONO_VLSB, 7)
+test_constructor(bytearray(11), 1, 9, framebuf.MONO_VLSB, 10)
+test_constructor(bytearray(10), 1, 9, framebuf.MONO_VLSB, 10)
+test_constructor(bytearray(11), 1, 16, framebuf.MONO_VLSB, 10)
for f in (framebuf.MONO_HLSB, framebuf.MONO_HMSB):
print(f)
@@ -40,21 +54,37 @@ test_constructor(bytearray(8), 4, 8, framebuf.GS2_HMSB)
test_constructor(bytearray(15), 5, 8, framebuf.GS2_HMSB)
test_constructor(bytearray(16), 5, 8, framebuf.GS2_HMSB)
test_constructor(bytearray(9), 4, 9, framebuf.GS2_HMSB)
+test_constructor(bytearray(2), 7, 1, framebuf.GS2_HMSB, 9)
+test_constructor(bytearray(4), 7, 2, framebuf.GS2_HMSB, 9)
+test_constructor(bytearray(5), 7, 2, framebuf.GS2_HMSB, 9)
print(framebuf.GS4_HMSB)
test_constructor(bytearray(8), 2, 8, framebuf.GS4_HMSB)
test_constructor(bytearray(15), 3, 8, framebuf.GS4_HMSB)
test_constructor(bytearray(16), 3, 8, framebuf.GS4_HMSB)
test_constructor(bytearray(9), 2, 9, framebuf.GS4_HMSB)
+test_constructor(bytearray(4), 7, 1, framebuf.GS4_HMSB, 9)
+test_constructor(bytearray(8), 7, 2, framebuf.GS4_HMSB, 9)
+test_constructor(bytearray(9), 7, 2, framebuf.GS4_HMSB, 9)
print(framebuf.GS8)
test_constructor(bytearray(63), 8, 8, framebuf.GS8)
test_constructor(bytearray(64), 8, 8, framebuf.GS8)
test_constructor(bytearray(64), 9, 8, framebuf.GS8)
test_constructor(bytearray(64), 8, 9, framebuf.GS8)
+test_constructor(bytearray(64), 4, 8, framebuf.GS8, 8)
+test_constructor(bytearray(64), 4, 8, framebuf.GS8, 9)
+test_constructor(bytearray(8), 8, 1, framebuf.GS8, 10)
+test_constructor(bytearray(17), 8, 2, framebuf.GS8, 10)
+test_constructor(bytearray(18), 8, 2, framebuf.GS8, 10)
print(framebuf.RGB565)
test_constructor(bytearray(127), 8, 8, framebuf.RGB565)
test_constructor(bytearray(128), 8, 8, framebuf.RGB565)
test_constructor(bytearray(128), 9, 8, framebuf.RGB565)
test_constructor(bytearray(128), 8, 9, framebuf.RGB565)
+test_constructor(bytearray(128), 4, 8, framebuf.RGB565, 8)
+test_constructor(bytearray(128), 4, 8, framebuf.RGB565, 9)
+test_constructor(bytearray(16), 8, 1, framebuf.RGB565, 10)
+test_constructor(bytearray(34), 8, 2, framebuf.RGB565, 10)
+test_constructor(bytearray(36), 8, 2, framebuf.RGB565, 10)
diff --git a/tests/extmod/framebuf_bounds.py.exp b/tests/extmod/framebuf_bounds.py.exp
index 3125013bc9..b9c221b42f 100644
--- a/tests/extmod/framebuf_bounds.py.exp
+++ b/tests/extmod/framebuf_bounds.py.exp
@@ -6,10 +6,24 @@ Valid
Valid
ValueError
ValueError
+Valid
+ValueError
+Valid
+ValueError
+Valid
0
Valid
ValueError
Valid
+Valid
+ValueError
+Valid
+Valid
+Valid
+ValueError
+Valid
+ValueError
+Valid
3
Valid
ValueError
@@ -27,18 +41,34 @@ Valid
ValueError
Valid
Valid
+Valid
+ValueError
+Valid
2
Valid
ValueError
Valid
Valid
+Valid
+ValueError
+Valid
6
ValueError
Valid
ValueError
ValueError
+Valid
+ValueError
+Valid
+ValueError
+Valid
1
ValueError
Valid
ValueError
ValueError
+Valid
+ValueError
+Valid
+ValueError
+Valid