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

Unified Diff: third_party/tcmalloc/chromium/src/tests/malloc_extension_test.cc

Issue 576001: Merged third_party/tcmalloc/vendor/src(google-perftools r87) into... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Removed the unnecessary printf and ASSERT(0) Created 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/tcmalloc/chromium/src/tests/malloc_extension_test.cc
===================================================================
--- third_party/tcmalloc/chromium/src/tests/malloc_extension_test.cc (revision 41942)
+++ third_party/tcmalloc/chromium/src/tests/malloc_extension_test.cc (working copy)
@@ -43,32 +43,32 @@
void* a = malloc(1000);
size_t cxx_bytes_used, c_bytes_used;
- CHECK(MallocExtension::instance()->GetNumericProperty(
- "generic.current_allocated_bytes", &cxx_bytes_used));
- CHECK(MallocExtension_GetNumericProperty(
- "generic.current_allocated_bytes", &c_bytes_used));
- CHECK_GT(cxx_bytes_used, 1000);
- CHECK_EQ(cxx_bytes_used, c_bytes_used);
+ ASSERT_TRUE(MallocExtension::instance()->GetNumericProperty(
+ "generic.current_allocated_bytes", &cxx_bytes_used));
+ ASSERT_TRUE(MallocExtension_GetNumericProperty(
+ "generic.current_allocated_bytes", &c_bytes_used));
+ ASSERT_GT(cxx_bytes_used, 1000);
+ ASSERT_EQ(cxx_bytes_used, c_bytes_used);
- CHECK(MallocExtension::instance()->VerifyAllMemory());
- CHECK(MallocExtension_VerifyAllMemory());
+ ASSERT_TRUE(MallocExtension::instance()->VerifyAllMemory());
+ ASSERT_TRUE(MallocExtension_VerifyAllMemory());
- CHECK_GE(MallocExtension::instance()->GetAllocatedSize(a), 1000);
+ ASSERT_GE(MallocExtension::instance()->GetAllocatedSize(a), 1000);
// This is just a sanity check. If we allocated too much, tcmalloc is broken
- CHECK_LE(MallocExtension::instance()->GetAllocatedSize(a), 5000);
- CHECK_GE(MallocExtension::instance()->GetEstimatedAllocatedSize(1000), 1000);
+ ASSERT_LE(MallocExtension::instance()->GetAllocatedSize(a), 5000);
+ ASSERT_GE(MallocExtension::instance()->GetEstimatedAllocatedSize(1000), 1000);
for (int i = 0; i < 10; ++i) {
void *p = malloc(i);
- CHECK_GE(MallocExtension::instance()->GetAllocatedSize(p),
+ ASSERT_GE(MallocExtension::instance()->GetAllocatedSize(p),
MallocExtension::instance()->GetEstimatedAllocatedSize(i));
free(p);
}
// Check the c-shim version too.
- CHECK_GE(MallocExtension_GetAllocatedSize(a), 1000);
- CHECK_LE(MallocExtension_GetAllocatedSize(a), 5000);
- CHECK_GE(MallocExtension_GetEstimatedAllocatedSize(1000), 1000);
+ ASSERT_GE(MallocExtension_GetAllocatedSize(a), 1000);
+ ASSERT_LE(MallocExtension_GetAllocatedSize(a), 5000);
+ ASSERT_GE(MallocExtension_GetEstimatedAllocatedSize(1000), 1000);
free(a);

Powered by Google App Engine
This is Rietveld 408576698