70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
- (void)stringTests
{
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
OFMutableString *s[3];
OFArray *a;
int i;
const of_unichar_t *ua;
EntityHandler *h;
#ifdef OF_HAVE_BLOCKS
__block BOOL ok;
#endif
s[0] = [OFMutableString stringWithString: @"täs€"];
s[1] = [OFMutableString string];
|
>
|
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
- (void)stringTests
{
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
OFMutableString *s[3];
OFArray *a;
int i;
const of_unichar_t *ua;
const uint16_t *u16a;
EntityHandler *h;
#ifdef OF_HAVE_BLOCKS
__block BOOL ok;
#endif
s[0] = [OFMutableString stringWithString: @"täs€"];
s[1] = [OFMutableString string];
|
378
379
380
381
382
383
384
385
386
387
388
389
390
391
|
OFOutOfRangeException,
[@"0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
@"0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
hexadecimalValue])
TEST(@"-[unicodeString]", (ua = [@"fööbär🀺" unicodeString]) &&
!memcmp(ua, ucstr + 1, sizeof(ucstr) - sizeof(of_unichar_t)))
TEST(@"-[MD5Hash]", [[@"asdfoobar" MD5Hash]
isEqual: @"184dce2ec49b5422c7cfd8728864db4c"])
TEST(@"-[SHA1Hash]", [[@"asdfoobar" SHA1Hash]
isEqual: @"f5f81ac0a8b5cbfdc4585ec1ad32e7b3a12b9b49"])
|
>
>
>
>
>
>
>
|
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
|
OFOutOfRangeException,
[@"0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
@"0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
hexadecimalValue])
TEST(@"-[unicodeString]", (ua = [@"fööbär🀺" unicodeString]) &&
!memcmp(ua, ucstr + 1, sizeof(ucstr) - sizeof(of_unichar_t)))
TEST(@"-[UTF16String]", (u16a = [@"fööbär🀺" UTF16String]) &&
#ifdef OF_BIG_ENDIAN
!memcmp(u16a, utf16str + 1, sizeof(utf16str) - sizeof(uint16_t)))
#else
!memcmp(u16a, sutf16str + 1, sizeof(sutf16str) - sizeof(uint16_t)))
#endif
TEST(@"-[MD5Hash]", [[@"asdfoobar" MD5Hash]
isEqual: @"184dce2ec49b5422c7cfd8728864db4c"])
TEST(@"-[SHA1Hash]", [[@"asdfoobar" SHA1Hash]
isEqual: @"f5f81ac0a8b5cbfdc4585ec1ad32e7b3a12b9b49"])
|