Verify reading parameters on update
Adds verification of ReadingParameter's metric count when property is
being updated. This brings consistency with behavior upon adding a new
report, where that same check is being made. Also adds a unit test for
that check.
Tested:
On platform, by updating report's ReadingParameter with object
containing metric count exceeding one specified by
`max-reading-parameters` project option. With this change applied, that
operation failed, as expected.
Change-Id: I06c8e21178d6bd554b62886e0e4f8cd0589f0d09
Signed-off-by: Michal Orzel <michalx.orzel@intel.com>
diff --git a/src/report_manager.hpp b/src/report_manager.hpp
index dcd2bfc..710d3ce 100644
--- a/src/report_manager.hpp
+++ b/src/report_manager.hpp
@@ -33,6 +33,9 @@
void removeReport(const interfaces::Report* report) override;
+ static void verifyMetricParams(
+ const std::vector<LabeledMetricParameters>& metricParams);
+
private:
std::unique_ptr<interfaces::ReportFactory> reportFactory;
std::unique_ptr<interfaces::JsonStorage> reportStorage;