diff options
author | Jakub Jelinek <jakub@redhat.com> | 2006-12-14 09:06:34 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2006-12-14 09:06:34 +0000 |
commit | b51633c5723e311ffd59a2f5ec5759914ed9476b (patch) | |
tree | 117191337a4d725029756cbfc1bb2ff545e0606c /stdlib/tst-strtod2.c | |
parent | 985d254c909903787e4bbc517af30406e0e9df8b (diff) |
Updated to fedora-glibc-20061214T0850cvs/fedora-glibc-2_5_90-13
Diffstat (limited to 'stdlib/tst-strtod2.c')
-rw-r--r-- | stdlib/tst-strtod2.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/stdlib/tst-strtod2.c b/stdlib/tst-strtod2.c new file mode 100644 index 0000000000..925ea9cafa --- /dev/null +++ b/stdlib/tst-strtod2.c @@ -0,0 +1,25 @@ +#include <stdio.h> +#include <stdlib.h> + +static int +do_test (void) +{ + int status = 0; + const char s[] = "0x"; + char *ep; + double r = strtod (s, &ep); + if (r != 0) + { + printf ("r = %g, expect 0\n", r); + status = 1; + } + if (ep != s + 1) + { + printf ("strtod parsed %ju characters, expected 1\n", ep - s); + status = 1; + } + return status; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" |