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

Side by Side Diff: base/debug/leak_tracker_unittest.cc

Issue 2625903003: Update scoped_ptr references to be unique_ptr in src/base comments. (Closed)
Patch Set: spelling fix Created 3 years, 11 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
« no previous file with comments | « base/bind_helpers.h ('k') | base/mac/scoped_authorizationref.h » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/debug/leak_tracker.h" 5 #include "base/debug/leak_tracker.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 12 matching lines...) Expand all
23 LeakTracker<ClassB> leak_tracker_; 23 LeakTracker<ClassB> leak_tracker_;
24 }; 24 };
25 25
26 #ifndef ENABLE_LEAK_TRACKER 26 #ifndef ENABLE_LEAK_TRACKER
27 27
28 // If leak tracking is disabled, we should do nothing. 28 // If leak tracking is disabled, we should do nothing.
29 TEST(LeakTrackerTest, NotEnabled) { 29 TEST(LeakTrackerTest, NotEnabled) {
30 EXPECT_EQ(-1, LeakTracker<ClassA>::NumLiveInstances()); 30 EXPECT_EQ(-1, LeakTracker<ClassA>::NumLiveInstances());
31 EXPECT_EQ(-1, LeakTracker<ClassB>::NumLiveInstances()); 31 EXPECT_EQ(-1, LeakTracker<ClassB>::NumLiveInstances());
32 32
33 // Use scoped_ptr so compiler doesn't complain about unused variables. 33 // Use unique_ptr so compiler doesn't complain about unused variables.
34 std::unique_ptr<ClassA> a1(new ClassA); 34 std::unique_ptr<ClassA> a1(new ClassA);
35 std::unique_ptr<ClassB> b1(new ClassB); 35 std::unique_ptr<ClassB> b1(new ClassB);
36 std::unique_ptr<ClassB> b2(new ClassB); 36 std::unique_ptr<ClassB> b2(new ClassB);
37 37
38 EXPECT_EQ(-1, LeakTracker<ClassA>::NumLiveInstances()); 38 EXPECT_EQ(-1, LeakTracker<ClassA>::NumLiveInstances());
39 EXPECT_EQ(-1, LeakTracker<ClassB>::NumLiveInstances()); 39 EXPECT_EQ(-1, LeakTracker<ClassB>::NumLiveInstances());
40 } 40 }
41 41
42 #else 42 #else
43 43
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // There are no live instances of ClassA, so this should do nothing. 106 // There are no live instances of ClassA, so this should do nothing.
107 LeakTracker<ClassA>::CheckForLeaks(); 107 LeakTracker<ClassA>::CheckForLeaks();
108 } 108 }
109 109
110 #endif // ENABLE_LEAK_TRACKER 110 #endif // ENABLE_LEAK_TRACKER
111 111
112 } // namespace 112 } // namespace
113 113
114 } // namespace debug 114 } // namespace debug
115 } // namespace base 115 } // namespace base
OLDNEW
« no previous file with comments | « base/bind_helpers.h ('k') | base/mac/scoped_authorizationref.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698