Skip to content

Commit 8c9b8ee

Browse files
committed
Add tests for crc32_combine
1 parent 0e28821 commit 8c9b8ee

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/test_zlib_compliance.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,17 @@ def test_crc32_adler32_unsigned(self):
9292
self.assertEqual(isal_zlib.adler32(foo + foo), 3573550353)
9393
self.assertEqual(isal_zlib.adler32(b'spam'), 72286642)
9494

95+
def test_crc32_combine(self):
96+
foo = b'abcdefghijklmnop'
97+
self.assertEqual(isal_zlib.crc32_combine(0, 0, 0), 0)
98+
self.assertEqual(isal_zlib.crc32_combine(1, 0, 0), 1)
99+
self.assertEqual(isal_zlib.crc32_combine(432, 0, 0), 432)
100+
self.assertEqual(
101+
isal_zlib.crc32_combine(
102+
isal_zlib.crc32(foo), isal_zlib.crc32(foo), len(foo)),
103+
isal_zlib.crc32(foo + foo)
104+
)
105+
95106
def test_same_as_binascii_crc32(self):
96107
foo = b'abcdefghijklmnop'
97108
crc = 2486878355

0 commit comments

Comments
 (0)