summaryrefslogtreecommitdiffstats
path: root/googlemock/test/gmock-matchers_test.cc
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2018-12-03 11:30:02 -0500
committerGennadiy Civil <misterg@google.com>2018-12-03 12:54:11 -0500
commit26743363be8f579ee7d637e5b15cbf73e9e18a4a (patch)
treefb89238693dad174c6ddaf57f04bae3c8f41d7fb /googlemock/test/gmock-matchers_test.cc
parenta42cdf2abdc0ab7ddfbafc098cafdd6152ae1b70 (diff)
downloadgoogletest-26743363be8f579ee7d637e5b15cbf73e9e18a4a.tar.gz
googletest-26743363be8f579ee7d637e5b15cbf73e9e18a4a.zip
Googletest export
Applied fixes for ClangTidy modernize-use-override and modernize-use-using. PiperOrigin-RevId: 223800219
Diffstat (limited to 'googlemock/test/gmock-matchers_test.cc')
-rw-r--r--googlemock/test/gmock-matchers_test.cc21
1 files changed, 7 insertions, 14 deletions
diff --git a/googlemock/test/gmock-matchers_test.cc b/googlemock/test/gmock-matchers_test.cc
index cb2d1ae0..5dc09f35 100644
--- a/googlemock/test/gmock-matchers_test.cc
+++ b/googlemock/test/gmock-matchers_test.cc
@@ -162,12 +162,9 @@ class GreaterThanMatcher : public MatcherInterface<int> {
public:
explicit GreaterThanMatcher(int rhs) : rhs_(rhs) {}
- virtual void DescribeTo(ostream* os) const {
- *os << "is > " << rhs_;
- }
+ void DescribeTo(ostream* os) const override { *os << "is > " << rhs_; }
- virtual bool MatchAndExplain(int lhs,
- MatchResultListener* listener) const {
+ bool MatchAndExplain(int lhs, MatchResultListener* listener) const override {
const int diff = lhs - rhs_;
if (diff > 0) {
*listener << "which is " << diff << " more than " << rhs_;
@@ -257,14 +254,12 @@ TEST(MatchResultListenerTest, IsInterestedWorks) {
// change.
class EvenMatcherImpl : public MatcherInterface<int> {
public:
- virtual bool MatchAndExplain(int x,
- MatchResultListener* /* listener */) const {
+ bool MatchAndExplain(int x,
+ MatchResultListener* /* listener */) const override {
return x % 2 == 0;
}
- virtual void DescribeTo(ostream* os) const {
- *os << "is an even number";
- }
+ void DescribeTo(ostream* os) const override { *os << "is an even number"; }
// We deliberately don't define DescribeNegationTo() and
// ExplainMatchResultTo() here, to make sure the definition of these
@@ -280,7 +275,7 @@ TEST(MatcherInterfaceTest, CanBeImplementedUsingPublishedAPI) {
class NewEvenMatcherImpl : public MatcherInterface<int> {
public:
- virtual bool MatchAndExplain(int x, MatchResultListener* listener) const {
+ bool MatchAndExplain(int x, MatchResultListener* listener) const override {
const bool match = x % 2 == 0;
// Verifies that we can stream to a listener directly.
*listener << "value % " << 2;
@@ -292,9 +287,7 @@ class NewEvenMatcherImpl : public MatcherInterface<int> {
return match;
}
- virtual void DescribeTo(ostream* os) const {
- *os << "is an even number";
- }
+ void DescribeTo(ostream* os) const override { *os << "is an even number"; }
};
TEST(MatcherInterfaceTest, CanBeImplementedUsingNewAPI) {
OpenPOWER on IntegriCloud