Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
a4b63e7e
Commit
a4b63e7e
authored
Mar 18, 2019
by
Abseil Team
Committed by
Gennadiy Civil
Mar 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Googletest export
Action helpers need to pass by const& so that they can work with unique_ptr. PiperOrigin-RevId: 239062671
parent
f957bd0c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
61 deletions
+85
-61
gmock-generated-actions.h
googlemock/include/gmock/gmock-generated-actions.h
+82
-58
gmock-generated-actions.h.pump
googlemock/include/gmock/gmock-generated-actions.h.pump
+3
-3
No files found.
googlemock/include/gmock/gmock-generated-actions.h
View file @
a4b63e7e
...
@@ -273,16 +273,16 @@ class ActionHelper {
...
@@ -273,16 +273,16 @@ class ActionHelper {
// An internal macro needed for implementing ACTION*().
// An internal macro needed for implementing ACTION*().
#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\
#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\
const args_type& args GTEST_ATTRIBUTE_UNUSED_, \
const args_type& args GTEST_ATTRIBUTE_UNUSED_, \
arg0_type
arg0 GTEST_ATTRIBUTE_UNUSED_, \
const arg0_type&
arg0 GTEST_ATTRIBUTE_UNUSED_, \
arg1_type
arg1 GTEST_ATTRIBUTE_UNUSED_, \
const arg1_type&
arg1 GTEST_ATTRIBUTE_UNUSED_, \
arg2_type
arg2 GTEST_ATTRIBUTE_UNUSED_, \
const arg2_type&
arg2 GTEST_ATTRIBUTE_UNUSED_, \
arg3_type
arg3 GTEST_ATTRIBUTE_UNUSED_, \
const arg3_type&
arg3 GTEST_ATTRIBUTE_UNUSED_, \
arg4_type
arg4 GTEST_ATTRIBUTE_UNUSED_, \
const arg4_type&
arg4 GTEST_ATTRIBUTE_UNUSED_, \
arg5_type
arg5 GTEST_ATTRIBUTE_UNUSED_, \
const arg5_type&
arg5 GTEST_ATTRIBUTE_UNUSED_, \
arg6_type
arg6 GTEST_ATTRIBUTE_UNUSED_, \
const arg6_type&
arg6 GTEST_ATTRIBUTE_UNUSED_, \
arg7_type
arg7 GTEST_ATTRIBUTE_UNUSED_, \
const arg7_type&
arg7 GTEST_ATTRIBUTE_UNUSED_, \
arg8_type
arg8 GTEST_ATTRIBUTE_UNUSED_, \
const arg8_type&
arg8 GTEST_ATTRIBUTE_UNUSED_, \
arg9_type
arg9 GTEST_ATTRIBUTE_UNUSED_
const arg9_type&
arg9 GTEST_ATTRIBUTE_UNUSED_
// Sometimes you want to give an action explicit template parameters
// Sometimes you want to give an action explicit template parameters
// that cannot be inferred from its value parameters. ACTION() and
// that cannot be inferred from its value parameters. ACTION() and
...
@@ -672,10 +672,12 @@ class ActionHelper {
...
@@ -672,10 +672,12 @@ class ActionHelper {
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg9_type>\
typename arg9_type>\
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
return_type gmock_PerformImpl(const args_type& args, \
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
const arg0_type& arg0, const arg1_type& arg1, \
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
const arg2_type& arg2, const arg3_type& arg3, \
arg9_type arg9) const;\
const arg4_type& arg4, const arg5_type& arg5, \
const arg6_type& arg6, const arg7_type& arg7, \
const arg8_type& arg8, const arg9_type& arg9) const;\
GMOCK_INTERNAL_DEFN_##value_params\
GMOCK_INTERNAL_DEFN_##value_params\
private:\
private:\
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
...
@@ -733,10 +735,12 @@ class ActionHelper {
...
@@ -733,10 +735,12 @@ class ActionHelper {
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg9_type>\
typename arg9_type>\
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
return_type gmock_PerformImpl(const args_type& args, \
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
const arg0_type& arg0, const arg1_type& arg1, \
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
const arg2_type& arg2, const arg3_type& arg3, \
arg9_type arg9) const;\
const arg4_type& arg4, const arg5_type& arg5, \
const arg6_type& arg6, const arg7_type& arg7, \
const arg8_type& arg8, const arg9_type& arg9) const;\
private:\
private:\
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
};\
};\
...
@@ -781,10 +785,12 @@ class ActionHelper {
...
@@ -781,10 +785,12 @@ class ActionHelper {
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg9_type>\
typename arg9_type>\
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
return_type gmock_PerformImpl(const args_type& args, \
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
const arg0_type& arg0, const arg1_type& arg1, \
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
const arg2_type& arg2, const arg3_type& arg3, \
arg9_type arg9) const;\
const arg4_type& arg4, const arg5_type& arg5, \
const arg6_type& arg6, const arg7_type& arg7, \
const arg8_type& arg8, const arg9_type& arg9) const;\
p0##_type p0;\
p0##_type p0;\
private:\
private:\
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
...
@@ -835,10 +841,12 @@ class ActionHelper {
...
@@ -835,10 +841,12 @@ class ActionHelper {
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg9_type>\
typename arg9_type>\
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
return_type gmock_PerformImpl(const args_type& args, \
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
const arg0_type& arg0, const arg1_type& arg1, \
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
const arg2_type& arg2, const arg3_type& arg3, \
arg9_type arg9) const;\
const arg4_type& arg4, const arg5_type& arg5, \
const arg6_type& arg6, const arg7_type& arg7, \
const arg8_type& arg8, const arg9_type& arg9) const;\
p0##_type p0;\
p0##_type p0;\
p1##_type p1;\
p1##_type p1;\
private:\
private:\
...
@@ -894,10 +902,12 @@ class ActionHelper {
...
@@ -894,10 +902,12 @@ class ActionHelper {
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg9_type>\
typename arg9_type>\
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
return_type gmock_PerformImpl(const args_type& args, \
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
const arg0_type& arg0, const arg1_type& arg1, \
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
const arg2_type& arg2, const arg3_type& arg3, \
arg9_type arg9) const;\
const arg4_type& arg4, const arg5_type& arg5, \
const arg6_type& arg6, const arg7_type& arg7, \
const arg8_type& arg8, const arg9_type& arg9) const;\
p0##_type p0;\
p0##_type p0;\
p1##_type p1;\
p1##_type p1;\
p2##_type p2;\
p2##_type p2;\
...
@@ -960,10 +970,12 @@ class ActionHelper {
...
@@ -960,10 +970,12 @@ class ActionHelper {
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg9_type>\
typename arg9_type>\
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
return_type gmock_PerformImpl(const args_type& args, \
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
const arg0_type& arg0, const arg1_type& arg1, \
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
const arg2_type& arg2, const arg3_type& arg3, \
arg9_type arg9) const;\
const arg4_type& arg4, const arg5_type& arg5, \
const arg6_type& arg6, const arg7_type& arg7, \
const arg8_type& arg8, const arg9_type& arg9) const;\
p0##_type p0;\
p0##_type p0;\
p1##_type p1;\
p1##_type p1;\
p2##_type p2;\
p2##_type p2;\
...
@@ -1035,10 +1047,12 @@ class ActionHelper {
...
@@ -1035,10 +1047,12 @@ class ActionHelper {
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg9_type>\
typename arg9_type>\
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
return_type gmock_PerformImpl(const args_type& args, \
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
const arg0_type& arg0, const arg1_type& arg1, \
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
const arg2_type& arg2, const arg3_type& arg3, \
arg9_type arg9) const;\
const arg4_type& arg4, const arg5_type& arg5, \
const arg6_type& arg6, const arg7_type& arg7, \
const arg8_type& arg8, const arg9_type& arg9) const;\
p0##_type p0;\
p0##_type p0;\
p1##_type p1;\
p1##_type p1;\
p2##_type p2;\
p2##_type p2;\
...
@@ -1114,10 +1128,12 @@ class ActionHelper {
...
@@ -1114,10 +1128,12 @@ class ActionHelper {
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg9_type>\
typename arg9_type>\
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
return_type gmock_PerformImpl(const args_type& args, \
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
const arg0_type& arg0, const arg1_type& arg1, \
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
const arg2_type& arg2, const arg3_type& arg3, \
arg9_type arg9) const;\
const arg4_type& arg4, const arg5_type& arg5, \
const arg6_type& arg6, const arg7_type& arg7, \
const arg8_type& arg8, const arg9_type& arg9) const;\
p0##_type p0;\
p0##_type p0;\
p1##_type p1;\
p1##_type p1;\
p2##_type p2;\
p2##_type p2;\
...
@@ -1199,10 +1215,12 @@ class ActionHelper {
...
@@ -1199,10 +1215,12 @@ class ActionHelper {
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg9_type>\
typename arg9_type>\
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
return_type gmock_PerformImpl(const args_type& args, \
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
const arg0_type& arg0, const arg1_type& arg1, \
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
const arg2_type& arg2, const arg3_type& arg3, \
arg9_type arg9) const;\
const arg4_type& arg4, const arg5_type& arg5, \
const arg6_type& arg6, const arg7_type& arg7, \
const arg8_type& arg8, const arg9_type& arg9) const;\
p0##_type p0;\
p0##_type p0;\
p1##_type p1;\
p1##_type p1;\
p2##_type p2;\
p2##_type p2;\
...
@@ -1293,10 +1311,12 @@ class ActionHelper {
...
@@ -1293,10 +1311,12 @@ class ActionHelper {
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg9_type>\
typename arg9_type>\
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
return_type gmock_PerformImpl(const args_type& args, \
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
const arg0_type& arg0, const arg1_type& arg1, \
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
const arg2_type& arg2, const arg3_type& arg3, \
arg9_type arg9) const;\
const arg4_type& arg4, const arg5_type& arg5, \
const arg6_type& arg6, const arg7_type& arg7, \
const arg8_type& arg8, const arg9_type& arg9) const;\
p0##_type p0;\
p0##_type p0;\
p1##_type p1;\
p1##_type p1;\
p2##_type p2;\
p2##_type p2;\
...
@@ -1393,10 +1413,12 @@ class ActionHelper {
...
@@ -1393,10 +1413,12 @@ class ActionHelper {
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg9_type>\
typename arg9_type>\
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
return_type gmock_PerformImpl(const args_type& args, \
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
const arg0_type& arg0, const arg1_type& arg1, \
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
const arg2_type& arg2, const arg3_type& arg3, \
arg9_type arg9) const;\
const arg4_type& arg4, const arg5_type& arg5, \
const arg6_type& arg6, const arg7_type& arg7, \
const arg8_type& arg8, const arg9_type& arg9) const;\
p0##_type p0;\
p0##_type p0;\
p1##_type p1;\
p1##_type p1;\
p2##_type p2;\
p2##_type p2;\
...
@@ -1500,10 +1522,12 @@ class ActionHelper {
...
@@ -1500,10 +1522,12 @@ class ActionHelper {
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg3_type, typename arg4_type, typename arg5_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg6_type, typename arg7_type, typename arg8_type, \
typename arg9_type>\
typename arg9_type>\
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
return_type gmock_PerformImpl(const args_type& args, \
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
const arg0_type& arg0, const arg1_type& arg1, \
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
const arg2_type& arg2, const arg3_type& arg3, \
arg9_type arg9) const;\
const arg4_type& arg4, const arg5_type& arg5, \
const arg6_type& arg6, const arg7_type& arg7, \
const arg8_type& arg8, const arg9_type& arg9) const;\
p0##_type p0;\
p0##_type p0;\
p1##_type p1;\
p1##_type p1;\
p2##_type p2;\
p2##_type p2;\
...
...
googlemock/include/gmock/gmock-generated-actions.h.pump
View file @
a4b63e7e
...
@@ -200,7 +200,7 @@ $range k 0..n-1
...
@@ -200,7 +200,7 @@ $range k 0..n-1
#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\
#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\
const args_type& args GTEST_ATTRIBUTE_UNUSED_
const args_type& args GTEST_ATTRIBUTE_UNUSED_
$
for
k
[[,
\
$
for
k
[[,
\
arg
$
k
[[]]
_type
arg
$
k
GTEST_ATTRIBUTE_UNUSED_
]]
const
arg
$
k
[[]]
_type
&
arg
$
k
GTEST_ATTRIBUTE_UNUSED_
]]
// Sometimes you want to give an action explicit template parameters
// Sometimes you want to give an action explicit template parameters
...
@@ -402,7 +402,7 @@ $range k 0..n-1
...
@@ -402,7 +402,7 @@ $range k 0..n-1
}\
}\
template <$for k, [[typename arg$k[[]]_type]]>\
template <$for k, [[typename arg$k[[]]_type]]>\
return_type gmock_PerformImpl(const args_type& args[[]]
return_type gmock_PerformImpl(const args_type& args[[]]
$
for
k
[[,
arg
$
k
[[]]
_type
arg
$
k
]])
const
;
\
$
for
k
[[,
const
arg
$
k
[[]]
_type
&
arg
$
k
]])
const
;
\
GMOCK_INTERNAL_DEFN_
##
value_params
\
GMOCK_INTERNAL_DEFN_
##
value_params
\
private
:
\
private
:
\
GTEST_DISALLOW_ASSIGN_
(
gmock_Impl
);
\
GTEST_DISALLOW_ASSIGN_
(
gmock_Impl
);
\
...
@@ -467,7 +467,7 @@ $var param_field_decls2 = [[$for j
...
@@ -467,7 +467,7 @@ $var param_field_decls2 = [[$for j
$
var
params
=
[[
$
for
j
,
[[
p
$
j
]]]]
$
var
params
=
[[
$
for
j
,
[[
p
$
j
]]]]
$
var
param_types
=
[[
$
if
i
==
0
[[]]
$
else
[[
<
$
for
j
,
[[
p
$
j
##
_type
]]
>
]]]]
$
var
param_types
=
[[
$
if
i
==
0
[[]]
$
else
[[
<
$
for
j
,
[[
p
$
j
##
_type
]]
>
]]]]
$
var
typename_arg_types
=
[[
$
for
k
,
[[
typename
arg
$
k
[[]]
_type
]]]]
$
var
typename_arg_types
=
[[
$
for
k
,
[[
typename
arg
$
k
[[]]
_type
]]]]
$
var
arg_types_and_names
=
[[
$
for
k
,
[[
arg
$
k
[[]]
_type
arg
$
k
]]]]
$
var
arg_types_and_names
=
[[
$
for
k
,
[[
const
arg
$
k
[[]]
_type
&
arg
$
k
]]]]
$
var
macro_name
=
[[
$
if
i
==
0
[[
ACTION
]]
$
elif
i
==
1
[[
ACTION_P
]]
$
var
macro_name
=
[[
$
if
i
==
0
[[
ACTION
]]
$
elif
i
==
1
[[
ACTION_P
]]
$
else
[[
ACTION_P
$
i
]]]]
$
else
[[
ACTION_P
$
i
]]]]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment