diff options
Diffstat (limited to 'testsuites/psxtests/psx01')
-rw-r--r-- | testsuites/psxtests/psx01/init.c | 125 | ||||
-rw-r--r-- | testsuites/psxtests/psx01/psx01.scn | 0 | ||||
-rw-r--r-- | testsuites/psxtests/psx01/system.h | 52 | ||||
-rw-r--r-- | testsuites/psxtests/psx01/task.c | 51 |
4 files changed, 0 insertions, 228 deletions
diff --git a/testsuites/psxtests/psx01/init.c b/testsuites/psxtests/psx01/init.c deleted file mode 100644 index 75aa73ac65..0000000000 --- a/testsuites/psxtests/psx01/init.c +++ /dev/null @@ -1,125 +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 <sched.h> - - -void *POSIX_Init( - void *argument -) -{ - int status; - int priority; - pthread_t thread_id; - time_t seconds; - time_t remaining; - struct tm tm; - struct timespec tv; - struct timespec tr; - - puts( "\n\n*** POSIX TEST 1 ***" ); - - /* set the time of day, and print our buffer in multiple ways */ - - build_time( &tm, TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 ); - - tv.tv_sec = mktime( &tm ); - assert( tv.tv_sec != -1 ); - - tv.tv_nsec = 0; - - status = clock_settime( CLOCK_REALTIME, &tv ); - assert( !status ); - - printf( asctime( &tm ) ); - printf( ctime( &tv.tv_sec ) ); - - /* use sleep to delay */ - - remaining = sleep( 3 ); - assert( !remaining ); - - /* print new times to make sure it has changed and we can get the realtime */ - - status = clock_gettime( CLOCK_REALTIME, &tv ); - assert( !status ); - - printf( ctime( &tv.tv_sec ) ); - - seconds = time( NULL ); - printf( ctime( &seconds ) ); - - /* check the time remaining */ - - printf( "seconds remaining (%d)\n", (int)remaining ); - assert( !remaining ); - - /* use nanosleep to delay */ - - tv.tv_sec = 3; - tv.tv_nsec = 500000; - - status = nanosleep ( &tv, &tr ); - assert( !status ); - - /* print the current real time again */ - - status = clock_gettime( CLOCK_REALTIME, &tv ); - assert( !status ); - - printf( ctime( &tv.tv_sec ) ); - - /* check the time remaining */ - - printf( "sec (%d), nsec (%d) remaining\n", (int)tr.tv_sec, (int)tr.tv_nsec ); - assert( !tr.tv_sec && !tr.tv_nsec ); - - /* get id of this thread */ - - Init_id = pthread_self(); - printf( "Init's ID is 0x%08x\n", Init_id ); - - /* print the minimum priority */ - - priority = sched_get_priority_min( SCHED_FIFO ); - printf( "Minimum priority for FIFO is %d\n", priority ); - assert( priority != -1 ); - - /* print the maximum priority */ - - priority = sched_get_priority_max( SCHED_FIFO ); - printf( "Maximum priority for FIFO is %d\n", priority ); - assert( priority != -1 ); - - /* print the round robin time quantum */ - - status = sched_rr_get_interval( getpid(), &tr ); - printf( - "Round Robin quantum is %d seconds, %d nanoseconds\n", - (int) tr.tv_sec, - (int) tr.tv_nsec - ); - assert( !status ); - - /* create a thread */ - - status = pthread_create( &thread_id, NULL, Task_1_through_3, NULL ); - assert( !status ); - - /* exit this thread */ - - pthread_exit( NULL ); - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx01/psx01.scn b/testsuites/psxtests/psx01/psx01.scn deleted file mode 100644 index e69de29bb2..0000000000 --- a/testsuites/psxtests/psx01/psx01.scn +++ /dev/null diff --git a/testsuites/psxtests/psx01/system.h b/testsuites/psxtests/psx01/system.h deleted file mode 100644 index 3abfff0e19..0000000000 --- a/testsuites/psxtests/psx01/system.h +++ /dev/null @@ -1,52 +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> -#include <unistd.h> - -void *POSIX_Init( - void *argument -); - -void *Task_1_through_3( - 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 - -#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; - -/* end of include file */ diff --git a/testsuites/psxtests/psx01/task.c b/testsuites/psxtests/psx01/task.c deleted file mode 100644 index 61095cf119..0000000000 --- a/testsuites/psxtests/psx01/task.c +++ /dev/null @@ -1,51 +0,0 @@ -/* Task_1_through_3 - * - * 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" - -void *Task_1_through_3( - void *argument -) -{ - int status; - - /* XXX temporary */ - - /* get id of this thread */ - - Task_id = pthread_self(); - printf( "Task's ID is 0x%08x\n", Task_id ); - - status = pthread_equal( Task_id, Task_id ); - if ( status ) - puts( "pthread_equal match case passed" ); - assert( status ); - - status = pthread_equal( Init_id, Task_id ); - if ( !status ) - puts( "pthread_equal different case passed" ); - assert( !status ); - - puts( "*** END OF POSIX TEST 1 ***" ); - exit( 0 ); - - return NULL; /* just so the compiler thinks we returned something */ -} |