Remove move DecompIO files
This commit is contained in:
parent
f9d7f46d67
commit
0d3f45bef8
@ -39,7 +39,6 @@ SRC_BITMAP := \
|
||||
shared-bindings/traceback/__init__.c \
|
||||
shared-bindings/util.c \
|
||||
shared-bindings/zlib/__init__.c \
|
||||
shared-bindings/zlib/DecompIO.c \
|
||||
shared-module/aesio/aes.c \
|
||||
shared-module/aesio/__init__.c \
|
||||
shared-module/bitmaptools/__init__.c \
|
||||
@ -50,7 +49,6 @@ SRC_BITMAP := \
|
||||
shared-module/rainbowio/__init__.c \
|
||||
shared-module/traceback/__init__.c \
|
||||
shared-module/zlib/__init__.c \
|
||||
shared-module/zlib/DecompIO.c
|
||||
|
||||
$(info $(SRC_BITMAP))
|
||||
SRC_C += $(SRC_BITMAP)
|
||||
|
@ -1,33 +0,0 @@
|
||||
try:
|
||||
import zlib
|
||||
import uio as io
|
||||
except ImportError:
|
||||
print("SKIP")
|
||||
raise SystemExit
|
||||
|
||||
|
||||
# Raw DEFLATE bitstream
|
||||
buf = io.BytesIO(b"\xcbH\xcd\xc9\xc9\x07\x00")
|
||||
inp = zlib.DecompIO(buf, -8)
|
||||
print(buf.seek(0, 1))
|
||||
print(inp.read(1))
|
||||
print(buf.seek(0, 1))
|
||||
print(inp.read(2))
|
||||
print(inp.read())
|
||||
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))
|
@ -1,12 +0,0 @@
|
||||
0
|
||||
b'h'
|
||||
2
|
||||
b'el'
|
||||
b'lo'
|
||||
7
|
||||
b''
|
||||
b''
|
||||
7
|
||||
b'0000000000'
|
||||
b'000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
|
||||
OSError(22,)
|
@ -1,60 +0,0 @@
|
||||
try:
|
||||
import zlib
|
||||
import uio as io
|
||||
except ImportError:
|
||||
print("SKIP")
|
||||
raise SystemExit
|
||||
|
||||
|
||||
# gzip bitstream
|
||||
buf = io.BytesIO(
|
||||
b"\x1f\x8b\x08\x08\x99\x0c\xe5W\x00\x03hello\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x05\x00\x00\x00"
|
||||
)
|
||||
inp = zlib.DecompIO(buf, 16 + 8)
|
||||
print(buf.seek(0, 1))
|
||||
print(inp.read(1))
|
||||
print(buf.seek(0, 1))
|
||||
print(inp.read(2))
|
||||
print(inp.read())
|
||||
print(buf.seek(0, 1))
|
||||
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:
|
||||
inp = zlib.DecompIO(buf, 16 + 8)
|
||||
except ValueError:
|
||||
print("ValueError")
|
||||
|
||||
# broken crc32
|
||||
buf = io.BytesIO(
|
||||
b"\x1f\x8b\x08\x08\x99\x0c\xe5W\x00\x03hello\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa7\x106\x05\x00\x00\x00"
|
||||
)
|
||||
inp = zlib.DecompIO(buf, 16 + 8)
|
||||
try:
|
||||
inp.read(6)
|
||||
except OSError as e:
|
||||
print(repr(e))
|
||||
|
||||
# broken uncompressed size - not checked so far
|
||||
# buf = io.BytesIO(b'\x1f\x8b\x08\x08\x99\x0c\xe5W\x00\x03hello\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x06\x00\x00\x00')
|
||||
# inp = zlib.DecompIO(buf, 16 + 8)
|
||||
# inp.read(6)
|
@ -1,13 +0,0 @@
|
||||
16
|
||||
b'h'
|
||||
18
|
||||
b'el'
|
||||
b'lo'
|
||||
31
|
||||
b''
|
||||
b''
|
||||
31
|
||||
b'hello'
|
||||
b'hello'
|
||||
ValueError
|
||||
OSError(22,)
|
Loading…
Reference in New Issue
Block a user