From c61a9cfbc48e9d9b719b4bc26fa3d9ce3fbaa964 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 26 Apr 2006 05:52:58 +0000 Subject: [BZ #2420] * stdlib/strfmon_l.c (__vstrfmon_l): Fix handling of ! modifier. * localedata/Makefile: Add rules to build and run tst-strfmon1. * localedata/tst-strfmon1.c: New file. --- localedata/ChangeLog | 5 +++++ localedata/Makefile | 4 +++- localedata/locales/es_UY | 2 +- localedata/tst-strfmon1.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 localedata/tst-strfmon1.c (limited to 'localedata') diff --git a/localedata/ChangeLog b/localedata/ChangeLog index de23e123e3..4eed4ecc34 100644 --- a/localedata/ChangeLog +++ b/localedata/ChangeLog @@ -1,3 +1,8 @@ +2006-04-25 Ulrich Drepper + + [BZ #2376] + * locales/es_UY: Change curreny_symbol. + 2006-04-24 Ulrich Drepper [BZ #2349] diff --git a/localedata/Makefile b/localedata/Makefile index db22cf16e4..db7094fabe 100644 --- a/localedata/Makefile +++ b/localedata/Makefile @@ -92,7 +92,8 @@ locale_test_suite := tst_iswalnum tst_iswalpha tst_iswcntrl \ tst_wctype tst_wcwidth tests = $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \ - tst-leaks tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale + tst-leaks tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \ + tst-strfmon1 ifeq (yes,$(build-shared)) ifneq (no,$(PERL)) tests: $(objpfx)mtrace-tst-leaks @@ -282,6 +283,7 @@ tst-digits-ENV = $(TEST_MBWC_ENV) tst-mbswcs6-ENV = $(TEST_MBWC_ENV) tst-xlocale1-ENV = $(TEST_MBWC_ENV) tst-xlocale2-ENV = $(TEST_MBWC_ENV) +tst-strfmon1-ENV = $(TEST_MBWC_ENV) tst-setlocale-ENV = LOCPATH=$(common-objpfx)localedata LC_ALL=ja_JP.EUC-JP diff --git a/localedata/locales/es_UY b/localedata/locales/es_UY index 36d18b1af2..50f8019da2 100644 --- a/localedata/locales/es_UY +++ b/localedata/locales/es_UY @@ -62,7 +62,7 @@ END LC_MESSAGES LC_MONETARY int_curr_symbol "" -currency_symbol "" +currency_symbol "" mon_decimal_point "" mon_thousands_sep "" mon_grouping 3;3 diff --git a/localedata/tst-strfmon1.c b/localedata/tst-strfmon1.c new file mode 100644 index 0000000000..e30aa1b204 --- /dev/null +++ b/localedata/tst-strfmon1.c @@ -0,0 +1,42 @@ +#include +#include +#include +#include + +static const struct +{ + const char *locale; + const char *expected; +} tests[] = + { + { "de_DE.ISO-8859-1", "|-12,34 EUR|-12,34|" }, + { "da_DK.ISO-8859-1", "|kr -12,34|-12,34|" }, + { "zh_TW.EUC-TW", "|-NT$12.34|-12.34|" }, + { "sv_SE.ISO-8859-1", "|-12,34 kr|-12,34|" } + }; +#define ntests (sizeof (tests) / sizeof (tests[0])) + + +static int +do_test (void) +{ + int res = 0; + for (int i = 0; i < ntests; ++i) + { + char buf[500]; + if (setlocale (LC_ALL, tests[i].locale) == NULL) + { + printf ("failed to set locale %s\n", tests[i].locale); + res = 1; + continue; + } + strfmon (buf, sizeof (buf), "|%n|%!n|", -12.34, -12.34); + int fail = strcmp (buf, tests[i].expected) != 0; + printf ("%s%s\n", buf, fail ? " *** FAIL ***" : ""); + res |= fail; + } + return res; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" -- cgit v1.2.1