forked from Imagelibrary/rtems
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:
@@ -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
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 ***
|
||||
|
||||
Reference in New Issue
Block a user