@@ -81,11 +81,10 @@ struct PerfSpeEventsTestHelper : public testing::Test {
8181 std::unique_ptr<ObjectFile> ObjFile;
8282 std::unique_ptr<BinaryContext> BC;
8383
84- // Helper function to export lists to show the mismatch
85- void exportBrStackEventMismatch (
84+ // / Helper function to export lists to show the mismatch.
85+ void reportBrStackEventMismatch (
8686 const std::unordered_map<Trace, TakenBranchInfo, TraceHash> &BranchLBRs,
8787 const std::vector<MockBranchInfo> &ExpectedSamples) {
88- // Simple export where they differ
8988 llvm::errs () << " BranchLBRs items: \n " ;
9089 for (const auto &AggrLBR : BranchLBRs)
9190 llvm::errs () << " {" << AggrLBR.first .From << " , " << AggrLBR.first .To
@@ -98,7 +97,7 @@ struct PerfSpeEventsTestHelper : public testing::Test {
9897 << " , " << BI.MispredCount << " }" << " \n " ;
9998 }
10099
101- // Parse and check SPE brstack as LBR.
100+ // / Parse and check SPE brstack as LBR.
102101 void parseAndCheckBrstackEvents (
103102 uint64_t PID, const std::vector<MockBranchInfo> &ExpectedSamples) {
104103 DataAggregator DA (" <pseudo input>" );
@@ -111,11 +110,10 @@ struct PerfSpeEventsTestHelper : public testing::Test {
111110
112111 EXPECT_EQ (DA.BranchLBRs .size (), ExpectedSamples.size ());
113112 if (DA.BranchLBRs .size () != ExpectedSamples.size ())
114- exportBrStackEventMismatch (DA.BranchLBRs , ExpectedSamples);
113+ reportBrStackEventMismatch (DA.BranchLBRs , ExpectedSamples);
115114
116115 for (const MockBranchInfo &BI : ExpectedSamples) {
117- // / Check whether the key exists, throws 'std::out_of_range'
118- // / if the container does not have an element with the specified key.
116+ // Check that each key exists and that it matches.
119117 EXPECT_NO_THROW (DA.BranchLBRs .at (Trace (BI.From , BI.To )));
120118
121119 EXPECT_EQ (DA.BranchLBRs .at (Trace (BI.From , BI.To )).MispredCount ,
0 commit comments