diff options
| author | Leitwolf11 | 2026-11-01 20:05:56 +0300 |
|---|---|---|
| committer | Leitwolf11 | 2026-11-01 20:05:56 +0300 |
| commit | 8603d31fd8c1a72e30cb444f278d7a0592383ba7 (patch) | |
| tree | 496d26ff659e92cdf4e6fe27a4aa47bf52818052 /tests/Progmasoft/RunnerFixture.cpp | |
| parent | 2aea9dafd283d69bec459ea0d495c25d1f6a0f94 (diff) | |
| download | catch3-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.cpp | 9 |
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"); |