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