| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // This basically tests |ErrnoImpl::Setter|, since |ErrnoImpl| itself is just a | 5 // This basically tests |ErrnoImpl::Setter|, since |ErrnoImpl| itself is just a |
| 6 // simple interface. | 6 // simple interface. |
| 7 | 7 |
| 8 #include "files/public/c/lib/errno_impl.h" | 8 #include "files/c/lib/errno_impl.h" |
| 9 | 9 |
| 10 #include "files/public/c/tests/mock_errno_impl.h" | 10 #include "files/c/tests/mock_errno_impl.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 12 |
| 13 namespace mojio { | 13 namespace mojio { |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 TEST(ErrnoImplTest, Setter) { | 16 TEST(ErrnoImplTest, Setter) { |
| 17 const int kLastErrorSentinel = -12345; | 17 const int kLastErrorSentinel = -12345; |
| 18 | 18 |
| 19 test::MockErrnoImpl errno_impl(-123); | 19 test::MockErrnoImpl errno_impl(-123); |
| 20 | 20 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 48 errno_impl.Reset(90); | 48 errno_impl.Reset(90); |
| 49 EXPECT_FALSE(errno_impl.was_set()); // Shouldn't be set until destruction. | 49 EXPECT_FALSE(errno_impl.was_set()); // Shouldn't be set until destruction. |
| 50 } | 50 } |
| 51 EXPECT_TRUE(errno_impl.was_set()); | 51 EXPECT_TRUE(errno_impl.was_set()); |
| 52 // But it'll be set to the explicitly-set value. | 52 // But it'll be set to the explicitly-set value. |
| 53 EXPECT_EQ(456, errno_impl.Get()); | 53 EXPECT_EQ(456, errno_impl.Get()); |
| 54 } | 54 } |
| 55 | 55 |
| 56 } // namespace | 56 } // namespace |
| 57 } // namespace mojio | 57 } // namespace mojio |
| OLD | NEW |