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

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal/catch_run_context.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2026-04-24 11:21:04 +0200
committerMartin Hořeňovský2026-04-24 11:21:04 +0200
commit11a96e186af8b2779d93e550217e9c95d3f89371 (patch)
tree0f478d0761c8a951c9c238f5504fa020929ae7fa /src/catch2/internal/catch_run_context.cpp
parent10f62484bff73e3a58a411e2e10b4e1c13cfba9f (diff)
downloadcatch3-11a96e186af8b2779d93e550217e9c95d3f89371.tar.gz
Cleanups from static analysis
Diffstat (limited to 'src/catch2/internal/catch_run_context.cpp')
-rw-r--r--src/catch2/internal/catch_run_context.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/catch2/internal/catch_run_context.cpp b/src/catch2/internal/catch_run_context.cpp
index e7e22c58..a435170f 100644
--- a/src/catch2/internal/catch_run_context.cpp
+++ b/src/catch2/internal/catch_run_context.cpp
@@ -461,14 +461,13 @@ namespace Catch {
Detail::g_lastAssertionPassed = true;
} else if (!result.succeeded()) {
Detail::g_lastAssertionPassed = false;
- if (result.isOk()) {
- }
- else if( m_activeTestCase->getTestCaseInfo().okToFail() ) // Read from a shared state established before the threads could start, this is fine
+ if (result.isOk()) {}
+ else if( m_activeTestCase->getTestCaseInfo().okToFail() ) { // Read from a shared state established before the threads could start, this is fine
m_atomicAssertionCount.failedButOk++;
- else
+ } else {
m_atomicAssertionCount.failed++;
- }
- else {
+ }
+ } else {
Detail::g_lastAssertionPassed = true;
}
@@ -650,7 +649,7 @@ namespace Catch {
// and since IResultCapture::getLastResult is deprecated,
// we will leave it as is, until it is finally removed.
Detail::LockGuard _( m_assertionMutex );
- return &(*m_lastResult);
+ return &*m_lastResult;
}
void RunContext::exceptionEarlyReported() {
@@ -902,7 +901,7 @@ namespace Catch {
}
void RunContext::populateReaction( AssertionReaction& reaction,
- bool has_normal_disposition ) {
+ bool has_normal_disposition ) const {
reaction.shouldDebugBreak = m_shouldDebugBreak;
reaction.shouldThrow = aborting() || has_normal_disposition;
}