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
ba974c97
Commit
ba974c97
authored
Sep 24, 2018
by
misterg
Committed by
Gennadiy Civil
Sep 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Googletest export
Remove non-variadic pre C++11 ElementsAreMatcher and UnorderedElementsAreMatcher PiperOrigin-RevId: 214266944
parent
0fc5466d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
86 deletions
+17
-86
gmock-generated-matchers.h
googlemock/include/gmock/gmock-generated-matchers.h
+0
-0
gmock-generated-matchers.h.pump
googlemock/include/gmock/gmock-generated-matchers.h.pump
+0
-69
gmock-matchers.h
googlemock/include/gmock/gmock-matchers.h
+17
-17
No files found.
googlemock/include/gmock/gmock-generated-matchers.h
View file @
ba974c97
This diff is collapsed.
Click to expand it.
googlemock/include/gmock/gmock-generated-matchers.h.pump
View file @
ba974c97
...
@@ -264,75 +264,6 @@ Args(const InnerMatcher& matcher) {
...
@@ -264,75 +264,6 @@ Args(const InnerMatcher& matcher) {
]]
]]
// ElementsAre(e_1, e_2, ... e_n) matches an STL-style container with
// n elements, where the i-th element in the container must
// match the i-th argument in the list. Each argument of
// ElementsAre() can be either a value or a matcher. We support up to
// $n arguments.
//
// The use of DecayArray in the implementation allows ElementsAre()
// to accept string literals, whose type is const char[N], but we
// want to treat them as const char*.
//
// NOTE: Since ElementsAre() cares about the order of the elements, it
// must not be used with containers whose elements's order is
// undefined (e.g. hash_map).
$
range
i
0.
.
n
$
for
i
[[
$
range
j
1.
.
i
$
if
i
>
0
[[
template
<
$
for
j
,
[[
typename
T
$
j
]]
>
]]
inline
internal
::
ElementsAreMatcher
<
::
testing
::
tuple
<
$
for
j
,
[[
typename
internal
::
DecayArray
<
T
$
j
[[]]
>::
type
]]
>
>
ElementsAre
(
$
for
j
,
[[
const
T
$
j
&
e
$
j
]])
{
typedef
::
testing
::
tuple
<
$
for
j
,
[[
typename
internal
::
DecayArray
<
T
$
j
[[]]
>::
type
]]
>
Args
;
return
internal
::
ElementsAreMatcher
<
Args
>
(
Args
(
$
for
j
,
[[
e
$
j
]]));
}
]]
// UnorderedElementsAre(e_1, e_2, ..., e_n) is an ElementsAre extension
// that matches n elements in any order. We support up to n=$n arguments.
//
// If you have >$n elements, consider UnorderedElementsAreArray() or
// UnorderedPointwise() instead.
$
range
i
0.
.
n
$
for
i
[[
$
range
j
1.
.
i
$
if
i
>
0
[[
template
<
$
for
j
,
[[
typename
T
$
j
]]
>
]]
inline
internal
::
UnorderedElementsAreMatcher
<
::
testing
::
tuple
<
$
for
j
,
[[
typename
internal
::
DecayArray
<
T
$
j
[[]]
>::
type
]]
>
>
UnorderedElementsAre
(
$
for
j
,
[[
const
T
$
j
&
e
$
j
]])
{
typedef
::
testing
::
tuple
<
$
for
j
,
[[
typename
internal
::
DecayArray
<
T
$
j
[[]]
>::
type
]]
>
Args
;
return
internal
::
UnorderedElementsAreMatcher
<
Args
>
(
Args
(
$
for
j
,
[[
e
$
j
]]));
}
]]
// AllOf(m1, m2, ..., mk) matches any value that matches all of the given
// AllOf(m1, m2, ..., mk) matches any value that matches all of the given
// sub-matchers. AllOf is called fully qualified to prevent ADL from firing.
// sub-matchers. AllOf is called fully qualified to prevent ADL from firing.
...
...
googlemock/include/gmock/gmock-matchers.h
View file @
ba974c97
...
@@ -5170,23 +5170,6 @@ std::string DescribeMatcher(const M& matcher, bool negation = false) {
...
@@ -5170,23 +5170,6 @@ std::string DescribeMatcher(const M& matcher, bool negation = false) {
return
ss
.
str
();
return
ss
.
str
();
}
}
#if GTEST_LANG_CXX11
// Define variadic matcher versions. They are overloaded in
// gmock-generated-matchers.h for the cases supported by pre C++11 compilers.
template
<
typename
...
Args
>
internal
::
AllOfMatcher
<
typename
std
::
decay
<
const
Args
&>::
type
...
>
AllOf
(
const
Args
&
...
matchers
)
{
return
internal
::
AllOfMatcher
<
typename
std
::
decay
<
const
Args
&>::
type
...
>
(
matchers
...);
}
template
<
typename
...
Args
>
internal
::
AnyOfMatcher
<
typename
std
::
decay
<
const
Args
&>::
type
...
>
AnyOf
(
const
Args
&
...
matchers
)
{
return
internal
::
AnyOfMatcher
<
typename
std
::
decay
<
const
Args
&>::
type
...
>
(
matchers
...);
}
template
<
typename
...
Args
>
template
<
typename
...
Args
>
internal
::
ElementsAreMatcher
<
tuple
<
typename
std
::
decay
<
const
Args
&>::
type
...
>>
internal
::
ElementsAreMatcher
<
tuple
<
typename
std
::
decay
<
const
Args
&>::
type
...
>>
ElementsAre
(
const
Args
&
...
matchers
)
{
ElementsAre
(
const
Args
&
...
matchers
)
{
...
@@ -5204,6 +5187,23 @@ UnorderedElementsAre(const Args&... matchers) {
...
@@ -5204,6 +5187,23 @@ UnorderedElementsAre(const Args&... matchers) {
make_tuple
(
matchers
...));
make_tuple
(
matchers
...));
}
}
#if GTEST_LANG_CXX11
// Define variadic matcher versions. They are overloaded in
// gmock-generated-matchers.h for the cases supported by pre C++11 compilers.
template
<
typename
...
Args
>
internal
::
AllOfMatcher
<
typename
std
::
decay
<
const
Args
&>::
type
...
>
AllOf
(
const
Args
&
...
matchers
)
{
return
internal
::
AllOfMatcher
<
typename
std
::
decay
<
const
Args
&>::
type
...
>
(
matchers
...);
}
template
<
typename
...
Args
>
internal
::
AnyOfMatcher
<
typename
std
::
decay
<
const
Args
&>::
type
...
>
AnyOf
(
const
Args
&
...
matchers
)
{
return
internal
::
AnyOfMatcher
<
typename
std
::
decay
<
const
Args
&>::
type
...
>
(
matchers
...);
}
#endif // GTEST_LANG_CXX11
#endif // GTEST_LANG_CXX11
// AllArgs(m) is a synonym of m. This is useful in
// AllArgs(m) is a synonym of m. This is useful in
...
...
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