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

Unified Diff: base/scoped_generic_unittest.cc

Issue 1479473002: base: Use std::move() instead of Pass() for real movable types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: basepass: missing-include Created 5 years, 1 month 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
« no previous file with comments | « base/profiler/win32_stack_frame_unwinder_unittest.cc ('k') | base/sequence_checker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/scoped_generic_unittest.cc
diff --git a/base/scoped_generic_unittest.cc b/base/scoped_generic_unittest.cc
index b28e154372e6f07ffdec17eec07f25bbf9ad8d8c..5a6abfb3c4b63b820cdc79ab80b798bd8bdd32af 100644
--- a/base/scoped_generic_unittest.cc
+++ b/base/scoped_generic_unittest.cc
@@ -2,9 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/scoped_generic.h"
+
+#include <utility>
#include <vector>
-#include "base/scoped_generic.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
@@ -85,10 +87,10 @@ TEST(ScopedGenericTest, ScopedGeneric) {
EXPECT_EQ(kSecond, values_freed[1]);
values_freed.clear();
- // Pass constructor.
+ // Move constructor.
{
ScopedInt a(kFirst, traits);
- ScopedInt b(a.Pass());
+ ScopedInt b(std::move(a));
EXPECT_TRUE(values_freed.empty()); // Nothing should be freed.
ASSERT_EQ(IntTraits::InvalidValue(), a.get());
ASSERT_EQ(kFirst, b.get());
@@ -98,11 +100,11 @@ TEST(ScopedGenericTest, ScopedGeneric) {
ASSERT_EQ(kFirst, values_freed[0]);
values_freed.clear();
- // Pass assign.
+ // Move assign.
{
ScopedInt a(kFirst, traits);
ScopedInt b(kSecond, traits);
- b = a.Pass();
+ b = std::move(a);
ASSERT_EQ(1u, values_freed.size());
EXPECT_EQ(kSecond, values_freed[0]);
ASSERT_EQ(IntTraits::InvalidValue(), a.get());
« no previous file with comments | « base/profiler/win32_stack_frame_unwinder_unittest.cc ('k') | base/sequence_checker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698