diff options
Diffstat (limited to 'testsuites/sptests/spthreadq01/init.c')
-rw-r--r-- | testsuites/sptests/spthreadq01/init.c | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/testsuites/sptests/spthreadq01/init.c b/testsuites/sptests/spthreadq01/init.c index 240cd1a9e8..ce47760e2d 100644 --- a/testsuites/sptests/spthreadq01/init.c +++ b/testsuites/sptests/spthreadq01/init.c @@ -18,38 +18,31 @@ const char rtems_test_name[] = "SPTHREADQ 1"; -/* forward declarations to avoid warnings */ -rtems_task Init(rtems_task_argument argument); -void threadq_first_empty( - const char *discipline_string, - Thread_queue_Disciplines discipline -); - -void threadq_first_empty( - const char *discipline_string, - Thread_queue_Disciplines discipline +static Thread_queue_Control fifo_queue = + THREAD_QUEUE_FIFO_INITIALIZER( fifo_queue, "FIFO" ); + +static Thread_queue_Control prio_queue = + THREAD_QUEUE_PRIORIY_INITIALIZER( prio_queue, "Prio" ); + +static rtems_task Init( + rtems_task_argument ignored ) { - Thread_queue_Control tq; - - printf( "Init - initialize thread queue for %s\n", discipline_string ); - _Thread_queue_Initialize( &tq, discipline, 3 ); + TEST_BEGIN(); puts( "Init - _Thread_queue_Extract - thread not blocked on a thread queue" ); _Thread_Disable_dispatch(); - _Thread_queue_Extract( &tq, _Thread_Executing ); + _Thread_queue_Extract( _Thread_Executing ); _Thread_Enable_dispatch(); /* is there more to check? */ -} -rtems_task Init( - rtems_task_argument ignored -) -{ - TEST_BEGIN(); + rtems_test_assert( _Chain_Is_empty( &fifo_queue.Queues.Fifo ) ); + rtems_test_assert( fifo_queue.operations == &_Thread_queue_Operations_FIFO ); - threadq_first_empty( "FIFO", THREAD_QUEUE_DISCIPLINE_FIFO ); - threadq_first_empty( "Priority", THREAD_QUEUE_DISCIPLINE_PRIORITY ); + rtems_test_assert( _RBTree_Is_empty( &fifo_queue.Queues.Priority ) ); + rtems_test_assert( + prio_queue.operations == &_Thread_queue_Operations_priority + ); TEST_END(); rtems_test_exit(0); |