added support for onChange report
Report is now notified when metric changes and updates reading values.
Tested:
- Added new unit tests
- OnChange report updates Readings when metric values changes
Change-Id: I3be9ef7aa0486cb15bac627aa1de5cc632613b3b
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
diff --git a/tests/src/params/metric_params.hpp b/tests/src/params/metric_params.hpp
index 90db484..cc5519d 100644
--- a/tests/src/params/metric_params.hpp
+++ b/tests/src/params/metric_params.hpp
@@ -79,6 +79,17 @@
return expectedReadingProperty;
}
+ bool expectedIsTimerRequired() const
+ {
+ return expectedIsTimerRequiredProperty;
+ }
+
+ MetricParams& expectedIsTimerRequired(bool value)
+ {
+ expectedIsTimerRequiredProperty = value;
+ return *this;
+ }
+
private:
OperationType operationTypeProperty = {};
std::string idProperty = "MetricId";
@@ -87,6 +98,7 @@
CollectionDuration(Milliseconds(0u));
std::vector<std::pair<Milliseconds, double>> readingsProperty = {};
std::pair<Milliseconds, double> expectedReadingProperty = {};
+ bool expectedIsTimerRequiredProperty = true;
};
inline std::ostream& operator<<(std::ostream& os, const MetricParams& mp)
@@ -103,6 +115,8 @@
}
auto [timestamp, reading] = mp.expectedReading();
- os << " }, expected: " << reading << "(" << timestamp.count() << "ms) }";
+ os << " }, expectedReading: " << reading << "(" << timestamp.count()
+ << "ms), expectedIsTimerRequired: " << std::boolalpha
+ << mp.expectedIsTimerRequired() << " }";
return os;
}