Make default colour selection fall-through

Closes #2426
This commit is contained in:
Martin Hořeňovský 2022-06-02 09:16:04 +02:00
parent cca5923502
commit 2dc657cd1f
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A

View File

@ -232,25 +232,22 @@ namespace Catch {
Detail::unique_ptr<ColourImpl> makeColourImpl( ColourMode implSelection, Detail::unique_ptr<ColourImpl> makeColourImpl( ColourMode implSelection,
IStream* stream ) { IStream* stream ) {
if ( implSelection == ColourMode::None ) {
return Detail::make_unique<NoColourImpl>( stream );
}
if ( implSelection == ColourMode::ANSI ) {
return Detail::make_unique<ANSIColourImpl>( stream );
}
#if defined( CATCH_CONFIG_COLOUR_WIN32 ) #if defined( CATCH_CONFIG_COLOUR_WIN32 )
if ( implSelection == ColourMode::Win32 ) { if ( implSelection == ColourMode::Win32 ) {
return Detail::make_unique<Win32ColourImpl>( stream ); return Detail::make_unique<Win32ColourImpl>( stream );
} }
#endif #endif
if ( implSelection == ColourMode::ANSI ) {
return Detail::make_unique<ANSIColourImpl>( stream );
}
if ( implSelection == ColourMode::None ) {
return Detail::make_unique<NoColourImpl>( stream );
}
// todo: check win32 eligibility under ifdef, otherwise ansi
if ( implSelection == ColourMode::PlatformDefault) { if ( implSelection == ColourMode::PlatformDefault) {
#if defined (CATCH_CONFIG_COLOUR_WIN32) #if defined( CATCH_CONFIG_COLOUR_WIN32 )
if ( Win32ColourImpl::useImplementationForStream( *stream ) ) { if ( Win32ColourImpl::useImplementationForStream( *stream ) ) {
return Detail::make_unique<Win32ColourImpl>( stream ); return Detail::make_unique<Win32ColourImpl>( stream );
} else {
return Detail::make_unique<NoColourImpl>( stream );
} }
#endif #endif
if ( ANSIColourImpl::useImplementationForStream( *stream ) ) { if ( ANSIColourImpl::useImplementationForStream( *stream ) ) {