summaryrefslogtreecommitdiffstats
path: root/googletest
diff options
context:
space:
mode:
authorRobert Luberda <robert@debian.org>2019-10-09 19:48:00 (GMT)
committerRobert Luberda <robert@debian.org>2019-10-11 21:45:31 (GMT)
commit3cddd56e195b516f449bea6dcd3edd4494195631 (patch)
tree43d4759ae7f635c361ebc9262d26b7cdfd6cc529 /googletest
parentba513d2c9525a7c986c115ed5d603f2cf17c6016 (diff)
downloadgoogletest-3cddd56e195b516f449bea6dcd3edd4494195631.zip
googletest-3cddd56e195b516f449bea6dcd3edd4494195631.tar.gz
googletest-3cddd56e195b516f449bea6dcd3edd4494195631.tar.bz2
Add more override keywordsrefs/pull/2507/head
Mark more functions with "override" keyword, just like it was done in commit 2460f97152c. This should prevent compiler from complaining while compiling both user code, and the googletest code itself with the -Wsuggest-override option turned on; with the exception of: * calls to new MOCK_METHOD() in test/gmock-function-mocker_test.cc * calls to old MOCK_METHODx()/MOCK_CONST_METHODx() in other unit test files. Closes #2493
Diffstat (limited to 'googletest')
-rw-r--r--googletest/include/gtest/gtest-typed-test.h4
-rw-r--r--googletest/include/gtest/internal/gtest-port.h4
-rw-r--r--googletest/test/gtest_unittest.cc4
3 files changed, 6 insertions, 6 deletions
diff --git a/googletest/include/gtest/gtest-typed-test.h b/googletest/include/gtest/gtest-typed-test.h
index 095ce05..6b7c9c8 100644
--- a/googletest/include/gtest/gtest-typed-test.h
+++ b/googletest/include/gtest/gtest-typed-test.h
@@ -201,7 +201,7 @@ INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes);
private: \
typedef CaseName<gtest_TypeParam_> TestFixture; \
typedef gtest_TypeParam_ TypeParam; \
- virtual void TestBody(); \
+ void TestBody() override; \
}; \
static bool gtest_##CaseName##_##TestName##_registered_ \
GTEST_ATTRIBUTE_UNUSED_ = \
@@ -276,7 +276,7 @@ INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes);
private: \
typedef SuiteName<gtest_TypeParam_> TestFixture; \
typedef gtest_TypeParam_ TypeParam; \
- virtual void TestBody(); \
+ void TestBody() override; \
}; \
static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName).AddTestName( \
diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h
index f6433c5..2b4770f 100644
--- a/googletest/include/gtest/internal/gtest-port.h
+++ b/googletest/include/gtest/internal/gtest-port.h
@@ -1590,7 +1590,7 @@ class ThreadLocal : public ThreadLocalBase {
class DefaultValueHolderFactory : public ValueHolderFactory {
public:
DefaultValueHolderFactory() {}
- virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }
+ ValueHolder* MakeNewHolder() const override { return new ValueHolder(); }
private:
GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
@@ -1599,7 +1599,7 @@ class ThreadLocal : public ThreadLocalBase {
class InstanceValueHolderFactory : public ValueHolderFactory {
public:
explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
- virtual ValueHolder* MakeNewHolder() const {
+ ValueHolder* MakeNewHolder() const override {
return new ValueHolder(value_);
}
diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc
index 8312bd1..d17a155 100644
--- a/googletest/test/gtest_unittest.cc
+++ b/googletest/test/gtest_unittest.cc
@@ -6170,7 +6170,7 @@ TEST_F(ParseFlagsTest, WideStrings) {
#if GTEST_USE_OWN_FLAGFILE_FLAG_
class FlagfileTest : public ParseFlagsTest {
public:
- virtual void SetUp() {
+ void SetUp() override {
ParseFlagsTest::SetUp();
testdata_path_.Set(internal::FilePath(
@@ -6180,7 +6180,7 @@ class FlagfileTest : public ParseFlagsTest {
EXPECT_TRUE(testdata_path_.CreateFolder());
}
- virtual void TearDown() {
+ void TearDown() override {
testing::internal::posix::RmDir(testdata_path_.c_str());
ParseFlagsTest::TearDown();
}