From cdfb970dd9c20861d7fdac16435d70792b8a027a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 31 Oct 2000 03:10:13 +0000 Subject: Update. * locale/findlocale.c (free_mem): We can remove NODELETE marked data, just not the C locale data. * intl/tst-gettext.c: Use setlocale() in addition to setting envvar. * intl/tst-gettext.sh: Copy locale data if necessary. * intl/Makefile (generated-dirs): Add localedir. * intl/dcigettext.c (guess_category_value): For libc always use the setlocale() method. * intl/Makefile: Add rules to build, run and, distribute tst-gettext2. * intl/tst-gettext2.c: New file. * intl/tst-gettext2.sh: New file. * intl/tstlang1.po: New file. * intl/tstlang2.po: New file. Patch by Andreas Jaeger . 2000-10-26 GOTO Masanori * intl/locale.alias: Add ja_JP.ujis alias. 2000-10-30 Ulrich Drepper --- intl/tst-gettext.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'intl/tst-gettext.c') diff --git a/intl/tst-gettext.c b/intl/tst-gettext.c index cfd2d5fc53..a83b1d25bd 100644 --- a/intl/tst-gettext.c +++ b/intl/tst-gettext.c @@ -106,6 +106,7 @@ main (int argc, char *argv[]) /* Now the same tests with LC_ALL deciding. */ unsetenv ("LANGUAGE"); setenv ("LC_ALL", "existing-locale", 1); + setlocale (LC_ALL, ""); puts ("test `gettext' with LC_ALL set"); /* This is the name of the existing domain with a catalog for the LC_MESSAGES category. */ @@ -119,13 +120,13 @@ main (int argc, char *argv[]) LC_MESSAGES category. We leave this value set for the `dgettext' and `dcgettext' tests. */ textdomain ("non-existing-domain"); - puts ("test `gettext' with LANGUAGE set"); + puts ("test `gettext' with LC_ALL deciding"); if (negative_gettext_test () != 0) { puts ("FAILED"); result = 1; } - puts ("test `dgettext' with LANGUAGE set"); + puts ("test `dgettext' with LC_ALL deciding"); if (positive_dgettext_test ("existing-domain") != 0) { puts ("FAILED"); @@ -135,8 +136,11 @@ main (int argc, char *argv[]) /* Now the same tests with LC_MESSAGES deciding. */ unsetenv ("LC_ALL"); setenv ("LC_MESSAGES", "existing-locale", 1); + setlocale (LC_MESSAGES, ""); setenv ("LC_TIME", "existing-locale", 1); + setlocale (LC_TIME, ""); setenv ("LC_NUMERIC", "non-existing-locale", 1); + setlocale (LC_NUMERIC, ""); puts ("test `gettext' with LC_ALL set"); /* This is the name of the existing domain with a catalog for the LC_MESSAGES category. */ @@ -150,33 +154,33 @@ main (int argc, char *argv[]) LC_MESSAGES category. We leave this value set for the `dgettext' and `dcgettext' tests. */ textdomain ("non-existing-domain"); - puts ("test `gettext' with LANGUAGE set"); + puts ("test `gettext' with LC_xxx deciding"); if (negative_gettext_test () != 0) { puts ("FAILED"); result = 1; } - puts ("test `dgettext' with LANGUAGE set"); + puts ("test `dgettext' with LC_xxx deciding"); if (positive_dgettext_test ("existing-domain") != 0) { puts ("FAILED"); result = 1; } - puts ("test `dcgettext' with LANGUAGE set (LC_MESSAGES)"); + puts ("test `dcgettext' with category == LC_MESSAGES"); if (positive_dcgettext_test ("existing-domain", LC_MESSAGES) != 0) { puts ("FAILED"); result = 1; } /* Try a different category. For this we also switch the domain. */ - puts ("test `dcgettext' with LANGUAGE set (LC_TIME)"); + puts ("test `dcgettext' with LANGUAGE == LC_TIME"); if (positive_dcgettext_test ("existing-time-domain", LC_TIME) != 0) { puts ("FAILED"); result = 1; } /* This time use a category for which there is no catalog. */ - puts ("test `dcgettext' with LANGUAGE set (LC_NUMERIC)"); + puts ("test `dcgettext' with LANGUAGE == LC_NUMERIC"); if (negative_dcgettext_test ("existing-domain", LC_NUMERIC) != 0) { puts ("FAILED"); @@ -186,10 +190,11 @@ main (int argc, char *argv[]) /* Now the same tests with LANG deciding. */ unsetenv ("LC_MESSAGES"); setenv ("LANG", "existing-locale", 1); + setlocale (LC_ALL, ""); /* This is the name of the existing domain with a catalog for the LC_MESSAGES category. */ textdomain ("existing-domain"); - puts ("test `gettext' with LC_ALL set"); + puts ("test `gettext' with LANG set"); if (positive_gettext_test () != 0) { puts ("FAILED"); @@ -199,19 +204,21 @@ main (int argc, char *argv[]) LC_MESSAGES category. We leave this value set for the `dgettext' and `dcgettext' tests. */ textdomain ("non-existing-domain"); - puts ("test `gettext' with LANGUAGE set"); + puts ("test `gettext' with LANG set"); if (negative_gettext_test () != 0) { puts ("FAILED"); result = 1; } - puts ("test `dgettext' with LANGUAGE set"); + puts ("test `dgettext' with LANG set"); if (positive_dgettext_test ("existing-domain") != 0) { puts ("FAILED"); result = 1; } + setlocale (LC_ALL, "C"); + return result; } -- cgit 1.4.1