There are the useful EXPECT_DEATH() and family of rules to check your program dies as expected, but is there a negative EXPECT_NO_DEATH() set or similar? As an artificial example:
void should_i_die(bool die)
{
if (die) { printf("Aaargh!"); exit(-1); }
else printf("I'm not dead yet!");
}
EXPECT_DEATH(should_i_die(true), "Aaargh.*");
EXPECT_NO_DEATH(should_i_die(false), ".*"); // What should be here?
Having just a stand-alone:
should_i_die(false);
EXPECT_TRUE(true); // We're not dead if we reach here
Feels like a bit of a cop-out, so is there a better way?