?????????????gtest - ?????У? ????????ASSERT_*??е??????????????????????????????????????????ASSERT_*????????return?????????? ASSERT_*??в????????????void???????????????????????????????????????????????????????gtest?????????????????£?
void Func(int a?? int b)
{
throw "b==0";
EXPECT_EQ(0?? a);
printf("End of Func");
}
TEST(FooTest?? Demo1)
{
Func(5?? 0);
printf("End Call Func(5?? 0)");
}
int _tmain(int argc?? _TCHAR* argv[])
{
testing::GTEST_FLAG(catch_exceptions) = 1;
testing::InitGoogleTest(&argc?? argv);
return RUN_ALL_TESTS();
}
????(?????????printf????????????С?)
????????????????????????????????
????1.????catch_exception???????main???????????????????????????
????2.??????????????????????throw????????????ɡ?
???????????????????????????????????????ο????gtest - ???????gtest??
????????????????????????TEST_F???????????????????????TearDown()???????????TearDown???????????????????С?
????????????????????????????????????????У?????TEST??????????????????????????????????????????????????£?EXPECT_*?? ASSERT_*??t????????????г???????????????????????????????????????????????????????????????Func?????е? EXPECT_EQ????