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_
| 2299 | // *_STRCASEEQ*. When it's true, the string " (ignoring case)" will |
| 2300 | // be inserted into the message. |
| 2301 | AssertionResult 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. |
| 2324 | String GetBoolAssertionFailureMessage(const AssertionResult& assertion_result, |
no test coverage detected