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
4707c0ff
Commit
4707c0ff
authored
Apr 18, 2018
by
Gennadiy Civil
Browse files
193353312
parent
80d6e26a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
googlemock/include/gmock/gmock-matchers.h
googlemock/include/gmock/gmock-matchers.h
+7
-4
googlemock/test/gmock-matchers_test.cc
googlemock/test/gmock-matchers_test.cc
+9
-0
No files found.
googlemock/include/gmock/gmock-matchers.h
View file @
4707c0ff
...
...
@@ -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 @
4707c0ff
...
...
@@ -2751,6 +2751,15 @@ TEST(ElementsAreTest, HugeMatcher) {
Eq
(
8
),
Eq
(
9
),
Eq
(
10
),
Gt
(
1
),
Eq
(
12
)));
}
// 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