mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-23 19:53:28 +01:00
Fix REQUIRE_FALSE so that it aborts test case
This commit is contained in:
parent
4af4405ce1
commit
465454fecc
@ -71,7 +71,7 @@ namespace Catch {
|
|||||||
if( !result.isOk() ) {
|
if( !result.isOk() ) {
|
||||||
if( getCurrentContext().getConfig()->shouldDebugBreak() )
|
if( getCurrentContext().getConfig()->shouldDebugBreak() )
|
||||||
m_shouldDebugBreak = true;
|
m_shouldDebugBreak = true;
|
||||||
if( getCurrentContext().getRunner()->aborting() || m_assertionInfo.resultDisposition == ResultDisposition::Normal )
|
if( getCurrentContext().getRunner()->aborting() || (m_assertionInfo.resultDisposition & ResultDisposition::Normal) )
|
||||||
m_shouldThrow = true;
|
m_shouldThrow = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,11 +41,11 @@ namespace Catch {
|
|||||||
|
|
||||||
// ResultDisposition::Flags enum
|
// ResultDisposition::Flags enum
|
||||||
struct ResultDisposition { enum Flags {
|
struct ResultDisposition { enum Flags {
|
||||||
Normal = 0x00,
|
Normal = 0x01,
|
||||||
|
|
||||||
ContinueOnFailure = 0x01, // Failures fail test, but execution continues
|
ContinueOnFailure = 0x02, // Failures fail test, but execution continues
|
||||||
FalseTest = 0x02, // Prefix expression with !
|
FalseTest = 0x04, // Prefix expression with !
|
||||||
SuppressFail = 0x04 // Failures are reported but do not fail the test
|
SuppressFail = 0x08 // Failures are reported but do not fail the test
|
||||||
}; };
|
}; };
|
||||||
|
|
||||||
inline ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) {
|
inline ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user