summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psxkey02/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites/psxtests/psxkey02/init.c')
-rw-r--r--testsuites/psxtests/psxkey02/init.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/testsuites/psxtests/psxkey02/init.c b/testsuites/psxtests/psxkey02/init.c
index 5734db76a5..23a392b004 100644
--- a/testsuites/psxtests/psxkey02/init.c
+++ b/testsuites/psxtests/psxkey02/init.c
@@ -30,6 +30,7 @@ rtems_task Init(rtems_task_argument ignored)
bool ok;
rtems_resource_snapshot snapshot;
void *greedy;
+ void *value;
TEST_BEGIN();
@@ -40,6 +41,24 @@ rtems_task Init(rtems_task_argument ignored)
eno = pthread_key_create( &key1, NULL );
rtems_test_assert( eno == 0 );
+ eno = pthread_setspecific( key1, (void *) 1 );
+ rtems_test_assert( eno == 0 );
+
+ value = pthread_getspecific( key1 );
+ rtems_test_assert( value == (void *) 1 );
+
+ eno = pthread_setspecific( key1, NULL );
+ rtems_test_assert( eno == 0 );
+
+ value = pthread_getspecific( key1 );
+ rtems_test_assert( value == NULL );
+
+ eno = pthread_setspecific( key1, NULL );
+ rtems_test_assert( eno == 0 );
+
+ value = pthread_getspecific( key1 );
+ rtems_test_assert( value == NULL );
+
puts( "Init - pthread_key_create - EAGAIN" );
eno = pthread_key_create( &key2, NULL );
rtems_test_assert( eno == EAGAIN );