Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
testing::gmock_generated_actions_test Namespace Reference

Namespaces

namespace  action_test
 

Classes

class  BoolResetter
 
struct  GiantTemplate
 
class  NullaryConstructorClass
 
class  NullaryFunctor
 
class  SubstractAction
 
struct  SumOf5Functor
 
struct  SumOf6Functor
 
class  TenArgConstructorClass
 
class  UnaryConstructorClass
 
struct  UnaryFunctor
 

Functions

short Short (short n)
 
char Char (char ch)
 
int Nullary ()
 
bool Unary (int x)
 
const char * Plus1 (const char *s)
 
bool ByConstRef (const std::string &s)
 
bool ReferencesGlobalDouble (const double &x)
 
std::string ByNonConstRef (std::string &s)
 
const char * Binary (const char *input, short n)
 
void VoidBinary (int, char)
 
int Ternary (int x, char y, short z)
 
void VoidTernary (int, char, bool)
 
int SumOf4 (int a, int b, int c, int d)
 
std::string Concat4 (const char *s1, const char *s2, const char *s3, const char *s4)
 
int SumOf5 (int a, int b, int c, int d, int e)
 
std::string Concat5 (const char *s1, const char *s2, const char *s3, const char *s4, const char *s5)
 
int SumOf6 (int a, int b, int c, int d, int e, int f)
 
std::string Concat6 (const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6)
 
std::string Concat7 (const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7)
 
std::string Concat8 (const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7, const char *s8)
 
std::string Concat9 (const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7, const char *s8, const char *s9)
 
std::string Concat10 (const char *s1, const char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7, const char *s8, const char *s9, const char *s10)
 
const char * CharPtr (const char *s)
 
 TEST (InvokeArgumentTest, Function0)
 
 TEST (InvokeArgumentTest, Functor1)
 
 TEST (InvokeArgumentTest, Function5)
 
 TEST (InvokeArgumentTest, Functor5)
 
 TEST (InvokeArgumentTest, Function6)
 
 TEST (InvokeArgumentTest, Functor6)
 
 TEST (InvokeArgumentTest, Function7)
 
 TEST (InvokeArgumentTest, Function8)
 
 TEST (InvokeArgumentTest, Function9)
 
 TEST (InvokeArgumentTest, Function10)
 
 TEST (InvokeArgumentTest, ByPointerFunction)
 
 TEST (InvokeArgumentTest, FunctionWithCStringLiteral)
 
 TEST (InvokeArgumentTest, ByConstReferenceFunction)
 
 TEST (InvokeArgumentTest, ByExplicitConstReferenceFunction)
 
 TEST (WithArgsTest, OneArg)
 
 TEST (WithArgsTest, TwoArgs)
 
 TEST (WithArgsTest, ThreeArgs)
 
 TEST (WithArgsTest, FourArgs)
 
 TEST (WithArgsTest, FiveArgs)
 
 TEST (WithArgsTest, SixArgs)
 
 TEST (WithArgsTest, SevenArgs)
 
 TEST (WithArgsTest, EightArgs)
 
 TEST (WithArgsTest, NineArgs)
 
 TEST (WithArgsTest, TenArgs)
 
 TEST (WithArgsTest, NonInvokeAction)
 
 TEST (WithArgsTest, Identity)
 
 TEST (WithArgsTest, RepeatedArguments)
 
 TEST (WithArgsTest, ReversedArgumentOrder)
 
 TEST (WithArgsTest, ArgsOfCompatibleTypes)
 
 TEST (WithArgsTest, VoidAction)
 
 TEST (DoAllTest, TwoActions)
 
 TEST (DoAllTest, ThreeActions)
 
 TEST (DoAllTest, FourActions)
 
 TEST (DoAllTest, FiveActions)
 
 TEST (DoAllTest, SixActions)
 
 TEST (DoAllTest, SevenActions)
 
 TEST (DoAllTest, EightActions)
 
 TEST (DoAllTest, NineActions)
 
 TEST (DoAllTest, TenActions)
 
 ACTION (Return5)
 
 TEST (ActionMacroTest, WorksWhenNotReferencingArguments)
 
 ACTION (IncrementArg1)
 
 TEST (ActionMacroTest, WorksWhenReturningVoid)
 
 ACTION (IncrementArg2)
 
 TEST (ActionMacroTest, CanReferenceArgumentType)
 
 ACTION (Sum2)
 
 TEST (ActionMacroTest, CanReferenceArgumentTuple)
 
int Dummy (bool flag)
 
 ACTION (InvokeDummy)
 
 TEST (ActionMacroTest, CanReferenceMockFunctionType)
 
 ACTION (InvokeDummy2)
 
 TEST (ActionMacroTest, CanReferenceMockFunctionReturnType)
 
 ACTION (ReturnAddrOfConstBoolReferenceArg)
 
 TEST (ActionMacroTest, WorksForConstReferenceArg)
 
 ACTION (ReturnAddrOfIntReferenceArg)
 
 TEST (ActionMacroTest, WorksForNonConstReferenceArg)
 
 TEST (ActionMacroTest, WorksInNamespace)
 
 ACTION (PlusTwo)
 
 TEST (ActionMacroTest, WorksForDifferentArgumentNumbers)
 
 ACTION_P (Plus, n)
 
 TEST (ActionPMacroTest, DefinesParameterizedAction)
 
 ACTION_P (TypedPlus, n)
 
 TEST (ActionPMacroTest, CanReferenceArgumentAndParameterTypes)
 
 TEST (ActionPMacroTest, WorksInCompatibleMockFunction)
 
 ACTION (OverloadedAction)
 
 ACTION_P (OverloadedAction, default_value)
 
 ACTION_P2 (OverloadedAction, true_value, false_value)
 
 TEST (ActionMacroTest, CanDefineOverloadedActions)
 
 ACTION_P3 (Plus, m, n, k)
 
 TEST (ActionPnMacroTest, WorksFor3Parameters)
 
 ACTION_P4 (Plus, p0, p1, p2, p3)
 
 TEST (ActionPnMacroTest, WorksFor4Parameters)
 
 ACTION_P5 (Plus, p0, p1, p2, p3, p4)
 
 TEST (ActionPnMacroTest, WorksFor5Parameters)
 
 ACTION_P6 (Plus, p0, p1, p2, p3, p4, p5)
 
 TEST (ActionPnMacroTest, WorksFor6Parameters)
 
 ACTION_P7 (Plus, p0, p1, p2, p3, p4, p5, p6)
 
 TEST (ActionPnMacroTest, WorksFor7Parameters)
 
 ACTION_P8 (Plus, p0, p1, p2, p3, p4, p5, p6, p7)
 
 TEST (ActionPnMacroTest, WorksFor8Parameters)
 
 ACTION_P9 (Plus, p0, p1, p2, p3, p4, p5, p6, p7, p8)
 
 TEST (ActionPnMacroTest, WorksFor9Parameters)
 
 ACTION_P10 (Plus, p0, p1, p2, p3, p4, p5, p6, p7, p8, last_param)
 
 TEST (ActionPnMacroTest, WorksFor10Parameters)
 
 ACTION_P2 (PadArgument, prefix, suffix)
 
 TEST (ActionPnMacroTest, SimpleTypePromotion)
 
 ACTION_P3 (ConcatImpl, a, b, c)
 
template<typename T1 , typename T2 >
ConcatImplActionP3< std::string, T1, T2 > Concat (const std::string &a, T1 b, T2 c)
 
template<typename T1 , typename T2 >
ConcatImplActionP3< T1, int, T2 > Concat (T1 a, int b, T2 c)
 
 TEST (ActionPnMacroTest, CanPartiallyRestrictParameterTypes)
 
 ACTION (DoFoo)
 
 ACTION_P (DoFoo, p)
 
 ACTION_P2 (DoFoo, p0, p1)
 
 TEST (ActionPnMacroTest, TypesAreCorrect)
 
 ACTION_P (Plus1, x)
 
 ACTION_P2 (Plus2, x, y)
 
 ACTION_P3 (Plus3, x, y, z)
 
 ACTION_P10 (Plus10, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)
 
 TEST (ActionPnMacroTest, CanExplicitlyInstantiateWithReferenceTypes)
 
 TEST (ReturnNewTest, NoArgs)
 
 TEST (ReturnNewTest, Unary)
 
 TEST (ReturnNewTest, UnaryWorksWhenMockMethodHasArgs)
 
 TEST (ReturnNewTest, UnaryWorksWhenMockMethodReturnsPointerToConst)
 
 TEST (ReturnNewTest, ConstructorThatTakes10Arguments)
 
 ACTION_TEMPLATE (CreateNew, HAS_1_TEMPLATE_PARAMS(typename, T), AND_0_VALUE_PARAMS())
 
 TEST (ActionTemplateTest, WorksWithoutValueParam)
 
 ACTION_TEMPLATE (CreateNew, HAS_1_TEMPLATE_PARAMS(typename, T), AND_1_VALUE_PARAMS(a0))
 
 TEST (ActionTemplateTest, WorksWithValueParams)
 
 ACTION_TEMPLATE (MyDeleteArg, HAS_1_TEMPLATE_PARAMS(int, k), AND_0_VALUE_PARAMS())
 
 TEST (ActionTemplateTest, WorksForIntegralTemplateParams)
 
 ACTION_TEMPLATE (ReturnSmartPointer, HAS_1_TEMPLATE_PARAMS(template< typename Pointee > class, Pointer), AND_1_VALUE_PARAMS(pointee))
 
 TEST (ActionTemplateTest, WorksForTemplateTemplateParameters)
 
 ACTION_TEMPLATE (ReturnGiant, HAS_10_TEMPLATE_PARAMS(typename, T1, typename, T2, typename, T3, int, k4, bool, k5, unsigned int, k6, class, T7, class, T8, class, T9, template< typename T > class, T10), AND_1_VALUE_PARAMS(value))
 
 TEST (ActionTemplateTest, WorksFor10TemplateParameters)
 
 ACTION_TEMPLATE (ReturnSum, HAS_1_TEMPLATE_PARAMS(typename, Number), AND_10_VALUE_PARAMS(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10))
 
 TEST (ActionTemplateTest, WorksFor10ValueParameters)
 
 ACTION (ReturnSum)
 
 ACTION_P (ReturnSum, x)
 
 ACTION_TEMPLATE (ReturnSum, HAS_1_TEMPLATE_PARAMS(typename, Number), AND_2_VALUE_PARAMS(v1, v2))
 
 ACTION_TEMPLATE (ReturnSum, HAS_1_TEMPLATE_PARAMS(typename, Number), AND_3_VALUE_PARAMS(v1, v2, v3))
 
 ACTION_TEMPLATE (ReturnSum, HAS_2_TEMPLATE_PARAMS(typename, Number, int, k), AND_4_VALUE_PARAMS(v1, v2, v3, v4))
 
 TEST (ActionTemplateTest, CanBeOverloadedOnNumberOfValueParameters)
 

Variables

bool g_done = false
 
const double g_double = 0
 

Function Documentation

◆ ACTION() [1/12]

testing::gmock_generated_actions_test::ACTION ( DoFoo )

Definition at line 938 of file gmock-generated-actions_test.cc.

938{}

◆ ACTION() [2/12]

testing::gmock_generated_actions_test::ACTION ( IncrementArg1 )

Definition at line 616 of file gmock-generated-actions_test.cc.

616{ (*arg1)++; }

◆ ACTION() [3/12]

testing::gmock_generated_actions_test::ACTION ( IncrementArg2 )

Definition at line 627 of file gmock-generated-actions_test.cc.

627 {
628 StaticAssertTypeEq<int*, arg2_type>();
629 arg2_type temp = arg2;
630 (*temp)++;
631}
Here is the call graph for this function:

◆ ACTION() [4/12]

testing::gmock_generated_actions_test::ACTION ( InvokeDummy )

Definition at line 658 of file gmock-generated-actions_test.cc.

658 {
659 StaticAssertTypeEq<int(bool), function_type>();
660 function_type* fp = &Dummy;
661 return (*fp)(true);
662}
Here is the call graph for this function:

◆ ACTION() [5/12]

testing::gmock_generated_actions_test::ACTION ( InvokeDummy2 )

Definition at line 672 of file gmock-generated-actions_test.cc.

672 {
673 StaticAssertTypeEq<int, return_type>();
674 return_type result = Dummy(true);
675 return result;
676}
Here is the call graph for this function:

◆ ACTION() [6/12]

testing::gmock_generated_actions_test::ACTION ( OverloadedAction )

Definition at line 764 of file gmock-generated-actions_test.cc.

764{ return arg0 ? arg1 : "hello"; }

◆ ACTION() [7/12]

testing::gmock_generated_actions_test::ACTION ( PlusTwo )

Definition at line 720 of file gmock-generated-actions_test.cc.

720{ return arg0 + 2; }

◆ ACTION() [8/12]

testing::gmock_generated_actions_test::ACTION ( Return5 )

Definition at line 605 of file gmock-generated-actions_test.cc.

605{ return 5; }

◆ ACTION() [9/12]

testing::gmock_generated_actions_test::ACTION ( ReturnAddrOfConstBoolReferenceArg )

Definition at line 685 of file gmock-generated-actions_test.cc.

685 {
686 StaticAssertTypeEq<const bool&, arg1_type>();
687 return &arg1;
688}
Here is the call graph for this function:

◆ ACTION() [10/12]

testing::gmock_generated_actions_test::ACTION ( ReturnAddrOfIntReferenceArg )

Definition at line 697 of file gmock-generated-actions_test.cc.

697 {
698 StaticAssertTypeEq<int&, arg0_type>();
699 return &arg0;
700}
Here is the call graph for this function:

◆ ACTION() [11/12]

testing::gmock_generated_actions_test::ACTION ( ReturnSum )

Definition at line 1190 of file gmock-generated-actions_test.cc.

1190{ return 0; }

◆ ACTION() [12/12]

testing::gmock_generated_actions_test::ACTION ( Sum2 )

Definition at line 642 of file gmock-generated-actions_test.cc.

642 {
643 StaticAssertTypeEq<tuple<int, char, int*>, args_type>();
644 args_type args_copy = args;
645 return get<0>(args_copy) + get<1>(args_copy);
646}

◆ ACTION_P() [1/6]

testing::gmock_generated_actions_test::ACTION_P ( DoFoo ,
p  )

Definition at line 939 of file gmock-generated-actions_test.cc.

939{}

◆ ACTION_P() [2/6]

testing::gmock_generated_actions_test::ACTION_P ( OverloadedAction ,
default_value  )

Definition at line 766 of file gmock-generated-actions_test.cc.

766 {
767 return arg0 ? arg1 : default_value;
768}

◆ ACTION_P() [3/6]

testing::gmock_generated_actions_test::ACTION_P ( Plus ,
n  )

Definition at line 732 of file gmock-generated-actions_test.cc.

732{ return arg0 + n; }

◆ ACTION_P() [4/6]

testing::gmock_generated_actions_test::ACTION_P ( Plus1 ,
x  )

Definition at line 982 of file gmock-generated-actions_test.cc.

982{ return x; }

◆ ACTION_P() [5/6]

testing::gmock_generated_actions_test::ACTION_P ( ReturnSum ,
x  )

Definition at line 1192 of file gmock-generated-actions_test.cc.

1192{ return x; }

◆ ACTION_P() [6/6]

testing::gmock_generated_actions_test::ACTION_P ( TypedPlus ,
n  )

Definition at line 741 of file gmock-generated-actions_test.cc.

741 {
742 arg0_type t1 = arg0;
743 n_type t2 = n;
744 return t1 + t2;
745}

◆ ACTION_P10() [1/2]

testing::gmock_generated_actions_test::ACTION_P10 ( Plus ,
p0 ,
p1 ,
p2 ,
p3 ,
p4 ,
p5 ,
p6 ,
p7 ,
p8 ,
last_param  )

Definition at line 854 of file gmock-generated-actions_test.cc.

854 {
855 arg0_type t0 = arg0;
856 last_param_type t9 = last_param;
857 return t0 + p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + t9;
858}

◆ ACTION_P10() [2/2]

testing::gmock_generated_actions_test::ACTION_P10 ( Plus10 ,
a0 ,
a1 ,
a2 ,
a3 ,
a4 ,
a5 ,
a6 ,
a7 ,
a8 ,
a9  )

Definition at line 985 of file gmock-generated-actions_test.cc.

985 {
986 return a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9;
987}

◆ ACTION_P2() [1/4]

testing::gmock_generated_actions_test::ACTION_P2 ( DoFoo ,
p0 ,
p1  )

Definition at line 940 of file gmock-generated-actions_test.cc.

940{}

◆ ACTION_P2() [2/4]

testing::gmock_generated_actions_test::ACTION_P2 ( OverloadedAction ,
true_value ,
false_value  )

Definition at line 770 of file gmock-generated-actions_test.cc.

770 {
771 return arg0 ? true_value : false_value;
772}

◆ ACTION_P2() [3/4]

testing::gmock_generated_actions_test::ACTION_P2 ( PadArgument ,
prefix ,
suffix  )

Definition at line 868 of file gmock-generated-actions_test.cc.

868 {
869 // The following lines promote the two parameters to desired types.
870 std::string prefix_str(prefix);
871 char suffix_char = static_cast<char>(suffix);
872 return prefix_str + arg0 + suffix_char;
873}

◆ ACTION_P2() [4/4]

testing::gmock_generated_actions_test::ACTION_P2 ( Plus2 ,
x ,
y  )

Definition at line 983 of file gmock-generated-actions_test.cc.

983{ return x + y; }

◆ ACTION_P3() [1/3]

testing::gmock_generated_actions_test::ACTION_P3 ( ConcatImpl ,
a ,
b ,
c  )

Definition at line 889 of file gmock-generated-actions_test.cc.

889 {
890 std::stringstream ss;
891 ss << a << b << c;
892 return ss.str();
893}
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181

◆ ACTION_P3() [2/3]

testing::gmock_generated_actions_test::ACTION_P3 ( Plus ,
m ,
n ,
k  )

Definition at line 792 of file gmock-generated-actions_test.cc.

792{ return arg0 + m + n + k; }

◆ ACTION_P3() [3/3]

testing::gmock_generated_actions_test::ACTION_P3 ( Plus3 ,
x ,
y ,
z  )

Definition at line 984 of file gmock-generated-actions_test.cc.

984{ return x + y + z; }

◆ ACTION_P4()

testing::gmock_generated_actions_test::ACTION_P4 ( Plus ,
p0 ,
p1 ,
p2 ,
p3  )

Definition at line 804 of file gmock-generated-actions_test.cc.

804{ return arg0 + p0 + p1 + p2 + p3; }

◆ ACTION_P5()

testing::gmock_generated_actions_test::ACTION_P5 ( Plus ,
p0 ,
p1 ,
p2 ,
p3 ,
p4  )

Definition at line 811 of file gmock-generated-actions_test.cc.

811{ return arg0 + p0 + p1 + p2 + p3 + p4; }

◆ ACTION_P6()

testing::gmock_generated_actions_test::ACTION_P6 ( Plus ,
p0 ,
p1 ,
p2 ,
p3 ,
p4 ,
p5  )

Definition at line 818 of file gmock-generated-actions_test.cc.

818 {
819 return arg0 + p0 + p1 + p2 + p3 + p4 + p5;
820}

◆ ACTION_P7()

testing::gmock_generated_actions_test::ACTION_P7 ( Plus ,
p0 ,
p1 ,
p2 ,
p3 ,
p4 ,
p5 ,
p6  )

Definition at line 827 of file gmock-generated-actions_test.cc.

827 {
828 return arg0 + p0 + p1 + p2 + p3 + p4 + p5 + p6;
829}

◆ ACTION_P8()

testing::gmock_generated_actions_test::ACTION_P8 ( Plus ,
p0 ,
p1 ,
p2 ,
p3 ,
p4 ,
p5 ,
p6 ,
p7  )

Definition at line 836 of file gmock-generated-actions_test.cc.

836 {
837 return arg0 + p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7;
838}

◆ ACTION_P9()

testing::gmock_generated_actions_test::ACTION_P9 ( Plus ,
p0 ,
p1 ,
p2 ,
p3 ,
p4 ,
p5 ,
p6 ,
p7 ,
p8  )

Definition at line 845 of file gmock-generated-actions_test.cc.

845 {
846 return arg0 + p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8;
847}

◆ ACTION_TEMPLATE() [1/9]

testing::gmock_generated_actions_test::ACTION_TEMPLATE ( CreateNew ,
HAS_1_TEMPLATE_PARAMS(typename, T) ,
AND_0_VALUE_PARAMS()  )

Definition at line 1074 of file gmock-generated-actions_test.cc.

1076 {
1077 return new T;
1078}
#define T(meth, val, expected)

◆ ACTION_TEMPLATE() [2/9]

testing::gmock_generated_actions_test::ACTION_TEMPLATE ( CreateNew ,
HAS_1_TEMPLATE_PARAMS(typename, T) ,
AND_1_VALUE_PARAMS(a0)  )

Definition at line 1087 of file gmock-generated-actions_test.cc.

1089 {
1090 return new T(a0);
1091}

◆ ACTION_TEMPLATE() [3/9]

testing::gmock_generated_actions_test::ACTION_TEMPLATE ( MyDeleteArg ,
HAS_1_TEMPLATE_PARAMS(int, k) ,
AND_0_VALUE_PARAMS()  )

Definition at line 1101 of file gmock-generated-actions_test.cc.

1103 {
1104 delete get<k>(args);
1105}

◆ ACTION_TEMPLATE() [4/9]

testing::gmock_generated_actions_test::ACTION_TEMPLATE ( ReturnGiant ,
HAS_10_TEMPLATE_PARAMS( typename, T1, typename, T2, typename, T3, int, k4, bool, k5, unsigned int, k6, class, T7, class, T8, class, T9, template< typename T > class, T10) ,
AND_1_VALUE_PARAMS(value)  )

Definition at line 1149 of file gmock-generated-actions_test.cc.

1161 {
1162 return GiantTemplate<T10<T1>, T2, T3, k4, k5, k6, T7, T8, T9>(value);
1163}
#define value
Definition pkcs11.h:157

◆ ACTION_TEMPLATE() [5/9]

testing::gmock_generated_actions_test::ACTION_TEMPLATE ( ReturnSmartPointer ,
HAS_1_TEMPLATE_PARAMS(template< typename Pointee > class, Pointer) ,
AND_1_VALUE_PARAMS(pointee)  )

Definition at line 1126 of file gmock-generated-actions_test.cc.

1129 {
1130 return Pointer<pointee_type>(new pointee_type(pointee));
1131}
GenericPointer< Value, CrtAllocator > Pointer
Definition fwd.h:128

◆ ACTION_TEMPLATE() [6/9]

testing::gmock_generated_actions_test::ACTION_TEMPLATE ( ReturnSum ,
HAS_1_TEMPLATE_PARAMS(typename, Number) ,
AND_10_VALUE_PARAMS(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10)  )

Definition at line 1176 of file gmock-generated-actions_test.cc.

1178 {
1179 return static_cast<Number>(v1) + v2 + v3 + v4 + v5 + v6 + v7 + v8 + v9 + v10;
1180}

◆ ACTION_TEMPLATE() [7/9]

testing::gmock_generated_actions_test::ACTION_TEMPLATE ( ReturnSum ,
HAS_1_TEMPLATE_PARAMS(typename, Number) ,
AND_2_VALUE_PARAMS(v1, v2)  )

Definition at line 1194 of file gmock-generated-actions_test.cc.

1196 {
1197 return static_cast<Number>(v1) + v2;
1198}

◆ ACTION_TEMPLATE() [8/9]

testing::gmock_generated_actions_test::ACTION_TEMPLATE ( ReturnSum ,
HAS_1_TEMPLATE_PARAMS(typename, Number) ,
AND_3_VALUE_PARAMS(v1, v2, v3)  )

Definition at line 1200 of file gmock-generated-actions_test.cc.

1202 {
1203 return static_cast<Number>(v1) + v2 + v3;
1204}

◆ ACTION_TEMPLATE() [9/9]

testing::gmock_generated_actions_test::ACTION_TEMPLATE ( ReturnSum ,
HAS_2_TEMPLATE_PARAMS(typename, Number, int, k) ,
AND_4_VALUE_PARAMS(v1, v2, v3, v4)  )

Definition at line 1206 of file gmock-generated-actions_test.cc.

1208 {
1209 return static_cast<Number>(v1) + v2 + v3 + v4 + k;
1210}

◆ Binary()

const char * testing::gmock_generated_actions_test::Binary ( const char * input,
short n )

Definition at line 95 of file gmock-generated-actions_test.cc.

95{ return input + n; } // NOLINT

◆ ByConstRef()

bool testing::gmock_generated_actions_test::ByConstRef ( const std::string & s)

Definition at line 84 of file gmock-generated-actions_test.cc.

84{ return s == "Hi"; }
char * s
Here is the caller graph for this function:

◆ ByNonConstRef()

std::string testing::gmock_generated_actions_test::ByNonConstRef ( std::string & s)

Definition at line 89 of file gmock-generated-actions_test.cc.

89{ return s += "+"; } // NOLINT

◆ Char()

char testing::gmock_generated_actions_test::Char ( char ch)
inline

Definition at line 68 of file gmock-generated-actions_test.cc.

68{ return ch; }
Here is the caller graph for this function:

◆ CharPtr()

const char * testing::gmock_generated_actions_test::CharPtr ( const char * s)
inline

Definition at line 165 of file gmock-generated-actions_test.cc.

165{ return s; }
Here is the caller graph for this function:

◆ Concat() [1/2]

template<typename T1 , typename T2 >
ConcatImplActionP3< std::string, T1, T2 > testing::gmock_generated_actions_test::Concat ( const std::string & a,
T1 b,
T2 c )

Definition at line 905 of file gmock-generated-actions_test.cc.

905 {
907 if (true) {
909 // This branch verifies that ConcatImpl() can be invoked without
910 // explicit template arguments.
911 return ConcatImpl(a, b, c);
912 } else {
913 // This branch verifies that ConcatImpl() can also be invoked with
914 // explicit template arguments. It doesn't really need to be
915 // executed as this is a compile-time verification.
916 return ConcatImpl<std::string, T1, T2>(a, b, c);
917 }
918}
#define GTEST_INTENTIONAL_CONST_COND_PUSH_()
Definition gtest-port.h:940
#define GTEST_INTENTIONAL_CONST_COND_POP_()
Definition gtest-port.h:942
return
if(ppFunctionList==NULL)
Here is the caller graph for this function:

◆ Concat() [2/2]

template<typename T1 , typename T2 >
ConcatImplActionP3< T1, int, T2 > testing::gmock_generated_actions_test::Concat ( T1 a,
int b,
T2 c )

Definition at line 924 of file gmock-generated-actions_test.cc.

924 {
925 return ConcatImpl(a, b, c);
926}

◆ Concat10()

std::string testing::gmock_generated_actions_test::Concat10 ( const char * s1,
const char * s2,
const char * s3,
const char * s4,
const char * s5,
const char * s6,
const char * s7,
const char * s8,
const char * s9,
const char * s10 )

Definition at line 156 of file gmock-generated-actions_test.cc.

159 {
160 return std::string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9 + s10;
161}
Here is the caller graph for this function:

◆ Concat4()

std::string testing::gmock_generated_actions_test::Concat4 ( const char * s1,
const char * s2,
const char * s3,
const char * s4 )

Definition at line 105 of file gmock-generated-actions_test.cc.

106 {
107 return std::string(s1) + s2 + s3 + s4;
108}
Here is the caller graph for this function:

◆ Concat5()

std::string testing::gmock_generated_actions_test::Concat5 ( const char * s1,
const char * s2,
const char * s3,
const char * s4,
const char * s5 )

Definition at line 118 of file gmock-generated-actions_test.cc.

119 {
120 return std::string(s1) + s2 + s3 + s4 + s5;
121}
Here is the caller graph for this function:

◆ Concat6()

std::string testing::gmock_generated_actions_test::Concat6 ( const char * s1,
const char * s2,
const char * s3,
const char * s4,
const char * s5,
const char * s6 )

Definition at line 133 of file gmock-generated-actions_test.cc.

134 {
135 return std::string(s1) + s2 + s3 + s4 + s5 + s6;
136}
Here is the caller graph for this function:

◆ Concat7()

std::string testing::gmock_generated_actions_test::Concat7 ( const char * s1,
const char * s2,
const char * s3,
const char * s4,
const char * s5,
const char * s6,
const char * s7 )

Definition at line 138 of file gmock-generated-actions_test.cc.

140 {
141 return std::string(s1) + s2 + s3 + s4 + s5 + s6 + s7;
142}
Here is the caller graph for this function:

◆ Concat8()

std::string testing::gmock_generated_actions_test::Concat8 ( const char * s1,
const char * s2,
const char * s3,
const char * s4,
const char * s5,
const char * s6,
const char * s7,
const char * s8 )

Definition at line 144 of file gmock-generated-actions_test.cc.

146 {
147 return std::string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8;
148}
Here is the caller graph for this function:

◆ Concat9()

std::string testing::gmock_generated_actions_test::Concat9 ( const char * s1,
const char * s2,
const char * s3,
const char * s4,
const char * s5,
const char * s6,
const char * s7,
const char * s8,
const char * s9 )

Definition at line 150 of file gmock-generated-actions_test.cc.

152 {
153 return std::string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9;
154}
Here is the caller graph for this function:

◆ Dummy()

int testing::gmock_generated_actions_test::Dummy ( bool flag)

Definition at line 656 of file gmock-generated-actions_test.cc.

656{ return flag? 1 : 0; }
Here is the caller graph for this function:

◆ Nullary()

int testing::gmock_generated_actions_test::Nullary ( )

Definition at line 71 of file gmock-generated-actions_test.cc.

71{ return 1; }
Here is the caller graph for this function:

◆ Plus1()

const char * testing::gmock_generated_actions_test::Plus1 ( const char * s)

Definition at line 82 of file gmock-generated-actions_test.cc.

82{ return s + 1; }
Here is the caller graph for this function:

◆ ReferencesGlobalDouble()

bool testing::gmock_generated_actions_test::ReferencesGlobalDouble ( const double & x)

Definition at line 87 of file gmock-generated-actions_test.cc.

Here is the caller graph for this function:

◆ Short()

short testing::gmock_generated_actions_test::Short ( short n)
inline

Definition at line 67 of file gmock-generated-actions_test.cc.

67{ return n; } // NOLINT
Here is the caller graph for this function:

◆ SumOf4()

int testing::gmock_generated_actions_test::SumOf4 ( int a,
int b,
int c,
int d )

Definition at line 103 of file gmock-generated-actions_test.cc.

103{ return a + b + c + d; }
CK_ULONG d
Here is the caller graph for this function:

◆ SumOf5()

int testing::gmock_generated_actions_test::SumOf5 ( int a,
int b,
int c,
int d,
int e )

Definition at line 110 of file gmock-generated-actions_test.cc.

110{ return a + b + c + d + e; }
Here is the caller graph for this function:

◆ SumOf6()

int testing::gmock_generated_actions_test::SumOf6 ( int a,
int b,
int c,
int d,
int e,
int f )

Definition at line 123 of file gmock-generated-actions_test.cc.

123 {
124 return a + b + c + d + e + f;
125}
Here is the caller graph for this function:

◆ Ternary()

int testing::gmock_generated_actions_test::Ternary ( int x,
char y,
short z )

Definition at line 99 of file gmock-generated-actions_test.cc.

99{ return x + y + z; } // NOLINT
Here is the caller graph for this function:

◆ TEST() [1/77]

testing::gmock_generated_actions_test::TEST ( ActionMacroTest ,
CanDefineOverloadedActions  )

Definition at line 774 of file gmock-generated-actions_test.cc.

774 {
775 typedef Action<const char*(bool, const char*)> MyAction;
776
777 const MyAction a1 = OverloadedAction();
778 EXPECT_STREQ("hello", a1.Perform(make_tuple(false, CharPtr("world"))));
779 EXPECT_STREQ("world", a1.Perform(make_tuple(true, CharPtr("world"))));
780
781 const MyAction a2 = OverloadedAction("hi");
782 EXPECT_STREQ("hi", a2.Perform(make_tuple(false, CharPtr("world"))));
783 EXPECT_STREQ("world", a2.Perform(make_tuple(true, CharPtr("world"))));
784
785 const MyAction a3 = OverloadedAction("hi", "you");
786 EXPECT_STREQ("hi", a3.Perform(make_tuple(true, CharPtr("world"))));
787 EXPECT_STREQ("you", a3.Perform(make_tuple(false, CharPtr("world"))));
788}
#define EXPECT_STREQ(s1, s2)
Definition gtest.h:2027
Here is the call graph for this function:

◆ TEST() [2/77]

testing::gmock_generated_actions_test::TEST ( ActionMacroTest ,
CanReferenceArgumentTuple  )

Definition at line 648 of file gmock-generated-actions_test.cc.

648 {
649 Action<int(int, char, int*)> a1 = Sum2();
650 int dummy = 0;
651 EXPECT_EQ(11, a1.Perform(make_tuple(5, Char(6), &dummy)));
652}
Result Perform(ArgumentTuple args) const
#define EXPECT_EQ(val1, val2)
Definition gtest.h:1954
Here is the call graph for this function:

◆ TEST() [3/77]

testing::gmock_generated_actions_test::TEST ( ActionMacroTest ,
CanReferenceArgumentType  )

Definition at line 633 of file gmock-generated-actions_test.cc.

633 {
634 Action<void(int, bool, int*)> a1 = IncrementArg2();
635 int n = 0;
636 a1.Perform(make_tuple(5, false, &n));
637 EXPECT_EQ(1, n);
638}
Here is the call graph for this function:

◆ TEST() [4/77]

testing::gmock_generated_actions_test::TEST ( ActionMacroTest ,
CanReferenceMockFunctionReturnType  )

Definition at line 678 of file gmock-generated-actions_test.cc.

678 {
679 Action<int(bool)> a1 = InvokeDummy2();
680 EXPECT_EQ(1, a1.Perform(make_tuple(true)));
681 EXPECT_EQ(1, a1.Perform(make_tuple(false)));
682}
Here is the call graph for this function:

◆ TEST() [5/77]

testing::gmock_generated_actions_test::TEST ( ActionMacroTest ,
CanReferenceMockFunctionType  )

Definition at line 664 of file gmock-generated-actions_test.cc.

664 {
665 Action<int(bool)> a1 = InvokeDummy();
666 EXPECT_EQ(1, a1.Perform(make_tuple(true)));
667 EXPECT_EQ(1, a1.Perform(make_tuple(false)));
668}
Here is the call graph for this function:

◆ TEST() [6/77]

testing::gmock_generated_actions_test::TEST ( ActionMacroTest ,
WorksForConstReferenceArg  )

Definition at line 690 of file gmock-generated-actions_test.cc.

690 {
691 Action<const bool*(int, const bool&)> a = ReturnAddrOfConstBoolReferenceArg();
692 const bool b = false;
693 EXPECT_EQ(&b, a.Perform(tuple<int, const bool&>(0, b)));
694}

◆ TEST() [7/77]

testing::gmock_generated_actions_test::TEST ( ActionMacroTest ,
WorksForDifferentArgumentNumbers  )

Definition at line 722 of file gmock-generated-actions_test.cc.

722 {
723 Action<int(int)> a1 = PlusTwo();
724 EXPECT_EQ(4, a1.Perform(make_tuple(2)));
725
726 Action<double(float, void*)> a2 = PlusTwo();
727 int dummy;
728 EXPECT_DOUBLE_EQ(6, a2.Perform(make_tuple(4.0f, &dummy)));
729}
#define EXPECT_DOUBLE_EQ(val1, val2)
Definition gtest.h:2063
Here is the call graph for this function:

◆ TEST() [8/77]

testing::gmock_generated_actions_test::TEST ( ActionMacroTest ,
WorksForNonConstReferenceArg  )

Definition at line 702 of file gmock-generated-actions_test.cc.

702 {
703 Action<int*(int&, bool, int)> a = ReturnAddrOfIntReferenceArg();
704 int n = 0;
705 EXPECT_EQ(&n, a.Perform(tuple<int&, bool, int>(n, true, 1)));
706}

◆ TEST() [9/77]

testing::gmock_generated_actions_test::TEST ( ActionMacroTest ,
WorksInNamespace  )

Definition at line 713 of file gmock-generated-actions_test.cc.

713 {
714 Action<int(int, int)> a1 = action_test::Sum();
715 EXPECT_EQ(3, a1.Perform(make_tuple(1, 2)));
716}
Here is the call graph for this function:

◆ TEST() [10/77]

testing::gmock_generated_actions_test::TEST ( ActionMacroTest ,
WorksWhenNotReferencingArguments  )

Definition at line 607 of file gmock-generated-actions_test.cc.

607 {
608 Action<double()> a1 = Return5();
609 EXPECT_DOUBLE_EQ(5, a1.Perform(make_tuple()));
610
611 Action<int(double, bool)> a2 = Return5();
612 EXPECT_EQ(5, a2.Perform(make_tuple(1, true)));
613}
Here is the call graph for this function:

◆ TEST() [11/77]

testing::gmock_generated_actions_test::TEST ( ActionMacroTest ,
WorksWhenReturningVoid  )

Definition at line 618 of file gmock-generated-actions_test.cc.

618 {
619 Action<void(int, int*)> a1 = IncrementArg1();
620 int n = 0;
621 a1.Perform(make_tuple(5, &n));
622 EXPECT_EQ(1, n);
623}
Here is the call graph for this function:

◆ TEST() [12/77]

testing::gmock_generated_actions_test::TEST ( ActionPMacroTest ,
CanReferenceArgumentAndParameterTypes  )

Definition at line 747 of file gmock-generated-actions_test.cc.

747 {
748 Action<int(char m, bool t)> a1 = TypedPlus(9);
749 EXPECT_EQ(10, a1.Perform(make_tuple(Char(1), true)));
750}
Here is the call graph for this function:

◆ TEST() [13/77]

testing::gmock_generated_actions_test::TEST ( ActionPMacroTest ,
DefinesParameterizedAction  )

Definition at line 734 of file gmock-generated-actions_test.cc.

734 {
735 Action<int(int m, bool t)> a1 = Plus(9);
736 EXPECT_EQ(10, a1.Perform(make_tuple(1, true)));
737}
Here is the call graph for this function:

◆ TEST() [14/77]

testing::gmock_generated_actions_test::TEST ( ActionPMacroTest ,
WorksInCompatibleMockFunction  )

Definition at line 754 of file gmock-generated-actions_test.cc.

754 {
755 Action<std::string(const std::string& s)> a1 = Plus("tail");
756 const std::string re = "re";
757 tuple<const std::string> dummy = make_tuple(re);
758 EXPECT_EQ("retail", a1.Perform(dummy));
759}
Here is the call graph for this function:

◆ TEST() [15/77]

testing::gmock_generated_actions_test::TEST ( ActionPnMacroTest ,
CanExplicitlyInstantiateWithReferenceTypes  )

Definition at line 989 of file gmock-generated-actions_test.cc.

989 {
990 int x = 1, y = 2, z = 3;
991 const tuple<> empty = make_tuple();
992
993 Action<int()> a = Plus1<int&>(x);
994 EXPECT_EQ(1, a.Perform(empty));
995
996 a = Plus2<const int&, int&>(x, y);
997 EXPECT_EQ(3, a.Perform(empty));
998
999 a = Plus3<int&, const int&, int&>(x, y, z);
1000 EXPECT_EQ(6, a.Perform(empty));
1001
1002 int n[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
1003 a = Plus10<const int&, int&, const int&, int&, const int&, int&, const int&,
1004 int&, const int&, int&>(n[0], n[1], n[2], n[3], n[4], n[5], n[6], n[7],
1005 n[8], n[9]);
1006 EXPECT_EQ(55, a.Perform(empty));
1007}
Here is the call graph for this function:

◆ TEST() [16/77]

testing::gmock_generated_actions_test::TEST ( ActionPnMacroTest ,
CanPartiallyRestrictParameterTypes  )

Definition at line 928 of file gmock-generated-actions_test.cc.

928 {
929 Action<const std::string()> a1 = Concat("Hello", "1", 2);
930 EXPECT_EQ("Hello12", a1.Perform(make_tuple()));
931
932 a1 = Concat(1, 2, 3);
933 EXPECT_EQ("123", a1.Perform(make_tuple()));
934}
ConcatImplActionP3< std::string, T1, T2 > Concat(const std::string &a, T1 b, T2 c)
Here is the call graph for this function:

◆ TEST() [17/77]

testing::gmock_generated_actions_test::TEST ( ActionPnMacroTest ,
SimpleTypePromotion  )

Definition at line 875 of file gmock-generated-actions_test.cc.

875 {
876 Action<std::string(const char*)> no_promo =
877 PadArgument(std::string("foo"), 'r');
878 Action<std::string(const char*)> promo =
879 PadArgument("foo", static_cast<int>('r'));
880 EXPECT_EQ("foobar", no_promo.Perform(make_tuple(CharPtr("ba"))));
881 EXPECT_EQ("foobar", promo.Perform(make_tuple(CharPtr("ba"))));
882}
Here is the call graph for this function:

◆ TEST() [18/77]

testing::gmock_generated_actions_test::TEST ( ActionPnMacroTest ,
TypesAreCorrect  )

Definition at line 942 of file gmock-generated-actions_test.cc.

942 {
943 // DoFoo() must be assignable to a DoFooAction variable.
944 DoFooAction a0 = DoFoo();
945
946 // DoFoo(1) must be assignable to a DoFooActionP variable.
947 DoFooActionP<int> a1 = DoFoo(1);
948
949 // DoFoo(p1, ..., pk) must be assignable to a DoFooActionPk
950 // variable, and so on.
951 DoFooActionP2<int, char> a2 = DoFoo(1, '2');
952 PlusActionP3<int, int, char> a3 = Plus(1, 2, '3');
953 PlusActionP4<int, int, int, char> a4 = Plus(1, 2, 3, '4');
954 PlusActionP5<int, int, int, int, char> a5 = Plus(1, 2, 3, 4, '5');
955 PlusActionP6<int, int, int, int, int, char> a6 = Plus(1, 2, 3, 4, 5, '6');
956 PlusActionP7<int, int, int, int, int, int, char> a7 =
957 Plus(1, 2, 3, 4, 5, 6, '7');
958 PlusActionP8<int, int, int, int, int, int, int, char> a8 =
959 Plus(1, 2, 3, 4, 5, 6, 7, '8');
960 PlusActionP9<int, int, int, int, int, int, int, int, char> a9 =
961 Plus(1, 2, 3, 4, 5, 6, 7, 8, '9');
962 PlusActionP10<int, int, int, int, int, int, int, int, int, char> a10 =
963 Plus(1, 2, 3, 4, 5, 6, 7, 8, 9, '0');
964
965 // Avoid "unused variable" warnings.
966 (void)a0;
967 (void)a1;
968 (void)a2;
969 (void)a3;
970 (void)a4;
971 (void)a5;
972 (void)a6;
973 (void)a7;
974 (void)a8;
975 (void)a9;
976 (void)a10;
977}

◆ TEST() [19/77]

testing::gmock_generated_actions_test::TEST ( ActionPnMacroTest ,
WorksFor10Parameters  )

Definition at line 860 of file gmock-generated-actions_test.cc.

860 {
861 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
862 EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10,
863 a1.Perform(make_tuple(10)));
864}
Here is the call graph for this function:

◆ TEST() [20/77]

testing::gmock_generated_actions_test::TEST ( ActionPnMacroTest ,
WorksFor3Parameters  )

Definition at line 794 of file gmock-generated-actions_test.cc.

794 {
795 Action<double(int m, bool t)> a1 = Plus(100, 20, 3.4);
796 EXPECT_DOUBLE_EQ(3123.4, a1.Perform(make_tuple(3000, true)));
797
798 Action<std::string(const std::string& s)> a2 = Plus("tail", "-", ">");
799 const std::string re = "re";
800 tuple<const std::string> dummy = make_tuple(re);
801 EXPECT_EQ("retail->", a2.Perform(dummy));
802}
Here is the call graph for this function:

◆ TEST() [21/77]

testing::gmock_generated_actions_test::TEST ( ActionPnMacroTest ,
WorksFor4Parameters  )

Definition at line 806 of file gmock-generated-actions_test.cc.

806 {
807 Action<int(int)> a1 = Plus(1, 2, 3, 4);
808 EXPECT_EQ(10 + 1 + 2 + 3 + 4, a1.Perform(make_tuple(10)));
809}
Here is the call graph for this function:

◆ TEST() [22/77]

testing::gmock_generated_actions_test::TEST ( ActionPnMacroTest ,
WorksFor5Parameters  )

Definition at line 813 of file gmock-generated-actions_test.cc.

813 {
814 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5);
815 EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5, a1.Perform(make_tuple(10)));
816}
Here is the call graph for this function:

◆ TEST() [23/77]

testing::gmock_generated_actions_test::TEST ( ActionPnMacroTest ,
WorksFor6Parameters  )

Definition at line 822 of file gmock-generated-actions_test.cc.

822 {
823 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6);
824 EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6, a1.Perform(make_tuple(10)));
825}
Here is the call graph for this function:

◆ TEST() [24/77]

testing::gmock_generated_actions_test::TEST ( ActionPnMacroTest ,
WorksFor7Parameters  )

Definition at line 831 of file gmock-generated-actions_test.cc.

831 {
832 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7);
833 EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7, a1.Perform(make_tuple(10)));
834}
Here is the call graph for this function:

◆ TEST() [25/77]

testing::gmock_generated_actions_test::TEST ( ActionPnMacroTest ,
WorksFor8Parameters  )

Definition at line 840 of file gmock-generated-actions_test.cc.

840 {
841 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8);
842 EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8, a1.Perform(make_tuple(10)));
843}
Here is the call graph for this function:

◆ TEST() [26/77]

testing::gmock_generated_actions_test::TEST ( ActionPnMacroTest ,
WorksFor9Parameters  )

Definition at line 849 of file gmock-generated-actions_test.cc.

849 {
850 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8, 9);
851 EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9, a1.Perform(make_tuple(10)));
852}
Here is the call graph for this function:

◆ TEST() [27/77]

testing::gmock_generated_actions_test::TEST ( ActionTemplateTest ,
CanBeOverloadedOnNumberOfValueParameters  )

Definition at line 1212 of file gmock-generated-actions_test.cc.

1212 {
1213 const Action<int()> a0 = ReturnSum();
1214 const Action<int()> a1 = ReturnSum(1);
1215 const Action<int()> a2 = ReturnSum<int>(1, 2);
1216 const Action<int()> a3 = ReturnSum<int>(1, 2, 3);
1217 const Action<int()> a4 = ReturnSum<int, 10000>(2000, 300, 40, 5);
1218 EXPECT_EQ(0, a0.Perform(make_tuple()));
1219 EXPECT_EQ(1, a1.Perform(make_tuple()));
1220 EXPECT_EQ(3, a2.Perform(make_tuple()));
1221 EXPECT_EQ(6, a3.Perform(make_tuple()));
1222 EXPECT_EQ(12345, a4.Perform(make_tuple()));
1223}
Here is the call graph for this function:

◆ TEST() [28/77]

testing::gmock_generated_actions_test::TEST ( ActionTemplateTest ,
WorksFor10TemplateParameters  )

Definition at line 1165 of file gmock-generated-actions_test.cc.

1165 {
1166 using ::testing::internal::linked_ptr;
1167 typedef GiantTemplate<linked_ptr<int>, bool, double, 5,
1168 true, 6, char, unsigned, int> Giant;
1169 const Action<Giant()> a = ReturnGiant<
1170 int, bool, double, 5, true, 6, char, unsigned, int, linked_ptr>(42);
1171 Giant giant = a.Perform(make_tuple());
1172 EXPECT_EQ(42, giant.value);
1173}
Here is the call graph for this function:

◆ TEST() [29/77]

testing::gmock_generated_actions_test::TEST ( ActionTemplateTest ,
WorksFor10ValueParameters  )

Definition at line 1182 of file gmock-generated-actions_test.cc.

1182 {
1183 const Action<int()> a = ReturnSum<int>(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
1184 EXPECT_EQ(55, a.Perform(make_tuple()));
1185}

◆ TEST() [30/77]

testing::gmock_generated_actions_test::TEST ( ActionTemplateTest ,
WorksForIntegralTemplateParams  )

Definition at line 1116 of file gmock-generated-actions_test.cc.

1116 {
1117 const Action<void(int*, BoolResetter*)> a = MyDeleteArg<1>();
1118 int n = 0;
1119 bool b = true;
1120 BoolResetter* resetter = new BoolResetter(&b);
1121 a.Perform(make_tuple(&n, resetter));
1122 EXPECT_FALSE(b); // Verifies that resetter is deleted.
1123}
#define EXPECT_FALSE(condition)
Definition gtest.h:1898

◆ TEST() [31/77]

testing::gmock_generated_actions_test::TEST ( ActionTemplateTest ,
WorksForTemplateTemplateParameters  )

Definition at line 1133 of file gmock-generated-actions_test.cc.

1133 {
1134 using ::testing::internal::linked_ptr;
1135 const Action<linked_ptr<int>()> a = ReturnSmartPointer<linked_ptr>(42);
1136 linked_ptr<int> p = a.Perform(make_tuple());
1137 EXPECT_EQ(42, *p);
1138}
const mie::Vuint & p
Definition bn.cpp:27

◆ TEST() [32/77]

testing::gmock_generated_actions_test::TEST ( ActionTemplateTest ,
WorksWithoutValueParam  )

Definition at line 1080 of file gmock-generated-actions_test.cc.

1080 {
1081 const Action<int*()> a = CreateNew<int>();
1082 int* p = a.Perform(make_tuple());
1083 delete p;
1084}

◆ TEST() [33/77]

testing::gmock_generated_actions_test::TEST ( ActionTemplateTest ,
WorksWithValueParams  )

Definition at line 1093 of file gmock-generated-actions_test.cc.

1093 {
1094 const Action<int*()> a = CreateNew<int>(42);
1095 int* p = a.Perform(make_tuple());
1096 EXPECT_EQ(42, *p);
1097 delete p;
1098}

◆ TEST() [34/77]

testing::gmock_generated_actions_test::TEST ( DoAllTest ,
EightActions  )

Definition at line 513 of file gmock-generated-actions_test.cc.

513 {
514 int m = 0, n = 0;
515 char a = '\0', b = '\0', c = '\0', d = '\0', e = '\0';
516 Action<int(int*, int*, char*, char*, char*, char*, // NOLINT
517 char*)> action =
518 DoAll(SetArgPointee<0>(1),
519 SetArgPointee<1>(2),
520 SetArgPointee<2>('a'),
521 SetArgPointee<3>('b'),
522 SetArgPointee<4>('c'),
523 SetArgPointee<5>('d'),
524 SetArgPointee<6>('e'),
525 Return(3));
526 EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c, &d, &e)));
527 EXPECT_EQ(1, m);
528 EXPECT_EQ(2, n);
529 EXPECT_EQ('a', a);
530 EXPECT_EQ('b', b);
531 EXPECT_EQ('c', c);
532 EXPECT_EQ('d', d);
533 EXPECT_EQ('e', e);
534}
Here is the call graph for this function:

◆ TEST() [35/77]

testing::gmock_generated_actions_test::TEST ( DoAllTest ,
FiveActions  )

Definition at line 456 of file gmock-generated-actions_test.cc.

456 {
457 int m = 0, n = 0;
458 char a = '\0', b = '\0';
459 Action<int(int*, int*, char*, char*)> action = // NOLINT
460 DoAll(SetArgPointee<0>(1),
461 SetArgPointee<1>(2),
462 SetArgPointee<2>('a'),
463 SetArgPointee<3>('b'),
464 Return(3));
465 EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b)));
466 EXPECT_EQ(1, m);
467 EXPECT_EQ(2, n);
468 EXPECT_EQ('a', a);
469 EXPECT_EQ('b', b);
470}
Here is the call graph for this function:

◆ TEST() [36/77]

testing::gmock_generated_actions_test::TEST ( DoAllTest ,
FourActions  )

Definition at line 441 of file gmock-generated-actions_test.cc.

441 {
442 int m = 0, n = 0;
443 char ch = '\0';
444 Action<int(int*, int*, char*)> a = // NOLINT
445 DoAll(SetArgPointee<0>(1),
446 SetArgPointee<1>(2),
447 SetArgPointee<2>('a'),
448 Return(3));
449 EXPECT_EQ(3, a.Perform(make_tuple(&m, &n, &ch)));
450 EXPECT_EQ(1, m);
451 EXPECT_EQ(2, n);
452 EXPECT_EQ('a', ch);
453}
Here is the call graph for this function:

◆ TEST() [37/77]

testing::gmock_generated_actions_test::TEST ( DoAllTest ,
NineActions  )

Definition at line 537 of file gmock-generated-actions_test.cc.

537 {
538 int m = 0, n = 0;
539 char a = '\0', b = '\0', c = '\0', d = '\0', e = '\0', f = '\0';
540 Action<int(int*, int*, char*, char*, char*, char*, // NOLINT
541 char*, char*)> action =
542 DoAll(SetArgPointee<0>(1),
543 SetArgPointee<1>(2),
544 SetArgPointee<2>('a'),
545 SetArgPointee<3>('b'),
546 SetArgPointee<4>('c'),
547 SetArgPointee<5>('d'),
548 SetArgPointee<6>('e'),
549 SetArgPointee<7>('f'),
550 Return(3));
551 EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c, &d, &e, &f)));
552 EXPECT_EQ(1, m);
553 EXPECT_EQ(2, n);
554 EXPECT_EQ('a', a);
555 EXPECT_EQ('b', b);
556 EXPECT_EQ('c', c);
557 EXPECT_EQ('d', d);
558 EXPECT_EQ('e', e);
559 EXPECT_EQ('f', f);
560}
Here is the call graph for this function:

◆ TEST() [38/77]

testing::gmock_generated_actions_test::TEST ( DoAllTest ,
SevenActions  )

Definition at line 492 of file gmock-generated-actions_test.cc.

492 {
493 int m = 0, n = 0;
494 char a = '\0', b = '\0', c = '\0', d = '\0';
495 Action<int(int*, int*, char*, char*, char*, char*)> action = // NOLINT
496 DoAll(SetArgPointee<0>(1),
497 SetArgPointee<1>(2),
498 SetArgPointee<2>('a'),
499 SetArgPointee<3>('b'),
500 SetArgPointee<4>('c'),
501 SetArgPointee<5>('d'),
502 Return(3));
503 EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c, &d)));
504 EXPECT_EQ(1, m);
505 EXPECT_EQ(2, n);
506 EXPECT_EQ('a', a);
507 EXPECT_EQ('b', b);
508 EXPECT_EQ('c', c);
509 EXPECT_EQ('d', d);
510}
Here is the call graph for this function:

◆ TEST() [39/77]

testing::gmock_generated_actions_test::TEST ( DoAllTest ,
SixActions  )

Definition at line 473 of file gmock-generated-actions_test.cc.

473 {
474 int m = 0, n = 0;
475 char a = '\0', b = '\0', c = '\0';
476 Action<int(int*, int*, char*, char*, char*)> action = // NOLINT
477 DoAll(SetArgPointee<0>(1),
478 SetArgPointee<1>(2),
479 SetArgPointee<2>('a'),
480 SetArgPointee<3>('b'),
481 SetArgPointee<4>('c'),
482 Return(3));
483 EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c)));
484 EXPECT_EQ(1, m);
485 EXPECT_EQ(2, n);
486 EXPECT_EQ('a', a);
487 EXPECT_EQ('b', b);
488 EXPECT_EQ('c', c);
489}
Here is the call graph for this function:

◆ TEST() [40/77]

testing::gmock_generated_actions_test::TEST ( DoAllTest ,
TenActions  )

Definition at line 563 of file gmock-generated-actions_test.cc.

563 {
564 int m = 0, n = 0;
565 char a = '\0', b = '\0', c = '\0', d = '\0';
566 char e = '\0', f = '\0', g = '\0';
567 Action<int(int*, int*, char*, char*, char*, char*, // NOLINT
568 char*, char*, char*)> action =
569 DoAll(SetArgPointee<0>(1),
570 SetArgPointee<1>(2),
571 SetArgPointee<2>('a'),
572 SetArgPointee<3>('b'),
573 SetArgPointee<4>('c'),
574 SetArgPointee<5>('d'),
575 SetArgPointee<6>('e'),
576 SetArgPointee<7>('f'),
577 SetArgPointee<8>('g'),
578 Return(3));
579 EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c, &d, &e, &f, &g)));
580 EXPECT_EQ(1, m);
581 EXPECT_EQ(2, n);
582 EXPECT_EQ('a', a);
583 EXPECT_EQ('b', b);
584 EXPECT_EQ('c', c);
585 EXPECT_EQ('d', d);
586 EXPECT_EQ('e', e);
587 EXPECT_EQ('f', f);
588 EXPECT_EQ('g', g);
589}
Here is the call graph for this function:

◆ TEST() [41/77]

testing::gmock_generated_actions_test::TEST ( DoAllTest ,
ThreeActions  )

Definition at line 430 of file gmock-generated-actions_test.cc.

430 {
431 int m = 0, n = 0;
432 Action<int(int*, int*)> a = DoAll(SetArgPointee<0>(1), // NOLINT
433 SetArgPointee<1>(2),
434 Return(3));
435 EXPECT_EQ(3, a.Perform(make_tuple(&m, &n)));
436 EXPECT_EQ(1, m);
437 EXPECT_EQ(2, n);
438}
Here is the call graph for this function:

◆ TEST() [42/77]

testing::gmock_generated_actions_test::TEST ( DoAllTest ,
TwoActions  )

Definition at line 421 of file gmock-generated-actions_test.cc.

421 {
422 int n = 0;
423 Action<int(int*)> a = DoAll(SetArgPointee<0>(1), // NOLINT
424 Return(2));
425 EXPECT_EQ(2, a.Perform(make_tuple(&n)));
426 EXPECT_EQ(1, n);
427}
Here is the call graph for this function:

◆ TEST() [43/77]

testing::gmock_generated_actions_test::TEST ( InvokeArgumentTest ,
ByConstReferenceFunction  )

Definition at line 261 of file gmock-generated-actions_test.cc.

261 {
262 Action<bool(bool (*function)(const std::string& s))> a = // NOLINT
263 InvokeArgument<0>(std::string("Hi"));
264 // When action 'a' is constructed, it makes a copy of the temporary
265 // string object passed to it, so it's OK to use 'a' later, when the
266 // temporary object has already died.
267 EXPECT_TRUE(a.Perform(make_tuple(&ByConstRef)));
268}
#define EXPECT_TRUE(condition)
Definition gtest.h:1895
Here is the call graph for this function:

◆ TEST() [44/77]

testing::gmock_generated_actions_test::TEST ( InvokeArgumentTest ,
ByExplicitConstReferenceFunction  )

Definition at line 272 of file gmock-generated-actions_test.cc.

272 {
273 Action<bool(bool(*)(const double& x))> a = // NOLINT
274 InvokeArgument<0>(ByRef(g_double));
275 // The above line calls ByRef() on a const value.
276 EXPECT_TRUE(a.Perform(make_tuple(&ReferencesGlobalDouble)));
277
278 double x = 0;
279 a = InvokeArgument<0>(ByRef(x)); // This calls ByRef() on a non-const.
280 EXPECT_FALSE(a.Perform(make_tuple(&ReferencesGlobalDouble)));
281}
Here is the call graph for this function:

◆ TEST() [45/77]

testing::gmock_generated_actions_test::TEST ( InvokeArgumentTest ,
ByPointerFunction  )

Definition at line 246 of file gmock-generated-actions_test.cc.

246 {
247 Action<const char*(const char*(*)(const char* input, short n))> a = // NOLINT
248 InvokeArgument<0>(static_cast<const char*>("Hi"), Short(1));
249 EXPECT_STREQ("i", a.Perform(make_tuple(&Binary)));
250}
Here is the call graph for this function:

◆ TEST() [46/77]

testing::gmock_generated_actions_test::TEST ( InvokeArgumentTest ,
Function0  )

Definition at line 170 of file gmock-generated-actions_test.cc.

170 {
171 Action<int(int, int(*)())> a = InvokeArgument<1>(); // NOLINT
172 EXPECT_EQ(1, a.Perform(make_tuple(2, &Nullary)));
173}
Here is the call graph for this function:

◆ TEST() [47/77]

testing::gmock_generated_actions_test::TEST ( InvokeArgumentTest ,
Function10  )

Definition at line 237 of file gmock-generated-actions_test.cc.

237 {
238 Action<std::string(std::string(*)(
239 const char*, const char*, const char*, const char*, const char*,
240 const char*, const char*, const char*, const char*, const char*))>
241 a = InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7", "8", "9", "0");
242 EXPECT_EQ("1234567890", a.Perform(make_tuple(&Concat10)));
243}
Here is the call graph for this function:

◆ TEST() [48/77]

testing::gmock_generated_actions_test::TEST ( InvokeArgumentTest ,
Function5  )

Definition at line 182 of file gmock-generated-actions_test.cc.

182 {
183 Action<int(int(*)(int, int, int, int, int))> a = // NOLINT
184 InvokeArgument<0>(10000, 2000, 300, 40, 5);
185 EXPECT_EQ(12345, a.Perform(make_tuple(&SumOf5)));
186}
Here is the call graph for this function:

◆ TEST() [49/77]

testing::gmock_generated_actions_test::TEST ( InvokeArgumentTest ,
Function6  )

Definition at line 196 of file gmock-generated-actions_test.cc.

196 {
197 Action<int(int(*)(int, int, int, int, int, int))> a = // NOLINT
198 InvokeArgument<0>(100000, 20000, 3000, 400, 50, 6);
199 EXPECT_EQ(123456, a.Perform(make_tuple(&SumOf6)));
200}
Here is the call graph for this function:

◆ TEST() [50/77]

testing::gmock_generated_actions_test::TEST ( InvokeArgumentTest ,
Function7  )

Definition at line 210 of file gmock-generated-actions_test.cc.

210 {
211 Action<std::string(std::string(*)(const char*, const char*, const char*,
212 const char*, const char*, const char*,
213 const char*))>
214 a = InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7");
215 EXPECT_EQ("1234567", a.Perform(make_tuple(&Concat7)));
216}
Here is the call graph for this function:

◆ TEST() [51/77]

testing::gmock_generated_actions_test::TEST ( InvokeArgumentTest ,
Function8  )

Definition at line 219 of file gmock-generated-actions_test.cc.

219 {
220 Action<std::string(std::string(*)(const char*, const char*, const char*,
221 const char*, const char*, const char*,
222 const char*, const char*))>
223 a = InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7", "8");
224 EXPECT_EQ("12345678", a.Perform(make_tuple(&Concat8)));
225}
Here is the call graph for this function:

◆ TEST() [52/77]

testing::gmock_generated_actions_test::TEST ( InvokeArgumentTest ,
Function9  )

Definition at line 228 of file gmock-generated-actions_test.cc.

228 {
229 Action<std::string(std::string(*)(const char*, const char*, const char*,
230 const char*, const char*, const char*,
231 const char*, const char*, const char*))>
232 a = InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7", "8", "9");
233 EXPECT_EQ("123456789", a.Perform(make_tuple(&Concat9)));
234}
Here is the call graph for this function:

◆ TEST() [53/77]

testing::gmock_generated_actions_test::TEST ( InvokeArgumentTest ,
FunctionWithCStringLiteral  )

Definition at line 254 of file gmock-generated-actions_test.cc.

254 {
255 Action<const char*(const char*(*)(const char* input, short n))> a = // NOLINT
256 InvokeArgument<0>("Hi", Short(1));
257 EXPECT_STREQ("i", a.Perform(make_tuple(&Binary)));
258}
Here is the call graph for this function:

◆ TEST() [54/77]

testing::gmock_generated_actions_test::TEST ( InvokeArgumentTest ,
Functor1  )

Definition at line 176 of file gmock-generated-actions_test.cc.

176 {
177 Action<int(UnaryFunctor)> a = InvokeArgument<0>(true); // NOLINT
178 EXPECT_EQ(1, a.Perform(make_tuple(UnaryFunctor())));
179}

◆ TEST() [55/77]

testing::gmock_generated_actions_test::TEST ( InvokeArgumentTest ,
Functor5  )

Definition at line 189 of file gmock-generated-actions_test.cc.

189 {
190 Action<int(SumOf5Functor)> a = // NOLINT
191 InvokeArgument<0>(10000, 2000, 300, 40, 5);
192 EXPECT_EQ(12345, a.Perform(make_tuple(SumOf5Functor())));
193}

◆ TEST() [56/77]

testing::gmock_generated_actions_test::TEST ( InvokeArgumentTest ,
Functor6  )

Definition at line 203 of file gmock-generated-actions_test.cc.

203 {
204 Action<int(SumOf6Functor)> a = // NOLINT
205 InvokeArgument<0>(100000, 20000, 3000, 400, 50, 6);
206 EXPECT_EQ(123456, a.Perform(make_tuple(SumOf6Functor())));
207}

◆ TEST() [57/77]

testing::gmock_generated_actions_test::TEST ( ReturnNewTest ,
ConstructorThatTakes10Arguments  )

Definition at line 1063 of file gmock-generated-actions_test.cc.

1063 {
1065 ReturnNew<TenArgConstructorClass>(1000000000, 200000000, 30000000,
1066 4000000, 500000, 60000,
1067 7000, 800, 90, 0);
1068 TenArgConstructorClass* c = a.Perform(make_tuple());
1069 EXPECT_EQ(1234567890, c->value_);
1070 delete c;
1071}

◆ TEST() [58/77]

testing::gmock_generated_actions_test::TEST ( ReturnNewTest ,
NoArgs  )

◆ TEST() [59/77]

testing::gmock_generated_actions_test::TEST ( ReturnNewTest ,
Unary  )

Definition at line 1030 of file gmock-generated-actions_test.cc.

◆ TEST() [60/77]

testing::gmock_generated_actions_test::TEST ( ReturnNewTest ,
UnaryWorksWhenMockMethodHasArgs  )

Definition at line 1037 of file gmock-generated-actions_test.cc.

1037 {
1038 Action<UnaryConstructorClass*(bool, int)> a =
1039 ReturnNew<UnaryConstructorClass>(4000);
1040 UnaryConstructorClass* c = a.Perform(make_tuple(false, 5));
1041 EXPECT_EQ(4000, c->value_);
1042 delete c;
1043}

◆ TEST() [61/77]

testing::gmock_generated_actions_test::TEST ( ReturnNewTest ,
UnaryWorksWhenMockMethodReturnsPointerToConst  )

Definition at line 1045 of file gmock-generated-actions_test.cc.

1045 {
1046 Action<const UnaryConstructorClass*()> a =
1047 ReturnNew<UnaryConstructorClass>(4000);
1048 const UnaryConstructorClass* c = a.Perform(make_tuple());
1049 EXPECT_EQ(4000, c->value_);
1050 delete c;
1051}

◆ TEST() [62/77]

testing::gmock_generated_actions_test::TEST ( WithArgsTest ,
ArgsOfCompatibleTypes  )

Definition at line 406 of file gmock-generated-actions_test.cc.

406 {
407 Action<long(short x, char y, double z, char c)> a = // NOLINT
408 WithArgs<0, 1, 3>(Invoke(Ternary));
409 EXPECT_EQ(123, a.Perform(make_tuple(Short(100), Char(20), 5.6, Char(3))));
410}
Here is the call graph for this function:

◆ TEST() [63/77]

testing::gmock_generated_actions_test::TEST ( WithArgsTest ,
EightArgs  )

Definition at line 342 of file gmock-generated-actions_test.cc.

342 {
343 Action<std::string(const char*, const char*, const char*, const char*)> a =
344 WithArgs<0, 1, 2, 3, 0, 1, 2, 3>(Invoke(Concat8));
345 EXPECT_EQ("01230123",
346 a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
347 CharPtr("3"))));
348}
Here is the call graph for this function:

◆ TEST() [64/77]

testing::gmock_generated_actions_test::TEST ( WithArgsTest ,
FiveArgs  )

Definition at line 315 of file gmock-generated-actions_test.cc.

315 {
316 Action<std::string(const char*, const char*, const char*, const char*,
317 const char*)>
318 a = WithArgs<4, 3, 2, 1, 0>(Invoke(Concat5));
319 EXPECT_EQ("43210",
320 a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
321 CharPtr("3"), CharPtr("4"))));
322}
Here is the call graph for this function:

◆ TEST() [65/77]

testing::gmock_generated_actions_test::TEST ( WithArgsTest ,
FourArgs  )

Definition at line 306 of file gmock-generated-actions_test.cc.

306 {
307 Action<std::string(const char*, const char*, double, const char*,
308 const char*)>
309 a = WithArgs<4, 3, 1, 0>(Invoke(Concat4));
310 EXPECT_EQ("4310", a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), 2.5,
311 CharPtr("3"), CharPtr("4"))));
312}
Here is the call graph for this function:

◆ TEST() [66/77]

testing::gmock_generated_actions_test::TEST ( WithArgsTest ,
Identity  )

Definition at line 384 of file gmock-generated-actions_test.cc.

384 {
385 Action<int(int x, char y, short z)> a = // NOLINT
386 WithArgs<0, 1, 2>(Invoke(Ternary));
387 EXPECT_EQ(123, a.Perform(make_tuple(100, Char(20), Short(3))));
388}
Here is the call graph for this function:

◆ TEST() [67/77]

testing::gmock_generated_actions_test::TEST ( WithArgsTest ,
NineArgs  )

Definition at line 351 of file gmock-generated-actions_test.cc.

351 {
352 Action<std::string(const char*, const char*, const char*, const char*)> a =
353 WithArgs<0, 1, 2, 3, 1, 2, 3, 2, 3>(Invoke(Concat9));
354 EXPECT_EQ("012312323",
355 a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
356 CharPtr("3"))));
357}
Here is the call graph for this function:

◆ TEST() [68/77]

testing::gmock_generated_actions_test::TEST ( WithArgsTest ,
NonInvokeAction  )

Definition at line 376 of file gmock-generated-actions_test.cc.

376 {
377 Action<int(const std::string&, int, int)> a = // NOLINT
378 WithArgs<2, 1>(MakeAction(new SubstractAction));
379 tuple<std::string, int, int> dummy = make_tuple(std::string("hi"), 2, 10);
380 EXPECT_EQ(8, a.Perform(dummy));
381}
Action< F > MakeAction(ActionInterface< F > *impl)
Here is the call graph for this function:

◆ TEST() [69/77]

testing::gmock_generated_actions_test::TEST ( WithArgsTest ,
OneArg  )

Definition at line 284 of file gmock-generated-actions_test.cc.

284 {
285 Action<bool(double x, int n)> a = WithArgs<1>(Invoke(Unary)); // NOLINT
286 EXPECT_TRUE(a.Perform(make_tuple(1.5, -1)));
287 EXPECT_FALSE(a.Perform(make_tuple(1.5, 1)));
288}
Here is the call graph for this function:

◆ TEST() [70/77]

testing::gmock_generated_actions_test::TEST ( WithArgsTest ,
RepeatedArguments  )

Definition at line 391 of file gmock-generated-actions_test.cc.

391 {
392 Action<int(bool, int m, int n)> a = // NOLINT
393 WithArgs<1, 1, 1, 1>(Invoke(SumOf4));
394 EXPECT_EQ(4, a.Perform(make_tuple(false, 1, 10)));
395}
Here is the call graph for this function:

◆ TEST() [71/77]

testing::gmock_generated_actions_test::TEST ( WithArgsTest ,
ReversedArgumentOrder  )

Definition at line 398 of file gmock-generated-actions_test.cc.

398 {
399 Action<const char*(short n, const char* input)> a = // NOLINT
400 WithArgs<1, 0>(Invoke(Binary));
401 const char s[] = "Hello";
402 EXPECT_EQ(s + 2, a.Perform(make_tuple(Short(2), CharPtr(s))));
403}
Here is the call graph for this function:

◆ TEST() [72/77]

testing::gmock_generated_actions_test::TEST ( WithArgsTest ,
SevenArgs  )

Definition at line 333 of file gmock-generated-actions_test.cc.

333 {
334 Action<std::string(const char*, const char*, const char*, const char*)> a =
335 WithArgs<0, 1, 2, 3, 2, 1, 0>(Invoke(Concat7));
336 EXPECT_EQ("0123210",
337 a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
338 CharPtr("3"))));
339}
Here is the call graph for this function:

◆ TEST() [73/77]

testing::gmock_generated_actions_test::TEST ( WithArgsTest ,
SixArgs  )

Definition at line 325 of file gmock-generated-actions_test.cc.

325 {
326 Action<std::string(const char*, const char*, const char*)> a =
327 WithArgs<0, 1, 2, 2, 1, 0>(Invoke(Concat6));
328 EXPECT_EQ("012210",
329 a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"))));
330}
Here is the call graph for this function:

◆ TEST() [74/77]

testing::gmock_generated_actions_test::TEST ( WithArgsTest ,
TenArgs  )

Definition at line 360 of file gmock-generated-actions_test.cc.

360 {
361 Action<std::string(const char*, const char*, const char*, const char*)> a =
362 WithArgs<0, 1, 2, 3, 2, 1, 0, 1, 2, 3>(Invoke(Concat10));
363 EXPECT_EQ("0123210123",
364 a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
365 CharPtr("3"))));
366}
Here is the call graph for this function:

◆ TEST() [75/77]

testing::gmock_generated_actions_test::TEST ( WithArgsTest ,
ThreeArgs  )

Definition at line 299 of file gmock-generated-actions_test.cc.

299 {
300 Action<int(int, double, char, short)> a = // NOLINT
301 WithArgs<0, 2, 3>(Invoke(Ternary));
302 EXPECT_EQ(123, a.Perform(make_tuple(100, 6.5, Char(20), Short(3))));
303}
Here is the call graph for this function:

◆ TEST() [76/77]

testing::gmock_generated_actions_test::TEST ( WithArgsTest ,
TwoArgs  )

Definition at line 291 of file gmock-generated-actions_test.cc.

291 {
292 Action<const char*(const char* s, double x, short n)> a =
293 WithArgs<0, 2>(Invoke(Binary));
294 const char s[] = "Hello";
295 EXPECT_EQ(s + 2, a.Perform(make_tuple(CharPtr(s), 0.5, Short(2))));
296}
Here is the call graph for this function:

◆ TEST() [77/77]

testing::gmock_generated_actions_test::TEST ( WithArgsTest ,
VoidAction  )

Definition at line 413 of file gmock-generated-actions_test.cc.

413 {
414 Action<void(double x, char c, int n)> a = WithArgs<2, 1>(Invoke(VoidBinary));
415 g_done = false;
416 a.Perform(make_tuple(1.5, 'a', 3));
417 EXPECT_TRUE(g_done);
418}
Here is the call graph for this function:

◆ Unary()

bool testing::gmock_generated_actions_test::Unary ( int x)

Definition at line 80 of file gmock-generated-actions_test.cc.

80{ return x < 0; }

◆ VoidBinary()

void testing::gmock_generated_actions_test::VoidBinary ( int ,
char  )

Definition at line 97 of file gmock-generated-actions_test.cc.

97{ g_done = true; }
Here is the caller graph for this function:

◆ VoidTernary()

void testing::gmock_generated_actions_test::VoidTernary ( int ,
char ,
bool  )

Definition at line 101 of file gmock-generated-actions_test.cc.

101{ g_done = true; }

Variable Documentation

◆ g_done

bool testing::gmock_generated_actions_test::g_done = false

Definition at line 78 of file gmock-generated-actions_test.cc.

◆ g_double

const double testing::gmock_generated_actions_test::g_double = 0

Definition at line 86 of file gmock-generated-actions_test.cc.