mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-18 10:55:39 +02:00
Rework of REQUIRE* changes in CATCH_CONFIG_FAST_COMPILE
`ResultBuilder`s destructor now checks for exceptions, preventing false negatives. The speedup should remain the same give or take a tiny bit.
This commit is contained in:
@@ -30,9 +30,18 @@ namespace Catch {
|
||||
char const* secondArg )
|
||||
: m_assertionInfo( macroName, lineInfo, capturedExpressionWithSecondArgument( capturedExpression, secondArg ), resultDisposition ),
|
||||
m_shouldDebugBreak( false ),
|
||||
m_shouldThrow( false )
|
||||
m_shouldThrow( false ),
|
||||
m_guardException( false )
|
||||
{}
|
||||
|
||||
ResultBuilder::~ResultBuilder() {
|
||||
#if defined(CATCH_CONFIG_FAST_COMPILE)
|
||||
if ( m_guardException ) {
|
||||
useActiveException( m_assertionInfo.resultDisposition );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
ResultBuilder& ResultBuilder::setResultType( ResultWas::OfType result ) {
|
||||
m_data.resultType = result;
|
||||
return *this;
|
||||
@@ -146,6 +155,13 @@ namespace Catch {
|
||||
dest = m_assertionInfo.capturedExpression;
|
||||
}
|
||||
|
||||
void ResultBuilder::setExceptionGuard() {
|
||||
m_guardException = true;
|
||||
}
|
||||
void ResultBuilder::unsetExceptionGuard() {
|
||||
m_guardException = false;
|
||||
}
|
||||
|
||||
} // end namespace Catch
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_RESULT_BUILDER_HPP_INCLUDED
|
||||
|
Reference in New Issue
Block a user