Skip to content

Commit

Permalink
tests/sys/events/: test if event_timeout_is_pending returns false
Browse files Browse the repository at this point in the history
test if event_timeout_is_pending returns false when event_timeout_t is not completly initialized
  • Loading branch information
JulianHolzwarth committed Nov 22, 2024
1 parent 0054f6c commit 2d3cbc6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/sys/events/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,19 @@ int main(void)

event_timeout_t event_timeout;

/* uninitialied event_timeout_t should return false */
event_timeout_init(&event_timeout, &queue, (event_t *)&event_callback);
event_timeout.clock = NULL;
expect(!event_timeout_is_pending(&event_timeout));

event_timeout_init(&event_timeout, &queue, (event_t *)&event_callback);
event_timeout.queue = NULL;
expect(!event_timeout_is_pending(&event_timeout));

event_timeout_init(&event_timeout, &queue, (event_t *)&event_callback);
event_timeout.event = NULL;
expect(!event_timeout_is_pending(&event_timeout));

puts("posting timed callback with timeout 1sec");
event_timeout_init(&event_timeout, &queue, (event_t *)&event_callback);
#if IS_USED(MODULE_ZTIMER_USEC)
Expand Down

0 comments on commit 2d3cbc6

Please sign in to comment.