OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |