Differences From Artifact [2e31055b19]:
- File tests/OFSHA256HashTests.m — part of check-in [1a86b8175b] at 2022-02-12 07:46:07 on branch trunk — Update copyright (user: js, size: 1734) [annotate] [blame] [check-ins using]
To Artifact [2075144684]:
- File
tests/OFSHA256HashTests.m
— part of check-in
[82801897d3]
at
2022-03-25 10:22:55
on branch trunk
— OFCryptographicHash: Add -[calculate]
Before, -[digest] would do the final calculation, however, this would
mean a property modifies state, which is bad. (user: js, size: 1815) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
40 41 42 43 44 45 46 47 48 49 50 51 52 53 | size_t length = [file readIntoBuffer: buffer length: 64]; [SHA256 updateWithBuffer: buffer length: length]; } [file close]; TEST(@"-[copy]", (SHA256Copy = [[SHA256 copy] autorelease])) TEST(@"-[digest]", memcmp(SHA256.digest, testFileSHA256, 32) == 0 && memcmp(SHA256Copy.digest, testFileSHA256, 32) == 0) EXPECT_EXCEPTION(@"Detect invalid call of " @"-[updateWithBuffer:length:]", OFHashAlreadyCalculatedException, [SHA256 updateWithBuffer: "" length: 1]) | > > > | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | size_t length = [file readIntoBuffer: buffer length: 64]; [SHA256 updateWithBuffer: buffer length: length]; } [file close]; TEST(@"-[copy]", (SHA256Copy = [[SHA256 copy] autorelease])) TEST(@"-[calculate]", R([SHA256 calculate]) && R([SHA256Copy calculate])) TEST(@"-[digest]", memcmp(SHA256.digest, testFileSHA256, 32) == 0 && memcmp(SHA256Copy.digest, testFileSHA256, 32) == 0) EXPECT_EXCEPTION(@"Detect invalid call of " @"-[updateWithBuffer:length:]", OFHashAlreadyCalculatedException, [SHA256 updateWithBuffer: "" length: 1]) |
︙ | ︙ |