Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/sys/events: test if event_timeout_is_pending returns false #21032

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tests/sys/events/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
const char *text;
} custom_event_t;

static custom_event_t custom_event = { .super.handler = custom_callback, .text = "CUSTOM CALLBACK" };

Check warning on line 75 in tests/sys/events/main.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
static event_callback_t* event_callback_ptr;
static event_callback_t noevent_callback = EVENT_CALLBACK_INIT(forbidden_callback, 0);

Expand Down Expand Up @@ -196,6 +196,16 @@

event_timeout_t event_timeout;

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

event_timeout_ztimer_init(&event_timeout, ZTIMER_USEC, NULL, (event_t *)&event_callback);
expect(!event_timeout_is_pending(&event_timeout));

event_timeout_ztimer_init(&event_timeout, ZTIMER_USEC, &queue, 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
Loading