mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-23 03:43:28 +01:00
Write single characters directly instead of as C-strings in Sonarqube
This commit is contained in:
parent
02839ba934
commit
a01073d871
@ -113,26 +113,26 @@ namespace Catch {
|
|||||||
XmlWriter::ScopedElement e = xml.scopedElement(elementName);
|
XmlWriter::ScopedElement e = xml.scopedElement(elementName);
|
||||||
|
|
||||||
ReusableStringStream messageRss;
|
ReusableStringStream messageRss;
|
||||||
messageRss << result.getTestMacroName() << "(" << result.getExpression() << ")";
|
messageRss << result.getTestMacroName() << '(' << result.getExpression() << ')';
|
||||||
xml.writeAttribute("message"_sr, messageRss.str());
|
xml.writeAttribute("message"_sr, messageRss.str());
|
||||||
|
|
||||||
ReusableStringStream textRss;
|
ReusableStringStream textRss;
|
||||||
if (stats.totals.assertions.total() > 0) {
|
if (stats.totals.assertions.total() > 0) {
|
||||||
textRss << "FAILED:\n";
|
textRss << "FAILED:\n";
|
||||||
if (result.hasExpression()) {
|
if (result.hasExpression()) {
|
||||||
textRss << "\t" << result.getExpressionInMacro() << "\n";
|
textRss << '\t' << result.getExpressionInMacro() << '\n';
|
||||||
}
|
}
|
||||||
if (result.hasExpandedExpression()) {
|
if (result.hasExpandedExpression()) {
|
||||||
textRss << "with expansion:\n\t" << result.getExpandedExpression() << "\n";
|
textRss << "with expansion:\n\t" << result.getExpandedExpression() << '\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!result.getMessage().empty())
|
if (!result.getMessage().empty())
|
||||||
textRss << result.getMessage() << "\n";
|
textRss << result.getMessage() << '\n';
|
||||||
|
|
||||||
for (auto const& msg : stats.infoMessages)
|
for (auto const& msg : stats.infoMessages)
|
||||||
if (msg.type == ResultWas::Info)
|
if (msg.type == ResultWas::Info)
|
||||||
textRss << msg.message << "\n";
|
textRss << msg.message << '\n';
|
||||||
|
|
||||||
textRss << "at " << result.getSourceInfo();
|
textRss << "at " << result.getSourceInfo();
|
||||||
xml.writeText(textRss.str(), XmlFormatting::Newline);
|
xml.writeText(textRss.str(), XmlFormatting::Newline);
|
||||||
|
Loading…
Reference in New Issue
Block a user