From 83cf6bf3396f638f484e09c45ab5206556e04894 Mon Sep 17 00:00:00 2001 From: JulianHolzwarth Date: Fri, 22 Nov 2024 18:35:54 +0100 Subject: [PATCH] tests/sys/events/: test if event_timeout_is_pending returns false test if event_timeout_is_pending returns false when event_timeout_t is not completly initialized --- tests/sys/events/main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/sys/events/main.c b/tests/sys/events/main.c index d0413e0221..2dab7ca13d 100644 --- a/tests/sys/events/main.c +++ b/tests/sys/events/main.c @@ -196,6 +196,16 @@ int main(void) 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)