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

summaryrefslogtreecommitdiffhomepage
path: root/tests/Progmasoft/RunnerFixture.cpp
diff options
context:
space:
mode:
authorLeitwolf112026-11-01 20:05:56 +0300
committerLeitwolf112026-11-01 20:05:56 +0300
commit8603d31fd8c1a72e30cb444f278d7a0592383ba7 (patch)
tree496d26ff659e92cdf4e6fe27a4aa47bf52818052 /tests/Progmasoft/RunnerFixture.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 'tests/Progmasoft/RunnerFixture.cpp')
-rw-r--r--tests/Progmasoft/RunnerFixture.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/Progmasoft/RunnerFixture.cpp b/tests/Progmasoft/RunnerFixture.cpp
index 2796912f..3a61d05c 100644
--- a/tests/Progmasoft/RunnerFixture.cpp
+++ b/tests/Progmasoft/RunnerFixture.cpp
@@ -251,6 +251,15 @@ TEST_CASE("fixture mock left by a failure", "[fixture][mock]")
FAIL("the test's own failure");
}
+TEST_CASE("fixture mock outlives the run", "[fixture][mock-exit]")
+{
+ static auto *mock = new Progmasoft::Catch3::MockFunction<void()>{ "late" };
+ CATCH3_EXPECT_CALL (*mock)();
+ std::atexit([] {
+ delete mock;
+ });
+}
+
TEST_CASE("fixture skips", "[fixture][skip]")
{
SKIP("not on this machine");