mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[Patch #1350573] zlib.crc32 doesn't handle 0xffffffff seed. Add tests and bugfix. Bug reported by John Schmidt; bugfix by Danny Yoo.
This commit is contained in:
parent
b2a739d19b
commit
bb7e800506
2 changed files with 4 additions and 2 deletions
|
@ -24,6 +24,7 @@ class ChecksumTestCase(unittest.TestCase):
|
|||
# checksum test cases
|
||||
def test_crc32start(self):
|
||||
self.assertEqual(zlib.crc32(""), zlib.crc32("", 0))
|
||||
self.assert_(zlib.crc32("abc", 0xffffffff))
|
||||
|
||||
def test_crc32empty(self):
|
||||
self.assertEqual(zlib.crc32("", 0), 0)
|
||||
|
@ -32,6 +33,7 @@ class ChecksumTestCase(unittest.TestCase):
|
|||
|
||||
def test_adler32start(self):
|
||||
self.assertEqual(zlib.adler32(""), zlib.adler32("", 1))
|
||||
self.assert_(zlib.adler32("abc", 0xffffffff))
|
||||
|
||||
def test_adler32empty(self):
|
||||
self.assertEqual(zlib.adler32("", 0), 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue