44 void Fail(
const char* msg) {
45 printf(
"FAILURE: %s\n", msg);
59 Fail(
"A successful assertion wrongfully threw.");
65 }
catch(
const std::runtime_error& e) {
66 if (strstr(e.what(),
"Expected failure") !=
nullptr)
return;
69 "A failed assertion did throw an exception of the right type, "
70 "but the message is incorrect. Instead of containing \"Expected "
71 "failure\", it is:\n");
74 Fail(
"A failed assertion threw the wrong type of exception.");
76 Fail(
"A failed assertion should've thrown but didn't.");
79 int main(
int argc,
char** argv) {
void TestFailureThrowsRuntimeError()
#define EXPECT_EQ(val1, val2)
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
void Fail(const char *msg)