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
4bd8c463
Unverified
Commit
4bd8c463
authored
Apr 18, 2018
by
Gennadiy Civil
Committed by
GitHub
Apr 18, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1579 from gennadiycivil/master
193353312
parents
4035d6ec
88311784
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
gmock-matchers.h
googlemock/include/gmock/gmock-matchers.h
+7
-4
gmock-matchers_test.cc
googlemock/test/gmock-matchers_test.cc
+9
-0
No files found.
googlemock/include/gmock/gmock-matchers.h
View file @
4bd8c463
...
...
@@ -5212,17 +5212,20 @@ internal::AnyOfMatcher<Args...> AnyOf(const Args&... matchers) {
}
template
<
typename
...
Args
>
internal
::
ElementsAreMatcher
<
tuple
<
typename
std
::
decay
<
Args
>::
type
...
>>
internal
::
ElementsAreMatcher
<
tuple
<
typename
std
::
decay
<
const
Args
&
>::
type
...
>>
ElementsAre
(
const
Args
&
...
matchers
)
{
return
internal
::
ElementsAreMatcher
<
tuple
<
typename
std
::
decay
<
Args
>::
type
...
>>
(
make_tuple
(
matchers
...));
tuple
<
typename
std
::
decay
<
const
Args
&>::
type
...
>>
(
make_tuple
(
matchers
...));
}
template
<
typename
...
Args
>
internal
::
UnorderedElementsAreMatcher
<
tuple
<
typename
std
::
decay
<
Args
>::
type
...
>>
internal
::
UnorderedElementsAreMatcher
<
tuple
<
typename
std
::
decay
<
const
Args
&>::
type
...
>>
UnorderedElementsAre
(
const
Args
&
...
matchers
)
{
return
internal
::
UnorderedElementsAreMatcher
<
tuple
<
typename
std
::
decay
<
Args
>::
type
...
>>
(
make_tuple
(
matchers
...));
tuple
<
typename
std
::
decay
<
const
Args
&>::
type
...
>>
(
make_tuple
(
matchers
...));
}
#endif // GTEST_LANG_CXX11
...
...
googlemock/test/gmock-matchers_test.cc
View file @
4bd8c463
...
...
@@ -2752,6 +2752,15 @@ TEST(ElementsAreTest, HugeMatcher) {
}
// Tests the variadic version of the UnorderedElementsAreMatcher
TEST
(
ElementsAreTest
,
HugeMatcherStr
)
{
vector
<
string
>
test_vector
{
"literal_string"
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
};
EXPECT_THAT
(
test_vector
,
UnorderedElementsAre
(
"literal_string"
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
));
}
// Tests the variadic version of the UnorderedElementsAreMatcher
TEST
(
ElementsAreTest
,
HugeMatcherUnordered
)
{
vector
<
int
>
test_vector
{
2
,
1
,
8
,
5
,
4
,
6
,
7
,
3
,
9
,
12
,
11
,
10
};
...
...
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