forked from Imagelibrary/rtems
posix: Delete key/value if value is set to NULL
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user