Manual cherry-pick from #1111

This hsould merge still-valid piece of #1111 into master.
This commit is contained in:
Martin Hořeňovský 2017-12-09 20:17:47 +01:00
parent 0cf05d54a6
commit a7a9ee5552
8 changed files with 13 additions and 15 deletions

View File

@ -59,11 +59,6 @@ namespace Catch {
m_resultCapture( getResultCapture() ) m_resultCapture( getResultCapture() )
{} {}
AssertionHandler::~AssertionHandler() {
if ( !m_completed )
m_resultCapture.handleIncomplete( m_assertionInfo );
}
void AssertionHandler::handleExpr( ITransientExpression const& expr ) { void AssertionHandler::handleExpr( ITransientExpression const& expr ) {
m_resultCapture.handleExpr( m_assertionInfo, expr, m_reaction ); m_resultCapture.handleExpr( m_assertionInfo, expr, m_reaction );
} }

View File

@ -52,7 +52,12 @@ namespace Catch {
SourceLineInfo const& lineInfo, SourceLineInfo const& lineInfo,
StringRef capturedExpression, StringRef capturedExpression,
ResultDisposition::Flags resultDisposition ); ResultDisposition::Flags resultDisposition );
~AssertionHandler(); ~AssertionHandler() {
if ( !m_completed ) {
m_resultCapture.handleIncomplete( m_assertionInfo )
}
}
template<typename T> template<typename T>
void handleExpr( ExprLhs<T> const& expr ) { void handleExpr( ExprLhs<T> const& expr ) {

View File

@ -15,10 +15,6 @@
namespace Catch { namespace Catch {
SourceLineInfo::SourceLineInfo( char const* _file, std::size_t _line ) noexcept
: file( _file ),
line( _line )
{}
bool SourceLineInfo::empty() const noexcept { bool SourceLineInfo::empty() const noexcept {
return file[0] == '\0'; return file[0] == '\0';
} }

View File

@ -43,7 +43,10 @@ namespace Catch {
struct SourceLineInfo { struct SourceLineInfo {
SourceLineInfo() = delete; SourceLineInfo() = delete;
SourceLineInfo( char const* _file, std::size_t _line ) noexcept; SourceLineInfo::SourceLineInfo( char const* _file, std::size_t _line ) noexcept
: file( _file ),
line( _line )
{}
SourceLineInfo( SourceLineInfo const& other ) = default; SourceLineInfo( SourceLineInfo const& other ) = default;
SourceLineInfo( SourceLineInfo && ) = default; SourceLineInfo( SourceLineInfo && ) = default;

View File

@ -20,7 +20,7 @@ namespace Catch {
return m_runner; return m_runner;
} }
virtual IConfigPtr getConfig() const override { virtual IConfigPtr const& getConfig() const override {
return m_config; return m_config;
} }

View File

@ -25,7 +25,7 @@ namespace Catch {
virtual IResultCapture* getResultCapture() = 0; virtual IResultCapture* getResultCapture() = 0;
virtual IRunner* getRunner() = 0; virtual IRunner* getRunner() = 0;
virtual IConfigPtr getConfig() const = 0; virtual IConfigPtr const& getConfig() const = 0;
}; };
struct IMutableContext : IContext struct IMutableContext : IContext

View File

@ -22,7 +22,6 @@ namespace Catch {
} }
bool shouldContinueOnFailure( int flags ) { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; } bool shouldContinueOnFailure( int flags ) { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; }
bool isFalseTest( int flags ) { return ( flags & ResultDisposition::FalseTest ) != 0; }
bool shouldSuppressFailure( int flags ) { return ( flags & ResultDisposition::SuppressFail ) != 0; } bool shouldSuppressFailure( int flags ) { return ( flags & ResultDisposition::SuppressFail ) != 0; }
} // end namespace Catch } // end namespace Catch

View File

@ -47,7 +47,7 @@ namespace Catch {
ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ); ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs );
bool shouldContinueOnFailure( int flags ); bool shouldContinueOnFailure( int flags );
bool isFalseTest( int flags ); inline bool isFalseTest( int flags ) { return ( flags & ResultDisposition::FalseTest ) != 0; }
bool shouldSuppressFailure( int flags ); bool shouldSuppressFailure( int flags );
} // end namespace Catch } // end namespace Catch