114 #ifndef GMOCK_TEST_GMOCK_LINK_TEST_H_ 115 #define GMOCK_TEST_GMOCK_LINK_TEST_H_ 117 #include "gmock/gmock.h" 119 #if !GTEST_OS_WINDOWS_MOBILE 124 #include "gtest/gtest.h" 148 using testing::InvokeArgument;
168 using testing::SetArrayArgument;
180 #if !GTEST_OS_WINDOWS_MOBILE 184 #if GTEST_HAS_EXCEPTIONS 185 using testing::Throw;
240 int field()
const {
return field_; }
315 #if !GTEST_OS_WINDOWS_MOBILE 322 int saved_errno = errno;
328 #endif // !GTEST_OS_WINDOWS_MOBILE 427 #if GTEST_HAS_EXCEPTIONS 436 #endif // GTEST_HAS_EXCEPTIONS 444 # pragma warning(push) 445 # pragma warning(disable:4100) 451 ACTION(Return1) {
return 1; }
465 ACTION_P(ReturnArgument, ret_value) {
return ret_value; }
479 ACTION_P2(ReturnEqualsEitherOf, first, second)
481 return arg0 == first || arg0 == second;
486 # pragma warning(pop) 495 .WillOnce(ReturnEqualsEitherOf(
"one",
"two"));
519 const char * p =
"x";
634 char arr[] = {
'a',
'b' };
723 #endif // GMOCK_TEST_GMOCK_LINK_TEST_H_
void VoidFromString(char *)
PolymorphicMatcher< internal::IsNullMatcher > IsNull()
#define ACTION_P2(name, p0, p1)
internal::GtMatcher< Rhs > Gt(Rhs x)
PolymorphicMatcher< internal::MatchesRegexMatcher > MatchesRegex(const internal::RE *regex)
internal::NeMatcher< Rhs > Ne(Rhs x)
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
virtual void VoidFromVector(const std::vector< int > &v)=0
PolymorphicMatcher< internal::NotNullMatcher > NotNull()
PolymorphicMatcher< internal::StartsWithMatcher< internal::string > > StartsWith(const internal::string &prefix)
virtual int IntFromString(char *str)=0
virtual void VoidFromFloat(float n)=0
static void StaticVoidFromVoid()
internal::EqMatcher< T > Eq(T x)
static bool StaticBoolFromString(const char *)
virtual int & IntRefFromString(char *str)=0
PolymorphicMatcher< internal::MatchesRegexMatcher > ContainsRegex(const internal::RE *regex)
internal::WithArgsAction< InnerAction > WithoutArgs(const InnerAction &action)
internal::FloatingEqMatcher< double > NanSensitiveDoubleEq(double rhs)
PolymorphicMatcher< internal::EndsWithMatcher< internal::string > > EndsWith(const internal::string &suffix)
#define EXPECT_TRUE(condition)
PolymorphicMatcher< internal::ContainerEqMatcher< GTEST_REMOVE_CONST_(Container)> > ContainerEq(const Container &rhs)
static void StaticVoidFromString(char *)
#define ON_CALL(obj, call)
PolymorphicAction< internal::InvokeWithoutArgsAction< FunctionImpl > > InvokeWithoutArgs(FunctionImpl function_impl)
internal::ReturnRefAction< R > ReturnRef(R &x)
internal::AllOfResult2< M1, M2 >::type AllOf(M1 m1, M2 m2)
internal::RefMatcher< T & > Ref(T &x)
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrEq(const internal::string &str)
internal::LtMatcher< Rhs > Lt(Rhs x)
internal::FloatingEqMatcher< double > DoubleEq(double rhs)
virtual void VoidFromDouble(double n)=0
internal::LeMatcher< Rhs > Le(Rhs x)
internal::ElementsAreMatcher< std::tr1::tuple<> > ElementsAre()
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrCaseNe(const internal::string &str)
#define EXPECT_THROW(statement, expected_exception)
internal::ElementsAreArrayMatcher< typename::std::iterator_traits< Iter >::value_type > ElementsAreArray(Iter first, Iter last)
PolymorphicAction< internal::SetArgumentPointeeAction< N, T, internal::IsAProtocolMessage< T >::value > > SetArgPointee(const T &x)
PolymorphicMatcher< internal::HasSubstrMatcher< internal::string > > HasSubstr(const internal::string &substring)
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
#define EXPECT_FALSE(condition)
internal::WithArgsAction< InnerAction, k1 > WithArgs(const InnerAction &action)
internal::NotMatcher< InnerMatcher > Not(InnerMatcher m)
internal::AnyOfResult2< M1, M2 >::type AnyOf(M1 m1, M2 m2)
internal::FloatingEqMatcher< float > NanSensitiveFloatEq(float rhs)
internal::PointeeMatcher< InnerMatcher > Pointee(const InnerMatcher &inner_matcher)
PolymorphicMatcher< internal::FieldMatcher< Class, FieldType > > Field(FieldType Class::*field, const FieldMatcher &matcher)
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrNe(const internal::string &str)
PolymorphicMatcher< internal::PropertyMatcher< Class, PropertyType > > Property(PropertyType(Class::*property)() const, const PropertyMatcher &matcher)
PolymorphicAction< internal::ReturnNullAction > ReturnNull()
virtual void VoidFromString(char *str)=0
#define MOCK_METHOD1(m,...)
#define ACTION_P(name, p0)
static int StaticIntFromString(char *)
Matcher< Lhs > TypedEq(const Rhs &rhs)
Matcher< T > MatcherCast(M matcher)
internal::DoDefaultAction DoDefault()
virtual char * StringFromString(char *str)=0
#define EXPECT_CALL(obj, call)
internal::FloatingEqMatcher< float > FloatEq(float rhs)
PolymorphicAction< internal::AssignAction< T1, T2 > > Assign(T1 *ptr, T2 val)
internal::DoBothAction< Action1, Action2 > DoAll(Action1 a1, Action2 a2)
const internal::AnythingMatcher _
virtual void VoidFromIntRef(int &n)=0
internal::IgnoreResultAction< A > IgnoreResult(const A &an_action)
internal::GeMatcher< Rhs > Ge(Rhs x)
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrCaseEq(const internal::string &str)
PolymorphicAction< internal::SetErrnoAndReturnAction< T > > SetErrnoAndReturn(int errval, T result)
virtual void VoidFromFunc(void(*func)(char *str))=0
internal::WithArgsAction< InnerAction, k > WithArg(const InnerAction &action)
internal::ResultOfMatcher< Callable > ResultOf(Callable callable, const ResultOfMatcher &matcher)
PolymorphicMatcher< internal::TrulyMatcher< Predicate > > Truly(Predicate pred)
TEST(LinkTest, TestReturnVoid)
internal::ReturnAction< R > Return(R value)