Lines Matching defs:action
37 // will define an action with the given name that executes the
39 // the return value of the action. Inside the statements, you can
62 // Sometimes you'll want to parameterize the action. For that you can use
106 // a new action, you should also consider implementing ActionInterface
108 // use the action a lot. While these approaches require more work,
110 // arguments and the action parameters, which in general leads to
156 // To implement an action Foo, define:
180 "Default action undefined for the function return type.");
242 // There's no need for a default action for signed wchar_t, as that
245 // There's also no need for a default action for unsigned wchar_t, as
384 // An action that can only be used once.
386 // This is accepted by WillOnce, which doesn't require the underlying action to
388 // an rvalue reference. This allows the action to work with move-only types like
397 // // We can define an action that provides a Foo to that API. Because It
408 // // This action can be used with WillOnce.
413 // // since the action cannot correctly be used repeatedly.
417 // A less-contrived example would be an action that returns an arbitrary type,
489 // Invoke the underlying action callable with which we were constructed,
698 // Implement this interface to define an action for function type F.
708 // Performs the action. This method is not const, as in general an
709 // action can have side effects and be stateful. For example, a
710 // get-the-next-element-from-the-collection action will need to
723 // object that represents an action to be taken when a mock function of type
726 // can view an object implementing ActionInterface<F> as a concrete action
777 Action(const Action<Func>& action) // NOLINT
778 : fun_(action.fun_) {}
780 // Returns true if and only if this is the DoDefault() action.
783 // Performs the action. Note that this method is const even though
786 // another concrete action, not that the concrete action it binds to
796 // An action can be used as a OnceAction, since it's obviously safe to call it
803 Action<F> action;
806 return action.Perform(
838 // fun_ is an empty function if and only if this is the DoDefault() action.
843 // polymorphic action (i.e. an action that can be used in mock
846 // To define a polymorphic action, a user first provides a COPYABLE
859 // Then the user creates the polymorphic action using
900 // Creates a polymorphic action from its implementation. This is
951 // Implements the Return(x) action for a mock function that returns type U.
1059 // auto action = Return(std::initializer_list<std::string>{
1064 // .WillOnce(action)
1065 // .WillOnce(action)
1097 << "A ByMove() action must be performed at most once.";
1116 // Implements the ReturnNull() action.
1128 // Implements the Return() action.
1138 // Implements the polymorphic ReturnRef(x) action, which can be used
1161 // Implements the ReturnRef(x) action for a particular function type F.
1179 // Implements the polymorphic ReturnRefOfCopy(x) action, which can be
1203 // Implements the ReturnRefOfCopy(x) action for a particular function type F.
1221 // Implements the polymorphic ReturnRoundRobin(v) action, which can be
1251 // Implements the polymorphic DoDefault() action.
1262 // Implements the Assign action to set a given pointer referent to a
1281 // Implements the SetErrnoAndReturn action to simulate return from
1301 // Implements the SetArgumentPointee<N>(x) action for any function
1313 // Implements the Invoke(object_ptr, &Class::Method) action.
1326 // Implements the InvokeWithoutArgs(f) action. The template argument
1334 // Allows InvokeWithoutArgs(f) to be used as any action whose type is
1342 // Implements the InvokeWithoutArgs(object_ptr, &Class::Method) action.
1357 // Implements the IgnoreResult(action) action.
1361 explicit IgnoreResultAction(const A& action) : action_(action) {}
1388 explicit Impl(const A& action) : action_(action) {}
1391 // Performs the action and ignores its result.
1411 // The signature of the function as seen by the inner action, given an out
1412 // action with the given result and argument types.
1418 // particular action types. This is necessary for embedded actions like
1419 // DoDefault(), which rely on an action conversion operators rather than
1476 // Base case: only a single action.
1483 explicit DoAllAction(UserConstructorTag, T&& action)
1484 : final_action_(std::forward<T>(action)) {}
1487 // particular action types. This is necessary for embedded actions like
1488 // DoDefault(), which rely on an action conversion operators rather than
1513 // Recursive case: support N actions by calling the initial action and then
1521 // The type of reference that should be provided to an initial action for a
1532 // might seem surprising for the user's initial action to need to be
1582 // Both the initial action and the rest must support
1590 // Return an action that first calls the initial action with arguments
1615 // Both the initial action and the rest must support conversion to
1622 // Return an action that first calls the initial action with arguments
1782 // Creates an action that does actions a1, a2, ..., sequentially in
1783 // each invocation. All but the last action will have a readonly view of the
1787 Action&&... action) {
1789 {}, std::forward<Action>(action)...);
1792 // WithArg<k>(an_action) creates an action that passes the k-th
1794 // it. It adapts an action accepting one argument to one that accepts
1799 InnerAction&& action) {
1800 return {std::forward<InnerAction>(action)};
1803 // WithArgs<N1, N2, ..., Nk>(an_action) creates an action that passes
1809 WithArgs(InnerAction&& action) {
1810 return {std::forward<InnerAction>(action)};
1815 // argument. In other words, it adapts an action accepting no
1819 InnerAction&& action) {
1820 return {std::forward<InnerAction>(action)};
1823 // Creates an action that returns a value.
1828 // * If R is convertible to U and U is move-constructible, then the action can
1832 // action can be used with both WillOnce and WillRepeatedly.
1841 // // Return. The view is valid even after the action is performed.
1852 // Creates an action that returns NULL.
1857 // Creates an action that returns from a void function.
1862 // Creates an action that returns the reference to a variable.
1872 // Creates an action that returns the reference to a copy of the
1873 // argument. The copy is created when the action is constructed and
1874 // lives as long as the action.
1882 // Modifies the parent action (a Return() action) to perform a move of the
1891 // Creates an action that returns an element of `vals`. Calling this action will
1899 // Creates an action that returns an element of `vals`. Calling this action will
1908 // Creates an action that does the default action for the give mock function.
1913 // Creates an action that sets the variable pointed by the N-th
1926 // Creates an action that sets a pointer referent to a given value.
1934 // Creates an action that sets errno and returns the appropriate error.
1955 // Creates an action that invokes the given method on the given object
1963 // Creates an action that invokes 'function_impl' with no argument.
1970 // Creates an action that invokes the given method on the given object
1978 // Creates an action that performs an_action and throws away its
2001 // The ReturnNew<T>(a1, a2, ..., a_k) action returns a pointer to a new
2041 // iterator. The action does not take ownership of the elements in the
2056 // This action returns the value pointed to by 'pointer'.
2074 // defines an action that can be used in a mock function. Typically,
2076 // function. For example, if such an action only uses the second
2080 // Therefore, the action implementation must be prepared to take more
2125 // Impl need not be specific to the signature of action being implemented;