aboutsummaryrefslogtreecommitdiff
path: root/stdlib/bug-strtod2.c
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2017-06-08 15:39:03 -0400
committerZack Weinberg <zackw@panix.com>2017-06-08 15:39:03 -0400
commit5046dbb4a7eba5eccfd258f92f4735c9ffc8d069 (patch)
tree4470480d904b65cf14ca524f96f79eca818c3eaf /stdlib/bug-strtod2.c
parent199fc19d3aaaf57944ef036e15904febe877fc93 (diff)
downloadglibc-zack/build-layout-experiment.tar
glibc-zack/build-layout-experiment.tar.gz
glibc-zack/build-layout-experiment.tar.bz2
glibc-zack/build-layout-experiment.zip
Prepare for radical source tree reorganization.zack/build-layout-experiment
All top-level files and directories are moved into a temporary storage directory, REORG.TODO, except for files that will certainly still exist in their current form at top level when we're done (COPYING, COPYING.LIB, LICENSES, NEWS, README), all old ChangeLog files (which are moved to the new directory OldChangeLogs, instead), and the generated file INSTALL (which is just deleted; in the new order, there will be no generated files checked into version control).
Diffstat (limited to 'stdlib/bug-strtod2.c')
-rw-r--r--stdlib/bug-strtod2.c57
1 files changed, 0 insertions, 57 deletions
diff --git a/stdlib/bug-strtod2.c b/stdlib/bug-strtod2.c
deleted file mode 100644
index 6128f2dd56..0000000000
--- a/stdlib/bug-strtod2.c
+++ /dev/null
@@ -1,57 +0,0 @@
-#include <locale.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "tst-strtod.h"
-
-static const char *tests[] =
- {
- "inf", "Inf", "iNf", "inF", "INf", "iNF", "INF", "InF",
- "infinity", "Infinity", "InfInity", "INFINITY"
- };
-#define ntests (sizeof (tests) / sizeof (tests[0]))
-
-#define TEST_STRTOD(FSUF, FTYPE, FTOSTR, LSUF, CSUF) \
-static int \
-test_strto ## FSUF (void) \
-{ \
- int res = 0; \
- for (int i = 0; i < ntests; ++i) \
- { \
- char *endp; \
- FTYPE d = strto ## FSUF (tests[i], &endp); \
- if (*endp != '\0') \
- { \
- printf ("did not consume all of '%s'\n", tests[i]); \
- res = 1; \
- } \
- if (!isinf (d)) \
- { \
- printf ("'%s' does not pass isinf\n", tests[i]); \
- res = 1; \
- } \
- } \
- \
- return res; \
-}
-
-GEN_TEST_STRTOD_FOREACH (TEST_STRTOD)
-
-static int
-do_test (void)
-{
- /* The Turkish locale is notorious because tolower() maps 'I' to the
- dotless lowercase 'i' and toupper() maps 'i' to an 'I' with a dot
- above. */
- if (setlocale (LC_ALL, "tr_TR.UTF-8") == NULL)
- {
- puts ("cannot set locale");
- return 0;
- }
-
- return STRTOD_TEST_FOREACH (test_strto);
-}
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"