Electroneum
Loading...
Searching...
No Matches
gmock_link_test.h File Reference
#include "gmock/gmock.h"
#include <errno.h>
#include "gmock/internal/gmock-port.h"
#include "gtest/gtest.h"
#include <iostream>
#include <vector>
Include dependency graph for gmock_link_test.h:

Go to the source code of this file.

Classes

class  Interface
class  Mock
class  InvokeHelper
class  FieldHelper
class  Matcher< T >

Functions

 TEST (LinkTest, TestReturnVoid)
 TEST (LinkTest, TestReturn)
 TEST (LinkTest, TestReturnNull)
 TEST (LinkTest, TestReturnRef)
 TEST (LinkTest, TestAssign)
 TEST (LinkTest, TestSetArgPointee)
 TEST (LinkTest, TestSetArrayArgument)
 TEST (LinkTest, TestSetErrnoAndReturn)
 TEST (LinkTest, TestInvoke)
 TEST (LinkTest, TestInvokeWithoutArgs)
 TEST (LinkTest, TestInvokeArgument)
 TEST (LinkTest, TestWithArg)
 TEST (LinkTest, TestWithArgs)
 TEST (LinkTest, TestWithoutArgs)
 TEST (LinkTest, TestDoAll)
 TEST (LinkTest, TestDoDefault)
 TEST (LinkTest, TestIgnoreResult)
 TEST (LinkTest, TestActionMacro)
 TEST (LinkTest, TestActionPMacro)
 TEST (LinkTest, TestActionP2Macro)
 TEST (LinkTest, TestMatcherAnything)
 TEST (LinkTest, TestMatcherA)
 TEST (LinkTest, TestMatchersEq)
 TEST (LinkTest, TestMatchersRelations)
 TEST (LinkTest, TestMatcherNotNull)
 TEST (LinkTest, TestMatcherIsNull)
 TEST (LinkTest, TestMatcherRef)
 TEST (LinkTest, TestMatcherTypedEq)
 TEST (LinkTest, TestMatchersFloatingPoint)
 TEST (LinkTest, TestMatcherContainsRegex)
 TEST (LinkTest, TestMatcherMatchesRegex)
 TEST (LinkTest, TestMatchersSubstrings)
 TEST (LinkTest, TestMatchersStringEquality)
 TEST (LinkTest, TestMatcherElementsAre)
 TEST (LinkTest, TestMatcherElementsAreArray)
 TEST (LinkTest, TestMatcherContainerEq)
 TEST (LinkTest, TestMatcherField)
 TEST (LinkTest, TestMatcherProperty)
 TEST (LinkTest, TestMatcherResultOf)
 TEST (LinkTest, TestMatcherPointee)
 TEST (LinkTest, TestMatcherTruly)
 TEST (LinkTest, TestMatcherAllOf)
 TEST (LinkTest, TestMatcherAnyOf)
 TEST (LinkTest, TestMatcherNot)
 TEST (LinkTest, TestMatcherCast)
template<typename T>
Matcher< TA ()
template<typename M1, typename M2>
internal::AllOfResult2< M1, M2 >::type AllOf (M1 m1, M2 m2)
template<typename M1, typename M2>
internal::AnyOfResult2< M1, M2 >::type AnyOf (M1 m1, M2 m2)
template<typename T1, typename T2>
PolymorphicAction< internal::AssignAction< T1, T2 > > Assign (T1 *ptr, T2 val)
template<typename Container>
PolymorphicMatcher< internal::ContainerEqMatcher< GTEST_REMOVE_CONST_(Container)> > ContainerEq (const Container &rhs)
template<typename Action1, typename Action2>
internal::DoBothAction< Action1, Action2 > DoAll (Action1 a1, Action2 a2)
internal::DoDefaultAction DoDefault ()
internal::FloatingEqMatcher< double > DoubleEq (double rhs)
internal::ElementsAreMatcher< ::testing::tuple<> > ElementsAre ()
template<typename Iter>
internal::ElementsAreArrayMatcher< typename ::std::iterator_traits< Iter >::value_type > ElementsAreArray (Iter first, Iter last)
PolymorphicMatcher< internal::EndsWithMatcher< internal::string > > EndsWith (const internal::string &suffix)
template<typename T>
internal::EqMatcher< TEq (T x)
template<typename Class, typename FieldType, typename FieldMatcher>
PolymorphicMatcher< internal::FieldMatcher< Class, FieldType > > Field (FieldType Class::*field, const FieldMatcher &matcher)
internal::FloatingEqMatcher< float > FloatEq (float rhs)
template<typename Rhs>
internal::GeMatcher< Rhs > Ge (Rhs x)
template<typename Rhs>
internal::GtMatcher< Rhs > Gt (Rhs x)
PolymorphicMatcher< internal::HasSubstrMatcher< internal::string > > HasSubstr (const internal::string &substring)
template<typename A>
internal::IgnoreResultAction< AIgnoreResult (const A &an_action)
template<typename FunctionImpl>
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke (FunctionImpl function_impl)
template<typename FunctionImpl>
PolymorphicAction< internal::InvokeWithoutArgsAction< FunctionImpl > > InvokeWithoutArgs (FunctionImpl function_impl)
PolymorphicMatcher< internal::IsNullMatcher > IsNull ()
template<typename Rhs>
internal::LeMatcher< Rhs > Le (Rhs x)
template<typename Rhs>
internal::LtMatcher< Rhs > Lt (Rhs x)
template<typename T, typename M>
Matcher< TMatcherCast (const M &matcher)
internal::FloatingEqMatcher< double > NanSensitiveDoubleEq (double rhs)
internal::FloatingEqMatcher< float > NanSensitiveFloatEq (float rhs)
template<typename Rhs>
internal::NeMatcher< Rhs > Ne (Rhs x)
template<typename InnerMatcher>
internal::NotMatcher< InnerMatcher > Not (InnerMatcher m)
PolymorphicMatcher< internal::NotNullMatcher > NotNull ()
template<typename T>
internal::RefMatcher< T & > Ref (T &x)
template<typename Callable, typename ResultOfMatcher>
internal::ResultOfMatcher< Callable > ResultOf (Callable callable, const ResultOfMatcher &matcher)
template<typename R>
internal::ReturnAction< R > Return (R value)
PolymorphicAction< internal::ReturnNullAction > ReturnNull ()
template<typename R>
internal::ReturnRefAction< R > ReturnRef (R &x)
template<size_t N, typename T>
PolymorphicAction< internal::SetArgumentPointeeAction< N, T, internal::IsAProtocolMessage< T >::value > > SetArgPointee (const T &x)
PolymorphicMatcher< internal::StartsWithMatcher< internal::string > > StartsWith (const internal::string &prefix)
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrCaseEq (const internal::string &str)
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrCaseNe (const internal::string &str)
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrEq (const internal::string &str)
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrNe (const internal::string &str)
template<typename Predicate>
PolymorphicMatcher< internal::TrulyMatcher< Predicate > > Truly (Predicate pred)
template<typename Lhs, typename Rhs>
Matcher< Lhs > TypedEq (const Rhs &rhs)
template<int k, typename InnerAction>
internal::WithArgsAction< InnerAction, k > WithArg (const InnerAction &action)
template<int k1, typename InnerAction>
internal::WithArgsAction< InnerAction, k1 > WithArgs (const InnerAction &action)
template<typename InnerAction>
internal::WithArgsAction< InnerAction > WithoutArgs (const InnerAction &action)
template<typename T>
PolymorphicAction< internal::SetErrnoAndReturnAction< T > > SetErrnoAndReturn (int errval, T result)
PolymorphicMatcher< internal::MatchesRegexMatcher > ContainsRegex (const internal::RE *regex)
PolymorphicMatcher< internal::MatchesRegexMatcher > MatchesRegex (const internal::RE *regex)

Variables

const internal::AnythingMatcher _

Function Documentation

◆ A()

template<typename T>
Matcher< T > testing::A ( )
inline

Definition at line 3732 of file gmock-matchers.h.

3732{ return MakeMatcher(new internal::AnyMatcherImpl<T>()); }
Matcher< T > MakeMatcher(const MatcherInterface< T > *impl)
Here is the caller graph for this function:

◆ AllOf()

template<typename M1, typename M2>
internal::AllOfResult2< M1, M2 >::type testing::AllOf ( M1 m1,
M2 m2 )
inline

Definition at line 1002 of file gmock-generated-matchers.h.

1002 {
1003 return typename internal::AllOfResult2<M1, M2>::type(
1004 m1,
1005 m2);
1006}
Here is the caller graph for this function:

◆ AnyOf()

template<typename M1, typename M2>
internal::AnyOfResult2< M1, M2 >::type testing::AnyOf ( M1 m1,
M2 m2 )
inline

Definition at line 1085 of file gmock-generated-matchers.h.

1085 {
1086 return typename internal::AnyOfResult2<M1, M2>::type(
1087 m1,
1088 m2);
1089}
Here is the caller graph for this function:

◆ Assign()

template<typename T1, typename T2>
PolymorphicAction< internal::AssignAction< T1, T2 > > testing::Assign ( T1 * ptr,
T2 val )

Definition at line 1147 of file gmock-actions.h.

1147 {
1148 return MakePolymorphicAction(internal::AssignAction<T1, T2>(ptr, val));
1149}
PolymorphicAction< Impl > MakePolymorphicAction(const Impl &impl)
Here is the caller graph for this function:

◆ ContainerEq()

template<typename Container>
PolymorphicMatcher< internal::ContainerEqMatcher< GTEST_REMOVE_CONST_(Container)> > testing::ContainerEq ( const Container & rhs)
inline

Definition at line 4150 of file gmock-matchers.h.

4150 {
4151 // This following line is for working around a bug in MSVC 8.0,
4152 // which causes Container to be a const type sometimes.
4153 typedef GTEST_REMOVE_CONST_(Container) RawContainer;
4155 internal::ContainerEqMatcher<RawContainer>(rhs));
4156}
#define GTEST_REMOVE_CONST_(T)
PolymorphicMatcher< Impl > MakePolymorphicMatcher(const Impl &impl)
Here is the caller graph for this function:

◆ ContainsRegex()

PolymorphicMatcher< internal::MatchesRegexMatcher > testing::ContainsRegex ( const internal::RE * regex)
inline

Definition at line 4016 of file gmock-matchers.h.

4017 {
4018 return MakePolymorphicMatcher(internal::MatchesRegexMatcher(regex, false));
4019}
Here is the caller graph for this function:

◆ DoAll()

template<typename Action1, typename Action2>
internal::DoBothAction< Action1, Action2 > testing::DoAll ( Action1 a1,
Action2 a2 )
inline

Definition at line 696 of file gmock-generated-actions.h.

696 {
697 return internal::DoBothAction<Action1, Action2>(a1, a2);
698}
Here is the caller graph for this function:

◆ DoDefault()

internal::DoDefaultAction testing::DoDefault ( )
inline

Definition at line 1099 of file gmock-actions.h.

1099 {
1100 return internal::DoDefaultAction();
1101}
Here is the caller graph for this function:

◆ DoubleEq()

internal::FloatingEqMatcher< double > testing::DoubleEq ( double rhs)
inline

Definition at line 3815 of file gmock-matchers.h.

3815 {
3816 return internal::FloatingEqMatcher<double>(rhs, false);
3817}
Here is the caller graph for this function:

◆ ElementsAre()

internal::ElementsAreMatcher< ::testing::tuple<> > testing::ElementsAre ( )
inline

Definition at line 570 of file gmock-generated-matchers.h.

570 {
571 typedef ::testing::tuple<> Args;
572 return internal::ElementsAreMatcher<Args>(Args());
573}
internal::ArgsMatcher< InnerMatcher > Args(const InnerMatcher &matcher)
Here is the caller graph for this function:

◆ ElementsAreArray()

template<typename Iter>
internal::ElementsAreArrayMatcher< typename ::std::iterator_traits< Iter >::value_type > testing::ElementsAreArray ( Iter first,
Iter last )
inline

Definition at line 3646 of file gmock-matchers.h.

3646 {
3647 typedef typename ::std::iterator_traits<Iter>::value_type T;
3648 return internal::ElementsAreArrayMatcher<T>(first, last);
3649}
#define T(x)
Here is the caller graph for this function:

◆ EndsWith()

PolymorphicMatcher< internal::EndsWithMatcher< internal::string > > testing::EndsWith ( const internal::string & suffix)
inline

Definition at line 3998 of file gmock-matchers.h.

3998 {
3999 return MakePolymorphicMatcher(internal::EndsWithMatcher<internal::string>(
4000 suffix));
4001}
Here is the caller graph for this function:

◆ Eq()

template<typename T>
internal::EqMatcher< T > testing::Eq ( T x)
inline

Definition at line 3742 of file gmock-matchers.h.

3742{ return internal::EqMatcher<T>(x); }
Here is the caller graph for this function:

◆ Field()

template<typename Class, typename FieldType, typename FieldMatcher>
PolymorphicMatcher< internal::FieldMatcher< Class, FieldType > > testing::Field ( FieldType Class::* field,
const FieldMatcher & matcher )
inline

Definition at line 3896 of file gmock-matchers.h.

3897 {
3899 internal::FieldMatcher<Class, FieldType>(
3900 field, MatcherCast<const FieldType&>(matcher)));
3901 // The call to MatcherCast() is required for supporting inner
3902 // matchers of compatible types. For example, it allows
3903 // Field(&Foo::bar, m)
3904 // to compile where bar is an int32 and m is a matcher for int64.
3905}
Here is the caller graph for this function:

◆ FloatEq()

internal::FloatingEqMatcher< float > testing::FloatEq ( float rhs)
inline

Definition at line 3843 of file gmock-matchers.h.

3843 {
3844 return internal::FloatingEqMatcher<float>(rhs, false);
3845}
Here is the caller graph for this function:

◆ Ge()

template<typename Rhs>
internal::GeMatcher< Rhs > testing::Ge ( Rhs x)
inline

Definition at line 3766 of file gmock-matchers.h.

3766 {
3767 return internal::GeMatcher<Rhs>(x);
3768}
Here is the caller graph for this function:

◆ Gt()

template<typename Rhs>
internal::GtMatcher< Rhs > testing::Gt ( Rhs x)
inline

Definition at line 3772 of file gmock-matchers.h.

3772 {
3773 return internal::GtMatcher<Rhs>(x);
3774}
Here is the caller graph for this function:

◆ HasSubstr()

PolymorphicMatcher< internal::HasSubstrMatcher< internal::string > > testing::HasSubstr ( const internal::string & substring)
inline

Definition at line 3984 of file gmock-matchers.h.

3984 {
3985 return MakePolymorphicMatcher(internal::HasSubstrMatcher<internal::string>(
3986 substring));
3987}
Here is the caller graph for this function:

◆ IgnoreResult()

template<typename A>
internal::IgnoreResultAction< A > testing::IgnoreResult ( const A & an_action)
inline

Definition at line 1187 of file gmock-actions.h.

1187 {
1188 return internal::IgnoreResultAction<A>(an_action);
1189}
Here is the caller graph for this function:

◆ Invoke()

template<typename FunctionImpl>
PolymorphicAction< internal::InvokeAction< FunctionImpl > > testing::Invoke ( FunctionImpl function_impl)

Definition at line 114 of file gmock-more-actions.h.

115 {
117 internal::InvokeAction<FunctionImpl>(function_impl));
118}
Here is the caller graph for this function:

◆ InvokeWithoutArgs()

template<typename FunctionImpl>
PolymorphicAction< internal::InvokeWithoutArgsAction< FunctionImpl > > testing::InvokeWithoutArgs ( FunctionImpl function_impl)

Definition at line 1168 of file gmock-actions.h.

1168 {
1169 return MakePolymorphicAction(
1170 internal::InvokeWithoutArgsAction<FunctionImpl>(function_impl));
1171}
Here is the caller graph for this function:

◆ IsNull()

PolymorphicMatcher< internal::IsNullMatcher > testing::IsNull ( )
inline

Definition at line 3795 of file gmock-matchers.h.

3795 {
3796 return MakePolymorphicMatcher(internal::IsNullMatcher());
3797}
Here is the caller graph for this function:

◆ Le()

template<typename Rhs>
internal::LeMatcher< Rhs > testing::Le ( Rhs x)
inline

Definition at line 3778 of file gmock-matchers.h.

3778 {
3779 return internal::LeMatcher<Rhs>(x);
3780}
Here is the caller graph for this function:

◆ Lt()

template<typename Rhs>
internal::LtMatcher< Rhs > testing::Lt ( Rhs x)
inline

Definition at line 3784 of file gmock-matchers.h.

3784 {
3785 return internal::LtMatcher<Rhs>(x);
3786}
Here is the caller graph for this function:

◆ MatcherCast()

template<typename T, typename M>
Matcher< T > testing::MatcherCast ( const M & matcher)
inline

Definition at line 610 of file gmock-matchers.h.

610 {
611 return internal::MatcherCastImpl<T, M>::Cast(matcher);
612}
Here is the caller graph for this function:

◆ MatchesRegex()

PolymorphicMatcher< internal::MatchesRegexMatcher > testing::MatchesRegex ( const internal::RE * regex)
inline

Definition at line 4005 of file gmock-matchers.h.

4006 {
4007 return MakePolymorphicMatcher(internal::MatchesRegexMatcher(regex, true));
4008}
Here is the caller graph for this function:

◆ NanSensitiveDoubleEq()

internal::FloatingEqMatcher< double > testing::NanSensitiveDoubleEq ( double rhs)
inline

Definition at line 3821 of file gmock-matchers.h.

3821 {
3822 return internal::FloatingEqMatcher<double>(rhs, true);
3823}
Here is the caller graph for this function:

◆ NanSensitiveFloatEq()

internal::FloatingEqMatcher< float > testing::NanSensitiveFloatEq ( float rhs)
inline

Definition at line 3849 of file gmock-matchers.h.

3849 {
3850 return internal::FloatingEqMatcher<float>(rhs, true);
3851}
Here is the caller graph for this function:

◆ Ne()

template<typename Rhs>
internal::NeMatcher< Rhs > testing::Ne ( Rhs x)
inline

Definition at line 3790 of file gmock-matchers.h.

3790 {
3791 return internal::NeMatcher<Rhs>(x);
3792}
Here is the caller graph for this function:

◆ Not()

template<typename InnerMatcher>
internal::NotMatcher< InnerMatcher > testing::Not ( InnerMatcher m)
inline

Definition at line 4107 of file gmock-matchers.h.

4107 {
4108 return internal::NotMatcher<InnerMatcher>(m);
4109}
Here is the caller graph for this function:

◆ NotNull()

PolymorphicMatcher< internal::NotNullMatcher > testing::NotNull ( )
inline

Definition at line 3802 of file gmock-matchers.h.

3802 {
3803 return MakePolymorphicMatcher(internal::NotNullMatcher());
3804}
Here is the caller graph for this function:

◆ Ref()

template<typename T>
internal::RefMatcher< T & > testing::Ref ( T & x)
inline

Definition at line 3809 of file gmock-matchers.h.

3809 { // NOLINT
3810 return internal::RefMatcher<T&>(x);
3811}
Here is the caller graph for this function:

◆ ResultOf()

template<typename Callable, typename ResultOfMatcher>
internal::ResultOfMatcher< Callable > testing::ResultOf ( Callable callable,
const ResultOfMatcher & matcher )

Definition at line 3939 of file gmock-matchers.h.

3940 {
3941 return internal::ResultOfMatcher<Callable>(
3942 callable,
3943 MatcherCast<typename internal::CallableTraits<Callable>::ResultType>(
3944 matcher));
3945 // The call to MatcherCast() is required for supporting inner
3946 // matchers of compatible types. For example, it allows
3947 // ResultOf(Function, m)
3948 // to compile where Function() returns an int32 and m is a matcher for int64.
3949}
Here is the caller graph for this function:

◆ Return()

template<typename R>
internal::ReturnAction< R > testing::Return ( R value)

Definition at line 1061 of file gmock-actions.h.

1061 {
1062 return internal::ReturnAction<R>(internal::move(value));
1063}
const GenericPointer< typename T::ValueType > T2 value
Definition pointer.h:1225
Here is the caller graph for this function:

◆ ReturnNull()

PolymorphicAction< internal::ReturnNullAction > testing::ReturnNull ( )
inline

Definition at line 1066 of file gmock-actions.h.

1066 {
1067 return MakePolymorphicAction(internal::ReturnNullAction());
1068}

◆ ReturnRef()

template<typename R>
internal::ReturnRefAction< R > testing::ReturnRef ( R & x)
inline

Definition at line 1077 of file gmock-actions.h.

1077 { // NOLINT
1078 return internal::ReturnRefAction<R>(x);
1079}
Here is the caller graph for this function:

◆ SetArgPointee()

template<size_t N, typename T>
PolymorphicAction< internal::SetArgumentPointeeAction< N, T, internal::IsAProtocolMessage< T >::value > > testing::SetArgPointee ( const T & x)

Definition at line 1109 of file gmock-actions.h.

1109 {
1110 return MakePolymorphicAction(internal::SetArgumentPointeeAction<
1111 N, T, internal::IsAProtocolMessage<T>::value>(x));
1112}
Here is the caller graph for this function:

◆ SetErrnoAndReturn()

template<typename T>
PolymorphicAction< internal::SetErrnoAndReturnAction< T > > testing::SetErrnoAndReturn ( int errval,
T result )

Definition at line 1156 of file gmock-actions.h.

1156 {
1157 return MakePolymorphicAction(
1158 internal::SetErrnoAndReturnAction<T>(errval, result));
1159}
Here is the caller graph for this function:

◆ StartsWith()

PolymorphicMatcher< internal::StartsWithMatcher< internal::string > > testing::StartsWith ( const internal::string & prefix)
inline

Definition at line 3991 of file gmock-matchers.h.

3991 {
3992 return MakePolymorphicMatcher(internal::StartsWithMatcher<internal::string>(
3993 prefix));
3994}
Here is the caller graph for this function:

◆ StrCaseEq()

PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > testing::StrCaseEq ( const internal::string & str)
inline

Definition at line 3969 of file gmock-matchers.h.

3969 {
3970 return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::string>(
3971 str, true, false));
3972}
Here is the caller graph for this function:

◆ StrCaseNe()

PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > testing::StrCaseNe ( const internal::string & str)
inline

Definition at line 3976 of file gmock-matchers.h.

3976 {
3977 return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::string>(
3978 str, false, false));
3979}
Here is the caller graph for this function:

◆ StrEq()

PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > testing::StrEq ( const internal::string & str)
inline

Definition at line 3955 of file gmock-matchers.h.

3955 {
3956 return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::string>(
3957 str, true, true));
3958}
Here is the caller graph for this function:

◆ StrNe()

PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > testing::StrNe ( const internal::string & str)
inline

Definition at line 3962 of file gmock-matchers.h.

3962 {
3963 return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::string>(
3964 str, false, true));
3965}
Here is the caller graph for this function:

◆ TEST() [1/45]

TEST ( LinkTest ,
TestActionMacro  )

Definition at line 431 of file gmock_link_test.h.

431 {
432 Mock mock;
433
434 EXPECT_CALL(mock, IntFromString(_)).WillOnce(Return1());
435 mock.IntFromString(NULL);
436}
virtual int IntFromString(char *str)=0
#define EXPECT_CALL(obj, call)
Here is the call graph for this function:

◆ TEST() [2/45]

TEST ( LinkTest ,
TestActionP2Macro  )

Definition at line 461 of file gmock_link_test.h.

461 {
462 Mock mock;
463 char ch = 'x';
464
465 EXPECT_CALL(mock, IntFromString(_))
466 .WillOnce(ReturnEqualsEitherOf("one", "two"));
467 mock.IntFromString(&ch);
468}
Here is the call graph for this function:

◆ TEST() [3/45]

TEST ( LinkTest ,
TestActionPMacro  )

Definition at line 443 of file gmock_link_test.h.

443 {
444 Mock mock;
445
446 EXPECT_CALL(mock, IntFromString(_)).WillOnce(ReturnArgument(42));
447 mock.IntFromString(NULL);
448}
Here is the call graph for this function:

◆ TEST() [4/45]

TEST ( LinkTest ,
TestAssign  )

Definition at line 276 of file gmock_link_test.h.

276 {
277 Mock mock;
278 char ch = 'x';
279
280 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Assign(&ch, 'y'));
281 mock.VoidFromString(NULL);
282}
virtual void VoidFromString(char *str)=0
Here is the call graph for this function:

◆ TEST() [5/45]

TEST ( LinkTest ,
TestDoAll  )

Definition at line 379 of file gmock_link_test.h.

379 {
380 Mock mock;
381 char ch = 'x';
382
383 EXPECT_CALL(mock, VoidFromString(_))
384 .WillOnce(DoAll(SetArgPointee<0>('y'), Return()));
385 mock.VoidFromString(&ch);
386}
Here is the call graph for this function:

◆ TEST() [6/45]

TEST ( LinkTest ,
TestDoDefault  )

Definition at line 389 of file gmock_link_test.h.

389 {
390 Mock mock;
391 char ch = 'x';
392
393 ON_CALL(mock, VoidFromString(_)).WillByDefault(Return());
394 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(DoDefault());
395 mock.VoidFromString(&ch);
396}
#define ON_CALL(obj, call)
Here is the call graph for this function:

◆ TEST() [7/45]

TEST ( LinkTest ,
TestIgnoreResult  )

Definition at line 399 of file gmock_link_test.h.

399 {
400 Mock mock;
401
402 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(IgnoreResult(Return(42)));
403 mock.VoidFromString(NULL);
404}
Here is the call graph for this function:

◆ TEST() [8/45]

TEST ( LinkTest ,
TestInvoke  )

Definition at line 319 of file gmock_link_test.h.

319 {
320 Mock mock;
321 InvokeHelper test_invoke_helper;
322
323 EXPECT_CALL(mock, VoidFromString(_))
325 .WillOnce(Invoke(&test_invoke_helper, &InvokeHelper::VoidFromString));
326 mock.VoidFromString(NULL);
327 mock.VoidFromString(NULL);
328}
static void StaticVoidFromString(char *)
void VoidFromString(char *)
Here is the call graph for this function:

◆ TEST() [9/45]

TEST ( LinkTest ,
TestInvokeArgument  )

Definition at line 344 of file gmock_link_test.h.

344 {
345 Mock mock;
346 char ch = 'x';
347
348 EXPECT_CALL(mock, VoidFromFunc(_)).WillOnce(InvokeArgument<0>(&ch));
350}
virtual void VoidFromFunc(void(*func)(char *str))=0
Here is the call graph for this function:

◆ TEST() [10/45]

TEST ( LinkTest ,
TestInvokeWithoutArgs  )

Definition at line 331 of file gmock_link_test.h.

331 {
332 Mock mock;
333 InvokeHelper test_invoke_helper;
334
335 EXPECT_CALL(mock, VoidFromString(_))
337 .WillOnce(InvokeWithoutArgs(&test_invoke_helper,
339 mock.VoidFromString(NULL);
340 mock.VoidFromString(NULL);
341}
static void StaticVoidFromVoid()
Here is the call graph for this function:

◆ TEST() [11/45]

TEST ( LinkTest ,
TestMatcherA  )

Definition at line 478 of file gmock_link_test.h.

478 {
479 Mock mock;
480
481 ON_CALL(mock, VoidFromString(A<char*>())).WillByDefault(Return());
482}
Here is the call graph for this function:

◆ TEST() [12/45]

TEST ( LinkTest ,
TestMatcherAllOf  )

Definition at line 646 of file gmock_link_test.h.

646 {
647 Matcher<int> m = AllOf(_, Eq(1));
648 EXPECT_TRUE(m.Matches(1));
649}
#define EXPECT_TRUE(condition)
Definition gtest.h:1859
Here is the call graph for this function:

◆ TEST() [13/45]

TEST ( LinkTest ,
TestMatcherAnyOf  )

Definition at line 652 of file gmock_link_test.h.

652 {
653 Matcher<int> m = AnyOf(_, Eq(1));
654 EXPECT_TRUE(m.Matches(1));
655}
Here is the call graph for this function:

◆ TEST() [14/45]

TEST ( LinkTest ,
TestMatcherAnything  )

Definition at line 471 of file gmock_link_test.h.

471 {
472 Mock mock;
473
474 ON_CALL(mock, VoidFromString(_)).WillByDefault(Return());
475}
Here is the call graph for this function:

◆ TEST() [15/45]

TEST ( LinkTest ,
TestMatcherCast  )

Definition at line 664 of file gmock_link_test.h.

Here is the call graph for this function:

◆ TEST() [16/45]

TEST ( LinkTest ,
TestMatcherContainerEq  )

Definition at line 596 of file gmock_link_test.h.

596 {
597 Mock mock;
598 std::vector<int> v;
599
600 ON_CALL(mock, VoidFromVector(ContainerEq(v))).WillByDefault(Return());
601}
Here is the call graph for this function:

◆ TEST() [17/45]

TEST ( LinkTest ,
TestMatcherContainsRegex  )

Definition at line 549 of file gmock_link_test.h.

549 {
550 Mock mock;
551
552 ON_CALL(mock, VoidFromString(ContainsRegex(".*"))).WillByDefault(Return());
553}
Here is the call graph for this function:

◆ TEST() [18/45]

TEST ( LinkTest ,
TestMatcherElementsAre  )

Definition at line 581 of file gmock_link_test.h.

581 {
582 Mock mock;
583
584 ON_CALL(mock, VoidFromVector(ElementsAre('a', _))).WillByDefault(Return());
585}
Here is the call graph for this function:

◆ TEST() [19/45]

TEST ( LinkTest ,
TestMatcherElementsAreArray  )

Definition at line 588 of file gmock_link_test.h.

588 {
589 Mock mock;
590 char arr[] = { 'a', 'b' };
591
592 ON_CALL(mock, VoidFromVector(ElementsAreArray(arr))).WillByDefault(Return());
593}
Here is the call graph for this function:

◆ TEST() [20/45]

TEST ( LinkTest ,
TestMatcherField  )

Definition at line 604 of file gmock_link_test.h.

604 {
605 FieldHelper helper(0);
606
608 EXPECT_TRUE(m.Matches(helper));
609
611 EXPECT_TRUE(m2.Matches(&helper));
612}
Here is the call graph for this function:

◆ TEST() [21/45]

TEST ( LinkTest ,
TestMatcherIsNull  )

Definition at line 513 of file gmock_link_test.h.

513 {
514 Mock mock;
515
516 ON_CALL(mock, VoidFromString(IsNull())).WillByDefault(Return());
517}
Here is the call graph for this function:

◆ TEST() [22/45]

TEST ( LinkTest ,
TestMatcherMatchesRegex  )

Definition at line 556 of file gmock_link_test.h.

556 {
557 Mock mock;
558
559 ON_CALL(mock, VoidFromString(MatchesRegex(".*"))).WillByDefault(Return());
560}
Here is the call graph for this function:

◆ TEST() [23/45]

TEST ( LinkTest ,
TestMatcherNot  )

Definition at line 658 of file gmock_link_test.h.

658 {
659 Matcher<int> m = Not(_);
660 EXPECT_FALSE(m.Matches(1));
661}
#define EXPECT_FALSE(condition)
Definition gtest.h:1862
Here is the call graph for this function:

◆ TEST() [24/45]

TEST ( LinkTest ,
TestMatcherNotNull  )

Definition at line 506 of file gmock_link_test.h.

506 {
507 Mock mock;
508
509 ON_CALL(mock, VoidFromString(NotNull())).WillByDefault(Return());
510}
Here is the call graph for this function:

◆ TEST() [25/45]

TEST ( LinkTest ,
TestMatcherPointee  )

Definition at line 632 of file gmock_link_test.h.

632 {
633 int n = 1;
634
635 Matcher<int*> m = Pointee(Eq(1));
636 EXPECT_TRUE(m.Matches(&n));
637}
internal::PointeeMatcher< InnerMatcher > Pointee(const InnerMatcher &inner_matcher)
Here is the call graph for this function:

◆ TEST() [26/45]

TEST ( LinkTest ,
TestMatcherProperty  )

Definition at line 615 of file gmock_link_test.h.

615 {
616 FieldHelper helper(0);
617
619 EXPECT_TRUE(m.Matches(helper));
620
622 EXPECT_TRUE(m2.Matches(&helper));
623}
int field() const
PolymorphicMatcher< internal::PropertyMatcher< Class, PropertyType > > Property(PropertyType(Class::*property)() const, const PropertyMatcher &matcher)
Here is the call graph for this function:

◆ TEST() [27/45]

TEST ( LinkTest ,
TestMatcherRef  )

Definition at line 520 of file gmock_link_test.h.

520 {
521 Mock mock;
522 int a = 0;
523
524 ON_CALL(mock, VoidFromIntRef(Ref(a))).WillByDefault(Return());
525}
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1124
Here is the call graph for this function:

◆ TEST() [28/45]

TEST ( LinkTest ,
TestMatcherResultOf  )

Definition at line 626 of file gmock_link_test.h.

626 {
628 EXPECT_TRUE(m.Matches(NULL));
629}
static int StaticIntFromString(char *)
Here is the call graph for this function:

◆ TEST() [29/45]

TEST ( LinkTest ,
TestMatchersEq  )

Definition at line 485 of file gmock_link_test.h.

485 {
486 Mock mock;
487 const char* p = "x";
488
489 ON_CALL(mock, VoidFromString(Eq(p))).WillByDefault(Return());
490 ON_CALL(mock, VoidFromString(const_cast<char*>("y")))
491 .WillByDefault(Return());
492}
Here is the call graph for this function:

◆ TEST() [30/45]

TEST ( LinkTest ,
TestMatchersFloatingPoint  )

Definition at line 537 of file gmock_link_test.h.

537 {
538 Mock mock;
539 float a = 0;
540
541 ON_CALL(mock, VoidFromFloat(FloatEq(a))).WillByDefault(Return());
542 ON_CALL(mock, VoidFromDouble(DoubleEq(a))).WillByDefault(Return());
543 ON_CALL(mock, VoidFromFloat(NanSensitiveFloatEq(a))).WillByDefault(Return());
544 ON_CALL(mock, VoidFromDouble(NanSensitiveDoubleEq(a)))
545 .WillByDefault(Return());
546}
Here is the call graph for this function:

◆ TEST() [31/45]

TEST ( LinkTest ,
TestMatchersRelations  )

Definition at line 495 of file gmock_link_test.h.

495 {
496 Mock mock;
497
498 ON_CALL(mock, VoidFromFloat(Lt(1.0f))).WillByDefault(Return());
499 ON_CALL(mock, VoidFromFloat(Gt(1.0f))).WillByDefault(Return());
500 ON_CALL(mock, VoidFromFloat(Le(1.0f))).WillByDefault(Return());
501 ON_CALL(mock, VoidFromFloat(Ge(1.0f))).WillByDefault(Return());
502 ON_CALL(mock, VoidFromFloat(Ne(1.0f))).WillByDefault(Return());
503}
Here is the call graph for this function:

◆ TEST() [32/45]

TEST ( LinkTest ,
TestMatchersStringEquality  )

Definition at line 572 of file gmock_link_test.h.

572 {
573 Mock mock;
574 ON_CALL(mock, VoidFromString(StrEq("a"))).WillByDefault(Return());
575 ON_CALL(mock, VoidFromString(StrNe("a"))).WillByDefault(Return());
576 ON_CALL(mock, VoidFromString(StrCaseEq("a"))).WillByDefault(Return());
577 ON_CALL(mock, VoidFromString(StrCaseNe("a"))).WillByDefault(Return());
578}
Here is the call graph for this function:

◆ TEST() [33/45]

TEST ( LinkTest ,
TestMatchersSubstrings  )

Definition at line 563 of file gmock_link_test.h.

563 {
564 Mock mock;
565
566 ON_CALL(mock, VoidFromString(StartsWith("a"))).WillByDefault(Return());
567 ON_CALL(mock, VoidFromString(EndsWith("c"))).WillByDefault(Return());
568 ON_CALL(mock, VoidFromString(HasSubstr("b"))).WillByDefault(Return());
569}
Here is the call graph for this function:

◆ TEST() [34/45]

TEST ( LinkTest ,
TestMatcherTruly  )

Definition at line 640 of file gmock_link_test.h.

640 {
642 EXPECT_TRUE(m.Matches(NULL));
643}
static bool StaticBoolFromString(const char *)
Here is the call graph for this function:

◆ TEST() [35/45]

TEST ( LinkTest ,
TestMatcherTypedEq  )

Definition at line 528 of file gmock_link_test.h.

528 {
529 Mock mock;
530 long a = 0;
531
532 ON_CALL(mock, VoidFromIntRef(TypedEq<int&>(a))).WillByDefault(Return());
533}
Here is the call graph for this function:

◆ TEST() [36/45]

TEST ( LinkTest ,
TestReturn  )

Definition at line 250 of file gmock_link_test.h.

250 {
251 Mock mock;
252 char ch = 'x';
253
254 EXPECT_CALL(mock, StringFromString(_)).WillOnce(Return(&ch));
255 mock.StringFromString(NULL);
256}
virtual char * StringFromString(char *str)=0
Here is the call graph for this function:

◆ TEST() [37/45]

TEST ( LinkTest ,
TestReturnNull  )

Definition at line 259 of file gmock_link_test.h.

259 {
260 Mock mock;
261
262 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Return());
263 mock.VoidFromString(NULL);
264}
Here is the call graph for this function:

◆ TEST() [38/45]

TEST ( LinkTest ,
TestReturnRef  )

Definition at line 267 of file gmock_link_test.h.

267 {
268 Mock mock;
269 int n = 42;
270
271 EXPECT_CALL(mock, IntRefFromString(_)).WillOnce(ReturnRef(n));
272 mock.IntRefFromString(NULL);
273}
virtual int & IntRefFromString(char *str)=0
Here is the call graph for this function:

◆ TEST() [39/45]

TEST ( LinkTest ,
TestReturnVoid  )

Definition at line 242 of file gmock_link_test.h.

242 {
243 Mock mock;
244
245 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Return());
246 mock.VoidFromString(NULL);
247}
Here is the call graph for this function:

◆ TEST() [40/45]

TEST ( LinkTest ,
TestSetArgPointee  )

Definition at line 285 of file gmock_link_test.h.

285 {
286 Mock mock;
287 char ch = 'x';
288
289 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(SetArgPointee<0>('y'));
290 mock.VoidFromString(&ch);
291}
Here is the call graph for this function:

◆ TEST() [41/45]

TEST ( LinkTest ,
TestSetArrayArgument  )

Definition at line 294 of file gmock_link_test.h.

294 {
295 Mock mock;
296 char ch = 'x';
297 char ch2 = 'y';
298
299 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(SetArrayArgument<0>(&ch2,
300 &ch2 + 1));
301 mock.VoidFromString(&ch);
302}
Here is the call graph for this function:

◆ TEST() [42/45]

TEST ( LinkTest ,
TestSetErrnoAndReturn  )

Definition at line 307 of file gmock_link_test.h.

307 {
308 Mock mock;
309
310 int saved_errno = errno;
311 EXPECT_CALL(mock, IntFromString(_)).WillOnce(SetErrnoAndReturn(1, -1));
312 mock.IntFromString(NULL);
313 errno = saved_errno;
314}
Here is the call graph for this function:

◆ TEST() [43/45]

TEST ( LinkTest ,
TestWithArg  )

Definition at line 353 of file gmock_link_test.h.

353 {
354 Mock mock;
355
356 EXPECT_CALL(mock, VoidFromString(_))
358 mock.VoidFromString(NULL);
359}
Here is the call graph for this function:

◆ TEST() [44/45]

TEST ( LinkTest ,
TestWithArgs  )

Definition at line 362 of file gmock_link_test.h.

362 {
363 Mock mock;
364
365 EXPECT_CALL(mock, VoidFromString(_))
367 mock.VoidFromString(NULL);
368}
Here is the call graph for this function:

◆ TEST() [45/45]

TEST ( LinkTest ,
TestWithoutArgs  )

Definition at line 371 of file gmock_link_test.h.

371 {
372 Mock mock;
373
374 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(WithoutArgs(Return()));
375 mock.VoidFromString(NULL);
376}
Here is the call graph for this function:

◆ Truly()

template<typename Predicate>
PolymorphicMatcher< internal::TrulyMatcher< Predicate > > testing::Truly ( Predicate pred)
inline

Definition at line 4116 of file gmock-matchers.h.

4116 {
4117 return MakePolymorphicMatcher(internal::TrulyMatcher<Predicate>(pred));
4118}
Here is the caller graph for this function:

◆ TypedEq()

template<typename Lhs, typename Rhs>
Matcher< Lhs > testing::TypedEq ( const Rhs & rhs)
inline

Definition at line 3762 of file gmock-matchers.h.

3762{ return Eq(rhs); }
Here is the caller graph for this function:

◆ WithArg()

template<int k, typename InnerAction>
internal::WithArgsAction< InnerAction, k > testing::WithArg ( const InnerAction & action)
inline

Definition at line 146 of file gmock-more-actions.h.

146 {
147 return internal::WithArgsAction<InnerAction, k>(action);
148}
Here is the caller graph for this function:

◆ WithArgs()

template<int k1, typename InnerAction>
internal::WithArgsAction< InnerAction, k1 > testing::WithArgs ( const InnerAction & action)
inline

Definition at line 625 of file gmock-generated-actions.h.

625 {
626 return internal::WithArgsAction<InnerAction, k1>(action);
627}
Here is the caller graph for this function:

◆ WithoutArgs()

template<typename InnerAction>
internal::WithArgsAction< InnerAction > testing::WithoutArgs ( const InnerAction & action)
inline

Definition at line 135 of file gmock-more-actions.h.

135 {
136 return internal::WithArgsAction<InnerAction>(action);
137}
Here is the caller graph for this function:

Variable Documentation

◆ _

const internal::AnythingMatcher testing::_

Definition at line 3729 of file gmock-matchers.h.

3729{};