diff options
| author | Phil Nash | 2011-09-29 18:42:32 +0100 |
|---|---|---|
| committer | Phil Nash | 2011-09-29 18:42:32 +0100 |
| commit | 4094e7fe3da4d1c7017ba00b8142b6a6ef774cec (patch) | |
| tree | 5a83178f56d5f2b76be4b1fae4c3110b2b057db0 /include | |
| parent | a713ce0264a3d87c582d0e9543ef35e816cf111d (diff) | |
| parent | 0afab69c7d25f00af2ea82ef8df7dfd2efe72f19 (diff) | |
| download | catch3-4094e7fe3da4d1c7017ba00b8142b6a6ef774cec.tar.gz | |
Merge branch 'master' of github.com:philsquared/Catch
Diffstat (limited to 'include')
| -rw-r--r-- | include/catch.hpp | 1 | ||||
| -rw-r--r-- | include/internal/catch_capture.hpp | 5 | ||||
| -rw-r--r-- | include/internal/catch_commandline.hpp | 1 | ||||
| -rw-r--r-- | include/internal/catch_common.h | 1 | ||||
| -rw-r--r-- | include/internal/catch_resultinfo.hpp | 16 | ||||
| -rw-r--r-- | include/internal/catch_section.hpp | 2 | ||||
| -rw-r--r-- | include/internal/catch_test_case_info.hpp | 6 | ||||
| -rw-r--r-- | include/reporters/catch_reporter_basic.hpp | 5 | ||||
| -rw-r--r-- | include/reporters/catch_reporter_junit.hpp | 4 | ||||
| -rw-r--r-- | include/reporters/catch_reporter_xml.hpp | 6 |
10 files changed, 43 insertions, 4 deletions
diff --git a/include/catch.hpp b/include/catch.hpp index 0b0bb62c..d314d3c2 100644 --- a/include/catch.hpp +++ b/include/catch.hpp @@ -28,6 +28,7 @@ #include "internal/catch_generators.hpp" #include "internal/catch_interfaces_exception.h" #include "internal/catch_approx.hpp" +#include "internal/catch_test_case_info.hpp" #ifdef __OBJC__ #include "internal/catch_objc.hpp" diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index d857fc66..738b8214 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -527,7 +527,8 @@ public: const char* expr = "", bool isNot = false ) - : m_result( expr, isNot, filename, line, macroName ) + : m_result( expr, isNot, filename, line, macroName ), + m_messageStream() {} /////////////////////////////////////////////////////////////////////////// @@ -627,7 +628,7 @@ class ScopedInfo public: /////////////////////////////////////////////////////////////////////////// ScopedInfo - () + () : m_oss() { Hub::getResultCapture().pushScopedInfo( this ); } diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index 6a4d0368..7fa7e573 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -194,6 +194,7 @@ namespace Catch return setErrorMode( m_command + " does not accept arguments" ); m_config.setShowHelp( true ); break; + case modeError: default: break; } diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h index d0181d19..ea2c53f0 100644 --- a/include/internal/catch_common.h +++ b/include/internal/catch_common.h @@ -38,6 +38,7 @@ namespace Catch void operator = ( const NonCopyable& ); protected: NonCopyable(){} + virtual ~NonCopyable() {} }; typedef char NoType; diff --git a/include/internal/catch_resultinfo.hpp b/include/internal/catch_resultinfo.hpp index 016ec8c2..258cc47c 100644 --- a/include/internal/catch_resultinfo.hpp +++ b/include/internal/catch_resultinfo.hpp @@ -24,7 +24,14 @@ namespace Catch /////////////////////////////////////////////////////////////////////////// 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_isNot( false ) {} @@ -44,6 +51,8 @@ namespace Catch m_filename( filename ), m_line( line ), m_expr( expr ), + m_lhs(), + m_rhs(), m_op( isNotExpression( expr ) ? "!" : "" ), m_message( message ), m_result( result ), @@ -54,6 +63,11 @@ namespace Catch } /////////////////////////////////////////////////////////////////////////// + virtual ~ResultInfo + () + { + } + /////////////////////////////////////////////////////////////////////////// bool ok () const diff --git a/include/internal/catch_section.hpp b/include/internal/catch_section.hpp index 084aa21d..c953aba8 100644 --- a/include/internal/catch_section.hpp +++ b/include/internal/catch_section.hpp @@ -31,6 +31,8 @@ namespace Catch std::size_t line ) : m_name( name ), + m_successes(0), + m_failures(0), m_sectionIncluded( Hub::getResultCapture().sectionStarted( name, description, filename, line, m_successes, m_failures ) ) { } diff --git a/include/internal/catch_test_case_info.hpp b/include/internal/catch_test_case_info.hpp index 4e88bc4f..e27a084d 100644 --- a/include/internal/catch_test_case_info.hpp +++ b/include/internal/catch_test_case_info.hpp @@ -42,7 +42,11 @@ namespace Catch /////////////////////////////////////////////////////////////////////// TestCaseInfo () - : m_test( NULL ) + : m_test( NULL ), + m_name(), + m_description(), + m_filename(), + m_line( 0 ) { } diff --git a/include/reporters/catch_reporter_basic.hpp b/include/reporters/catch_reporter_basic.hpp index 78de2e56..35e86df5 100644 --- a/include/reporters/catch_reporter_basic.hpp +++ b/include/reporters/catch_reporter_basic.hpp @@ -211,6 +211,11 @@ namespace Catch case ResultWas::ExplicitFailure: m_config.stream() << "failed with message: '" << resultInfo.getMessage() << "'"; break; + case ResultWas::Unknown: // These cases are here to prevent compiler warnings + case ResultWas::Ok: + case ResultWas::FailureBit: + case ResultWas::ExpressionFailed: + case ResultWas::Exception: default: if( !resultInfo.hasExpression() ) { diff --git a/include/reporters/catch_reporter_junit.hpp b/include/reporters/catch_reporter_junit.hpp index 6dbc4bf3..b281fed0 100644 --- a/include/reporters/catch_reporter_junit.hpp +++ b/include/reporters/catch_reporter_junit.hpp @@ -156,6 +156,10 @@ namespace Catch case ResultWas::Ok: stats.m_element = "success"; break; + case ResultWas::Unknown: + case ResultWas::FailureBit: + case ResultWas::Exception: + case ResultWas::DidntThrowException: default: stats.m_element = "unknown"; break; diff --git a/include/reporters/catch_reporter_xml.hpp b/include/reporters/catch_reporter_xml.hpp index 141ed419..792ab929 100644 --- a/include/reporters/catch_reporter_xml.hpp +++ b/include/reporters/catch_reporter_xml.hpp @@ -153,6 +153,12 @@ namespace Catch .writeText( resultInfo.getMessage() ); m_currentTestSuccess = false; break; + case ResultWas::Unknown: + case ResultWas::Ok: + case ResultWas::FailureBit: + case ResultWas::ExpressionFailed: + case ResultWas::Exception: + case ResultWas::DidntThrowException: default: break; } |