@@ -54,6 +54,7 @@ class TestErrorLogger : public TestFixture {
54
54
TEST_CASE (ToXmlV2Locations);
55
55
TEST_CASE (ToXmlV2Encoding);
56
56
TEST_CASE (FromXmlV2);
57
+ TEST_CASE (ToXmlV3);
57
58
58
59
// Inconclusive results in xml reports..
59
60
TEST_CASE (InconclusiveXml);
@@ -232,7 +233,7 @@ class TestErrorLogger : public TestFixture {
232
233
header += CppCheck::version ();
233
234
header += " \" />\n <errors>" ;
234
235
ASSERT_EQUALS (header, ErrorMessage::getXMLHeader (" " ));
235
- ASSERT_EQUALS (" </errors>\n </results>" , ErrorMessage::getXMLFooter ());
236
+ ASSERT_EQUALS (" </errors>\n </results>" , ErrorMessage::getXMLFooter (2 ));
236
237
std::string message (" <error id=\" errorId\" severity=\" error\" " );
237
238
message += " msg=\" Programming error.\" verbose=\" Verbose error\" >\n " ;
238
239
message += " <location file=\" foo.cpp\" line=\" 5\" column=\" 1\" />\n </error>" ;
@@ -253,7 +254,7 @@ class TestErrorLogger : public TestFixture {
253
254
header += CppCheck::version ();
254
255
header += " \" />\n <errors>" ;
255
256
ASSERT_EQUALS (header, ErrorMessage::getXMLHeader (" " ));
256
- ASSERT_EQUALS (" </errors>\n </results>" , ErrorMessage::getXMLFooter ());
257
+ ASSERT_EQUALS (" </errors>\n </results>" , ErrorMessage::getXMLFooter (2 ));
257
258
std::string message (" <error id=\" errorId\" severity=\" error\" " );
258
259
message += " msg=\" Programming error.\" verbose=\" Verbose error\" >\n " ;
259
260
message += " <location file=\" bar.cpp\" line=\" 8\" column=\" 1\" info=\"\\ 303\\ 244\" />\n " ;
@@ -312,6 +313,10 @@ class TestErrorLogger : public TestFixture {
312
313
ASSERT_EQUALS (1u , msg.callStack .back ().column );
313
314
}
314
315
316
+ void ToXmlV3 () const {
317
+ ASSERT_EQUALS (" </results>" , ErrorMessage::getXMLFooter (3 ));
318
+ }
319
+
315
320
void InconclusiveXml () const {
316
321
// Location
317
322
std::list<ErrorMessage::FileLocation> locs (1 , fooCpp5);
0 commit comments