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

Unified Diff: base/debug/leak_tracker_unittest.cc

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/debug/debugger_posix.cc ('k') | base/debug/stack_trace_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/leak_tracker_unittest.cc
diff --git a/base/debug/leak_tracker_unittest.cc b/base/debug/leak_tracker_unittest.cc
index 99df4c17e1d9c7174728cddc74ce9ec4888dfc42..8b4c5681e0dc24c01d221324cfa1e1a5a6d8da51 100644
--- a/base/debug/leak_tracker_unittest.cc
+++ b/base/debug/leak_tracker_unittest.cc
@@ -3,7 +3,9 @@
// found in the LICENSE file.
#include "base/debug/leak_tracker.h"
-#include "base/memory/scoped_ptr.h"
+
+#include <memory>
+
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
@@ -29,9 +31,9 @@ TEST(LeakTrackerTest, NotEnabled) {
EXPECT_EQ(-1, LeakTracker<ClassB>::NumLiveInstances());
// Use scoped_ptr so compiler doesn't complain about unused variables.
- scoped_ptr<ClassA> a1(new ClassA);
- scoped_ptr<ClassB> b1(new ClassB);
- scoped_ptr<ClassB> b2(new ClassB);
+ std::unique_ptr<ClassA> a1(new ClassA);
+ std::unique_ptr<ClassB> b1(new ClassB);
+ std::unique_ptr<ClassB> b2(new ClassB);
EXPECT_EQ(-1, LeakTracker<ClassA>::NumLiveInstances());
EXPECT_EQ(-1, LeakTracker<ClassB>::NumLiveInstances());
@@ -52,7 +54,7 @@ TEST(LeakTrackerTest, Basic) {
EXPECT_EQ(1, LeakTracker<ClassA>::NumLiveInstances());
EXPECT_EQ(2, LeakTracker<ClassB>::NumLiveInstances());
- scoped_ptr<ClassA> a2(new ClassA);
+ std::unique_ptr<ClassA> a2(new ClassA);
EXPECT_EQ(2, LeakTracker<ClassA>::NumLiveInstances());
EXPECT_EQ(2, LeakTracker<ClassB>::NumLiveInstances());
@@ -72,10 +74,10 @@ TEST(LeakTrackerTest, Basic) {
TEST(LeakTrackerTest, LinkedList) {
EXPECT_EQ(0, LeakTracker<ClassB>::NumLiveInstances());
- scoped_ptr<ClassA> a1(new ClassA);
- scoped_ptr<ClassA> a2(new ClassA);
- scoped_ptr<ClassA> a3(new ClassA);
- scoped_ptr<ClassA> a4(new ClassA);
+ std::unique_ptr<ClassA> a1(new ClassA);
+ std::unique_ptr<ClassA> a2(new ClassA);
+ std::unique_ptr<ClassA> a3(new ClassA);
+ std::unique_ptr<ClassA> a4(new ClassA);
EXPECT_EQ(4, LeakTracker<ClassA>::NumLiveInstances());
@@ -88,7 +90,7 @@ TEST(LeakTrackerTest, LinkedList) {
EXPECT_EQ(2, LeakTracker<ClassA>::NumLiveInstances());
// Append to the new tail of the list (a3).
- scoped_ptr<ClassA> a5(new ClassA);
+ std::unique_ptr<ClassA> a5(new ClassA);
EXPECT_EQ(3, LeakTracker<ClassA>::NumLiveInstances());
a2.reset();
« no previous file with comments | « base/debug/debugger_posix.cc ('k') | base/debug/stack_trace_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698