MCPcopy Create free account
hub / github.com/GNOME/gjs / assert_coverage_data_for_source_file

Function assert_coverage_data_for_source_file

test/gjs-test-coverage.cpp:997–1020  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

995};
996
997static void assert_coverage_data_for_source_file(
998 const std::vector<ExpectedSourceFileCoverageData>& expected_data,
999 const char* section_start) {
1000 for (const auto& expected : expected_data) {
1001 if (strncmp(&section_start[3], expected.source_file_path,
1002 strlen(expected.source_file_path)) == 0) {
1003 assert_coverage_data_matches_values_for_key(
1004 section_start, "DA:", line_hit_count_is_more_than,
1005 expected.more_than);
1006 const char* total_hits_record =
1007 line_starting_with(section_start, "LH:");
1008 g_assert_cmpint(total_hits_record[3], ==,
1009 expected.expected_lines_hit_character);
1010 const char* total_found_record =
1011 line_starting_with(section_start, "LF:");
1012 g_assert_cmpint(total_found_record[3], ==,
1013 expected.expected_lines_found_character);
1014
1015 return;
1016 }
1017 }
1018
1019 g_assert_true(false && "Expected source file path to be found in section");
1020}
1021
1022static void
1023test_correct_line_coverage_data_written_for_both_source_file_sections(

Tested by

no test coverage detected