summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/extmod/framebuf1.py2
-rw-r--r--tests/extmod/framebuf1.py.exp108
-rw-r--r--tests/extmod/framebuf2.py2
3 files changed, 56 insertions, 56 deletions
diff --git a/tests/extmod/framebuf1.py b/tests/extmod/framebuf1.py
index c8e013226..d35674a70 100644
--- a/tests/extmod/framebuf1.py
+++ b/tests/extmod/framebuf1.py
@@ -6,7 +6,7 @@ except ImportError:
w = 5
h = 16
-size = w * h // 8
+size = ((w + 7) & ~7) * ((h + 7) & ~7) // 8
buf = bytearray(size)
maps = {
framebuf.MONO_VLSB: "MONO_VLSB",
diff --git a/tests/extmod/framebuf1.py.exp b/tests/extmod/framebuf1.py.exp
index d954623de..b9cd97835 100644
--- a/tests/extmod/framebuf1.py.exp
+++ b/tests/extmod/framebuf1.py.exp
@@ -1,68 +1,68 @@
MONO_VLSB
0
-bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff')
-bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-bytearray(b'\x01\x00\x00\x00\x01\x80\x00\x00\x00\x80')
-bytearray(b'\x01\x00\x00\x00\x01\x80\x00\x00\x00\x00')
+bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x01\x00\x00\x00\x01\x80\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x01\x00\x00\x00\x01\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
1 0
-hline bytearray(b'\x02\x02\x02\x02\x02\x00\x00\x00\x00\x00')
-vline bytearray(b'\x00\xff\x00\x00\x00\x00\xff\x00\x00\x00')
-rect bytearray(b'\x00\x0e\n\x0e\x00\x00\x00\x00\x00\x00')
-fill_rect bytearray(b'\x00\x0e\x0e\x0e\x00\x00\x00\x00\x00\x00')
-line bytearray(b'\x00\x02\x04\x08\x00\x00\x00\x00\x00\x00')
-line bytearray(b'\x00\x00\x06\x08\x00\x00\x00\x00\x00\x00')
-bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00')
-bytearray(b'\x00\x00@\x00\x00\x00\x00\x00\x00\x00')
-bytearray(b'\x00\x00\x00@\x00\x00\x00\x00\x00\x00')
-bytearray(b'\x00\x00@\x00\x00\x00\x00\x00\x00\x00')
-bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01')
-bytearray(b'\x00\x7f\x7f\x04\x04\x00\x00\x00\x00\x00')
-bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-bytearray(b'\xaaU\xaaU\xaa\x00\x00\x00\x00\x00')
+hline bytearray(b'\x02\x02\x02\x02\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+vline bytearray(b'\x00\xff\x00\x00\x00\x00\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+rect bytearray(b'\x00\x0e\n\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+fill_rect bytearray(b'\x00\x0e\x0e\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+line bytearray(b'\x00\x02\x04\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+line bytearray(b'\x00\x00\x06\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x00\x7f\x7f\x04\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\xaaU\xaaU\xaa\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
MONO_HLSB
0
-bytearray(b'\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8')
-bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-bytearray(b'\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-bytearray(b'\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8')
+bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x88')
+bytearray(b'\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80')
1 0
-hline bytearray(b'\x00\xf8\x00\x00\x00\x00\x00\x00\x00\x00')
-vline bytearray(b'@@@@@@@@@@')
-rect bytearray(b'\x00pPp\x00\x00\x00\x00\x00\x00')
-fill_rect bytearray(b'\x00ppp\x00\x00\x00\x00\x00\x00')
-line bytearray(b'\x00@ \x10\x00\x00\x00\x00\x00\x00')
-line bytearray(b'\x00 \x10\x00\x00\x00\x00\x00\x00')
-bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00 \x00')
-bytearray(b'\x00\x00\x00\x00\x00\x00 \x00\x00\x00')
-bytearray(b'\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00')
-bytearray(b'\x00\x00\x00\x00\x00\x00 \x00\x00\x00')
-bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00')
-bytearray(b'``x````\x00\x00\x00')
-bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-bytearray(b'P\xa8P\xa8P\xa8P\xa8\x00\x00')
+hline bytearray(b'\x00\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+vline bytearray(b'@@@@@@@@@@@@@@@@')
+rect bytearray(b'\x00pPp\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+fill_rect bytearray(b'\x00ppp\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+line bytearray(b'\x00@ \x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+line bytearray(b'\x00 \x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x00\x00\x00\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x00\x00\x00\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'``x````\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'P\xa8P\xa8P\xa8P\xa8\x00\x00\x00\x00\x00\x00\x00\x00')
MONO_HMSB
0
-bytearray(b'\x1f\x1f\x1f\x1f\x1f\x1f\x1f\x1f\x1f\x1f')
-bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-bytearray(b'\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-bytearray(b'\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x1f\x1f\x1f\x1f\x1f\x1f\x1f\x1f\x1f\x1f\x1f\x1f\x1f\x1f\x1f\x1f')
+bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11')
+bytearray(b'\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01')
1 0
-hline bytearray(b'\x00\x1f\x00\x00\x00\x00\x00\x00\x00\x00')
-vline bytearray(b'\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02')
-rect bytearray(b'\x00\x0e\n\x0e\x00\x00\x00\x00\x00\x00')
-fill_rect bytearray(b'\x00\x0e\x0e\x0e\x00\x00\x00\x00\x00\x00')
-line bytearray(b'\x00\x02\x04\x08\x00\x00\x00\x00\x00\x00')
-line bytearray(b'\x00\x04\x04\x08\x00\x00\x00\x00\x00\x00')
-bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00')
-bytearray(b'\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00')
-bytearray(b'\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00')
-bytearray(b'\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00')
-bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00')
-bytearray(b'\x06\x06\x1e\x06\x06\x06\x06\x00\x00\x00')
-bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-bytearray(b'\n\x15\n\x15\n\x15\n\x15\x00\x00')
+hline bytearray(b'\x00\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+vline bytearray(b'\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02')
+rect bytearray(b'\x00\x0e\n\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+fill_rect bytearray(b'\x00\x0e\x0e\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+line bytearray(b'\x00\x02\x04\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+line bytearray(b'\x00\x04\x04\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x06\x06\x1e\x06\x06\x06\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+bytearray(b'\n\x15\n\x15\n\x15\n\x15\x00\x00\x00\x00\x00\x00\x00\x00')
ValueError
True
diff --git a/tests/extmod/framebuf2.py b/tests/extmod/framebuf2.py
index 097057fe9..408a483be 100644
--- a/tests/extmod/framebuf2.py
+++ b/tests/extmod/framebuf2.py
@@ -48,7 +48,7 @@ printbuf()
w2 = 2
h2 = 3
-buf2 = bytearray(w2 * h2 // 4)
+buf2 = bytearray(h2 * ((w2 + 3) // 4))
fbuf2 = framebuf.FrameBuffer(buf2, w2, h2, framebuf.GS2_HMSB)
# blit