33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#import "TestsAppDelegate.h"
static OFString *module = @"OFString";
static OFString* whitespace[] = {
@" \r \t\n\t \tasd \t \t\t\r\n",
@" \t\t \t\t \t \t"
};
static of_unichar_t ucstr[] = { 'f', 0xF6, 0xF6, 'b', 0xE4, 'r', 0x1F03A, 0 };
static of_unichar_t sucstr[] = {
0xFFFE0000, 0x66000000, 0xF6000000, 0xF6000000, 0x62000000, 0xE4000000,
0x72000000, 0x3AF00100, 0
};
@interface EntityHandler: OFObject <OFStringXMLUnescapingDelegate>
@end
|
|
>
>
|
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#import "TestsAppDelegate.h"
static OFString *module = @"OFString";
static OFString* whitespace[] = {
@" \r \t\n\t \tasd \t \t\t\r\n",
@" \t\t \t\t \t \t"
};
static of_unichar_t ucstr[] = {
0xFEFF, 'f', 0xF6, 0xF6, 'b', 0xE4, 'r', 0x1F03A, 0
};
static of_unichar_t sucstr[] = {
0xFFFE0000, 0x66000000, 0xF6000000, 0xF6000000, 0x62000000, 0xE4000000,
0x72000000, 0x3AF00100, 0
};
@interface EntityHandler: OFObject <OFStringXMLUnescapingDelegate>
@end
|
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
|
EXPECT_EXCEPTION(@"Detect out of range in -[hexadecimalValue]",
OFOutOfRangeException,
[@"0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
@"0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
hexadecimalValue])
TEST(@"-[unicodeString]", (ua = [@"fööbär🀺" unicodeString]) &&
!memcmp(ua, ucstr, 8 * sizeof(of_unichar_t)) && R(free(ua)))
TEST(@"-[MD5Hash]", [[@"asdfoobar" MD5Hash]
isEqual: @"184dce2ec49b5422c7cfd8728864db4c"])
TEST(@"-[SHA1Hash]", [[@"asdfoobar" SHA1Hash]
isEqual: @"f5f81ac0a8b5cbfdc4585ec1ad32e7b3a12b9b49"])
|
|
|
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
|
EXPECT_EXCEPTION(@"Detect out of range in -[hexadecimalValue]",
OFOutOfRangeException,
[@"0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
@"0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
hexadecimalValue])
TEST(@"-[unicodeString]", (ua = [@"fööbär🀺" unicodeString]) &&
!memcmp(ua, ucstr, 9 * sizeof(of_unichar_t)))
TEST(@"-[MD5Hash]", [[@"asdfoobar" MD5Hash]
isEqual: @"184dce2ec49b5422c7cfd8728864db4c"])
TEST(@"-[SHA1Hash]", [[@"asdfoobar" SHA1Hash]
isEqual: @"f5f81ac0a8b5cbfdc4585ec1ad32e7b3a12b9b49"])
|