forked from Imagelibrary/rtems
2009-08-18 Joel Sherrill <joel.sherrill@OARcorp.com>
* spobjgetnext/init.c, spobjgetnext/spobjgetnext.scn: Add error cases for various null parameters.
This commit is contained in:
@@ -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 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user