Lines Matching refs:Action
54 using testing::Action;
171 Action<int(int, int(*)())> a = InvokeArgument<1>(); // NOLINT
177 Action<int(UnaryFunctor)> a = InvokeArgument<0>(true); // NOLINT
183 Action<int(int(*)(int, int, int, int, int))> a = // NOLINT
190 Action<int(SumOf5Functor)> a = // NOLINT
197 Action<int(int(*)(int, int, int, int, int, int))> a = // NOLINT
204 Action<int(SumOf6Functor)> a = // NOLINT
211 Action<string(string(*)(const char*, const char*, const char*,
220 Action<string(string(*)(const char*, const char*, const char*,
229 Action<string(string(*)(const char*, const char*, const char*,
238 Action<string(string(*)(const char*, const char*, const char*,
248 Action<const char*(const char*(*)(const char* input, short n))> a = // NOLINT
256 Action<const char*(const char*(*)(const char* input, short n))> a = // NOLINT
263 Action<bool(bool(*function)(const string& s))> a = // NOLINT
265 // When action 'a' is constructed, it makes a copy of the temporary
274 Action<bool(bool(*)(const double& x))> a = // NOLINT
284 // Tests using WithArgs and with an action that takes 1 argument.
286 Action<bool(double x, int n)> a = WithArgs<1>(Invoke(Unary)); // NOLINT
291 // Tests using WithArgs with an action that takes 2 arguments.
293 Action<const char*(const char* s, double x, short n)> a =
299 // Tests using WithArgs with an action that takes 3 arguments.
301 Action<int(int, double, char, short)> a = // NOLINT
306 // Tests using WithArgs with an action that takes 4 arguments.
308 Action<string(const char*, const char*, double, const char*, const char*)> a =
314 // Tests using WithArgs with an action that takes 5 arguments.
316 Action<string(const char*, const char*, const char*,
324 // Tests using WithArgs with an action that takes 6 arguments.
326 Action<string(const char*, const char*, const char*)> a =
332 // Tests using WithArgs with an action that takes 7 arguments.
334 Action<string(const char*, const char*, const char*, const char*)> a =
341 // Tests using WithArgs with an action that takes 8 arguments.
343 Action<string(const char*, const char*, const char*, const char*)> a =
350 // Tests using WithArgs with an action that takes 9 arguments.
352 Action<string(const char*, const char*, const char*, const char*)> a =
359 // Tests using WithArgs with an action that takes 10 arguments.
361 Action<string(const char*, const char*, const char*, const char*)> a =
368 // Tests using WithArgs with an action that is not Invoke().
377 Action<int(const string&, int, int)> a = // NOLINT
384 Action<int(int x, char y, short z)> a = // NOLINT
391 Action<int(bool, int m, int n)> a = // NOLINT
398 Action<const char*(short n, const char* input)> a = // NOLINT
406 Action<long(short x, char y, double z, char c)> a = // NOLINT
411 // Tests using WithArgs with an action that returns void.
413 Action<void(double x, char c, int n)> a = WithArgs<2, 1>(Invoke(VoidBinary));
422 Action<int(int*)> a = DoAll(SetArgPointee<0>(1), // NOLINT
431 Action<int(int*, int*)> a = DoAll(SetArgPointee<0>(1), // NOLINT
443 Action<int(int*, int*, char*)> a = // NOLINT
458 Action<int(int*, int*, char*, char*)> action = // NOLINT
464 EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b)));
475 Action<int(int*, int*, char*, char*, char*)> action = // NOLINT
482 EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c)));
494 Action<int(int*, int*, char*, char*, char*, char*)> action = // NOLINT
502 EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c, &d)));
515 Action<int(int*, int*, char*, char*, char*, char*, // NOLINT
516 char*)> action =
525 EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c, &d, &e)));
539 Action<int(int*, int*, char*, char*, char*, char*, // NOLINT
540 char*, char*)> action =
550 EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c, &d, &e, &f)));
566 Action<int(int*, int*, char*, char*, char*, char*, // NOLINT
567 char*, char*, char*)> action =
578 EXPECT_EQ(3, action.Perform(make_tuple(&m, &n, &a, &b, &c, &d, &e, &f, &g)));
590 // The ACTION*() macros trigger warning C4100 (unreferenced formal
600 // Tests the ACTION*() macro family.
602 // Tests that ACTION() can define an action that doesn't reference the
604 ACTION(Return5) { return 5; }
607 Action<double()> a1 = Return5();
610 Action<int(double, bool)> a2 = Return5();
614 // Tests that ACTION() can define an action that returns void.
615 ACTION(IncrementArg1) { (*arg1)++; }
618 Action<void(int, int*)> a1 = IncrementArg1();
624 // Tests that the body of ACTION() can reference the type of the
626 ACTION(IncrementArg2) {
633 Action<void(int, bool, int*)> a1 = IncrementArg2();
639 // Tests that the body of ACTION() can reference the argument tuple
641 ACTION(Sum2) {
648 Action<int(int, char, int*)> a1 = Sum2();
653 // Tests that the body of ACTION() can reference the mock function
657 ACTION(InvokeDummy) {
664 Action<int(bool)> a1 = InvokeDummy();
669 // Tests that the body of ACTION() can reference the mock function's
671 ACTION(InvokeDummy2) {
678 Action<int(bool)> a1 = InvokeDummy2();
683 // Tests that ACTION() works for arguments passed by const reference.
684 ACTION(ReturnAddrOfConstBoolReferenceArg) {
690 Action<const bool*(int, const bool&)> a = ReturnAddrOfConstBoolReferenceArg();
695 // Tests that ACTION() works for arguments passed by non-const reference.
696 ACTION(ReturnAddrOfIntReferenceArg) {
702 Action<int*(int&, bool, int)> a = ReturnAddrOfIntReferenceArg();
707 // Tests that ACTION() can be used in a namespace.
709 ACTION(Sum) { return arg0 + arg1; }
713 Action<int(int, int)> a1 = action_test::Sum();
717 // Tests that the same ACTION definition works for mock functions with
719 ACTION(PlusTwo) { return arg0 + 2; }
722 Action<int(int)> a1 = PlusTwo();
725 Action<double(float, void*)> a2 = PlusTwo();
730 // Tests that ACTION_P can define a parameterized action.
734 Action<int(int m, bool t)> a1 = Plus(9);
747 Action<int(char m, bool t)> a1 = TypedPlus(9);
751 // Tests that a parameterized action can be used in any mock function
754 Action<std::string(const std::string& s)> a1 = Plus("tail");
759 // Tests that we can use ACTION*() to define actions overloaded on the
762 ACTION(OverloadedAction) { return arg0 ? arg1 : "hello"; }
773 typedef Action<const char*(bool, const char*)> MyAction;
793 Action<double(int m, bool t)> a1 = Plus(100, 20, 3.4);
796 Action<std::string(const std::string& s)> a2 = Plus("tail", "-", ">");
804 Action<int(int)> a1 = Plus(1, 2, 3, 4);
811 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5);
820 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6);
829 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7);
838 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8);
847 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8, 9);
858 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
863 // Tests that the action body can promote the parameter types.
873 Action<std::string(const char*)> no_promo =
875 Action<std::string(const char*)> promo =
884 // Defines a generic action that doesn't restrict the types of its
924 Action<const std::string()> a1 = Concat("Hello", "1", 2);
931 // Verifies the type of an ACTION*.
933 ACTION(DoFoo) {}
961 // Tests that an ACTION_P*() action can be explicitly instantiated
975 Action<int()> a = Plus1<int&>(x);
999 Action<NullaryConstructorClass*()> a = ReturnNew<NullaryConstructorClass>();
1013 Action<UnaryConstructorClass*()> a = ReturnNew<UnaryConstructorClass>(4000);
1020 Action<UnaryConstructorClass*(bool, int)> a =
1028 Action<const UnaryConstructorClass*()> a =
1046 Action<TenArgConstructorClass*()> a =
1063 const Action<int*()> a = CreateNew<int>();
1076 const Action<int*()> a = CreateNew<int>(42);
1099 const Action<void(int*, BoolResetter*)> a = MyDeleteArg<1>();
1117 const Action<linked_ptr<int>()> a = ReturnSmartPointer<linked_ptr>(42);
1151 const Action<Giant()> a = ReturnGiant<
1165 const Action<int()> a = ReturnSum<int>(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
1169 // Tests that ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded
1172 ACTION(ReturnSum) { return 0; }
1195 const Action<int()> a0 = ReturnSum();
1196 const Action<int()> a1 = ReturnSum(1);
1197 const Action<int()> a2 = ReturnSum<int>(1, 2);
1198 const Action<int()> a3 = ReturnSum<int>(1, 2, 3);
1199 const Action<int()> a4 = ReturnSum<int, 10000>(2000, 300, 40, 5);