From 4389287a3964ae5b8e08f5268823e832272c78e1 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Sun, 14 Dec 2008 18:38:45 +0000 Subject: 2008-12-14 Joel Sherrill * tm01/task1.c, tm02/task1.c, tm03/task1.c, tm04/task1.c, tm05/task1.c, tm06/task1.c, tm07/task1.c, tm08/task1.c, tm09/task1.c, tm10/task1.c, tm11/task1.c, tm12/task1.c, tm13/task1.c, tm14/task1.c, tm16/task1.c, tm17/task1.c, tm18/task1.c, tm19/task1.c, tm20/task1.c, tm21/task1.c, tm23/task1.c, tm24/task1.c, tm25/task1.c, tm26/task1.c, tm27/task1.c, tm28/task1.c, tm29/task1.c, tmoverhd/testtask.c: Run all tests successfully with maxixum number of priorities as 16 instead of 256. This was done by temporarily modifying the score priority.h maximum. This allowed testing of all API code to ensure that it worked properly with a reduced number of priorities. Most modifications were to switch from hard-coded maximum to using the API provided methods to determine maximum number of priority levels. --- testsuites/tmtests/tm13/task1.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'testsuites/tmtests/tm13') diff --git a/testsuites/tmtests/tm13/task1.c b/testsuites/tmtests/tm13/task1.c index 482029d92b..a687d8004e 100644 --- a/testsuites/tmtests/tm13/task1.c +++ b/testsuites/tmtests/tm13/task1.c @@ -1,6 +1,5 @@ /* - * - * COPYRIGHT (c) 1989-2007. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -31,6 +30,8 @@ rtems_task High_task( #define MESSAGE_SIZE (sizeof(long) * 4) +int operation_count = OPERATION_COUNT; + void Init( rtems_task_argument argument ) @@ -44,7 +45,7 @@ void Init( status = rtems_task_create( 1, - 251, + RTEMS_MAXIMUM_PRIORITY - 1, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, @@ -63,7 +64,7 @@ rtems_task test_init( rtems_task_argument argument ) { - uint32_t index; + uint32_t index; rtems_task_entry task_entry; rtems_task_priority priority; rtems_id task_id; @@ -83,9 +84,12 @@ rtems_task test_init( ); directive_failed( status, "rtems_message_queue_create" ); - priority = 250; + priority = RTEMS_MAXIMUM_PRIORITY - 2; - for( index = 0; index < OPERATION_COUNT ; index++ ) { + if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2 ) + operation_count = RTEMS_MAXIMUM_PRIORITY - 2; + + for( index = 0; index < operation_count ; index++ ) { status = rtems_task_create( rtems_build_name( 'T', 'I', 'M', 'E' ), priority, @@ -98,7 +102,7 @@ rtems_task test_init( priority--; - if ( index==OPERATION_COUNT-1 ) task_entry = High_task; + if ( index==operation_count-1 ) task_entry = High_task; else task_entry = Middle_tasks; status = rtems_task_start( task_id, task_entry, 0 ); @@ -145,7 +149,7 @@ rtems_task High_task( put_time( "rtems_message_queue_urgent: task readied -- preempts caller", end_time, - OPERATION_COUNT, + operation_count, 0, CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT ); -- cgit v1.2.3