Add and execute unit tests for run limit feature

This commit is contained in:
2025-08-22 12:42:53 +03:00
parent 29803c063e
commit fb4f34e895
6 changed files with 232 additions and 9 deletions

View File

@@ -84,6 +84,23 @@ TEST_CASE("Test relay_chn_nvs_erase_all", "[relay_chn][nvs]")
TEST_ESP_OK(relay_chn_nvs_deinit());
}
#ifdef CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT
TEST_CASE("Test run limit setting and getting", "[relay_chn][nvs][run_limit]")
{
TEST_ESP_OK(relay_chn_nvs_init());
const uint16_t run_limit_sec = 32;
for (uint8_t i = 0; i < CONFIG_RELAY_CHN_COUNT; i++) {
TEST_ESP_OK(relay_chn_nvs_set_run_limit(i, run_limit_sec));
uint16_t run_limit_read;
TEST_ESP_OK(relay_chn_nvs_get_run_limit(i, &run_limit_read));
TEST_ASSERT_EQUAL(run_limit_sec, run_limit_read);
}
TEST_ESP_OK(relay_chn_nvs_deinit());
}
#endif
#ifdef RELAY_CHN_ENABLE_TILTING
TEST_CASE("Test sensitivity setting and getting", "[relay_chn][nvs][tilt]")
{