Fix compiler warnings

Fix base classes without virtual destructors and missing initialisors.
This commit is contained in:
Wichert Akkerman 2011-09-23 10:03:52 +02:00
parent 98a21bce5d
commit 6d18d4b189
5 changed files with 26 additions and 4 deletions

View File

@ -559,7 +559,8 @@ public:
const char* expr = "", const char* expr = "",
bool isNot = false bool isNot = false
) )
: m_result( expr, isNot, filename, line, macroName ) : m_result( expr, isNot, filename, line, macroName ),
m_messageStream()
{} {}
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
@ -659,7 +660,7 @@ class ScopedInfo
public: public:
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
ScopedInfo ScopedInfo
() () : m_oss()
{ {
Hub::getResultCapture().pushScopedInfo( this ); Hub::getResultCapture().pushScopedInfo( this );
} }

View File

@ -38,6 +38,7 @@ namespace Catch
void operator = ( const NonCopyable& ); void operator = ( const NonCopyable& );
protected: protected:
NonCopyable(){} NonCopyable(){}
virtual ~NonCopyable() {}
}; };
typedef char NoType; typedef char NoType;

View File

@ -24,7 +24,14 @@ namespace Catch
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
ResultInfo ResultInfo
() ()
: m_line( 0 ), : m_macroName(),
m_filename(),
m_line( 0 ),
m_expr(),
m_lhs(),
m_rhs(),
m_op(),
m_message(),
m_result( ResultWas::Unknown ), m_result( ResultWas::Unknown ),
m_isNot( false ) m_isNot( false )
{} {}
@ -44,6 +51,8 @@ namespace Catch
m_filename( filename ), m_filename( filename ),
m_line( line ), m_line( line ),
m_expr( expr ), m_expr( expr ),
m_lhs(),
m_rhs(),
m_op( isNotExpression( expr ) ? "!" : "" ), m_op( isNotExpression( expr ) ? "!" : "" ),
m_message( message ), m_message( message ),
m_result( result ), m_result( result ),
@ -53,6 +62,11 @@ namespace Catch
m_expr = "!" + m_expr; m_expr = "!" + m_expr;
} }
///////////////////////////////////////////////////////////////////////////
virtual ~ResultInfo
()
{
}
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
bool ok bool ok
() ()

View File

@ -31,6 +31,8 @@ namespace Catch
std::size_t line std::size_t line
) )
: m_name( name ), : m_name( name ),
m_successes(0),
m_failures(0),
m_sectionIncluded( Hub::getResultCapture().sectionStarted( name, description, filename, line, m_successes, m_failures ) ) m_sectionIncluded( Hub::getResultCapture().sectionStarted( name, description, filename, line, m_successes, m_failures ) )
{ {
} }

View File

@ -42,7 +42,11 @@ namespace Catch
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
TestCaseInfo TestCaseInfo
() ()
: m_test( NULL ) : m_test( NULL ),
m_name(),
m_description(),
m_filename(),
m_line( 0 )
{ {
} }