mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-29 16:53:30 +01:00
Refactored printResultType into switch
This commit is contained in:
parent
60ed3c142c
commit
3b970e20e9
@ -61,14 +61,18 @@ namespace Catch {
|
||||
}
|
||||
|
||||
bool printResultType( AssertionResult const& _result ) {
|
||||
if( _result.getResultType() == ResultWas::Info ||
|
||||
_result.getResultType() == ResultWas::Warning ) {
|
||||
}
|
||||
else if( _result.succeeded() ) {
|
||||
switch( _result.getResultType() ) {
|
||||
case ResultWas::Info:
|
||||
case ResultWas::Warning:
|
||||
break;
|
||||
case ResultWas::Ok:
|
||||
{
|
||||
TextColour successColour( TextColour::Success );
|
||||
stream << "passed ";
|
||||
}
|
||||
else if( _result.isOk() ) {
|
||||
break;
|
||||
default:
|
||||
if( _result.isOk() ) {
|
||||
TextColour okAnywayColour( TextColour::Success );
|
||||
stream << "failed - but was ok ";
|
||||
}
|
||||
@ -76,6 +80,7 @@ namespace Catch {
|
||||
TextColour errorColour( TextColour::Error );
|
||||
stream << "failed ";
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool printOriginalExpression( AssertionResult const& _result ) {
|
||||
|
Loading…
Reference in New Issue
Block a user