Skip to content

Commit 8af3e61

Browse files
committed
testrunner
1 parent 963b38c commit 8af3e61

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/testerrorlogger.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class TestErrorLogger : public TestFixture {
5454
TEST_CASE(ToXmlV2Locations);
5555
TEST_CASE(ToXmlV2Encoding);
5656
TEST_CASE(FromXmlV2);
57+
TEST_CASE(ToXmlV3);
5758

5859
// Inconclusive results in xml reports..
5960
TEST_CASE(InconclusiveXml);
@@ -232,7 +233,7 @@ class TestErrorLogger : public TestFixture {
232233
header += CppCheck::version();
233234
header += "\"/>\n <errors>";
234235
ASSERT_EQUALS(header, ErrorMessage::getXMLHeader(""));
235-
ASSERT_EQUALS(" </errors>\n</results>", ErrorMessage::getXMLFooter());
236+
ASSERT_EQUALS(" </errors>\n</results>", ErrorMessage::getXMLFooter(2));
236237
std::string message(" <error id=\"errorId\" severity=\"error\"");
237238
message += " msg=\"Programming error.\" verbose=\"Verbose error\">\n";
238239
message += " <location file=\"foo.cpp\" line=\"5\" column=\"1\"/>\n </error>";
@@ -253,7 +254,7 @@ class TestErrorLogger : public TestFixture {
253254
header += CppCheck::version();
254255
header += "\"/>\n <errors>";
255256
ASSERT_EQUALS(header, ErrorMessage::getXMLHeader(""));
256-
ASSERT_EQUALS(" </errors>\n</results>", ErrorMessage::getXMLFooter());
257+
ASSERT_EQUALS(" </errors>\n</results>", ErrorMessage::getXMLFooter(2));
257258
std::string message(" <error id=\"errorId\" severity=\"error\"");
258259
message += " msg=\"Programming error.\" verbose=\"Verbose error\">\n";
259260
message += " <location file=\"bar.cpp\" line=\"8\" column=\"1\" info=\"\\303\\244\"/>\n";
@@ -312,6 +313,10 @@ class TestErrorLogger : public TestFixture {
312313
ASSERT_EQUALS(1u, msg.callStack.back().column);
313314
}
314315

316+
void ToXmlV3() const {
317+
ASSERT_EQUALS("</results>", ErrorMessage::getXMLFooter(3));
318+
}
319+
315320
void InconclusiveXml() const {
316321
// Location
317322
std::list<ErrorMessage::FileLocation> locs(1, fooCpp5);

0 commit comments

Comments
 (0)