35 #ifndef MIR_TEST_GMOCK_FIXES_H_
36 #define MIR_TEST_GMOCK_FIXES_H_
39 #include <gmock/gmock.h>
47 class ActionResultHolder<std::unique_ptr<T>>
48 :
public UntypedActionResultHolderBase {
51 value_(std::move(a_value)) {}
58 std::unique_ptr<T> retval(std::move(value_));
60 return std::move(retval);
65 *os <<
"\n Returns: ";
67 UniversalPrinter<std::unique_ptr<T>>::Print(value_, os);
74 const FunctionMockerBase<F>* func_mocker,
75 const typename Function<F>::ArgumentTuple& args,
76 const string& call_description) {
77 return new ActionResultHolder(
78 func_mocker->PerformDefaultAction(args, call_description));
84 static ActionResultHolder*
86 const typename Function<F>::ArgumentTuple& args) {
87 return new ActionResultHolder(action.Perform(args));
91 std::unique_ptr<T>
mutable value_;
94 GTEST_DISALLOW_ASSIGN_(ActionResultHolder);
100 class DefaultValue<std::unique_ptr<T>> {
106 static bool IsSet() {
return false; }
117 static std::unique_ptr<T>
Get() {
118 return std::unique_ptr<T>();
ActionResultHolder(std::unique_ptr< T > &&a_value)
Definition: gmock_fixes.h:50
static std::unique_ptr< T > Get()
Definition: gmock_fixes.h:117
static bool IsSet()
Definition: gmock_fixes.h:106
static void Clear()
Definition: gmock_fixes.h:103
std::unique_ptr< T > GetValueAndDelete() const
Definition: gmock_fixes.h:57
static bool Exists()
Definition: gmock_fixes.h:110
virtual void PrintAsActionResult(::std::ostream *os) const
Definition: gmock_fixes.h:64
static ActionResultHolder * PerformDefaultAction(const FunctionMockerBase< F > *func_mocker, const typename Function< F >::ArgumentTuple &args, const string &call_description)
Definition: gmock_fixes.h:73
static ActionResultHolder * PerformAction(const Action< F > &action, const typename Function< F >::ArgumentTuple &args)
Definition: gmock_fixes.h:85