Differences From Artifact [c6a6847787]:
- File tests/OFMD5HashTests.m — part of check-in [b045cbb9c7] at 2019-03-25 00:21:30 on branch trunk — tests: Use dot syntax (user: js, size: 1644) [annotate] [blame] [check-ins using]
To Artifact [f4ae6e53d2]:
- File
tests/OFMD5HashTests.m
— part of check-in
[09be825f88]
at
2019-09-29 15:58:33
on branch trunk
— Remove OFAutoreleasePool
OFAutoreleasePools have long been discouraged in favor of the runtime's
autorelease pools. (user: js, size: 1642) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
25 26 27 28 29 30 31 | const uint8_t testfile_md5[16] = "\x00\x8B\x9D\x1B\x58\xDF\xF8\xFE\xEE\xF3\xAE\x8D\xBB\x68\x2D\x38"; @implementation TestsAppDelegate (OFMD5HashTests) - (void)MD5HashTests { | | | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | const uint8_t testfile_md5[16] = "\x00\x8B\x9D\x1B\x58\xDF\xF8\xFE\xEE\xF3\xAE\x8D\xBB\x68\x2D\x38"; @implementation TestsAppDelegate (OFMD5HashTests) - (void)MD5HashTests { void *pool = objc_autoreleasePoolPush(); OFMD5Hash *md5, *copy; OFFile *f = [OFFile fileWithPath: @"testfile.bin" mode: @"r"]; TEST(@"+[cryptoHash]", (md5 = [OFMD5Hash cryptoHash])) while (!f.atEndOfStream) { |
︙ | ︙ | |||
52 53 54 55 56 57 58 | memcmp(copy.digest, testfile_md5, 16) == 0) EXPECT_EXCEPTION(@"Detect invalid call of " @"-[updateWithBuffer:length]", OFHashAlreadyCalculatedException, [md5 updateWithBuffer: "" length: 1]) | | | 52 53 54 55 56 57 58 59 60 61 | memcmp(copy.digest, testfile_md5, 16) == 0) EXPECT_EXCEPTION(@"Detect invalid call of " @"-[updateWithBuffer:length]", OFHashAlreadyCalculatedException, [md5 updateWithBuffer: "" length: 1]) objc_autoreleasePoolPop(pool); } @end |