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

Unified Diff: base/strings/string_number_conversions_unittest.cc

Issue 2415353002: Add boundary test case to StringToDouble (Closed)
Patch Set: Created 4 years, 2 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 | no next file » | 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 6b2bd97da9a63b49e17c9201e9cdc9d335bda40d..b1f2469f41851ab1334d487ce71c2b7d840f93c2 100644
--- a/base/strings/string_number_conversions_unittest.cc
+++ b/base/strings/string_number_conversions_unittest.cc
@@ -745,6 +745,8 @@ TEST(StringNumberConversionsTest, StringToDouble) {
{"9e307", 9e307, true},
{"1.7976e308", 1.7976e308, true},
{"1.7977e308", HUGE_VAL, false},
+ {"1.797693134862315807e+308", HUGE_VAL, true},
+ {"1.797693134862315808e+308", HUGE_VAL, false},
{"9e308", HUGE_VAL, false},
{"9e309", HUGE_VAL, false},
{"9e999", HUGE_VAL, false},
@@ -754,6 +756,8 @@ TEST(StringNumberConversionsTest, StringToDouble) {
{"-9e307", -9e307, true},
{"-1.7976e308", -1.7976e308, true},
{"-1.7977e308", -HUGE_VAL, false},
+ {"-1.797693134862315807e+308", -HUGE_VAL, true},
+ {"-1.797693134862315808e+308", -HUGE_VAL, false},
{"-9e308", -HUGE_VAL, false},
{"-9e309", -HUGE_VAL, false},
{"-9e999", -HUGE_VAL, false},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698