78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
CHECK([s1 hash] == 0xC44F49A4)
CHECK([[s1 reverse] isEqual: @"321tset"])
CHECK([[s1 upper] isEqual: @"321TSET"])
CHECK([[s1 lower] isEqual: @"321tset"])
/* Also clears all the memory of the returned C strings */
[pool release];
/* UTF-8 tests */
CHECK_EXCEPT(s1 = [OFString stringWithCString: "\xE0\x80"],
OFInvalidEncodingException)
CHECK_EXCEPT(s1 = [OFString stringWithCString: "\xF0\x80\x80\xC0"],
OFInvalidEncodingException)
|
>
>
>
>
>
>
>
>
|
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
CHECK([s1 hash] == 0xC44F49A4)
CHECK([[s1 reverse] isEqual: @"321tset"])
CHECK([[s1 upper] isEqual: @"321TSET"])
CHECK([[s1 lower] isEqual: @"321tset"])
/* Also clears all the memory of the returned C strings */
[pool release];
s1 = [OFMutableString stringWithCString: "foobar"
andLength: 3];
CHECK([s1 isEqual: @"foo"])
[s1 appendCString: "foobarqux" + 3
withLength: 3];
CHECK([s1 isEqual: @"foobar"])
/* UTF-8 tests */
CHECK_EXCEPT(s1 = [OFString stringWithCString: "\xE0\x80"],
OFInvalidEncodingException)
CHECK_EXCEPT(s1 = [OFString stringWithCString: "\xF0\x80\x80\xC0"],
OFInvalidEncodingException)
|