summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psx05
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-28 13:44:58 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-28 13:44:58 +0000
commit42d57c7ac6523a3cdd9134aa01d7a55c0e4269d5 (patch)
treefdb809e935a551032b4919495d1ab65273d3c24c /testsuites/psxtests/psx05
parent2009-07-27 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-42d57c7ac6523a3cdd9134aa01d7a55c0e4269d5.tar.bz2
2009-07-28 Santosh G Vattam <vattam.santosh@gmail.com>
* psx05/init.c, psx05/psx05.scn: Add test for pthread_mutex_timedlock with timeout in the past.
Diffstat (limited to 'testsuites/psxtests/psx05')
-rw-r--r--testsuites/psxtests/psx05/init.c10
-rw-r--r--testsuites/psxtests/psx05/psx05.scn1
2 files changed, 10 insertions, 1 deletions
diff --git a/testsuites/psxtests/psx05/init.c b/testsuites/psxtests/psx05/init.c
index e587a86e0e..4456516d18 100644
--- a/testsuites/psxtests/psx05/init.c
+++ b/testsuites/psxtests/psx05/init.c
@@ -415,6 +415,14 @@ void *POSIX_Init(
printf( "status = %d\n", status );
assert( status == ETIMEDOUT );
+ puts( "Init: pthread_mutex_timedlock - time out in the past" );
+ calculate_abstimeout( &times, -1, (TOD_NANOSECONDS_PER_SECOND / 2) );
+
+ status = pthread_mutex_timedlock( &Mutex_id, &times );
+ if ( status != EBUSY )
+ printf( "status = %d\n", status );
+ assert( status == EBUSY );
+
/* switch to idle */
puts( "Init: pthread_mutex_timedlock - EAGAIN (timeout)" );
@@ -577,7 +585,7 @@ void *POSIX_Init(
priority = sched_get_priority_max( SCHED_FIFO );
priority = (priority == 254) ? 200 : 13;
- printf( "Init: pthread_mutex_setprioceiling - new ceiling = %d", priority );
+ printf( "Init: pthread_mutex_setprioceiling - new ceiling = %d\n", priority );
status = pthread_mutex_setprioceiling( &Mutex2_id, priority, &old_ceiling );
assert( !status );
printf(
diff --git a/testsuites/psxtests/psx05/psx05.scn b/testsuites/psxtests/psx05/psx05.scn
index a0a7da50b1..a9d11a66e3 100644
--- a/testsuites/psxtests/psx05/psx05.scn
+++ b/testsuites/psxtests/psx05/psx05.scn
@@ -59,6 +59,7 @@ Init: pthread_mutex_unlock - EPERM (not owner)
Init: pthread_mutex_timedlock - time out in 1/2 second
Task: mutex acquired
Task: sleep for 2 seconds
+Init: pthread_mutex_timedlock - time out in the past
Init: pthread_mutex_timedlock - EAGAIN (timeout)
Init: pthread_mutex_init - SUCCESSFUL