view modules/strtold-tests @ 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 c1aa6d1185ea
children
line wrap: on
line source

Files:
tests/test-strtold.c
tests/test-strtold1.sh
tests/test-strtold1.c
tests/signature.h
tests/minus-zero.h
tests/macros.h
m4/locale-fr.m4
m4/codeset.m4

Depends-on:
float
isnanl-nolibm
signbit

configure.ac:
gt_LOCALE_FR
gt_LOCALE_FR_UTF8

Makefile.am:
TESTS += test-strtold
check_PROGRAMS += test-strtold

TESTS += test-strtold1.sh
TESTS_ENVIRONMENT += \
  LOCALE_FR='@LOCALE_FR@' \
  LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
check_PROGRAMS += test-strtold1