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

Unified Diff: base/trace_event/heap_profiler_stack_frame_deduplicator_unittest.cc

Issue 2977783002: [tracing] Optimize StackFrameDeduplicator. (Closed)
Patch Set: Don't use ASSERT_EQ on deque iterators (see goo.gl/9gkBf7) Created 3 years, 5 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: base/trace_event/heap_profiler_stack_frame_deduplicator_unittest.cc
diff --git a/base/trace_event/heap_profiler_stack_frame_deduplicator_unittest.cc b/base/trace_event/heap_profiler_stack_frame_deduplicator_unittest.cc
index 291f99ba7aa5039696128a5202b3a5e25997dd71..c5b94ad952f2394632d2257d4dcff1326a55e769 100644
--- a/base/trace_event/heap_profiler_stack_frame_deduplicator_unittest.cc
+++ b/base/trace_event/heap_profiler_stack_frame_deduplicator_unittest.cc
@@ -106,7 +106,7 @@ TEST(StackFrameDeduplicatorTest, ImplicitId0) {
StackFrameDeduplicator dedup(&string_dedup);
// Node #0 is added implicitly and corresponds to an empty backtrace.
- ASSERT_EQ(dedup.begin() + 1, dedup.end());
+ ASSERT_TRUE(dedup.begin() + 1 == dedup.end());
ASSERT_EQ(0, dedup.Insert(std::begin(null_bt), std::begin(null_bt)));
// Placeholder entry for ID 0 is a frame with NULL name and no parent.
@@ -138,7 +138,7 @@ TEST(StackFrameDeduplicatorTest, SingleBacktrace) {
ASSERT_EQ(kMalloc, (iter + 2)->frame);
ASSERT_EQ(2, (iter + 2)->parent_frame_index);
- ASSERT_EQ(iter + 3, dedup.end());
+ ASSERT_TRUE(iter + 3 == dedup.end());
}
TEST(StackFrameDeduplicatorTest, SingleBacktraceWithNull) {
@@ -168,7 +168,7 @@ TEST(StackFrameDeduplicatorTest, SingleBacktraceWithNull) {
ASSERT_EQ(kMalloc, (iter + 2)->frame);
ASSERT_EQ(2, (iter + 2)->parent_frame_index);
- ASSERT_EQ(iter + 3, dedup.end());
+ ASSERT_TRUE(iter + 3 == dedup.end());
}
// Test that there can be different call trees (there can be multiple bottom
@@ -206,7 +206,7 @@ TEST(StackFrameDeduplicatorTest, MultipleRoots) {
ASSERT_EQ(kCreateWidget, (iter + 3)->frame);
ASSERT_EQ(3, (iter + 3)->parent_frame_index);
- ASSERT_EQ(iter + 4, dedup.end());
+ ASSERT_TRUE(iter + 4 == dedup.end());
}
TEST(StackFrameDeduplicatorTest, Deduplication) {
@@ -236,7 +236,7 @@ TEST(StackFrameDeduplicatorTest, Deduplication) {
ASSERT_EQ(kInitialize, (iter + 2)->frame);
ASSERT_EQ(1, (iter + 2)->parent_frame_index);
- ASSERT_EQ(iter + 3, dedup.end());
+ ASSERT_TRUE(iter + 3 == dedup.end());
// Inserting the same backtrace again should return the index of the existing
// node.
« no previous file with comments | « base/trace_event/heap_profiler_stack_frame_deduplicator.cc ('k') | base/trace_event/memory_usage_estimator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698