30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
@implementation TestsAppDelegate (SHA512HashTests)
- (void)SHA512HashTests
{
void *pool = objc_autoreleasePoolPush();
OFSHA512Hash *sha512, *copy;
OFFile *f = [OFFile fileWithPath: @"testfile.bin" mode: @"r"];
TEST(@"+[cryptoHashWithAllowsSwappableMemory:]",
(sha512 = [OFSHA512Hash cryptoHashWithAllowsSwappableMemory: true]))
while (!f.atEndOfStream) {
char buf[128];
size_t len = [f readIntoBuffer: buf length: 128];
[sha512 updateWithBuffer: buf length: len];
}
[f close];
|
|
|
|
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
@implementation TestsAppDelegate (SHA512HashTests)
- (void)SHA512HashTests
{
void *pool = objc_autoreleasePoolPush();
OFSHA512Hash *sha512, *copy;
OFFile *f = [OFFile fileWithPath: @"testfile.bin" mode: @"r"];
TEST(@"+[hashWithAllowsSwappableMemory:]",
(sha512 = [OFSHA512Hash hashWithAllowsSwappableMemory: true]))
while (!f.atEndOfStream) {
char buf[128];
size_t len = [f readIntoBuffer: buf length: 128];
[sha512 updateWithBuffer: buf length: len];
}
[f close];
|