summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2008-03-20 06:20:09 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2008-03-20 06:20:09 (GMT)
commit2727503bc9c7df0093d8920713fdb5ae4db65a98 (patch)
tree1865acbc48313832f649873366f9279808fb6567 /Lib
parent97797a9c3c69add56faefb8c4e5d029618f5bcb2 (diff)
downloadcpython-2727503bc9c7df0093d8920713fdb5ae4db65a98.zip
cpython-2727503bc9c7df0093d8920713fdb5ae4db65a98.tar.gz
cpython-2727503bc9c7df0093d8920713fdb5ae4db65a98.tar.bz2
crc32 always returns unsigned. cleanup the code a bit and revert r61648 with
the proper fix.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_zlib.py4
1 files changed, 2 insertions, 2 deletions
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 @@ class ChecksumTestCase(unittest.TestCase):
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'))