Skip to content

Commit

Permalink
Add more override
Browse files Browse the repository at this point in the history
  • Loading branch information
archang19 committed Dec 17, 2024
1 parent 51769c4 commit 378d36a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
8 changes: 5 additions & 3 deletions db/db_test_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,9 @@ class SpecialEnv : public EnvWrapper {
: env_(env), base_(std::move(b)) {
env_->num_open_wal_file_.fetch_add(1);
}
virtual ~SpecialWalFile() { env_->num_open_wal_file_.fetch_add(-1); }
virtual ~SpecialWalFile() override {
env_->num_open_wal_file_.fetch_add(-1);
}
Status Append(const Slice& data) override {
#if !(defined NDEBUG) || !defined(OS_WIN)
TEST_SYNC_POINT("SpecialEnv::SpecialWalFile::Append:1");
Expand Down Expand Up @@ -594,7 +596,7 @@ class SpecialEnv : public EnvWrapper {
class NoopDirectory : public Directory {
public:
NoopDirectory() {}
~NoopDirectory() {}
~NoopDirectory() override {}

Status Fsync() override { return Status::OK(); }
Status Close() override { return Status::OK(); }
Expand Down Expand Up @@ -1098,7 +1100,7 @@ class DBTestBase : public testing::Test {
// tests, but won't cover the exact fsync logic.
DBTestBase(const std::string path, bool env_do_fsync);

~DBTestBase();
~DBTestBase() override;

static std::string Key(int i) {
char buf[100];
Expand Down
2 changes: 1 addition & 1 deletion table/mock_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class MockTableBuilder : public TableBuilder {
}

// REQUIRES: Either Finish() or Abandon() has been called.
~MockTableBuilder() = default;
~MockTableBuilder() override = default;

// Add key,value to the table being constructed.
// REQUIRES: key is after any previously added key according to comparator.
Expand Down
2 changes: 1 addition & 1 deletion table/mock_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class MockTableReader : public TableReader {
return std::make_shared<const TableProperties>(tp_);
}

~MockTableReader() = default;
~MockTableReader() override = default;

private:
const KVVector& table_;
Expand Down
10 changes: 5 additions & 5 deletions test_util/testutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class PlainInternalKeyComparator : public InternalKeyComparator {
explicit PlainInternalKeyComparator(const Comparator* c)
: InternalKeyComparator(c) {}

virtual ~PlainInternalKeyComparator() {}
virtual ~PlainInternalKeyComparator() override {}

int Compare(const Slice& a, const Slice& b) const override {
return user_comparator()->Compare(a, b);
Expand Down Expand Up @@ -310,7 +310,7 @@ class StringSource : public FSRandomAccessFile {
mmap_(mmap),
total_reads_(0) {}

virtual ~StringSource() {}
virtual ~StringSource() override {}

uint64_t Size() const { return contents_.size(); }

Expand Down Expand Up @@ -744,7 +744,7 @@ class ChanglingMergeOperator : public MergeOperator {
public:
explicit ChanglingMergeOperator(const std::string& name)
: name_(name + "MergeOperator") {}
~ChanglingMergeOperator() {}
~ChanglingMergeOperator() override {}

void SetName(const std::string& name) { name_ = name; }

Expand Down Expand Up @@ -783,7 +783,7 @@ class ChanglingCompactionFilter : public CompactionFilter {
public:
explicit ChanglingCompactionFilter(const std::string& name)
: name_(name + "CompactionFilter") {}
~ChanglingCompactionFilter() {}
~ChanglingCompactionFilter() override {}

void SetName(const std::string& name) { name_ = name; }

Expand Down Expand Up @@ -819,7 +819,7 @@ class ChanglingCompactionFilterFactory : public CompactionFilterFactory {
public:
explicit ChanglingCompactionFilterFactory(const std::string& name)
: name_(name + "CompactionFilterFactory") {}
~ChanglingCompactionFilterFactory() {}
~ChanglingCompactionFilterFactory() override {}

void SetName(const std::string& name) { name_ = name; }

Expand Down

0 comments on commit 378d36a

Please sign in to comment.