2009-10-11 Joel Sherrill <joel.sherrill@oarcorp.com>

* psx05/init.c, psx05/psx05.scn: Add test for bad mutex type.
This commit is contained in:
Joel Sherrill
2009-10-12 00:07:16 +00:00
parent a3a9a2d0ef
commit f1887691cd
3 changed files with 14 additions and 0 deletions

View File

@@ -1,3 +1,7 @@
2009-10-11 Joel Sherrill <joel.sherrill@oarcorp.com>
* psx05/init.c, psx05/psx05.scn: Add test for bad mutex type.
2009-10-11 Joel Sherrill <joel.sherrill@oarcorp.com>
* psxcleanup/system.h: Fix typo.

View File

@@ -295,6 +295,15 @@ void *POSIX_Init(
status = pthread_mutex_init( &Mutex_id, &attr );
assert( status == EINVAL );
/* bad kind */
status = pthread_mutexattr_init( &attr );
assert( !status );
puts( "Init: pthread_mutex_init - EINVAL (invalid type)" );
attr.type = -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" );

View File

@@ -36,6 +36,7 @@ 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: pthread_mutex_init - EINVAL (invalid type)
Init: Resetting mutex attributes
Init: Changing mutex attributes
Init: mutex protocol is (1) -- PTHREAD_PRIO_INHERIT