Le 08/03/2016 18:18, Richard Frith-Macdonald a écrit :
I was suspecting the same and dug out my old PowerBook, but in the end it turns
out that it's really a locale issue. The test program uses code like
n1 = [NSDecimalNumber decimalNumberWithString: @"0.009"];
to define the decimal numbers. According to Apple's documentation this method
works with an unspecified locale, so the code works as long as this default
locale is English (or any other locale that uses a '.' as decimal separator),
but it breaks as soon as you are in a locale where '.' is not the decimal
separator (in my case German, where ',' is the decimal separator). I guess, the
test needs to be changed to use a fixed locale. On the other hand, on OS X with
Apple's foundation the test seems to work for me even though my default locale
is set to German. Perhaps while the default locale used by
-decimalNumberWithString: is unspecified according to Apple's documentation
they really use a fixed locale regardless of the user's locale nevertheless?
Thanks ... I changed the test to explicitly use [NSLocale systemLocale] ... I
hope that fixes it.
I looked at the Apple documentation, and to me it reads like they *should* be
using the German locale.
Applied, compiled, tested...
"bertrand@Gromac:~/Bureau/gnustep_svn/modules/core/base/Tests/base/NSNumber$
gnustep-tests test02.m
--- Running tests in . ---
5 Passed tests
All OK!"
and passed !
Thanks.
Bertrand
_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep