Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
9112b0b6
Commit
9112b0b6
authored
Dec 13, 2016
by
Rami Ali
Committed by
Damien George
Dec 13, 2016
Browse files
Options
Downloads
Patches
Plain Diff
tests/extmod: Improve modframebuf test coverage.
parent
0f408bc1
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/extmod/framebuf1.py
+16
-0
16 additions, 0 deletions
tests/extmod/framebuf1.py
tests/extmod/framebuf1.py.exp
+3
-0
3 additions, 0 deletions
tests/extmod/framebuf1.py.exp
tests/extmod/framebuf16.py
+1
-0
1 addition, 0 deletions
tests/extmod/framebuf16.py
with
20 additions
and
0 deletions
tests/extmod/framebuf1.py
+
16
−
0
View file @
9112b0b6
...
...
@@ -48,11 +48,21 @@ fbuf.fill(0)
fbuf
.
rect
(
1
,
1
,
3
,
3
,
1
)
print
(
'
rect
'
,
buf
)
#fill rect
fbuf
.
fill
(
0
)
fbuf
.
fill_rect
(
1
,
1
,
3
,
3
,
1
)
print
(
'
fill_rect
'
,
buf
)
# line
fbuf
.
fill
(
0
)
fbuf
.
line
(
1
,
1
,
3
,
3
,
1
)
print
(
'
line
'
,
buf
)
# line steep negative gradient
fbuf
.
fill
(
0
)
fbuf
.
line
(
3
,
3
,
2
,
1
,
1
)
print
(
'
line
'
,
buf
)
# scroll
fbuf
.
fill
(
0
)
fbuf
.
pixel
(
2
,
7
,
1
)
...
...
@@ -78,6 +88,12 @@ print(buf)
fbuf
.
text
(
str
(
chr
(
31
)),
0
,
0
)
print
(
buf
)
# test invalid constructor
try
:
fbuf
=
framebuf
.
FrameBuffer
(
buf
,
w
,
h
,
2
,
framebuf
.
MVLSB
)
except
ValueError
:
print
(
"
ValueError
"
)
# test legacy constructor
fbuf
=
framebuf
.
FrameBuffer1
(
buf
,
w
,
h
)
fbuf
=
framebuf
.
FrameBuffer1
(
buf
,
w
,
h
,
w
)
This diff is collapsed.
Click to expand it.
tests/extmod/framebuf1.py.exp
+
3
−
0
View file @
9112b0b6
...
...
@@ -7,7 +7,9 @@ bytearray(b'\x01\x00\x00\x00\x01\x80\x00\x00\x00\x00')
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')
...
...
@@ -16,3 +18,4 @@ 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')
ValueError
This diff is collapsed.
Click to expand it.
tests/extmod/framebuf16.py
+
1
−
0
View file @
9112b0b6
...
...
@@ -56,4 +56,5 @@ fbuf2.pixel(1, 2, 0xe00e)
fbuf
.
fill
(
0xffff
)
fbuf
.
blit
(
fbuf2
,
3
,
3
,
0x0000
)
fbuf
.
blit
(
fbuf2
,
-
1
,
-
1
,
0x0000
)
fbuf
.
blit
(
fbuf2
,
16
,
16
,
0x0000
)
printbuf
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment