diff options
| author | David Schultz <das@FreeBSD.org> | 2008-06-21 19:28:26 +0000 |
|---|---|---|
| committer | David Schultz <das@FreeBSD.org> | 2008-06-21 19:28:26 +0000 |
| commit | c0ff67d57fe0e7be784e1286fa0dceaefd64f6a2 (patch) | |
| tree | 5f11b2185effe7b0490d0aa80161dc2b9ede05ca /tools/regression/lib/libc/stdio/test-scanfloat.c | |
| parent | c713eaa60353b6f1bc562075efcbe0720233249e (diff) | |
Notes
Diffstat (limited to 'tools/regression/lib/libc/stdio/test-scanfloat.c')
| -rw-r--r-- | tools/regression/lib/libc/stdio/test-scanfloat.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/regression/lib/libc/stdio/test-scanfloat.c b/tools/regression/lib/libc/stdio/test-scanfloat.c index b768ed7548b2..6ab63c842c22 100644 --- a/tools/regression/lib/libc/stdio/test-scanfloat.c +++ b/tools/regression/lib/libc/stdio/test-scanfloat.c @@ -49,8 +49,9 @@ main(int argc, char *argv[]) long double ld = 0.0; double d = 0.0; float f = 0.0; + char *endp; - printf("1..3\n"); + printf("1..4\n"); buf[0] = '\0'; assert(setlocale(LC_NUMERIC, "")); @@ -274,6 +275,15 @@ main(int argc, char *argv[]) printf("ok 3 - scanfloat\n"); + /* + * Tests specific to strtod(). + */ + + assert(strtod("0xy", &endp) == 0); + assert(strcmp("xy", endp) == 0); + + printf("ok 4 - scanfloat\n"); + return (0); } |
