mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
A stab in the dark attempt to fix the alpha/tru64 buildbot problem and add more
test coverage of valid inputs to zlib.crc32.
This commit is contained in:
parent
4677fbf7de
commit
88440960f9
2 changed files with 11 additions and 2 deletions
|
|
@ -53,6 +53,15 @@ class ChecksumTestCase(unittest.TestCase):
|
|||
self.assertEqual(binascii.crc32(foo), zlib.crc32(foo))
|
||||
self.assertEqual(binascii.crc32('spam'), zlib.crc32('spam'))
|
||||
|
||||
def test_negative_crc_iv_input(self):
|
||||
# The range of valid input values for the crc state should be
|
||||
# -2**31 through 2**32-1 to allow inputs artifically constrained
|
||||
# to a signed 32-bit integer.
|
||||
self.assertEqual(zlib.crc32('ham', -1), zlib.crc32('ham', 0xffffffffL))
|
||||
self.assertEqual(zlib.crc32('spam', -3141593),
|
||||
zlib.crc32('spam', 0xffd01027L))
|
||||
self.assertEqual(zlib.crc32('spam', -(2**31)),
|
||||
zlib.crc32('spam', (2**31)))
|
||||
|
||||
|
||||
class ExceptionTestCase(unittest.TestCase):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue