Allow tests including catch to compile with g++ flags -Wall and -Werror.

This commit is contained in:
Michael Mortensen 2010-12-28 15:42:46 +01:00
parent 4aa36f6071
commit 9dfb8157a0
4 changed files with 17 additions and 6 deletions

View File

@ -142,6 +142,8 @@ namespace Catch
case ResultWas::ExplicitFailure: case ResultWas::ExplicitFailure:
m_config.stream() << "failed with message: '" << resultInfo.getMessage() << "'"; m_config.stream() << "failed with message: '" << resultInfo.getMessage() << "'";
break; break;
default:
break;
} }
if( resultInfo.hasExpression() ) if( resultInfo.hasExpression() )

View File

@ -101,8 +101,13 @@ namespace Catch
m_currentStats = &m_testSuiteStats; m_currentStats = &m_testSuiteStats;
} }
virtual void StartSection( const std::string& sectionName, const std::string description ){(sectionName,description);} virtual void StartSection( const std::string& sectionName, const std::string description )
virtual void EndSection( const std::string& sectionName, std::size_t succeeded, std::size_t failed ){(sectionName, succeeded, failed);} {
}
virtual void EndSection( const std::string& sectionName, std::size_t succeeded, std::size_t failed )
{
}
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
virtual void StartTestCase( const Catch::TestCaseInfo& testInfo ) virtual void StartTestCase( const Catch::TestCaseInfo& testInfo )

View File

@ -130,6 +130,8 @@ namespace Catch
.writeText( resultInfo.getMessage() ); .writeText( resultInfo.getMessage() );
m_currentTestSuccess = false; m_currentTestSuccess = false;
break; break;
default:
break;
} }
if( resultInfo.hasExpression() ) if( resultInfo.hasExpression() )
m_xml.endElement(); m_xml.endElement();

View File

@ -157,6 +157,8 @@ namespace Catch
return setErrorMode( m_command + " does not accept arguments" ); return setErrorMode( m_command + " does not accept arguments" );
m_config.setShouldDebugBreak( true ); m_config.setShouldDebugBreak( true );
break; break;
default:
break;
} }
m_args.clear(); m_args.clear();
m_mode = mode; m_mode = mode;