Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
8a57cacd
Commit
8a57cacd
authored
Mar 14, 2017
by
Rami Ali
Committed by
Damien George
Mar 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests/extmod: Improve tinfgzip.c test coverage.
parent
a49a96bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
tests/extmod/uzlib_decompio_gz.py
tests/extmod/uzlib_decompio_gz.py
+10
-0
tests/extmod/uzlib_decompio_gz.py.exp
tests/extmod/uzlib_decompio_gz.py.exp
+2
-0
No files found.
tests/extmod/uzlib_decompio_gz.py
View file @
8a57cacd
...
...
@@ -20,6 +20,16 @@ print(inp.read(1))
print
(
inp
.
read
())
print
(
buf
.
seek
(
0
,
1
))
# Check FHCRC field
buf
=
io
.
BytesIO
(
b'
\x1f\x8b\x08\x02\x99\x0c\xe5
W
\x00\x03\x00\x00\xcb
H
\xcd\xc9\xc9\x07\x00\x86\xa6\x10
6
\x05\x00\x00\x00
'
)
inp
=
zlib
.
DecompIO
(
buf
,
16
+
8
)
print
(
inp
.
read
())
# Check FEXTRA field
buf
=
io
.
BytesIO
(
b'
\x1f\x8b\x08\x04\x99\x0c\xe5
W
\x00\x03\x01\x00
X
\xcb
H
\xcd\xc9\xc9\x07\x00\x86\xa6\x10
6
\x05\x00\x00\x00
'
)
inp
=
zlib
.
DecompIO
(
buf
,
16
+
8
)
print
(
inp
.
read
())
# broken header
buf
=
io
.
BytesIO
(
b'
\x1f\x8c\x08\x08\x99\x0c\xe5
W
\x00\x03
hello
\x00\xcb
H
\xcd\xc9\xc9\x07\x00\x86\xa6\x10
6
\x05\x00\x00\x00
'
)
try
:
...
...
tests/extmod/uzlib_decompio_gz.py.exp
View file @
8a57cacd
...
...
@@ -7,5 +7,7 @@ b'lo'
b''
b''
31
b'hello'
b'hello'
ValueError
OSError(22,)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment