Home | History | Annotate | Download | only in gmock

Lines Matching refs:Function

360 // Template struct Function<F>, where F must be a function type, contains
363 // Result: the function's return type.
368 // MakeResultVoid: the function type obtained by substituting void
371 // the function type obtained by substituting Something
374 struct Function;
377 struct Function<R()> {
386 struct Function<R(A1)>
387 : Function<R()> {
396 struct Function<R(A1, A2)>
397 : Function<R(A1)> {
406 struct Function<R(A1, A2, A3)>
407 : Function<R(A1, A2)> {
416 struct Function<R(A1, A2, A3, A4)>
417 : Function<R(A1, A2, A3)> {
427 struct Function<R(A1, A2, A3, A4, A5)>
428 : Function<R(A1, A2, A3, A4)> {
438 struct Function<R(A1, A2, A3, A4, A5, A6)>
439 : Function<R(A1, A2, A3, A4, A5)> {
449 struct Function<R(A1, A2, A3, A4, A5, A6, A7)>
450 : Function<R(A1, A2, A3, A4, A5, A6)> {
460 struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8)>
461 : Function<R(A1, A2, A3, A4, A5, A6, A7)> {
471 struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)>
472 : Function<R(A1, A2, A3, A4, A5, A6, A7, A8)> {
484 struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>
485 : Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
731 // inline this function to prevent it from showing up in the stack
781 // function calls will be inlined by the compiler and need to be
862 // function call '[testing::internal::NativeArray<char *>].NativeArray(
921 // 2. a factory function that creates an Action object from a
937 // function will abort the process.
941 // This function returns true iff type T has a built-in default value.
945 "Default action undefined for the function return type.");
948 // order for this function to compile.
1015 // When an unexpected function call is encountered, Google Mock will
1023 // destructible (i.e. anything that can be used as a function return
1116 // Implement this interface to define an action for function type F.
1120 typedef typename internal::Function<F>::Result Result;
1121 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
1137 // object that represents an action to be taken when a mock function
1148 typedef typename internal::Function<F>::Result Result;
1149 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
1231 typedef typename internal::Function<F>::Result Result;
1232 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
1277 typedef typename internal::Function<F1>::Result Result;
1278 typedef typename internal::Function<F1>::ArgumentTuple ArgumentTuple;
1293 // any function that returns the type of x, regardless of the argument
1297 // Function<F>::Result when this action is cast to Action<F> rather than
1325 // used in ANY function that returns x's type.
1336 typedef typename Function<F>::Result Result;
1344 // Implements the Return(x) action for a particular function type F.
1348 typedef typename Function<F>::Result Result;
1349 typedef typename Function<F>::ArgumentTuple ArgumentTuple;
1379 // Allows ReturnNull() to be used in any pointer-returning function.
1391 // Allows Return() to be used in any void-returning function.
1399 // in any function that returns a reference to the type of x,
1408 // used in ANY function that returns a reference to x's type.
1411 typedef typename Function<F>::Result Result;
1412 // Asserts that the function return type is a reference. This
1421 // Implements the ReturnRef(x) action for a particular function type F.
1425 typedef typename Function<F>::Result Result;
1426 typedef typename Function<F>::ArgumentTuple ArgumentTuple;
1446 // used in any function that returns a reference to the type of x,
1456 // used in ANY function that returns a reference to x's type.
1459 typedef typename Function<F>::Result Result;
1460 // Asserts that the function return type is a reference. This
1470 // Implements the ReturnRefOfCopy(x) action for a particular function type F.
1474 typedef typename Function<F>::Result Result;
1475 typedef typename Function<F>::ArgumentTuple ArgumentTuple;
1498 // used in any function.
1547 // Implements the SetArgumentPointee<N>(x) action for any function
1555 // N-th function argument to 'value'.
1574 // N-th function argument to 'proto'. Both ProtocolMessage and
1595 // function pointer or a functor. InvokeWithoutArgs(f) can be used as an
1597 // assigned to a tr1::function<F>).
1601 // The c'tor makes a copy of function_impl (either a function
1652 typedef typename internal::Function<F>::Result Result;
1664 typedef typename internal::Function<F>::Result Result;
1665 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
1677 typedef typename internal::Function<F>::MakeResultIgnoredValue
1726 // to be used in ANY function of compatible type.
1733 // Implements the DoAll(...) action for a particular function type F.
1737 typedef typename Function<F>::Result Result;
1738 typedef typename Function<F>::ArgumentTuple ArgumentTuple;
1739 typedef typename Function<F>::MakeResultVoid VoidResult;
1766 // mock function arguments. For example, given
1818 // Creates an action that returns from a void function.
1837 // Creates an action that does the default action for the give mock function.
1843 // (0-based) function argument to 'value'.
1993 // 2. a factory function that creates a Cardinality object from a
2021 // object that specifies how many times a mock function is expected to
2134 // function or method with the unpacked values, where F is a function
2142 template <typename Function>
2143 static R Invoke(Function function, const ::std::tr1::tuple<>&) {
2144 return function();
2158 template <typename Function>
2159 static R Invoke(Function function, const ::std::tr1::tuple<A1>& args) {
2161 return function(get<0>(args));
2176 template <typename Function>
2177 static R Invoke(Function function, const ::std::tr1::tuple<A1, A2>& args) {
2179 return function(get<0>(args), get<1>(args));
2194 template <typename Function>
2195 static R Invoke(Function function, const ::std::tr1::tuple<A1, A2,
2198 return function(get<0>(args), get<1>(args), get<2>(args));
2213 template <typename Function>
2214 static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3,
2217 return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args));
2234 template <typename Function>
2235 static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
2238 return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),
2256 template <typename Function>
2257 static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
2260 return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),
2278 template <typename Function>
2279 static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
2282 return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),
2301 template <typename Function>
2302 static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
2305 return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),
2324 template <typename Function>
2325 static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
2328 return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),
2350 template <typename Function>
2351 static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
2354 return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),
2372 // i.e. function pointers and functors. It uses overloading to
2385 template <typename Function>
2386 static R Call(Function function) { return function(); }
2392 // parameter as 'const A1& a1' and write Call(function, "Hi"), the
2396 // is 'const char*' when it sees Call(function, "Hi").
2398 // Since this function is defined inline, the compiler can get rid
2401 template <typename Function, typename A1>
2402 static R Call(Function function, A1 a1) { return function(a1); }
2405 template <typename Function, typename A1, typename A2>
2406 static R Call(Function function, A1 a1, A2 a2) {
2407 return function(a1, a2);
2411 template <typename Function, typename A1, typename A2, typename A3>
2412 static R Call(Function function, A1 a1, A2 a2, A3 a3) {
2413 return function(a1, a2, a3);
2417 template <typename Function, typename A1, typename A2, typename A3,
2419 static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4) {
2420 return function(a1, a2, a3, a4);
2424 template <typename Function, typename A1, typename A2, typename A3,
2426 static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) {
2427 return function(a1, a2, a3, a4, a5);
2431 template <typename Function, typename A1, typename A2, typename A3,
2433 static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {
2434 return function(a1, a2, a3, a4, a5, a6);
2438 template <typename Function, typename A1, typename A2, typename A3,
2440 static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
2442 return function(a1, a2, a3, a4, a5, a6, a7);
2446 template <typename Function, typename A1, typename A2, typename A3,
2448 static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
2450 return function(a1, a2, a3, a4, a5, a6, a7, a8);
2454 template <typename Function, typename A1, typename A2, typename A3,
2457 static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
2459 return function(a1, a2, a3, a4, a5, a6, a7, a8, a9);
2463 template <typename Function, typename A1, typename A2, typename A3,
2466 static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
2468 return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
2479 // type of an n-ary function whose i-th (1-based) argument type is the
2506 typedef typename Function<type>::ArgumentTuple SelectedArgs;
2520 typedef typename Function<type>::ArgumentTuple SelectedArgs;
2532 typedef typename Function<type>::ArgumentTuple SelectedArgs;
2545 typedef typename Function<type>::ArgumentTuple SelectedArgs;
2558 typedef typename Function<type>::ArgumentTuple SelectedArgs;
2573 typedef typename Function<type>::ArgumentTuple SelectedArgs;
2589 typedef typename Function<type>::ArgumentTuple SelectedArgs;
2606 typedef typename Function<type>::ArgumentTuple SelectedArgs;
2623 typedef typename Function<type>::ArgumentTuple SelectedArgs;
2641 typedef typename Function<type>::ArgumentTuple SelectedArgs;
2660 typedef typename Function<type>::ArgumentTuple SelectedArgs;
2686 typedef typename Function<F>::Result Result;
2687 typedef typename Function<F>::ArgumentTuple ArgumentTuple;
2709 // defines an action that can be used in a mock function. Typically,
2711 // function. For example, if such an action only uses the second
2712 // argument, it can be used in any mock function that takes >= 2
2844 // the selected arguments of the mock function to an_action and
2847 // function templates, so we have to overload it.
3017 // refer to the K-th (0-based) argument of the mock function by
3030 // 'args' and 'args_type', and refer to the mock function type and its
3033 // Note that you don't need to specify the types of the mock function
3037 // mock function's return type, for example.
3086 // they give you more control on the types of the mock function
3095 // that C++ doesn't yet allow function-local types to be used to
3098 // a function.
3139 // // function to type T and copies it to *output.
3480 typedef typename ::testing::internal::Function<F>::Result return_type;\
3481 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
3526 typename ::testing::internal::Function<F>::Result\
3541 typedef typename ::testing::internal::Function<F>::Result return_type;\
3542 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
3574 typename ::testing::internal::Function<F>::Result\
3587 typedef typename ::testing::internal::Function<F>::Result return_type;\
3588 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
3624 typename ::testing::internal::Function<F>::Result\
3638 typedef typename ::testing::internal::Function<F>::Result return_type;\
3639 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
3679 typename ::testing::internal::Function<F>::Result\
3693 typedef typename ::testing::internal::Function<F>::Result return_type;\
3694 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
3736 typename ::testing::internal::Function<F>::Result\
3753 typedef typename ::testing::internal::Function<F>::Result return_type;\
3754 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
3803 typename ::testing::internal::Function<F>::Result\
3821 typedef typename ::testing::internal::Function<F>::Result return_type;\
3822 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
3873 typename ::testing::internal::Function<F>::Result\
3891 typedef typename ::testing::internal::Function<F>::Result return_type;\
3892 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
3946 typename ::testing::internal::Function<F>::Result\
3966 typedef typename ::testing::internal::Function<F>::Result return_type;\
3967 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
4027 Function<F>::Result\
4048 typedef typename ::testing::internal::Function<F>::Result return_type;\
4049 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
4113 typename ::testing::internal::Function<F>::Result\
4135 typedef typename ::testing::internal::Function<F>::Result return_type;\
4136 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
4204 typename ::testing::internal::Function<F>::Result\
4227 typedef typename ::testing::internal::Function<F>::Result return_type;\
4228 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
4300 typename ::testing::internal::Function<F>::Result\
4325 // function, with arguments a1, a2, ..., a_k.
4341 // argument of the mock function takes a const string&, the action
4507 // pump.py gmock-generated-function-mockers.h.pump
4543 // This file implements function mockers of various arities.
4670 // 2. a factory function that creates a Matcher<T> object from a
4742 // Describes this matcher to an ostream. The function should print
4922 // method, and define a member function (or member function template)
5012 // for function templates but can for member function templates.
5082 // a template or function type.
5219 // function templates.).
5397 // from mistakenly using Ref(x) to match a non-reference function
5410 // mocking any function types, including those that take non-const
6110 // A helper function for converting a matcher to a predicate-formatter
6412 // Specialization for function pointers.
6420 << "NULL function pointer is passed into ResultOf().";
6429 // unary function of an object.
6896 // type with its two matchers. See Pair() function below.
7339 // callable parameter can be a function, function pointer, or a functor.
7345 // * If it is a function object, it has to define type result_type.
7356 // ResultOf(Function, m)
7357 // to compile where Function() returns an int32 and m is a matcher for int64.
7521 // predicate. The predicate can be any unary function or functor
7692 // Implements a mock function.
7704 // Base class for function mockers.
7707 // Protects the mock object registry (in class Mock), all function
7711 // mock function Foo() is called, it needs to consult its expectations
7713 // call a mock function (either Foo() or a different one) at the same
7716 // expectation gets picked. Therefore, we sequence all mock function
7724 // type-agnostic part of the function mocker interface. Its pure
7731 // Verifies that all expectations on this mock function have been
7737 // Clears the ON_CALL()s set on this mock function.
7768 // Returns the expectation that matches the given function arguments
7780 // Prints the given function arguments to the ostream.
7793 // name of the mock function. Will be called upon each invocation
7794 // of this mock function.
7809 // Returns the result of invoking this mock function with the given
7810 // arguments. This function can be safely called from multiple
7824 // which must be an expectation on this mock function.
7832 // Name of the function being mocked. Only valid after this mock
7836 // All default action specs for this function mocker.
7839 // All expectations for this function mocker.
7886 typedef typename Function<F>::ArgumentTuple ArgumentTuple;
7887 typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple;
7990 // Needed for a function mocker to register itself (so that we know
8300 // Describes how many times a function call matching this
8429 template <typename Function>
8452 // and can change as the mock function is called.
8466 // Impements an expectation for the given function type.
8470 typedef typename Function<F>::ArgumentTuple ArgumentTuple;
8471 typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple;
8472 typedef typename Function<F>::Result Result;
8662 template <typename Function>
8733 // be executed as currently the ExplainMatchResultTo() function
8734 // is called only when the mock function call does NOT match the
8770 // Given the arguments of a mock function call, if the call will
8786 *what << "Mock function called more times than expected - ";
8804 *what << "Mock function call matches " << source_text() <<"...\n";
8820 // function.
8836 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
8837 typedef typename internal::Function<F>::ArgumentMatcherTuple
8840 // Constructs a MockSpec object, given the function mocker object
8845 // Adds a new default action spec to the function mocker and returns
8854 // Adds a new expectation spec to the function mocker and returns
8865 template <typename Function>
8872 // The function mocker that owns this spec.
8891 // a void-typed variable or pass a void value to a function.
8930 // Performs the given mock function's default action and returns the
8935 const typename Function<F>::ArgumentTuple& args,
8946 const typename Function<F>::ArgumentTuple& args) {
8965 // Performs the given mock function's default action and returns NULL;
8969 const typename Function<F>::ArgumentTuple& args,
8979 const typename Function<F>::ArgumentTuple& args) {
8985 // The base of the function mocker class for the given function type.
8991 typedef typename Function<F>::Result Result;
8992 typedef typename Function<F>::ArgumentTuple ArgumentTuple;
8993 typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple;
8998 // function have been satisfied. If not, it will report Google Test
9008 // Returns the ON_CALL spec that matches this mock function with the
9024 // Performs the default action of this mock function on the given arguments
9037 call_description + "\n The mock function has no default action "
9070 // clears the ON_CALL()s set on this mock function.
9083 template <typename Function>
9088 // Returns the result of invoking this mock function with the given
9089 // arguments. This function can be safely called from multiple
9097 // Adds and returns a default action spec for this mock function.
9108 // Adds and returns an expectation spec for this mock function.
9131 // being described on this function mocker.
9164 *os << "Uninteresting mock function call - ";
9166 *os << " Function call: " << Name();
9170 // Returns the expectation that matches the given function arguments
9184 // action does (it can invoke an arbitrary user function or even a
9185 // mock function) and excessive locking could cause a dead lock.
9211 // Prints the given function arguments to the ostream.
9243 *os << "\nUnexpected mock function call - ";
9249 // current mock function call.
9274 // being described on this function mocker.
9279 // Thus we disallow copying function mockers. If the user really
9298 // Verifies that all expectations on this mock function have been
9316 // Const(x) is a convenient function for obtaining a const reference
9374 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
9394 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
9415 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
9436 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
9458 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
9481 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
9505 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
9530 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
9555 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
9580 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
9607 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
9638 // The result type of function type F.
9640 #define GMOCK_RESULT_(tn, F) tn ::testing::internal::Function<F>::Result
9642 // The type of argument N of function type F.
9644 #define GMOCK_ARG_(tn, F, N) tn ::testing::internal::Function<F>::Argument##N
9646 // The matcher type for argument N of function type F.
9659 tn ::testing::internal::Function<F>::ArgumentTuple>::value == 0, \
9675 tn ::testing::internal::Function<F>::ArgumentTuple>::value == 1, \
9692 tn ::testing::internal::Function<F>::ArgumentTuple>::value == 2, \
9711 tn ::testing::internal::Function<F>::ArgumentTuple>::value == 3, \
9734 tn ::testing::internal::Function<F>::ArgumentTuple>::value == 4, \
9759 tn ::testing::internal::Function<F>::ArgumentTuple>::value == 5, \
9786 tn ::testing::internal::Function<F>::ArgumentTuple>::value == 6, \
9815 tn ::testing::internal::Function<F>::ArgumentTuple>::value == 7, \
9846 tn ::testing::internal::Function<F>::ArgumentTuple>::value == 8, \
9879 tn ::testing::internal::Function<F>::ArgumentTuple>::value == 9, \
9916 tn ::testing::internal::Function<F>::ArgumentTuple>::value == 10, \
10905 // arguments for function templates, so we have to overload it.
11482 // that C++ doesn't yet allow function-local types to be used to
11485 // a function.
12338 // function pointer or a functor. Invoke(f) can be used as an
12340 // assigned to a tr1::function<F>).
12344 // The c'tor makes a copy of function_impl (either a function
12385 // function's arguments.
12394 // with the mock function's arguments.
12402 // WithoutArgs(inner_action) can be used in a mock function with a
12413 // (0-based) argument of the mock function to an_action and performs
12433 // Action ReturnArg<k>() returns the k-th argument of the mock function.
12441 // mock function to *pointer.
12449 // by the k-th (0-based) argument of the mock function to *pointer.
12457 // referenced by the k-th (0-based) argument of the mock function.
12464 // a mock function whose k-th (0-based) argument is not a reference.
12479 // 4996 (Function call with parameters that may be unsafe) there.
12491 // function.
12501 // Action Throw(exception) can be used in a mock function of any type
12811 // Since Google Test is needed for Google Mock to work, this function