don't try to drop XML into the XML output :)

This commit is contained in:
Jez Higgins 2010-01-12 22:53:23 +00:00
parent 6734035e62
commit ea8bcdbacd

View file

@ -38,10 +38,17 @@ void printException(std::ostream& stream,
const std::string& tag,
CppUnitException *e)
{
stream << "<" << tag << " message='" << e->what() << "'>"
std::string msg = e->what();
size_t cut = msg.find_first_of("<>'");
if(cut != -1)
{
msg.erase(cut);
msg += "...";
} // if ...
stream << "<" << tag << " message='" << msg << "'><![CDATA["
<< "line: " << e->lineNumber() << " "
<< e->fileName() << " "
<< "'" << e->what() << "'</" << tag << ">";
<< "'" << e->what() << "']]></" << tag << ">";
} // exception
void XmlTestResult::print(std::ostream& stream)