mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Moved -getObjectValue:... test to NSLocale set (this method requires libicu for NSNumberFormatterBehavior10_4.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32590 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
fd82f4f6a9
commit
a489a4d175
1 changed files with 11 additions and 14 deletions
|
@ -44,19 +44,6 @@ int main()
|
|||
== [NSNumberFormatter defaultFormatterBehavior],
|
||||
"default behavior can be changed to NSNumberFormatterBehavior10_4")
|
||||
|
||||
fmt = [[[NSNumberFormatter alloc] init] autorelease];
|
||||
PASS([fmt getObjectValue: &num forString: @"0.00" errorDescription: nil]
|
||||
&& num != nil, "formatting tuceeded")
|
||||
if (testPassed)
|
||||
{
|
||||
NSLog(@"number: %@", num);
|
||||
PASS(NO == [num isEqual: [NSDecimalNumber notANumber]],
|
||||
"is not equal to NaN")
|
||||
PASS(YES == [num isEqual: [NSDecimalNumber zero]],
|
||||
"is equal to zero")
|
||||
}
|
||||
|
||||
|
||||
fmt = [[[NSNumberFormatter alloc] init] autorelease];
|
||||
|
||||
PASS(NSNumberFormatterBehavior10_4 == [fmt formatterBehavior],
|
||||
|
@ -78,7 +65,17 @@ int main()
|
|||
START_SET("NSLocale")
|
||||
if (!NSLOCALE_SUPPORTED)
|
||||
SKIP("NSLocale not supported\nThe ICU library was not available when GNUstep-base was built")
|
||||
|
||||
|
||||
PASS([fmt getObjectValue: &num forString: @"0.00" errorDescription: nil]
|
||||
&& num != nil, "formatting suceeded")
|
||||
if (testPassed)
|
||||
{
|
||||
PASS(NO == [num isEqual: [NSDecimalNumber notANumber]],
|
||||
"is not equal to NaN")
|
||||
PASS(YES == [num isEqual: [NSDecimalNumber zero]],
|
||||
"is equal to zero")
|
||||
}
|
||||
|
||||
num = [[[NSNumber alloc] initWithFloat: 1234.567] autorelease];
|
||||
|
||||
str = [fmt stringFromNumber: num];
|
||||
|
|
Loading…
Reference in a new issue