MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / ToXmlV2Encoding

Method ToXmlV2Encoding

test/testerrorlogger.cpp:463–477  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461 }
462
463 void ToXmlV2Encoding() const {
464 {
465 ErrorMessage msg({}, "", Severity::error, "Programming error.\nComparing \"\203\" with \"\003\"", "errorId", Certainty::normal);
466 const std::string expected(" <error id=\"errorId\" severity=\"error\" msg=\"Programming error.\" verbose=\"Comparing &quot;\\203&quot; with &quot;\\003&quot;\"/>");
467 ASSERT_EQUALS(expected, msg.toXML());
468 }
469 {
470 const char code1[]="äöü";
471 const char code2[]="\x12\x00\x00\x01";
472 ErrorMessage msg1({}, "", Severity::error, std::string("Programming error.\nReading \"")+code1+"\"", "errorId", Certainty::normal);
473 ASSERT_EQUALS(" <error id=\"errorId\" severity=\"error\" msg=\"Programming error.\" verbose=\"Reading &quot;\\303\\244\\303\\266\\303\\274&quot;\"/>", msg1.toXML());
474 ErrorMessage msg2({}, "", Severity::error, std::string("Programming error.\nReading \"")+code2+"\"", "errorId", Certainty::normal);
475 ASSERT_EQUALS(" <error id=\"errorId\" severity=\"error\" msg=\"Programming error.\" verbose=\"Reading &quot;\\022&quot;\"/>", msg2.toXML());
476 }
477 }
478
479 void FromXmlV2() const {
480 const char xmldata[] = "<?xml version=\"1.0\"?>\n"

Callers

nothing calls this directly

Calls 1

toXMLMethod · 0.80

Tested by

no test coverage detected