Added Periodic reportingType support to Report
When report interval expires report will collect readings from
metrics and update timestamp.
Tested:
- Added new units tests covering added code
- All existing unit tests are passing
Change-Id: I7f23ca05d77efb0f18d2c0d0f138c524ffb4f6af
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
diff --git a/tests/src/mocks/metric_mock.hpp b/tests/src/mocks/metric_mock.hpp
new file mode 100644
index 0000000..6150455
--- /dev/null
+++ b/tests/src/mocks/metric_mock.hpp
@@ -0,0 +1,20 @@
+#pragma once
+
+#include "interfaces/metric.hpp"
+
+#include <gmock/gmock.h>
+
+class MetricMock : public interfaces::Metric
+{
+ public:
+ MetricMock()
+ {
+ using namespace testing;
+
+ ON_CALL(*this, getReadings())
+ .WillByDefault(ReturnRefOfCopy(std::vector<MetricValue>()));
+ }
+
+ MOCK_METHOD(const std::vector<MetricValue>&, getReadings, (),
+ (const, override));
+};