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

Unified Diff: test/cctest/test-heap-profiler.cc

Issue 247001: Heap profiler: aggregate retainers count of equivalent clusters. (Closed)
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 | « src/heap-profiler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap-profiler.cc
diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc
index f8e5a6b755ff423a9202e31b5673e8cba64db2dd..1e9cb7355773ff2d9e32054807cf64a3e10658f3 100644
--- a/test/cctest/test-heap-profiler.cc
+++ b/test/cctest/test-heap-profiler.cc
@@ -322,7 +322,14 @@ TEST(RetainerProfile) {
}
RetainerProfilePrinter printer;
ret_profile.DebugPrintStats(&printer);
- CHECK_EQ("(global property);1,B;2,C;2", printer.GetRetainers("A"));
+ const char* retainers_of_a = printer.GetRetainers("A");
+ // The order of retainers is unspecified, so we check string length, and
+ // verify each retainer separately.
+ CHECK_EQ(static_cast<int>(strlen("(global property);1,B;2,C;2")),
+ static_cast<int>(strlen(retainers_of_a)));
+ CHECK(strstr(retainers_of_a, "(global property);1") != NULL);
+ CHECK(strstr(retainers_of_a, "B;2") != NULL);
+ CHECK(strstr(retainers_of_a, "C;2") != NULL);
CHECK_EQ("(global property);2", printer.GetRetainers("B"));
CHECK_EQ("(global property);1", printer.GetRetainers("C"));
}
« no previous file with comments | « src/heap-profiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698