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

Side by Side Diff: base/scoped_clear_errno_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: Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <errno.h>
6
7 #include "base/scoped_clear_errno.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 TEST(ScopedClearErrno, TestNoError) {
11 errno = 1;
12 {
13 ScopedClearErrno clear_error;
14 EXPECT_EQ(0, errno);
15 }
16 EXPECT_EQ(1, errno);
17 }
18
19 TEST(ScopedClearErrno, TestError) {
20 errno = 1;
21 {
22 ScopedClearErrno clear_error;
23 errno = 2;
24 }
25 EXPECT_EQ(2, errno);
26 }
OLDNEW
« base/scoped_clear_errno.h ('K') | « base/scoped_clear_errno.h ('k') | base/stringprintf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698