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>();