diff options
Diffstat (limited to 'testsuites/psxtests/psx06')
-rw-r--r-- | testsuites/psxtests/psx06/init.c | 121 | ||||
-rw-r--r-- | testsuites/psxtests/psx06/psx06.scn | 21 | ||||
-rw-r--r-- | testsuites/psxtests/psx06/system.h | 61 | ||||
-rw-r--r-- | testsuites/psxtests/psx06/task.c | 51 | ||||
-rw-r--r-- | testsuites/psxtests/psx06/task2.c | 52 |
5 files changed, 0 insertions, 306 deletions
diff --git a/testsuites/psxtests/psx06/init.c b/testsuites/psxtests/psx06/init.c deleted file mode 100644 index f35bcbb926..0000000000 --- a/testsuites/psxtests/psx06/init.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - * $Id$ - */ - -#define CONFIGURE_INIT -#include "system.h" -#include <errno.h> - -void Key_destructor( - void *key_data -) -{ - Destructor_invoked++; - - /* - * This checks out that we only run the destructor multiple times - * when the key data is non null. - */ - - if ( Destructor_invoked == 5 ) - (void) pthread_setspecific( Key_id, NULL ); -} - -void *POSIX_Init( - void *argument -) -{ - int status; - unsigned int remaining; - rtems_unsigned32 *key_data; - - puts( "\n\n*** POSIX TEST 6 ***" ); - - /* set the time of day, and print our buffer in multiple ways */ - - set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 ); - - /* get id of this thread */ - - Init_id = pthread_self(); - printf( "Init's ID is 0x%08x\n", Init_id ); - - /* create a couple of threads */ - - status = pthread_create( &Task_id, NULL, Task_1, NULL ); - assert( !status ); - - status = pthread_create( &Task2_id, NULL, Task_2, NULL ); - assert( !status ); - - /* create a key */ - - empty_line(); - - Destructor_invoked = 0; - puts( "Init: pthread_key_create - SUCCESSFUL" ); - status = pthread_key_create( &Key_id, Key_destructor ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - printf( "Destructor invoked %d times\n", Destructor_invoked ); - - puts( "Init: pthread_key_create - EAGAIN (too many keys)" ); - status = pthread_key_create( &Key_id, Key_destructor ); - assert( status == EAGAIN ); - - puts( "Init: pthread_setspecific - EINVAL (invalid key)" ); - status = pthread_setspecific( -1, &Data_array[ 0 ] ); - assert( status == EINVAL ); - - puts( "Init: pthread_getspecific - EINVAL (invalid key)" ); - key_data = pthread_getspecific( -1 ); - assert( !key_data ); - - puts( "Init: pthread_key_delete - EINVAL (invalid key)" ); - status = pthread_key_delete( -1 ); - assert( status == EINVAL ); - - printf( "Init: Setting the key to %d\n", 0 ); - status = pthread_setspecific( Key_id, &Data_array[ 0 ] ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - /* switch to task 1 */ - - key_data = pthread_getspecific( Key_id ); - printf( "Init: Got the key value of %d\n", - (rtems_unsigned32 *)key_data - Data_array ); - - remaining = sleep( 3 ); - if ( remaining ) - printf( "seconds remaining = %d\n", remaining ); - assert( !remaining ); - - /* switch to task 1 */ - - /* delete the key */ - - puts( "Init: pthread_key_delete - SUCCESSFUL" ); - status = pthread_key_delete( Key_id ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - printf( "Destructor invoked %d times\n", Destructor_invoked ); - - puts( "*** END OF POSIX TEST 6 ***" ); - exit( 0 ); - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx06/psx06.scn b/testsuites/psxtests/psx06/psx06.scn deleted file mode 100644 index a17fa043ee..0000000000 --- a/testsuites/psxtests/psx06/psx06.scn +++ /dev/null @@ -1,21 +0,0 @@ -*** POSIX TEST 6 *** -Init's ID is 0x0c010001 - -Init: pthread_key_create - SUCCESSFUL -Destructor invoked 0 times -Init: pthread_key_create - EAGAIN (too many keys) -Init: pthread_setspecific - EINVAL (invalid key) -Init: pthread_getspecific - EINVAL (invalid key) -Init: pthread_key_delete - EINVAL (invalid key) -Init: Setting the key to 0 -Init: Got the key value of 0 -Task_1: Setting the key to 1 -Task_1: Got the key value of 1 -Task_1: exitting -Destructor invoked 4 times -Task_2: Setting the key to 2 -Task_2: Got the key value of 2 -Task2: exitting -Init: pthread_key_delete - SUCCESSFUL -Destructor invoked 5 times -*** END OF POSIX TEST 6 *** diff --git a/testsuites/psxtests/psx06/system.h b/testsuites/psxtests/psx06/system.h deleted file mode 100644 index f6527b5516..0000000000 --- a/testsuites/psxtests/psx06/system.h +++ /dev/null @@ -1,61 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - * $Id$ - */ - -/* functions */ - -#include <pmacros.h> - -void *POSIX_Init( - void *argument -); - -void *Task_1( - void *argument -); - -void *Task_2( - void *argument -); - -/* configuration information */ - -#define CONFIGURE_SPTEST - -#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_KEYS 1 - -#include <confdefs.h> - -/* global variables */ - -#ifdef CONFIGURE_INIT -#define TEST_EXTERN -#else -#define TEST_EXTERN extern -#endif - -TEST_EXTERN pthread_t Init_id; -TEST_EXTERN pthread_t Task_id; -TEST_EXTERN pthread_t Task2_id; -TEST_EXTERN pthread_key_t Key_id; -TEST_EXTERN rtems_unsigned32 Data_array[ CONFIGURE_MAXIMUM_POSIX_THREADS ]; -TEST_EXTERN rtems_unsigned32 Destructor_invoked; - -/* end of include file */ diff --git a/testsuites/psxtests/psx06/task.c b/testsuites/psxtests/psx06/task.c deleted file mode 100644 index a4ebc285f4..0000000000 --- a/testsuites/psxtests/psx06/task.c +++ /dev/null @@ -1,51 +0,0 @@ -/* Task_1 - * - * This routine serves as a test task. It verifies the basic task - * switching capabilities of the executive. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - * $Id$ - */ - -#include "system.h" -#include <errno.h> - -void *Task_1( - void *argument -) -{ - int status; - rtems_unsigned32 *key_data; - - printf( "Task_1: Setting the key to %d\n", 1 ); - status = pthread_setspecific( Key_id, &Data_array[ 1 ] ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - key_data = pthread_getspecific( Key_id ); - printf( "Task_1: Got the key value of %d\n", - (rtems_unsigned32 *)key_data - Data_array ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - puts( "Task_1: exitting" ); - pthread_exit( NULL ); - - /* switch to task 2 */ - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx06/task2.c b/testsuites/psxtests/psx06/task2.c deleted file mode 100644 index 90569f993c..0000000000 --- a/testsuites/psxtests/psx06/task2.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Task_2 - * - * This routine serves as a test task. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - * $Id$ - */ - -#include "system.h" -#include <errno.h> - -void *Task_2( - void *argument -) -{ - int status; - rtems_unsigned32 *key_data; - - printf( "Destructor invoked %d times\n", Destructor_invoked ); - - printf( "Task_2: Setting the key to %d\n", 2 ); - status = pthread_setspecific( Key_id, &Data_array[ 2 ] ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - key_data = pthread_getspecific( Key_id ); - printf( "Task_2: Got the key value of %d\n", - (rtems_unsigned32 *)key_data - Data_array ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - puts( "Task2: exitting" ); - pthread_exit( NULL ); - - /* switch to init task */ - - return NULL; /* just so the compiler thinks we returned something */ -} |