mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-11 08:40:44 +00:00
just one more testcase
This commit is contained in:
parent
323f9abace
commit
4aa8ca1e6d
1 changed files with 16 additions and 0 deletions
|
@ -2,6 +2,19 @@
|
|||
#import <Foundation/NSAutoreleasePool.h>
|
||||
#import <Foundation/NSString.h>
|
||||
|
||||
|
||||
static NSString*
|
||||
makeFormattedString(NSString *theFormat, ...)
|
||||
{
|
||||
NSString *aString;
|
||||
va_list args;
|
||||
|
||||
va_start(args, theFormat);
|
||||
aString = [[NSString alloc] initWithFormat: theFormat arguments: args];
|
||||
va_end(args);
|
||||
return AUTORELEASE(aString);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
|
@ -125,6 +138,9 @@ int main()
|
|||
PASS_EQUAL(s, @"€", "lossy backslassh-u20ac is a euro");
|
||||
RELEASE(s);
|
||||
|
||||
s = makeFormattedString(@"%d.%d%s", 10, 20, "hello");
|
||||
PASS_EQUAL(s, @"10.20hello", "simple intWithFormat: works");
|
||||
|
||||
[arp release]; arp = nil;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue