Index: mojo/public/cpp/system/tests/macros_unittest.cc |
diff --git a/mojo/public/cpp/system/tests/macros_unittest.cc b/mojo/public/cpp/system/tests/macros_unittest.cc |
index 72a9b242776e52a385c91f04f7be3625ade4d5a4..e9daf52b0c5192c7865dedb62136cfca528bdd86 100644 |
--- a/mojo/public/cpp/system/tests/macros_unittest.cc |
+++ b/mojo/public/cpp/system/tests/macros_unittest.cc |
@@ -15,6 +15,7 @@ |
#include <assert.h> |
#include <stdint.h> |
#include <stdlib.h> |
+#include <utility> |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -97,7 +98,7 @@ class MoveOnlyInt { |
~MoveOnlyInt() {} |
// Move-only constructor and operator=. |
- MoveOnlyInt(MoveOnlyInt&& other) { *this = other.Pass(); } |
+ MoveOnlyInt(MoveOnlyInt&& other) { *this = std::move(other); } |
MoveOnlyInt& operator=(MoveOnlyInt&& other) { |
if (&other != this) { |
is_set_ = other.is_set_; |
@@ -124,17 +125,14 @@ TEST(MacrosCppTest, MoveOnlyType) { |
EXPECT_EQ(123, x.value()); |
MoveOnlyInt y; |
EXPECT_FALSE(y.is_set()); |
- y = x.Pass(); |
+ y = std::move(x); |
EXPECT_FALSE(x.is_set()); |
EXPECT_TRUE(y.is_set()); |
EXPECT_EQ(123, y.value()); |
- MoveOnlyInt z(y.Pass()); |
+ MoveOnlyInt z(std::move(y)); |
EXPECT_FALSE(y.is_set()); |
EXPECT_TRUE(z.is_set()); |
EXPECT_EQ(123, z.value()); |
- z = z.Pass(); |
- EXPECT_TRUE(z.is_set()); |
- EXPECT_EQ(123, z.value()); |
} |
// Use it, to make sure things get linked in and to avoid any warnings about |