Merge branch 'refactor/esp_event_astyle_format' into 'master'

change(esp_event): formatted files with astyle

See merge request espressif/esp-idf!28801
This commit is contained in:
Jakob Hasse
2024-02-01 11:20:05 +08:00
9 changed files with 611 additions and 612 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2018-2022 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@@ -76,7 +76,6 @@ esp_err_t esp_event_post(esp_event_base_t event_base, int32_t event_id,
event_data, event_data_size, ticks_to_wait); event_data, event_data_size, ticks_to_wait);
} }
#if CONFIG_ESP_EVENT_POST_FROM_ISR #if CONFIG_ESP_EVENT_POST_FROM_ISR
esp_err_t esp_event_isr_post(esp_event_base_t event_base, int32_t event_id, esp_err_t esp_event_isr_post(esp_event_base_t event_base, int32_t event_id,
const void* event_data, size_t event_data_size, BaseType_t* task_unblocked) const void* event_data, size_t event_data_size, BaseType_t* task_unblocked)
@@ -90,7 +89,6 @@ esp_err_t esp_event_isr_post(esp_event_base_t event_base, int32_t event_id,
} }
#endif #endif
esp_err_t esp_event_loop_create_default(void) esp_err_t esp_event_loop_create_default(void)
{ {
if (s_default_loop) { if (s_default_loop) {

View File

@@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2018-2023 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@@ -46,12 +46,10 @@ static SLIST_HEAD(esp_event_loop_instance_list_t, esp_event_loop_instance) s_eve
static portMUX_TYPE s_event_loops_spinlock = portMUX_INITIALIZER_UNLOCKED; static portMUX_TYPE s_event_loops_spinlock = portMUX_INITIALIZER_UNLOCKED;
#endif #endif
/* ------------------------- Static Functions ------------------------------- */ /* ------------------------- Static Functions ------------------------------- */
#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING #ifdef CONFIG_ESP_EVENT_LOOP_PROFILING
static int esp_event_dump_prepare(void) static int esp_event_dump_prepare(void)
{ {
esp_event_loop_instance_t* loop_it; esp_event_loop_instance_t* loop_it;
@@ -166,7 +164,9 @@ static esp_err_t handler_instances_add(esp_event_handler_nodes_t* handlers, esp_
{ {
esp_event_handler_node_t *handler_instance = calloc(1, sizeof(*handler_instance)); esp_event_handler_node_t *handler_instance = calloc(1, sizeof(*handler_instance));
if (!handler_instance) return ESP_ERR_NO_MEM; if (!handler_instance) {
return ESP_ERR_NO_MEM;
}
esp_event_handler_instance_context_t *context = calloc(1, sizeof(*context)); esp_event_handler_instance_context_t *context = calloc(1, sizeof(*context));
@@ -181,8 +181,7 @@ static esp_err_t handler_instances_add(esp_event_handler_nodes_t* handlers, esp_
if (SLIST_EMPTY(handlers)) { if (SLIST_EMPTY(handlers)) {
SLIST_INSERT_HEAD(handlers, handler_instance, next); SLIST_INSERT_HEAD(handlers, handler_instance, next);
} } else {
else {
esp_event_handler_node_t *it = NULL, *last = NULL; esp_event_handler_node_t *it = NULL, *last = NULL;
SLIST_FOREACH(it, handlers, next) { SLIST_FOREACH(it, handlers, next) {
@@ -219,8 +218,7 @@ static esp_err_t base_node_add_handler(esp_event_base_node_t* base_node,
{ {
if (id == ESP_EVENT_ANY_ID) { if (id == ESP_EVENT_ANY_ID) {
return handler_instances_add(&(base_node->handlers), event_handler, event_handler_arg, handler_ctx, legacy); return handler_instances_add(&(base_node->handlers), event_handler, event_handler_arg, handler_ctx, legacy);
} } else {
else {
esp_err_t err = ESP_OK; esp_err_t err = ESP_OK;
esp_event_id_node_t *it = NULL, *id_node = NULL, *last_id_node = NULL; esp_event_id_node_t *it = NULL, *id_node = NULL, *last_id_node = NULL;
@@ -248,8 +246,7 @@ static esp_err_t base_node_add_handler(esp_event_base_node_t* base_node,
if (err == ESP_OK) { if (err == ESP_OK) {
if (!last_id_node) { if (!last_id_node) {
SLIST_INSERT_HEAD(&(base_node->id_nodes), id_node, next); SLIST_INSERT_HEAD(&(base_node->id_nodes), id_node, next);
} } else {
else {
SLIST_INSERT_AFTER(last_id_node, id_node, next); SLIST_INSERT_AFTER(last_id_node, id_node, next);
} }
} else { } else {
@@ -257,8 +254,7 @@ static esp_err_t base_node_add_handler(esp_event_base_node_t* base_node,
} }
return err; return err;
} } else {
else {
return handler_instances_add(&(id_node->handlers), event_handler, event_handler_arg, handler_ctx, legacy); return handler_instances_add(&(id_node->handlers), event_handler, event_handler_arg, handler_ctx, legacy);
} }
} }
@@ -274,8 +270,7 @@ static esp_err_t loop_node_add_handler(esp_event_loop_node_t* loop_node,
{ {
if (base == esp_event_any_base && id == ESP_EVENT_ANY_ID) { if (base == esp_event_any_base && id == ESP_EVENT_ANY_ID) {
return handler_instances_add(&(loop_node->handlers), event_handler, event_handler_arg, handler_ctx, legacy); return handler_instances_add(&(loop_node->handlers), event_handler, event_handler_arg, handler_ctx, legacy);
} } else {
else {
esp_err_t err = ESP_OK; esp_err_t err = ESP_OK;
esp_event_base_node_t *it = NULL, *base_node = NULL, *last_base_node = NULL; esp_event_base_node_t *it = NULL, *base_node = NULL, *last_base_node = NULL;
@@ -307,8 +302,7 @@ static esp_err_t loop_node_add_handler(esp_event_loop_node_t* loop_node,
if (err == ESP_OK) { if (err == ESP_OK) {
if (!last_base_node) { if (!last_base_node) {
SLIST_INSERT_HEAD(&(loop_node->base_nodes), base_node, next); SLIST_INSERT_HEAD(&(loop_node->base_nodes), base_node, next);
} } else {
else {
SLIST_INSERT_AFTER(last_base_node, base_node, next); SLIST_INSERT_AFTER(last_base_node, base_node, next);
} }
} else { } else {
@@ -347,13 +341,11 @@ static esp_err_t handler_instances_remove(esp_event_handler_nodes_t* handlers, e
return ESP_ERR_NOT_FOUND; return ESP_ERR_NOT_FOUND;
} }
static esp_err_t base_node_remove_handler(esp_event_base_node_t* base_node, int32_t id, esp_event_handler_instance_context_t* handler_ctx, bool legacy) static esp_err_t base_node_remove_handler(esp_event_base_node_t* base_node, int32_t id, esp_event_handler_instance_context_t* handler_ctx, bool legacy)
{ {
if (id == ESP_EVENT_ANY_ID) { if (id == ESP_EVENT_ANY_ID) {
return handler_instances_remove(&(base_node->handlers), handler_ctx, legacy); return handler_instances_remove(&(base_node->handlers), handler_ctx, legacy);
} } else {
else {
esp_event_id_node_t *it, *temp; esp_event_id_node_t *it, *temp;
SLIST_FOREACH_SAFE(it, &(base_node->id_nodes), next, temp) { SLIST_FOREACH_SAFE(it, &(base_node->id_nodes), next, temp) {
if (it->id == id) { if (it->id == id) {
@@ -377,8 +369,7 @@ static esp_err_t loop_node_remove_handler(esp_event_loop_node_t* loop_node, esp_
{ {
if (base == esp_event_any_base && id == ESP_EVENT_ANY_ID) { if (base == esp_event_any_base && id == ESP_EVENT_ANY_ID) {
return handler_instances_remove(&(loop_node->handlers), handler_ctx, legacy); return handler_instances_remove(&(loop_node->handlers), handler_ctx, legacy);
} } else {
else {
esp_event_base_node_t *it, *temp; esp_event_base_node_t *it, *temp;
SLIST_FOREACH_SAFE(it, &(loop_node->base_nodes), next, temp) { SLIST_FOREACH_SAFE(it, &(loop_node->base_nodes), next, temp) {
if (it->base == base) { if (it->base == base) {
@@ -740,15 +731,13 @@ esp_err_t esp_event_handler_register_with_internal(esp_event_loop_handle_t event
if (err == ESP_OK) { if (err == ESP_OK) {
if (!last_loop_node) { if (!last_loop_node) {
SLIST_INSERT_HEAD(&(loop->loop_nodes), loop_node, next); SLIST_INSERT_HEAD(&(loop->loop_nodes), loop_node, next);
} } else {
else {
SLIST_INSERT_AFTER(last_loop_node, loop_node, next); SLIST_INSERT_AFTER(last_loop_node, loop_node, next);
} }
} else { } else {
free(loop_node); free(loop_node);
} }
} } else {
else {
err = loop_node_add_handler(last_loop_node, event_base, event_id, event_handler, event_handler_arg, handler_ctx_arg, legacy); err = loop_node_add_handler(last_loop_node, event_base, event_id, event_handler, event_handler_arg, handler_ctx_arg, legacy);
} }
@@ -819,7 +808,9 @@ esp_err_t esp_event_handler_unregister_with(esp_event_loop_handle_t event_loop,
esp_err_t esp_event_handler_instance_unregister_with(esp_event_loop_handle_t event_loop, esp_event_base_t event_base, esp_err_t esp_event_handler_instance_unregister_with(esp_event_loop_handle_t event_loop, esp_event_base_t event_base,
int32_t event_id, esp_event_handler_instance_t handler_ctx_arg) int32_t event_id, esp_event_handler_instance_t handler_ctx_arg)
{ {
if (!handler_ctx_arg) return ESP_ERR_INVALID_ARG; if (!handler_ctx_arg) {
return ESP_ERR_INVALID_ARG;
}
return esp_event_handler_unregister_with_internal(event_loop, event_base, event_id, (esp_event_handler_instance_context_t*) handler_ctx_arg, false); return esp_event_handler_unregister_with_internal(event_loop, event_base, event_id, (esp_event_handler_instance_context_t*) handler_ctx_arg, false);
} }

View File

@@ -22,8 +22,7 @@ bool esp_event_is_handler_registered(esp_event_loop_handle_t event_loop, esp_eve
SLIST_FOREACH(loop_node, &(loop->loop_nodes), next) { SLIST_FOREACH(loop_node, &(loop->loop_nodes), next) {
SLIST_FOREACH(handler, &(loop_node->handlers), next) { SLIST_FOREACH(handler, &(loop_node->handlers), next) {
if(event_base == ESP_EVENT_ANY_BASE && event_id == ESP_EVENT_ANY_ID && handler->handler_ctx->handler == event_handler) if (event_base == ESP_EVENT_ANY_BASE && event_id == ESP_EVENT_ANY_ID && handler->handler_ctx->handler == event_handler) {
{
result = true; result = true;
goto out; goto out;
} }
@@ -32,8 +31,7 @@ bool esp_event_is_handler_registered(esp_event_loop_handle_t event_loop, esp_eve
SLIST_FOREACH(base_node, &(loop_node->base_nodes), next) { SLIST_FOREACH(base_node, &(loop_node->base_nodes), next) {
if (base_node->base == event_base) { if (base_node->base == event_base) {
SLIST_FOREACH(handler, &(base_node->handlers), next) { SLIST_FOREACH(handler, &(base_node->handlers), next) {
if(event_id == ESP_EVENT_ANY_ID && handler->handler_ctx->handler == event_handler) if (event_id == ESP_EVENT_ANY_ID && handler->handler_ctx->handler == event_handler) {
{
result = true; result = true;
goto out; goto out;
} }
@@ -42,8 +40,7 @@ bool esp_event_is_handler_registered(esp_event_loop_handle_t event_loop, esp_eve
SLIST_FOREACH(id_node, &(base_node->id_nodes), next) { SLIST_FOREACH(id_node, &(base_node->id_nodes), next) {
if (id_node->id == event_id) { if (id_node->id == event_id) {
SLIST_FOREACH(handler, &(id_node->handlers), next) { SLIST_FOREACH(handler, &(id_node->handlers), next) {
if(handler->handler_ctx->handler == event_handler) if (handler->handler_ctx->handler == event_handler) {
{
result = true; result = true;
goto out; goto out;
} }

View File

@@ -7,7 +7,6 @@
CONDITIONS OF ANY KIND, either express or implied. CONDITIONS OF ANY KIND, either express or implied.
*/ */
#include <stdio.h> #include <stdio.h>
#include "esp_event.h" #include "esp_event.h"
@@ -20,7 +19,6 @@ extern "C" {
#include "Mockqueue.h" #include "Mockqueue.h"
} }
namespace { namespace {
const uint32_t QUEUE_SIZE = 32; const uint32_t QUEUE_SIZE = 32;
@@ -45,7 +43,8 @@ void dummy_handler(void* event_handler_arg, esp_event_base_t event_base, int32_t
} }
// TODO: IDF-2693, function definition just to satisfy linker, implement esp_common instead // TODO: IDF-2693, function definition just to satisfy linker, implement esp_common instead
const char *esp_err_to_name(esp_err_t code) { const char *esp_err_to_name(esp_err_t code)
{
return "test"; return "test";
} }
@@ -141,7 +140,8 @@ TEST_CASE("test esp_event_loop_create with_task(void)")
xQueueGiveMutexRecursive_StopIgnore(); xQueueGiveMutexRecursive_StopIgnore();
} }
TEST_CASE("registering with ANY_BASE but specific ID fails") { TEST_CASE("registering with ANY_BASE but specific ID fails")
{
esp_event_loop_handle_t loop = reinterpret_cast<esp_event_loop_handle_t>(1); esp_event_loop_handle_t loop = reinterpret_cast<esp_event_loop_handle_t>(1);
CHECK(esp_event_handler_register_with(loop, CHECK(esp_event_handler_register_with(loop,
ESP_EVENT_ANY_BASE, ESP_EVENT_ANY_BASE,

View File

@@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */

View File

@@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2018-2023 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */

View File

@@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Unlicense OR CC0-1.0 * SPDX-License-Identifier: Unlicense OR CC0-1.0
*/ */
@@ -48,14 +48,16 @@ static esp_event_loop_args_t test_event_get_default_loop_args(void)
struct EV_LoopFix { struct EV_LoopFix {
public: public:
EV_LoopFix(size_t queue_size = CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE, const char *task_name = NULL) { EV_LoopFix(size_t queue_size = CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE, const char *task_name = NULL)
{
esp_event_loop_args_t loop_args = test_event_get_default_loop_args(); esp_event_loop_args_t loop_args = test_event_get_default_loop_args();
loop_args.task_name = task_name; loop_args.task_name = task_name;
loop_args.queue_size = queue_size; loop_args.queue_size = queue_size;
TEST_ESP_OK(esp_event_loop_create(&loop_args, &loop)); TEST_ESP_OK(esp_event_loop_create(&loop_args, &loop));
} }
~EV_LoopFix() { ~EV_LoopFix()
{
esp_event_loop_delete(loop); esp_event_loop_delete(loop);
} }
@@ -126,7 +128,8 @@ static void test_handler_inc(void* event_handler_arg, esp_event_base_t event_bas
(*target)++; (*target)++;
} }
TEST_CASE("registering event handler instance without instance context works", "[event][linux]") { TEST_CASE("registering event handler instance without instance context works", "[event][linux]")
{
EV_LoopFix loop_fix; EV_LoopFix loop_fix;
int count = 0; int count = 0;
@@ -148,7 +151,8 @@ TEST_CASE("registering event handler instance without instance context works", "
* This aims to verify: 1) Handler's argument to be updated * This aims to verify: 1) Handler's argument to be updated
* 2) Registration not to leak memory * 2) Registration not to leak memory
*/ */
TEST_CASE("registering event twice with same handler yields updated handler arg", "[event][linux]") { TEST_CASE("registering event twice with same handler yields updated handler arg", "[event][linux]")
{
EV_LoopFix loop_fix; EV_LoopFix loop_fix;
int count_first = 0; int count_first = 0;
@@ -179,7 +183,8 @@ TEST_CASE("registering event twice with same handler yields updated handler arg"
TEST_ASSERT_EQUAL(1, count_second); TEST_ASSERT_EQUAL(1, count_second);
} }
TEST_CASE("registering event handler instance twice works", "[event][linux]") { TEST_CASE("registering event handler instance twice works", "[event][linux]")
{
EV_LoopFix loop_fix; EV_LoopFix loop_fix;
int count_1 = 0; int count_1 = 0;
int count_2 = 0; int count_2 = 0;
@@ -207,7 +212,8 @@ TEST_CASE("registering event handler instance twice works", "[event][linux]") {
TEST_ASSERT_EQUAL(1, count_2); TEST_ASSERT_EQUAL(1, count_2);
} }
TEST_CASE("registering with ANY_BASE but specific ID fails", "[event][linux]") { TEST_CASE("registering with ANY_BASE but specific ID fails", "[event][linux]")
{
EV_LoopFix loop_fix; EV_LoopFix loop_fix;
int count = 0; int count = 0;
int count_instance = 0; int count_instance = 0;
@@ -232,7 +238,8 @@ TEST_CASE("registering with ANY_BASE but specific ID fails", "[event][linux]") {
TEST_ASSERT_EQUAL(0, count_instance); TEST_ASSERT_EQUAL(0, count_instance);
} }
TEST_CASE("registration of ANY_BASE and ANY_ID always called", "[event][linux]") { TEST_CASE("registration of ANY_BASE and ANY_ID always called", "[event][linux]")
{
EV_LoopFix loop_fix; EV_LoopFix loop_fix;
int count = 0; int count = 0;
int count_instance = 0; int count_instance = 0;
@@ -263,7 +270,8 @@ TEST_CASE("registration of ANY_BASE and ANY_ID always called", "[event][linux]")
TEST_ASSERT_EQUAL(4, count_instance); TEST_ASSERT_EQUAL(4, count_instance);
} }
TEST_CASE("registration of ANY_ID not called from wrong base", "[event][linux]") { TEST_CASE("registration of ANY_ID not called from wrong base", "[event][linux]")
{
EV_LoopFix loop_fix; EV_LoopFix loop_fix;
int count = 0; int count = 0;
int count_instance = 0; int count_instance = 0;
@@ -291,7 +299,8 @@ TEST_CASE("registration of ANY_ID not called from wrong base", "[event][linux]")
TEST_ASSERT_EQUAL(0, count_instance); TEST_ASSERT_EQUAL(0, count_instance);
} }
TEST_CASE("registration of ANY_ID called from correct base", "[event][linux]") { TEST_CASE("registration of ANY_ID called from correct base", "[event][linux]")
{
EV_LoopFix loop_fix; EV_LoopFix loop_fix;
int count = 0; int count = 0;
int count_instance = 0; int count_instance = 0;
@@ -319,7 +328,8 @@ TEST_CASE("registration of ANY_ID called from correct base", "[event][linux]") {
TEST_ASSERT_EQUAL(2, count_instance); TEST_ASSERT_EQUAL(2, count_instance);
} }
TEST_CASE("registering specific event posting different base and different event ID", "[event][linux]") { TEST_CASE("registering specific event posting different base and different event ID", "[event][linux]")
{
EV_LoopFix loop_fix; EV_LoopFix loop_fix;
int count = 0; int count = 0;
int count_instance = 0; int count_instance = 0;
@@ -345,7 +355,8 @@ TEST_CASE("registering specific event posting different base and different event
TEST_ASSERT_EQUAL(0, count_instance); TEST_ASSERT_EQUAL(0, count_instance);
} }
TEST_CASE("registering specific event posting different base", "[event][linux]") { TEST_CASE("registering specific event posting different base", "[event][linux]")
{
EV_LoopFix loop_fix; EV_LoopFix loop_fix;
int count = 0; int count = 0;
int count_instance = 0; int count_instance = 0;
@@ -373,7 +384,8 @@ TEST_CASE("registering specific event posting different base", "[event][linux]")
TEST_ASSERT_EQUAL(0, count_instance); TEST_ASSERT_EQUAL(0, count_instance);
} }
TEST_CASE("registering specific event posting incorrect event ID", "[event][linux]") { TEST_CASE("registering specific event posting incorrect event ID", "[event][linux]")
{
EV_LoopFix loop_fix; EV_LoopFix loop_fix;
int count = 0; int count = 0;
int count_instance = 0; int count_instance = 0;
@@ -399,7 +411,8 @@ TEST_CASE("registering specific event posting incorrect event ID", "[event][linu
TEST_ASSERT_EQUAL(0, count_instance); TEST_ASSERT_EQUAL(0, count_instance);
} }
TEST_CASE("registering specific event posting correct event and base", "[event][linux]") { TEST_CASE("registering specific event posting correct event and base", "[event][linux]")
{
EV_LoopFix loop_fix; EV_LoopFix loop_fix;
int count = 0; int count = 0;
int count_instance = 0; int count_instance = 0;
@@ -425,7 +438,8 @@ TEST_CASE("registering specific event posting correct event and base", "[event][
TEST_ASSERT_EQUAL(1, count_instance); TEST_ASSERT_EQUAL(1, count_instance);
} }
TEST_CASE("posting ANY_EVENT or ANY_ID fails", "[event][linux]") { TEST_CASE("posting ANY_EVENT or ANY_ID fails", "[event][linux]")
{
EV_LoopFix loop_fix; EV_LoopFix loop_fix;
int count = 0; int count = 0;
int count_instance = 0; int count_instance = 0;
@@ -467,7 +481,8 @@ TEST_CASE("posting ANY_EVENT or ANY_ID fails", "[event][linux]") {
TEST_ASSERT_EQUAL(0, count_instance); TEST_ASSERT_EQUAL(0, count_instance);
} }
TEST_CASE("posting to loop with multiple registrations at every level", "[event][linux]") { TEST_CASE("posting to loop with multiple registrations at every level", "[event][linux]")
{
EV_LoopFix loop_fix; EV_LoopFix loop_fix;
int count_loop = 0; int count_loop = 0;
int count_loop_inst = 0; int count_loop_inst = 0;
@@ -1227,7 +1242,8 @@ static void test_handler_give_sem(void* handler_arg, esp_event_base_t base, int3
const TickType_t ONE_TICK = 1; const TickType_t ONE_TICK = 1;
static void wait_taken(SemaphoreHandle_t sem, TickType_t delay_ticks_if_not_taken) { static void wait_taken(SemaphoreHandle_t sem, TickType_t delay_ticks_if_not_taken)
{
while (xSemaphoreTake(sem, ONE_TICK) == pdTRUE) { while (xSemaphoreTake(sem, ONE_TICK) == pdTRUE) {
xSemaphoreGive(sem); xSemaphoreGive(sem);
vTaskDelay(delay_ticks_if_not_taken); vTaskDelay(delay_ticks_if_not_taken);
@@ -1564,7 +1580,8 @@ TEST_CASE("default loop: registering/unregistering event works", "[event][defaul
TEST_ESP_OK(esp_event_loop_delete_default()); TEST_ESP_OK(esp_event_loop_delete_default());
} }
TEST_CASE("default event loop: registering event handler instance without instance context works", "[event][default][linux]") { TEST_CASE("default event loop: registering event handler instance without instance context works", "[event][default][linux]")
{
TEST_ESP_OK(esp_event_loop_create_default()); TEST_ESP_OK(esp_event_loop_create_default());
if (TEST_PROTECT()) { if (TEST_PROTECT()) {

View File

@@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Unlicense OR CC0-1.0 * SPDX-License-Identifier: Unlicense OR CC0-1.0
*/ */
@@ -30,7 +30,6 @@
#include "test_utils.h" #include "test_utils.h"
static const char* TAG = "test_event"; static const char* TAG = "test_event";
static const TickType_t ZERO_DELAY = 0; static const TickType_t ZERO_DELAY = 0;
@@ -381,8 +380,7 @@ TEST_CASE("can post and run events simultaneously", "[event]")
post_event_data_t* post_event_data = calloc(TEST_CONFIG_TASKS_TO_SPAWN, sizeof(*post_event_data)); post_event_data_t* post_event_data = calloc(TEST_CONFIG_TASKS_TO_SPAWN, sizeof(*post_event_data));
task_arg_t* post_event_arg = calloc(TEST_CONFIG_TASKS_TO_SPAWN, sizeof(*post_event_arg)); task_arg_t* post_event_arg = calloc(TEST_CONFIG_TASKS_TO_SPAWN, sizeof(*post_event_arg));
for (int i = 0; i < TEST_CONFIG_TASKS_TO_SPAWN; i++) for (int i = 0; i < TEST_CONFIG_TASKS_TO_SPAWN; i++) {
{
post_event_data[i].base = s_test_base1; post_event_data[i].base = s_test_base1;
post_event_data[i].id = TEST_EVENT_BASE1_EV1; post_event_data[i].id = TEST_EVENT_BASE1_EV1;
post_event_data[i].loop = loop; post_event_data[i].loop = loop;
@@ -459,8 +457,7 @@ TEST_CASE("can post and run events simultaneously with instances", "[event]")
post_event_data_t* post_event_data = calloc(TEST_CONFIG_TASKS_TO_SPAWN, sizeof(*post_event_data)); post_event_data_t* post_event_data = calloc(TEST_CONFIG_TASKS_TO_SPAWN, sizeof(*post_event_data));
task_arg_t* post_event_arg = calloc(TEST_CONFIG_TASKS_TO_SPAWN, sizeof(*post_event_arg)); task_arg_t* post_event_arg = calloc(TEST_CONFIG_TASKS_TO_SPAWN, sizeof(*post_event_arg));
for (int i = 0; i < TEST_CONFIG_TASKS_TO_SPAWN; i++) for (int i = 0; i < TEST_CONFIG_TASKS_TO_SPAWN; i++) {
{
post_event_data[i].base = s_test_base1; post_event_data[i].base = s_test_base1;
post_event_data[i].id = TEST_EVENT_BASE1_EV1; post_event_data[i].id = TEST_EVENT_BASE1_EV1;
post_event_data[i].loop = loop; post_event_data[i].loop = loop;

View File

@@ -54,7 +54,6 @@ components_not_formatted_temporary:
- "/components/efuse/" - "/components/efuse/"
- "/components/esp_coex/" - "/components/esp_coex/"
- "/components/esp_eth/" - "/components/esp_eth/"
- "/components/esp_event/"
- "/components/esp_gdbstub/" - "/components/esp_gdbstub/"
- "/components/esp_hid/" - "/components/esp_hid/"
- "/components/esp_http_client/" - "/components/esp_http_client/"