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

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

Issue 6714032: Move some files in base to base/memory. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: only base Created 9 years, 9 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace { 9 namespace {
10 10
11 class ConDecLogger { 11 class ConDecLogger {
12 public: 12 public:
13 ConDecLogger() : ptr_(NULL) { } 13 ConDecLogger() : ptr_(NULL) { }
14 explicit ConDecLogger(int* ptr) { set_ptr(ptr); } 14 explicit ConDecLogger(int* ptr) { set_ptr(ptr); }
15 ~ConDecLogger() { --*ptr_; } 15 ~ConDecLogger() { --*ptr_; }
16 16
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 scoper2.swap(scoper1); 160 scoper2.swap(scoper1);
161 EXPECT_EQ(loggers, scoper2.get()); 161 EXPECT_EQ(loggers, scoper2.get());
162 EXPECT_FALSE(scoper1.get()); 162 EXPECT_FALSE(scoper1.get());
163 EXPECT_FALSE(scoper1 == scoper2.get()); 163 EXPECT_FALSE(scoper1 == scoper2.get());
164 EXPECT_TRUE(scoper1 != scoper2.get()); 164 EXPECT_TRUE(scoper1 != scoper2.get());
165 } 165 }
166 EXPECT_EQ(0, constructed); 166 EXPECT_EQ(0, constructed);
167 } 167 }
168 168
169 // TODO scoped_ptr_malloc 169 // TODO scoped_ptr_malloc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698