[rtems commit] libtest: Check for pending events

Sebastian Huber sebh at rtems.org
Wed Dec 22 09:23:30 UTC 2021


Module:    rtems
Branch:    master
Commit:    8657986989f5c39444c8781a8bf76d8f48730b41
Changeset: http://git.rtems.org/rtems/commit/?id=8657986989f5c39444c8781a8bf76d8f48730b41

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Dec 22 10:09:11 2021 +0100

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(+)

diff --git a/cpukit/libtest/t-test-rtems-context.c b/cpukit/libtest/t-test-rtems-context.c
index 8d33d08..cadafcd 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



More information about the vc mailing list