MCPcopy Index your code
hub / github.com/RustPython/RustPython / testDecompress4G

Method testDecompress4G

Lib/test/test_zlib.py:988–1001  ·  view source on GitHub ↗
(self, size)

Source from the content-addressed store, hash-verified

986 @support.skip_if_pgo_task
987 @bigmemtest(size=_4G + 100, memuse=3.3)
988 def testDecompress4G(self, size):
989 # "Test zlib._ZlibDecompressor.decompress() with >4GiB input"
990 blocksize = min(10 * 1024 * 1024, size)
991 block = random.randbytes(blocksize)
992 try:
993 data = block * ((size-1) // blocksize + 1)
994 compressed = zlib.compress(data)
995 zlibd = zlib._ZlibDecompressor()
996 decompressed = zlibd.decompress(compressed)
997 self.assertTrue(decompressed == data)
998 finally:
999 data = None
1000 compressed = None
1001 decompressed = None
1002
1003 def testPickle(self):
1004 for proto in range(pickle.HIGHEST_PROTOCOL + 1):

Callers

nothing calls this directly

Calls 5

minFunction · 0.85
assertTrueMethod · 0.80
randbytesMethod · 0.45
compressMethod · 0.45
decompressMethod · 0.45

Tested by

no test coverage detected