2009-07-09 Joel Sherrill <joel.sherrill@OARcorp.com>

* sp43/init.c, sp43/sp43.scn: Add test of having the object class
	pointer being null. This does not happen naturally at this time so
	force the point.
This commit is contained in:
Joel Sherrill
2009-07-09 16:58:04 +00:00
parent 66abaa1e20
commit 0c5a8be8b2
3 changed files with 49 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
2009-07-09 Joel Sherrill <joel.sherrill@OARcorp.com>
* sp43/init.c, sp43/sp43.scn: Add test of having the object class
pointer being null. This does not happen naturally at this time so
force the point.
2009-07-08 Joel Sherrill <joel.sherrill@OARcorp.com>
* sp12/sp12.scn: Update screen to reflect priority changes from long

View File

@@ -11,6 +11,7 @@
* $Id$
*/
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
#define CONFIGURE_INIT
#include "system.h"
@@ -399,7 +400,45 @@ rtems_task Init(
directive_failed( status, "rtems_object_get_class_information" );
print_class_info( OBJECTS_CLASSIC_API, OBJECTS_RTEMS_TIMERS, &info );
/*
* Ugly hack to force a weird error
*/
{
rtems_status_code sc;
rtems_task_priority old_priority;
void *tmp;
int class;
int api;
class = OBJECTS_INTERNAL_API;
api = OBJECTS_INTERNAL_THREADS;
puts( "rtems_task_set_priority - use valid Idle thread id" );
sc = rtems_task_set_priority(
rtems_build_id( class, api, 1, 1 ),
RTEMS_CURRENT_PRIORITY,
&old_priority
);
directive_failed( sc, "rtems_task_set_priority" );
/* destroy class pointer */
puts( "rtems_task_set_priority - clobber internal thread class info" );
tmp = _Objects_Information_table[ class ][ api ];
_Objects_Information_table[ class ][ api ] = NULL;
puts( "rtems_task_set_priority - use valid Idle thread id again" );
sc = rtems_task_set_priority(
rtems_build_id( class, api, 1, 1 ),
RTEMS_CURRENT_PRIORITY,
&old_priority
);
fatal_directive_status( sc, RTEMS_INVALID_ID, "rtems_task_set_priority" );
/* restore pointer */
puts( "rtems_task_set_priority - restore internal thread class info" );
_Objects_Information_table[ class ][ api ] = tmp;
}
puts( "*** END OF TEST 43 ***" );
rtems_test_exit( 0 );
}

View File

@@ -83,4 +83,8 @@ Classic API Timer Information
minimum id : 0x12010001 maximum id: 0x12010001
maximum : 1 available : 1
auto_extend : no
rtems_task_set_priority - use valid Idle thread id
rtems_task_set_priority - clobber internal thread class info
rtems_task_set_priority - use valid Idle thread id again
rtems_task_set_priority - restore internal thread class info
*** END OF TEST 43 ***