diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-09-28 23:07:56 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-09-28 23:07:56 +0000 |
commit | f55f60591cdc27bf14eaa455b661420b2a4fb682 (patch) | |
tree | cacc6e50c34131a01e9d410e82130482c30f2028 /testsuites/sptests/sp09/screen01.c | |
parent | 2009-09-28 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-f55f60591cdc27bf14eaa455b661420b2a4fb682.tar.bz2 |
2009-09-28 Joel Sherrill <joel.sherrill@OARcorp.com>
* sp09/screen01.c, sp09/screen02.c, sp09/screen03.c, sp09/screen05.c,
sp09/screen09.c, sp09/screen14.c, sp09/sp09.scn, sp28/init.c,
sp28/sp28.scn, sp43/init.c: Add more error cases uncovered by uC5282
coverage runs.
Diffstat (limited to 'testsuites/sptests/sp09/screen01.c')
-rw-r--r-- | testsuites/sptests/sp09/screen01.c | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/testsuites/sptests/sp09/screen01.c b/testsuites/sptests/sp09/screen01.c index 7edd55ef2d..25b41eb5eb 100644 --- a/testsuites/sptests/sp09/screen01.c +++ b/testsuites/sptests/sp09/screen01.c @@ -34,6 +34,16 @@ void Screen1() ); puts( "TA1 - rtems_task_delete - RTEMS_INVALID_ID" ); + /* NULL return */ + status = rtems_task_get_note( RTEMS_SELF, RTEMS_NOTEPAD_FIRST, NULL ); + fatal_directive_status( + status, + RTEMS_INVALID_ADDRESS, + "rtems_task_get_note with NULL param" + ); + puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_ADDRESS" ); + + /* note too high */ status = rtems_task_get_note( RTEMS_SELF, 100, ¬epad_value ); fatal_directive_status( status, @@ -42,6 +52,7 @@ void Screen1() ); puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_NUMBER" ); + /* bad Id */ status = rtems_task_get_note( 100, RTEMS_NOTEPAD_LAST, ¬epad_value ); fatal_directive_status( status, @@ -50,6 +61,7 @@ void Screen1() ); puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_ID" ); + /* unused Id so invalid now */ status = rtems_task_get_note( _RTEMS_tasks_Information.maximum_id, RTEMS_NOTEPAD_LAST, @@ -90,7 +102,9 @@ void Screen1() RTEMS_NOTEPAD_LAST, ¬epad_value ); - fatal_directive_status( status, RTEMS_INVALID_ID, + fatal_directive_status( + status, + RTEMS_INVALID_ID, "rtems_task_get_note with no tasks in API" ); @@ -103,6 +117,16 @@ void Screen1() "rtems_object_get_classic_name with no tasks in API" ); + /* NULL param */ + status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, NULL ); + fatal_directive_status( + status, + RTEMS_INVALID_ADDRESS, + "rtems_task_ident NULL param" + ); + puts( "TA1 - rtems_task_ident - RTEMS_INVALID_ADDRESS" ); + + /* OK */ status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &self_id ); directive_failed( status, "rtems_task_ident of self" ); if ( self_id != Task_id[ 1 ] ) { @@ -170,6 +194,16 @@ void Screen1() ); puts( "TA1 - rtems_task_resume - RTEMS_INCORRECT_STATE" ); + /* NULL param */ + status = rtems_task_set_priority( RTEMS_SELF, RTEMS_CURRENT_PRIORITY, NULL ); + fatal_directive_status( + status, + RTEMS_INVALID_ADDRESS, + "rtems_task_set_priority with NULL param" + ); + puts( "TA1 - rtems_task_set_priority - RTEMS_INVALID_ADDRESS" ); + + /* bad priority */ status = rtems_task_set_priority( RTEMS_SELF, 512, &previous_priority ); fatal_directive_status( status, @@ -178,6 +212,7 @@ void Screen1() ); puts( "TA1 - rtems_task_set_priority - RTEMS_INVALID_PRIORITY" ); + /* bad Id */ status = rtems_task_set_priority( 100, 8, &previous_priority ); fatal_directive_status( status, @@ -214,7 +249,8 @@ void Screen1() ); puts( "TA1 - rtems_task_start - RTEMS_INVALID_ID" ); - status = rtems_task_start( 0, Task_1, 0 ); + /* already started */ + status = rtems_task_start( RTEMS_SELF, Task_1, 0 ); fatal_directive_status( status, RTEMS_INCORRECT_STATE, @@ -222,6 +258,7 @@ void Screen1() ); puts( "TA1 - rtems_task_start - RTEMS_INCORRECT_STATE" ); + /* bad Id */ status = rtems_task_suspend( 100 ); fatal_directive_status( status, @@ -229,4 +266,13 @@ void Screen1() "rtems_task_suspend with illegal id" ); puts( "TA1 - rtems_task_suspend - RTEMS_INVALID_ID" ); + + /* NULL param */ + status = rtems_task_mode( RTEMS_SELF, 0, NULL ); + fatal_directive_status( + status, + RTEMS_INVALID_ADDRESS, + "rtems_task_mode with NULL param" + ); + puts( "TA1 - rtems_task_mode - RTEMS_INVALID_ADDRESS" ); } |