Explorar o código

buzhash: One more test case

Test with more than 31 bytes to make sure our BARREL_SHIFT macro
works correctly.
Jonas Borgström %!s(int64=11) %!d(string=hai) anos
pai
achega
95162ce1f8
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      attic/testsuite/chunker.py

+ 2 - 0
attic/testsuite/chunker.py

@@ -25,3 +25,5 @@ class ChunkerTestCase(AtticTestCase):
         self.assert_equal(buzhash(b'abcdefghijklmnop', 0), 3795437769)
         self.assert_equal(buzhash(b'abcdefghijklmnop', 1), 3795400502)
         self.assert_equal(buzhash(b'abcdefghijklmnop', 1), buzhash_update(buzhash(b'Xabcdefghijklmno', 1), ord('X'), ord('p'), 16, 1))
+        # Test with more than 31 bytes to make sure our barrel_shift macro works correctly
+        self.assert_equal(buzhash(b'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz', 0), 566521248)