Skip to content

Commit 651fa22

Browse files
committed
Fix warnings in junit_xml
1 parent c7dcf0c commit 651fa22

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

include/formatters/junit_xml.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ struct TestSuites {
130130
ss << std::format(R"(<testsuites name="{}" tests="{}" failures="{}" time="{:f}" timestamp="{}">)", name, tests,
131131
failures, time.count(), timestamp_str);
132132
ss << std::endl;
133-
for (const auto& suite : suites) {
133+
for (const TestSuite& suite : suites) {
134134
ss << suite.to_xml() << std::endl;
135135
}
136136
ss << "</testsuites>" << std::endl;
@@ -148,10 +148,10 @@ class JUnitXML : public BaseFormatter {
148148

149149
~JUnitXML() {
150150
test_suites.tests =
151-
std::accumulate(test_suites.suites.begin(), test_suites.suites.end(), 0,
151+
std::accumulate(test_suites.suites.begin(), test_suites.suites.end(), size_t{0},
152152
[](size_t sum, const JUnitNodes::TestSuite& suite) { return sum + suite.tests; });
153153
test_suites.failures =
154-
std::accumulate(test_suites.suites.begin(), test_suites.suites.end(), 0,
154+
std::accumulate(test_suites.suites.begin(), test_suites.suites.end(), size_t{0},
155155
[](size_t sum, const JUnitNodes::TestSuite& suite) { return sum + suite.failures; });
156156
test_suites.time = std::ranges::fold_left(test_suites.suites, std::chrono::duration<double>(0),
157157
[](const auto& acc, const auto& suite) { return acc + suite.time; });
@@ -181,7 +181,7 @@ class JUnitXML : public BaseFormatter {
181181
std::forward_list<std::string> descriptions;
182182

183183
descriptions.push_front(it.get_description());
184-
for (const auto* parent = it.get_parent_as<Description>(); parent->has_parent();
184+
for (const Description* parent = it.get_parent_as<Description>(); parent->has_parent();
185185
parent = parent->get_parent_as<Description>()) {
186186
descriptions.push_front(parent->get_description());
187187
}
@@ -198,7 +198,7 @@ class JUnitXML : public BaseFormatter {
198198
.line = it.get_location().line(),
199199
};
200200

201-
for (const auto& result : it.get_results()) {
201+
for (const Result& result : it.get_results()) {
202202
if (result.is_success()) {
203203
continue;
204204
}

0 commit comments

Comments
 (0)