diff options
author | Damien George <damien@micropython.org> | 2023-09-27 13:13:12 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2023-09-29 12:01:04 +1000 |
commit | a33766880e8fabfa421bee3252b486ebcfbde79b (patch) | |
tree | 7896668fc673fbe5621e97135d51c0da6beaad41 /tests/extmod/deflate_decompress.py | |
parent | 3695211576ed69671b98412ff5278265ab65e6bd (diff) |
tests/extmod/deflate_decompress.py: Skip test when not enough memory.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/extmod/deflate_decompress.py')
-rw-r--r-- | tests/extmod/deflate_decompress.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/extmod/deflate_decompress.py b/tests/extmod/deflate_decompress.py index 29d3ec2d7..3ac8880af 100644 --- a/tests/extmod/deflate_decompress.py +++ b/tests/extmod/deflate_decompress.py @@ -6,6 +6,17 @@ except ImportError: print("SKIP") raise SystemExit +try: + # Check there's enough memory to deflate gzip streams. + # zlib.compress(b'', wbits=25) + empty_gzip = ( + b"\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00" + ) + deflate.DeflateIO(io.BytesIO(empty_gzip)).read() +except MemoryError: + print("SKIP") + raise SystemExit + # zlib.compress(b'micropython hello world hello world micropython', wbits=-9) data_raw = b'\xcb\xcdL.\xca/\xa8,\xc9\xc8\xcfS\xc8H\xcd\xc9\xc9W(\xcf/\xcaIAa\xe7"\xd4\x00\x00' # zlib.compress(b'micropython hello world hello world micropython', wbits=9) |