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

Unified Diff: mojo/services/files/public/c/tests/errno_impl_unittest.cc

Issue 1388413005: Move //mojo/services/X/public/... to //mojo/services/X/... (part 1). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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
Index: mojo/services/files/public/c/tests/errno_impl_unittest.cc
diff --git a/mojo/services/files/public/c/tests/errno_impl_unittest.cc b/mojo/services/files/public/c/tests/errno_impl_unittest.cc
deleted file mode 100644
index 458f619fa91c4db762adc8200720e1b80bcd8d27..0000000000000000000000000000000000000000
--- a/mojo/services/files/public/c/tests/errno_impl_unittest.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This basically tests |ErrnoImpl::Setter|, since |ErrnoImpl| itself is just a
-// simple interface.
-
-#include "files/public/c/lib/errno_impl.h"
-
-#include "files/public/c/tests/mock_errno_impl.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace mojio {
-namespace {
-
-TEST(ErrnoImplTest, Setter) {
- const int kLastErrorSentinel = -12345;
-
- test::MockErrnoImpl errno_impl(-123);
-
- // Make sure |TestErrnoImpl| isn't totally broken.
- ASSERT_EQ(-123, errno_impl.Get());
- ASSERT_FALSE(errno_impl.was_set());
-
- errno_impl.Set(-456);
- ASSERT_EQ(-456, errno_impl.Get());
- ASSERT_TRUE(errno_impl.was_set());
-
- errno_impl.Reset(kLastErrorSentinel);
- {
- ErrnoImpl::Setter setter(&errno_impl);
- EXPECT_TRUE(setter.Set(0));
- EXPECT_FALSE(errno_impl.was_set()); // Shouldn't be set until destruction.
- // We may fiddle with the value.
- errno_impl.Reset(123);
- }
- EXPECT_TRUE(errno_impl.was_set());
- // But it'll be reset to the original value.
- EXPECT_EQ(kLastErrorSentinel, errno_impl.Get());
-
- errno_impl.Reset(kLastErrorSentinel);
- {
- ErrnoImpl::Setter setter(&errno_impl);
- // We may fiddle with the value.
- errno_impl.Reset(78);
- EXPECT_FALSE(setter.Set(456));
- // We may fiddle with the value again.
- errno_impl.Reset(90);
- EXPECT_FALSE(errno_impl.was_set()); // Shouldn't be set until destruction.
- }
- EXPECT_TRUE(errno_impl.was_set());
- // But it'll be set to the explicitly-set value.
- EXPECT_EQ(456, errno_impl.Get());
-}
-
-} // namespace
-} // namespace mojio

Powered by Google App Engine
This is Rietveld 408576698