Commit 8a57cacd authored by Rami Ali's avatar Rami Ali Committed by Damien George

tests/extmod: Improve tinfgzip.c test coverage.

parent a49a96bb
......@@ -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\xe5W\x00\x03\x00\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\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\xe5W\x00\x03\x01\x00X\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\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\xe5W\x00\x03hello\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x05\x00\x00\x00')
try:
......
......@@ -7,5 +7,7 @@ b'lo'
b''
b''
31
b'hello'
b'hello'
ValueError
OSError(22,)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment