Skip to content

Commit 94aeba0

Browse files
Alex Marchdpgeorge
authored andcommitted
tests/extmod/framebuf1: Test framebuffer pixel clear, and text function.
1 parent f9b6b37 commit 94aeba0

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

tests/extmod/framebuf1.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
fbuf.pixel(4, 15, 1)
2424
print(buf)
2525

26+
# clear pixel
27+
fbuf.pixel(4, 15, 0)
28+
print(buf)
29+
2630
# get pixel
2731
print(fbuf.pixel(0, 0), fbuf.pixel(1, 1))
2832

@@ -39,3 +43,14 @@
3943
print(buf)
4044
fbuf.scroll(2, 2)
4145
print(buf)
46+
47+
# print text
48+
fbuf.fill(0)
49+
fbuf.text("hello", 0, 0, 1)
50+
print(buf)
51+
fbuf.text("hello", 0, 0, 0) # clear
52+
print(buf)
53+
54+
# char out of font range set to chr(127)
55+
fbuf.text(str(chr(31)), 0, 0)
56+
print(buf)

tests/extmod/framebuf1.py.exp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff')
22
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
33
bytearray(b'\x01\x00\x00\x00\x01\x80\x00\x00\x00\x80')
4+
bytearray(b'\x01\x00\x00\x00\x01\x80\x00\x00\x00\x00')
45
1 0
56
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00')
67
bytearray(b'\x00\x00@\x00\x00\x00\x00\x00\x00\x00')
78
bytearray(b'\x00\x00\x00@\x00\x00\x00\x00\x00\x00')
89
bytearray(b'\x00\x00@\x00\x00\x00\x00\x00\x00\x00')
910
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01')
11+
bytearray(b'\x00\x7f\x7f\x04\x04\x00\x00\x00\x00\x00')
12+
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
13+
bytearray(b'\xaaU\xaaU\xaa\x00\x00\x00\x00\x00')

0 commit comments

Comments
 (0)