38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
if (![s2 compareTo: s4])
puts("s2 and s4 match! GOOD!");
else {
puts("s1 and s3 don't match!");
return 1;
}
if (!wcscmp([[s1 append: 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)
puts("s1 has the expected length. GOOD!");
else {
puts("s1 does not have the expected length!");
return 1;
}
[s1 free];
[s2 free];
[s3 free];
[s4 free];
return 0;
}
|
|
|
>
>
>
>
>
>
>
|
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
if (![s2 compareTo: s4])
puts("s2 and s4 match! GOOD!");
else {
puts("s1 and s3 don't match!");
return 1;
}
if (!wcscmp([[s1 append: 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)
puts("s1 has the expected length. GOOD!");
else {
puts("s1 does not have the expected length!");
return 1;
}
if (!wcscmp([[s1 reverse] wCString], L"321tset"))
puts("Reversed s1 is expected string! GOOD!");
else {
puts("Reversed s1 is NOT the expected string!");
return 1;
}
[s1 free];
[s2 free];
[s3 free];
[s4 free];
return 0;
}
|