summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psxkey02
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-12-12 13:16:11 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-12-12 13:16:25 +0100
commit172e953147da1d82bf5a6746b2fe6112a9509ad7 (patch)
treeac343e5f8c6eaee52f162c86d0966924823e3514 /testsuites/psxtests/psxkey02
parentposix: Simplify _POSIX_Keys_Find() (diff)
downloadrtems-172e953147da1d82bf5a6746b2fe6112a9509ad7.tar.bz2
posix: Delete key/value if value is set to NULL
Diffstat (limited to 'testsuites/psxtests/psxkey02')
-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 );