Martin Storsjo : msvcrt: Test that the normal strtod doesn't handle the " NAN" string.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Aug 31 06:41:59 CDT 2015
Module: wine
Branch: master
Commit: 8edbd9b381a921df7d8d681cd4579a1c8de5fb13
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8edbd9b381a921df7d8d681cd4579a1c8de5fb13
Author: Martin Storsjo <martin at martin.st>
Date: Sun Aug 30 23:47:15 2015 +0300
msvcrt: Test that the normal strtod doesn't handle the "NAN" string.
---
dlls/msvcrt/tests/string.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c
index 476f762..d247ba6 100644
--- a/dlls/msvcrt/tests/string.c
+++ b/dlls/msvcrt/tests/string.c
@@ -1728,6 +1728,7 @@ static void test__strtod(void)
const char double3[] = "INF";
const char double4[] = ".21e12";
const char double5[] = "214353e-3";
+ const char double6[] = "NAN";
const char overflow[] = "1d9999999999999999999";
const char white_chars[] = " d10";
@@ -1754,6 +1755,10 @@ static void test__strtod(void)
ok(almost_equal(d, 214.353), "d = %lf\n", d);
ok(end == double5+9, "incorrect end (%d)\n", (int)(end-double5));
+ d = strtod(double6, &end);
+ ok(almost_equal(d, 0), "d = %lf\n", d);
+ ok(end == double6, "incorrect end (%d)\n", (int)(end-double6));
+
d = strtod("12.1d2", NULL);
ok(almost_equal(d, 12.1e2), "d = %lf\n", d);
More information about the wine-cvs
mailing list