소스 검색

Fix crc32 tests.

Jelmer Vernooij 16 년 전
부모
커밋
8d78985b51
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      dulwich/objects.py
  2. 1 1
      dulwich/tests/test_pack.py

+ 1 - 1
dulwich/objects.py

@@ -160,7 +160,7 @@ class ShaFile(object):
         return "%s %lu\0" % (self._type, len(self._text))
   
     def crc32(self):
-        return zlib.crc32(self._text)
+        return zlib.crc32(self._text) & 0xffffffff
   
     def sha(self):
         """The SHA1 object that is the name of this object."""

+ 1 - 1
dulwich/tests/test_pack.py

@@ -139,7 +139,7 @@ class TestPackData(PackTests):
   
     def test_iterentries(self):
         p = self.get_pack_data(pack1_sha)
-        self.assertEquals(set([('og\x0c\x0f\xb5?\x94cv\x0br\x95\xfb\xb8\x14\xe9e\xfb \xc8', 178, -1718046665), ('\xb2\xa2vj(y\xc2\t\xab\x11v\xe7\xe7x\xb8\x1a\xe4"\xee\xaa', 138, -901046474), ('\xf1\x8f\xaa\x16S\x1a\xc5p\xa3\xfd\xc8\xc7\xca\x16h%H\xda\xfd\x12', 12, 1185722901)]), set(p.iterentries()))
+        self.assertEquals(set([('og\x0c\x0f\xb5?\x94cv\x0br\x95\xfb\xb8\x14\xe9e\xfb \xc8', 178, 2576920631), ('\xb2\xa2vj(y\xc2\t\xab\x11v\xe7\xe7x\xb8\x1a\xe4"\xee\xaa', 138, 3393920822), ('\xf1\x8f\xaa\x16S\x1a\xc5p\xa3\xfd\xc8\xc7\xca\x16h%H\xda\xfd\x12', 12, 1185722901)]), set(p.iterentries()))
   
     def test_create_index_v1(self):
         p = self.get_pack_data(pack1_sha)