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 /src/Progmasoft/Mock.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 'src/Progmasoft/Mock.cpp')
| -rw-r--r-- | src/Progmasoft/Mock.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/Progmasoft/Mock.cpp b/src/Progmasoft/Mock.cpp index b1364450..bc7945f5 100644 --- a/src/Progmasoft/Mock.cpp +++ b/src/Progmasoft/Mock.cpp @@ -9,7 +9,6 @@ #include <algorithm> #include <cstdio> #include <cstdlib> -#include <exception> namespace Progmasoft::Catch3::Detail { @@ -101,16 +100,15 @@ namespace Progmasoft::Catch3::Detail void ReportMockFailure(const Catch::SourceLineInfo &line, const std::string &mock, - std::string message, - MockReport report) + std::string message) { if (!InTestCase()) { WriteToStandardError(line, mock, message); return; } - // An aborting run throws out of any failure, and a destructor must - // not let that through. + // An aborting run throws out of any failure. The run still stops, at + // its next assertion. CATCH_TRY { Report(line, @@ -120,12 +118,7 @@ namespace Progmasoft::Catch3::Detail Catch::ResultDisposition::ContinueOnFailure); } CATCH_CATCH_ALL - { - if (report == MockReport::kContinue) - { - std::rethrow_exception(std::current_exception()); - } - } + {} } void |