MCPcopy Create free account
hub / github.com/catchorg/Catch2 / getExpressionInMacro

Method getExpressionInMacro

extras/catch_amalgamated.cpp:686–697  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

684 }
685
686 std::string AssertionResult::getExpressionInMacro() const {
687 if ( m_info.macroName.empty() ) {
688 return static_cast<std::string>( m_info.capturedExpression );
689 }
690 std::string expr;
691 expr.reserve( m_info.macroName.size() + m_info.capturedExpression.size() + 4 );
692 expr += m_info.macroName;
693 expr += "( ";
694 expr += m_info.capturedExpression;
695 expr += " )";
696 return expr;
697 }
698
699 bool AssertionResult::hasExpandedExpression() const {
700 return hasExpression() && getExpandedExpression() != getExpression();

Callers 4

printFunction · 0.45
writeAssertionMethod · 0.45
assertionEndedMethod · 0.45

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected