Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1795)

Unified Diff: base/strings/string_number_conversions_unittest.cc

Issue 2364123002: Merge latest changes from http://www.netlib.org/fp/dtoa.c into dtoa.cc (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/third_party/dmg_fp/README.chromium » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/strings/string_number_conversions_unittest.cc
diff --git a/base/strings/string_number_conversions_unittest.cc b/base/strings/string_number_conversions_unittest.cc
index 0576302a0798c98329531d27370a9bd15488ebdf..728537440f3d8292a4d63d30f7315f33d6c54826 100644
--- a/base/strings/string_number_conversions_unittest.cc
+++ b/base/strings/string_number_conversions_unittest.cc
@@ -890,4 +890,25 @@ TEST(StringNumberConversionsTest, StrtodFailures) {
}
}
+TEST(StringNumberConversionsTest, StringToDoubleBugs) {
+ static const struct {
+ std::string input;
+ double output;
+ bool success;
+ } cases[] = {
+ // crbug.com/588726 timeout
+ {"-0.0010000000000000000000000000000000000000001e-256",
+ -1.0000000000000001e-259, true},
+ };
+
+ for (size_t i = 0; i < arraysize(cases); ++i) {
scottmg 2016/09/23 18:12:40 Since there's only one case, it would be clearer t
kcwu 2016/09/23 19:23:06 Done.
+ double output;
+ errno = 1;
+ EXPECT_EQ(cases[i].success, StringToDouble(cases[i].input, &output));
+ if (cases[i].success)
+ EXPECT_EQ(1, errno) << i; // confirm that errno is unchanged.
+ EXPECT_DOUBLE_EQ(cases[i].output, output);
+ }
+}
+
} // namespace base
« no previous file with comments | « no previous file | base/third_party/dmg_fp/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698