Some tidy up

This commit is contained in:
Phil Nash 2010-12-10 20:06:54 +00:00
parent 68eec929e4
commit de77ff3b29
4 changed files with 14 additions and 13 deletions

View File

@ -61,7 +61,6 @@ namespace Catch
m_config.stream() << "[Testing completed. ";
ReportCounts( succeeded, failed );
m_config.stream() << "]" << std::endl;
(succeeded, failed);
}
///////////////////////////////////////////////////////////////////////////
@ -156,10 +155,10 @@ namespace Catch
virtual void EndTestCase( const TestCaseInfo& testInfo, const std::string& stdOut, const std::string& stdErr )
{
if( !stdOut.empty() )
m_config.stream() << "[stdout: " << stdOut << "]\n";
m_config.stream() << "[stdout: " << trim( stdOut ) << "]\n";
if( !stdErr.empty() )
m_config.stream() << "[stderr: " << stdErr << "]\n";
m_config.stream() << "[stderr: " << trim( stdErr ) << "]\n";
m_config.stream() << "[Finished: " << testInfo.getName() << "]" << std::endl;
}

View File

@ -168,14 +168,6 @@ namespace Catch
m_stdErr << stdErr << "\n";
}
static std::string trim( const std::string& str )
{
std::string::size_type start = str.find_first_not_of( "\n\r\t " );
std::string::size_type end = str.find_last_not_of( "\n\r\t " );
return start < end ? str.substr( start, 1+end-start ) : "";
}
///////////////////////////////////////////////////////////////////////////
virtual void EndTesting( std::size_t /* succeeded */, std::size_t /* failed */ )
{

View File

@ -22,6 +22,16 @@
namespace Catch
{
///////////////////////////////////////////////////////////////////////////
static std::string trim( const std::string& str )
{
std::string::size_type start = str.find_first_not_of( "\n\r\t " );
std::string::size_type end = str.find_last_not_of( "\n\r\t " );
return start < end ? str.substr( start, 1+end-start ) : "";
}
class ReporterConfig
{
private: