Changeset 13adea0 in rtems


Ignore:
Timestamp:
08/09/96 19:55:04 (27 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
b9444fb9
Parents:
c03aeaf
Message:

added test cases for EINVAL cases in pthread_mutexattr_destroy

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/tests/psxtests/psx05/init.c

    rc03aeaf r13adea0  
    7878  int                  status;
    7979  pthread_mutexattr_t  attr;
     80  pthread_mutexattr_t  destroyed_attr;
    8081  struct timespec      times;
    8182  struct sched_param   param;
     
    9596  printf( "Init's ID is 0x%08x\n", Init_id );
    9697 
    97   /* basic checkout of mutex attributes */
     98  /* tes pthread_mutex_attr_init */
    9899
    99100  puts( "Init: pthread_mutexattr_init - EINVAL (NULL attr)" );
     
    106107
    107108  Print_mutexattr( "Init: ", &attr );
     109
     110  /* create an "uninitialized" attribute structure */
     111
     112  status = pthread_mutexattr_init( &destroyed_attr );
     113  assert( !status );
     114
     115  puts( "Init: pthread_mutexattr_destroy - SUCCESSFUL" );
     116  status = pthread_mutexattr_destroy( &destroyed_attr );
     117  assert( !status );
     118
     119  puts( "Init: pthread_mutexattr_destroy - EINVAL (NULL attr)" );
     120  status = pthread_mutexattr_destroy( NULL );
     121  assert( status == EINVAL );
     122
     123  puts( "Init: pthread_mutexattr_destroy - EINVAL (not initialized)" );
     124  status = pthread_mutexattr_destroy( &destroyed_attr );
     125  assert( status == EINVAL );
     126
     127  /* change the attributes structure */
    108128
    109129  puts( "Init: Changing mutex attributes" );
  • testsuites/psxtests/psx05/init.c

    rc03aeaf r13adea0  
    7878  int                  status;
    7979  pthread_mutexattr_t  attr;
     80  pthread_mutexattr_t  destroyed_attr;
    8081  struct timespec      times;
    8182  struct sched_param   param;
     
    9596  printf( "Init's ID is 0x%08x\n", Init_id );
    9697 
    97   /* basic checkout of mutex attributes */
     98  /* tes pthread_mutex_attr_init */
    9899
    99100  puts( "Init: pthread_mutexattr_init - EINVAL (NULL attr)" );
     
    106107
    107108  Print_mutexattr( "Init: ", &attr );
     109
     110  /* create an "uninitialized" attribute structure */
     111
     112  status = pthread_mutexattr_init( &destroyed_attr );
     113  assert( !status );
     114
     115  puts( "Init: pthread_mutexattr_destroy - SUCCESSFUL" );
     116  status = pthread_mutexattr_destroy( &destroyed_attr );
     117  assert( !status );
     118
     119  puts( "Init: pthread_mutexattr_destroy - EINVAL (NULL attr)" );
     120  status = pthread_mutexattr_destroy( NULL );
     121  assert( status == EINVAL );
     122
     123  puts( "Init: pthread_mutexattr_destroy - EINVAL (not initialized)" );
     124  status = pthread_mutexattr_destroy( &destroyed_attr );
     125  assert( status == EINVAL );
     126
     127  /* change the attributes structure */
    108128
    109129  puts( "Init: Changing mutex attributes" );
Note: See TracChangeset for help on using the changeset viewer.