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

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

Issue 1828333002: Eliminate zero count allocations from profile (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix signed/unsigned comparison 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 | « src/profiler/sampling-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 c8e918d1226d54d77be4f3852bcc770c12e6ae75..eeb722c7fb5e405544be8c363dc21fa3bb6c5827 100644
--- a/test/cctest/test-heap-profiler.cc
+++ b/test/cctest/test-heap-profiler.cc
@@ -2875,6 +2875,15 @@ static const v8::AllocationProfile::Node* FindAllocationProfileNode(
return node;
}
+static void CheckNoZeroCountNodes(v8::AllocationProfile::Node* node) {
+ for (auto alloc : node->allocations) {
+ CHECK_GT(alloc.count, 0u);
+ }
+ for (auto child : node->children) {
+ CheckNoZeroCountNodes(child);
+ }
+}
+
TEST(SamplingHeapProfiler) {
v8::HandleScope scope(v8::Isolate::GetCurrent());
LocalContext env;
@@ -3002,6 +3011,8 @@ TEST(SamplingHeapProfiler) {
heap_profiler->GetAllocationProfile());
CHECK(!profile.is_empty());
+ CheckNoZeroCountNodes(profile->GetRootNode());
+
heap_profiler->StopSamplingHeapProfiler();
}
}
« no previous file with comments | « src/profiler/sampling-heap-profiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698