Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions tcmalloc/internal/profile_builder_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -574,16 +574,17 @@ TEST(ProfileConverterTest, HeapProfile) {
// Require that the default_sample_type appeared in sample_type.
EXPECT_THAT(sample_types, testing::Contains(converted.default_sample_type()));

constexpr int kNumSamples = 6;
constexpr int kNumSampleTypes = 9;
// This is slightly redundant with the next line, but we need to loop over
// each of the samples later.
EXPECT_THAT(extracted_sample_type, SizeIs(kNumSamples));
EXPECT_THAT(extracted_sample_type, SizeIs(kNumSampleTypes));
EXPECT_THAT(
extracted_sample_type,
UnorderedElementsAre(
Pair("objects", "count"), Pair("space", "bytes"),
Pair("resident_space", "bytes"), Pair("stale_space", "bytes"),
Pair("locked_space", "bytes"), Pair("swapped_space", "bytes")));
Pair("locked_space", "bytes"), Pair("swapped_space", "bytes"),
Pair("zero_space", "bytes"), Pair("trailing_zero_space", "bytes")));

SampleLabels extracted_labels;
{
Expand Down Expand Up @@ -708,6 +709,7 @@ TEST(ProfileConverterTest, HeapProfile) {
Pair("objects", 2),
})));

constexpr int kNumSamples = 6;
ASSERT_EQ(converted.sample().size(), kNumSamples);
// The addresses for the samples at stack[0], stack[1] should match.
for (int i = 0; i < kNumSamples; ++i) {
Expand Down
Loading