diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-04-05 02:32:06 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-04-23 02:03:47 +0200 |
commit | b57308e4a134fb6139d2cb52a031d3e7185f16cf (patch) | |
tree | 7c31d445e2f76bb737ef90ce29e0e7e6738d6eb1 /metrics | |
parent | 40b8ba5a3f34028d208d4e0dc1b46940d6fe5a47 (diff) |
Use override
Diffstat (limited to 'metrics')
-rw-r--r-- | metrics/src/tests/metricmanagertest.cpp | 14 | ||||
-rw-r--r-- | metrics/src/tests/metricsettest.cpp | 6 | ||||
-rw-r--r-- | metrics/src/tests/snapshottest.cpp | 9 | ||||
-rw-r--r-- | metrics/src/tests/stresstest.cpp | 4 | ||||
-rw-r--r-- | metrics/src/tests/testrunner.cpp | 6 |
5 files changed, 15 insertions, 24 deletions
diff --git a/metrics/src/tests/metricmanagertest.cpp b/metrics/src/tests/metricmanagertest.cpp index 362cad83a66..0ba6bdfbd2f 100644 --- a/metrics/src/tests/metricmanagertest.cpp +++ b/metrics/src/tests/metricmanagertest.cpp @@ -9,8 +9,6 @@ #include <vespa/vdstestlib/cppunit/macros.h> #include <vespa/vespalib/stllike/asciistream.h> #include <vespa/vespalib/data/slime/slime.h> -#include <fstream> -#include <sstream> #include <vespa/log/log.h> LOG_SETUP(".test.metricmanager"); @@ -143,22 +141,20 @@ struct MetricNameVisitor : public MetricVisitor { MetricNameVisitor(bool debug_ = false) : debug(debug_) {} - virtual bool visitMetricSet(const MetricSet& metricSet, - bool autoGenerated) override - { + bool visitMetricSet(const MetricSet& metricSet, bool autoGenerated) override { if (debug) { ost << "<" << (autoGenerated ? "*" : "") << metricSet.getPath() << ">\n"; } return true; } - virtual void doneVisitingMetricSet(const MetricSet& metricSet) override { + void doneVisitingMetricSet(const MetricSet& metricSet) override { if (debug) { ost << "</" << metricSet.getPath() << ">\n"; } } - virtual bool visitMetric(const Metric& m, bool autoGenerated) override { + bool visitMetric(const Metric& m, bool autoGenerated) override { ost << (autoGenerated ? "*" : "") << m.getPath() << "\n"; return true; } @@ -390,7 +386,7 @@ namespace { struct FakeTimer : public MetricManager::Timer { time_t _time; FakeTimer(time_t startTime = 0) : _time(startTime) {} - virtual time_t getTime() const override { return _time; } + time_t getTime() const override { return _time; } }; struct BriefValuePrinter : public MetricVisitor { @@ -399,7 +395,7 @@ namespace { BriefValuePrinter() : count(0), ost() {} - virtual bool visitMetric(const Metric& metric, bool) override { + bool visitMetric(const Metric& metric, bool) override { if (++count > 1) ost << ","; //ost << metric.getPath() << ":"; ost << metric.getDoubleValue("value"); diff --git a/metrics/src/tests/metricsettest.cpp b/metrics/src/tests/metricsettest.cpp index 176572acbd4..2b45bd049e0 100644 --- a/metrics/src/tests/metricsettest.cpp +++ b/metrics/src/tests/metricsettest.cpp @@ -1,5 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> + #include <vespa/vdstestlib/cppunit/macros.h> #include <vespa/vespalib/objects/floatingpointtype.h> #include <vespa/metrics/metrics.h> @@ -28,7 +28,7 @@ namespace { TestMetricVisitor(uint32_t setsToVisit_ = 100) : ost(), setsToVisit(setsToVisit_) {} - virtual bool visitMetricSet(const MetricSet& set, bool autoGenerated) override { + bool visitMetricSet(const MetricSet& set, bool autoGenerated) override { ost << "[" << (autoGenerated ? "*" : "") << set.getName() << "]\n"; if (setsToVisit > 0) { --setsToVisit; @@ -36,7 +36,7 @@ namespace { } return false; } - virtual bool visitMetric(const Metric& m, bool autoGenerated) override { + bool visitMetric(const Metric& m, bool autoGenerated) override { ost << (autoGenerated ? "*" : "") << m.getName() << "\n"; return true; } diff --git a/metrics/src/tests/snapshottest.cpp b/metrics/src/tests/snapshottest.cpp index bee3e910fb3..5c13a0f82b6 100644 --- a/metrics/src/tests/snapshottest.cpp +++ b/metrics/src/tests/snapshottest.cpp @@ -1,6 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> #include <vespa/metrics/metrics.h> #include <vespa/metrics/loadmetric.hpp> #include <vespa/metrics/summetric.hpp> @@ -40,8 +39,8 @@ struct SubSubMetricSet : public MetricSet { SubSubMetricSet(vespalib::stringref name, const LoadTypeSet& loadTypes_, MetricSet* owner = 0); ~SubSubMetricSet(); - virtual MetricSet* clone(std::vector<Metric::UP> &ownerList, CopyType copyType, - metrics::MetricSet* owner, bool includeUnused) const override; + MetricSet* clone(std::vector<Metric::UP> &ownerList, CopyType copyType, + metrics::MetricSet* owner, bool includeUnused) const override; void incValues(); }; @@ -191,10 +190,8 @@ TestMetricSet::incValues() { struct FakeTimer : public MetricManager::Timer { uint32_t _timeInSecs; - FakeTimer() : _timeInSecs(1) {} - - virtual time_t getTime() const override { return _timeInSecs; } + time_t getTime() const override { return _timeInSecs; } }; } // End of anonymous namespace diff --git a/metrics/src/tests/stresstest.cpp b/metrics/src/tests/stresstest.cpp index 5a2a736e9ba..70194ecd861 100644 --- a/metrics/src/tests/stresstest.cpp +++ b/metrics/src/tests/stresstest.cpp @@ -1,5 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> + #include <vespa/metrics/metrics.h> #include <vespa/metrics/loadmetric.hpp> #include <vespa/metrics/summetric.hpp> @@ -108,7 +108,7 @@ OuterMetricSet::~OuterMetricSet() { } //std::cerr << "Loadgiver thread joined\n"; } - virtual void run() override { + void run() override { uint64_t i = 0; while (running()) { ++i; diff --git a/metrics/src/tests/testrunner.cpp b/metrics/src/tests/testrunner.cpp index 5d8dc8d4c1f..9bf86e3276a 100644 --- a/metrics/src/tests/testrunner.cpp +++ b/metrics/src/tests/testrunner.cpp @@ -1,14 +1,12 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <iostream> -#include <vespa/log/log.h> #include <vespa/vdstestlib/cppunit/cppunittestrunner.h> +#include <vespa/log/log.h> LOG_SETUP("storagecppunittests"); int -main(int argc, char **argv) +main(int argc, const char *argv[]) { vdstestlib::CppUnitTestRunner testRunner; return testRunner.run(argc, argv); |