Index: tests/OFString/OFString.m ================================================================== --- tests/OFString/OFString.m +++ tests/OFString/OFString.m @@ -10,11 +10,10 @@ */ #include "config.h" #include -#include #import "OFString.h" #import "OFArray.h" #import "OFAutoreleasePool.h" #import "OFExceptions.h" @@ -72,16 +71,16 @@ [s2 appendCString: "12"]; [s2 appendString: @"3"]; [s4 setToCString: [s2 cString]]; CHECK(![s2 compare: s4]) - CHECK(!strcmp([[s1 appendString: s2] cString], "test123")) + CHECK([[s1 appendString: s2] isEqual: @"test123"]) + CHECK([s1 length] == 7) CHECK([s1 hash] == 0xC44F49A4) - CHECK(strlen([s1 cString]) == [s1 length] && [s1 length] == 7) - CHECK(!strcmp([[s1 reverse] cString], "321tset")) - CHECK(!strcmp([[s1 upper] cString], "321TSET")) - CHECK(!strcmp([[s1 lower] cString], "321tset")) + 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 */ @@ -89,19 +88,19 @@ OFInvalidEncodingException) CHECK_EXCEPT(s1 = [OFString stringWithCString: "\xF0\x80\x80\xC0"], OFInvalidEncodingException) s1 = [OFMutableString stringWithCString: "äöü€𝄞"]; - CHECK(!strcmp([[s1 reverse] cString], "𝄞€üöä")) + CHECK([[s1 reverse] isEqual: @"𝄞€üöä"]) [s1 dealloc]; /* Format tests */ s1 = [OFMutableString stringWithFormat: @"%s: %d", "test", 123]; - CHECK(!strcmp([s1 cString], "test: 123")) + CHECK([s1 isEqual: @"test: 123"]) [s1 appendWithFormat: @"%02X", 15]; - CHECK(!strcmp([s1 cString], "test: 1230F")) + CHECK([s1 isEqual: @"test: 1230F"]) /* Find index tests */ CHECK([@"foo" indexOfFirstOccurrenceOfString: @"oo"] == 1) CHECK([@"foo" indexOfLastOccurrenceOfString: @"oo"] == 1) CHECK([@"foo" indexOfFirstOccurrenceOfString: @"o"] == 1)