summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2021-08-23 01:45:57 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2021-08-23 01:45:57 +0000
commit03067ce786912393f7881d270721a01aa43597a7 (patch)
tree2d40424a6b7c70b08765e600ca46f416b942640b
parentf66dcfdebba52e142787f2548e4111744ddf9f41 (diff)
downloadmpfr-03067ce786912393f7881d270721a01aa43597a7.tar.gz
[tests/tsprintf.c] In locale_da_DK(), also try da_DK.utf8 (preferably):
in Debian/unstable, da_DK no longer exists. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14566 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--tests/tsprintf.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/tsprintf.c b/tests/tsprintf.c
index e4ea6a81b..de4ebf754 100644
--- a/tests/tsprintf.c
+++ b/tests/tsprintf.c
@@ -927,16 +927,19 @@ mixed (void)
#if defined(HAVE_LOCALE_H) && defined(HAVE_SETLOCALE) && MPFR_LCONV_DPTS
-/* Check with locale "da_DK". On most platforms, decimal point is ','
- and thousands separator is '.'; the test is not performed if this
- is not the case or if the locale doesn't exist. */
+/* Check with locale "da_DK.utf8" or "da_DK".
+ On most platforms, decimal point is ',' and thousands separator is '.';
+ if this is not the case or if the locale does not exist, the test is not
+ performed (and if the MPFR_CHECK_LOCALES environment variable is set,
+ the program fails). */
static void
locale_da_DK (void)
{
mpfr_prec_t p = 128;
mpfr_t x, y;
- if (setlocale (LC_ALL, "da_DK") == 0 ||
+ if ((setlocale (LC_ALL, "da_DK.utf8") == 0 &&
+ setlocale (LC_ALL, "da_DK") == 0) ||
localeconv()->decimal_point[0] != ',' ||
localeconv()->thousands_sep[0] != '.')
{