catch3
Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.
Clonegit clone https://git.progmasoft.com/catch3
Fixes issue with fatal errors and non-failing assertions
- Commit
684cbb2631fbb31c60e3a9cf1eedae22aa5227d0- Author
- Phil Nash ·
- Parents
6282999291f6
Changes
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; +}