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

Unified Diff: mojo/public/cpp/system/tests/core_unittest.cc

Issue 1535943002: Convert Pass()→std::move() in //mojo/public/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Regenerate correctly 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 side-by-side diff with in-line comments
Download patch
Index: mojo/public/cpp/system/tests/core_unittest.cc
diff --git a/mojo/public/cpp/system/tests/core_unittest.cc b/mojo/public/cpp/system/tests/core_unittest.cc
index ee955f1b38fc1367b92706453425791e84914315..b3ebea2d202a1f1f4ffde43b8c370997e8b76168 100644
--- a/mojo/public/cpp/system/tests/core_unittest.cc
+++ b/mojo/public/cpp/system/tests/core_unittest.cc
@@ -10,8 +10,8 @@
#include <stddef.h>
#include <stdint.h>
-
#include <map>
+#include <utility>
#include "mojo/public/cpp/system/macros.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -103,7 +103,7 @@ TEST(CoreCppTest, Basic) {
EXPECT_EQ(kInvalidHandleValue, h.get().value());
// This should be a no-op.
- Close(h.Pass());
+ Close(std::move(h));
// It should still be invalid.
EXPECT_EQ(kInvalidHandleValue, h.get().value());
@@ -213,7 +213,7 @@ TEST(CoreCppTest, Basic) {
EXPECT_EQ(kSignalAll, states[1].satisfiable_signals);
// Test closing |h1| explicitly.
- Close(h1.Pass());
+ Close(std::move(h1));
EXPECT_FALSE(h1.get().is_valid());
// Make sure |h1| is closed.
@@ -474,22 +474,12 @@ TEST(CoreCppTest, ScopedHandleMoveCtor) {
// If this fails to close buffer1, ScopedHandleBase::CloseIfNecessary() will
// assert.
- buffer1 = buffer2.Pass();
+ buffer1 = std::move(buffer2);
EXPECT_TRUE(buffer1.is_valid());
EXPECT_FALSE(buffer2.is_valid());
}
-TEST(CoreCppTest, ScopedHandleMoveCtorSelf) {
- ScopedSharedBufferHandle buffer1;
- EXPECT_EQ(MOJO_RESULT_OK, CreateSharedBuffer(nullptr, 1024, &buffer1));
- EXPECT_TRUE(buffer1.is_valid());
-
- buffer1 = buffer1.Pass();
-
- EXPECT_TRUE(buffer1.is_valid());
-}
-
// TODO(vtl): Write data pipe tests.
} // namespace
« no previous file with comments | « mojo/public/cpp/bindings/tests/validation_unittest.cc ('k') | mojo/public/cpp/system/tests/macros_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698