mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +01:00
Small defensive tweak on checking expression
This commit is contained in:
parent
e401601ac1
commit
01234172a9
@ -44,7 +44,7 @@ namespace Catch
|
||||
m_filename( filename ),
|
||||
m_line( line ),
|
||||
m_expr( expr ),
|
||||
m_op( m_expr[0] == '!' ? "!" : "" ),
|
||||
m_op( isNotExpression( expr ) ? "!" : "" ),
|
||||
m_result( result ),
|
||||
m_isNot( isNot ),
|
||||
m_expressionIncomplete( false )
|
||||
@ -152,6 +152,15 @@ namespace Catch
|
||||
else
|
||||
return "{can't expand - use " + m_macroName + "_NOT( " + m_expr.substr(1) + " ) instead of " + m_macroName + "( " + m_expr + " ) for better diagnostics}";
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
bool isNotExpression
|
||||
(
|
||||
const char* expr
|
||||
)
|
||||
{
|
||||
return expr && expr[0] == '!';
|
||||
}
|
||||
|
||||
protected:
|
||||
std::string m_macroName;
|
||||
|
Loading…
Reference in New Issue
Block a user