Lines Matching full:action
56 using testing::Action;
204 Action<int()> a = Invoke(Nullary); // NOLINT in TEST()
210 Action<bool(int)> a = Invoke(Unary); // NOLINT in TEST()
217 Action<const char*(const char*, short)> a = Invoke(Binary); // NOLINT in TEST()
224 Action<int(int, char, short)> a = Invoke(Ternary); // NOLINT in TEST()
230 Action<int(int, int, int, int)> a = Invoke(SumOf4); // NOLINT in TEST()
236 Action<int(int, int, int, int, int)> a = Invoke(SumOf5); // NOLINT in TEST()
242 Action<int(int, int, int, int, int, int)> a = Invoke(SumOf6); // NOLINT in TEST()
253 Action<std::string(const char*, const char*, const char*, const char*, in TEST()
264 Action<std::string(const char*, const char*, const char*, const char*, in TEST()
275 Action<std::string(const char*, const char*, const char*, const char*, in TEST()
287 Action<std::string(const char*, const char*, const char*, const char*, in TEST()
300 Action<int(int, int, double, const std::string&)> a1 = Invoke(SumOfFirst2); in TEST()
305 Action<int(int, int, bool, int*)> a2 = Invoke(SumOfFirst2); in TEST()
313 Action<int(std::string, bool, int, int)> a1 = Invoke(&foo, &Foo::SumOfLast2); in TEST()
316 Action<int(char, double, int, int)> a2 = Invoke(&foo, &Foo::SumOfLast2); in TEST()
322 Action<long(long, int)> a = Invoke(plus<long>()); // NOLINT in TEST()
326 // Tests using Invoke(f) as an action of a compatible type.
328 Action<long(int, short, char, bool)> a = Invoke(SumOf4); // NOLINT in TEST()
337 Action<int()> a = Invoke(&foo, &Foo::Nullary); // NOLINT in TEST()
344 Action<short(long)> a = Invoke(&foo, &Foo::Unary); // NOLINT in TEST()
351 Action<std::string(const std::string&, char)> a = Invoke(&foo, &Foo::Binary); in TEST()
360 Action<int(int, bool, char)> a = Invoke(&foo, &Foo::Ternary); // NOLINT in TEST()
367 Action<int(int, int, int, int)> a = Invoke(&foo, &Foo::SumOf4); // NOLINT in TEST()
374 Action<int(int, int, int, int, int)> a = in TEST()
382 Action<int(int, int, int, int, int, int)> a = // NOLINT in TEST()
391 Action<std::string(const char*, const char*, const char*, const char*, in TEST()
403 Action<std::string(const char*, const char*, const char*, const char*, in TEST()
415 Action<std::string(const char*, const char*, const char*, const char*, in TEST()
428 Action<std::string(const char*, const char*, const char*, const char*, in TEST()
439 // Tests using Invoke(f) as an action of a compatible type.
442 Action<long(int, short, char, bool)> a = // NOLINT in TEST()
447 // Tests using WithoutArgs with an action that takes no argument.
449 Action<int(int n)> a = WithoutArgs(Invoke(Nullary)); // NOLINT in TEST()
453 // Tests using WithArg with an action that takes 1 argument.
455 Action<bool(double x, int n)> b = WithArg<1>(Invoke(Unary)); // NOLINT in TEST()
461 const Action<int(int)> a = ReturnArg<0>(); in TEST()
466 const Action<bool(bool, bool, bool)> a = ReturnArg<0>(); in TEST()
471 const Action<std::string(int, int, std::string, int)> a = ReturnArg<2>(); in TEST()
476 const Action<std::string&(std::string&)> a = ReturnArg<0>(); in TEST()
483 const Action<void(int n)> a1 = SaveArg<0>(&result); in TEST()
490 const Action<void(bool, char)> a1 = SaveArg<1>(&result); in TEST()
498 const Action<void(const int*)> a1 = SaveArgPointee<0>(&result); in TEST()
506 const Action<void(bool, char*)> a1 = SaveArgPointee<1>(&result); in TEST()
513 const Action<void(int&)> a1 = SetArgReferee<0>(1); in TEST()
520 const Action<void(int, int&)> a1 = SetArgReferee<1>('a'); in TEST()
527 const Action<void(bool, int, int&, const char*)> a1 = SetArgReferee<2>('a'); in TEST()
550 const Action<void(DeletionTester*)> a1 = DeleteArg<0>(); // NOLINT in TEST()
559 const Action<void(bool, int, int, const char*, bool, int, int, int, int, in TEST()
570 const Action<void(int n)> a = Throw('a'); in TEST()
577 const Action<double(char ch)> a = Throw(MyException()); in TEST()
582 const Action<double()> a = Throw(MyException()); in TEST()
620 Action<MyFunction> a = SetArrayArgument<1>(numbers, numbers + 3); in TEST()
656 Action<MyFunction> a = SetArrayArgument<1>(numbers, numbers); in TEST()
672 Action<MyFunction> a = SetArrayArgument<1>(chars, chars + 3); in TEST()
687 Action<MyFunction> a = SetArrayArgument<1>(letters.begin(), letters.end()); in TEST()
696 const Action<int()> a = ReturnPointee(&n); in TEST()
707 Action<int(int, int (*)())> a = InvokeArgument<1>(); // NOLINT in TEST()
713 Action<int(UnaryFunctor)> a = InvokeArgument<0>(true); // NOLINT in TEST()
719 Action<int(UnaryMoveOnlyFunctor)> a = InvokeArgument<0>(true); // NOLINT in TEST()
725 Action<int(OneShotUnaryFunctor)> a = InvokeArgument<0>(true); // NOLINT in TEST()
731 Action<int(int (*)(int, int, int, int, int))> a = // NOLINT in TEST()
738 Action<int(SumOf5Functor)> a = // NOLINT in TEST()
745 Action<int(int (*)(int, int, int, int, int, int))> a = // NOLINT in TEST()
752 Action<int(SumOf6Functor)> a = // NOLINT in TEST()
759 Action<std::string(std::string(*)(const char*, const char*, const char*, in TEST()
768 Action<std::string(std::string(*)(const char*, const char*, const char*, in TEST()
777 Action<std::string(std::string(*)(const char*, const char*, const char*, in TEST()
786 Action<std::string(std::string(*)( in TEST()
795 Action<const char*(const char* (*)(const char* input, short n))> // NOLINT in TEST()
803 Action<const char*(const char* (*)(const char* input, short n))> // NOLINT in TEST()
810 Action<bool(bool (*function)(const std::string& s))> a = // NOLINT in TEST()
812 // When action 'a' is constructed, it makes a copy of the temporary in TEST()
821 Action<bool(bool (*)(const double& x))> a = // NOLINT in TEST()
850 Action<int(int*)> a = DoAll(SetArgPointee<0>(1), // NOLINT in TEST()
859 Action<int(int*, int*)> a = DoAll(SetArgPointee<0>(1), // NOLINT in TEST()
870 Action<int(int*, int*, char*)> a = // NOLINT in TEST()
883 Action<int(int*, int*, char*, char*)> action = // NOLINT in TEST() local
886 EXPECT_EQ(3, action.Perform(std::make_tuple(&m, &n, &a, &b))); in TEST()
897 Action<int(int*, int*, char*, char*, char*)> action = // NOLINT in TEST() local
900 EXPECT_EQ(3, action.Perform(std::make_tuple(&m, &n, &a, &b, &c))); in TEST()
912 Action<int(int*, int*, char*, char*, char*, char*)> action = // NOLINT in TEST() local
916 EXPECT_EQ(3, action.Perform(std::make_tuple(&m, &n, &a, &b, &c, &d))); in TEST()
929 Action<int(int*, int*, char*, char*, char*, char*, // NOLINT in TEST()
931 action = in TEST() local
935 EXPECT_EQ(3, action.Perform(std::make_tuple(&m, &n, &a, &b, &c, &d, &e))); in TEST()
949 Action<int(int*, int*, char*, char*, char*, char*, // NOLINT in TEST()
951 action = DoAll(SetArgPointee<0>(1), SetArgPointee<1>(2), in TEST() local
955 EXPECT_EQ(3, action.Perform(std::make_tuple(&m, &n, &a, &b, &c, &d, &e, &f))); in TEST()
971 Action<int(int*, int*, char*, char*, char*, char*, // NOLINT in TEST()
973 action = in TEST() local
979 3, action.Perform(std::make_tuple(&m, &n, &a, &b, &c, &d, &e, &f, &g))); in TEST()
993 Action<bool()> a = in TEST()
1000 Action<int(std::unique_ptr<int>)> a = in TEST()
1009 // Action<void(std::vector<int>)> isn't an in TEST()
1010 // Action<void(const std::vector<int>&) but can be converted. in TEST()
1011 Action<void(std::vector<int>)> first = [&] { ran_first = true; }; in TEST()
1012 Action<int(std::vector<int>)> a = in TEST()
1018 // The ACTION*() macros trigger warning C4100 (unreferenced formal
1025 // Tests the ACTION*() macro family.
1027 // Tests that ACTION() can define an action that doesn't reference the
1029 ACTION(Return5) { return 5; } in ACTION() function
1032 Action<double()> a1 = Return5(); in TEST()
1035 Action<int(double, bool)> a2 = Return5(); in TEST()
1039 // Tests that ACTION() can define an action that returns void.
1040 ACTION(IncrementArg1) { (*arg1)++; } in ACTION() function
1043 Action<void(int, int*)> a1 = IncrementArg1(); in TEST()
1049 // Tests that the body of ACTION() can reference the type of the
1051 ACTION(IncrementArg2) { in ACTION() function
1058 Action<void(int, bool, int*)> a1 = IncrementArg2(); in TEST()
1064 // Tests that the body of ACTION() can reference the argument tuple
1066 ACTION(Sum2) { in ACTION() function
1073 Action<int(int, char, int*)> a1 = Sum2(); in TEST()
1080 // Tests that the body of ACTION() can reference the mock function
1086 ACTION(InvokeDummy) { in ACTION() function
1093 Action<int(bool)> a1 = InvokeDummy(); in TEST()
1098 // Tests that the body of ACTION() can reference the mock function's
1100 ACTION(InvokeDummy2) { in ACTION() function
1107 Action<int(bool)> a1 = InvokeDummy2(); in TEST()
1112 // Tests that ACTION() works for arguments passed by const reference.
1113 ACTION(ReturnAddrOfConstBoolReferenceArg) { in ACTION() function
1119 Action<const bool*(int, const bool&)> a = ReturnAddrOfConstBoolReferenceArg(); in TEST()
1124 // Tests that ACTION() works for arguments passed by non-const reference.
1125 ACTION(ReturnAddrOfIntReferenceArg) { in ACTION() function
1131 Action<int*(int&, bool, int)> a = ReturnAddrOfIntReferenceArg(); in TEST()
1136 // Tests that ACTION() can be used in a namespace.
1138 ACTION(Sum) { return arg0 + arg1; } in ACTION() function
1142 Action<int(int, int)> a1 = action_test::Sum(); in TEST()
1146 // Tests that the same ACTION definition works for mock functions with
1148 ACTION(PlusTwo) { return arg0 + 2; } in ACTION() function
1151 Action<int(int)> a1 = PlusTwo(); in TEST()
1154 Action<double(float, void*)> a2 = PlusTwo(); in TEST()
1159 // Tests that ACTION_P can define a parameterized action.
1163 Action<int(int m, bool t)> a1 = Plus(9); in TEST()
1176 Action<int(char m, bool t)> a1 = TypedPlus(9); in TEST()
1180 // Tests that a parameterized action can be used in any mock function
1183 Action<std::string(const std::string& s)> a1 = Plus("tail"); in TEST()
1189 // Tests that we can use ACTION*() to define actions overloaded on the
1192 ACTION(OverloadedAction) { return arg0 ? arg1 : "hello"; } in ACTION() function
1203 using MyAction = Action<const char*(bool, const char*)>; in TEST()
1223 Action<double(int m, bool t)> a1 = Plus(100, 20, 3.4); in TEST()
1226 Action<std::string(const std::string& s)> a2 = Plus("tail", "-", ">"); in TEST()
1235 Action<int(int)> a1 = Plus(1, 2, 3, 4); in TEST()
1242 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5); in TEST()
1251 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6); in TEST()
1260 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7); in TEST()
1269 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8); in TEST()
1279 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8, 9); in TEST()
1291 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); in TEST()
1296 // Tests that the action body can promote the parameter types.
1306 Action<std::string(const char*)> no_promo = in TEST()
1308 Action<std::string(const char*)> promo = in TEST()
1317 // Defines a generic action that doesn't restrict the types of its
1358 Action<const std::string()> a1 = Concat("Hello", "1", 2); in TEST()
1365 // Verifies the type of an ACTION*.
1367 ACTION(DoFoo) {} in ACTION() function
1408 // Tests that an ACTION_P*() action can be explicitly instantiated
1422 Action<int()> a = Plus1<int&>(x); in TEST()
1453 const Action<int*()> a = CreateNew<int>(); in TEST()
1465 const Action<int*()> a = CreateNew<int>(42); in TEST()
1488 const Action<void(int*, BoolResetter*)> a = MyDeleteArg<1>(); in TEST()
1505 const Action<std::shared_ptr<int>()> a = in TEST()
1532 const Action<Giant()> a = ReturnGiant<int, bool, double, 5, true, 6, char, in TEST()
1545 const Action<int()> a = ReturnSum<int>(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); in TEST()
1549 // Tests that ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded
1552 ACTION(ReturnSum) { return 0; } in ACTION() function
1572 const Action<int()> a0 = ReturnSum(); in TEST()
1573 const Action<int()> a1 = ReturnSum(1); in TEST()
1574 const Action<int()> a2 = ReturnSum<int>(1, 2); in TEST()
1575 const Action<int()> a3 = ReturnSum<int>(1, 2, 3); in TEST()
1576 const Action<int()> a4 = ReturnSum<int, 10000>(2000, 300, 40, 5); in TEST()