diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-09 16:58:04 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-09 16:58:04 +0000 |
commit | 0c5a8be8b2c9757379a1c33628942e95f9cd61ee (patch) | |
tree | e36a1a022191c686731a4a039354384a5ae0d4ab /testsuites/sptests/sp43 | |
parent | 2009-07-09 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-0c5a8be8b2c9757379a1c33628942e95f9cd61ee.tar.bz2 |
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.
Diffstat (limited to 'testsuites/sptests/sp43')
-rw-r--r-- | testsuites/sptests/sp43/init.c | 41 | ||||
-rw-r--r-- | testsuites/sptests/sp43/sp43.scn | 4 |
2 files changed, 44 insertions, 1 deletions
diff --git a/testsuites/sptests/sp43/init.c b/testsuites/sptests/sp43/init.c index a2fd1bd837..d3bc638f67 100644 --- a/testsuites/sptests/sp43/init.c +++ b/testsuites/sptests/sp43/init.c @@ -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 ); } diff --git a/testsuites/sptests/sp43/sp43.scn b/testsuites/sptests/sp43/sp43.scn index a27a45bcfe..fc42f2532b 100644 --- a/testsuites/sptests/sp43/sp43.scn +++ b/testsuites/sptests/sp43/sp43.scn @@ -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 *** |