mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 09:58:01 +00:00
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:
parent
4cbb0bae65
commit
b5597cc833
@ -998,13 +998,13 @@ class crypt(MyTestBase):
|
|||||||
|
|
||||||
for prior in test_prior_values:
|
for prior in test_prior_values:
|
||||||
prior_shifted = shift8(prior)
|
prior_shifted = shift8(prior)
|
||||||
for i in range(256):
|
for i in range(256):
|
||||||
exp = shift8(i) ^ prior_shifted
|
exp = shift8(i) ^ prior_shifted
|
||||||
self.assertEqual(crc32_update(prior, struct.pack("B", i)), exp)
|
self.assertEqual(crc32_update(prior, struct.pack("B", i)), exp)
|
||||||
|
|
||||||
# Check linearity of the _reference_ implementation, while
|
# Check linearity of the _reference_ implementation, while
|
||||||
# we're at it!
|
# we're at it!
|
||||||
self.assertEqual(shift8(i ^ prior), exp)
|
self.assertEqual(shift8(i ^ prior), exp)
|
||||||
|
|
||||||
def testCRCDA(self):
|
def testCRCDA(self):
|
||||||
def pattern(badblk, otherblks, pat):
|
def pattern(badblk, otherblks, pat):
|
||||||
|
Loading…
Reference in New Issue
Block a user