mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
check for failures
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32615 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
eed1840fd3
commit
050b475d6f
1 changed files with 38 additions and 24 deletions
|
@ -20,39 +20,53 @@ int main(int argc, char **argv)
|
|||
|
||||
d = [s1 dataUsingEncoding: NSUTF16BigEndianStringEncoding];
|
||||
b = [d bytes];
|
||||
PASS(b[0] == 0 && b[1] == 65, "UTF-16 BE OK");
|
||||
s2 = [[NSString alloc] initWithBytes: b
|
||||
length: 2
|
||||
encoding: NSUTF16BigEndianStringEncoding];
|
||||
PASS([s1 isEqual: s2], "UTF-16 BE reverse OK");
|
||||
[s2 release];
|
||||
PASS([d length] > 1 && b[0] == 0 && b[1] == 65, "UTF-16 BE OK");
|
||||
if (testPassed)
|
||||
{
|
||||
s2 = [[NSString alloc] initWithBytes: b
|
||||
length: 2
|
||||
encoding: NSUTF16BigEndianStringEncoding];
|
||||
PASS([s1 isEqual: s2], "UTF-16 BE reverse OK");
|
||||
[s2 release];
|
||||
}
|
||||
|
||||
d = [s1 dataUsingEncoding: NSUTF16LittleEndianStringEncoding];
|
||||
b = [d bytes];
|
||||
PASS(b[0] == 65 && b[1] == 0, "UTF-16 LE OK");
|
||||
s2 = [[NSString alloc] initWithBytes: b
|
||||
length: 2
|
||||
encoding: NSUTF16LittleEndianStringEncoding];
|
||||
PASS([s1 isEqual: s2], "UTF-16 LE reverse OK");
|
||||
[s2 release];
|
||||
PASS([d length] > 1 && b[0] == 65 && b[1] == 0, "UTF-16 LE OK");
|
||||
if (testPassed)
|
||||
{
|
||||
s2 = [[NSString alloc] initWithBytes: b
|
||||
length: 2
|
||||
encoding: NSUTF16LittleEndianStringEncoding];
|
||||
PASS([s1 isEqual: s2], "UTF-16 LE reverse OK");
|
||||
[s2 release];
|
||||
}
|
||||
|
||||
d = [s1 dataUsingEncoding: NSUTF32BigEndianStringEncoding];
|
||||
b = [d bytes];
|
||||
PASS(b[0] == 0 && b[1] == 0 && b[2] == 0 && b[3] == 65, "UTF-32 BE OK");
|
||||
s2 = [[NSString alloc] initWithBytes: b
|
||||
length: 4
|
||||
encoding: NSUTF32BigEndianStringEncoding];
|
||||
PASS([s1 isEqual: s2], "UTF-32 BE reverse OK");
|
||||
[s2 release];
|
||||
PASS([d length] > 3 && b[0] == 0 && b[1] == 0 && b[2] == 0 && b[3] == 65,
|
||||
"UTF-32 BE OK");
|
||||
if (testPassed)
|
||||
{
|
||||
s2 = [[NSString alloc] initWithBytes: b
|
||||
length: 4
|
||||
encoding: NSUTF32BigEndianStringEncoding];
|
||||
PASS([s1 isEqual: s2], "UTF-32 BE reverse OK");
|
||||
[s2 release];
|
||||
}
|
||||
|
||||
d = [s1 dataUsingEncoding: NSUTF32LittleEndianStringEncoding];
|
||||
b = [d bytes];
|
||||
PASS(b[0] == 65 && b[1] == 0 && b[2] == 0 && b[3] == 0, "UTF-32 LE OK");
|
||||
s2 = [[NSString alloc] initWithBytes: b
|
||||
length: 4
|
||||
encoding: NSUTF32LittleEndianStringEncoding];
|
||||
PASS([s1 isEqual: s2], "UTF-32 LE reverse OK");
|
||||
[s2 release];
|
||||
PASS([d length] > 3 && b[0] == 65 && b[1] == 0 && b[2] == 0 && b[3] == 0,
|
||||
"UTF-32 LE OK");
|
||||
if (testPassed)
|
||||
{
|
||||
s2 = [[NSString alloc] initWithBytes: b
|
||||
length: 4
|
||||
encoding: NSUTF32LittleEndianStringEncoding];
|
||||
PASS([s1 isEqual: s2], "UTF-32 LE reverse OK");
|
||||
[s2 release];
|
||||
}
|
||||
|
||||
[pool release];
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue