crc32 always returns unsigned. cleanup the code a bit and revert r61648 with
the proper fix.
diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py
index 9cd5434..65e633b 100644
--- a/Lib/test/test_zlib.py
+++ b/Lib/test/test_zlib.py
@@ -42,14 +42,14 @@
def test_crc32_adler32_unsigned(self):
foo = 'abcdefghijklmnop'
# explicitly test signed behavior
- self.assertEqual(zlib.crc32(foo), -1808088941)
+ self.assertEqual(zlib.crc32(foo), 2486878355)
self.assertEqual(zlib.crc32('spam'), 1138425661)
self.assertEqual(zlib.adler32(foo+foo), 3573550353)
self.assertEqual(zlib.adler32('spam'), 72286642)
def test_same_as_binascii_crc32(self):
foo = 'abcdefghijklmnop'
- crc = -1808088941
+ crc = 2486878355
self.assertEqual(binascii.crc32(foo), crc)
self.assertEqual(zlib.crc32(foo), crc)
self.assertEqual(binascii.crc32('spam'), zlib.crc32('spam'))