19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
main()
{
OFWideString *s1 = [OFWideString new: L"test"];
OFWideString *s2 = [[OFWideString alloc] init: L""];
OFWideString *s3;
OFWideString *s4 = [OFWideString new];
[s2 append: L"123"];
s3 = [s1 clone];
[s4 setTo: [s2 wcString]];
if (![s1 compare: s3])
puts("s1 and s3 match! GOOD!");
else {
puts("s1 and s3 don't match!");
return 1;
}
if (![s2 compare: s4])
puts("s2 and s4 match! GOOD!");
else {
puts("s1 and s3 don't match!");
return 1;
}
if (!wcscmp([[s1 append: [s2 wcString]] wcString], L"test123"))
puts("s1 appended with s2 is the expected string! GOOD!");
else {
puts("s1 appended with s2 is not the expected string!");
return 1;
}
if (wcslen([s1 wcString]) == [s1 length] && [s1 length] == 7)
|
|
|
|
|
|
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
main()
{
OFWideString *s1 = [OFWideString new: L"test"];
OFWideString *s2 = [[OFWideString alloc] init: L""];
OFWideString *s3;
OFWideString *s4 = [OFWideString new];
[s2 append: [OFConstWideString new: L"123"]];
s3 = [s1 clone];
[s4 setTo: (OFConstWideString*)s2];
if (![s1 compare: (OFConstWideString*)s3])
puts("s1 and s3 match! GOOD!");
else {
puts("s1 and s3 don't match!");
return 1;
}
if (![s2 compare: (OFConstWideString*)s4])
puts("s2 and s4 match! GOOD!");
else {
puts("s1 and s3 don't match!");
return 1;
}
if (!wcscmp([[s1 append: (OFConstWideString*)s2] wcString], L"test123"))
puts("s1 appended with s2 is the expected string! GOOD!");
else {
puts("s1 appended with s2 is not the expected string!");
return 1;
}
if (wcslen([s1 wcString]) == [s1 length] && [s1 length] == 7)
|