Unneeded newline printed to std::cout creates invalid XML
Brought to you by:
blep
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.