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
46734d9a
Commit
46734d9a
authored
Jun 20, 2020
by
Vladimir Goncharov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small improvements: code style and property name
parent
9ac4cd0f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
gmock-matchers.h
googlemock/include/gmock/gmock-matchers.h
+2
-2
gmock-matchers_test.cc
googlemock/test/gmock-matchers_test.cc
+2
-4
No files found.
googlemock/include/gmock/gmock-matchers.h
View file @
46734d9a
...
@@ -4843,7 +4843,7 @@ ThrowsMessage(const MessageMatcher& messageMatcher) {
...
@@ -4843,7 +4843,7 @@ ThrowsMessage(const MessageMatcher& messageMatcher) {
// literals, e.g. ThrowsMessage("message").
// literals, e.g. ThrowsMessage("message").
return
MakePolymorphicMatcher
(
return
MakePolymorphicMatcher
(
internal
::
ExceptionMatcherImpl
<
Err
>
{
internal
::
ExceptionMatcherImpl
<
Err
>
{
Property
(
"
description
"
,
&
std
::
exception
::
what
,
Property
(
"
what
"
,
&
std
::
exception
::
what
,
MatcherCast
<
std
::
string
>
(
messageMatcher
))});
MatcherCast
<
std
::
string
>
(
messageMatcher
))});
}
}
template
<
typename
Err
,
typename
Message
=
std
::
string
>
template
<
typename
Err
,
typename
Message
=
std
::
string
>
...
@@ -4854,7 +4854,7 @@ ThrowsMessageHasSubstr(const internal::StringLike<Message>& message) {
...
@@ -4854,7 +4854,7 @@ ThrowsMessageHasSubstr(const internal::StringLike<Message>& message) {
"expected an std::exception-derived class"
);
"expected an std::exception-derived class"
);
return
MakePolymorphicMatcher
(
return
MakePolymorphicMatcher
(
internal
::
ExceptionMatcherImpl
<
Err
>
{
internal
::
ExceptionMatcherImpl
<
Err
>
{
Property
(
"
description
"
,
&
std
::
exception
::
what
,
HasSubstr
(
message
))});
Property
(
"
what
"
,
&
std
::
exception
::
what
,
HasSubstr
(
message
))});
}
}
#endif // GTEST_HAS_EXCEPTIONS
#endif // GTEST_HAS_EXCEPTIONS
...
...
googlemock/test/gmock-matchers_test.cc
View file @
46734d9a
...
@@ -8282,10 +8282,8 @@ TEST(ThrowsPredicateCompilesTest, StringLikeMessage) {
...
@@ -8282,10 +8282,8 @@ TEST(ThrowsPredicateCompilesTest, StringLikeMessage) {
std
::
string
inner
;
std
::
string
inner
;
// Note: explicit conversion.
// Note: explicit conversion.
explicit
operator
std
::
string
()
const
{
explicit
operator
std
::
string
()
const
{
return
inner
;
}
return
inner
;
};
}
};
Matcher
<
void
(
*
)()
>
matcher
=
ThrowsMessageHasSubstr
<
std
::
runtime_error
>
(
Matcher
<
void
(
*
)()
>
matcher
=
ThrowsMessageHasSubstr
<
std
::
runtime_error
>
(
SomeCustomString
{
"error message"
});
SomeCustomString
{
"error message"
});
...
...
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