зеркало из https://github.com/github/putty.git
Fix indentation goof in CRC test suite.
In crypt.testCRC32(), I had intended to test every input byte with each of several previous states, but I mis-indented what should have been the inner loop (over bytes), with the effect that instead I silently tested the input bytes with only the last of those states.
This commit is contained in:
Родитель
4cbb0bae65
Коммит
b5597cc833
|
@ -998,13 +998,13 @@ class crypt(MyTestBase):
|
|||
|
||||
for prior in test_prior_values:
|
||||
prior_shifted = shift8(prior)
|
||||
for i in range(256):
|
||||
exp = shift8(i) ^ prior_shifted
|
||||
self.assertEqual(crc32_update(prior, struct.pack("B", i)), exp)
|
||||
for i in range(256):
|
||||
exp = shift8(i) ^ prior_shifted
|
||||
self.assertEqual(crc32_update(prior, struct.pack("B", i)), exp)
|
||||
|
||||
# Check linearity of the _reference_ implementation, while
|
||||
# we're at it!
|
||||
self.assertEqual(shift8(i ^ prior), exp)
|
||||
# Check linearity of the _reference_ implementation, while
|
||||
# we're at it!
|
||||
self.assertEqual(shift8(i ^ prior), exp)
|
||||
|
||||
def testCRCDA(self):
|
||||
def pattern(badblk, otherblks, pat):
|
||||
|
|
Загрузка…
Ссылка в новой задаче