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

Unified Diff: base/strings/string_number_conversions_unittest.cc

Issue 2296503003: Fix parsing of exponents in StringToDouble. (Closed)
Patch Set: Created 4 years, 4 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 640468c33d5c6274c26b57affb26c95c5a46487a..a12cecfdfcda1101bd99c2876451f9a71558064c 100644
--- a/base/strings/string_number_conversions_unittest.cc
+++ b/base/strings/string_number_conversions_unittest.cc
@@ -728,7 +728,23 @@ TEST(StringNumberConversionsTest, StringToDouble) {
{"2.99792458e8", 299792458.0, true},
{"149597870.691E+3", 149597870691.0, true},
{"6.", 6.0, true},
+ {"9e307", 9e307, true},
+ {"1.7976e308", 1.7976e308, true},
danakj 2016/09/01 23:49:23 Can you drop a comment on all these new ones where
Lei Zhang 2016/09/02 01:07:10 - Added comments for all the groups of cases. - Ad
+ {"1.7977e308", HUGE_VAL, false},
+ {"9e308", HUGE_VAL, false},
+ {"9e309", HUGE_VAL, false},
+ {"9e999", HUGE_VAL, false},
+ {"9e1999", HUGE_VAL, false},
+ {"9e19999", HUGE_VAL, false},
{"9e99999999999999999999", HUGE_VAL, false},
+ {"-9e307", -9e307, true},
+ {"-1.7976e308", -1.7976e308, true},
+ {"-1.7977e308", -HUGE_VAL, false},
+ {"-9e308", -HUGE_VAL, false},
+ {"-9e309", -HUGE_VAL, false},
+ {"-9e999", -HUGE_VAL, false},
+ {"-9e1999", -HUGE_VAL, false},
+ {"-9e19999", -HUGE_VAL, false},
{"-9e99999999999999999999", -HUGE_VAL, false},
{"1e-2", 0.01, true},
{"42 ", 42.0, false},
« 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