34 #include "gmock/gmock.h" 35 #include "gtest/gtest.h" 40 using testing::internal::GoogleTestFailureException;
43 class NonDefaultConstructible {
45 explicit NonDefaultConstructible(
int ) {}
52 MOCK_METHOD0(GetNonDefaultConstructible, NonDefaultConstructible());
55 #if GTEST_HAS_EXCEPTIONS 57 TEST(DefaultValueTest, ThrowsRuntimeErrorWhenNoDefaultValue) {
65 mock.GetNonDefaultConstructible();
66 FAIL() <<
"GetNonDefaultConstructible()'s return type has no default " 67 <<
"value, so Google Mock should have thrown.";
68 }
catch (
const GoogleTestFailureException& ) {
69 FAIL() <<
"Google Test does not try to catch an exception of type " 70 <<
"GoogleTestFailureException, which is used for reporting " 71 <<
"a failure to other testing frameworks. Google Mock should " 72 <<
"not throw a GoogleTestFailureException as it will kill the " 73 <<
"entire test program instead of just the current TEST.";
74 }
catch (
const std::exception& ex) {
#define TEST(test_case_name, test_name)
PolymorphicMatcher< internal::HasSubstrMatcher< internal::string > > HasSubstr(const internal::string &substring)
#define EXPECT_THAT(value, matcher)
#define MOCK_METHOD0(m,...)