"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "googlemock/include/gmock/gmock-more-actions.h" between
googletest-release-1.11.0.tar.gz and googletest-release-1.12.0.tar.gz

About: GoogleTest is Google's (unit) testing and mocking framework for C++ tests.

gmock-more-actions.h  (googletest-release-1.11.0):gmock-more-actions.h  (googletest-release-1.12.0)
skipping to change at line 34 skipping to change at line 34
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Google Mock - a framework for writing C++ mock classes. // Google Mock - a framework for writing C++ mock classes.
// //
// This file implements some commonly used variadic actions. // This file implements some commonly used variadic actions.
// GOOGLETEST_CM0002 DO NOT DELETE // IWYU pragma: private, include "gmock/gmock.h"
// IWYU pragma: friend gmock/.*
#ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_ #ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
#define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_ #define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
#include <memory> #include <memory>
#include <utility> #include <utility>
#include "gmock/gmock-actions.h" #include "gmock/gmock-actions.h"
#include "gmock/internal/gmock-port.h" #include "gmock/internal/gmock-port.h"
skipping to change at line 131 skipping to change at line 132
// ... typename T ... // ... typename T ...
// //
// This technique conforms to the C++ standard and is portable. It // This technique conforms to the C++ standard and is portable. It
// allows us to implement action templates using O(N) code, where N is // allows us to implement action templates using O(N) code, where N is
// the maximum number of template/value parameters supported. Without // the maximum number of template/value parameters supported. Without
// using it, we'd have to devote O(N^2) amount of code to implement all // using it, we'd have to devote O(N^2) amount of code to implement all
// combinations of m and n. // combinations of m and n.
// Declares the template parameters. // Declares the template parameters.
#define GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(kind0, name0) kind0 name0 #define GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(kind0, name0) kind0 name0
#define GMOCK_INTERNAL_DECL_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \ #define GMOCK_INTERNAL_DECL_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, name1) \
name1) kind0 name0, kind1 name1 kind0 name0, kind1 name1
#define GMOCK_INTERNAL_DECL_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ #define GMOCK_INTERNAL_DECL_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
kind2, name2) kind0 name0, kind1 name1, kind2 name2 kind2, name2) \
kind0 name0, kind1 name1, kind2 name2
#define GMOCK_INTERNAL_DECL_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ #define GMOCK_INTERNAL_DECL_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
kind2, name2, kind3, name3) kind0 name0, kind1 name1, kind2 name2, \ kind2, name2, kind3, name3) \
kind3 name3 kind0 name0, kind1 name1, kind2 name2, kind3 name3
#define GMOCK_INTERNAL_DECL_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ #define GMOCK_INTERNAL_DECL_HAS_5_TEMPLATE_PARAMS( \
kind2, name2, kind3, name3, kind4, name4) kind0 name0, kind1 name1, \ kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4) \
kind2 name2, kind3 name3, kind4 name4 kind0 name0, kind1 name1, kind2 name2, kind3 name3, kind4 name4
#define GMOCK_INTERNAL_DECL_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ #define GMOCK_INTERNAL_DECL_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
kind2, name2, kind3, name3, kind4, name4, kind5, name5) kind0 name0, \ kind2, name2, kind3, name3, \
kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5 kind4, name4, kind5, name5) \
#define GMOCK_INTERNAL_DECL_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ kind0 name0, kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5
kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \ #define GMOCK_INTERNAL_DECL_HAS_7_TEMPLATE_PARAMS( \
name6) kind0 name0, kind1 name1, kind2 name2, kind3 name3, kind4 name4, \ kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, \
kind5 name5, kind6 name6 kind5, name5, kind6, name6) \
#define GMOCK_INTERNAL_DECL_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ kind0 name0, kind1 name1, kind2 name2, kind3 name3, kind4 name4, \
kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \ kind5 name5, kind6 name6
kind7, name7) kind0 name0, kind1 name1, kind2 name2, kind3 name3, \ #define GMOCK_INTERNAL_DECL_HAS_8_TEMPLATE_PARAMS( \
kind4 name4, kind5 name5, kind6 name6, kind7 name7 kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, \
#define GMOCK_INTERNAL_DECL_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ kind5, name5, kind6, name6, kind7, name7) \
kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \ kind0 name0, kind1 name1, kind2 name2, kind3 name3, kind4 name4, \
kind7, name7, kind8, name8) kind0 name0, kind1 name1, kind2 name2, \ kind5 name5, kind6 name6, kind7 name7
kind3 name3, kind4 name4, kind5 name5, kind6 name6, kind7 name7, \ #define GMOCK_INTERNAL_DECL_HAS_9_TEMPLATE_PARAMS( \
kind8 name8 kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, \
#define GMOCK_INTERNAL_DECL_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \ kind5, name5, kind6, name6, kind7, name7, kind8, name8) \
name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \ kind0 name0, kind1 name1, kind2 name2, kind3 name3, kind4 name4, \
name6, kind7, name7, kind8, name8, kind9, name9) kind0 name0, \ kind5 name5, kind6 name6, kind7 name7, kind8 name8
kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5, \ #define GMOCK_INTERNAL_DECL_HAS_10_TEMPLATE_PARAMS( \
kind6 name6, kind7 name7, kind8 name8, kind9 name9 kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, \
kind5, name5, kind6, name6, kind7, name7, kind8, name8, kind9, name9) \
kind0 name0, kind1 name1, kind2 name2, kind3 name3, kind4 name4, \
kind5 name5, kind6 name6, kind7 name7, kind8 name8, kind9 name9
// Lists the template parameters. // Lists the template parameters.
#define GMOCK_INTERNAL_LIST_HAS_1_TEMPLATE_PARAMS(kind0, name0) name0 #define GMOCK_INTERNAL_LIST_HAS_1_TEMPLATE_PARAMS(kind0, name0) name0
#define GMOCK_INTERNAL_LIST_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \ #define GMOCK_INTERNAL_LIST_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, name1) \
name1) name0, name1 name0, name1
#define GMOCK_INTERNAL_LIST_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ #define GMOCK_INTERNAL_LIST_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
kind2, name2) name0, name1, name2 kind2, name2) \
name0, name1, name2
#define GMOCK_INTERNAL_LIST_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ #define GMOCK_INTERNAL_LIST_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
kind2, name2, kind3, name3) name0, name1, name2, name3 kind2, name2, kind3, name3) \
#define GMOCK_INTERNAL_LIST_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ name0, name1, name2, name3
kind2, name2, kind3, name3, kind4, name4) name0, name1, name2, name3, \ #define GMOCK_INTERNAL_LIST_HAS_5_TEMPLATE_PARAMS( \
name4 kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4) \
name0, name1, name2, name3, name4
#define GMOCK_INTERNAL_LIST_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ #define GMOCK_INTERNAL_LIST_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
kind2, name2, kind3, name3, kind4, name4, kind5, name5) name0, name1, \ kind2, name2, kind3, name3, \
name2, name3, name4, name5 kind4, name4, kind5, name5) \
#define GMOCK_INTERNAL_LIST_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ name0, name1, name2, name3, name4, name5
kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \ #define GMOCK_INTERNAL_LIST_HAS_7_TEMPLATE_PARAMS( \
name6) name0, name1, name2, name3, name4, name5, name6 kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, \
#define GMOCK_INTERNAL_LIST_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ kind5, name5, kind6, name6) \
kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \ name0, name1, name2, name3, name4, name5, name6
kind7, name7) name0, name1, name2, name3, name4, name5, name6, name7 #define GMOCK_INTERNAL_LIST_HAS_8_TEMPLATE_PARAMS( \
#define GMOCK_INTERNAL_LIST_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \ kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, \
kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \ kind5, name5, kind6, name6, kind7, name7) \
kind7, name7, kind8, name8) name0, name1, name2, name3, name4, name5, \ name0, name1, name2, name3, name4, name5, name6, name7
name6, name7, name8 #define GMOCK_INTERNAL_LIST_HAS_9_TEMPLATE_PARAMS( \
#define GMOCK_INTERNAL_LIST_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \ kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, \
name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \ kind5, name5, kind6, name6, kind7, name7, kind8, name8) \
name6, kind7, name7, kind8, name8, kind9, name9) name0, name1, name2, \ name0, name1, name2, name3, name4, name5, name6, name7, name8
name3, name4, name5, name6, name7, name8, name9 #define GMOCK_INTERNAL_LIST_HAS_10_TEMPLATE_PARAMS( \
kind0, name0, kind1, name1, kind2, name2, kind3, name3, kind4, name4, \
kind5, name5, kind6, name6, kind7, name7, kind8, name8, kind9, name9) \
name0, name1, name2, name3, name4, name5, name6, name7, name8, name9
// Declares the types of value parameters. // Declares the types of value parameters.
#define GMOCK_INTERNAL_DECL_TYPE_AND_0_VALUE_PARAMS() #define GMOCK_INTERNAL_DECL_TYPE_AND_0_VALUE_PARAMS()
#define GMOCK_INTERNAL_DECL_TYPE_AND_1_VALUE_PARAMS(p0) , typename p0##_type #define GMOCK_INTERNAL_DECL_TYPE_AND_1_VALUE_PARAMS(p0) , typename p0##_type
#define GMOCK_INTERNAL_DECL_TYPE_AND_2_VALUE_PARAMS(p0, p1) , \ #define GMOCK_INTERNAL_DECL_TYPE_AND_2_VALUE_PARAMS(p0, p1) \
typename p0##_type, typename p1##_type , typename p0##_type, typename p1##_type
#define GMOCK_INTERNAL_DECL_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , \ #define GMOCK_INTERNAL_DECL_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) \
typename p0##_type, typename p1##_type, typename p2##_type , typename p0##_type, typename p1##_type, typename p2##_type
#define GMOCK_INTERNAL_DECL_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \ #define GMOCK_INTERNAL_DECL_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) \
typename p0##_type, typename p1##_type, typename p2##_type, \ , typename p0##_type, typename p1##_type, typename p2##_type, \
typename p3##_type typename p3##_type
#define GMOCK_INTERNAL_DECL_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \ #define GMOCK_INTERNAL_DECL_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) \
typename p0##_type, typename p1##_type, typename p2##_type, \ , typename p0##_type, typename p1##_type, typename p2##_type, \
typename p3##_type, typename p4##_type typename p3##_type, typename p4##_type
#define GMOCK_INTERNAL_DECL_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \ #define GMOCK_INTERNAL_DECL_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) \
typename p0##_type, typename p1##_type, typename p2##_type, \ , typename p0##_type, typename p1##_type, typename p2##_type, \
typename p3##_type, typename p4##_type, typename p5##_type typename p3##_type, typename p4##_type, typename p5##_type
#define GMOCK_INTERNAL_DECL_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ #define GMOCK_INTERNAL_DECL_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
p6) , typename p0##_type, typename p1##_type, typename p2##_type, \ p6) \
typename p3##_type, typename p4##_type, typename p5##_type, \ , typename p0##_type, typename p1##_type, typename p2##_type, \
typename p6##_type typename p3##_type, typename p4##_type, typename p5##_type, \
typename p6##_type
#define GMOCK_INTERNAL_DECL_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ #define GMOCK_INTERNAL_DECL_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
p6, p7) , typename p0##_type, typename p1##_type, typename p2##_type, \ p6, p7) \
typename p3##_type, typename p4##_type, typename p5##_type, \ , typename p0##_type, typename p1##_type, typename p2##_type, \
typename p6##_type, typename p7##_type typename p3##_type, typename p4##_type, typename p5##_type, \
typename p6##_type, typename p7##_type
#define GMOCK_INTERNAL_DECL_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ #define GMOCK_INTERNAL_DECL_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
p6, p7, p8) , typename p0##_type, typename p1##_type, typename p2##_type, \ p6, p7, p8) \
typename p3##_type, typename p4##_type, typename p5##_type, \ , typename p0##_type, typename p1##_type, typename p2##_type, \
typename p6##_type, typename p7##_type, typename p8##_type typename p3##_type, typename p4##_type, typename p5##_type, \
typename p6##_type, typename p7##_type, typename p8##_type
#define GMOCK_INTERNAL_DECL_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ #define GMOCK_INTERNAL_DECL_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
p6, p7, p8, p9) , typename p0##_type, typename p1##_type, \ p6, p7, p8, p9) \
typename p2##_type, typename p3##_type, typename p4##_type, \ , typename p0##_type, typename p1##_type, typename p2##_type, \
typename p5##_type, typename p6##_type, typename p7##_type, \ typename p3##_type, typename p4##_type, typename p5##_type, \
typename p8##_type, typename p9##_type typename p6##_type, typename p7##_type, typename p8##_type, \
typename p9##_type
// Initializes the value parameters. // Initializes the value parameters.
#define GMOCK_INTERNAL_INIT_AND_0_VALUE_PARAMS()\ #define GMOCK_INTERNAL_INIT_AND_0_VALUE_PARAMS() ()
() #define GMOCK_INTERNAL_INIT_AND_1_VALUE_PARAMS(p0) \
#define GMOCK_INTERNAL_INIT_AND_1_VALUE_PARAMS(p0)\ (p0##_type gmock_p0) : p0(::std::move(gmock_p0))
(p0##_type gmock_p0) : p0(::std::move(gmock_p0)) #define GMOCK_INTERNAL_INIT_AND_2_VALUE_PARAMS(p0, p1) \
#define GMOCK_INTERNAL_INIT_AND_2_VALUE_PARAMS(p0, p1)\ (p0##_type gmock_p0, p1##_type gmock_p1) \
(p0##_type gmock_p0, p1##_type gmock_p1) : p0(::std::move(gmock_p0)), \ : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1))
p1(::std::move(gmock_p1)) #define GMOCK_INTERNAL_INIT_AND_3_VALUE_PARAMS(p0, p1, p2) \
#define GMOCK_INTERNAL_INIT_AND_3_VALUE_PARAMS(p0, p1, p2)\ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2) \
(p0##_type gmock_p0, p1##_type gmock_p1, \ : p0(::std::move(gmock_p0)), \
p2##_type gmock_p2) : p0(::std::move(gmock_p0)), \ p1(::std::move(gmock_p1)), \
p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)) p2(::std::move(gmock_p2))
#define GMOCK_INTERNAL_INIT_AND_4_VALUE_PARAMS(p0, p1, p2, p3)\ #define GMOCK_INTERNAL_INIT_AND_4_VALUE_PARAMS(p0, p1, p2, p3) \
(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3) : p0(::std::move(gmock_p0)), \ p3##_type gmock_p3) \
p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ : p0(::std::move(gmock_p0)), \
p1(::std::move(gmock_p1)), \
p2(::std::move(gmock_p2)), \
p3(::std::move(gmock_p3)) p3(::std::move(gmock_p3))
#define GMOCK_INTERNAL_INIT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)\ #define GMOCK_INTERNAL_INIT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) \
(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3, p4##_type gmock_p4) : p0(::std::move(gmock_p0)), \ p3##_type gmock_p3, p4##_type gmock_p4) \
p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ : p0(::std::move(gmock_p0)), \
p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)) p1(::std::move(gmock_p1)), \
#define GMOCK_INTERNAL_INIT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)\ p2(::std::move(gmock_p2)), \
(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3(::std::move(gmock_p3)), \
p3##_type gmock_p3, p4##_type gmock_p4, \ p4(::std::move(gmock_p4))
p5##_type gmock_p5) : p0(::std::move(gmock_p0)), \ #define GMOCK_INTERNAL_INIT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) \
p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5) \
: p0(::std::move(gmock_p0)), \
p1(::std::move(gmock_p1)), \
p2(::std::move(gmock_p2)), \
p3(::std::move(gmock_p3)), \
p4(::std::move(gmock_p4)), \
p5(::std::move(gmock_p5)) p5(::std::move(gmock_p5))
#define GMOCK_INTERNAL_INIT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)\ #define GMOCK_INTERNAL_INIT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6) \
(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
p6##_type gmock_p6) : p0(::std::move(gmock_p0)), \ p6##_type gmock_p6) \
p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ : p0(::std::move(gmock_p0)), \
p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ p1(::std::move(gmock_p1)), \
p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)) p2(::std::move(gmock_p2)), \
#define GMOCK_INTERNAL_INIT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)\ p3(::std::move(gmock_p3)), \
(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p4(::std::move(gmock_p4)), \
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p5(::std::move(gmock_p5)), \
p6##_type gmock_p6, p7##_type gmock_p7) : p0(::std::move(gmock_p0)), \ p6(::std::move(gmock_p6))
p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ #define GMOCK_INTERNAL_INIT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7) \
p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
p6##_type gmock_p6, p7##_type gmock_p7) \
: p0(::std::move(gmock_p0)), \
p1(::std::move(gmock_p1)), \
p2(::std::move(gmock_p2)), \
p3(::std::move(gmock_p3)), \
p4(::std::move(gmock_p4)), \
p5(::std::move(gmock_p5)), \
p6(::std::move(gmock_p6)), \
p7(::std::move(gmock_p7)) p7(::std::move(gmock_p7))
#define GMOCK_INTERNAL_INIT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ #define GMOCK_INTERNAL_INIT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, \
p7, p8)\ p8) \
(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
p6##_type gmock_p6, p7##_type gmock_p7, \ p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8) \
p8##_type gmock_p8) : p0(::std::move(gmock_p0)), \ : p0(::std::move(gmock_p0)), \
p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ p1(::std::move(gmock_p1)), \
p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ p2(::std::move(gmock_p2)), \
p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \ p3(::std::move(gmock_p3)), \
p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)) p4(::std::move(gmock_p4)), \
p5(::std::move(gmock_p5)), \
p6(::std::move(gmock_p6)), \
p7(::std::move(gmock_p7)), \
p8(::std::move(gmock_p8))
#define GMOCK_INTERNAL_INIT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ #define GMOCK_INTERNAL_INIT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
p7, p8, p9)\ p7, p8, p9) \
(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \ p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
p9##_type gmock_p9) : p0(::std::move(gmock_p0)), \ p9##_type gmock_p9) \
p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ : p0(::std::move(gmock_p0)), \
p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ p1(::std::move(gmock_p1)), \
p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \ p2(::std::move(gmock_p2)), \
p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)), \ p3(::std::move(gmock_p3)), \
p4(::std::move(gmock_p4)), \
p5(::std::move(gmock_p5)), \
p6(::std::move(gmock_p6)), \
p7(::std::move(gmock_p7)), \
p8(::std::move(gmock_p8)), \
p9(::std::move(gmock_p9)) p9(::std::move(gmock_p9))
// Defines the copy constructor // Defines the copy constructor
#define GMOCK_INTERNAL_DEFN_COPY_AND_0_VALUE_PARAMS() \ #define GMOCK_INTERNAL_DEFN_COPY_AND_0_VALUE_PARAMS() \
{} // Avoid https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82134 {} // Avoid https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82134
#define GMOCK_INTERNAL_DEFN_COPY_AND_1_VALUE_PARAMS(...) = default; #define GMOCK_INTERNAL_DEFN_COPY_AND_1_VALUE_PARAMS(...) = default;
#define GMOCK_INTERNAL_DEFN_COPY_AND_2_VALUE_PARAMS(...) = default; #define GMOCK_INTERNAL_DEFN_COPY_AND_2_VALUE_PARAMS(...) = default;
#define GMOCK_INTERNAL_DEFN_COPY_AND_3_VALUE_PARAMS(...) = default; #define GMOCK_INTERNAL_DEFN_COPY_AND_3_VALUE_PARAMS(...) = default;
#define GMOCK_INTERNAL_DEFN_COPY_AND_4_VALUE_PARAMS(...) = default; #define GMOCK_INTERNAL_DEFN_COPY_AND_4_VALUE_PARAMS(...) = default;
#define GMOCK_INTERNAL_DEFN_COPY_AND_5_VALUE_PARAMS(...) = default; #define GMOCK_INTERNAL_DEFN_COPY_AND_5_VALUE_PARAMS(...) = default;
#define GMOCK_INTERNAL_DEFN_COPY_AND_6_VALUE_PARAMS(...) = default; #define GMOCK_INTERNAL_DEFN_COPY_AND_6_VALUE_PARAMS(...) = default;
#define GMOCK_INTERNAL_DEFN_COPY_AND_7_VALUE_PARAMS(...) = default; #define GMOCK_INTERNAL_DEFN_COPY_AND_7_VALUE_PARAMS(...) = default;
#define GMOCK_INTERNAL_DEFN_COPY_AND_8_VALUE_PARAMS(...) = default; #define GMOCK_INTERNAL_DEFN_COPY_AND_8_VALUE_PARAMS(...) = default;
#define GMOCK_INTERNAL_DEFN_COPY_AND_9_VALUE_PARAMS(...) = default; #define GMOCK_INTERNAL_DEFN_COPY_AND_9_VALUE_PARAMS(...) = default;
#define GMOCK_INTERNAL_DEFN_COPY_AND_10_VALUE_PARAMS(...) = default; #define GMOCK_INTERNAL_DEFN_COPY_AND_10_VALUE_PARAMS(...) = default;
// Declares the fields for storing the value parameters. // Declares the fields for storing the value parameters.
#define GMOCK_INTERNAL_DEFN_AND_0_VALUE_PARAMS() #define GMOCK_INTERNAL_DEFN_AND_0_VALUE_PARAMS()
#define GMOCK_INTERNAL_DEFN_AND_1_VALUE_PARAMS(p0) p0##_type p0; #define GMOCK_INTERNAL_DEFN_AND_1_VALUE_PARAMS(p0) p0##_type p0;
#define GMOCK_INTERNAL_DEFN_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0; \ #define GMOCK_INTERNAL_DEFN_AND_2_VALUE_PARAMS(p0, p1) \
p1##_type p1; p0##_type p0; \
#define GMOCK_INTERNAL_DEFN_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0; \ p1##_type p1;
p1##_type p1; p2##_type p2; #define GMOCK_INTERNAL_DEFN_AND_3_VALUE_PARAMS(p0, p1, p2) \
#define GMOCK_INTERNAL_DEFN_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0; \ p0##_type p0; \
p1##_type p1; p2##_type p2; p3##_type p3; p1##_type p1; \
#define GMOCK_INTERNAL_DEFN_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \ p2##_type p2;
p4) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; #define GMOCK_INTERNAL_DEFN_AND_4_VALUE_PARAMS(p0, p1, p2, p3) \
#define GMOCK_INTERNAL_DEFN_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \ p0##_type p0; \
p5) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \ p1##_type p1; \
p5##_type p5; p2##_type p2; \
#define GMOCK_INTERNAL_DEFN_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ p3##_type p3;
p6) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \ #define GMOCK_INTERNAL_DEFN_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) \
p5##_type p5; p6##_type p6; p0##_type p0; \
#define GMOCK_INTERNAL_DEFN_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ p1##_type p1; \
p7) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \ p2##_type p2; \
p5##_type p5; p6##_type p6; p7##_type p7; p3##_type p3; \
#define GMOCK_INTERNAL_DEFN_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ p4##_type p4;
p7, p8) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \ #define GMOCK_INTERNAL_DEFN_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) \
p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8; p0##_type p0; \
p1##_type p1; \
p2##_type p2; \
p3##_type p3; \
p4##_type p4; \
p5##_type p5;
#define GMOCK_INTERNAL_DEFN_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6) \
p0##_type p0; \
p1##_type p1; \
p2##_type p2; \
p3##_type p3; \
p4##_type p4; \
p5##_type p5; \
p6##_type p6;
#define GMOCK_INTERNAL_DEFN_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7) \
p0##_type p0; \
p1##_type p1; \
p2##_type p2; \
p3##_type p3; \
p4##_type p4; \
p5##_type p5; \
p6##_type p6; \
p7##_type p7;
#define GMOCK_INTERNAL_DEFN_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, \
p8) \
p0##_type p0; \
p1##_type p1; \
p2##_type p2; \
p3##_type p3; \
p4##_type p4; \
p5##_type p5; \
p6##_type p6; \
p7##_type p7; \
p8##_type p8;
#define GMOCK_INTERNAL_DEFN_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ #define GMOCK_INTERNAL_DEFN_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
p7, p8, p9) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \ p7, p8, p9) \
p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8; \ p0##_type p0; \
p9##_type p9; p1##_type p1; \
p2##_type p2; \
p3##_type p3; \
p4##_type p4; \
p5##_type p5; \
p6##_type p6; \
p7##_type p7; \
p8##_type p8; \
p9##_type p9;
// Lists the value parameters. // Lists the value parameters.
#define GMOCK_INTERNAL_LIST_AND_0_VALUE_PARAMS() #define GMOCK_INTERNAL_LIST_AND_0_VALUE_PARAMS()
#define GMOCK_INTERNAL_LIST_AND_1_VALUE_PARAMS(p0) p0 #define GMOCK_INTERNAL_LIST_AND_1_VALUE_PARAMS(p0) p0
#define GMOCK_INTERNAL_LIST_AND_2_VALUE_PARAMS(p0, p1) p0, p1 #define GMOCK_INTERNAL_LIST_AND_2_VALUE_PARAMS(p0, p1) p0, p1
#define GMOCK_INTERNAL_LIST_AND_3_VALUE_PARAMS(p0, p1, p2) p0, p1, p2 #define GMOCK_INTERNAL_LIST_AND_3_VALUE_PARAMS(p0, p1, p2) p0, p1, p2
#define GMOCK_INTERNAL_LIST_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0, p1, p2, p3 #define GMOCK_INTERNAL_LIST_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0, p1, p2, p3
#define GMOCK_INTERNAL_LIST_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) p0, p1, \ #define GMOCK_INTERNAL_LIST_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) \
p2, p3, p4 p0, p1, p2, p3, p4
#define GMOCK_INTERNAL_LIST_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) p0, \ #define GMOCK_INTERNAL_LIST_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) \
p1, p2, p3, p4, p5 p0, p1, p2, p3, p4, p5
#define GMOCK_INTERNAL_LIST_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ #define GMOCK_INTERNAL_LIST_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6) \
p6) p0, p1, p2, p3, p4, p5, p6 p0, p1, p2, p3, p4, p5, p6
#define GMOCK_INTERNAL_LIST_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ #define GMOCK_INTERNAL_LIST_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7) \
p7) p0, p1, p2, p3, p4, p5, p6, p7 p0, p1, p2, p3, p4, p5, p6, p7
#define GMOCK_INTERNAL_LIST_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ #define GMOCK_INTERNAL_LIST_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, \
p7, p8) p0, p1, p2, p3, p4, p5, p6, p7, p8 p8) \
p0, p1, p2, p3, p4, p5, p6, p7, p8
#define GMOCK_INTERNAL_LIST_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ #define GMOCK_INTERNAL_LIST_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
p7, p8, p9) p0, p1, p2, p3, p4, p5, p6, p7, p8, p9 p7, p8, p9) \
p0, p1, p2, p3, p4, p5, p6, p7, p8, p9
// Lists the value parameter types. // Lists the value parameter types.
#define GMOCK_INTERNAL_LIST_TYPE_AND_0_VALUE_PARAMS() #define GMOCK_INTERNAL_LIST_TYPE_AND_0_VALUE_PARAMS()
#define GMOCK_INTERNAL_LIST_TYPE_AND_1_VALUE_PARAMS(p0) , p0##_type #define GMOCK_INTERNAL_LIST_TYPE_AND_1_VALUE_PARAMS(p0) , p0##_type
#define GMOCK_INTERNAL_LIST_TYPE_AND_2_VALUE_PARAMS(p0, p1) , p0##_type, \ #define GMOCK_INTERNAL_LIST_TYPE_AND_2_VALUE_PARAMS(p0, p1) \
p1##_type , p0##_type, p1##_type
#define GMOCK_INTERNAL_LIST_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , p0##_type, \ #define GMOCK_INTERNAL_LIST_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) \
p1##_type, p2##_type , p0##_type, p1##_type, p2##_type
#define GMOCK_INTERNAL_LIST_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \ #define GMOCK_INTERNAL_LIST_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) \
p0##_type, p1##_type, p2##_type, p3##_type , p0##_type, p1##_type, p2##_type, p3##_type
#define GMOCK_INTERNAL_LIST_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \ #define GMOCK_INTERNAL_LIST_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) \
p0##_type, p1##_type, p2##_type, p3##_type, p4##_type , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type
#define GMOCK_INTERNAL_LIST_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \ #define GMOCK_INTERNAL_LIST_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) \
p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type
#define GMOCK_INTERNAL_LIST_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ #define GMOCK_INTERNAL_LIST_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
p6) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, \ p6) \
p6##_type , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, p6##_type
#define GMOCK_INTERNAL_LIST_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ #define GMOCK_INTERNAL_LIST_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
p6, p7) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \ p6, p7) \
p5##_type, p6##_type, p7##_type , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, \
p6##_type, p7##_type
#define GMOCK_INTERNAL_LIST_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ #define GMOCK_INTERNAL_LIST_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
p6, p7, p8) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \ p6, p7, p8) \
p5##_type, p6##_type, p7##_type, p8##_type , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, \
p6##_type, p7##_type, p8##_type
#define GMOCK_INTERNAL_LIST_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ #define GMOCK_INTERNAL_LIST_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
p6, p7, p8, p9) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \ p6, p7, p8, p9) \
p5##_type, p6##_type, p7##_type, p8##_type, p9##_type , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, \
p6##_type, p7##_type, p8##_type, p9##_type
// Declares the value parameters. // Declares the value parameters.
#define GMOCK_INTERNAL_DECL_AND_0_VALUE_PARAMS() #define GMOCK_INTERNAL_DECL_AND_0_VALUE_PARAMS()
#define GMOCK_INTERNAL_DECL_AND_1_VALUE_PARAMS(p0) p0##_type p0 #define GMOCK_INTERNAL_DECL_AND_1_VALUE_PARAMS(p0) p0##_type p0
#define GMOCK_INTERNAL_DECL_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0, \ #define GMOCK_INTERNAL_DECL_AND_2_VALUE_PARAMS(p0, p1) \
p1##_type p1 p0##_type p0, p1##_type p1
#define GMOCK_INTERNAL_DECL_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0, \ #define GMOCK_INTERNAL_DECL_AND_3_VALUE_PARAMS(p0, p1, p2) \
p1##_type p1, p2##_type p2 p0##_type p0, p1##_type p1, p2##_type p2
#define GMOCK_INTERNAL_DECL_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0, \ #define GMOCK_INTERNAL_DECL_AND_4_VALUE_PARAMS(p0, p1, p2, p3) \
p1##_type p1, p2##_type p2, p3##_type p3 p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3
#define GMOCK_INTERNAL_DECL_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \ #define GMOCK_INTERNAL_DECL_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) \
p4) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4 p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4
#define GMOCK_INTERNAL_DECL_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \ #define GMOCK_INTERNAL_DECL_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) \
p5) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \ p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
p5##_type p5 p5##_type p5
#define GMOCK_INTERNAL_DECL_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \ #define GMOCK_INTERNAL_DECL_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6) \
p6) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \ p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
p5##_type p5, p6##_type p6 p5##_type p5, p6##_type p6
#define GMOCK_INTERNAL_DECL_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ #define GMOCK_INTERNAL_DECL_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7) \
p7) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \ p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
p5##_type p5, p6##_type p6, p7##_type p7 p5##_type p5, p6##_type p6, p7##_type p7
#define GMOCK_INTERNAL_DECL_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ #define GMOCK_INTERNAL_DECL_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, \
p7, p8) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \ p8) \
p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8 p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8
#define GMOCK_INTERNAL_DECL_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ #define GMOCK_INTERNAL_DECL_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
p7, p8, p9) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \ p7, p8, p9) \
p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \ p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
p9##_type p9 p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, p9##_type p9
// The suffix of the class template implementing the action template. // The suffix of the class template implementing the action template.
#define GMOCK_INTERNAL_COUNT_AND_0_VALUE_PARAMS() #define GMOCK_INTERNAL_COUNT_AND_0_VALUE_PARAMS()
#define GMOCK_INTERNAL_COUNT_AND_1_VALUE_PARAMS(p0) P #define GMOCK_INTERNAL_COUNT_AND_1_VALUE_PARAMS(p0) P
#define GMOCK_INTERNAL_COUNT_AND_2_VALUE_PARAMS(p0, p1) P2 #define GMOCK_INTERNAL_COUNT_AND_2_VALUE_PARAMS(p0, p1) P2
#define GMOCK_INTERNAL_COUNT_AND_3_VALUE_PARAMS(p0, p1, p2) P3 #define GMOCK_INTERNAL_COUNT_AND_3_VALUE_PARAMS(p0, p1, p2) P3
#define GMOCK_INTERNAL_COUNT_AND_4_VALUE_PARAMS(p0, p1, p2, p3) P4 #define GMOCK_INTERNAL_COUNT_AND_4_VALUE_PARAMS(p0, p1, p2, p3) P4
#define GMOCK_INTERNAL_COUNT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) P5 #define GMOCK_INTERNAL_COUNT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) P5
#define GMOCK_INTERNAL_COUNT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) P6 #define GMOCK_INTERNAL_COUNT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) P6
#define GMOCK_INTERNAL_COUNT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6) P7 #define GMOCK_INTERNAL_COUNT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6) P7
#define GMOCK_INTERNAL_COUNT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ #define GMOCK_INTERNAL_COUNT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
p7) P8 p7) \
P8
#define GMOCK_INTERNAL_COUNT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ #define GMOCK_INTERNAL_COUNT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
p7, p8) P9 p7, p8) \
P9
#define GMOCK_INTERNAL_COUNT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ #define GMOCK_INTERNAL_COUNT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
p7, p8, p9) P10 p7, p8, p9) \
P10
// The name of the class template implementing the action template. // The name of the class template implementing the action template.
#define GMOCK_ACTION_CLASS_(name, value_params)\ #define GMOCK_ACTION_CLASS_(name, value_params) \
GTEST_CONCAT_TOKEN_(name##Action, GMOCK_INTERNAL_COUNT_##value_params) GTEST_CONCAT_TOKEN_(name##Action, GMOCK_INTERNAL_COUNT_##value_params)
#define ACTION_TEMPLATE(name, template_params, value_params) \ #define ACTION_TEMPLATE(name, template_params, value_params) \
template <GMOCK_INTERNAL_DECL_##template_params \ template <GMOCK_INTERNAL_DECL_##template_params \
GMOCK_INTERNAL_DECL_TYPE_##value_params> \ GMOCK_INTERNAL_DECL_TYPE_##value_params> \
class GMOCK_ACTION_CLASS_(name, value_params) { \ class GMOCK_ACTION_CLASS_(name, value_params) { \
public: \ public: \
explicit GMOCK_ACTION_CLASS_(name, value_params)( \ explicit GMOCK_ACTION_CLASS_(name, value_params)( \
GMOCK_INTERNAL_DECL_##value_params) \ GMOCK_INTERNAL_DECL_##value_params) \
GMOCK_PP_IF(GMOCK_PP_IS_EMPTY(GMOCK_INTERNAL_COUNT_##value_params), \ GMOCK_PP_IF(GMOCK_PP_IS_EMPTY(GMOCK_INTERNAL_COUNT_##value_params), \
= default; , \ = default; \
, \
: impl_(std::make_shared<gmock_Impl>( \ : impl_(std::make_shared<gmock_Impl>( \
GMOCK_INTERNAL_LIST_##value_params)) { }) \ GMOCK_INTERNAL_LIST_##value_params)){}) \
GMOCK_ACTION_CLASS_(name, value_params)( \ GMOCK_ACTION_CLASS_(name, value_params)(const GMOCK_ACTION_CLASS_( \
const GMOCK_ACTION_CLASS_(name, value_params)&) noexcept \ name, value_params) &) noexcept GMOCK_INTERNAL_DEFN_COPY_ \
GMOCK_INTERNAL_DEFN_COPY_##value_params \ ##value_params GMOCK_ACTION_CLASS_(name, value_params)( \
GMOCK_ACTION_CLASS_(name, value_params)( \ GMOCK_ACTION_CLASS_(name, value_params) &&) noexcept \
GMOCK_ACTION_CLASS_(name, value_params)&&) noexcept \ GMOCK_INTERNAL_DEFN_COPY_##value_params template <typename F> \
GMOCK_INTERNAL_DEFN_COPY_##value_params \ operator ::testing::Action<F>() const { \
template <typename F> \
operator ::testing::Action<F>() const { \
return GMOCK_PP_IF( \ return GMOCK_PP_IF( \
GMOCK_PP_IS_EMPTY(GMOCK_INTERNAL_COUNT_##value_params), \ GMOCK_PP_IS_EMPTY(GMOCK_INTERNAL_COUNT_##value_params), \
(::testing::internal::MakeAction<F, gmock_Impl>()), \ (::testing::internal::MakeAction<F, gmock_Impl>()), \
(::testing::internal::MakeAction<F>(impl_))); \ (::testing::internal::MakeAction<F>(impl_))); \
} \ } \
\
private: \ private: \
class gmock_Impl { \ class gmock_Impl { \
public: \ public: \
explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {} \ explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {} \
template <typename function_type, typename return_type, \ template <typename function_type, typename return_type, \
typename args_type, GMOCK_ACTION_TEMPLATE_ARGS_NAMES_> \ typename args_type, GMOCK_ACTION_TEMPLATE_ARGS_NAMES_> \
return_type gmock_PerformImpl(GMOCK_ACTION_ARG_TYPES_AND_NAMES_) const; \ return_type gmock_PerformImpl(GMOCK_ACTION_ARG_TYPES_AND_NAMES_) const; \
GMOCK_INTERNAL_DEFN_##value_params \ GMOCK_INTERNAL_DEFN_##value_params \
}; \ }; \
GMOCK_PP_IF(GMOCK_PP_IS_EMPTY(GMOCK_INTERNAL_COUNT_##value_params), \ GMOCK_PP_IF(GMOCK_PP_IS_EMPTY(GMOCK_INTERNAL_COUNT_##value_params), , \
, std::shared_ptr<const gmock_Impl> impl_;) \ std::shared_ptr<const gmock_Impl> impl_;) \
}; \ }; \
template <GMOCK_INTERNAL_DECL_##template_params \ template <GMOCK_INTERNAL_DECL_##template_params \
GMOCK_INTERNAL_DECL_TYPE_##value_params> \ GMOCK_INTERNAL_DECL_TYPE_##value_params> \
GMOCK_ACTION_CLASS_(name, value_params)< \ GMOCK_ACTION_CLASS_( \
GMOCK_INTERNAL_LIST_##template_params \ name, value_params)<GMOCK_INTERNAL_LIST_##template_params \
GMOCK_INTERNAL_LIST_TYPE_##value_params> name( \ GMOCK_INTERNAL_LIST_TYPE_##value_params> \
GMOCK_INTERNAL_DECL_##value_params) GTEST_MUST_USE_RESULT_; \ name(GMOCK_INTERNAL_DECL_##value_params) GTEST_MUST_USE_RESULT_; \
template <GMOCK_INTERNAL_DECL_##template_params \ template <GMOCK_INTERNAL_DECL_##template_params \
GMOCK_INTERNAL_DECL_TYPE_##value_params> \ GMOCK_INTERNAL_DECL_TYPE_##value_params> \
inline GMOCK_ACTION_CLASS_(name, value_params)< \ inline GMOCK_ACTION_CLASS_( \
GMOCK_INTERNAL_LIST_##template_params \ name, value_params)<GMOCK_INTERNAL_LIST_##template_params \
GMOCK_INTERNAL_LIST_TYPE_##value_params> name( \ GMOCK_INTERNAL_LIST_TYPE_##value_params> \
GMOCK_INTERNAL_DECL_##value_params) { \ name(GMOCK_INTERNAL_DECL_##value_params) { \
return GMOCK_ACTION_CLASS_(name, value_params)< \ return GMOCK_ACTION_CLASS_( \
GMOCK_INTERNAL_LIST_##template_params \ name, value_params)<GMOCK_INTERNAL_LIST_##template_params \
GMOCK_INTERNAL_LIST_TYPE_##value_params>( \ GMOCK_INTERNAL_LIST_TYPE_##value_params>( \
GMOCK_INTERNAL_LIST_##value_params); \ GMOCK_INTERNAL_LIST_##value_params); \
} \ } \
template <GMOCK_INTERNAL_DECL_##template_params \ template <GMOCK_INTERNAL_DECL_##template_params \
GMOCK_INTERNAL_DECL_TYPE_##value_params> \ GMOCK_INTERNAL_DECL_TYPE_##value_params> \
template <typename function_type, typename return_type, typename args_type, \ template <typename function_type, typename return_type, typename args_type, \
GMOCK_ACTION_TEMPLATE_ARGS_NAMES_> \ GMOCK_ACTION_TEMPLATE_ARGS_NAMES_> \
return_type GMOCK_ACTION_CLASS_(name, value_params)< \ return_type GMOCK_ACTION_CLASS_( \
GMOCK_INTERNAL_LIST_##template_params \ name, value_params)<GMOCK_INTERNAL_LIST_##template_params \
GMOCK_INTERNAL_LIST_TYPE_##value_params>::gmock_Impl::gmock_PerformImpl( \ GMOCK_INTERNAL_LIST_TYPE_##value_params>:: \
GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const gmock_Impl::gmock_PerformImpl(GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) \
const
namespace testing { namespace testing {
// The ACTION*() macros trigger warning C4100 (unreferenced formal // The ACTION*() macros trigger warning C4100 (unreferenced formal
// parameter) in MSVC with -W4. Unfortunately they cannot be fixed in // parameter) in MSVC with -W4. Unfortunately they cannot be fixed in
// the macro definition, as the warnings are generated when the macro // the macro definition, as the warnings are generated when the macro
// is expanded and macro expansion cannot contain #pragma. Therefore // is expanded and macro expansion cannot contain #pragma. Therefore
// we suppress them here. // we suppress them here.
#ifdef _MSC_VER #ifdef _MSC_VER
# pragma warning(push) #pragma warning(push)
# pragma warning(disable:4100) #pragma warning(disable : 4100)
#endif #endif
namespace internal { namespace internal {
// internal::InvokeArgument - a helper for InvokeArgument action. // internal::InvokeArgument - a helper for InvokeArgument action.
// The basic overloads are provided here for generic functors. // The basic overloads are provided here for generic functors.
// Overloads for other custom-callables are provided in the // Overloads for other custom-callables are provided in the
// internal/custom/gmock-generated-actions.h header. // internal/custom/gmock-generated-actions.h header.
template <typename F, typename... Args> template <typename F, typename... Args>
auto InvokeArgument(F f, Args... args) -> decltype(f(args...)) { auto InvokeArgument(F f, Args... args) -> decltype(f(args...)) {
return f(args...); return f(args...);
} }
template <std::size_t index, typename... Params> template <std::size_t index, typename... Params>
struct InvokeArgumentAction { struct InvokeArgumentAction {
template <typename... Args> template <typename... Args,
typename = typename std::enable_if<(index < sizeof...(Args))>::type>
auto operator()(Args&&... args) const -> decltype(internal::InvokeArgument( auto operator()(Args&&... args) const -> decltype(internal::InvokeArgument(
std::get<index>(std::forward_as_tuple(std::forward<Args>(args)...)), std::get<index>(std::forward_as_tuple(std::forward<Args>(args)...)),
std::declval<const Params&>()...)) { std::declval<const Params&>()...)) {
internal::FlatTuple<Args&&...> args_tuple(FlatTupleConstructTag{}, internal::FlatTuple<Args&&...> args_tuple(FlatTupleConstructTag{},
std::forward<Args>(args)...); std::forward<Args>(args)...);
return params.Apply([&](const Params&... unpacked_params) { return params.Apply([&](const Params&... unpacked_params) {
auto&& callable = args_tuple.template Get<index>(); auto&& callable = args_tuple.template Get<index>();
return internal::InvokeArgument( return internal::InvokeArgument(
std::forward<decltype(callable)>(callable), unpacked_params...); std::forward<decltype(callable)>(callable), unpacked_params...);
}); });
skipping to change at line 567 skipping to change at line 657
// InvokeArgument action from temporary values and have it performed // InvokeArgument action from temporary values and have it performed
// later. // later.
template <std::size_t index, typename... Params> template <std::size_t index, typename... Params>
internal::InvokeArgumentAction<index, typename std::decay<Params>::type...> internal::InvokeArgumentAction<index, typename std::decay<Params>::type...>
InvokeArgument(Params&&... params) { InvokeArgument(Params&&... params) {
return {internal::FlatTuple<typename std::decay<Params>::type...>( return {internal::FlatTuple<typename std::decay<Params>::type...>(
internal::FlatTupleConstructTag{}, std::forward<Params>(params)...)}; internal::FlatTupleConstructTag{}, std::forward<Params>(params)...)};
} }
#ifdef _MSC_VER #ifdef _MSC_VER
# pragma warning(pop) #pragma warning(pop)
#endif #endif
} // namespace testing } // namespace testing
#endif // GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_ #endif // GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
 End of changes. 48 change blocks. 
256 lines changed or deleted 346 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)