summaryrefslogtreecommitdiffstats
path: root/spec/rtems/signal/req/send.yml
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rtems/signal/req/send.yml')
-rw-r--r--spec/rtems/signal/req/send.yml83
1 files changed, 15 insertions, 68 deletions
diff --git a/spec/rtems/signal/req/send.yml b/spec/rtems/signal/req/send.yml
index 050c6e8e..6e9d02d5 100644
--- a/spec/rtems/signal/req/send.yml
+++ b/spec/rtems/signal/req/send.yml
@@ -293,7 +293,8 @@ test-description: null
test-header: null
test-includes:
- rtems.h
-test-local-includes: []
+test-local-includes:
+- tc-support.h
test-prepare: |
ctx->handler_calls = 0;
ctx->calls_after_send = 0;
@@ -304,26 +305,13 @@ test-prepare: |
test-setup:
brief: null
code: |
- rtems_status_code sc;
- rtems_task_priority prio;
+ rtems_status_code sc;
memset( ctx, 0, sizeof( *ctx ) );
ctx->runner_id = rtems_task_self();
+ SetSelfPriority( PRIO_NORMAL );
- prio = 0;
- sc = rtems_task_set_priority( RTEMS_SELF, PRIO_NORMAL, &prio );
- T_rsc_success( sc );
- T_eq_u32( prio, PRIO_HIGH );
-
- sc = rtems_task_create(
- rtems_build_name( 'W', 'O', 'R', 'K' ),
- PRIO_HIGH,
- RTEMS_MINIMUM_STACK_SIZE,
- RTEMS_DEFAULT_MODES,
- RTEMS_DEFAULT_ATTRIBUTES,
- &ctx->worker_id
- );
- T_assert_rsc_success( sc );
+ ctx->worker_id = CreateTask( "WORK", PRIO_HIGH );
#if defined(RTEMS_SMP)
if ( rtems_scheduler_get_processor_maximum() > 1 ) {
@@ -337,8 +325,7 @@ test-setup:
}
#endif
- sc = rtems_task_start( ctx->worker_id, Worker, (rtems_task_argument) ctx );
- T_assert_rsc_success( sc );
+ StartTask( ctx->worker_id, Worker, ctx );
description: null
test-stop: null
test-support: |
@@ -354,36 +341,6 @@ test-support: |
typedef RtemsSignalReqSend_Context Context;
- typedef enum {
- PRIO_HIGH = 1,
- PRIO_NORMAL
- } Priorities;
-
- static rtems_event_set Wait( void )
- {
- rtems_status_code sc;
- rtems_event_set events;
-
- events = 0;
- sc = rtems_event_receive(
- RTEMS_ALL_EVENTS,
- RTEMS_EVENT_ANY | RTEMS_WAIT,
- RTEMS_NO_TIMEOUT,
- &events
- );
- T_rsc_success( sc );
-
- return events;
- }
-
- static void SendEvents( rtems_id id, rtems_event_set events )
- {
- rtems_status_code sc;
-
- sc = rtems_event_send( id, events );
- T_rsc_success( sc );
- }
-
static void WorkerDone( const Context *ctx )
{
#if defined(RTEMS_SMP)
@@ -399,7 +356,7 @@ test-support: |
#if defined(RTEMS_SMP)
if ( rtems_scheduler_get_processor_maximum() > 1 ) {
- events = Wait();
+ events = ReceiveAnyEvents();
T_eq_u32( events, EVENT_WORKER_DONE );
}
#endif
@@ -430,12 +387,12 @@ test-support: |
WorkerDone( ctx );
- events = Wait();
+ events = ReceiveAnyEvents();
T_eq_u32( events, EVENT_SEND_DONE );
WorkerDone( ctx );
- events = Wait();
+ events = ReceiveAnyEvents();
T_eq_u32( events, EVENT_DO_ENABLE );
} else {
sc = rtems_signal_catch( ctx->handler, RTEMS_NO_ASR );
@@ -458,7 +415,7 @@ test-support: |
rtems_status_code sc;
rtems_event_set events;
- events = Wait();
+ events = ReceiveAnyEvents();
T_eq_u32( events, EVENT_START );
if ( ctx->nested != 0 ) {
@@ -480,12 +437,12 @@ test-support: |
WorkerDone( ctx );
- events = Wait();
+ events = ReceiveAnyEvents();
T_eq_u32( events, EVENT_SEND_DONE );
WorkerDone( ctx );
- events = Wait();
+ events = ReceiveAnyEvents();
T_eq_u32( events, EVENT_DO_ENABLE );
sc = rtems_task_mode( mode, RTEMS_ASR_MASK, &mode );
@@ -494,7 +451,7 @@ test-support: |
WorkerDone( ctx );
}
- events = Wait();
+ events = ReceiveAnyEvents();
T_eq_u32( events, EVENT_END );
WorkerDone( ctx );
@@ -504,18 +461,8 @@ test-target: testsuites/validation/tc-signal-send.c
test-teardown:
brief: null
code: |
- rtems_status_code sc;
- rtems_task_priority prio;
-
- prio = 0;
- sc = rtems_task_set_priority( RTEMS_SELF, PRIO_HIGH, &prio );
- T_rsc_success( sc );
- T_eq_u32( prio, PRIO_NORMAL );
-
- if ( ctx->worker_id != 0 ) {
- sc = rtems_task_delete( ctx->worker_id );
- T_rsc_success( sc );
- }
+ DeleteTask( ctx->worker_id );
+ RestoreRunnerPriority();
description: null
text: ${.:text-template}
transition-map: