summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2022-01-12 14:23:06 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-01-12 14:24:23 +0100
commit37377b0f9dc3c373c7498e7a1f9bb1c2af9f7bce (patch)
treeaf6405ee21087131ea6d67f76429f0dd30c8dada /testsuites/sptests
parentFix device tree blob alignment (diff)
downloadrtems-37377b0f9dc3c373c7498e7a1f9bb1c2af9f7bce.tar.bz2
spintrcritical21: Clear pending events
The test runner checks that there are no pending events after a test case.
Diffstat (limited to 'testsuites/sptests')
-rw-r--r--testsuites/sptests/spintrcritical21/init.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/testsuites/sptests/spintrcritical21/init.c b/testsuites/sptests/spintrcritical21/init.c
index 032ee89eac..5b1ecb2862 100644
--- a/testsuites/sptests/spintrcritical21/init.c
+++ b/testsuites/sptests/spintrcritical21/init.c
@@ -31,6 +31,18 @@ typedef struct {
rtems_id other_task;
} test_context;
+static void clear_pending_events( void )
+{
+ rtems_event_set out;
+
+ (void) rtems_event_receive(
+ RTEMS_ALL_EVENTS,
+ RTEMS_NO_WAIT | RTEMS_EVENT_ANY,
+ 0,
+ &out
+ );
+}
+
static bool is_blocked( Thread_Wait_flags flags )
{
return flags == ( THREAD_WAIT_CLASS_EVENT | THREAD_WAIT_STATE_BLOCKED );
@@ -123,6 +135,8 @@ T_TEST_CASE(EventFromISR)
status = rtems_task_delete( ctx.other_task );
T_rsc_success( status );
+
+ clear_pending_events();
}
static T_interrupt_test_state event_with_timeout_from_isr_interrupt(
@@ -183,6 +197,8 @@ T_TEST_CASE( EventWithTimeoutFromISR )
state = T_interrupt_test( &event_with_timeout_from_isr_config, &ctx );
T_eq_int( state, T_INTERRUPT_TEST_DONE );
+
+ clear_pending_events();
}
static rtems_task Init( rtems_task_argument argument )