Skip to content

Commit

Permalink
tests/extmod: Get DecompIO test running on low-memory targets.
Browse files Browse the repository at this point in the history
By changing the zlib header so that it uses a small (256 byte) window.

Signed-off-by: Damien George <damien@micropython.org>
  • Loading branch information
dpgeorge committed Feb 9, 2023
1 parent 5c3c1c7 commit b1123a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/extmod/uzlib_decompio.py
Expand Up @@ -20,13 +20,13 @@
print(buf.seek(0, 1))


# zlib bitstream
inp = zlib.DecompIO(io.BytesIO(b"x\x9c30\xa0=\x00\x00\xb3q\x12\xc1"))
# zlib bitstream (with 256 byte window size)
inp = zlib.DecompIO(io.BytesIO(b"\x08\x9930\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"))
inp = zlib.DecompIO(io.BytesIO(b"\x08\x9930\xa0=\x00\x00\xb3q\x12\xc0"))
try:
print(inp.read())
except OSError as e:
Expand Down

0 comments on commit b1123a5

Please sign in to comment.