diff options
| author | Leitwolf11 | 2026-11-01 19:11:27 +0300 |
|---|---|---|
| committer | Leitwolf11 | 2026-11-01 19:11:27 +0300 |
| commit | 2aea9dafd283d69bec459ea0d495c25d1f6a0f94 (patch) | |
| tree | e478374100157fe4d0aef16e582dbcabda51e2c1 /src/Progmasoft/Catch3 | |
| parent | c51d15273e87267215e5877edc268e7db354187b (diff) | |
| download | catch3-2aea9dafd283d69bec459ea0d495c25d1f6a0f94.tar.gz | |
Keep the mock lock alive to the end of the process
A static mutex needs an exit-time destructor, which Clang's warnings
refuse, and a mock of static lifetime can outlive it. The test seam is
held the same way, and a test covers a mock method with nothing after
its parameters, which needs an empty variadic argument to stay valid
under -Wpedantic.
Diffstat (limited to 'src/Progmasoft/Catch3')
| -rw-r--r-- | src/Progmasoft/Catch3/Mock.hpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Progmasoft/Catch3/Mock.hpp b/src/Progmasoft/Catch3/Mock.hpp index 1e077ac8..f100041c 100644 --- a/src/Progmasoft/Catch3/Mock.hpp +++ b/src/Progmasoft/Catch3/Mock.hpp @@ -373,8 +373,8 @@ namespace Progmasoft::Catch3 } else if constexpr (std::is_copy_constructible_v<Result>) { - return Does([held = Result(std::forward<Value>(value))]( - Arguments...) -> Result { + return Does([held = static_cast<Result>(std::forward<Value>( + value))](Arguments...) -> Result { return held; }); } @@ -925,7 +925,8 @@ namespace Progmasoft::Catch3 field, \ arguments, \ CATCH3_INTERNAL_MOCK_EXPAND(CATCH3_INTERNAL_MOCK_COUNT arguments), \ - CATCH3_INTERNAL_MOCK_EXPAND(CATCH3_INTERNAL_MOCK_FIRST(__VA_ARGS__)))) + CATCH3_INTERNAL_MOCK_EXPAND( \ + CATCH3_INTERNAL_MOCK_FIRST(__VA_ARGS__, )))) /// Declares the member `name` of a mock class and, beside it, the mock /// `name##Mock` that `CATCH3_EXPECT_CALL` takes. The parenthesized list of |