diff options
Diffstat (limited to 'storage/src/tests/storageserver')
-rw-r--r-- | storage/src/tests/storageserver/statereportertest.cpp | 12 | ||||
-rw-r--r-- | storage/src/tests/storageserver/testvisitormessagesession.h | 5 |
2 files changed, 7 insertions, 10 deletions
diff --git a/storage/src/tests/storageserver/statereportertest.cpp b/storage/src/tests/storageserver/statereportertest.cpp index 47d70cf436e..01cf12f7947 100644 --- a/storage/src/tests/storageserver/statereportertest.cpp +++ b/storage/src/tests/storageserver/statereportertest.cpp @@ -25,8 +25,8 @@ namespace storage { class DummyApplicationGenerationFether : public ApplicationGenerationFetcher { public: - int64_t getGeneration() const override { return 1; } - std::string getComponentName() const override { return "component"; } + [[nodiscard]] int64_t getGeneration() const override { return 1; } + [[nodiscard]] std::string getComponentName() const override { return "component"; } }; struct StateReporterTest : Test { @@ -54,8 +54,8 @@ struct MetricClock : public metrics::MetricManager::Timer { framework::Clock& _clock; explicit MetricClock(framework::Clock& c) : _clock(c) {} - time_t getTime() const override { return _clock.getTimeInSeconds().getTime(); } - time_t getTimeInMilliSecs() const override { return _clock.getTimeInMillis().getTime(); } + [[nodiscard]] time_t getTime() const override { return vespalib::count_s(_clock.getMonotonicTime().time_since_epoch()); } + [[nodiscard]] time_t getTimeInMilliSecs() const override { return vespalib::count_ms(_clock.getMonotonicTime().time_since_epoch()); } }; } @@ -245,8 +245,8 @@ TEST_F(StateReporterTest, report_metrics) { "/state/v1/metrics?consumer=status" }; - for (int i = 0; i < pathCount; i++) { - framework::HttpUrlPath path(paths[i]); + for (auto & path_str : paths) { + framework::HttpUrlPath path(path_str); std::ostringstream ost; _stateReporter->reportStatus(ost, path); std::string jsonData = ost.str(); diff --git a/storage/src/tests/storageserver/testvisitormessagesession.h b/storage/src/tests/storageserver/testvisitormessagesession.h index c0c3b8429b2..4479b194396 100644 --- a/storage/src/tests/storageserver/testvisitormessagesession.h +++ b/storage/src/tests/storageserver/testvisitormessagesession.h @@ -32,10 +32,7 @@ public: std::deque<std::unique_ptr<documentapi::DocumentMessage> > sentMessages; - TestVisitorMessageSession(VisitorThread& t, - Visitor& v, - const mbus::Error& autoReplyError, - bool autoReply); + TestVisitorMessageSession(VisitorThread& t, Visitor& v, const mbus::Error& autoReplyError, bool autoReply); void reply(mbus::Reply::UP rep); uint32_t pending() override { return pendingCount; } |