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

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorPhil Nash2017-08-25 11:33:29 +0100
committerPhil Nash2017-08-25 11:37:49 +0100
commit8e8c0c1675e20669df415209b27e2ff3d80da527 (patch)
tree78ad9952172c9cd15e9ebe25c7460be5326f2614 /include
parentb6e7c9bd7a160c07c5de894292022687895c17a3 (diff)
downloadcatch3-8e8c0c1675e20669df415209b27e2ff3d80da527.tar.gz
Tweaked how failedButOk assertions are recorded
- fixes issue where sections in !shouldfail or !mayfail test cases that have failing assertions where marked as failed instead of failedButOk
Diffstat (limited to 'include')
-rw-r--r--include/internal/catch_run_context.hpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/include/internal/catch_run_context.hpp b/include/internal/catch_run_context.hpp
index 30a34586..be9b5521 100644
--- a/include/internal/catch_run_context.hpp
+++ b/include/internal/catch_run_context.hpp
@@ -166,7 +166,10 @@ namespace Catch {
m_totals.assertions.passed++;
}
else if( !result.isOk() ) {
- m_totals.assertions.failed++;
+ if( m_activeTestCase->getTestCaseInfo().okToFail() )
+ m_totals.assertions.failedButOk++;
+ else
+ m_totals.assertions.failed++;
}
// We have no use for the return value (whether messages should be cleared), because messages were made scoped
@@ -355,12 +358,6 @@ namespace Catch {
Counts assertions = m_totals.assertions - prevAssertions;
bool missingAssertions = testForMissingAssertions( assertions );
- if( testCaseInfo.okToFail() ) {
- std::swap( assertions.failedButOk, assertions.failed );
- m_totals.assertions.failed -= assertions.failedButOk;
- m_totals.assertions.failedButOk += assertions.failedButOk;
- }
-
SectionStats testCaseSectionStats( testCaseSection, assertions, duration, missingAssertions );
m_reporter->sectionEnded( testCaseSectionStats );
}