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