Fix incorrectly clamped return value

Fixes #1215
This commit is contained in:
Martin Hořeňovský 2018-03-09 10:00:55 +01:00
parent d14b7563c2
commit dc3e7f9cf7

View File

@ -277,7 +277,7 @@ namespace Catch {
// Note that on unices only the lower 8 bits are usually used, clamping // Note that on unices only the lower 8 bits are usually used, clamping
// the return value to 255 prevents false negative when some multiple // the return value to 255 prevents false negative when some multiple
// of 256 tests has failed // of 256 tests has failed
return (std::min)( { MaxExitCode, totals.error, static_cast<int>( totals.assertions.failed ) } ); return (std::min) (MaxExitCode, (std::max) (totals.error, static_cast<int>(totals.assertions.failed)));
} }
catch( std::exception& ex ) { catch( std::exception& ex ) {
Catch::cerr() << ex.what() << std::endl; Catch::cerr() << ex.what() << std::endl;