From 8657986989f5c39444c8781a8bf76d8f48730b41 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 22 Dec 2021 10:09:11 +0100 Subject: libtest: Check for pending events Make sure there are no pending events after a test case. --- cpukit/libtest/t-test-rtems-context.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cpukit/libtest') diff --git a/cpukit/libtest/t-test-rtems-context.c b/cpukit/libtest/t-test-rtems-context.c index 8d33d08866..cadafcdf94 100644 --- a/cpukit/libtest/t-test-rtems-context.c +++ b/cpukit/libtest/t-test-rtems-context.c @@ -63,6 +63,7 @@ T_do_check_task_context(void) rtems_task_priority prio; rtems_status_code sc; uint32_t v; + rtems_event_set events; #ifdef RTEMS_SMP rtems_id id; #endif @@ -95,6 +96,14 @@ T_do_check_task_context(void) T_check(&T_special, prio == T_runner_priority, "Wrong runner priority, expected %" PRIu32 ", actual %" PRIu32, T_runner_priority, prio); + + sc = rtems_event_receive(RTEMS_ALL_EVENTS, + RTEMS_NO_WAIT | RTEMS_EVENT_ANY, 0, &events); + T_quiet_rsc( sc, RTEMS_UNSATISFIED ); + + sc = rtems_event_system_receive(RTEMS_ALL_EVENTS, + RTEMS_NO_WAIT | RTEMS_EVENT_ANY, 0, &events); + T_quiet_rsc( sc, RTEMS_UNSATISFIED ); } void -- cgit v1.2.3