From 51f87e2e0d4159fc5ad248074dfeb970c4e74816 Mon Sep 17 00:00:00 2001 From: liuchang0812 Date: Fri, 3 Mar 2017 21:18:38 +0800 Subject: [PATCH] test: add override in test submodule Signed-off-by: liuchang0812 --- src/test/ObjectMap/KeyValueDBMemory.cc | 4 +- src/test/ObjectMap/KeyValueDBMemory.h | 32 ++--- src/test/TestTimers.cc | 4 +- src/test/bench/bencher.h | 4 +- src/test/bench/detailed_stat_collector.h | 12 +- src/test/bench/distribution.h | 12 +- src/test/bench/dumb_backend.h | 18 +-- src/test/bench/rados_backend.h | 4 +- src/test/bench/rbd_backend.h | 4 +- src/test/bench/testfilestore_backend.h | 6 +- src/test/compressor/compressor_example.h | 8 +- src/test/compressor/test_compression.cc | 2 +- src/test/encoding/ceph_dencoder.cc | 4 +- src/test/erasure-code/ErasureCodeExample.h | 38 +++--- src/test/erasure-code/TestErasureCode.cc | 2 +- src/test/journal/RadosTestFixture.h | 6 +- src/test/librados/TestCase.h | 62 ++++----- src/test/librados/misc.cc | 2 +- src/test/librados/tier.cc | 4 +- .../librados_test_stub/MockTestMemIoCtxImpl.h | 2 +- src/test/librados_test_stub/TestIoCtxImpl.h | 2 +- .../librados_test_stub/TestMemIoCtxImpl.h | 89 ++++++------- .../librados_test_stub/TestMemRadosClient.h | 28 ++--- src/test/libradosstriper/TestCase.h | 14 +-- src/test/messenger/simple_dispatcher.h | 22 ++-- src/test/msgr/perf_msgr_server.cc | 2 +- src/test/objectstore/FileStoreTracker.h | 8 +- src/test/objectstore/TestObjectStoreState.h | 2 +- src/test/objectstore/workload_generator.h | 6 +- src/test/omap_bench.h | 2 +- src/test/osd/Object.h | 30 ++--- src/test/osd/RadosModel.h | 118 +++++++++--------- src/test/osdc/FakeWriteback.h | 14 +-- src/test/osdc/MemWriteback.h | 14 +-- src/test/system/rados_list_parallel.cc | 4 +- src/test/system/rados_open_pools_parallel.cc | 2 +- src/test/system/st_rados_create_pool.h | 4 +- src/test/system/st_rados_delete_objs.h | 4 +- src/test/system/st_rados_delete_pool.h | 4 +- src/test/system/st_rados_list_objects.h | 4 +- src/test/system/st_rados_notify.h | 4 +- src/test/system/st_rados_watch.h | 4 +- src/test/test_snap_mapper.cc | 2 +- 43 files changed, 307 insertions(+), 306 deletions(-) diff --git a/src/test/ObjectMap/KeyValueDBMemory.cc b/src/test/ObjectMap/KeyValueDBMemory.cc index a7fc929ead30..f4b3719eff5f 100644 --- a/src/test/ObjectMap/KeyValueDBMemory.cc +++ b/src/test/ObjectMap/KeyValueDBMemory.cc @@ -27,7 +27,7 @@ protected: public: explicit WholeSpaceMemIterator(KeyValueDBMemory *db) : db(db), ready(false) { } - ~WholeSpaceMemIterator() { } + ~WholeSpaceMemIterator() override { } int seek_to_first() override { if (db->db.empty()) { @@ -240,7 +240,7 @@ public: explicit WholeSpaceSnapshotMemIterator(KeyValueDBMemory *db) : WholeSpaceMemIterator(db) { } - ~WholeSpaceSnapshotMemIterator() { + ~WholeSpaceSnapshotMemIterator() override { delete db; } }; diff --git a/src/test/ObjectMap/KeyValueDBMemory.h b/src/test/ObjectMap/KeyValueDBMemory.h index d0ee9dc59d53..767d56f1be4e 100644 --- a/src/test/ObjectMap/KeyValueDBMemory.h +++ b/src/test/ObjectMap/KeyValueDBMemory.h @@ -17,15 +17,15 @@ public: KeyValueDBMemory() { } explicit KeyValueDBMemory(KeyValueDBMemory *db) : db(db->db) { } - virtual ~KeyValueDBMemory() { } + ~KeyValueDBMemory() override { } - virtual int init(string _opt) { + int init(string _opt) override { return 0; } - virtual int open(ostream &out) { + int open(ostream &out) override { return 0; } - virtual int create_and_open(ostream &out) { + int create_and_open(ostream &out) override { return 0; } @@ -33,7 +33,7 @@ public: const string &prefix, const std::set &key, std::map *out - ); + ) override; using KeyValueDB::get; int get_keys( @@ -73,12 +73,12 @@ public: const std::pair &key, const bufferlist &value) : db(db), key(key), value(value) {} - void finish(int r) { + void finish(int r) override { db->set(key.first, key.second, value); } }; - void set(const string &prefix, const string &k, const bufferlist& bl) { + void set(const string &prefix, const string &k, const bufferlist& bl) override { on_commit.push_back(new SetOp(db, std::make_pair(prefix, k), bl)); } @@ -88,12 +88,12 @@ public: RmKeysOp(KeyValueDBMemory *db, const std::pair &key) : db(db), key(key) {} - void finish(int r) { + void finish(int r) override { db->rmkey(key.first, key.second); } }; - void rmkey(const string &prefix, const string &key) { + void rmkey(const string &prefix, const string &key) override { on_commit.push_back(new RmKeysOp(db, std::make_pair(prefix, key))); } @@ -103,11 +103,11 @@ public: RmKeysByPrefixOp(KeyValueDBMemory *db, const string &prefix) : db(db), prefix(prefix) {} - void finish(int r) { + void finish(int r) override { db->rmkeys_by_prefix(prefix); } }; - void rmkeys_by_prefix(const string &prefix) { + void rmkeys_by_prefix(const string &prefix) override { on_commit.push_back(new RmKeysByPrefixOp(db, prefix)); } @@ -120,7 +120,7 @@ public: return 0; } - ~TransactionImpl_() { + ~TransactionImpl_() override { for (list::iterator i = on_commit.begin(); i != on_commit.end(); on_commit.erase(i++)) { @@ -129,15 +129,15 @@ public: } }; - Transaction get_transaction() { + Transaction get_transaction() override { return Transaction(new TransactionImpl_(this)); } - int submit_transaction(Transaction trans) { + int submit_transaction(Transaction trans) override { return static_cast(trans.get())->complete(); } - uint64_t get_estimated_size(map &extras) { + uint64_t get_estimated_size(map &extras) override { uint64_t total_size = 0; for (map,bufferlist>::iterator p = db.begin(); @@ -165,5 +165,5 @@ private: friend class WholeSpaceMemIterator; protected: - WholeSpaceIterator _get_iterator(); + WholeSpaceIterator _get_iterator() override; }; diff --git a/src/test/TestTimers.cc b/src/test/TestTimers.cc index 77b64d9356e8..691cab3e718a 100644 --- a/src/test/TestTimers.cc +++ b/src/test/TestTimers.cc @@ -39,7 +39,7 @@ public: array_lock.Unlock(); } - ~TestContext() + ~TestContext() override { } @@ -63,7 +63,7 @@ public: array_lock.Unlock(); } - ~StrictOrderTestContext() + ~StrictOrderTestContext() override { } }; diff --git a/src/test/bench/bencher.h b/src/test/bench/bencher.h index 28d743351f33..1fe9b888d6c1 100644 --- a/src/test/bench/bencher.h +++ b/src/test/bench/bencher.h @@ -101,7 +101,7 @@ public: ); void run_bench(); - void *entry() { + void *entry() override { run_bench(); return 0; } @@ -131,7 +131,7 @@ public: op_dist(op_dist) {} boost::tuple - operator()() { + operator()() override { boost::tuple ret = boost::make_tuple(*object_pos, cur_pos, length, (*op_dist)()); cur_pos += length; diff --git a/src/test/bench/detailed_stat_collector.h b/src/test/bench/detailed_stat_collector.h index 60b7cab3cdca..ad622f91a6c7 100644 --- a/src/test/bench/detailed_stat_collector.h +++ b/src/test/bench/detailed_stat_collector.h @@ -84,12 +84,12 @@ public: AdditionalPrinting *details = 0 ); - uint64_t next_seq(); - void start_write(uint64_t seq, uint64_t size); - void start_read(uint64_t seq, uint64_t size); - void write_applied(uint64_t seq); - void write_committed(uint64_t seq); - void read_complete(uint64_t seq); + uint64_t next_seq() override; + void start_write(uint64_t seq, uint64_t size) override; + void start_read(uint64_t seq, uint64_t size) override; + void write_applied(uint64_t seq) override; + void write_committed(uint64_t seq) override; + void read_complete(uint64_t seq) override; }; diff --git a/src/test/bench/distribution.h b/src/test/bench/distribution.h index 545195fc8b43..fdad5dd39ef0 100644 --- a/src/test/bench/distribution.h +++ b/src/test/bench/distribution.h @@ -35,7 +35,7 @@ public: Distribution *v, Distribution *w) : t(t), u(u), v(v), w(w) {} - boost::tuple operator()() { + boost::tuple operator()() override { return boost::make_tuple((*t)(), (*u)(), (*v)(), (*w)()); } }; @@ -53,7 +53,7 @@ public: contents.insert(std::make_pair(count, *i)); } } - virtual T operator()() { + T operator()() override { assert(contents.size()); boost::uniform_int<> value(0, contents.size() - 1); return contents.find(value(rng))->second; @@ -76,7 +76,7 @@ public: contents.insert(std::make_pair(total, i->second)); } } - virtual T operator()() { + T operator()() override { return contents.lower_bound( boost::uniform_real<>(0, total)(rng))->second; } @@ -107,7 +107,7 @@ class UniformRandom : public Distribution { public: UniformRandom(const rngen_t &rng, uint64_t min, uint64_t max) : rng(rng), min(min), max(max) {} - virtual uint64_t operator()() { + uint64_t operator()() override { return boost::uniform_int(min, max)(rng); } }; @@ -118,7 +118,7 @@ class Align : public Distribution { public: Align(Distribution *dist, uint64_t align) : dist(dist), align(align) {} - virtual uint64_t operator()() { + uint64_t operator()() override { uint64_t ret = (*dist)(); return ret - (ret % align); } @@ -128,7 +128,7 @@ class Uniform : public Distribution { uint64_t val; public: explicit Uniform(uint64_t val) : val(val) {} - virtual uint64_t operator()() { + uint64_t operator()() override { return val; } }; diff --git a/src/test/bench/dumb_backend.h b/src/test/bench/dumb_backend.h index 50f3908d84ba..11843f1599da 100644 --- a/src/test/bench/dumb_backend.h +++ b/src/test/bench/dumb_backend.h @@ -43,7 +43,7 @@ class DumbBackend : public Backend { DumbBackend *backend; public: explicit SyncThread(DumbBackend *backend) : backend(backend) {} - void *entry() { + void *entry() override { backend->sync_loop(); return 0; } @@ -69,19 +69,19 @@ class DumbBackend : public Backend { ThreadPool *tp) : ThreadPool::WorkQueue("DumbBackend::queue", ti, ti*10, tp), backend(_backend) {} - bool _enqueue(write_item *item) { + bool _enqueue(write_item *item) override { item_queue.push_back(item); return true; } - void _dequeue(write_item*) { ceph_abort(); } - write_item *_dequeue() { + void _dequeue(write_item*) override { ceph_abort(); } + write_item *_dequeue() override { if (item_queue.empty()) return 0; write_item *retval = item_queue.front(); item_queue.pop_front(); return retval; } - bool _empty() { + bool _empty() override { return item_queue.empty(); } void _process(write_item *item, ThreadPool::TPHandle &) override { @@ -92,7 +92,7 @@ class DumbBackend : public Backend { item->on_applied, item->on_commit); } - void _clear() { + void _clear() override { return item_queue.clear(); } } queue; @@ -134,7 +134,7 @@ public: sem.Put(); } } - ~DumbBackend() { + ~DumbBackend() override { { Mutex::Locker l(sync_loop_mutex); if (sync_loop_stop == 0) @@ -150,7 +150,7 @@ public: uint64_t offset, const bufferlist &bl, Context *on_applied, - Context *on_commit) { + Context *on_commit) override { sem.Get(); queue.queue( new write_item( @@ -162,7 +162,7 @@ public: uint64_t offset, uint64_t length, bufferlist *bl, - Context *on_complete); + Context *on_complete) override; }; #endif diff --git a/src/test/bench/rados_backend.h b/src/test/bench/rados_backend.h index a607ae7c8cc5..fa46ab3b185a 100644 --- a/src/test/bench/rados_backend.h +++ b/src/test/bench/rados_backend.h @@ -18,14 +18,14 @@ public: uint64_t offset, const bufferlist &bl, Context *on_applied, - Context *on_commit); + Context *on_commit) override; void read( const string &oid, uint64_t offset, uint64_t length, bufferlist *bl, - Context *on_complete); + Context *on_complete) override; }; #endif diff --git a/src/test/bench/rbd_backend.h b/src/test/bench/rbd_backend.h index 9994bc727b52..d245c99716b8 100644 --- a/src/test/bench/rbd_backend.h +++ b/src/test/bench/rbd_backend.h @@ -17,14 +17,14 @@ public: uint64_t offset, const bufferlist &bl, Context *on_applied, - Context *on_commit); + Context *on_commit) override; void read( const string &oid, uint64_t offset, uint64_t length, bufferlist *bl, - Context *on_complete); + Context *on_complete) override; }; #endif diff --git a/src/test/bench/testfilestore_backend.h b/src/test/bench/testfilestore_backend.h index 2c3f8e6dc052..412d93c860fe 100644 --- a/src/test/bench/testfilestore_backend.h +++ b/src/test/bench/testfilestore_backend.h @@ -16,7 +16,7 @@ class TestFileStoreBackend : public Backend { public: TestFileStoreBackend(ObjectStore *os, bool write_infos); - ~TestFileStoreBackend() { + ~TestFileStoreBackend() override { finisher.stop(); } void write( @@ -24,14 +24,14 @@ public: uint64_t offset, const bufferlist &bl, Context *on_applied, - Context *on_commit); + Context *on_commit) override; void read( const string &oid, uint64_t offset, uint64_t length, bufferlist *bl, - Context *on_complete); + Context *on_complete) override; }; #endif diff --git a/src/test/compressor/compressor_example.h b/src/test/compressor/compressor_example.h index 058dbcaf0cbb..334a4eecd0fa 100644 --- a/src/test/compressor/compressor_example.h +++ b/src/test/compressor/compressor_example.h @@ -30,20 +30,20 @@ class CompressorExample : public Compressor { public: CompressorExample() : Compressor(COMP_ALG_NONE, "example") {} - virtual ~CompressorExample() {} + ~CompressorExample() override {} - virtual int compress(const bufferlist &in, bufferlist &out) + int compress(const bufferlist &in, bufferlist &out) override { out = in; return 0; } - virtual int decompress(const bufferlist &in, bufferlist &out) + int decompress(const bufferlist &in, bufferlist &out) override { out = in; return 0; } - virtual int decompress(bufferlist::iterator &p, size_t compressed_len, bufferlist &out) + int decompress(bufferlist::iterator &p, size_t compressed_len, bufferlist &out) override { p.copy(MIN(p.get_remaining(), compressed_len), out); return 0; diff --git a/src/test/compressor/test_compression.cc b/src/test/compressor/test_compression.cc index f4006c6d2ff1..11678e024e86 100644 --- a/src/test/compressor/test_compression.cc +++ b/src/test/compressor/test_compression.cc @@ -51,7 +51,7 @@ public: } cout << "[plugin " << plugin << " (" << GetParam() << ")]" << std::endl; } - ~CompressorTest() { + ~CompressorTest() override { g_conf->set_val("compressor_zlib_isal", old_zlib_isal ? "true" : "false"); g_ceph_context->_conf->apply_changes(NULL); } diff --git a/src/test/encoding/ceph_dencoder.cc b/src/test/encoding/ceph_dencoder.cc index 676e7d4ad050..3875aaae00e3 100644 --- a/src/test/encoding/ceph_dencoder.cc +++ b/src/test/encoding/ceph_dencoder.cc @@ -104,7 +104,7 @@ public: : m_object(new T), stray_okay(stray_okay), nondeterministic(nondeterministic) {} - ~DencoderBase() { + ~DencoderBase() override { delete m_object; } @@ -220,7 +220,7 @@ public: MessageDencoderImpl() { m_object = new T; } - ~MessageDencoderImpl() { + ~MessageDencoderImpl() override { m_object->put(); } diff --git a/src/test/erasure-code/ErasureCodeExample.h b/src/test/erasure-code/ErasureCodeExample.h index d56ae2e4cac8..f235c8f13fe4 100644 --- a/src/test/erasure-code/ErasureCodeExample.h +++ b/src/test/erasure-code/ErasureCodeExample.h @@ -37,18 +37,18 @@ class ErasureCodeExample : public ErasureCode { public: - virtual ~ErasureCodeExample() {} + ~ErasureCodeExample() override {} - virtual int create_ruleset(const string &name, + int create_ruleset(const string &name, CrushWrapper &crush, - ostream *ss) const { + ostream *ss) const override { return crush.add_simple_ruleset(name, "default", "host", "indep", pg_pool_t::TYPE_ERASURE, ss); } - virtual int minimum_to_decode(const set &want_to_read, + int minimum_to_decode(const set &want_to_read, const set &available_chunks, - set *minimum) { + set *minimum) override { if (includes(available_chunks.begin(), available_chunks.end(), want_to_read.begin(), want_to_read.end())) { *minimum = want_to_read; @@ -61,9 +61,9 @@ public: } } - virtual int minimum_to_decode_with_cost(const set &want_to_read, + int minimum_to_decode_with_cost(const set &want_to_read, const map &available, - set *minimum) { + set *minimum) override { // // If one chunk is more expensive to fetch than the others, // recover it instead. For instance, if the cost reflects the @@ -91,21 +91,21 @@ public: return minimum_to_decode(want_to_read, available_chunks, minimum); } - virtual unsigned int get_chunk_count() const { + unsigned int get_chunk_count() const override { return DATA_CHUNKS + CODING_CHUNKS; } - virtual unsigned int get_data_chunk_count() const { + unsigned int get_data_chunk_count() const override { return DATA_CHUNKS; } - virtual unsigned int get_chunk_size(unsigned int object_size) const { + unsigned int get_chunk_size(unsigned int object_size) const override { return ( object_size / DATA_CHUNKS ) + 1; } - virtual int encode(const set &want_to_encode, + int encode(const set &want_to_encode, const bufferlist &in, - map *encoded) { + map *encoded) override { // // make sure all data chunks have the same length, allocating // padding if necessary. @@ -138,15 +138,15 @@ public: return 0; } - virtual int encode_chunks(const set &want_to_encode, - map *encoded) { + int encode_chunks(const set &want_to_encode, + map *encoded) override { ceph_abort(); return 0; } - virtual int decode(const set &want_to_read, + int decode(const set &want_to_read, const map &chunks, - map *decoded) { + map *decoded) override { // // All chunks have the same size // @@ -186,14 +186,14 @@ public: return 0; } - virtual int decode_chunks(const set &want_to_read, + int decode_chunks(const set &want_to_read, const map &chunks, - map *decoded) { + map *decoded) override { ceph_abort(); return 0; } - virtual const vector &get_chunk_mapping() const { + const vector &get_chunk_mapping() const override { static vector mapping; return mapping; } diff --git a/src/test/erasure-code/TestErasureCode.cc b/src/test/erasure-code/TestErasureCode.cc index ddd571fb5a4f..0bf01b05c3e1 100644 --- a/src/test/erasure-code/TestErasureCode.cc +++ b/src/test/erasure-code/TestErasureCode.cc @@ -31,7 +31,7 @@ public: ErasureCodeTest(unsigned int _k, unsigned int _m, unsigned int _chunk_size) : k(_k), m(_m), chunk_size(_chunk_size) {} - ~ErasureCodeTest() {} + ~ErasureCodeTest() override {} int init(ErasureCodeProfile &profile, ostream *ss) override { return 0; diff --git a/src/test/journal/RadosTestFixture.h b/src/test/journal/RadosTestFixture.h index 64d3011a69f0..860329e61079 100644 --- a/src/test/journal/RadosTestFixture.h +++ b/src/test/journal/RadosTestFixture.h @@ -18,8 +18,8 @@ public: static std::string get_temp_oid(); RadosTestFixture(); - virtual void SetUp(); - virtual void TearDown(); + void SetUp() override; + void TearDown() override; int create(const std::string &oid, uint8_t order = 14, uint8_t splay_width = 2); @@ -46,7 +46,7 @@ public: Listener(RadosTestFixture *_test_fixture) : test_fixture(_test_fixture), mutex("mutex") {} - virtual void handle_update(journal::JournalMetadata *metadata) { + void handle_update(journal::JournalMetadata *metadata) override { Mutex::Locker locker(mutex); ++updates[metadata]; cond.Signal(); diff --git a/src/test/librados/TestCase.h b/src/test/librados/TestCase.h index 8e9a93d5351b..2bb1f1f4aa90 100644 --- a/src/test/librados/TestCase.h +++ b/src/test/librados/TestCase.h @@ -22,7 +22,7 @@ class RadosTestNS : public ::testing::Test { public: RadosTestNS() {} - virtual ~RadosTestNS() {} + ~RadosTestNS() override {} protected: static void SetUpTestCase(); static void TearDownTestCase(); @@ -30,8 +30,8 @@ protected: static rados_t s_cluster; static std::string pool_name; - virtual void SetUp(); - virtual void TearDown(); + void SetUp() override; + void TearDown() override; rados_t cluster; rados_ioctx_t ioctx; }; @@ -39,7 +39,7 @@ protected: class RadosTestPPNS : public ::testing::Test { public: RadosTestPPNS() : cluster(s_cluster) {} - virtual ~RadosTestPPNS() {} + ~RadosTestPPNS() override {} protected: static void SetUpTestCase(); static void TearDownTestCase(); @@ -47,8 +47,8 @@ protected: static librados::Rados s_cluster; static std::string pool_name; - virtual void SetUp(); - virtual void TearDown(); + void SetUp() override; + void TearDown() override; librados::Rados &cluster; librados::IoCtx ioctx; }; @@ -56,7 +56,7 @@ protected: class RadosTestParamPPNS : public ::testing::TestWithParam { public: RadosTestParamPPNS() : cluster(s_cluster) {} - virtual ~RadosTestParamPPNS() {} + ~RadosTestParamPPNS() override {} static void SetUpTestCase(); static void TearDownTestCase(); protected: @@ -65,8 +65,8 @@ protected: static std::string pool_name; static std::string cache_pool_name; - virtual void SetUp(); - virtual void TearDown(); + void SetUp() override; + void TearDown() override; librados::Rados &cluster; librados::IoCtx ioctx; }; @@ -74,15 +74,15 @@ protected: class RadosTestECNS : public RadosTestNS { public: RadosTestECNS() {} - virtual ~RadosTestECNS() {} + ~RadosTestECNS() override {} protected: static void SetUpTestCase(); static void TearDownTestCase(); static rados_t s_cluster; static std::string pool_name; - virtual void SetUp(); - virtual void TearDown(); + void SetUp() override; + void TearDown() override; rados_t cluster; rados_ioctx_t ioctx; uint64_t alignment; @@ -91,15 +91,15 @@ protected: class RadosTestECPPNS : public RadosTestPPNS { public: RadosTestECPPNS() : cluster(s_cluster) {} - virtual ~RadosTestECPPNS() {} + ~RadosTestECPPNS() override {} protected: static void SetUpTestCase(); static void TearDownTestCase(); static librados::Rados s_cluster; static std::string pool_name; - virtual void SetUp(); - virtual void TearDown(); + void SetUp() override; + void TearDown() override; librados::Rados &cluster; librados::IoCtx ioctx; uint64_t alignment; @@ -116,7 +116,7 @@ protected: class RadosTest : public ::testing::Test { public: RadosTest() {} - virtual ~RadosTest() {} + ~RadosTest() override {} protected: static void SetUpTestCase(); static void TearDownTestCase(); @@ -125,8 +125,8 @@ protected: static rados_t s_cluster; static std::string pool_name; - virtual void SetUp(); - virtual void TearDown(); + void SetUp() override; + void TearDown() override; rados_t cluster; rados_ioctx_t ioctx; std::string nspace; @@ -135,7 +135,7 @@ protected: class RadosTestPP : public ::testing::Test { public: RadosTestPP() : cluster(s_cluster) {} - virtual ~RadosTestPP() {} + ~RadosTestPP() override {} protected: static void SetUpTestCase(); static void TearDownTestCase(); @@ -144,8 +144,8 @@ protected: static librados::Rados s_cluster; static std::string pool_name; - virtual void SetUp(); - virtual void TearDown(); + void SetUp() override; + void TearDown() override; librados::Rados &cluster; librados::IoCtx ioctx; std::string nspace; @@ -154,7 +154,7 @@ protected: class RadosTestParamPP : public ::testing::TestWithParam { public: RadosTestParamPP() : cluster(s_cluster) {} - virtual ~RadosTestParamPP() {} + ~RadosTestParamPP() override {} static void SetUpTestCase(); static void TearDownTestCase(); protected: @@ -164,8 +164,8 @@ protected: static std::string pool_name; static std::string cache_pool_name; - virtual void SetUp(); - virtual void TearDown(); + void SetUp() override; + void TearDown() override; librados::Rados &cluster; librados::IoCtx ioctx; std::string nspace; @@ -174,15 +174,15 @@ protected: class RadosTestEC : public RadosTest { public: RadosTestEC() {} - virtual ~RadosTestEC() {} + ~RadosTestEC() override {} protected: static void SetUpTestCase(); static void TearDownTestCase(); static rados_t s_cluster; static std::string pool_name; - virtual void SetUp(); - virtual void TearDown(); + void SetUp() override; + void TearDown() override; rados_t cluster; rados_ioctx_t ioctx; std::string nspace; @@ -192,15 +192,15 @@ protected: class RadosTestECPP : public RadosTestPP { public: RadosTestECPP() : cluster(s_cluster) {} - virtual ~RadosTestECPP() {} + ~RadosTestECPP() override {} protected: static void SetUpTestCase(); static void TearDownTestCase(); static librados::Rados s_cluster; static std::string pool_name; - virtual void SetUp(); - virtual void TearDown(); + void SetUp() override; + void TearDown() override; librados::Rados &cluster; librados::IoCtx ioctx; std::string nspace; @@ -216,7 +216,7 @@ protected: class RadosTestNP: public ::testing::Test { public: RadosTestNP() {} - virtual ~RadosTestNP() {} + ~RadosTestNP() override {} }; #endif diff --git a/src/test/librados/misc.cc b/src/test/librados/misc.cc index 74065842829d..96348a1090ce 100644 --- a/src/test/librados/misc.cc +++ b/src/test/librados/misc.cc @@ -836,7 +836,7 @@ class LibRadosTwoPoolsECPP : public RadosTestECPP { public: LibRadosTwoPoolsECPP() {}; - ~LibRadosTwoPoolsECPP() {}; + ~LibRadosTwoPoolsECPP() override {}; protected: static void SetUpTestCase() { pool_name = get_temp_pool_name(); diff --git a/src/test/librados/tier.cc b/src/test/librados/tier.cc index 0b0c78385c7c..ab7130ce5a41 100755 --- a/src/test/librados/tier.cc +++ b/src/test/librados/tier.cc @@ -67,7 +67,7 @@ class LibRadosTwoPoolsPP : public RadosTestPP { public: LibRadosTwoPoolsPP() {}; - ~LibRadosTwoPoolsPP() {}; + ~LibRadosTwoPoolsPP() override {}; protected: static void SetUpTestCase() { pool_name = get_temp_pool_name(); @@ -2742,7 +2742,7 @@ class LibRadosTwoPoolsECPP : public RadosTestECPP { public: LibRadosTwoPoolsECPP() {}; - ~LibRadosTwoPoolsECPP() {}; + ~LibRadosTwoPoolsECPP() override {}; protected: static void SetUpTestCase() { pool_name = get_temp_pool_name(); diff --git a/src/test/librados_test_stub/MockTestMemIoCtxImpl.h b/src/test/librados_test_stub/MockTestMemIoCtxImpl.h index 291853990ebe..bc1250d84a9f 100644 --- a/src/test/librados_test_stub/MockTestMemIoCtxImpl.h +++ b/src/test/librados_test_stub/MockTestMemIoCtxImpl.h @@ -26,7 +26,7 @@ public: return m_mock_client; } - virtual TestIoCtxImpl *clone() { + TestIoCtxImpl *clone() override { TestIoCtxImpl *io_ctx_impl = new ::testing::NiceMock( m_mock_client, m_client, get_pool_id(), get_pool_name(), get_pool()); io_ctx_impl->set_snap_read(get_snap_read()); diff --git a/src/test/librados_test_stub/TestIoCtxImpl.h b/src/test/librados_test_stub/TestIoCtxImpl.h index 30f120616918..aa5318e1171d 100644 --- a/src/test/librados_test_stub/TestIoCtxImpl.h +++ b/src/test/librados_test_stub/TestIoCtxImpl.h @@ -169,7 +169,7 @@ private: C_AioNotify(TestIoCtxImpl *_io_ctx, AioCompletionImpl *_aio_comp) : io_ctx(_io_ctx), aio_comp(_aio_comp) { } - virtual void finish(int r) { + void finish(int r) override { io_ctx->handle_aio_notify_complete(aio_comp, r); } }; diff --git a/src/test/librados_test_stub/TestMemIoCtxImpl.h b/src/test/librados_test_stub/TestMemIoCtxImpl.h index 97e9e89525ee..bfe45df5d1b3 100644 --- a/src/test/librados_test_stub/TestMemIoCtxImpl.h +++ b/src/test/librados_test_stub/TestMemIoCtxImpl.h @@ -15,50 +15,51 @@ public: TestMemIoCtxImpl(TestMemRadosClient *client, int64_t m_pool_id, const std::string& pool_name, TestMemRadosClient::Pool *pool); - virtual ~TestMemIoCtxImpl(); - - virtual TestIoCtxImpl *clone(); - - virtual int aio_remove(const std::string& oid, AioCompletionImpl *c); - - virtual int append(const std::string& oid, const bufferlist &bl, - const SnapContext &snapc); - virtual int assert_exists(const std::string &oid); - - virtual int create(const std::string& oid, bool exclusive); - virtual int list_snaps(const std::string& o, snap_set_t *out_snaps); - virtual int omap_get_vals(const std::string& oid, - const std::string& start_after, - const std::string &filter_prefix, - uint64_t max_return, - std::map *out_vals); - virtual int omap_rm_keys(const std::string& oid, - const std::set& keys); - virtual int omap_set(const std::string& oid, const std::map &map); - virtual int read(const std::string& oid, size_t len, uint64_t off, - bufferlist *bl); - virtual int remove(const std::string& oid, const SnapContext &snapc); - virtual int selfmanaged_snap_create(uint64_t *snapid); - virtual int selfmanaged_snap_remove(uint64_t snapid); - virtual int selfmanaged_snap_rollback(const std::string& oid, - uint64_t snapid); - virtual int sparse_read(const std::string& oid, uint64_t off, uint64_t len, - std::map *m, bufferlist *data_bl); - virtual int stat(const std::string& oid, uint64_t *psize, time_t *pmtime); - virtual int truncate(const std::string& oid, uint64_t size, - const SnapContext &snapc); - virtual int write(const std::string& oid, bufferlist& bl, size_t len, - uint64_t off, const SnapContext &snapc); - virtual int write_full(const std::string& oid, bufferlist& bl, - const SnapContext &snapc); - virtual int writesame(const std::string& oid, bufferlist& bl, size_t len, - uint64_t off, const SnapContext &snapc); - virtual int xattr_get(const std::string& oid, - std::map* attrset); - virtual int xattr_set(const std::string& oid, const std::string &name, - bufferlist& bl); - virtual int zero(const std::string& oid, uint64_t off, uint64_t len); + ~TestMemIoCtxImpl() override; + + TestIoCtxImpl *clone() override; + + int aio_remove(const std::string& oid, AioCompletionImpl *c) override; + + int append(const std::string& oid, const bufferlist &bl, + const SnapContext &snapc) override; + + int assert_exists(const std::string &oid) override; + + int create(const std::string& oid, bool exclusive) override; + int list_snaps(const std::string& o, snap_set_t *out_snaps) override; + int omap_get_vals(const std::string& oid, + const std::string& start_after, + const std::string &filter_prefix, + uint64_t max_return, + std::map *out_vals) override; + int omap_rm_keys(const std::string& oid, + const std::set& keys) override; + int omap_set(const std::string& oid, const std::map &map) override; + int read(const std::string& oid, size_t len, uint64_t off, + bufferlist *bl) override; + int remove(const std::string& oid, const SnapContext &snapc) override; + int selfmanaged_snap_create(uint64_t *snapid) override; + int selfmanaged_snap_remove(uint64_t snapid) override; + int selfmanaged_snap_rollback(const std::string& oid, + uint64_t snapid) override; + int sparse_read(const std::string& oid, uint64_t off, uint64_t len, + std::map *m, bufferlist *data_bl) override; + int stat(const std::string& oid, uint64_t *psize, time_t *pmtime) override; + int truncate(const std::string& oid, uint64_t size, + const SnapContext &snapc) override; + int write(const std::string& oid, bufferlist& bl, size_t len, + uint64_t off, const SnapContext &snapc) override; + int write_full(const std::string& oid, bufferlist& bl, + const SnapContext &snapc) override; + int writesame(const std::string& oid, bufferlist& bl, size_t len, + uint64_t off, const SnapContext &snapc) override; + int xattr_get(const std::string& oid, + std::map* attrset) override; + int xattr_set(const std::string& oid, const std::string &name, + bufferlist& bl) override; + int zero(const std::string& oid, uint64_t off, uint64_t len) override; protected: TestMemRadosClient::Pool *get_pool() { diff --git a/src/test/librados_test_stub/TestMemRadosClient.h b/src/test/librados_test_stub/TestMemRadosClient.h index dada74ec62a1..e574a1361b45 100644 --- a/src/test/librados_test_stub/TestMemRadosClient.h +++ b/src/test/librados_test_stub/TestMemRadosClient.h @@ -67,25 +67,25 @@ public: TestMemRadosClient(CephContext *cct); - virtual TestIoCtxImpl *create_ioctx(int64_t pool_id, - const std::string &pool_name); + TestIoCtxImpl *create_ioctx(int64_t pool_id, + const std::string &pool_name) override; - virtual void object_list(int64_t pool_id, - std::list *list); + void object_list(int64_t pool_id, + std::list *list) override; - virtual int pool_create(const std::string &pool_name); - virtual int pool_delete(const std::string &pool_name); - virtual int pool_get_base_tier(int64_t pool_id, int64_t* base_tier); - virtual int pool_list(std::list >& v); - virtual int64_t pool_lookup(const std::string &name); - virtual int pool_reverse_lookup(int64_t id, std::string *name); + int pool_create(const std::string &pool_name) override; + int pool_delete(const std::string &pool_name) override; + int pool_get_base_tier(int64_t pool_id, int64_t* base_tier) override; + int pool_list(std::list >& v) override; + int64_t pool_lookup(const std::string &name) override; + int pool_reverse_lookup(int64_t id, std::string *name) override; - virtual int watch_flush(); + int watch_flush() override; - virtual int blacklist_add(const std::string& client_address, - uint32_t expire_seconds); + int blacklist_add(const std::string& client_address, + uint32_t expire_seconds) override; protected: - ~TestMemRadosClient(); + ~TestMemRadosClient() override; Pool *get_pool(const std::string &pool_name); diff --git a/src/test/libradosstriper/TestCase.h b/src/test/libradosstriper/TestCase.h index cfa9f72ad747..301f53a8e687 100644 --- a/src/test/libradosstriper/TestCase.h +++ b/src/test/libradosstriper/TestCase.h @@ -23,15 +23,15 @@ class StriperTest : public ::testing::Test { public: StriperTest() {} - virtual ~StriperTest() {} + ~StriperTest() override {} protected: static void SetUpTestCase(); static void TearDownTestCase(); static rados_t s_cluster; static std::string pool_name; - virtual void SetUp(); - virtual void TearDown(); + void SetUp() override; + void TearDown() override; rados_t cluster; rados_ioctx_t ioctx; rados_striper_t striper; @@ -40,14 +40,14 @@ protected: class StriperTestPP : public ::testing::Test { public: StriperTestPP() : cluster(s_cluster) {} - virtual ~StriperTestPP() {} + ~StriperTestPP() override {} static void SetUpTestCase(); static void TearDownTestCase(); protected: static librados::Rados s_cluster; static std::string pool_name; - virtual void SetUp(); + void SetUp() override; librados::Rados &cluster; librados::IoCtx ioctx; libradosstriper::RadosStriper striper; @@ -66,14 +66,14 @@ struct TestData { class StriperTestParam : public ::testing::TestWithParam { public: StriperTestParam() : cluster(s_cluster) {} - virtual ~StriperTestParam() {} + ~StriperTestParam() override {} static void SetUpTestCase(); static void TearDownTestCase(); protected: static librados::Rados s_cluster; static std::string pool_name; - virtual void SetUp(); + void SetUp() override; librados::Rados &cluster; librados::IoCtx ioctx; libradosstriper::RadosStriper striper; diff --git a/src/test/messenger/simple_dispatcher.h b/src/test/messenger/simple_dispatcher.h index 57427901ca66..c5345d662d1a 100644 --- a/src/test/messenger/simple_dispatcher.h +++ b/src/test/messenger/simple_dispatcher.h @@ -25,7 +25,7 @@ private: uint64_t dcount; public: explicit SimpleDispatcher(Messenger *msgr); - virtual ~SimpleDispatcher(); + ~SimpleDispatcher() override; uint64_t get_dcount() { return dcount; } @@ -34,7 +34,7 @@ public: }; // how i receive messages - virtual bool ms_dispatch(Message *m); + bool ms_dispatch(Message *m) override; /** * This function will be called whenever a new Connection is made to the @@ -43,14 +43,14 @@ public: * @param con The new Connection which has been established. You are not * granted a reference to it -- take one if you need one! */ - virtual void ms_handle_connect(Connection *con) { }; + void ms_handle_connect(Connection *con) override { }; /** * Callback indicating we have accepted an incoming connection. * * @param con The (new or existing) Connection associated with the session */ - virtual void ms_handle_accept(Connection *con) { }; + void ms_handle_accept(Connection *con) override { }; /* * this indicates that the ordered+reliable delivery semantics have @@ -62,7 +62,7 @@ public: * @param con The Connection which broke. You are not granted * a reference to it. */ - virtual bool ms_handle_reset(Connection *con); + bool ms_handle_reset(Connection *con) override; /** * This indicates that the ordered+reliable delivery semantics @@ -73,9 +73,9 @@ public: * @param con The Connection which broke. You are not granted * a reference to it. */ - virtual void ms_handle_remote_reset(Connection *con); + void ms_handle_remote_reset(Connection *con) override; - virtual bool ms_handle_refused(Connection *con) { return false; } + bool ms_handle_refused(Connection *con) override { return false; } /** * @defgroup Authentication @@ -94,8 +94,8 @@ public: * * @return True if this function call properly filled in *a, false otherwise. */ - virtual bool ms_get_authorizer(int dest_type, AuthAuthorizer **a, - bool force_new) { return false; }; + bool ms_get_authorizer(int dest_type, AuthAuthorizer **a, + bool force_new) override { return false; }; /** * Verify the authorizer for a new incoming Connection. @@ -112,10 +112,10 @@ public: * @return True if we were able to prove or disprove correctness of * authorizer, false otherwise. */ - virtual bool ms_verify_authorizer(Connection *con, int peer_type, + bool ms_verify_authorizer(Connection *con, int peer_type, int protocol, bufferlist& authorizer, bufferlist& authorizer_reply, - bool& isvalid, CryptoKey& session_key) { + bool& isvalid, CryptoKey& session_key) override { /* always succeed */ isvalid = true; return true; diff --git a/src/test/msgr/perf_msgr_server.cc b/src/test/msgr/perf_msgr_server.cc index 2d428386ecb9..ded62d28918b 100644 --- a/src/test/msgr/perf_msgr_server.cc +++ b/src/test/msgr/perf_msgr_server.cc @@ -75,7 +75,7 @@ class ServerDispatcher : public Dispatcher { op_wq(30, 30, &op_tp) { op_tp.start(); } - ~ServerDispatcher() { + ~ServerDispatcher() override { op_tp.stop(); } bool ms_can_fast_dispatch_any() const override { return true; } diff --git a/src/test/objectstore/FileStoreTracker.h b/src/test/objectstore/FileStoreTracker.h index a324fa25e32b..d422d1cf1444 100644 --- a/src/test/objectstore/FileStoreTracker.h +++ b/src/test/objectstore/FileStoreTracker.h @@ -42,7 +42,7 @@ public: const string &oid) : coll(coll), oid(oid) {} void operator()(FileStoreTracker *harness, - OutTransaction *out) { + OutTransaction *out) override { harness->write(make_pair(coll, oid), out); } }; @@ -56,7 +56,7 @@ public: const string &to) : coll(coll), from(from), to(to) {} void operator()(FileStoreTracker *harness, - OutTransaction *out) { + OutTransaction *out) override { harness->clone_range(make_pair(coll, from), make_pair(coll, to), out); } @@ -71,7 +71,7 @@ public: const string &to) : coll(coll), from(from), to(to) {} void operator()(FileStoreTracker *harness, - OutTransaction *out) { + OutTransaction *out) override { harness->clone(make_pair(coll, from), make_pair(coll, to), out); } @@ -84,7 +84,7 @@ public: const string &obj) : coll(coll), obj(obj) {} void operator()(FileStoreTracker *harness, - OutTransaction *out) { + OutTransaction *out) override { harness->remove(make_pair(coll, obj), out); } diff --git a/src/test/objectstore/TestObjectStoreState.h b/src/test/objectstore/TestObjectStoreState.h index 80164c3bf7c1..c59d4769113e 100644 --- a/src/test/objectstore/TestObjectStoreState.h +++ b/src/test/objectstore/TestObjectStoreState.h @@ -135,7 +135,7 @@ public: public: explicit C_OnFinished(TestObjectStoreState *state) : m_state(state) { } - void finish(int r) { + void finish(int r) override { Mutex::Locker locker(m_state->m_finished_lock); m_state->dec_in_flight(); m_state->m_finished_cond.Signal(); diff --git a/src/test/objectstore/workload_generator.h b/src/test/objectstore/workload_generator.h index 0d5360ee20ef..978cd043b1ec 100644 --- a/src/test/objectstore/workload_generator.h +++ b/src/test/objectstore/workload_generator.h @@ -132,7 +132,7 @@ public: explicit C_OnReadable(WorkloadGenerator *state) :TestObjectStoreState::C_OnFinished(state), wrkldgen_state(state) { } - void finish(int r) + void finish(int r) override { TestObjectStoreState::C_OnFinished::finish(r); wrkldgen_state->m_nr_runs.inc(); @@ -146,7 +146,7 @@ public: C_OnDestroyed(WorkloadGenerator *state, coll_entry_t *entry) : C_OnReadable(state), m_entry(entry) {} - void finish(int r) { + void finish(int r) override { C_OnReadable::finish(r); delete m_entry; } @@ -160,7 +160,7 @@ public: C_StatWrapper(C_StatState *state, Context *context) : stat_state(state), ctx(context) { } - void finish(int r) { + void finish(int r) override { ctx->complete(r); stat_state->wrkldgen->m_stats_lock.Lock(); diff --git a/src/test/omap_bench.h b/src/test/omap_bench.h index d764a5d9ba35..45637489c9ac 100644 --- a/src/test/omap_bench.h +++ b/src/test/omap_bench.h @@ -72,7 +72,7 @@ protected: public: AioWriter(OmapBench *omap_bench); - ~AioWriter(); + ~AioWriter() override; virtual librados::AioCompletion * get_aioc(); virtual void set_aioc(librados::callback_t complete, librados::callback_t safe); diff --git a/src/test/osd/Object.h b/src/test/osd/Object.h index 47fcfd62eb63..85a75a56ca9d 100644 --- a/src/test/osd/Object.h +++ b/src/test/osd/Object.h @@ -167,20 +167,20 @@ public: current = rand(); } - ContDesc get_cont() const { return cont; } - uint64_t get_pos() const { return pos; } + ContDesc get_cont() const override { return cont; } + uint64_t get_pos() const override { return pos; } - iterator_impl &operator++() { + iterator_impl &operator++() override { pos++; current = rand(); return *this; } - char operator*() { + char operator*() override { return current; } - void seek(uint64_t _pos) { + void seek(uint64_t _pos) override { if (_pos < pos) { iterator_impl begin = iterator_impl(cont, cont_gen); begin.seek(_pos); @@ -191,22 +191,22 @@ public: } } - bool end() { + bool end() override { return pos >= cont_gen->get_length(cont); } }; - ContentsGenerator::iterator_impl *get_iterator_impl(const ContDesc &in) { + ContentsGenerator::iterator_impl *get_iterator_impl(const ContDesc &in) override { RandGenerator::iterator_impl *i = new iterator_impl(in, this); return i; } - void put_iterator_impl(ContentsGenerator::iterator_impl *in) { + void put_iterator_impl(ContentsGenerator::iterator_impl *in) override { delete in; } ContentsGenerator::iterator_impl *dup_iterator_impl( - const ContentsGenerator::iterator_impl *in) { + const ContentsGenerator::iterator_impl *in) override { ContentsGenerator::iterator_impl *retval = get_iterator_impl(in->get_cont()); retval->seek(in->get_pos()); return retval; @@ -224,8 +224,8 @@ public: min_stride_size(min_stride_size), max_stride_size(max_stride_size) {} void get_ranges_map( - const ContDesc &cont, std::map &out); - uint64_t get_length(const ContDesc &in) { + const ContDesc &cont, std::map &out) override; + uint64_t get_length(const ContDesc &in) override { RandWrap rand(in.seqnum); if (max_length == 0) return 0; @@ -240,10 +240,10 @@ public: AttrGenerator(uint64_t max_len, uint64_t big_max_len) : max_len(max_len), big_max_len(big_max_len) {} void get_ranges_map( - const ContDesc &cont, std::map &out) { + const ContDesc &cont, std::map &out) override { out.insert(std::pair(0, get_length(cont))); } - uint64_t get_length(const ContDesc &in) { + uint64_t get_length(const ContDesc &in) override { RandWrap rand(in.seqnum); // make some attrs big if (in.seqnum & 3) @@ -292,11 +292,11 @@ public: RandWrap rand(in.seqnum); return round_up(rand() % max_append_total, alignment); } - uint64_t get_length(const ContDesc &in) { + uint64_t get_length(const ContDesc &in) override { return off + get_append_size(in); } void get_ranges_map( - const ContDesc &cont, std::map &out); + const ContDesc &cont, std::map &out) override; }; class ObjectDesc { diff --git a/src/test/osd/RadosModel.h b/src/test/osd/RadosModel.h index 21eaaa046025..1cd0d83feeb6 100644 --- a/src/test/osd/RadosModel.h +++ b/src/test/osd/RadosModel.h @@ -78,12 +78,12 @@ public: lock("watch lock") {} void handle_notify(uint64_t notify_id, uint64_t cookie, uint64_t notifier_id, - bufferlist &bl) { + bufferlist &bl) override { Mutex::Locker l(lock); waiting = false; cond.SignalAll(); } - void handle_error(uint64_t cookie, int err) { + void handle_error(uint64_t cookie, int err) override { Mutex::Locker l(lock); cout << "watch handle_error " << err << std::endl; } @@ -536,7 +536,7 @@ public: : TestOp(n, context, stat), oid(oid), comp(NULL) {} - void _begin() + void _begin() override { ContDesc cont; set to_remove; @@ -597,7 +597,7 @@ public: context->io_ctx.aio_operate(context->prefix+oid, comp, &op); } - void _finish(CallbackInfo *info) + void _finish(CallbackInfo *info) override { Mutex::Locker l(context->state_lock); done = true; @@ -607,12 +607,12 @@ public: context->kick(); } - bool finished() + bool finished() override { return done; } - string getType() + string getType() override { return "RemoveAttrsOp"; } @@ -631,7 +631,7 @@ public: oid(oid), comp(NULL) {} - void _begin() + void _begin() override { ContDesc cont; { @@ -687,7 +687,7 @@ public: context->io_ctx.aio_operate(context->prefix+oid, comp, &op); } - void _finish(CallbackInfo *info) + void _finish(CallbackInfo *info) override { Mutex::Locker l(context->state_lock); int r; @@ -702,12 +702,12 @@ public: context->kick(); } - bool finished() + bool finished() override { return done; } - string getType() + string getType() override { return "SetAttrsOp"; } @@ -741,7 +741,7 @@ public: do_excl(do_excl) {} - void _begin() + void _begin() override { context->state_lock.Lock(); done = 0; @@ -855,7 +855,7 @@ public: context->state_lock.Unlock(); } - void _finish(CallbackInfo *info) + void _finish(CallbackInfo *info) override { assert(info); context->state_lock.Lock(); @@ -915,12 +915,12 @@ public: context->state_lock.Unlock(); } - bool finished() + bool finished() override { return done; } - string getType() + string getType() override { return "WriteOp"; } @@ -948,7 +948,7 @@ public: last_acked_tid(0) {} - void _begin() + void _begin() override { context->state_lock.Lock(); done = 0; @@ -1032,7 +1032,7 @@ public: context->state_lock.Unlock(); } - void _finish(CallbackInfo *info) + void _finish(CallbackInfo *info) override { assert(info); context->state_lock.Lock(); @@ -1092,12 +1092,12 @@ public: context->state_lock.Unlock(); } - bool finished() + bool finished() override { return done; } - string getType() + string getType() override { return "WriteSameOp"; } @@ -1114,7 +1114,7 @@ public: : TestOp(n, context, stat), oid(oid) {} - void _begin() + void _begin() override { context->state_lock.Lock(); if (context->get_watch_context(oid)) { @@ -1157,7 +1157,7 @@ public: context->state_lock.Unlock(); } - string getType() + string getType() override { return "DeleteOp"; } @@ -1228,7 +1228,7 @@ public: } } - void _begin() + void _begin() override { context->state_lock.Lock(); if (!(rand() % 4) && !context->snaps.empty()) { @@ -1317,7 +1317,7 @@ public: context->state_lock.Unlock(); } - void _finish(CallbackInfo *info) + void _finish(CallbackInfo *info) override { Mutex::Locker l(context->state_lock); assert(!done); @@ -1473,12 +1473,12 @@ public: done = true; } - bool finished() + bool finished() override { return done; } - string getType() + string getType() override { return "ReadOp"; } @@ -1492,7 +1492,7 @@ public: : TestOp(n, context, stat) {} - void _begin() + void _begin() override { uint64_t snap; string snapname; @@ -1539,11 +1539,11 @@ public: } } - string getType() + string getType() override { return "SnapCreateOp"; } - bool must_quiesce_other_ops() { return context->pool_snaps; } + bool must_quiesce_other_ops() override { return context->pool_snaps; } }; class SnapRemoveOp : public TestOp { @@ -1556,7 +1556,7 @@ public: to_remove(snap) {} - void _begin() + void _begin() override { context->state_lock.Lock(); uint64_t snap = context->snaps[to_remove]; @@ -1587,7 +1587,7 @@ public: context->state_lock.Unlock(); } - string getType() + string getType() override { return "SnapRemoveOp"; } @@ -1604,7 +1604,7 @@ public: oid(_oid) {} - void _begin() + void _begin() override { context->state_lock.Lock(); ObjectDesc contents; @@ -1649,7 +1649,7 @@ public: } } - string getType() + string getType() override { return "WatchOp"; } @@ -1677,7 +1677,7 @@ public: last_finished(-1), outstanding(3) {} - void _begin() + void _begin() override { context->state_lock.Lock(); if (context->get_watch_context(oid)) { @@ -1756,7 +1756,7 @@ public: } } - void _finish(CallbackInfo *info) + void _finish(CallbackInfo *info) override { Mutex::Locker l(context->state_lock); uint64_t tid = info->id; @@ -1780,12 +1780,12 @@ public: } } - bool finished() + bool finished() override { return done; } - string getType() + string getType() override { return "RollBackOp"; } @@ -1815,7 +1815,7 @@ public: version(0), r(0) {} - void _begin() + void _begin() override { ContDesc cont; { @@ -1861,7 +1861,7 @@ public: } - void _finish(CallbackInfo *info) + void _finish(CallbackInfo *info) override { Mutex::Locker l(context->state_lock); @@ -1910,12 +1910,12 @@ public: } } - bool finished() + bool finished() override { return done == 2; } - string getType() + string getType() override { return "CopyFromOp"; } @@ -1937,7 +1937,7 @@ public: hash(hash) {} - void _begin() + void _begin() override { pair *cb_arg = new pair(this, @@ -1948,7 +1948,7 @@ public: assert(r == 0); } - void _finish(CallbackInfo *info) { + void _finish(CallbackInfo *info) override { Mutex::Locker l(context->state_lock); if (!comp2) { if (ls.empty()) { @@ -1987,11 +1987,11 @@ public: context->kick(); } - bool finished() { + bool finished() override { return done; } - string getType() { + string getType() override { return "HitSetListOp"; } }; @@ -2011,7 +2011,7 @@ public: oid(oid) {} - void _begin() + void _begin() override { context->state_lock.Lock(); pair *cb_arg = @@ -2031,7 +2031,7 @@ public: assert(!r); } - void _finish(CallbackInfo *info) + void _finish(CallbackInfo *info) override { context->state_lock.Lock(); assert(!done); @@ -2044,12 +2044,12 @@ public: context->state_lock.Unlock(); } - bool finished() + bool finished() override { return done; } - string getType() + string getType() override { return "UndirtyOp"; } @@ -2075,7 +2075,7 @@ public: dirty(false) {} - void _begin() + void _begin() override { context->state_lock.Lock(); @@ -2112,7 +2112,7 @@ public: } } - void _finish(CallbackInfo *info) + void _finish(CallbackInfo *info) override { context->state_lock.Lock(); assert(!done); @@ -2137,12 +2137,12 @@ public: context->state_lock.Unlock(); } - bool finished() + bool finished() override { return done; } - string getType() + string getType() override { return "IsDirtyOp"; } @@ -2173,7 +2173,7 @@ public: can_fail(false) {} - void _begin() + void _begin() override { context->state_lock.Lock(); @@ -2224,7 +2224,7 @@ public: } } - void _finish(CallbackInfo *info) + void _finish(CallbackInfo *info) override { context->state_lock.Lock(); assert(!done); @@ -2251,12 +2251,12 @@ public: context->state_lock.Unlock(); } - bool finished() + bool finished() override { return done; } - string getType() + string getType() override { return "CacheFlushOp"; } @@ -2278,7 +2278,7 @@ public: oid(oid) {} - void _begin() + void _begin() override { context->state_lock.Lock(); @@ -2316,7 +2316,7 @@ public: } } - void _finish(CallbackInfo *info) + void _finish(CallbackInfo *info) override { context->state_lock.Lock(); assert(!done); @@ -2341,12 +2341,12 @@ public: context->state_lock.Unlock(); } - bool finished() + bool finished() override { return done; } - string getType() + string getType() override { return "CacheEvictOp"; } diff --git a/src/test/osdc/FakeWriteback.h b/src/test/osdc/FakeWriteback.h index 8ab665c8c407..d6d0235a4bf2 100644 --- a/src/test/osdc/FakeWriteback.h +++ b/src/test/osdc/FakeWriteback.h @@ -15,24 +15,24 @@ class Mutex; class FakeWriteback : public WritebackHandler { public: FakeWriteback(CephContext *cct, Mutex *lock, uint64_t delay_ns); - virtual ~FakeWriteback(); + ~FakeWriteback() override; - virtual void read(const object_t& oid, uint64_t object_no, + void read(const object_t& oid, uint64_t object_no, const object_locator_t& oloc, uint64_t off, uint64_t len, snapid_t snapid, bufferlist *pbl, uint64_t trunc_size, - __u32 trunc_seq, int op_flags, Context *onfinish); + __u32 trunc_seq, int op_flags, Context *onfinish) override; - virtual ceph_tid_t write(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t write(const object_t& oid, const object_locator_t& oloc, uint64_t off, uint64_t len, const SnapContext& snapc, const bufferlist &bl, ceph::real_time mtime, uint64_t trunc_size, __u32 trunc_seq, ceph_tid_t journal_tid, - Context *oncommit); + Context *oncommit) override; using WritebackHandler::write; - virtual bool may_copy_on_write(const object_t&, uint64_t, uint64_t, - snapid_t); + bool may_copy_on_write(const object_t&, uint64_t, uint64_t, + snapid_t) override; private: CephContext *m_cct; Mutex *m_lock; diff --git a/src/test/osdc/MemWriteback.h b/src/test/osdc/MemWriteback.h index d5a057f0a7f3..726f297d4cad 100644 --- a/src/test/osdc/MemWriteback.h +++ b/src/test/osdc/MemWriteback.h @@ -15,24 +15,24 @@ class Mutex; class MemWriteback : public WritebackHandler { public: MemWriteback(CephContext *cct, Mutex *lock, uint64_t delay_ns); - virtual ~MemWriteback(); + ~MemWriteback() override; - virtual void read(const object_t& oid, uint64_t object_no, + void read(const object_t& oid, uint64_t object_no, const object_locator_t& oloc, uint64_t off, uint64_t len, snapid_t snapid, bufferlist *pbl, uint64_t trunc_size, - __u32 trunc_seq, int op_flags, Context *onfinish); + __u32 trunc_seq, int op_flags, Context *onfinish) override; - virtual ceph_tid_t write(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t write(const object_t& oid, const object_locator_t& oloc, uint64_t off, uint64_t len, const SnapContext& snapc, const bufferlist &bl, ceph::real_time mtime, uint64_t trunc_size, __u32 trunc_seq, ceph_tid_t journal_tid, - Context *oncommit); + Context *oncommit) override; using WritebackHandler::write; - virtual bool may_copy_on_write(const object_t&, uint64_t, uint64_t, - snapid_t); + bool may_copy_on_write(const object_t&, uint64_t, uint64_t, + snapid_t) override; void write_object_data(const object_t& oid, uint64_t off, uint64_t len, const bufferlist& data_bl); int read_object_data(const object_t& oid, uint64_t off, uint64_t len, diff --git a/src/test/system/rados_list_parallel.cc b/src/test/system/rados_list_parallel.cc index cb1724767673..d6b3dfc055f3 100644 --- a/src/test/system/rados_list_parallel.cc +++ b/src/test/system/rados_list_parallel.cc @@ -52,7 +52,7 @@ public: { } - ~RadosDeleteObjectsR() + ~RadosDeleteObjectsR() override { } @@ -137,7 +137,7 @@ public: { } - ~RadosAddObjectsR() + ~RadosAddObjectsR() override { } diff --git a/src/test/system/rados_open_pools_parallel.cc b/src/test/system/rados_open_pools_parallel.cc index 12d2f44a53c8..0181e2b88257 100644 --- a/src/test/system/rados_open_pools_parallel.cc +++ b/src/test/system/rados_open_pools_parallel.cc @@ -59,7 +59,7 @@ public: { } - ~StRadosOpenPool() + ~StRadosOpenPool() override { } diff --git a/src/test/system/st_rados_create_pool.h b/src/test/system/st_rados_create_pool.h index 5554f3eec98c..ee65b22c62cc 100644 --- a/src/test/system/st_rados_create_pool.h +++ b/src/test/system/st_rados_create_pool.h @@ -37,8 +37,8 @@ public: const std::string &pool_name, int num_objects, const std::string &suffix); - ~StRadosCreatePool(); - virtual int run(); + ~StRadosCreatePool() override; + int run() override; private: CrossProcessSem *m_setup_sem; CrossProcessSem *m_pool_setup_sem; diff --git a/src/test/system/st_rados_delete_objs.h b/src/test/system/st_rados_delete_objs.h index 718f88a60dc4..40771ee457ca 100644 --- a/src/test/system/st_rados_delete_objs.h +++ b/src/test/system/st_rados_delete_objs.h @@ -35,8 +35,8 @@ public: int num_objs, const std::string &pool_name, const std::string &suffix); - ~StRadosDeleteObjs(); - virtual int run(); + ~StRadosDeleteObjs() override; + int run() override; private: CrossProcessSem *m_setup_sem; CrossProcessSem *m_deleted_sem; diff --git a/src/test/system/st_rados_delete_pool.h b/src/test/system/st_rados_delete_pool.h index 5aeb9513137b..cc48af9b9b3c 100644 --- a/src/test/system/st_rados_delete_pool.h +++ b/src/test/system/st_rados_delete_pool.h @@ -32,8 +32,8 @@ public: CrossProcessSem *pool_setup_sem, CrossProcessSem *delete_pool_sem, const std::string &pool_name); - ~StRadosDeletePool(); - virtual int run(); + ~StRadosDeletePool() override; + int run() override; private: CrossProcessSem *m_pool_setup_sem; CrossProcessSem *m_delete_pool_sem; diff --git a/src/test/system/st_rados_list_objects.h b/src/test/system/st_rados_list_objects.h index ddb1342e8b67..b26d51844bbc 100644 --- a/src/test/system/st_rados_list_objects.h +++ b/src/test/system/st_rados_list_objects.h @@ -39,8 +39,8 @@ public: CrossProcessSem *pool_setup_sem, CrossProcessSem *midway_sem_wait, CrossProcessSem *midway_sem_post); - ~StRadosListObjects(); - virtual int run(); + ~StRadosListObjects() override; + int run() override; private: std::string m_pool_name; bool m_accept_list_errors; diff --git a/src/test/system/st_rados_notify.h b/src/test/system/st_rados_notify.h index 7c65efb6e7ac..1d61b4d121b3 100644 --- a/src/test/system/st_rados_notify.h +++ b/src/test/system/st_rados_notify.h @@ -38,8 +38,8 @@ public: int notify_retcode, const std::string &pool_name, const std::string &obj_name); - ~StRadosNotify(); - virtual int run(); + ~StRadosNotify() override; + int run() override; private: CrossProcessSem *m_setup_sem; CrossProcessSem *m_notify_sem; diff --git a/src/test/system/st_rados_watch.h b/src/test/system/st_rados_watch.h index e3e78c0cc0e1..366be3f87e0b 100644 --- a/src/test/system/st_rados_watch.h +++ b/src/test/system/st_rados_watch.h @@ -41,8 +41,8 @@ public: int watch_retcode, const std::string &pool_name, const std::string &obj_name); - ~StRadosWatch(); - virtual int run(); + ~StRadosWatch() override; + int run() override; private: CrossProcessSem *m_setup_sem; CrossProcessSem *m_watch_sem; diff --git a/src/test/test_snap_mapper.cc b/src/test/test_snap_mapper.cc index cc39bc19aeef..20d2a629b964 100644 --- a/src/test/test_snap_mapper.cc +++ b/src/test/test_snap_mapper.cc @@ -167,7 +167,7 @@ public: PausyAsyncMap() : lock("PausyAsyncMap"), doer(this) { doer.create("doer"); } - ~PausyAsyncMap() { + ~PausyAsyncMap() override { doer.join(); } int get_keys( -- 2.47.3