MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / EqFailure

Function EqFailure

rtpose_wrapper/src/gtest/gtest-all.cpp:2301–2321  ·  view source on GitHub ↗

Constructs and returns the message for an equality assertion (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure. The first four parameters are the expressions used in the assertion and their values, as strings. For example, for ASSERT_EQ(foo, bar) where foo is 5 and bar is 6, we have: expected_expression: "foo" actual_expression: "bar" expected_value: "5" actual_value: "6" The ignoring_

Source from the content-addressed store, hash-verified

2299// *_STRCASEEQ*. When it's true, the string " (ignoring case)" will
2300// be inserted into the message.
2301AssertionResult EqFailure(const char* expected_expression,
2302 const char* actual_expression,
2303 const String& expected_value,
2304 const String& actual_value,
2305 bool ignoring_case) {
2306 Message msg;
2307 msg << "Value of: " << actual_expression;
2308 if (actual_value != actual_expression) {
2309 msg << "\n Actual: " << actual_value;
2310 }
2311
2312 msg << "\nExpected: " << expected_expression;
2313 if (ignoring_case) {
2314 msg << " (ignoring case)";
2315 }
2316 if (expected_value != expected_expression) {
2317 msg << "\nWhich is: " << expected_value;
2318 }
2319
2320 return AssertionFailure() << msg;
2321}
2322
2323// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
2324String GetBoolAssertionFailureMessage(const AssertionResult& assertion_result,

Callers 5

CmpHelperEQFunction · 0.85
CmpHelperFloatingPointEQFunction · 0.85
CmpHelperEQFunction · 0.85
gtest-all.cppFile · 0.85
CmpHelperSTREQFunction · 0.85

Calls 1

AssertionFailureFunction · 0.85

Tested by

no test coverage detected