mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-21 03:55:39 +02:00
More method bodies moved out of line
This commit is contained in:
@@ -11,6 +11,10 @@
|
||||
namespace Catch {
|
||||
|
||||
|
||||
bool DecomposedExpression::isBinaryExpression() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
AssertionInfo::AssertionInfo( char const * _macroName,
|
||||
SourceLineInfo const& _lineInfo,
|
||||
char const * _capturedExpression,
|
||||
@@ -21,6 +25,30 @@ namespace Catch {
|
||||
resultDisposition( _resultDisposition )
|
||||
{}
|
||||
|
||||
void AssertionResultData::negate( bool parenthesize ) {
|
||||
negated = !negated;
|
||||
parenthesized = parenthesize;
|
||||
if( resultType == ResultWas::Ok )
|
||||
resultType = ResultWas::ExpressionFailed;
|
||||
else if( resultType == ResultWas::ExpressionFailed )
|
||||
resultType = ResultWas::Ok;
|
||||
}
|
||||
|
||||
std::string const& AssertionResultData::reconstructExpression() const {
|
||||
if( decomposedExpression != nullptr ) {
|
||||
decomposedExpression->reconstructExpression( reconstructedExpression );
|
||||
if( parenthesized ) {
|
||||
reconstructedExpression.insert( 0, 1, '(' );
|
||||
reconstructedExpression.append( 1, ')' );
|
||||
}
|
||||
if( negated ) {
|
||||
reconstructedExpression.insert( 0, 1, '!' );
|
||||
}
|
||||
decomposedExpression = nullptr;
|
||||
}
|
||||
return reconstructedExpression;
|
||||
}
|
||||
|
||||
AssertionResult::AssertionResult() {}
|
||||
|
||||
AssertionResult::AssertionResult( AssertionInfo const& info, AssertionResultData const& data )
|
||||
|
Reference in New Issue
Block a user