summaryrefslogtreecommitdiff
path: root/tests/extmod/uzlib_decompio.py
diff options
context:
space:
mode:
authorScott Shawcroft <scott@chickadee.tech>2016-09-19 13:32:29 -0700
committerScott Shawcroft <scott@chickadee.tech>2016-09-19 13:32:29 -0700
commitbb03afdb77c95b9cb23e531e5763167ccb09c8e4 (patch)
tree509722778a03b10c933963a35c93eb5670a5cdb5 /tests/extmod/uzlib_decompio.py
parent345dd1484c4e68f53ea242c5778a2de99119db9a (diff)
parent60592fd23c8acd4ed4f70d8fbe8f8b11ea58082c (diff)
Merge remote-tracking branch 'micropython/master'
Diffstat (limited to 'tests/extmod/uzlib_decompio.py')
-rw-r--r--tests/extmod/uzlib_decompio.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/extmod/uzlib_decompio.py b/tests/extmod/uzlib_decompio.py
index ee3204d07..75a6df0ca 100644
--- a/tests/extmod/uzlib_decompio.py
+++ b/tests/extmod/uzlib_decompio.py
@@ -7,7 +7,7 @@ import uio as io
# Raw DEFLATE bitstream
buf = io.BytesIO(b'\xcbH\xcd\xc9\xc9\x07\x00')
-inp = zlib.DecompIO(buf)
+inp = zlib.DecompIO(buf, -8)
print(buf.seek(0, 1))
print(inp.read(1))
print(buf.seek(0, 1))
@@ -17,3 +17,16 @@ print(buf.seek(0, 1))
print(inp.read(1))
print(inp.read())
print(buf.seek(0, 1))
+
+
+# zlib bitstream
+inp = zlib.DecompIO(io.BytesIO(b'x\x9c30\xa0=\x00\x00\xb3q\x12\xc1'))
+print(inp.read(10))
+print(inp.read())
+
+# zlib bitstream, wrong checksum
+inp = zlib.DecompIO(io.BytesIO(b'x\x9c30\xa0=\x00\x00\xb3q\x12\xc0'))
+try:
+ print(inp.read())
+except OSError as e:
+ print(repr(e))