From 7d414c33ae972ceb2b73b52f47e4bc462f0c8e0b Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 18 Aug 2009 15:32:49 +0000 Subject: [PATCH] 2009-08-18 Joel Sherrill * spobjgetnext/init.c, spobjgetnext/spobjgetnext.scn: Add error cases for various null parameters. --- testsuites/sptests/ChangeLog | 5 +++++ testsuites/sptests/spobjgetnext/init.c | 21 +++++++++++++++++-- .../sptests/spobjgetnext/spobjgetnext.scn | 7 +++++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog index ec00527e38..79db688ce5 100644 --- a/testsuites/sptests/ChangeLog +++ b/testsuites/sptests/ChangeLog @@ -1,3 +1,8 @@ +2009-08-18 Joel Sherrill + + * spobjgetnext/init.c, spobjgetnext/spobjgetnext.scn: Add error cases + for various null parameters. + 2009-08-18 Joel Sherrill * sp16/sp16.scn, sp16/task1.c: Fix typo. diff --git a/testsuites/sptests/spobjgetnext/init.c b/testsuites/sptests/spobjgetnext/init.c index eaabffcf65..39535a6fc5 100644 --- a/testsuites/sptests/spobjgetnext/init.c +++ b/testsuites/sptests/spobjgetnext/init.c @@ -63,20 +63,37 @@ rtems_task Init( rtems_status_code status; rtems_id main_task; int count; + Objects_Control *o; + Objects_Locations location; + Objects_Id id; + Objects_Information *info; puts( "\n\n*** TEST OBJECT GET NEXT ***" ); + info = &_RTEMS_tasks_Information; main_task = rtems_task_self(); + puts( "Init - _Objects_Get_next - NULL object information" ); + o = _Objects_Get_next( NULL, main_task, &location, &id ); + assert( o == NULL ); + + puts( "Init - _Objects_Get_next - NULL location" ); + o = _Objects_Get_next( info, main_task, NULL, &id ); + assert( o == NULL ); + + puts( "Init - _Objects_Get_next - NULL id" ); + o = _Objects_Get_next( info, main_task, &location, NULL ); + assert( o == NULL ); + /* XXX push the three NULL error cases */ /* simple case of only all tasks in the system, starting at initial */ - count = scan_objects( &_RTEMS_tasks_Information, OBJECTS_ID_INITIAL_INDEX ); + count = scan_objects( info, OBJECTS_ID_INITIAL_INDEX ); printf( "%d RTEMS Task%s\n", count, ((count == 1) ? "" : "s") ); assert( count == 1 ); /* simple case of only 1 task in the system, starting at that task */ - count = scan_objects( &_RTEMS_tasks_Information, main_task ); + count = scan_objects( info, main_task ); printf( "%d RTEMS Task%s\n", count, ((count == 1) ? "" : "s") ); assert( count == 1 ); diff --git a/testsuites/sptests/spobjgetnext/spobjgetnext.scn b/testsuites/sptests/spobjgetnext/spobjgetnext.scn index e69de29bb2..b5e7b115df 100644 --- a/testsuites/sptests/spobjgetnext/spobjgetnext.scn +++ b/testsuites/sptests/spobjgetnext/spobjgetnext.scn @@ -0,0 +1,7 @@ +*** TEST OBJECT GET NEXT *** +Init - _Objects_Get_next - NULL object information +Init - _Objects_Get_next - NULL location +Init - _Objects_Get_next - NULL id +1 RTEMS Task +1 RTEMS Task +*** END OF TEST OBJECT GET NEXT ***