Add and execute unit tests for run limit feature
This commit is contained in:
@@ -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]")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user