Mercurial > gnulib
comparison tests/test-strtold1.sh @ 40172:31ab89a208b9
strtod, strtold: Use the locale's decimal point.
* lib/strtod.c: Include <locale.h>, <stdio.h>, <langinfo.h>.
(decimal_point_char): New function, copied from lib/vasnprintf.c.
(parse_number): Add a radixchar argument. Use it instead of '.'.
(STRTOD): Invoke decimal_point_char and pass the result to parse_number.
* m4/strtod.m4 (gl_PREREQ_STRTOD): Test whether nl_langinfo exists.
* m4/strtold.m4 (gl_PREREQ_STRTOLD): Likewise.
* tests/test-strtod1.c: New file.
* tests/test-strtod1.sh: New file.
* modules/strtod-tests (Files): Add test-strtod1.{sh,c}. Add
locale-fr.m4 and its dependencies.
(configure.ac): Invoke gt_LOCALE_FR, gt_LOCALE_FR_UTF8.
(Makefile.am): Arrange to compile test-strtod1.c and run
test-strtod1.sh.
* tests/test-strtold1.c: New file.
* tests/test-strtold1.sh: New file.
* modules/strtold-tests (Files): Add test-strtold1.{sh,c}. Add
locale-fr.m4 and its dependencies.
(configure.ac): Invoke gt_LOCALE_FR, gt_LOCALE_FR_UTF8.
(Makefile.am): Arrange to compile test-strtold1.c and run
test-strtold1.sh.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Fri, 01 Feb 2019 03:12:28 +0100 |
parents | |
children | 8c1a17df67e0 |
comparison
equal
deleted
inserted
replaced
40171:fbfa1d6417d9 | 40172:31ab89a208b9 |
---|---|
1 #!/bin/sh | |
2 | |
3 : ${LOCALE_FR=fr_FR} | |
4 : ${LOCALE_FR_UTF8=fr_FR.UTF-8} | |
5 | |
6 if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then | |
7 if test -f /usr/bin/localedef; then | |
8 echo "Skipping test: no locale for testing is installed" | |
9 else | |
10 echo "Skipping test: no locale for testing is supported" | |
11 fi | |
12 exit 77 | |
13 fi | |
14 | |
15 if test $LOCALE_FR != none; then | |
16 LC_ALL=$LOCALE_FR ./test-strtold1${EXEEXT} || exit 1 | |
17 fi | |
18 | |
19 if test $LOCALE_FR_UTF8 != none; then | |
20 LC_ALL=$LOCALE_FR_UTF8 ./test-strtold1${EXEEXT} || exit 1 | |
21 fi | |
22 | |
23 exit 0 |