From 85e525aab8dc9b65aa078a6445c4377b379ea979 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 29 Jun 2009 23:23:23 +0000 Subject: 2009-06-29 Joel Sherrill * psx05/init.c, psx05/psx05.scn: Add test case for process scope now that the assert has been removed in the source. --- testsuites/psxtests/ChangeLog | 5 +++++ testsuites/psxtests/psx05/init.c | 15 +++++++++++++++ testsuites/psxtests/psx05/psx05.scn | 3 +++ 3 files changed, 23 insertions(+) (limited to 'testsuites/psxtests') 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 + + * 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 * 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 -- cgit v1.2.3