#138 Unneeded newline printed to std::cout creates invalid XML

1.10.2
open
nobody
5
2005-03-17
2005-03-17
Anonymous
No

If you create a TextTestRunner, and set its output to
an XMLOutputter, you would expect valid (read:
well-formed) XML to be created. However, if you log
the results from your CPPUnit test run to a file, the
file will not be valid XML. This is because in the
TextTestRunner::printResult method, the statement
"std::cout << std::endl;" is executed before the test
output is written, meaning a newline gets inserted
before the XML declaration, meaning you now have
invalid XML.

Removing the "std::cout << std::endl;" statement from
TextTestRunner.cpp's printResult() method will resolve
this issue, and no real functionality will be adversely
affected.

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks