Mail Archives: djgpp-workers/2003/11/02/15:52:42
Hello.
Alexander Aganichev wrote:
>
> >>> I don't have time to review them properly, but they basically
> >>> look OK to me. I'll review them properly on Sunday, hopefully.
> >>>
> >>> Do you have any test programs for these functions?
> >>>
> >>> If there are any existing tests, do they still pass, after
> >>> applying your patches?
> >>
> >> In general, without new setlocale() all locale patches should
> >> do nothing more then all those functions currently do. They
> >> only add the possibility to modify the behaviour of these
> >> functions from external modules.
> >
> > Sure, it should work the same. ;) But how can you prove it
> > without some regression tests?
>
> Because of they obvious to me? ;)
Hmmm. ;)
> >> For decimal point fixes I'll write the test cases where
> >> decimal_point is set from the application to some odd character
> >> (like comma or even ampersend) and test that conversion from
> >> ASCII and to ASCII still stable.
> >
> > Sounds good.
>
> Here is the test case:
>
> == decimal.c ==
> #include <locale.h>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
>
> double d;
> long double ld;
> char buf[256];
> char *end;
>
> int main(int ac, char *av[])
> {
> localeconv()->decimal_point[0] = '$';
[snip]
This is not allowed by the C standard. The caller is not allowed to modify the
structure returned by localeconv().
That said, it works with our implementation. ;)
Thanks for the test cases!
I'll put those test cases in CVS. I will update them, so they can be run
automatically. That way, the user won't have to work out whether they passed
or failed.
Bye, Rich =]
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
"You can't evaluate a man by logic alone." -- McCoy, "I, Mudd", Star Trek
- Raw text -