Extend storage array to contain additional data
This array was originally just an array of objects of
type 'any'. This commit changes it to be an array of
tuples of type <any, any> to add an extra field for
use by anything that needs it.
For example, the storage is currently used to store
property values, and a future change to the CountCondition
class will now also store the result of the comparisons done
between the property values and another value specified in
the rule YAML. Then, a callback will be able to see the
result of whether each property passed the check.
Tested: Build and run unit tests
Change-Id: I58f32c9f4068b15a02b1ff7f28871161cafebddb
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/src/test/propertywatchtest.cpp b/src/test/propertywatchtest.cpp
index b92dbec..c97e8d3 100644
--- a/src/test/propertywatchtest.cpp
+++ b/src/test/propertywatchtest.cpp
@@ -27,7 +27,7 @@
const std::string meta;
-std::array<any_ns::any, 8> storage = { };
+std::array<std::tuple<any_ns::any, any_ns::any>, 8> storage = { };
const PropertyIndex watchIndex =
{
@@ -204,7 +204,7 @@
ndx = 0;
for (auto s : storage)
{
- ASSERT_EQ(s.empty(), false);
+ ASSERT_EQ(std::get<0>(s).empty(), false);
ASSERT_EQ(any_ns::any_cast<T>(s), ExpectedValues<T>::get(ndx));
++ndx;
}