From 9688891868e051bb1d8a005b293229d9428bed34 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 10 Aug 2017 17:10:13 +0100 Subject: [PATCH] Fix issue with fatal errors and non-failing assertions Fixes #990 --- include/internal/catch_run_context.hpp | 1 + projects/SelfTest/TrickyTests.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/internal/catch_run_context.hpp b/include/internal/catch_run_context.hpp index 8cd637c6..30a34586 100644 --- a/include/internal/catch_run_context.hpp +++ b/include/internal/catch_run_context.hpp @@ -295,6 +295,7 @@ namespace Catch { Totals deltaTotals; deltaTotals.testCases.failed = 1; + deltaTotals.assertions.failed = 1; m_reporter->testCaseEnded( TestCaseStats( testInfo, deltaTotals, std::string(), diff --git a/projects/SelfTest/TrickyTests.cpp b/projects/SelfTest/TrickyTests.cpp index 26625b03..60f58131 100644 --- a/projects/SelfTest/TrickyTests.cpp +++ b/projects/SelfTest/TrickyTests.cpp @@ -407,3 +407,9 @@ TEST_CASE( "has printf", "" ) { // This can cause problems as, currently, stdout itself is not redirect - only the cout (and cerr) buffer printf( "spanner" ); } + +TEST_CASE( "null deref", "[.][failing][!nonportable]" ) { + CHECK( false ); + int *x = NULL; + *x = 1; +}