diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-07-16 08:31:05 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-07-16 08:58:11 +0200 |
commit | 6ec7f2102e6517c60a70acd1421cbc4106495513 (patch) | |
tree | 41ceedbff1e80abf239f32de5fd3d9e85bc9163c /testsuites/psxtests/psxcond01 | |
parent | jffs2: Add README (diff) | |
download | rtems-6ec7f2102e6517c60a70acd1421cbc4106495513.tar.bz2 |
posix: Fix rwlock auto initialization
Add more test cases.
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" ); |