diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-05-22 18:10:07 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-05-22 18:10:07 +0000 |
commit | ef6d53b92d1da7ad1d5bbaa569c48fb97bef26a6 (patch) | |
tree | 6e2c4f2b77774e058e60506ca6e76640c0aeb842 /testsuites/sptests/sp51/init.c | |
parent | 2009-05-21 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-ef6d53b92d1da7ad1d5bbaa569c48fb97bef26a6.tar.bz2 |
2009-05-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* sp51/init.c, sp51/sp51.scn: Add more priority ceiling test cases.
Diffstat (limited to 'testsuites/sptests/sp51/init.c')
-rw-r--r-- | testsuites/sptests/sp51/init.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/testsuites/sptests/sp51/init.c b/testsuites/sptests/sp51/init.c index ecb2779808..7a09dea1f6 100644 --- a/testsuites/sptests/sp51/init.c +++ b/testsuites/sptests/sp51/init.c @@ -20,7 +20,17 @@ rtems_task Init( puts( "\n\n*** TEST 51 ***" ); - puts( "Create semaphore" ); + puts( "Create semaphore - priority ceiling locked - violate ceiling" ); + sc = rtems_semaphore_create( + rtems_build_name( 'S', 'E', 'M', '1' ), + 0, + RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY_CEILING | RTEMS_PRIORITY, + (RTEMS_MAXIMUM_PRIORITY - 4u), + &mutex + ); + fatal_directive_status(sc, RTEMS_INVALID_PRIORITY, "rtems_semaphore_create"); + + puts( "Create semaphore - priority ceiling unlocked" ); sc = rtems_semaphore_create( rtems_build_name( 'S', 'E', 'M', '1' ), 1, @@ -32,12 +42,14 @@ rtems_task Init( puts( "Obtain semaphore -- violate ceiling" ); sc = rtems_semaphore_obtain( mutex, RTEMS_DEFAULT_OPTIONS, 0 ); - fatal_directive_status( sc, RTEMS_INTERNAL_ERROR, "rtems_semaphore_obtain" ); + fatal_directive_status( + sc, RTEMS_INVALID_PRIORITY, "rtems_semaphore_obtain" ); - puts( "Release semaphore we did not obtain-- violate ceiling" ); + /* This returns successful because RTEMS eats the unneeded unlock */ + puts( "Release semaphore we did not obtain" ); sc = rtems_semaphore_release( mutex ); fatal_directive_status( - sc, RTEMS_NOT_OWNER_OF_RESOURCE, "rtems_semaphore_release" ); + sc, RTEMS_SUCCESSFUL, "rtems_semaphore_release" ); puts( "*** END OF TEST 51 ***" ); rtems_test_exit( 0 ); |