mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +01:00
Small refactoring in AssertionResult
This commit is contained in:
parent
1af351cea1
commit
f04c93462b
@ -68,16 +68,15 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string AssertionResult::getExpressionInMacro() const {
|
std::string AssertionResult::getExpressionInMacro() const {
|
||||||
std::string expr;
|
if ( m_info.macroName.empty() ) {
|
||||||
if( m_info.macroName.empty() )
|
return static_cast<std::string>( m_info.capturedExpression );
|
||||||
expr = static_cast<std::string>(m_info.capturedExpression);
|
|
||||||
else {
|
|
||||||
expr.reserve( m_info.macroName.size() + m_info.capturedExpression.size() + 4 );
|
|
||||||
expr += m_info.macroName;
|
|
||||||
expr += "( ";
|
|
||||||
expr += m_info.capturedExpression;
|
|
||||||
expr += " )";
|
|
||||||
}
|
}
|
||||||
|
std::string expr;
|
||||||
|
expr.reserve( m_info.macroName.size() + m_info.capturedExpression.size() + 4 );
|
||||||
|
expr += m_info.macroName;
|
||||||
|
expr += "( ";
|
||||||
|
expr += m_info.capturedExpression;
|
||||||
|
expr += " )";
|
||||||
return expr;
|
return expr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user