Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9dbdc7b

Browse files
authored
Revert "Encode newlines for -ojunit as their XML equivalent instead of {newline}"
1 parent a1d7bf2 commit 9dbdc7b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/CppUTest/JUnitTestOutput.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ SimpleString JUnitTestOutput::encodeXmlText(const SimpleString& textbody)
209209
buf.replace("\"", """);
210210
buf.replace("<", "&lt;");
211211
buf.replace(">", "&gt;");
212-
buf.replace("\r", "&#13;");
213-
buf.replace("\n", "&#10;");
212+
buf.replace("\n", "{newline}");
214213
return buf;
215214
}
216215

tests/CppUTest/JUnitOutputTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ TEST(JUnitOutputTest, testFailureWithNewlineInIt)
544544

545545
outputFile = fileSystem.file("cpputest_testGroupWithFailingTest.xml");
546546

547-
STRCMP_EQUAL("<failure message=\"thisfile:10: Test &#10; failed\" type=\"AssertionFailedError\">\n", outputFile->line(6));
547+
STRCMP_EQUAL("<failure message=\"thisfile:10: Test {newline}failed\" type=\"AssertionFailedError\">\n", outputFile->line(6));
548548
}
549549

550550
TEST(JUnitOutputTest, testFailureWithDifferentFileAndLine)
@@ -755,5 +755,5 @@ TEST(JUnitOutputTest, UTPRINTOutputInJUnitOutputWithSpecials)
755755
.end();
756756

757757
outputFile = fileSystem.file("cpputest_groupname.xml");
758-
STRCMP_EQUAL("<system-out>The &lt;rain&gt; in &quot;Spain&quot;&#10; Goes \\mainly\\ down the Dr&amp;in&#10; </system-out>\n", outputFile->lineFromTheBack(3));
758+
STRCMP_EQUAL("<system-out>The &lt;rain&gt; in &quot;Spain&quot;{newline}Goes \\mainly\\ down the Dr&amp;in{newline}</system-out>\n", outputFile->lineFromTheBack(3));
759759
}

0 commit comments

Comments
 (0)