45void Fail(
const char* msg) {
46 printf(
"FAILURE: %s\n", msg);
54 testing::GTEST_FLAG(throw_on_failure) =
true;
60 Fail(
"A successful assertion wrongfully threw.");
66 }
catch(
const std::runtime_error& e) {
67 if (strstr(e.what(),
"Expected failure") != NULL)
71 "A failed assertion did throw an exception of the right type, "
72 "but the message is incorrect. Instead of containing \"Expected "
73 "failure\", it is:\n");
76 Fail(
"A failed assertion threw the wrong type of exception.");
78 Fail(
"A failed assertion should've thrown but didn't.");
#define EXPECT_EQ(val1, val2)
void TestFailureThrowsRuntimeError()
void Fail(const char *msg)
GTEST_API_ void InitGoogleTest(int *argc, char **argv)