From a9bbc42e9c52d92d22955e4648cee8295f51db61 Mon Sep 17 00:00:00 2001 From: Nic Ramage Date: Mon, 26 Jul 2021 13:14:42 +0200 Subject: [PATCH] Specify a maximum console width that is independent of CATCH_CONFIG_CONSOLE_WIDTH --- include/internal/catch_config.hpp | 4 ++++ include/reporters/catch_reporter_bases.hpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp index fd7de5b2..457a2024 100644 --- a/include/internal/catch_config.hpp +++ b/include/internal/catch_config.hpp @@ -18,6 +18,10 @@ #include #include +#ifndef CATCH_CONFIG_CONSOLE_MAXIMUM_WIDTH +#define CATCH_CONFIG_CONSOLE_MAXIMUM_WIDTH 512 +#endif + #ifndef CATCH_CONFIG_CONSOLE_WIDTH #define CATCH_CONFIG_CONSOLE_WIDTH 80 #endif diff --git a/include/reporters/catch_reporter_bases.hpp b/include/reporters/catch_reporter_bases.hpp index f62e1430..7f0f15db 100644 --- a/include/reporters/catch_reporter_bases.hpp +++ b/include/reporters/catch_reporter_bases.hpp @@ -262,7 +262,7 @@ namespace Catch { template char const* getLineOfChars() { - static char line[CATCH_CONFIG_CONSOLE_WIDTH] = {0}; + static char line[CATCH_CONFIG_CONSOLE_MAXIMUM_WIDTH] = {0}; if( !*line ) { std::memset( line, C, CATCH_CONFIG_CONSOLE_WIDTH-1 ); line[CATCH_CONFIG_CONSOLE_WIDTH-1] = 0;