summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/spsimplesched01/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites/sptests/spsimplesched01/init.c')
-rw-r--r--testsuites/sptests/spsimplesched01/init.c38
1 files changed, 29 insertions, 9 deletions
diff --git a/testsuites/sptests/spsimplesched01/init.c b/testsuites/sptests/spsimplesched01/init.c
index 95eaaa2b1a..3a05c37a34 100644
--- a/testsuites/sptests/spsimplesched01/init.c
+++ b/testsuites/sptests/spsimplesched01/init.c
@@ -25,15 +25,18 @@ rtems_task Test_task(
rtems_task_argument unused
)
{
- rtems_id tid;
- rtems_time_of_day time;
- uint32_t task_index;
- rtems_status_code status;
+ rtems_id tid;
+ rtems_time_of_day time;
+ uint32_t task_index;
+ rtems_status_code status;
status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ directive_failed( status, "task ident" );
+
task_index = task_number( tid );
for ( ; ; ) {
status = rtems_clock_get_tod( &time );
+ directive_failed( status, "clock get tod" );
if ( time.second >= 35 ) {
puts( "*** END OF SIMPLE01 TEST ***" );
rtems_test_exit( 0 );
@@ -41,7 +44,9 @@ rtems_task Test_task(
put_name( Task_name[ task_index ], FALSE );
print_time( " - rtems_clock_get_tod - ", &time, "\n" );
status = rtems_task_wake_after(
- task_index * 5 * rtems_clock_get_ticks_per_second() );
+ task_index * 5 * rtems_clock_get_ticks_per_second()
+ );
+ directive_failed( status, "wake after" );
}
}
@@ -73,28 +78,43 @@ rtems_task Init(
Task_name[ 1 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 1 ]
);
+ directive_failed( status, "create 1" );
+
status = rtems_task_create(
Task_name[ 2 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 2 ]
);
+ directive_failed( status, "create 2" );
+
status = rtems_task_create(
Task_name[ 3 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 3 ]
);
+ directive_failed( status, "create 3" );
status = rtems_task_start( Task_id[ 1 ], Test_task, 1 );
+ directive_failed( status, "start 1" );
rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
+
status = rtems_task_start( Task_id[ 2 ], Test_task, 2 );
+ directive_failed( status, "start 2" );
rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
+
status = rtems_task_start( Task_id[ 3 ], Test_task, 3 );
+ directive_failed( status, "start 3" );
- rtems_task_set_priority(Task_id[1], 2, &old);
- rtems_task_set_priority(Task_id[2], 2, &old);
- rtems_task_set_priority(Task_id[3], 2, &old);
+ status = rtems_task_set_priority( Task_id[1], 2, &old );
+ directive_failed( status, "set priority 1" );
+ status = rtems_task_set_priority( Task_id[2], 2, &old );
+ directive_failed( status, "set priority 2" );
+ status = rtems_task_set_priority( Task_id[3], 2, &old );
+ directive_failed( status, "set priority 3" );
- rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
+ status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
+ directive_failed( status, "yield" );
status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "delete self" );
}
/* configuration information */