2009-05-22 Joel Sherrill <joel.sherrill@oarcorp.com>

* sp51/init.c, sp51/sp51.scn: Add more priority ceiling test cases.
This commit is contained in:
Joel Sherrill
2009-05-22 18:10:07 +00:00
parent e379e962b3
commit ef6d53b92d
3 changed files with 26 additions and 4 deletions

View File

@@ -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> 2009-05-21 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1415/cpukit PR 1415/cpukit

View File

@@ -20,7 +20,17 @@ rtems_task Init(
puts( "\n\n*** TEST 51 ***" ); 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( sc = rtems_semaphore_create(
rtems_build_name( 'S', 'E', 'M', '1' ), rtems_build_name( 'S', 'E', 'M', '1' ),
1, 1,
@@ -32,12 +42,14 @@ rtems_task Init(
puts( "Obtain semaphore -- violate ceiling" ); puts( "Obtain semaphore -- violate ceiling" );
sc = rtems_semaphore_obtain( mutex, RTEMS_DEFAULT_OPTIONS, 0 ); 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 ); sc = rtems_semaphore_release( mutex );
fatal_directive_status( fatal_directive_status(
sc, RTEMS_NOT_OWNER_OF_RESOURCE, "rtems_semaphore_release" ); sc, RTEMS_SUCCESSFUL, "rtems_semaphore_release" );
puts( "*** END OF TEST 51 ***" ); puts( "*** END OF TEST 51 ***" );
rtems_test_exit( 0 ); rtems_test_exit( 0 );

View File

@@ -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 ***