Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/extras/catch_amalgamated.cpp
diff options
context:
space:
mode:
authorLeitwolf112026-11-01 20:05:56 +0300
committerLeitwolf112026-11-01 20:05:56 +0300
commit8603d31fd8c1a72e30cb444f278d7a0592383ba7 (patch)
tree496d26ff659e92cdf4e6fe27a4aa47bf52818052 /extras/catch_amalgamated.cpp
parent2aea9dafd283d69bec459ea0d495c25d1f6a0f94 (diff)
downloadcatch3-feature/mocking.tar.gz
Answer the review of the mocksfeature/mocking
A report no longer throws, so a noexcept mock survives an aborting run. A call that has nothing to return still leaves the test case, which ends the process in a noexcept function; the documentation says so. RunContext clears the result capture when it goes, so a mock of static lifetime finds none and writes to standard error. Decision owns its source line, since Verify can free the expectation while a call is on its way. Moving a result out takes the lock. Vector matchers refer to their vector, so they are rejected at compile time like composed ones. A null text expectation accepts only null, and integers compare by value, so 256 no longer accepts an unsigned char.
Diffstat (limited to 'extras/catch_amalgamated.cpp')
-rw-r--r--extras/catch_amalgamated.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp
index 78782e44..fb73d0b2 100644
--- a/extras/catch_amalgamated.cpp
+++ b/extras/catch_amalgamated.cpp
@@ -7,7 +7,7 @@
// SPDX-License-Identifier: BSL-1.0
// Catch3 v0.3.0.1, on the Catch2 v3.16.1 engine
-// Generated: 2026-11-01 16:09:52.594301
+// Generated: 2026-11-01 20:05:03.089807
// ----------------------------------------------------------
// This file is an amalgamation of multiple different files.
// You probably shouldn't edit it directly.
@@ -5189,6 +5189,11 @@ namespace Catch {
RunContext::~RunContext() {
updateTotalsFromAtomics();
m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, aborting()));
+ // What outlives the run, such as a mock of static lifetime, must not
+ // find a capture that is gone.
+ if ( getCurrentContext().getResultCapture() == this ) {
+ getCurrentMutableContext().setResultCapture( nullptr );
+ }
}
Totals RunContext::runTest(TestCaseHandle const& testCase) {