From d05ec0f77313dc15ff4f4253441d56a4ce101530 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Sun, 4 Oct 2009 22:02:18 +0000 Subject: 2009-10-04 Joel Sherrill * sp07/init.c, sp07/sp07.scn, sp09/init.c, sp09/screen01.c, sp09/sp09.scn, sp28/init.c, sp62/init.c, sp62/sp62.scn, sp64/init.c, sp64/sp64.scn: Add more test cases highlighted on SPARC at -O2, x86 at -Os and m68k at -Os. Fix typos. --- testsuites/sptests/ChangeLog | 7 +++++++ testsuites/sptests/sp07/init.c | 23 ++++++++--------------- testsuites/sptests/sp07/sp07.scn | 3 ++- testsuites/sptests/sp09/init.c | 37 ++++++++++++++++++++++--------------- testsuites/sptests/sp09/screen01.c | 14 ++++++++++---- testsuites/sptests/sp09/sp09.scn | 4 +++- testsuites/sptests/sp28/init.c | 2 +- testsuites/sptests/sp62/init.c | 31 ++++++++++++++++++++++++++++--- testsuites/sptests/sp62/sp62.scn | 1 + testsuites/sptests/sp64/init.c | 2 +- testsuites/sptests/sp64/sp64.scn | 2 +- 11 files changed, 84 insertions(+), 42 deletions(-) (limited to 'testsuites') diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog index fc73fd983f..861184517e 100644 --- a/testsuites/sptests/ChangeLog +++ b/testsuites/sptests/ChangeLog @@ -1,3 +1,10 @@ +2009-10-04 Joel Sherrill + + * sp07/init.c, sp07/sp07.scn, sp09/init.c, sp09/screen01.c, + sp09/sp09.scn, sp28/init.c, sp62/init.c, sp62/sp62.scn, sp64/init.c, + sp64/sp64.scn: Add more test cases highlighted on SPARC at -O2, x86 + at -Os and m68k at -Os. Fix typos. + 2009-10-02 Ralf Corsépius * sp54/init.c: Use rtems_build_id to make building Objects_Id diff --git a/testsuites/sptests/sp07/init.c b/testsuites/sptests/sp07/init.c index 58018ab6a2..806544119b 100644 --- a/testsuites/sptests/sp07/init.c +++ b/testsuites/sptests/sp07/init.c @@ -1,16 +1,4 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * +/* * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * @@ -171,9 +159,14 @@ rtems_task Init( buffered_io_flush(); + status = rtems_task_set_note( rtems_task_self(), RTEMS_NOTEPAD_4, 32 ); + directive_failed( status, "task_set_node of Self id" ); + printf( "INIT - rtems_task_set_note - set my (id) RTEMS_NOTEPAD_4 " ); + puts ( "to TA1's priority: 04" ); + status = rtems_task_set_note( RTEMS_SELF, RTEMS_NOTEPAD_4, 32 ); - directive_failed( status, "task_set_node of Self" ); - printf( "INIT - rtems_task_set_note - set my RTEMS_NOTEPAD_4 " ); + directive_failed( status, "task_set_node of Self 0" ); + printf( "INIT - rtems_task_set_note - set my (SELF) RTEMS_NOTEPAD_4 " ); puts ( "to TA1's priority: 04" ); status = rtems_task_set_note( Task_id[ 1 ], RTEMS_NOTEPAD_8, 4 ); diff --git a/testsuites/sptests/sp07/sp07.scn b/testsuites/sptests/sp07/sp07.scn index 2bbf8a7f0a..e75bdd0095 100644 --- a/testsuites/sptests/sp07/sp07.scn +++ b/testsuites/sptests/sp07/sp07.scn @@ -18,7 +18,8 @@ TASK_START - TA2 - started TASK_START - TA3 - started TASK_START - TA4 - started TASK_RESTART - TA3 - restarted -INIT - rtems_task_set_note - set my RTEMS_NOTEPAD_4 to TA1's priority: 04 +INIT - rtems_task_set_note - set my (id) RTEMS_NOTEPAD_4 to TA1's priority: 04 +INIT - rtems_task_set_note - set my (SELF) RTEMS_NOTEPAD_4 to TA1's priority: 04 INIT - rtems_task_set_note - set TA1's RTEMS_NOTEPAD_8 to TA1's priority: 04 INIT - rtems_task_set_note - set TA2's RTEMS_NOTEPAD_8 to TA2's priority: 04 diff --git a/testsuites/sptests/sp09/init.c b/testsuites/sptests/sp09/init.c index f8b5e8bbb5..12ff5a9b08 100644 --- a/testsuites/sptests/sp09/init.c +++ b/testsuites/sptests/sp09/init.c @@ -1,17 +1,5 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. +/* + * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -60,6 +48,7 @@ rtems_task Init( Period_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' ); + /* priority of 0 error */ status = rtems_task_create( Task_name[1], 0, @@ -73,7 +62,25 @@ rtems_task Init( RTEMS_INVALID_PRIORITY, "rtems_task_create with illegal priority" ); - puts( "INIT - rtems_task_create - RTEMS_INVALID_PRIORITY" ); + puts( "INIT - rtems_task_create - priority of 0 - RTEMS_INVALID_PRIORITY" ); + + /* priority > 255 error */ + status = rtems_task_create( + Task_name[1], + 257, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 1 ] + ); + fatal_directive_status( + status, + RTEMS_INVALID_PRIORITY, + "rtems_task_create with illegal priority" + ); + puts( + "INIT - rtems_task_create - priority too high - RTEMS_INVALID_PRIORITY" + ); status = rtems_task_create( Task_name[ 1 ], diff --git a/testsuites/sptests/sp09/screen01.c b/testsuites/sptests/sp09/screen01.c index 25b41eb5eb..4f94bba4c5 100644 --- a/testsuites/sptests/sp09/screen01.c +++ b/testsuites/sptests/sp09/screen01.c @@ -2,10 +2,6 @@ * * This routine generates error screen 1 for test 9. * - * Input parameters: NONE - * - * Output parameters: NONE - * * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * @@ -26,6 +22,16 @@ void Screen1() rtems_task_priority previous_priority; rtems_status_code status; + /* bad Id */ + status = rtems_task_is_suspended( 100 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_task_set_priority with illegal id" + ); + puts( "TA1 - rtems_task_is_suspended - RTEMS_INVALID_ID" ); + + /* bad Id */ status = rtems_task_delete( 100 ); fatal_directive_status( status, diff --git a/testsuites/sptests/sp09/sp09.scn b/testsuites/sptests/sp09/sp09.scn index b976bcdbec..89518f9274 100644 --- a/testsuites/sptests/sp09/sp09.scn +++ b/testsuites/sptests/sp09/sp09.scn @@ -1,6 +1,8 @@ *** TEST 9 *** -INIT - rtems_task_create - RTEMS_INVALID_PRIORITY +INIT - rtems_task_create - priority of 0 - RTEMS_INVALID_PRIORITY +INIT - rtems_task_create - priority too high - RTEMS_INVALID_PRIORITY INIT - rtems_task_restart - RTEMS_INCORRECT_STATE +TA1 - rtems_task_is_suspended - RTEMS_INVALID_ID TA1 - rtems_task_delete - RTEMS_INVALID_ID TA1 - rtems_task_get_note - RTEMS_INVALID_ADDRESS TA1 - rtems_task_get_note - RTEMS_INVALID_NUMBER diff --git a/testsuites/sptests/sp28/init.c b/testsuites/sptests/sp28/init.c index 77009b14b1..05f819aadd 100644 --- a/testsuites/sptests/sp28/init.c +++ b/testsuites/sptests/sp28/init.c @@ -119,7 +119,7 @@ void test_errors(void) * task variable add error status codes */ puts( "task variable add - NULL pointer - RTEMS_INVALID_ADDRESS" ); - sc = rtems_task_variable_get(RTEMS_SELF, NULL, NULL ); + sc = rtems_task_variable_add(RTEMS_SELF, NULL, NULL ); fatal_directive_status( sc, RTEMS_INVALID_ADDRESS, "add NULL pointer" ); /* diff --git a/testsuites/sptests/sp62/init.c b/testsuites/sptests/sp62/init.c index e352de8464..0863b1d521 100644 --- a/testsuites/sptests/sp62/init.c +++ b/testsuites/sptests/sp62/init.c @@ -50,6 +50,7 @@ rtems_task Init( rtems_status_code sc; void *segment_address_1; intptr_t old_size; + size_t size; puts( "\n\n*** TEST 62 ***" ); @@ -104,10 +105,34 @@ rtems_task Init( if ( case_hit ) { puts( "Init - successfully resized and unblocked a task" ); - puts( "*** END OF TEST 62 ***" ); - } else + } else { puts( "Init - failed to resize and unblock a task" ); - + rtems_test_exit(0); + } + + /* + * Now resize and take all of memory so there is no need to + * process any blocked tasks waiting for memory. + */ + + size = sizeof(Region_Memory); + while (1) { + sc = rtems_region_resize_segment( + Region, segment_address_1, size, &old_size); + if ( sc == RTEMS_UNSATISFIED ) { + size --; + if ( size ) + continue; + } + directive_failed( sc, "rtems_region_resize_segment" ); + if ( sc == RTEMS_SUCCESSFUL ) + break; + + } + if ( sc == RTEMS_SUCCESSFUL && size != 0 ) + puts( "Init - resized to all of available memory" ); + + puts( "*** END OF TEST 62 ***" ); rtems_test_exit(0); } diff --git a/testsuites/sptests/sp62/sp62.scn b/testsuites/sptests/sp62/sp62.scn index a7dc9ee740..36a266bbaf 100644 --- a/testsuites/sptests/sp62/sp62.scn +++ b/testsuites/sptests/sp62/sp62.scn @@ -8,4 +8,5 @@ Blocker - rtems_region_get_segment - OK Init - sleep 1 second for Blocker to run again - OK Blocker - Got memory after resize Init - successfully resized and unblocked a task +Init - resized to all of available memory *** END OF TEST 62 *** diff --git a/testsuites/sptests/sp64/init.c b/testsuites/sptests/sp64/init.c index 6b6d6f2018..0238134a3e 100644 --- a/testsuites/sptests/sp64/init.c +++ b/testsuites/sptests/sp64/init.c @@ -144,7 +144,7 @@ rtems_task Init( assert( info.Free.number == start.Free.number ); #endif - puts( "*** END OF TEST 63 ***" ); + puts( "*** END OF TEST 64 ***" ); rtems_test_exit(0); } diff --git a/testsuites/sptests/sp64/sp64.scn b/testsuites/sptests/sp64/sp64.scn index f572f623d8..ff72fa984b 100644 --- a/testsuites/sptests/sp64/sp64.scn +++ b/testsuites/sptests/sp64/sp64.scn @@ -3,4 +3,4 @@ Allocate one region -- so second auto extends Init - rtems_workspace_get_information - OK Init - rtems_region_create - auto-extend - RTEMS_UNSATISFIED Init - rtems_region_delete - OK -*** END OF TEST 63 *** +*** END OF TEST 64 *** -- cgit v1.2.3