From dc3e7f9cf7628d4edf43ad04507a86ba81137c31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Fri, 9 Mar 2018 10:00:55 +0100 Subject: [PATCH] Fix incorrectly clamped return value Fixes #1215 --- include/internal/catch_session.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/internal/catch_session.cpp b/include/internal/catch_session.cpp index 0581ac88..a5f8946e 100644 --- a/include/internal/catch_session.cpp +++ b/include/internal/catch_session.cpp @@ -277,7 +277,7 @@ namespace Catch { // Note that on unices only the lower 8 bits are usually used, clamping // the return value to 255 prevents false negative when some multiple // of 256 tests has failed - return (std::min)( { MaxExitCode, totals.error, static_cast( totals.assertions.failed ) } ); + return (std::min) (MaxExitCode, (std::max) (totals.error, static_cast(totals.assertions.failed))); } catch( std::exception& ex ) { Catch::cerr() << ex.what() << std::endl;