diff options
author | Gregory P. Smith <greg@krypto.org> | 2011-05-14 22:32:19 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2011-05-14 22:32:19 (GMT) |
commit | ec075e6479fa7e98b17625e954b442c205ce5672 (patch) | |
tree | ea48a8208569004ce88156ec62e44452e6d32334 /Lib | |
parent | 79aa5bf5ed78fd298c5744a31a867237d9062090 (diff) | |
parent | ccb33bf0028e966a7b0a3d67f6a83a8bf2cddcff (diff) | |
download | cpython-ec075e6479fa7e98b17625e954b442c205ce5672.zip cpython-ec075e6479fa7e98b17625e954b442c205ce5672.tar.gz cpython-ec075e6479fa7e98b17625e954b442c205ce5672.tar.bz2 |
merge heads
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_zlib.py | 11 |
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).""" |