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
a02af2f6
Commit
a02af2f6
authored
Jul 20, 2018
by
Gennadiy Civil
Browse files
code merge
parent
c62c7943
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
+18
-5
googlemock/include/gmock/gmock-matchers.h
googlemock/include/gmock/gmock-matchers.h
+14
-0
googlemock/test/gmock-matchers_test.cc
googlemock/test/gmock-matchers_test.cc
+4
-1
googletest/include/gtest/internal/gtest-port.h
googletest/include/gtest/internal/gtest-port.h
+0
-4
No files found.
googlemock/include/gmock/gmock-matchers.h
View file @
a02af2f6
...
...
@@ -4529,6 +4529,20 @@ Property(PropertyType (Class::*property)() const &,
property
,
MatcherCast
<
GTEST_REFERENCE_TO_CONST_
(
PropertyType
)
>
(
matcher
)));
}
// Three-argument form for reference-qualified member functions.
template
<
typename
Class
,
typename
PropertyType
,
typename
PropertyMatcher
>
inline
PolymorphicMatcher
<
internal
::
PropertyMatcher
<
Class
,
PropertyType
,
PropertyType
(
Class
::*
)()
const
&>
>
Property
(
const
std
::
string
&
property_name
,
PropertyType
(
Class
::*
property
)()
const
&
,
const
PropertyMatcher
&
matcher
)
{
return
MakePolymorphicMatcher
(
internal
::
PropertyMatcher
<
Class
,
PropertyType
,
PropertyType
(
Class
::*
)()
const
&>
(
property_name
,
property
,
MatcherCast
<
GTEST_REFERENCE_TO_CONST_
(
PropertyType
)
>
(
matcher
)));
}
#endif
// Creates a matcher that matches an object iff the result of applying
...
...
googlemock/test/gmock-matchers_test.cc
View file @
a02af2f6
...
...
@@ -2795,7 +2795,6 @@ TEST(ElementsAreTest, HugeMatcherUnordered) {
#endif // GTEST_LANG_CXX11
// Tests that AnyOf(m1, ..., mn) describes itself properly.
TEST
(
AnyOfTest
,
CanDescribeSelf
)
{
Matcher
<
int
>
m
;
...
...
@@ -4239,13 +4238,17 @@ TEST(PropertyTest, WorksForReferenceToConstProperty) {
// ref-qualified.
TEST
(
PropertyTest
,
WorksForRefQualifiedProperty
)
{
Matcher
<
const
AClass
&>
m
=
Property
(
&
AClass
::
s_ref
,
StartsWith
(
"hi"
));
Matcher
<
const
AClass
&>
m_with_name
=
Property
(
"s"
,
&
AClass
::
s_ref
,
StartsWith
(
"hi"
));
AClass
a
;
a
.
set_s
(
"hill"
);
EXPECT_TRUE
(
m
.
Matches
(
a
));
EXPECT_TRUE
(
m_with_name
.
Matches
(
a
));
a
.
set_s
(
"hole"
);
EXPECT_FALSE
(
m
.
Matches
(
a
));
EXPECT_FALSE
(
m_with_name
.
Matches
(
a
));
}
#endif
...
...
googletest/include/gtest/internal/gtest-port.h
View file @
a02af2f6
...
...
@@ -522,11 +522,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
#endif // !defined(GTEST_HAS_STD_STRING)
#ifndef GTEST_HAS_GLOBAL_STRING
// The user didn't tell us whether ::string is available, so we need
// to figure it out.
# define GTEST_HAS_GLOBAL_STRING 0
#endif // GTEST_HAS_GLOBAL_STRING
#ifndef GTEST_HAS_STD_WSTRING
...
...
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