summaryrefslogtreecommitdiffstats
path: root/googlemock
diff options
context:
space:
mode:
authorVladimir Goncharov <amatanhead@yandex-team.ru>2020-06-20 13:38:55 (GMT)
committerVladimir Goncharov <amatanhead@yandex-team.ru>2020-08-03 20:47:57 (GMT)
commit46734d9a66e858e2b419729b52d6aa21faa614c7 (patch)
treec099636a10a2e2249b706f40f43867a4ee7c2b6c /googlemock
parent9ac4cd0f4958608961f9b5ca27b99fe696e1dd27 (diff)
downloadgoogletest-46734d9a66e858e2b419729b52d6aa21faa614c7.zip
googletest-46734d9a66e858e2b419729b52d6aa21faa614c7.tar.gz
googletest-46734d9a66e858e2b419729b52d6aa21faa614c7.tar.bz2
Small improvements: code style and property name
Diffstat (limited to 'googlemock')
-rw-r--r--googlemock/include/gmock/gmock-matchers.h4
-rw-r--r--googlemock/test/gmock-matchers_test.cc6
2 files changed, 4 insertions, 6 deletions
diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h
index 43456c2..cc04564 100644
--- a/googlemock/include/gmock/gmock-matchers.h
+++ b/googlemock/include/gmock/gmock-matchers.h
@@ -4843,7 +4843,7 @@ ThrowsMessage(const MessageMatcher& messageMatcher) {
// literals, e.g. ThrowsMessage("message").
return MakePolymorphicMatcher(
internal::ExceptionMatcherImpl<Err>{
- Property("description", &std::exception::what,
+ Property("what", &std::exception::what,
MatcherCast<std::string>(messageMatcher))});
}
template <typename Err, typename Message = std::string>
@@ -4854,7 +4854,7 @@ ThrowsMessageHasSubstr(const internal::StringLike<Message>& message) {
"expected an std::exception-derived class");
return MakePolymorphicMatcher(
internal::ExceptionMatcherImpl<Err>{
- Property("description", &std::exception::what, HasSubstr(message))});
+ Property("what", &std::exception::what, HasSubstr(message))});
}
#endif // GTEST_HAS_EXCEPTIONS
diff --git a/googlemock/test/gmock-matchers_test.cc b/googlemock/test/gmock-matchers_test.cc
index db2e043..dd61a53 100644
--- a/googlemock/test/gmock-matchers_test.cc
+++ b/googlemock/test/gmock-matchers_test.cc
@@ -8282,10 +8282,8 @@ TEST(ThrowsPredicateCompilesTest, StringLikeMessage) {
std::string inner;
// Note: explicit conversion.
- explicit operator std::string() const {
- return inner;
- }
-};
+ explicit operator std::string() const { return inner; }
+ };
Matcher<void (*)()> matcher = ThrowsMessageHasSubstr<std::runtime_error>(
SomeCustomString{"error message"});