From ec6a5a18c11d69c392527b1c17d7a5b3f56965b6 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 27 Jul 2010 21:25:02 +0000 Subject: 2010-07-27 Joel Sherrill * sp43/init.c, sp43/sp43.scn: Add code to exercise case where an API pointer is NULL when getting an object name. --- testsuites/sptests/ChangeLog | 5 +++++ testsuites/sptests/sp43/init.c | 18 ++++++++++++++++++ testsuites/sptests/sp43/sp43.scn | 1 + 3 files changed, 24 insertions(+) (limited to 'testsuites/sptests') diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog index a3f513db39..54e6e803fd 100644 --- a/testsuites/sptests/ChangeLog +++ b/testsuites/sptests/ChangeLog @@ -1,3 +1,8 @@ +2010-07-27 Joel Sherrill + + * sp43/init.c, sp43/sp43.scn: Add code to exercise case where an API + pointer is NULL when getting an object name. + 2010-07-27 Joel Sherrill * sp11/sp11.scn, sp11/task1.c: Add test case for receiving all events diff --git a/testsuites/sptests/sp43/init.c b/testsuites/sptests/sp43/init.c index 2bfc5df80c..dc3435db17 100644 --- a/testsuites/sptests/sp43/init.c +++ b/testsuites/sptests/sp43/init.c @@ -473,6 +473,24 @@ rtems_task Init( ); fatal_directive_status( sc, RTEMS_INVALID_ID, "rtems_semaphore_obtain" ); + /* + * Invalid POSIX API pointer on get name + */ + { + void *tmp; + tmp = _Objects_Information_table[OBJECTS_POSIX_API]; + _Objects_Information_table[OBJECTS_POSIX_API] = NULL; + + puts( "rtems_object_get_classic_name - bad API pointer - INVALID_ID" ); + sc = rtems_object_get_classic_name( + rtems_build_id( OBJECTS_POSIX_API, OBJECTS_POSIX_THREADS, 1, 1 ), + &tmpName + ); + fatal_directive_status( sc, RTEMS_INVALID_ID, "object_get_classic_name" ); + + _Objects_Information_table[OBJECTS_POSIX_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 4b496fe051..37c38026e1 100644 --- a/testsuites/sptests/sp43/sp43.scn +++ b/testsuites/sptests/sp43/sp43.scn @@ -85,4 +85,5 @@ 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 rtems_semaphore_obtain - good but uncreated ID - INVALID_ID - OK +rtems_object_get_classic_name - bad API pointer - INVALID_ID *** END OF TEST 43 *** -- cgit v1.2.3