summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psx05
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-10-12 00:07:16 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-10-12 00:07:16 +0000
commitf1887691cdea36127aef6011e579647867d55c73 (patch)
tree045473d8e48f75523eab6b846516ecf00f47bcbb /testsuites/psxtests/psx05
parent2009-10-11 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-f1887691cdea36127aef6011e579647867d55c73.tar.bz2
2009-10-11 Joel Sherrill <joel.sherrill@oarcorp.com>
* psx05/init.c, psx05/psx05.scn: Add test for bad mutex type.
Diffstat (limited to 'testsuites/psxtests/psx05')
-rw-r--r--testsuites/psxtests/psx05/init.c9
-rw-r--r--testsuites/psxtests/psx05/psx05.scn1
2 files changed, 10 insertions, 0 deletions
diff --git a/testsuites/psxtests/psx05/init.c b/testsuites/psxtests/psx05/init.c
index a36dc9240a..2194f8873d 100644
--- a/testsuites/psxtests/psx05/init.c
+++ b/testsuites/psxtests/psx05/init.c
@@ -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" );
diff --git a/testsuites/psxtests/psx05/psx05.scn b/testsuites/psxtests/psx05/psx05.scn
index 58351cccd7..8fa3e23fcd 100644
--- a/testsuites/psxtests/psx05/psx05.scn
+++ b/testsuites/psxtests/psx05/psx05.scn
@@ -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