diff options
author | Martin Panter <vadmium+py@gmail.com> | 2015-12-11 05:19:29 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2015-12-11 05:19:29 (GMT) |
commit | b82032f935962d13220bba52d26ac607149485eb (patch) | |
tree | dd2b37f8a5c8f4e5621739c6f7c5b727727d9542 /Lib/test | |
parent | 7dda421bfff887da9a84e99c37ef1b0ef9f3cde9 (diff) | |
download | cpython-b82032f935962d13220bba52d26ac607149485eb.zip cpython-b82032f935962d13220bba52d26ac607149485eb.tar.gz cpython-b82032f935962d13220bba52d26ac607149485eb.tar.bz2 |
Issue #22341: Drop Python 2 workaround and document CRC initial value
Also align the parameter naming in binascii to be consistent with zlib.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_zlib.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py index 88c415b..ecdb5a7 100644 --- a/Lib/test/test_zlib.py +++ b/Lib/test/test_zlib.py @@ -47,16 +47,11 @@ class ChecksumTestCase(unittest.TestCase): self.assertEqual(zlib.adler32(b"", 1), 1) self.assertEqual(zlib.adler32(b"", 432), 432) - def assertEqual32(self, seen, expected): - # 32-bit values masked -- checksums on 32- vs 64- bit machines - # This is important if bit 31 (0x08000000L) is set. - self.assertEqual(seen & 0x0FFFFFFFF, expected & 0x0FFFFFFFF) - def test_penguins(self): - self.assertEqual32(zlib.crc32(b"penguin", 0), 0x0e5c1a120) - self.assertEqual32(zlib.crc32(b"penguin", 1), 0x43b6aa94) - self.assertEqual32(zlib.adler32(b"penguin", 0), 0x0bcf02f6) - self.assertEqual32(zlib.adler32(b"penguin", 1), 0x0bd602f7) + self.assertEqual(zlib.crc32(b"penguin", 0), 0x0e5c1a120) + self.assertEqual(zlib.crc32(b"penguin", 1), 0x43b6aa94) + self.assertEqual(zlib.adler32(b"penguin", 0), 0x0bcf02f6) + self.assertEqual(zlib.adler32(b"penguin", 1), 0x0bd602f7) self.assertEqual(zlib.crc32(b"penguin"), zlib.crc32(b"penguin", 0)) self.assertEqual(zlib.adler32(b"penguin"),zlib.adler32(b"penguin",1)) |