[esp_event]: fixed and improved docs

* Description of unregistering was incorrect
* Made clear that event loop arg mustn't be NULL
* Added parameter check in create function

Closes https://github.com/espressif/esp-idf/issues/6761
Closes IDFGH-4969
This commit is contained in:
Jakob Hasse
2021-07-06 17:19:20 +08:00
committed by bot
parent 9805fc85ee
commit dfa2a980d7
3 changed files with 43 additions and 25 deletions

View File

@@ -306,6 +306,14 @@ static void test_teardown(void)
#define TIMER_SCALE (TIMER_BASE_CLK / TIMER_DIVIDER) // convert counter value to seconds
#define TIMER_INTERVAL0_SEC (2.0) // sample test interval for the first timer
TEST_CASE("create and event loop with any NULL argument fails", "[event]")
{
esp_event_loop_handle_t loop; // with dedicated task
esp_event_loop_args_t loop_args = test_event_get_default_loop_args();
TEST_ASSERT_EQUAL(ESP_ERR_INVALID_ARG, esp_event_loop_create(NULL, &loop));
TEST_ASSERT_EQUAL(ESP_ERR_INVALID_ARG, esp_event_loop_create(&loop_args, NULL));
}
TEST_CASE("can create and delete event loops", "[event]")
{
/* this test aims to verify that: