From 2dc657cd1f9ce9f67b93a6511acea2775965e621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Thu, 2 Jun 2022 09:16:04 +0200 Subject: [PATCH] Make default colour selection fall-through Closes #2426 --- src/catch2/internal/catch_console_colour.cpp | 17 +++++++---------- 1 file 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 makeColourImpl( ColourMode implSelection, IStream* stream ) { - if ( implSelection == ColourMode::None ) { - return Detail::make_unique( stream ); - } - if ( implSelection == ColourMode::ANSI ) { - return Detail::make_unique( stream ); - } #if defined( CATCH_CONFIG_COLOUR_WIN32 ) if ( implSelection == ColourMode::Win32 ) { return Detail::make_unique( stream ); } #endif + if ( implSelection == ColourMode::ANSI ) { + return Detail::make_unique( stream ); + } + if ( implSelection == ColourMode::None ) { + return Detail::make_unique( 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( stream ); - } else { - return Detail::make_unique( stream ); } #endif if ( ANSIColourImpl::useImplementationForStream( *stream ) ) {