Forgot to reply to all...

---------- Forwarded message ----------
From: Stefan Bidi <stefanb...@gmail.com>
Date: Sat, Jan 21, 2012 at 9:51 AM
Subject: Re: GNUstep Code Freeze
To: Fred Kiefer <fredkie...@gmx.de>


Those failures seem to come up every once in a while.  I've never been able
to reproduce this bug on any of my machines, though.  The attached test
does essential the same thing as NSNumberFormatter, and I'm willing to bet
it will work on your system (build with "gcc `icu-config --ldflags` -licuio
test_unum.c").

The method that actually does all the work is -stringForObjectValue:.  Can
you set a break point there and see if anything jumps out at you?


On Sat, Jan 21, 2012 at 9:17 AM, Fred Kiefer <fredkie...@gmx.de> wrote:

> I just did run the tests for base and get 12 failures. One is the know
> +initialize bug of the gcc runtime. The other 11 come from the
> NSNumberFormatter:
>
>
> base/NSNumberFormatter/**basic10_4.m:
> Failed test:         basic10_4.m:75 ... default 10.4 format same as Cocoa
> Failed test:         basic10_4.m:82 ... round up for fractional part >0.5
> Failed test:         basic10_4.m:87 ... round down for fractional part <0.5
> Failed test:         basic10_4.m:93 ... minus sign assigned correctly
> Failed test:         basic10_4.m:111 ... format width set correctly
> Failed test:         basic10_4.m:115 ... positive prefix set correctly
> Failed test:         basic10_4.m:119 ... default padding position is
> before prefix
> Failed test:         basic10_4.m:124 ... numeric and space padding OK
> Failed test:         basic10_4.m:137 ... positive prefix is set correctly
> for currency style
> Failed test:         basic10_4.m:141 ... prefix and suffix used properly
> Failed test:         basic10_4.m:145 ... negativeFormat used for -ve number
> --- Running tests in base/NSObject ---
>
> And here the extract from test.log:
> Testing basic10_4.m...
> Running base/NSNumberFormatter/**basic10_4.m...
> Start set:       basic10_4.m:17 ... NSNumberFormatter
> Passed test:       basic10_4.m:21 ... default behavior is
> NSNumberFormatterBehavior10_4
> Passed test:       basic10_4.m:27 ... default behavior can be changed to
> NSNumberFormatterBehavior10_0
> Passed test:       basic10_4.m:33 ... NSNumberFormatterBehaviorDefau**lt
> gives NSNumberFormatterBehavior10_4
> Passed test:       basic10_4.m:39 ... unknown behavior is accepted
> Passed test:       basic10_4.m:45 ... default behavior can be changed to
> NSNumberFormatterBehavior10_4
> Passed test:       basic10_4.m:50 ... a new formatter gets the current
> default behavior
> Passed test:       basic10_4.m:53 ... a new formatter can have the default
> behavior set
> Passed test:       basic10_4.m:56 ... notANumber special case
> Start set:         basic10_4.m:58 ... NSLocale
> Passed test:         basic10_4.m:63 ... formatting suceeded
> Passed test:         basic10_4.m:67 ... is not equal to NaN
> Passed test:         basic10_4.m:69 ... is equal to zero
> Failed test:         basic10_4.m:75 ... default 10.4 format same as Cocoa
> Expected '1235' and got 'NaN'
> Failed test:         basic10_4.m:82 ... round up for fractional part >0.5
> Expected '1234.57' and got 'NaN'
> Failed test:         basic10_4.m:87 ... round down for fractional part <0.5
> Expected '1234.43' and got 'NaN'
> Failed test:         basic10_4.m:93 ... minus sign assigned correctly
> Expected '_1234.4' and got 'NaN'
> Dashed hope:         basic10_4.m:100 ... Negative percentage correct
> Expected '_123,443##' and got 'NaN'
> Failed test:         basic10_4.m:111 ... format width set correctly
> Expected '**1234' and got '***NaN'
> Failed test:         basic10_4.m:115 ... positive prefix set correctly
> Expected '*+1234' and got '***NaN'
> Failed test:         basic10_4.m:119 ... default padding position is
> before prefix
> Expected '0+1234' and got '000NaN'
> Failed test:         basic10_4.m:124 ... numeric and space padding OK
> Expected '+01234' and got '000NaN'
> Dashed hope:         basic10_4.m:132 ... currency style does not include
> currency string
> Expected '+1.235' and got '000NaN'
> Failed test:         basic10_4.m:137 ... positive prefix is set correctly
> for currency style
> Expected '+1.235' and got '000NaN'
> Failed test:         basic10_4.m:141 ... prefix and suffix used properly
> Expected '+1.235c' and got '000NaN'
> Failed test:         basic10_4.m:145 ... negativeFormat used for -ve number
> Expected '(R$1.235)' and got '000NaN'
> Dashed hope:         basic10_4.m:151 ... format string of length 1
> Expected '_01235' and got '000NaN'
> End set:           basic10_4.m:154 ... NSLocale
> End set:         basic10_4.m:156 ... NSNumberFormatter
> Completed file:  basic10_4.m
>
>
> This is on 64bit OpenSuse 12.1 with gcc 4.6.2 and /usr/bin/icu-config
> --version reports 4.6.1.
>
> ______________________________**_________________
> Gnustep-dev mailing list
> Gnustep-dev@gnu.org
> https://lists.gnu.org/mailman/**listinfo/gnustep-dev<https://lists.gnu.org/mailman/listinfo/gnustep-dev>
>
#include <unicode/unum.h>
#include <unicode/ustdio.h>
#include <stdio.h>

int main (void)
{
  UChar buffer[1024];
  UErrorCode err = U_ZERO_ERROR;
  int32_t len;
  UNumberFormat *fmt;
  UFILE *f;
  
  fmt = unum_open (UNUM_DECIMAL, NULL, 0, NULL, NULL, &err);
  len = unum_formatDouble (fmt, 1234.00, buffer, 1024, NULL, &err);
  
  f = u_finit (stdout, NULL, NULL);
  u_fprintf (f, "%S\n", buffer);
  
  return 0;
}
_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to