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

Unified Diff: base/leak_tracker_unittest.cc

Issue 196130: Make LeakTracker be enabled using ENABLE_LEAK_TRACKER, rather than NDEBUG.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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/leak_tracker.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/leak_tracker_unittest.cc
===================================================================
--- base/leak_tracker_unittest.cc (revision 26247)
+++ base/leak_tracker_unittest.cc (working copy)
@@ -18,10 +18,10 @@
base::LeakTracker<ClassB> leak_tracker_;
};
-#ifdef NDEBUG
+#ifndef ENABLE_LEAK_TRACKER
-// In RELEASE mode, leak tracking is disabled.
-TEST(LeakTrackerTest, ReleaseMode) {
+// If leak tracking is disabled, we should do nothing.
+TEST(LeakTrackerTest, NotEnabled) {
EXPECT_EQ(-1, base::LeakTracker<ClassA>::NumLiveInstances());
EXPECT_EQ(-1, base::LeakTracker<ClassB>::NumLiveInstances());
@@ -36,8 +36,7 @@
#else
-// In DEBUG mode, leak tracking should work.
-TEST(LeakTrackerTest, DebugMode) {
+TEST(LeakTrackerTest, Basic) {
{
ClassA a1;
@@ -67,7 +66,7 @@
// Try some orderings of create/remove to hit different cases in the linked-list
// assembly.
-TEST(LeakTrackerTest, DebugMode_LinkedList) {
+TEST(LeakTrackerTest, LinkedList) {
EXPECT_EQ(0, base::LeakTracker<ClassB>::NumLiveInstances());
scoped_ptr<ClassA> a1(new ClassA);
@@ -98,11 +97,11 @@
EXPECT_EQ(0, base::LeakTracker<ClassA>::NumLiveInstances());
}
-TEST(LeakTrackerTest, DebugMode_NoOpCheckForLeaks) {
+TEST(LeakTrackerTest, NoOpCheckForLeaks) {
// There are no live instances of ClassA, so this should do nothing.
base::LeakTracker<ClassA>::CheckForLeaks();
}
-#endif // NDEBUG
+#endif // ENABLE_LEAK_TRACKER
} // namespace
« no previous file with comments | « base/leak_tracker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698