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_
| 998 | // *_STRCASEEQ*. When it's true, the string " (ignoring case)" will |
| 999 | // be inserted into the message. |
| 1000 | AssertionResult EqFailure(const char* expected_expression, |
| 1001 | const char* actual_expression, |
| 1002 | const std::string& expected_value, |
| 1003 | const std::string& actual_value, |
| 1004 | bool ignoring_case) { |
| 1005 | Message msg; |
| 1006 | msg << "Value of: " << actual_expression; |
| 1007 | if (actual_value != actual_expression) { |
| 1008 | msg << "\n Actual: " << actual_value; |
| 1009 | } |
| 1010 | |
| 1011 | msg << "\nExpected: " << expected_expression; |
| 1012 | if (ignoring_case) { |
| 1013 | msg << " (ignoring case)"; |
| 1014 | } |
| 1015 | if (expected_value != expected_expression) { |
| 1016 | msg << "\nWhich is: " << expected_value; |
| 1017 | } |
| 1018 | |
| 1019 | return AssertionFailure() << msg; |
| 1020 | } |
| 1021 | |
| 1022 | // Constructs a failure message for Boolean assertions such as EXPECT_TRUE. |
| 1023 | std::string GetBoolAssertionFailureMessage( |
no test coverage detected