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

Side by Side Diff: base/memory/scoped_ptr_unittest.cc

Issue 1454993003: Add a move constructor and move assignment operator to scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a real move constructor 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 unified diff | Download patch
« base/memory/scoped_ptr.h ('K') | « base/memory/scoped_ptr.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 #include <utility>
8 9
9 #include "base/basictypes.h" 10 #include "base/basictypes.h"
10 #include "base/bind.h" 11 #include "base/bind.h"
11 #include "base/callback.h" 12 #include "base/callback.h"
12 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
13 14
14 namespace { 15 namespace {
15 16
16 // Used to test depth subtyping. 17 // Used to test depth subtyping.
17 class ConDecLoggerParent { 18 class ConDecLoggerParent {
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 EXPECT_FALSE(p < nullptr); 866 EXPECT_FALSE(p < nullptr);
866 EXPECT_TRUE(nullptr < p); 867 EXPECT_TRUE(nullptr < p);
867 EXPECT_FALSE(pnull < nullptr); 868 EXPECT_FALSE(pnull < nullptr);
868 EXPECT_FALSE(nullptr < pnull); 869 EXPECT_FALSE(nullptr < pnull);
869 870
870 EXPECT_FALSE(p <= nullptr); 871 EXPECT_FALSE(p <= nullptr);
871 EXPECT_TRUE(nullptr <= p); 872 EXPECT_TRUE(nullptr <= p);
872 EXPECT_TRUE(pnull <= nullptr); 873 EXPECT_TRUE(pnull <= nullptr);
873 EXPECT_TRUE(nullptr <= pnull); 874 EXPECT_TRUE(nullptr <= pnull);
874 } 875 }
876
877 namespace {
878 scoped_ptr<int> Thinger() {
879 scoped_ptr<int> r(new int);
880 return std::move(r);
881 }
882 }
883
884 TEST(ScopedPtrTest, MooMoo) {
885 Thinger();
886 }
OLDNEW
« base/memory/scoped_ptr.h ('K') | « base/memory/scoped_ptr.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698