diff options
author | Alex March <alex.march.dev@gmail.com> | 2016-10-26 11:36:06 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-11-03 00:10:17 +1100 |
commit | 94aeba0427cc80e43b59c4155e02e8cb7c327951 (patch) | |
tree | d945e1599f0a01308065145740e4a27ffc240c9d | |
parent | f9b6b37cf65c4f65c4ad461d439fbf624c0f10c1 (diff) | |
download | micropython-94aeba0427cc80e43b59c4155e02e8cb7c327951.tar.gz micropython-94aeba0427cc80e43b59c4155e02e8cb7c327951.zip |
tests/extmod/framebuf1: Test framebuffer pixel clear, and text function.
-rw-r--r-- | tests/extmod/framebuf1.py | 15 | ||||
-rw-r--r-- | tests/extmod/framebuf1.py.exp | 4 |
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/extmod/framebuf1.py b/tests/extmod/framebuf1.py index f550b6b4f4..52899028c7 100644 --- a/tests/extmod/framebuf1.py +++ b/tests/extmod/framebuf1.py @@ -23,6 +23,10 @@ fbuf.pixel(0, 15, 1) fbuf.pixel(4, 15, 1) print(buf) +# clear pixel +fbuf.pixel(4, 15, 0) +print(buf) + # get pixel print(fbuf.pixel(0, 0), fbuf.pixel(1, 1)) @@ -39,3 +43,14 @@ fbuf.scroll(-1, 0) print(buf) fbuf.scroll(2, 2) print(buf) + +# print text +fbuf.fill(0) +fbuf.text("hello", 0, 0, 1) +print(buf) +fbuf.text("hello", 0, 0, 0) # clear +print(buf) + +# char out of font range set to chr(127) +fbuf.text(str(chr(31)), 0, 0) +print(buf) diff --git a/tests/extmod/framebuf1.py.exp b/tests/extmod/framebuf1.py.exp index 8fd8c37098..1577faac8a 100644 --- a/tests/extmod/framebuf1.py.exp +++ b/tests/extmod/framebuf1.py.exp @@ -1,9 +1,13 @@ 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') 1 0 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') |