diff options
author | Arne H Juul <arnej27959@users.noreply.github.com> | 2017-04-24 12:10:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-24 12:10:42 +0200 |
commit | 9ff4bdb407ed8d855a3f86a17c99906ff738177b (patch) | |
tree | fc2b050224d7dde92d57e1f9cac12c1e5aaf6b90 /storageframework | |
parent | 32ae190acc9ac5081049e1c7008d1602c68cf821 (diff) |
Revert "Balder/enforce override 2"
Diffstat (limited to 'storageframework')
6 files changed, 23 insertions, 11 deletions
diff --git a/storageframework/src/tests/clock/timetest.cpp b/storageframework/src/tests/clock/timetest.cpp index d0367449fe1..ae07559e095 100644 --- a/storageframework/src/tests/clock/timetest.cpp +++ b/storageframework/src/tests/clock/timetest.cpp @@ -10,6 +10,9 @@ namespace defaultimplementation { struct TimeTest : public CppUnit::TestFixture { + void setUp() override {} + void tearDown() override {} + void testBasics(); void testCreatedFromClock(); void canAssignMicrosecondResolutionTimeToFakeClock(); diff --git a/storageframework/src/tests/memory/memorymanagertest.cpp b/storageframework/src/tests/memory/memorymanagertest.cpp index 8b1868a6bd4..885ae86e832 100644 --- a/storageframework/src/tests/memory/memorymanagertest.cpp +++ b/storageframework/src/tests/memory/memorymanagertest.cpp @@ -155,7 +155,8 @@ MemoryManagerTest::testBasics() struct ReduceI : public framework::ReduceMemoryUsageInterface { framework::MemoryToken::UP _token; - uint64_t reduceMemoryConsumption(const MemoryToken& token, uint64_t reduceBy) override { + virtual uint64_t reduceMemoryConsumption(const MemoryToken& token, uint64_t reduceBy) override + { assert(&token == _token.get()); (void) &token; assert(_token->getSize() >= reduceBy); diff --git a/storageframework/src/tests/memory/memorystatetest.cpp b/storageframework/src/tests/memory/memorystatetest.cpp index 5a047a5c790..40d102199d6 100644 --- a/storageframework/src/tests/memory/memorystatetest.cpp +++ b/storageframework/src/tests/memory/memorystatetest.cpp @@ -2,6 +2,7 @@ #include <vespa/storageframework/defaultimplementation/clock/realclock.h> #include <vespa/storageframework/defaultimplementation/memory/memorystate.h> +#include <vespa/storageframework/generic/memory/memorymanagerinterface.h> #include <vespa/vdstestlib/cppunit/macros.h> #include <vespa/vespalib/util/exceptions.h> @@ -11,6 +12,8 @@ namespace defaultimplementation { struct MemoryStateTest : public CppUnit::TestFixture { + void setUp() override {} + void tearDown() override {} void testBasics(); @@ -27,15 +30,15 @@ private: std::map<std::string, framework::MemoryAllocationType> _types; public: - void setMaximumMemoryUsage(uint64_t max) override { (void) max; } + virtual void setMaximumMemoryUsage(uint64_t max) override { (void) max; } - const framework::MemoryAllocationType& + virtual const framework::MemoryAllocationType& registerAllocationType(const framework::MemoryAllocationType& type) override { _types[type.getName()] = type; return _types[type.getName()]; } - const framework::MemoryAllocationType& + virtual const framework::MemoryAllocationType& getAllocationType(const std::string& name) const override { std::map<std::string, framework::MemoryAllocationType>::const_iterator iter = _types.find(name); @@ -47,7 +50,8 @@ public: return iter->second; } - std::vector<const MemoryAllocationType*> getAllocationTypes() const override { + virtual std::vector<const MemoryAllocationType*> getAllocationTypes() const override + { std::vector<const MemoryAllocationType*> types; for(std::map<std::string, framework::MemoryAllocationType> ::const_iterator it = _types.begin(); it != _types.end(); ++it) diff --git a/storageframework/src/tests/testrunner.cpp b/storageframework/src/tests/testrunner.cpp index 5baa0f60b6e..0d40a0429d9 100644 --- a/storageframework/src/tests/testrunner.cpp +++ b/storageframework/src/tests/testrunner.cpp @@ -6,7 +6,7 @@ LOG_SETUP("persistencecppunittests"); int -main(int argc, const char *argv[]) +main(int argc, char **argv) { vdstestlib::CppUnitTestRunner testRunner; return testRunner.run(argc, argv); diff --git a/storageframework/src/tests/thread/taskthreadtest.cpp b/storageframework/src/tests/thread/taskthreadtest.cpp index a6698be3676..bca5c81ef01 100644 --- a/storageframework/src/tests/thread/taskthreadtest.cpp +++ b/storageframework/src/tests/thread/taskthreadtest.cpp @@ -34,7 +34,7 @@ namespace { struct MyThread : public TaskThread<Task> { MyThread(ThreadLock& lock) : TaskThread<Task>(lock) {} - ThreadWaitInfo doNonCriticalTick(ThreadIndex) override { + virtual ThreadWaitInfo doNonCriticalTick(ThreadIndex) override { return ThreadWaitInfo::NO_MORE_CRITICAL_WORK_KNOWN; } }; diff --git a/storageframework/src/tests/thread/tickingthreadtest.cpp b/storageframework/src/tests/thread/tickingthreadtest.cpp index c9d54fe557a..c65b809e5da 100644 --- a/storageframework/src/tests/thread/tickingthreadtest.cpp +++ b/storageframework/src/tests/thread/tickingthreadtest.cpp @@ -13,6 +13,9 @@ namespace defaultimplementation { struct TickingThreadTest : public CppUnit::TestFixture { + void setUp() override {} + void tearDown() override {} + void testTicksBeforeWaitBasic(); void testTicksBeforeWaitLiveUpdate(); void testDestroyWithoutStarting(); @@ -59,7 +62,7 @@ struct MyApp : public TickingThread { void start(ThreadPool& p) { _threadPool->start(p); } - ThreadWaitInfo doCriticalTick(ThreadIndex index) override { + virtual ThreadWaitInfo doCriticalTick(ThreadIndex index) override { assert(index < _context.size()); Context& c(_context[index]); if (_doCritOverlapTest) { @@ -71,12 +74,13 @@ struct MyApp : public TickingThread { ++c._critTickCount; return ThreadWaitInfo::NO_MORE_CRITICAL_WORK_KNOWN; } - ThreadWaitInfo doNonCriticalTick(ThreadIndex index) override { + virtual ThreadWaitInfo doNonCriticalTick(ThreadIndex index) override { assert(index < _context.size()); Context& c(_context[index]); ++c._nonCritTickCount; return ThreadWaitInfo::NO_MORE_CRITICAL_WORK_KNOWN; } + uint64_t getMinCritTick() { uint64_t min = std::numeric_limits<uint64_t>().max(); for (uint32_t i=0; i<_context.size(); ++i) { @@ -310,7 +314,7 @@ struct BroadcastApp : public TickingThread { void start(ThreadPool& p) { _threadPool->start(p); } - ThreadWaitInfo doCriticalTick(ThreadIndex) override { + virtual ThreadWaitInfo doCriticalTick(ThreadIndex) override { if (!_queue.empty()) { for (uint32_t i=0; i<_queue.size(); ++i) { printTaskInfo(_queue[i], "activating"); @@ -321,7 +325,7 @@ struct BroadcastApp : public TickingThread { } return ThreadWaitInfo::NO_MORE_CRITICAL_WORK_KNOWN; } - ThreadWaitInfo doNonCriticalTick(ThreadIndex) override { + virtual ThreadWaitInfo doNonCriticalTick(ThreadIndex) override { if (!_active.empty()) { for (uint32_t i=0; i<_active.size(); ++i) { printTaskInfo(_queue[i], "processing"); |