Function getExpression

Synopsis

#include <include/internal/catch_assertionresult.h>

std::string getExpression() const

Description

No description yet.

Source

Lines 55-66 in include/internal/catch_assertionresult.cpp. Line 44 in include/internal/catch_assertionresult.h.

std::string AssertionResult::getExpression() const {
    // Possibly overallocating by 3 characters should be basically free
    std::string expr; expr.reserve(m_info.capturedExpression.size() + 3);
    if (isFalseTest(m_info.resultDisposition)) {
        expr += "!(";
    }
    expr += m_info.capturedExpression;
    if (isFalseTest(m_info.resultDisposition)) {
        expr += ')';
    }
    return expr;
}





Add Discussion as Guest

Log in