Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
c6430992
Commit
c6430992
authored
Jul 26, 2020
by
ofats
Committed by
Mark Barolak
Jul 28, 2020
Browse files
Googletest export
Stop using ADL for InvokeArgument action. PiperOrigin-RevId: 323234396
parent
a781fe29
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
59 deletions
+24
-59
googlemock/docs/cheat_sheet.md
googlemock/docs/cheat_sheet.md
+1
-1
googlemock/include/gmock/gmock-actions.h
googlemock/include/gmock/gmock-actions.h
+2
-10
googlemock/include/gmock/gmock-generated-actions.h
googlemock/include/gmock/gmock-generated-actions.h
+17
-40
googlemock/include/gmock/gmock-generated-actions.h.pump
googlemock/include/gmock/gmock-generated-actions.h.pump
+4
-8
No files found.
googlemock/docs/cheat_sheet.md
View file @
c6430992
...
...
@@ -423,7 +423,7 @@ messages, you can use:
<!-- GOOGLETEST_CM0026 DO NOT DELETE -->
<!--
GOOGLETEST_CM0027 DO NOT DELETE
-->
<!--
#include file="includes/g3_util_status_matcher.md"
-->
### Multi-argument Matchers {#MultiArgMatchers}
...
...
googlemock/include/gmock/gmock-actions.h
View file @
c6430992
...
...
@@ -1388,23 +1388,15 @@ class ActionImpl<Derived<Ts...>> {
std
::
tuple
<
Ts
...
>
params_
;
};
namespace
invoke_argument
{
// Appears in InvokeArgumentAdl's argument list to help avoid
// accidental calls to user functions of the same name.
struct
AdlTag
{};
// InvokeArgumentAdl - a helper for InvokeArgument.
// internal::InvokeArgument - a helper for InvokeArgument action.
// The basic overloads are provided here for generic functors.
// Overloads for other custom-callables are provided in the
// internal/custom/gmock-generated-actions.h header.
template
<
typename
F
,
typename
...
Args
>
auto
InvokeArgument
Adl
(
AdlTag
,
F
f
,
Args
...
args
)
->
decltype
(
f
(
args
...))
{
auto
InvokeArgument
(
F
f
,
Args
...
args
)
->
decltype
(
f
(
args
...))
{
return
f
(
args
...);
}
}
// namespace invoke_argument
#define GMOCK_INTERNAL_ARG_UNUSED(i, data, el) \
, const arg##i##_type& arg##i GTEST_ATTRIBUTE_UNUSED_
#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_ \
...
...
googlemock/include/gmock/gmock-generated-actions.h
View file @
c6430992
...
...
@@ -47,6 +47,8 @@
#include "gmock/gmock-actions.h"
#include "gmock/internal/gmock-port.h"
// Include any custom callback actions added by the local installation.
#include "gmock/internal/custom/gmock-generated-actions.h"
// Sometimes you want to give an action explicit template parameters
// that cannot be inferred from its value parameters. ACTION() and
...
...
@@ -511,91 +513,71 @@ namespace testing {
ACTION_TEMPLATE
(
InvokeArgument
,
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
AND_0_VALUE_PARAMS
())
{
using
internal
::
invoke_argument
::
InvokeArgumentAdl
;
return
InvokeArgumentAdl
(
internal
::
invoke_argument
::
AdlTag
(),
::
std
::
get
<
k
>
(
args
));
return
internal
::
InvokeArgument
(
::
std
::
get
<
k
>
(
args
));
}
ACTION_TEMPLATE
(
InvokeArgument
,
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
AND_1_VALUE_PARAMS
(
p0
))
{
using
internal
::
invoke_argument
::
InvokeArgumentAdl
;
return
InvokeArgumentAdl
(
internal
::
invoke_argument
::
AdlTag
(),
::
std
::
get
<
k
>
(
args
),
p0
);
return
internal
::
InvokeArgument
(
::
std
::
get
<
k
>
(
args
),
p0
);
}
ACTION_TEMPLATE
(
InvokeArgument
,
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
AND_2_VALUE_PARAMS
(
p0
,
p1
))
{
using
internal
::
invoke_argument
::
InvokeArgumentAdl
;
return
InvokeArgumentAdl
(
internal
::
invoke_argument
::
AdlTag
(),
::
std
::
get
<
k
>
(
args
),
p0
,
p1
);
return
internal
::
InvokeArgument
(
::
std
::
get
<
k
>
(
args
),
p0
,
p1
);
}
ACTION_TEMPLATE
(
InvokeArgument
,
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
AND_3_VALUE_PARAMS
(
p0
,
p1
,
p2
))
{
using
internal
::
invoke_argument
::
InvokeArgumentAdl
;
return
InvokeArgumentAdl
(
internal
::
invoke_argument
::
AdlTag
(),
::
std
::
get
<
k
>
(
args
),
p0
,
p1
,
p2
);
return
internal
::
InvokeArgument
(
::
std
::
get
<
k
>
(
args
),
p0
,
p1
,
p2
);
}
ACTION_TEMPLATE
(
InvokeArgument
,
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
AND_4_VALUE_PARAMS
(
p0
,
p1
,
p2
,
p3
))
{
using
internal
::
invoke_argument
::
InvokeArgumentAdl
;
return
InvokeArgumentAdl
(
internal
::
invoke_argument
::
AdlTag
(),
::
std
::
get
<
k
>
(
args
),
p0
,
p1
,
p2
,
p3
);
return
internal
::
InvokeArgument
(
::
std
::
get
<
k
>
(
args
),
p0
,
p1
,
p2
,
p3
);
}
ACTION_TEMPLATE
(
InvokeArgument
,
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
AND_5_VALUE_PARAMS
(
p0
,
p1
,
p2
,
p3
,
p4
))
{
using
internal
::
invoke_argument
::
InvokeArgumentAdl
;
return
InvokeArgumentAdl
(
internal
::
invoke_argument
::
AdlTag
(),
::
std
::
get
<
k
>
(
args
),
p0
,
p1
,
p2
,
p3
,
p4
);
return
internal
::
InvokeArgument
(
::
std
::
get
<
k
>
(
args
),
p0
,
p1
,
p2
,
p3
,
p4
);
}
ACTION_TEMPLATE
(
InvokeArgument
,
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
AND_6_VALUE_PARAMS
(
p0
,
p1
,
p2
,
p3
,
p4
,
p5
))
{
using
internal
::
invoke_argument
::
InvokeArgumentAdl
;
return
InvokeArgumentAdl
(
internal
::
invoke_argument
::
AdlTag
(),
::
std
::
get
<
k
>
(
args
),
p0
,
p1
,
p2
,
p3
,
p4
,
p5
);
return
internal
::
InvokeArgument
(
::
std
::
get
<
k
>
(
args
),
p0
,
p1
,
p2
,
p3
,
p4
,
p5
);
}
ACTION_TEMPLATE
(
InvokeArgument
,
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
AND_7_VALUE_PARAMS
(
p0
,
p1
,
p2
,
p3
,
p4
,
p5
,
p6
))
{
using
internal
::
invoke_argument
::
InvokeArgumentAdl
;
return
InvokeArgumentAdl
(
internal
::
invoke_argument
::
AdlTag
(),
::
std
::
get
<
k
>
(
args
),
p0
,
p1
,
p2
,
p3
,
p4
,
p5
,
p6
);
return
internal
::
InvokeArgument
(
::
std
::
get
<
k
>
(
args
),
p0
,
p1
,
p2
,
p3
,
p4
,
p5
,
p6
);
}
ACTION_TEMPLATE
(
InvokeArgument
,
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
AND_8_VALUE_PARAMS
(
p0
,
p1
,
p2
,
p3
,
p4
,
p5
,
p6
,
p7
))
{
using
internal
::
invoke_argument
::
InvokeArgumentAdl
;
return
InvokeArgumentAdl
(
internal
::
invoke_argument
::
AdlTag
(),
::
std
::
get
<
k
>
(
args
),
p0
,
p1
,
p2
,
p3
,
p4
,
p5
,
p6
,
p7
);
return
internal
::
InvokeArgument
(
::
std
::
get
<
k
>
(
args
),
p0
,
p1
,
p2
,
p3
,
p4
,
p5
,
p6
,
p7
);
}
ACTION_TEMPLATE
(
InvokeArgument
,
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
AND_9_VALUE_PARAMS
(
p0
,
p1
,
p2
,
p3
,
p4
,
p5
,
p6
,
p7
,
p8
))
{
using
internal
::
invoke_argument
::
InvokeArgumentAdl
;
return
InvokeArgumentAdl
(
internal
::
invoke_argument
::
AdlTag
(),
::
std
::
get
<
k
>
(
args
),
p0
,
p1
,
p2
,
p3
,
p4
,
p5
,
p6
,
p7
,
p8
);
return
internal
::
InvokeArgument
(
::
std
::
get
<
k
>
(
args
),
p0
,
p1
,
p2
,
p3
,
p4
,
p5
,
p6
,
p7
,
p8
);
}
ACTION_TEMPLATE
(
InvokeArgument
,
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
AND_10_VALUE_PARAMS
(
p0
,
p1
,
p2
,
p3
,
p4
,
p5
,
p6
,
p7
,
p8
,
p9
))
{
using
internal
::
invoke_argument
::
InvokeArgumentAdl
;
return
InvokeArgumentAdl
(
internal
::
invoke_argument
::
AdlTag
(),
::
std
::
get
<
k
>
(
args
),
p0
,
p1
,
p2
,
p3
,
p4
,
p5
,
p6
,
p7
,
p8
,
p9
);
return
internal
::
InvokeArgument
(
::
std
::
get
<
k
>
(
args
),
p0
,
p1
,
p2
,
p3
,
p4
,
p5
,
p6
,
p7
,
p8
,
p9
);
}
#ifdef _MSC_VER
...
...
@@ -604,9 +586,4 @@ ACTION_TEMPLATE(InvokeArgument,
}
// namespace testing
// Include any custom callback actions added by the local installation.
// We must include this header at the end to make sure it can use the
// declarations from this file.
#include "gmock/internal/custom/gmock-generated-actions.h"
#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
googlemock/include/gmock/gmock-generated-actions.h.pump
View file @
c6430992
...
...
@@ -49,6 +49,9 @@ $$}} This meta comment fixes auto-indentation in editors.
#include "gmock/gmock-actions.h"
#include "gmock/internal/gmock-port.h"
// Include any custom callback actions added by the local installation.
#include "gmock/internal/custom/gmock-generated-actions.h"
$
range
i
0.
.
n
$
range
k
0.
.
n
-
1
...
...
@@ -333,9 +336,7 @@ $range j 0..i-1
ACTION_TEMPLATE
(
InvokeArgument
,
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
AND_
$
i
[[]]
_VALUE_PARAMS
(
$
for
j
,
[[
p
$
j
]]))
{
using
internal
::
invoke_argument
::
InvokeArgumentAdl
;
return
InvokeArgumentAdl
(
internal
::
invoke_argument
::
AdlTag
(),
::
std
::
get
<
k
>
(
args
)
$
for
j
[[,
p
$
j
]]);
return
internal
::
InvokeArgument
(
::
std
::
get
<
k
>
(
args
)
$
for
j
[[,
p
$
j
]]);
}
]]
...
...
@@ -346,9 +347,4 @@ ACTION_TEMPLATE(InvokeArgument,
}
// namespace testing
// Include any custom callback actions added by the local installation.
// We must include this header at the end to make sure it can use the
// declarations from this file.
#include "gmock/internal/custom/gmock-generated-actions.h"
#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
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