diff options
Diffstat (limited to 'testsuites/psxtests/psxcond01')
-rw-r--r-- | testsuites/psxtests/psxcond01/init.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/testsuites/psxtests/psxcond01/init.c b/testsuites/psxtests/psxcond01/init.c index 69dc5458ca..4d21531c8a 100644 --- a/testsuites/psxtests/psxcond01/init.c +++ b/testsuites/psxtests/psxcond01/init.c @@ -51,6 +51,41 @@ void *BlockingThread( return NULL; } +static void test_cond_auto_initialization( void ) +{ + int eno; + + { + pthread_cond_t cond = PTHREAD_COND_INITIALIZER; + + eno = pthread_cond_destroy( &cond ); + rtems_test_assert( eno == 0 ); + + eno = pthread_cond_destroy( &cond ); + rtems_test_assert( eno == EINVAL ); + } + + { + pthread_cond_t cond = PTHREAD_COND_INITIALIZER; + + eno = pthread_cond_signal( &cond ); + rtems_test_assert( eno == 0 ); + + eno = pthread_cond_destroy( &cond ); + rtems_test_assert( eno == 0 ); + } + + { + pthread_cond_t cond = PTHREAD_COND_INITIALIZER; + + eno = pthread_cond_broadcast( &cond ); + rtems_test_assert( eno == 0 ); + + eno = pthread_cond_destroy( &cond ); + rtems_test_assert( eno == 0 ); + } +} + void *POSIX_Init( void *argument ) @@ -60,6 +95,8 @@ void *POSIX_Init( TEST_BEGIN(); + test_cond_auto_initialization(); + puts( "Init - pthread_mutex_init - Mutex1 - OK" ); sc = pthread_mutex_init( &Mutex1, NULL ); fatal_posix_service_status( sc, 0, "mutex1 create ok" ); |