summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter Hinch <peter@hinch.me.uk>2017-04-01 07:00:09 +0100
committerDamien George <damien.p.george@gmail.com>2017-04-04 17:38:33 +1000
commit468c6f9da147d6e752e437a32211e317a116b6df (patch)
treea719f6e6a2b97d3ab23d59b6aa3c35e472a86790 /tests
parentfc245d1ca4367f9876ac32c7e08e169da7db79b9 (diff)
extmod/modframebuf: Make monochrome bitmap formats start with MONO_.
MONO_xxx is much easier to read if you're not familiar with the code. MVLSB is deprecated but kept for backwards compatibility, for the time being. This patch also updates the associated docs and tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/extmod/framebuf1.py7
-rw-r--r--tests/extmod/framebuf1.py.exp7
2 files changed, 8 insertions, 6 deletions
diff --git a/tests/extmod/framebuf1.py b/tests/extmod/framebuf1.py
index 0a8e1ae55..990b0b120 100644
--- a/tests/extmod/framebuf1.py
+++ b/tests/extmod/framebuf1.py
@@ -9,9 +9,9 @@ w = 5
h = 16
size = w * h // 8
buf = bytearray(size)
-maps = {framebuf.MVLSB : 'MVLSB',
- framebuf.MHLSB : 'MHLSB',
- framebuf.MHMSB : 'MHMSB'}
+maps = {framebuf.MONO_VLSB : 'MONO_VLSB',
+ framebuf.MONO_HLSB : 'MONO_HLSB',
+ framebuf.MONO_HMSB : 'MONO_HMSB'}
for mapping in maps.keys():
for x in range(size):
@@ -107,3 +107,4 @@ except ValueError:
# test legacy constructor
fbuf = framebuf.FrameBuffer1(buf, w, h)
fbuf = framebuf.FrameBuffer1(buf, w, h, w)
+print(framebuf.MVLSB == framebuf.MONO_VLSB)
diff --git a/tests/extmod/framebuf1.py.exp b/tests/extmod/framebuf1.py.exp
index 736ad7a45..d954623de 100644
--- a/tests/extmod/framebuf1.py.exp
+++ b/tests/extmod/framebuf1.py.exp
@@ -1,4 +1,4 @@
-MVLSB
+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')
@@ -20,7 +20,7 @@ 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')
-MHLSB
+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')
@@ -42,7 +42,7 @@ 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')
-MHMSB
+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')
@@ -65,3 +65,4 @@ bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\n\x15\n\x15\n\x15\n\x15\x00\x00')
ValueError
+True