summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2011-05-14 22:33:43 (GMT)
committerGregory P. Smith <greg@krypto.org>2011-05-14 22:33:43 (GMT)
commit11ddc999e03b5b3d1c780e2e81d8a65ed9bf6aaf (patch)
treec956b709faf14abc427add6328cd1c6346540e0f /Lib
parent873cab28903eb6a9063b502d7e9fe9555fc0cfd7 (diff)
parent565d659dcd97af786a2422c36308f453958f4077 (diff)
downloadcpython-11ddc999e03b5b3d1c780e2e81d8a65ed9bf6aaf.zip
cpython-11ddc999e03b5b3d1c780e2e81d8a65ed9bf6aaf.tar.gz
cpython-11ddc999e03b5b3d1c780e2e81d8a65ed9bf6aaf.tar.bz2
merge heads
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_zlib.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py
index 48d9f58..930aac6 100644
--- a/Lib/test/test_zlib.py
+++ b/Lib/test/test_zlib.py
@@ -523,6 +523,17 @@ class CompressObjectTestCase(BaseCompressTestCase, unittest.TestCase):
decompress = lambda s: d.decompress(s) + d.flush()
self.check_big_decompress_buffer(size, decompress)
+ @precisionbigmemtest(size=_4G + 100, memuse=1)
+ def test_length_overflow(self, size):
+ if size < _4G + 100:
+ self.skipTest("not enough free memory, need at least 4 GB")
+ data = b'x' * size
+ try:
+ self.assertRaises(OverflowError, zlib.compress, data, 1)
+ self.assertRaises(OverflowError, zlib.decompress, data)
+ finally:
+ data = None
+
def genblock(seed, length, step=1024, generator=random):
"""length-byte stream of random data from a seed (in step-byte blocks)."""