Init: added condattr - destroy, init, set and get cases

This commit is contained in:
Mark Johannes
1996-08-09 18:28:21 +00:00
parent 66dfd0ba6e
commit 695dd0b64c
2 changed files with 12 additions and 10 deletions

View File

@@ -54,27 +54,27 @@ void *POSIX_Init(
status = pthread_condattr_setpshared( &attr, PTHREAD_PROCESS_PRIVATE ); status = pthread_condattr_setpshared( &attr, PTHREAD_PROCESS_PRIVATE );
assert( !status ); assert( !status );
puts( "Init: pthread_condattr_setpshared - EINVAL - attr" );
status = pthread_condattr_setpshared( NULL, PTHREAD_PROCESS_PRIVATE ); status = pthread_condattr_setpshared( NULL, PTHREAD_PROCESS_PRIVATE );
if ( status != EINVAL ) if ( status != EINVAL )
printf( "status = %d\n", status ); printf( "status = %d\n", status );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_condattr_setpshared - EINVAL - attr" );
puts( "Init: pthread_condattr_setpshared - EINVAL - pshared" );
status = pthread_condattr_setpshared( &attr, 0xFFFFFF ); status = pthread_condattr_setpshared( &attr, 0xFFFFFF );
if ( status != EINVAL ) if ( status != EINVAL )
printf( "status = %d\n", status ); printf( "status = %d\n", status );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_condattr_setpshared - EINVAL - pshared" );
status = pthread_condattr_getpshared( &attr, &pshared ); status = pthread_condattr_getpshared( &attr, &pshared );
assert( !status ); assert( !status );
printf( "Init: pthread_condattr_getpshared - %d", pshared ); printf( "Init: pthread_condattr_getpshared - %d\n", pshared );
puts( "Init: pthread_condattr_getpshared - EINVAL" );
status = pthread_condattr_getpshared( NULL, &pshared ); status = pthread_condattr_getpshared( NULL, &pshared );
if ( status != EINVAL ) if ( status != EINVAL )
printf( "status = %d\n", status ); printf( "status = %d\n", status );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_condattr_getpshared - EINVAL" );
Init_id = pthread_self(); Init_id = pthread_self();
printf( "Init: ID is 0x%08x\n", Init_id ); printf( "Init: ID is 0x%08x\n", Init_id );
@@ -88,7 +88,8 @@ void *POSIX_Init(
/* exit this thread */ /* exit this thread */
pthread_exit( NULL ); puts( "*** END OF POSIX TEST 5 ***" );
exit( 0 );
return NULL; /* just so the compiler thinks we returned something */ return NULL; /* just so the compiler thinks we returned something */
} }

View File

@@ -54,27 +54,27 @@ void *POSIX_Init(
status = pthread_condattr_setpshared( &attr, PTHREAD_PROCESS_PRIVATE ); status = pthread_condattr_setpshared( &attr, PTHREAD_PROCESS_PRIVATE );
assert( !status ); assert( !status );
puts( "Init: pthread_condattr_setpshared - EINVAL - attr" );
status = pthread_condattr_setpshared( NULL, PTHREAD_PROCESS_PRIVATE ); status = pthread_condattr_setpshared( NULL, PTHREAD_PROCESS_PRIVATE );
if ( status != EINVAL ) if ( status != EINVAL )
printf( "status = %d\n", status ); printf( "status = %d\n", status );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_condattr_setpshared - EINVAL - attr" );
puts( "Init: pthread_condattr_setpshared - EINVAL - pshared" );
status = pthread_condattr_setpshared( &attr, 0xFFFFFF ); status = pthread_condattr_setpshared( &attr, 0xFFFFFF );
if ( status != EINVAL ) if ( status != EINVAL )
printf( "status = %d\n", status ); printf( "status = %d\n", status );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_condattr_setpshared - EINVAL - pshared" );
status = pthread_condattr_getpshared( &attr, &pshared ); status = pthread_condattr_getpshared( &attr, &pshared );
assert( !status ); assert( !status );
printf( "Init: pthread_condattr_getpshared - %d", pshared ); printf( "Init: pthread_condattr_getpshared - %d\n", pshared );
puts( "Init: pthread_condattr_getpshared - EINVAL" );
status = pthread_condattr_getpshared( NULL, &pshared ); status = pthread_condattr_getpshared( NULL, &pshared );
if ( status != EINVAL ) if ( status != EINVAL )
printf( "status = %d\n", status ); printf( "status = %d\n", status );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_condattr_getpshared - EINVAL" );
Init_id = pthread_self(); Init_id = pthread_self();
printf( "Init: ID is 0x%08x\n", Init_id ); printf( "Init: ID is 0x%08x\n", Init_id );
@@ -88,7 +88,8 @@ void *POSIX_Init(
/* exit this thread */ /* exit this thread */
pthread_exit( NULL ); puts( "*** END OF POSIX TEST 5 ***" );
exit( 0 );
return NULL; /* just so the compiler thinks we returned something */ return NULL; /* just so the compiler thinks we returned something */
} }