X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f Sender: rich AT phekda DOT freeserve DOT co DOT uk Message-ID: <3FA56E25.8164E380@phekda.freeserve.co.uk> Date: Sun, 02 Nov 2003 20:50:45 +0000 From: Richard Dawe X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586) X-Accept-Language: de,fr MIME-Version: 1.0 To: djgpp-workers AT delorie DOT com Subject: Re: locale fixes References: <3F9E3836 DOT 000008 DOT 02793 AT soapbox DOT yandex DOT ru> <3F9EC775 DOT 41795CD0 AT phekda DOT freeserve DOT co DOT uk> <3F9FD9C8 DOT 000003 DOT 05203 AT ariel DOT yandex DOT ru> <3FA164AB DOT EC4594A8 AT phekda DOT freeserve DOT co DOT uk> <3FA201EE DOT 000006 DOT 19866 AT tide DOT yandex DOT ru> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com 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 > #include > #include > #include > > 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