Googletest export

Move part of functionality of Action* class to the base one. Reduce copypaste.

Make constructor and conversion operator of Action* class independent of pump.

PiperOrigin-RevId: 288907005
This commit is contained in:
Abseil Team
2020-01-09 11:59:39 -05:00
committed by Andy Soffer
parent 8417b73322
commit c901f67ddf
3 changed files with 94 additions and 186 deletions

View File

@@ -423,9 +423,10 @@ $var macro_name = [[$if i==0 [[ACTION]] $elif i==1 [[ACTION_P]]
$else [[ACTION_P$i]]]]
#define $macro_name(name$for j [[, p$j]])\$template
class $class_name {\
class $class_name : public ::testing::internal::ActionImpl<$class_name$param_types> {\
using base_type = ::testing::internal::ActionImpl<$class_name>;\
public:\
[[$if i==1 [[explicit ]]]]$class_name($ctor_param_list)$inits {}\
using base_type::base_type;\
template <typename F>\
class gmock_Impl : public ::testing::ActionInterface<F> {\
public:\
@@ -444,9 +445,6 @@ $arg_types_and_names) const;\$param_field_decls
private:\
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
};\
template <typename F> operator ::testing::Action<F>() const {\
return ::testing::Action<F>(new gmock_Impl<F>($params));\
}\$param_field_decls2
private:\
GTEST_DISALLOW_ASSIGN_($class_name);\
};\$template