From 6afc8dde54db48eb4c8ec91eb9e3e9b042c0dd02 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 7 Jul 2009 19:39:12 +0000 Subject: [PATCH] 2009-07-07 Joel Sherrill * sp09/screen01.c, sp09/sp09.scn: Add test for rtems_object_get_classic_name with invalid id. --- testsuites/sptests/ChangeLog | 5 +++++ testsuites/sptests/sp09/screen01.c | 15 ++++++++++++--- testsuites/sptests/sp09/sp09.scn | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog index 44e6520468..e02f0b2a95 100644 --- a/testsuites/sptests/ChangeLog +++ b/testsuites/sptests/ChangeLog @@ -1,3 +1,8 @@ +2009-07-07 Joel Sherrill + + * sp09/screen01.c, sp09/sp09.scn: Add test for + rtems_object_get_classic_name with invalid id. + 2009-07-07 Joel Sherrill * sp02/task1.c: Minor spacing. diff --git a/testsuites/sptests/sp09/screen01.c b/testsuites/sptests/sp09/screen01.c index 3de2811d8d..7edd55ef2d 100644 --- a/testsuites/sptests/sp09/screen01.c +++ b/testsuites/sptests/sp09/screen01.c @@ -6,7 +6,7 @@ * * Output parameters: NONE * - * COPYRIGHT (c) 1989-2008. + * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -20,7 +20,8 @@ void Screen1() { - uint32_t notepad_value; + uint32_t notepad_value; + rtems_name task_name; rtems_id self_id; rtems_task_priority previous_priority; rtems_status_code status; @@ -93,9 +94,17 @@ void Screen1() "rtems_task_get_note with no tasks in API" ); + puts( "TA1 - rtems_object_get_classic_name - bad ID" ); + status = rtems_object_get_classic_name( + rtems_build_id( OBJECTS_ITRON_API, OBJECTS_ITRON_TASKS, 1, 1 ), + &task_name + ); + fatal_directive_status( status, RTEMS_INVALID_ID, + "rtems_object_get_classic_name with no tasks in API" + ); + 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 ] ) { puts( "ERROR - rtems_task_ident - incorrect ID returned!" ); } diff --git a/testsuites/sptests/sp09/sp09.scn b/testsuites/sptests/sp09/sp09.scn index 9d0d807f03..44afce8015 100644 --- a/testsuites/sptests/sp09/sp09.scn +++ b/testsuites/sptests/sp09/sp09.scn @@ -6,6 +6,7 @@ TA1 - rtems_task_get_note - RTEMS_INVALID_NUMBER TA1 - rtems_task_get_note - RTEMS_INVALID_ID TA1 - rtems_task_get_note - RTEMS_INVALID_ID TA1 - rtems_task_get_note - RTEMS_INVALID_ID (no tasks in API) +TA1 - rtems_object_get_classic_name - bad ID TA1 - rtems_task_ident - current task RTEMS_SUCCESSFUL TA1 - rtems_task_ident - global RTEMS_INVALID_NAME TA1 - rtems_task_ident - local RTEMS_INVALID_NAME