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

Side by Side Diff: base/scoped_clear_errno_unittest.cc

Issue 1466413002: Update gtest to 786564fa4a3c, switch to googlemock in gtest Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « base/rand_util_unittest.cc ('k') | base/scoped_generic_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <errno.h> 5 #include <errno.h>
6 6
7 #include "base/scoped_clear_errno.h" 7 #include "base/scoped_clear_errno.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/googletest/include/gtest/gtest.h"
9 9
10 namespace base { 10 namespace base {
11 11
12 TEST(ScopedClearErrno, TestNoError) { 12 TEST(ScopedClearErrno, TestNoError) {
13 errno = 1; 13 errno = 1;
14 { 14 {
15 ScopedClearErrno clear_error; 15 ScopedClearErrno clear_error;
16 EXPECT_EQ(0, errno); 16 EXPECT_EQ(0, errno);
17 } 17 }
18 EXPECT_EQ(1, errno); 18 EXPECT_EQ(1, errno);
19 } 19 }
20 20
21 TEST(ScopedClearErrno, TestError) { 21 TEST(ScopedClearErrno, TestError) {
22 errno = 1; 22 errno = 1;
23 { 23 {
24 ScopedClearErrno clear_error; 24 ScopedClearErrno clear_error;
25 errno = 2; 25 errno = 2;
26 } 26 }
27 EXPECT_EQ(2, errno); 27 EXPECT_EQ(2, errno);
28 } 28 }
29 29
30 } // namespace base 30 } // namespace base
OLDNEW
« no previous file with comments | « base/rand_util_unittest.cc ('k') | base/scoped_generic_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698