Implements --gmock_catch_leaked_mocks and Mock::AllowLeak.

This commit is contained in:
zhanyong.wan
2009-04-22 22:25:31 +00:00
parent 1c8eb1c059
commit df35a763b9
17 changed files with 681 additions and 43 deletions

View File

@@ -246,3 +246,10 @@ TEST(WideInitGoogleMockTest, CallsInitGoogleTest) {
TestInitGoogleMock(argv, new_argv, "error");
EXPECT_EQ(old_init_gtest_count + 1, g_init_gtest_count);
}
// Makes sure Google Mock flags can be accessed in code.
TEST(FlagTest, IsAccessibleInCode) {
bool dummy = testing::GMOCK_FLAG(catch_leaked_mocks) &&
testing::GMOCK_FLAG(verbose) == "";
dummy = dummy; // Avoids the "unused local variable" warning.
}