diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-16 21:14:08 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-16 21:14:08 +0000 |
commit | 5a236f79082386a5c9edb6da07d02b3fd1d3cd25 (patch) | |
tree | 0a00575ae0a0767868c7c6123209870a84f4424b /base/leak_tracker_unittest.cc | |
parent | 690a7dcc59e1867280f18b5f428e005e2f5c95a0 (diff) | |
download | chromium_src-5a236f79082386a5c9edb6da07d02b3fd1d3cd25.zip chromium_src-5a236f79082386a5c9edb6da07d02b3fd1d3cd25.tar.gz chromium_src-5a236f79082386a5c9edb6da07d02b3fd1d3cd25.tar.bz2 |
Make LeakTracker be enabled using ENABLE_LEAK_TRACKER, rather than NDEBUG.
This way it is easy to toggle it on in release builds.
Review URL: http://codereview.chromium.org/196130
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26389 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/leak_tracker_unittest.cc')
-rw-r--r-- | base/leak_tracker_unittest.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/base/leak_tracker_unittest.cc b/base/leak_tracker_unittest.cc index 8f0e2f2..0217b17 100644 --- a/base/leak_tracker_unittest.cc +++ b/base/leak_tracker_unittest.cc @@ -18,10 +18,10 @@ class ClassB { 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 @@ TEST(LeakTrackerTest, ReleaseMode) { #else -// In DEBUG mode, leak tracking should work. -TEST(LeakTrackerTest, DebugMode) { +TEST(LeakTrackerTest, Basic) { { ClassA a1; @@ -67,7 +66,7 @@ TEST(LeakTrackerTest, DebugMode) { // 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 @@ TEST(LeakTrackerTest, DebugMode_LinkedList) { 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 |