|
29 | 29 | #include "zwave_command_handler_mock.h" |
30 | 30 | #include "zwave_tx_mock.h" |
31 | 31 | #include "zwave_tx_scheme_selector_mock.h" |
32 | | -#include "zwave_utils.h" |
| 32 | +#include "zwave_utils_mock.h" |
| 33 | +#include "zwapi_protocol_controller_mock.h" |
33 | 34 | #include "zwave_unid_mock.h" |
34 | 35 | #include "zwave_command_class_supervision_mock.h" |
35 | 36 | #include "zpc_attribute_store_network_helper_mock.h" |
@@ -329,6 +330,27 @@ void test_handle_cc_versions_log() |
329 | 330 | uic_stdin_handle_command("zwave_cc_versions_log")); |
330 | 331 | } |
331 | 332 |
|
| 333 | +void test_handle_nls() |
| 334 | +{ |
| 335 | + sl_status_t state; |
| 336 | + uint8_t nls_state = false; |
| 337 | + |
| 338 | + state = uic_stdin_handle_command("zwave_enable_nls"); |
| 339 | + TEST_ASSERT_EQUAL(SL_STATUS_FAIL, state); |
| 340 | + |
| 341 | + zwave_store_nls_state_ExpectAndReturn(2, true, DESIRED_ATTRIBUTE, SL_STATUS_OK); |
| 342 | + state = uic_stdin_handle_command("zwave_enable_nls 2"); |
| 343 | + TEST_ASSERT_EQUAL(SL_STATUS_OK, state); |
| 344 | + |
| 345 | + state = uic_stdin_handle_command("zwave_get_nls_state"); |
| 346 | + TEST_ASSERT_EQUAL(SL_STATUS_FAIL, state); |
| 347 | + |
| 348 | + zwapi_get_node_nls_ExpectAndReturn(2, &nls_state, SL_STATUS_OK); |
| 349 | + zwave_store_nls_state_ExpectAndReturn(2, nls_state, REPORTED_ATTRIBUTE, SL_STATUS_OK); |
| 350 | + state = uic_stdin_handle_command("zwave_get_nls_state 2"); |
| 351 | + TEST_ASSERT_EQUAL(SL_STATUS_OK, state); |
| 352 | +} |
| 353 | + |
332 | 354 | void test_handle_zwave_s2_log_security_keys() |
333 | 355 | { |
334 | 356 | zwave_s2_log_security_keys_Expect(1); |
|
0 commit comments