summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-05-22 18:10:07 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-05-22 18:10:07 +0000
commitef6d53b92d1da7ad1d5bbaa569c48fb97bef26a6 (patch)
tree6e2c4f2b77774e058e60506ca6e76640c0aeb842 /testsuites
parent2009-05-21 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-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')
-rw-r--r--testsuites/sptests/ChangeLog4
-rw-r--r--testsuites/sptests/sp51/init.c20
-rw-r--r--testsuites/sptests/sp51/sp51.scn6
3 files changed, 26 insertions, 4 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog
index 12b3aaab1e..b6e9b796cd 100644
--- a/testsuites/sptests/ChangeLog
+++ b/testsuites/sptests/ChangeLog
@@ -1,3 +1,7 @@
+2009-05-22 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * sp51/init.c, sp51/sp51.scn: Add more priority ceiling test cases.
+
2009-05-21 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1415/cpukit
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 );
diff --git a/testsuites/sptests/sp51/sp51.scn b/testsuites/sptests/sp51/sp51.scn
index e69de29bb2..9fe462288f 100644
--- a/testsuites/sptests/sp51/sp51.scn
+++ b/testsuites/sptests/sp51/sp51.scn
@@ -0,0 +1,6 @@
+*** TEST 51 ***
+Create semaphore - priority ceiling locked - violate ceiling
+Create semaphore - priority ceiling unlocked
+Obtain semaphore -- violate ceiling
+Release semaphore we did not obtain
+*** END OF TEST 51 ***