• Home
  • Raw
  • Download

Lines Matching full:action

55 using testing::Action;
193 Action<int()> a = Invoke(Nullary); // NOLINT in TEST()
199 Action<bool(int)> a = Invoke(Unary); // NOLINT in TEST()
206 Action<const char*(const char*, short)> a = Invoke(Binary); // NOLINT in TEST()
213 Action<int(int, char, short)> a = Invoke(Ternary); // NOLINT in TEST()
219 Action<int(int, int, int, int)> a = Invoke(SumOf4); // NOLINT in TEST()
225 Action<int(int, int, int, int, int)> a = Invoke(SumOf5); // NOLINT in TEST()
231 Action<int(int, int, int, int, int, int)> a = Invoke(SumOf6); // NOLINT in TEST()
242 Action<std::string(const char*, const char*, const char*, const char*, 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()
276 Action<std::string(const char*, const char*, const char*, const char*, in TEST()
289 Action<int(int, int, double, const std::string&)> a1 = Invoke(SumOfFirst2); in TEST()
294 Action<int(int, int, bool, int*)> a2 = Invoke(SumOfFirst2); in TEST()
302 Action<int(std::string, bool, int, int)> a1 = Invoke(&foo, &Foo::SumOfLast2); in TEST()
305 Action<int(char, double, int, int)> a2 = Invoke(&foo, &Foo::SumOfLast2); in TEST()
311 Action<long(long, int)> a = Invoke(plus<long>()); // NOLINT in TEST()
315 // Tests using Invoke(f) as an action of a compatible type.
317 Action<long(int, short, char, bool)> a = Invoke(SumOf4); // NOLINT in TEST()
326 Action<int()> a = Invoke(&foo, &Foo::Nullary); // NOLINT in TEST()
333 Action<short(long)> a = Invoke(&foo, &Foo::Unary); // NOLINT in TEST()
340 Action<std::string(const std::string&, char)> a = Invoke(&foo, &Foo::Binary); in TEST()
349 Action<int(int, bool, char)> a = Invoke(&foo, &Foo::Ternary); // NOLINT in TEST()
356 Action<int(int, int, int, int)> a = Invoke(&foo, &Foo::SumOf4); // NOLINT in TEST()
363 Action<int(int, int, int, int, int)> a = in TEST()
371 Action<int(int, int, int, int, int, int)> a = // NOLINT in TEST()
380 Action<std::string(const char*, const char*, const char*, const char*, in TEST()
392 Action<std::string(const char*, const char*, const char*, const char*, in TEST()
404 Action<std::string(const char*, const char*, const char*, const char*, in TEST()
417 Action<std::string(const char*, const char*, const char*, const char*, in TEST()
428 // Tests using Invoke(f) as an action of a compatible type.
431 Action<long(int, short, char, bool)> a = // NOLINT in TEST()
436 // Tests using WithoutArgs with an action that takes no argument.
438 Action<int(int n)> a = WithoutArgs(Invoke(Nullary)); // NOLINT in TEST()
442 // Tests using WithArg with an action that takes 1 argument.
444 Action<bool(double x, int n)> b = WithArg<1>(Invoke(Unary)); // NOLINT in TEST()
450 const Action<int(int)> a = ReturnArg<0>(); in TEST()
455 const Action<bool(bool, bool, bool)> a = ReturnArg<0>(); in TEST()
460 const Action<std::string(int, int, std::string, int)> a = ReturnArg<2>(); in TEST()
465 const Action<std::string&(std::string&)> a = ReturnArg<0>(); in TEST()
472 const Action<void(int n)> a1 = SaveArg<0>(&result); in TEST()
479 const Action<void(bool, char)> a1 = SaveArg<1>(&result); in TEST()
487 const Action<void(const int*)> a1 = SaveArgPointee<0>(&result); in TEST()
495 const Action<void(bool, char*)> a1 = SaveArgPointee<1>(&result); in TEST()
502 const Action<void(int&)> a1 = SetArgReferee<0>(1); in TEST()
509 const Action<void(int, int&)> a1 = SetArgReferee<1>('a'); in TEST()
516 const Action<void(bool, int, int&, const char*)> a1 = SetArgReferee<2>('a'); in TEST()
539 const Action<void(DeletionTester*)> a1 = DeleteArg<0>(); // NOLINT in TEST()
548 const Action<void(bool, int, int, const char*, bool, int, int, int, int, in TEST()
559 const Action<void(int n)> a = Throw('a'); in TEST()
566 const Action<double(char ch)> a = Throw(MyException()); in TEST()
571 const Action<double()> a = Throw(MyException()); in TEST()
609 Action<MyFunction> a = SetArrayArgument<1>(numbers, numbers + 3); in TEST()
645 Action<MyFunction> a = SetArrayArgument<1>(numbers, numbers); in TEST()
661 Action<MyFunction> a = SetArrayArgument<1>(chars, chars + 3); in TEST()
676 Action<MyFunction> a = SetArrayArgument<1>(letters.begin(), letters.end()); in TEST()
685 const Action<int()> a = ReturnPointee(&n); in TEST()
696 Action<int(int, int (*)())> a = InvokeArgument<1>(); // NOLINT in TEST()
702 Action<int(UnaryFunctor)> a = InvokeArgument<0>(true); // NOLINT in TEST()
708 Action<int(int (*)(int, int, int, int, int))> a = // NOLINT in TEST()
715 Action<int(SumOf5Functor)> a = // NOLINT in TEST()
722 Action<int(int (*)(int, int, int, int, int, int))> a = // NOLINT in TEST()
729 Action<int(SumOf6Functor)> a = // NOLINT in TEST()
736 Action<std::string(std::string(*)(const char*, const char*, const char*, in TEST()
745 Action<std::string(std::string(*)(const char*, const char*, const char*, in TEST()
754 Action<std::string(std::string(*)(const char*, const char*, const char*, in TEST()
763 Action<std::string(std::string(*)( in TEST()
772 Action<const char*(const char* (*)(const char* input, short n))> // NOLINT in TEST()
780 Action<const char*(const char* (*)(const char* input, short n))> // NOLINT in TEST()
787 Action<bool(bool (*function)(const std::string& s))> a = // NOLINT in TEST()
789 // When action 'a' is constructed, it makes a copy of the temporary in TEST()
798 Action<bool(bool (*)(const double& x))> a = // NOLINT in TEST()
811 Action<int(int*)> a = DoAll(SetArgPointee<0>(1), // NOLINT in TEST()
820 Action<int(int*, int*)> a = DoAll(SetArgPointee<0>(1), // NOLINT in TEST()
831 Action<int(int*, int*, char*)> a = // NOLINT in TEST()
844 Action<int(int*, int*, char*, char*)> action = // NOLINT in TEST() local
847 EXPECT_EQ(3, action.Perform(std::make_tuple(&m, &n, &a, &b))); in TEST()
858 Action<int(int*, int*, char*, char*, char*)> action = // NOLINT in TEST() local
861 EXPECT_EQ(3, action.Perform(std::make_tuple(&m, &n, &a, &b, &c))); in TEST()
873 Action<int(int*, int*, char*, char*, char*, char*)> action = // NOLINT in TEST() local
877 EXPECT_EQ(3, action.Perform(std::make_tuple(&m, &n, &a, &b, &c, &d))); in TEST()
890 Action<int(int*, int*, char*, char*, char*, char*, // NOLINT in TEST()
892 action = in TEST() local
896 EXPECT_EQ(3, action.Perform(std::make_tuple(&m, &n, &a, &b, &c, &d, &e))); in TEST()
910 Action<int(int*, int*, char*, char*, char*, char*, // NOLINT in TEST()
912 action = DoAll(SetArgPointee<0>(1), SetArgPointee<1>(2), in TEST() local
916 EXPECT_EQ(3, action.Perform(std::make_tuple(&m, &n, &a, &b, &c, &d, &e, &f))); in TEST()
932 Action<int(int*, int*, char*, char*, char*, char*, // NOLINT in TEST()
934 action = in TEST() local
940 3, action.Perform(std::make_tuple(&m, &n, &a, &b, &c, &d, &e, &f, &g))); in TEST()
954 Action<bool()> a = in TEST()
961 Action<int(std::unique_ptr<int>)> a = in TEST()
970 // Action<void(std::vector<int>)> isn't an in TEST()
971 // Action<void(const std::vector<int>&) but can be converted. in TEST()
972 Action<void(std::vector<int>)> first = [&] { ran_first = true; }; in TEST()
973 Action<int(std::vector<int>)> a = in TEST()
979 // The ACTION*() macros trigger warning C4100 (unreferenced formal
990 // Tests the ACTION*() macro family.
992 // Tests that ACTION() can define an action that doesn't reference the
994 ACTION(Return5) { return 5; } in ACTION() function
997 Action<double()> a1 = Return5(); in TEST()
1000 Action<int(double, bool)> a2 = Return5(); in TEST()
1004 // Tests that ACTION() can define an action that returns void.
1005 ACTION(IncrementArg1) { (*arg1)++; } in ACTION() function
1008 Action<void(int, int*)> a1 = IncrementArg1(); in TEST()
1014 // Tests that the body of ACTION() can reference the type of the
1016 ACTION(IncrementArg2) { in ACTION() function
1023 Action<void(int, bool, int*)> a1 = IncrementArg2(); in TEST()
1029 // Tests that the body of ACTION() can reference the argument tuple
1031 ACTION(Sum2) { in ACTION() function
1038 Action<int(int, char, int*)> a1 = Sum2(); in TEST()
1045 // Tests that the body of ACTION() can reference the mock function
1051 ACTION(InvokeDummy) { in ACTION() function
1058 Action<int(bool)> a1 = InvokeDummy(); in TEST()
1063 // Tests that the body of ACTION() can reference the mock function's
1065 ACTION(InvokeDummy2) { in ACTION() function
1072 Action<int(bool)> a1 = InvokeDummy2(); in TEST()
1077 // Tests that ACTION() works for arguments passed by const reference.
1078 ACTION(ReturnAddrOfConstBoolReferenceArg) { in ACTION() function
1084 Action<const bool*(int, const bool&)> a = ReturnAddrOfConstBoolReferenceArg(); in TEST()
1089 // Tests that ACTION() works for arguments passed by non-const reference.
1090 ACTION(ReturnAddrOfIntReferenceArg) { in ACTION() function
1096 Action<int*(int&, bool, int)> a = ReturnAddrOfIntReferenceArg(); in TEST()
1101 // Tests that ACTION() can be used in a namespace.
1103 ACTION(Sum) { return arg0 + arg1; } in ACTION() function
1107 Action<int(int, int)> a1 = action_test::Sum(); in TEST()
1111 // Tests that the same ACTION definition works for mock functions with
1113 ACTION(PlusTwo) { return arg0 + 2; } in ACTION() function
1116 Action<int(int)> a1 = PlusTwo(); in TEST()
1119 Action<double(float, void*)> a2 = PlusTwo(); in TEST()
1124 // Tests that ACTION_P can define a parameterized action.
1128 Action<int(int m, bool t)> a1 = Plus(9); in TEST()
1141 Action<int(char m, bool t)> a1 = TypedPlus(9); in TEST()
1145 // Tests that a parameterized action can be used in any mock function
1148 Action<std::string(const std::string& s)> a1 = Plus("tail"); in TEST()
1154 // Tests that we can use ACTION*() to define actions overloaded on the
1157 ACTION(OverloadedAction) { return arg0 ? arg1 : "hello"; } in ACTION() function
1168 using MyAction = Action<const char*(bool, const char*)>; in TEST()
1188 Action<double(int m, bool t)> a1 = Plus(100, 20, 3.4); in TEST()
1191 Action<std::string(const std::string& s)> a2 = Plus("tail", "-", ">"); in TEST()
1200 Action<int(int)> a1 = Plus(1, 2, 3, 4); in TEST()
1207 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5); in TEST()
1216 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6); in TEST()
1225 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7); in TEST()
1234 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8); in TEST()
1244 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8, 9); in TEST()
1256 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); in TEST()
1261 // Tests that the action body can promote the parameter types.
1271 Action<std::string(const char*)> no_promo = in TEST()
1273 Action<std::string(const char*)> promo = in TEST()
1282 // Defines a generic action that doesn't restrict the types of its
1323 Action<const std::string()> a1 = Concat("Hello", "1", 2); in TEST()
1330 // Verifies the type of an ACTION*.
1332 ACTION(DoFoo) {} in ACTION() function
1373 // Tests that an ACTION_P*() action can be explicitly instantiated
1387 Action<int()> a = Plus1<int&>(x); in TEST()
1418 const Action<int*()> a = CreateNew<int>(); in TEST()
1430 const Action<int*()> a = CreateNew<int>(42); in TEST()
1453 const Action<void(int*, BoolResetter*)> a = MyDeleteArg<1>(); in TEST()
1470 const Action<std::shared_ptr<int>()> a = in TEST()
1497 const Action<Giant()> a = ReturnGiant<int, bool, double, 5, true, 6, char, in TEST()
1510 const Action<int()> a = ReturnSum<int>(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); in TEST()
1514 // Tests that ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded
1517 ACTION(ReturnSum) { return 0; } in ACTION() function
1537 const Action<int()> a0 = ReturnSum(); in TEST()
1538 const Action<int()> a1 = ReturnSum(1); in TEST()
1539 const Action<int()> a2 = ReturnSum<int>(1, 2); in TEST()
1540 const Action<int()> a3 = ReturnSum<int>(1, 2, 3); in TEST()
1541 const Action<int()> a4 = ReturnSum<int, 10000>(2000, 300, 40, 5); in TEST()