mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
More leaks fixed
This commit is contained in:
parent
aedd13dc94
commit
c7f0c27dd7
8 changed files with 47 additions and 40 deletions
|
@ -6,16 +6,21 @@ int main()
|
|||
{
|
||||
START_SET("NSPersonNameComponentsFormatter base");
|
||||
|
||||
NSPersonNameComponents *pnc = [[NSPersonNameComponents alloc] init];
|
||||
NSPersonNameComponents *pnc;
|
||||
NSPersonNameComponents *pnc2;
|
||||
NSPersonNameComponentsFormatter *fmt;
|
||||
|
||||
pnc = AUTORELEASE([[NSPersonNameComponents alloc] init]);
|
||||
[pnc setGivenName: @"Gregory"];
|
||||
[pnc setMiddleName: @"John"];
|
||||
[pnc setFamilyName: @"Casamento"];
|
||||
[pnc setNameSuffix: @"PhD"];
|
||||
[pnc setNamePrefix: @"Dr."];
|
||||
|
||||
NSPersonNameComponentsFormatter *fmt = [[NSPersonNameComponentsFormatter alloc] init];
|
||||
NSPersonNameComponents *pnc2 = [fmt personNameComponentsFromString:
|
||||
@"Dr. Gregory John Casamento PhD"];
|
||||
fmt = AUTORELEASE([[NSPersonNameComponentsFormatter alloc] init]);
|
||||
pnc2 = [fmt personNameComponentsFromString:
|
||||
@"Dr. Gregory John Casamento PhD"];
|
||||
|
||||
PASS([[pnc givenName] isEqualToString:
|
||||
[pnc2 givenName]], "First name matches");
|
||||
PASS([[pnc middleName] isEqualToString:
|
||||
|
@ -27,7 +32,7 @@ int main()
|
|||
PASS([[pnc namePrefix] isEqualToString:
|
||||
[pnc2 namePrefix]], "Prefix name matches");
|
||||
|
||||
fmt = [[NSPersonNameComponentsFormatter alloc] init];
|
||||
fmt = AUTORELEASE([[NSPersonNameComponentsFormatter alloc] init]);
|
||||
pnc2 = [fmt personNameComponentsFromString:
|
||||
@"Gregory John Casamento PhD"];
|
||||
PASS([[pnc givenName] isEqualToString:
|
||||
|
@ -39,7 +44,7 @@ int main()
|
|||
PASS([[pnc nameSuffix] isEqualToString:
|
||||
[pnc2 nameSuffix]], "Suffix name matches");
|
||||
|
||||
fmt = [[NSPersonNameComponentsFormatter alloc] init];
|
||||
fmt = AUTORELEASE([[NSPersonNameComponentsFormatter alloc] init]);
|
||||
pnc2 = [fmt personNameComponentsFromString:
|
||||
@"Gregory John Casamento"];
|
||||
PASS([[pnc givenName] isEqualToString:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue