From 684cbb2631fbb31c60e3a9cf1eedae22aa5227d0 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 10 Aug 2017 17:10:13 +0100 Subject: [PATCH] Fixes issue with fatal errors and non-failing assertions Fixes #990 --- include/internal/catch_run_context.cpp | 1 + projects/SelfTest/TrickyTests.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/internal/catch_run_context.cpp b/include/internal/catch_run_context.cpp index d1dd4168..d29ef54d 100644 --- a/include/internal/catch_run_context.cpp +++ b/include/internal/catch_run_context.cpp @@ -227,6 +227,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 0fe377ce..96a8b2b6 100644 --- a/projects/SelfTest/TrickyTests.cpp +++ b/projects/SelfTest/TrickyTests.cpp @@ -429,3 +429,9 @@ TEST_CASE("Commas in various macros are allowed") { CHECK(true); } } + +TEST_CASE( "null deref", "[.][failing][!nonportable]" ) { + CHECK( false ); + int *x = NULL; + *x = 1; +}