Skip to content

Commit

Permalink
Fix broken unit test to match new behavior (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewkotila authored Sep 7, 2023
1 parent 8ecca20 commit e56524d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/c++/perf_analyzer/test_report_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ TEST_CASE("testing WriteGpuMetrics")
SUBCASE("single gpu complete output")
{
trw.WriteGpuMetrics(actual_output, m);
const std::string expected_output{"a:1;,a:2.2;,a:3;,a:4;,"};
const std::string expected_output{",a:1;,a:2.2;,a:3;,a:4;"};
CHECK(actual_output.str() == expected_output);
}

SUBCASE("single gpu missing data")
{
m.gpu_power_usage_per_gpu.erase("a");
trw.WriteGpuMetrics(actual_output, m);
const std::string expected_output{"a:1;,,a:3;,a:4;,"};
const std::string expected_output{",a:1;,,a:3;,a:4;"};
CHECK(actual_output.str() == expected_output);
}

Expand All @@ -75,7 +75,7 @@ TEST_CASE("testing WriteGpuMetrics")
{
trw.WriteGpuMetrics(actual_output, m);
const std::string expected_output{
"a:1;z:100;,a:2.2;z:222.2;,a:3;z:45;,a:4;z:89;,"};
",a:1;z:100;,a:2.2;z:222.2;,a:3;z:45;,a:4;z:89;"};
CHECK(actual_output.str() == expected_output);
}

Expand All @@ -84,7 +84,7 @@ TEST_CASE("testing WriteGpuMetrics")
m.gpu_utilization_per_gpu.erase("z");
m.gpu_power_usage_per_gpu.erase("a");
trw.WriteGpuMetrics(actual_output, m);
const std::string expected_output{"a:1;,z:222.2;,a:3;z:45;,a:4;z:89;,"};
const std::string expected_output{",a:1;,z:222.2;,a:3;z:45;,a:4;z:89;"};
CHECK(actual_output.str() == expected_output);
}
}
Expand Down

0 comments on commit e56524d

Please sign in to comment.