diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-06-29 23:23:23 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-06-29 23:23:23 +0000 |
commit | 85e525aab8dc9b65aa078a6445c4377b379ea979 (patch) | |
tree | 8798a0df555e771f17062b982e15c81764148819 /testsuites/psxtests | |
parent | 2009-06-29 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-85e525aab8dc9b65aa078a6445c4377b379ea979.tar.bz2 |
2009-06-29 Joel Sherrill <joel.sherrill@oarcorp.com>
* psx05/init.c, psx05/psx05.scn: Add test case for process scope now
that the assert has been removed in the source.
Diffstat (limited to 'testsuites/psxtests')
-rw-r--r-- | testsuites/psxtests/ChangeLog | 5 | ||||
-rw-r--r-- | testsuites/psxtests/psx05/init.c | 15 | ||||
-rw-r--r-- | testsuites/psxtests/psx05/psx05.scn | 3 |
3 files changed, 23 insertions, 0 deletions
diff --git a/testsuites/psxtests/ChangeLog b/testsuites/psxtests/ChangeLog index 40ec6cdb13..3bc9dc45e6 100644 --- a/testsuites/psxtests/ChangeLog +++ b/testsuites/psxtests/ChangeLog @@ -1,3 +1,8 @@ +2009-06-29 Joel Sherrill <joel.sherrill@oarcorp.com> + + * psx05/init.c, psx05/psx05.scn: Add test case for process scope now + that the assert has been removed in the source. + 2009-06-18 Joel Sherrill <joel.sherrill@OARcorp.com> * psxstat/psxstat.scn, psxstat/test.c: Disable test for error on wrong diff --git a/testsuites/psxtests/psx05/init.c b/testsuites/psxtests/psx05/init.c index 1cf47aa800..8dcda85802 100644 --- a/testsuites/psxtests/psx05/init.c +++ b/testsuites/psxtests/psx05/init.c @@ -280,6 +280,21 @@ void *POSIX_Init( status = pthread_mutex_init( &Mutex_id, &attr ); assert( status == EINVAL ); + /* must get around various error checks before checking bad scope */ + puts( "Init: Resetting mutex attributes" ); + status = pthread_mutexattr_init( &attr ); + assert( !status ); + + puts( "Init: pthread_mutex_init - ENOSYS (process wide scope)" ); + attr.process_shared = PTHREAD_PROCESS_SHARED; + status = pthread_mutex_init( &Mutex_id, &attr ); + assert( status == ENOSYS ); + + puts( "Init: pthread_mutex_init - EINVAL (invalid scope)" ); + attr.process_shared = -1; + status = pthread_mutex_init( &Mutex_id, &attr ); + assert( status == EINVAL ); + /* now set up for a success pthread_mutex_init */ puts( "Init: Resetting mutex attributes" ); diff --git a/testsuites/psxtests/psx05/psx05.scn b/testsuites/psxtests/psx05/psx05.scn index bc93da60b8..65c72a688b 100644 --- a/testsuites/psxtests/psx05/psx05.scn +++ b/testsuites/psxtests/psx05/psx05.scn @@ -30,6 +30,9 @@ Init: pthread_mutex_init - EINVAL (not initialized attr) Init: pthread_mutex_init - EINVAL (bad protocol) Init: pthread_mutex_init - EINVAL (bad priority ceiling) Init: Resetting mutex attributes +Init: pthread_mutex_init - ENOSYS (process wide scope) +Init: pthread_mutex_init - EINVAL (invalid scope) +Init: Resetting mutex attributes Init: Changing mutex attributes Init: mutex protocol is (1) -- PTHREAD_PRIO_INHERIT Init: mutex priority ceiling is 128 |