14#ifndef ZPC_ATTRIBUTE_STORE_TEST_HELPER_CPP_HPP
15#define ZPC_ATTRIBUTE_STORE_TEST_HELPER_CPP_HPP
18#include "attribute.hpp"
66 attribute_store::attribute parent
92attribute_store::attribute
94 attribute_store::attribute parent
104 attribute_store::attribute parent
113 attribute_store::attribute parent
123 attribute_store_type_t node_type,
126 attribute_store_node_value_state_t
state = REPORTED_ATTRIBUTE)
131 const std::string error_message
132 = (std::string(
"Value mismatch for ") + current_node.name_and_id())
135 if constexpr (std::is_same<T, std::vector<uint8_t>>::value) {
136 TEST_ASSERT_EQUAL_UINT8_ARRAY_MESSAGE(
137 expected_value.data(),
138 current_node.reported<std::vector<uint8_t>>().data(),
139 expected_value.size(),
140 error_message.c_str());
141 }
else if constexpr (std::is_same<T, std::string>::value) {
142 TEST_ASSERT_EQUAL_STRING_MESSAGE(
143 expected_value.c_str(),
144 current_node.reported<std::string>().c_str(),
145 error_message.c_str());
147 TEST_ASSERT_EQUAL_MESSAGE(expected_value,
148 current_node.get<T>(
state),
149 error_message.c_str());
151 }
catch (std::exception &e) {
152 TEST_FAIL_MESSAGE(e.what());
uint8_t zwave_cc_version_t
‍Version of a Z-Wave Command Class
Definition: zwave_command_class_version_types.h:26
uint16_t zwave_command_class_t
Definition: zwave_generic_types.h:29
Helper namespace for the ZPC attribute store tests.
Definition: zpc_attribute_store_test_helper_cpp.hpp:36
attribute_store::attribute helper_test_and_get_node(attribute_store_type_t node_type, attribute_store::attribute parent=cpp_endpoint_id_node)
Get a node and check that it exists.
zwave_cc_version_t helper_get_command_class_version(zwave_command_class_t command_class_id)
Get version for current class.
attribute_store::attribute helper_test_attribute_value(attribute_store_type_t node_type, T expected_value, attribute_store::attribute parent=cpp_endpoint_id_node, attribute_store_node_value_state_t state=REPORTED_ATTRIBUTE)
Definition: zpc_attribute_store_test_helper_cpp.hpp:122
void helper_test_node_exists(attribute_store_type_t node_type, attribute_store::attribute parent=cpp_endpoint_id_node)
Test that a node exists.
void zpc_attribute_store_test_helper_init()
Initialize the test helper.
attribute_store::attribute cpp_endpoint_id_node
void helper_test_node_does_not_exists(attribute_store_type_t node_type, attribute_store::attribute parent=cpp_endpoint_id_node)
Test that a node doesn't exists.
void helper_set_command_class_version(zwave_command_class_t command_class_id, const zwave_cc_version_t &version, attribute_store::attribute parent=cpp_endpoint_id_node)
Set version for current class.
Test helper for using the zpc attribute store.
static send_data_state_t state
Definition: zwave_crc16_transport.c:52