mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234679 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -68,14 +68,15 @@ class GTEST_API_ ScopedFakeTestPartResultReporter
|
||||
TestPartResultArray* result);
|
||||
|
||||
// The d'tor restores the previous test part result reporter.
|
||||
virtual ~ScopedFakeTestPartResultReporter();
|
||||
~ScopedFakeTestPartResultReporter() override;
|
||||
|
||||
// Appends the TestPartResult object to the TestPartResultArray
|
||||
// received in the constructor.
|
||||
//
|
||||
// This method is from the TestPartResultReporterInterface
|
||||
// interface.
|
||||
virtual void ReportTestPartResult(const TestPartResult& result);
|
||||
void ReportTestPartResult(const TestPartResult &result) override;
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
|
@@ -159,8 +159,8 @@ class GTEST_API_ HasNewFatalFailureHelper
|
||||
: public TestPartResultReporterInterface {
|
||||
public:
|
||||
HasNewFatalFailureHelper();
|
||||
virtual ~HasNewFatalFailureHelper();
|
||||
virtual void ReportTestPartResult(const TestPartResult& result);
|
||||
~HasNewFatalFailureHelper() override;
|
||||
void ReportTestPartResult(const TestPartResult &result) override;
|
||||
bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
|
||||
private:
|
||||
bool has_new_fatal_failure_;
|
||||
|
@@ -982,21 +982,22 @@ class TestEventListener {
|
||||
class EmptyTestEventListener : public TestEventListener {
|
||||
virtual void anchor();
|
||||
public:
|
||||
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
|
||||
virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
|
||||
int /*iteration*/) {}
|
||||
virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
|
||||
virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
|
||||
virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
|
||||
virtual void OnTestStart(const TestInfo& /*test_info*/) {}
|
||||
virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
|
||||
virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
|
||||
virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
|
||||
virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
|
||||
virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
|
||||
virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
|
||||
int /*iteration*/) {}
|
||||
virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
|
||||
void OnTestProgramStart(const UnitTest & /*unit_test*/) override {}
|
||||
void OnTestIterationStart(const UnitTest & /*unit_test*/,
|
||||
int /*iteration*/) override {}
|
||||
void OnEnvironmentsSetUpStart(const UnitTest & /*unit_test*/) override {}
|
||||
void OnEnvironmentsSetUpEnd(const UnitTest & /*unit_test*/) override {}
|
||||
void OnTestCaseStart(const TestCase & /*test_case*/) override {}
|
||||
void OnTestStart(const TestInfo & /*test_info*/) override {}
|
||||
void OnTestPartResult(const TestPartResult & /*test_part_result*/) override {
|
||||
}
|
||||
void OnTestEnd(const TestInfo & /*test_info*/) override {}
|
||||
void OnTestCaseEnd(const TestCase & /*test_case*/) override {}
|
||||
void OnEnvironmentsTearDownStart(const UnitTest & /*unit_test*/) override {}
|
||||
void OnEnvironmentsTearDownEnd(const UnitTest & /*unit_test*/) override {}
|
||||
void OnTestIterationEnd(const UnitTest & /*unit_test*/,
|
||||
int /*iteration*/) override {}
|
||||
void OnTestProgramEnd(const UnitTest & /*unit_test*/) override {}
|
||||
};
|
||||
|
||||
// TestEventListeners lets users add listeners to track events in Google Test.
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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_);
|
||||
|
Reference in New Issue
Block a user