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

Unified Diff: base/strings/string_number_conversions_unittest.cc

Issue 14749003: Stop overwriting errno in base::StringPrintf, StringAppendV, and StringToDouble (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comment Created 7 years, 8 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 | « base/strings/string_number_conversions.cc ('k') | 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 4d413d768ac5a35d41e2ca14245a06904d86f0e7..5ae59d304108a865fb994143f58aa091b03b2b5d 100644
--- a/base/strings/string_number_conversions_unittest.cc
+++ b/base/strings/string_number_conversions_unittest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <errno.h>
#include <math.h>
#include <limits>
@@ -449,7 +450,10 @@ TEST(StringNumberConversionsTest, StringToDouble) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) {
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);
}
« no previous file with comments | « base/strings/string_number_conversions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698