Differences From Artifact [21aef18599]:
- File tests/OFStreamTests.m — part of check-in [b045cbb9c7] at 2019-03-25 00:21:30 on branch trunk — tests: Use dot syntax (user: js, size: 1796) [annotate] [blame] [check-ins using]
To Artifact [fe2a783d3f]:
- File
tests/OFStreamTests.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: 1794) [annotate] [blame] [check-ins using] [more...]
| ︙ | ︙ | |||
61 62 63 64 65 66 67 |
return 0;
}
@end
@implementation TestsAppDelegate (OFStreamTests)
- (void)streamTests
{
| | | | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
return 0;
}
@end
@implementation TestsAppDelegate (OFStreamTests)
- (void)streamTests
{
void *pool = objc_autoreleasePoolPush();
size_t pageSize = [OFSystemInfo pageSize];
StreamTester *t = [[[StreamTester alloc] init] autorelease];
OFString *str;
char *cstr;
cstr = [t allocMemoryWithSize: pageSize - 2];
memset(cstr, 'X', pageSize - 3);
cstr[pageSize - 3] = '\0';
TEST(@"-[readLine]", [[t readLine] isEqual: @"foo"] &&
(str = [t readLine]).length == pageSize - 3 &&
!strcmp(str.UTF8String, cstr))
objc_autoreleasePoolPop(pool);
}
@end
|