summaryrefslogtreecommitdiffstats
path: root/c/src/tests/psxtests/psx06
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1996-08-09 17:44:04 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1996-08-09 17:44:04 +0000
commit66dfd0ba6ef17f1635f33082e92dde7f20fd1b13 (patch)
treee04c8449098437656902451606898c2d17dd2fbd /c/src/tests/psxtests/psx06
parentmerged remote object id and invalid id error cases. (diff)
downloadrtems-66dfd0ba6ef17f1635f33082e92dde7f20fd1b13.tar.bz2
added test cases for invalid key ids
Diffstat (limited to 'c/src/tests/psxtests/psx06')
-rw-r--r--c/src/tests/psxtests/psx06/init.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/c/src/tests/psxtests/psx06/init.c b/c/src/tests/psxtests/psx06/init.c
index c26d51e814..f35bcbb926 100644
--- a/c/src/tests/psxtests/psx06/init.c
+++ b/c/src/tests/psxtests/psx06/init.c
@@ -61,7 +61,7 @@ void *POSIX_Init(
empty_line();
Destructor_invoked = 0;
- puts( "Init: Creating a key" );
+ puts( "Init: pthread_key_create - SUCCESSFUL" );
status = pthread_key_create( &Key_id, Key_destructor );
if ( status )
printf( "status = %d\n", status );
@@ -69,7 +69,21 @@ void *POSIX_Init(
printf( "Destructor invoked %d times\n", Destructor_invoked );
+ puts( "Init: pthread_key_create - EAGAIN (too many keys)" );
+ status = pthread_key_create( &Key_id, Key_destructor );
+ assert( status == EAGAIN );
+
+ puts( "Init: pthread_setspecific - EINVAL (invalid key)" );
+ status = pthread_setspecific( -1, &Data_array[ 0 ] );
+ assert( status == EINVAL );
+
+ puts( "Init: pthread_getspecific - EINVAL (invalid key)" );
+ key_data = pthread_getspecific( -1 );
+ assert( !key_data );
+ puts( "Init: pthread_key_delete - EINVAL (invalid key)" );
+ status = pthread_key_delete( -1 );
+ assert( status == EINVAL );
printf( "Init: Setting the key to %d\n", 0 );
status = pthread_setspecific( Key_id, &Data_array[ 0 ] );
@@ -92,7 +106,7 @@ void *POSIX_Init(
/* delete the key */
- puts( "Init: Deleting a key" );
+ puts( "Init: pthread_key_delete - SUCCESSFUL" );
status = pthread_key_delete( Key_id );
if ( status )
printf( "status = %d\n", status );