diff options
| author | Martin Hořeňovský | 2022-06-02 09:16:04 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2022-06-02 09:16:10 +0200 |
| commit | 2dc657cd1f9ce9f67b93a6511acea2775965e621 (patch) | |
| tree | 464192388e7ec29a0c8dabd93ec42ab47061dc7d /src/catch2/internal | |
| parent | cca59235023fa30339086be845d9cd7214ecff91 (diff) | |
| download | catch3-2dc657cd1f9ce9f67b93a6511acea2775965e621.tar.gz | |
Make default colour selection fall-through
Closes #2426
Diffstat (limited to 'src/catch2/internal')
| -rw-r--r-- | src/catch2/internal/catch_console_colour.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/catch2/internal/catch_console_colour.cpp b/src/catch2/internal/catch_console_colour.cpp index 698fb0be..c77e8295 100644 --- a/src/catch2/internal/catch_console_colour.cpp +++ b/src/catch2/internal/catch_console_colour.cpp @@ -232,25 +232,22 @@ namespace Catch { Detail::unique_ptr<ColourImpl> makeColourImpl( ColourMode implSelection, 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 ( implSelection == ColourMode::Win32 ) { return Detail::make_unique<Win32ColourImpl>( stream ); } #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 defined (CATCH_CONFIG_COLOUR_WIN32) +#if defined( CATCH_CONFIG_COLOUR_WIN32 ) if ( Win32ColourImpl::useImplementationForStream( *stream ) ) { return Detail::make_unique<Win32ColourImpl>( stream ); - } else { - return Detail::make_unique<NoColourImpl>( stream ); } #endif if ( ANSIColourImpl::useImplementationForStream( *stream ) ) { |