mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Add a fgew tests for capitalisation
This commit is contained in:
parent
8acf2a5304
commit
ba24a18176
1 changed files with 33 additions and 1 deletions
|
@ -252,11 +252,43 @@ void test_return_self_optimizations(void)
|
|||
string = [[stringClass alloc] initWithCharacters: NULL
|
||||
length: 0];
|
||||
returnValue = [string capitalizedString];
|
||||
[string release];
|
||||
RELEASE(string);
|
||||
PASS((IS_VALID_OBJECT(returnValue) && [@"" isEqual: returnValue]),
|
||||
"-capitalizedString returns a valid instance");
|
||||
DESTROY(arp);
|
||||
|
||||
ENTER_POOL
|
||||
string = [[stringClass alloc] initWithCString: "helvetica"
|
||||
length: 9];
|
||||
returnValue = [string capitalizedString];
|
||||
RELEASE(string);
|
||||
PASS_EQUAL(returnValue, @"Helvetica", "-capitalizedString for helvetica")
|
||||
LEAVE_POOL
|
||||
|
||||
ENTER_POOL
|
||||
string = [[stringClass alloc] initWithCString: "HeLveTica"
|
||||
length: 9];
|
||||
returnValue = [string capitalizedString];
|
||||
RELEASE(string);
|
||||
PASS_EQUAL(returnValue, @"Helvetica", "-capitalizedString for HeLveTica")
|
||||
LEAVE_POOL
|
||||
|
||||
ENTER_POOL
|
||||
string = [[stringClass alloc] initWithCString: "HELVETICA"
|
||||
length: 9];
|
||||
returnValue = [string capitalizedString];
|
||||
RELEASE(string);
|
||||
PASS_EQUAL(returnValue, @"Helvetica", "-capitalizedString for HELVETICA")
|
||||
LEAVE_POOL
|
||||
|
||||
ENTER_POOL
|
||||
string = [[stringClass alloc] initWithCString: "HeLLO worLd"
|
||||
length: 11];
|
||||
returnValue = [string capitalizedString];
|
||||
RELEASE(string);
|
||||
PASS_EQUAL(returnValue, @"Hello World", "-capitalizedString for HeLLO worLd")
|
||||
LEAVE_POOL
|
||||
|
||||
arp = [NSAutoreleasePool new];
|
||||
string = [[stringClass alloc] initWithCharacters: NULL
|
||||
length: 0];
|
||||
|
|
Loading…
Reference in a new issue