Improves error messages for undefined return value (by Sverre Sundsdal); improves gmock_doctor.

This commit is contained in:
zhanyong.wan
2009-01-27 22:28:45 +00:00
parent 6a896b5ec6
commit 5b95fa7b16
5 changed files with 144 additions and 12 deletions

View File

@@ -987,6 +987,18 @@ TEST(UnexpectedCallTest, UnsatisifiedPrerequisites) {
#endif // GMOCK_HAS_REGEX
#ifdef GTEST_HAS_DEATH_TEST
TEST(UndefinedReturnValueTest, ReturnValueIsMandatory) {
MockA a;
// TODO(wan@google.com): We should really verify the output message,
// but we cannot yet due to that EXPECT_DEATH only captures stderr
// while Google Mock logs to stdout.
EXPECT_DEATH(a.ReturnResult(1), "");
}
#endif // GTEST_HAS_DEATH_TEST
// Tests that an excessive call (one whose arguments match the
// matchers but is called too many times) performs the default action.
TEST(ExcessiveCallTest, DoesDefaultAction) {