6 #include "tst-strtod.h"
8 static const char *tests
[] =
10 "inf", "Inf", "iNf", "inF", "INf", "iNF", "INF", "InF",
11 "infinity", "Infinity", "InfInity", "INFINITY"
13 #define ntests (sizeof (tests) / sizeof (tests[0]))
15 #define TEST_STRTOD(FSUF, FTYPE, FTOSTR, FTOSTRM, LSUF, CSUF) \
17 test_strto ## FSUF (void) \
20 for (int i = 0; i < ntests; ++i) \
23 FTYPE d = strto ## FSUF (tests[i], &endp); \
26 printf ("did not consume all of '%s'\n", tests[i]); \
31 printf ("'%s' does not pass isinf\n", tests[i]); \
39 GEN_TEST_STRTOD_FOREACH (TEST_STRTOD
)
44 /* The Turkish locale is notorious because tolower() maps 'I' to the
45 dotless lowercase 'i' and toupper() maps 'i' to an 'I' with a dot
47 if (setlocale (LC_ALL
, "tr_TR.UTF-8") == NULL
)
49 puts ("cannot set locale");
53 return STRTOD_TEST_FOREACH (test_strto
);
56 #define TEST_FUNCTION do_test ()
57 #include "../test-skeleton.c"