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
|
OFString *s1 = [OFString newFromCString: "test"];
OFString *s2 = [OFString newFromCString: ""];
OFString *s3;
OFString *s4 = [OFString new];
s3 = [s1 clone];
if (![s1 compare: s3])
puts("s1 and s3 match! GOOD!");
else {
puts("s1 and s3 don't match!");
return 1;
}
[s2 appendCString: "123"];
[s4 setTo: s2];
if (![s2 compare: s4])
puts("s2 and s4 match! GOOD!");
else {
puts("s2 and s4 don't match!");
return 1;
}
if (!strcmp([[s1 append: s2] getCString], "test123"))
|
|
|
|
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
|
OFString *s1 = [OFString newFromCString: "test"];
OFString *s2 = [OFString newFromCString: ""];
OFString *s3;
OFString *s4 = [OFString new];
s3 = [s1 clone];
if (![s1 compareTo: s3])
puts("s1 and s3 match! GOOD!");
else {
puts("s1 and s3 don't match!");
return 1;
}
[s2 appendCString: "123"];
[s4 setTo: s2];
if (![s2 compareTo: s4])
puts("s2 and s4 match! GOOD!");
else {
puts("s2 and s4 don't match!");
return 1;
}
if (!strcmp([[s1 append: s2] getCString], "test123"))
|