diff options
author | Alexander Kornienko <alexfh@google.com> | 2015-04-11 02:11:45 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2015-04-11 02:11:45 +0000 |
commit | f817c1cb9afe641516b21fcc6e400681025f18f9 (patch) | |
tree | 06bc60f7ff86fcc42f6b97ac69337b5b691528ae /llvm/utils/unittest/googletest/include/gtest/internal | |
parent | 34eb20725d9d923f6f2ff9f205f198d5f3df022b (diff) | |
download | bcm5719-llvm-f817c1cb9afe641516b21fcc6e400681025f18f9.tar.gz bcm5719-llvm-f817c1cb9afe641516b21fcc6e400681025f18f9.zip |
Use 'override/final' instead of 'virtual' for overridden methods
The patch is generated using clang-tidy misc-use-override check.
This command was used:
tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \
-checks='-*,misc-use-override' -header-filter='llvm|clang' \
-j=32 -fix -format
http://reviews.llvm.org/D8925
llvm-svn: 234679
Diffstat (limited to 'llvm/utils/unittest/googletest/include/gtest/internal')
4 files changed, 19 insertions, 19 deletions
diff --git a/llvm/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h b/llvm/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h index 8d53c452807..04c676ce5ff 100644 --- a/llvm/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h +++ b/llvm/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h @@ -147,8 +147,8 @@ class DeathTestFactory { // A concrete DeathTestFactory implementation for normal use. class DefaultDeathTestFactory : public DeathTestFactory { public: - virtual bool Create(const char* statement, const RE* regex, - const char* file, int line, DeathTest** test); + bool Create(const char *statement, const RE *regex, const char *file, + int line, DeathTest **test) override; }; // Returns true if exit_status describes a process that was terminated diff --git a/llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal.h b/llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal.h index 63f72acdfb5..3c7eee81b1d 100644 --- a/llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal.h +++ b/llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal.h @@ -555,7 +555,7 @@ class TestFactoryBase { template <class TestClass> class TestFactoryImpl : public TestFactoryBase { public: - virtual Test* CreateTest() { return new TestClass; } + Test *CreateTest() override { return new TestClass; } }; #if GTEST_OS_WINDOWS diff --git a/llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h b/llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h index 3bb2ffb3556..dea4d5cc6bc 100644 --- a/llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h +++ b/llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h @@ -270,12 +270,12 @@ class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> { template <typename ForwardIterator> ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end) : container_(begin, end) {} - virtual ~ValuesInIteratorRangeGenerator() {} + ~ValuesInIteratorRangeGenerator() override {} - virtual ParamIteratorInterface<T>* Begin() const { + ParamIteratorInterface<T> *Begin() const override { return new Iterator(this, container_.begin()); } - virtual ParamIteratorInterface<T>* End() const { + ParamIteratorInterface<T> *End() const override { return new Iterator(this, container_.end()); } @@ -287,16 +287,16 @@ class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> { Iterator(const ParamGeneratorInterface<T>* base, typename ContainerType::const_iterator iterator) : base_(base), iterator_(iterator) {} - virtual ~Iterator() {} + ~Iterator() override {} - virtual const ParamGeneratorInterface<T>* BaseGenerator() const { + const ParamGeneratorInterface<T> *BaseGenerator() const override { return base_; } - virtual void Advance() { + void Advance() override { ++iterator_; value_.reset(); } - virtual ParamIteratorInterface<T>* Clone() const { + ParamIteratorInterface<T> *Clone() const override { return new Iterator(*this); } // We need to use cached value referenced by iterator_ because *iterator_ @@ -306,12 +306,12 @@ class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> { // can advance iterator_ beyond the end of the range, and we cannot // detect that fact. The client code, on the other hand, is // responsible for not calling Current() on an out-of-range iterator. - virtual const T* Current() const { + const T *Current() const override { if (value_.get() == NULL) value_.reset(new T(*iterator_)); return value_.get(); } - virtual bool Equals(const ParamIteratorInterface<T>& other) const { + bool Equals(const ParamIteratorInterface<T> &other) const override { // Having the same base generator guarantees that the other // iterator is of the same type and we can downcast. GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) @@ -355,7 +355,7 @@ class ParameterizedTestFactory : public TestFactoryBase { typedef typename TestClass::ParamType ParamType; explicit ParameterizedTestFactory(ParamType parameter) : parameter_(parameter) {} - virtual Test* CreateTest() { + Test *CreateTest() override { TestClass::SetParam(¶meter_); return new TestClass(); } @@ -394,7 +394,7 @@ class TestMetaFactory TestMetaFactory() {} - virtual TestFactoryBase* CreateTestFactory(ParamType parameter) { + TestFactoryBase *CreateTestFactory(ParamType parameter) override { return new ParameterizedTestFactory<TestCase>(parameter); } @@ -454,9 +454,9 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase { : test_case_name_(name) {} // Test case base name for display purposes. - virtual const string& GetTestCaseName() const { return test_case_name_; } + const string &GetTestCaseName() const override { return test_case_name_; } // Test case id to verify identity. - virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); } + TypeId GetTestCaseTypeId() const override { return GetTypeId<TestCase>(); } // TEST_P macro uses AddTestPattern() to record information // about a single test in a LocalTestInfo structure. // test_case_name is the base name of the test case (without invocation @@ -484,7 +484,7 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase { // This method should not be called more then once on any single // instance of a ParameterizedTestCaseInfoBase derived class. // UnitTest has a guard to prevent from calling this method more then once. - virtual void RegisterTests() { + void RegisterTests() override { for (typename TestInfoContainer::iterator test_it = tests_.begin(); test_it != tests_.end(); ++test_it) { linked_ptr<TestInfo> test_info = *test_it; diff --git a/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h b/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h index 9ddcea1fbf9..6b942e9f9d9 100644 --- a/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h +++ b/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h @@ -1165,7 +1165,7 @@ class ThreadWithParam : public ThreadWithParamBase { GTEST_CHECK_POSIX_SUCCESS_( pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base)); } - ~ThreadWithParam() { Join(); } + ~ThreadWithParam() override { Join(); } void Join() { if (!finished_) { @@ -1174,7 +1174,7 @@ class ThreadWithParam : public ThreadWithParamBase { } } - virtual void Run() { + void Run() override { if (thread_can_start_ != NULL) thread_can_start_->WaitForNotification(); func_(param_); |