diff options
Diffstat (limited to 'testsuites/sptests/spfatal')
-rw-r--r-- | testsuites/sptests/spfatal/fatal.c | 135 | ||||
-rw-r--r-- | testsuites/sptests/spfatal/init.c | 51 | ||||
-rw-r--r-- | testsuites/sptests/spfatal/puterr.c | 68 | ||||
-rw-r--r-- | testsuites/sptests/spfatal/spfatal.doc | 28 | ||||
-rw-r--r-- | testsuites/sptests/spfatal/spfatal.scn | 8 | ||||
-rw-r--r-- | testsuites/sptests/spfatal/system.h | 79 | ||||
-rw-r--r-- | testsuites/sptests/spfatal/task1.c | 29 |
7 files changed, 0 insertions, 398 deletions
diff --git a/testsuites/sptests/spfatal/fatal.c b/testsuites/sptests/spfatal/fatal.c deleted file mode 100644 index fa3dd547bd..0000000000 --- a/testsuites/sptests/spfatal/fatal.c +++ /dev/null @@ -1,135 +0,0 @@ -/* Fatal Error Test - * - * NOTE: - * - * This test actually modifies the Configuration table and restarts - * the executive. It is very carefully constructed to do this and - * uses the Configuration very carefully. - * - * 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 <setjmp.h> - -char Workspace[ 64 * 1024 ] CPU_STRUCTURE_ALIGNMENT; - -typedef enum { - FATAL_WORKSPACE_OF_ZERO, - FATAL_NULL_WORKSPACE, - FATAL_WORKSPACE_TOO_SMALL, - FATAL_TASK_CREATE, - FATAL_TASK_START -} Fatal_errors_t; - -#define FATAL_LAST FATAL_TASK_START - -volatile Fatal_errors_t Case_in_switch; - -rtems_status_code Expected_Errors[] = { - RTEMS_UNSATISFIED, - RTEMS_INVALID_ADDRESS, - RTEMS_UNSATISFIED, - RTEMS_INVALID_PRIORITY, - RTEMS_TASK_EXITTED -}; - -rtems_status_code Error_Happened[ FATAL_LAST + 1]; - -jmp_buf Restart_Context; - -/* - * We depend on this being zeroed during initialization. This - * occurs automatically because this is part of the BSS. - */ - -rtems_unsigned32 First_Time_Through; - -void Process_case(); - -rtems_extension Fatal_extension( - rtems_unsigned32 error, - boolean is_internal -) -{ - int index; - - Error_Happened[ Case_in_switch ] = error; - - if ( First_Time_Through == 0 ) { - Case_in_switch = FATAL_WORKSPACE_OF_ZERO; - First_Time_Through = 1; - setjmp( Restart_Context ); - } else if ( Case_in_switch == FATAL_LAST ) { - - /* - * Depending on the C library we use, we cannot get the - * task exitted error so do not check for it. - */ - - puts( "*** TEST FATAL ***" ); - for ( index=0 ; index< FATAL_LAST ; index++ ) - put_error( Error_Happened[ index ], Expected_Errors[ index ] ); - puts( "NOT TESTING FATAL ERROR WHEN TASK EXITS -- C LIBRARY CATCHES THIS" ); - puts( "*** END OF TEST FATAL ***" ); - - /* - * returns to the default fatal error handler instead of - * calling rtems_shutdown_executive - */ - return; - - } else { - - longjmp( Restart_Context, 1 ); - } - - Process_case(); -} - - - -void Process_case() -{ - switch ( Case_in_switch ) { - case FATAL_WORKSPACE_OF_ZERO: - New_Configuration = BSP_Configuration; - New_Configuration.work_space_start = NULL; - Case_in_switch = FATAL_NULL_WORKSPACE; - break; - - case FATAL_NULL_WORKSPACE: - New_Configuration.work_space_start = Workspace; - New_Configuration.work_space_size = 256; - Case_in_switch = FATAL_WORKSPACE_TOO_SMALL; - break; - - case FATAL_WORKSPACE_TOO_SMALL: - Initialization_tasks[ 0 ].initial_priority = RTEMS_CURRENT_PRIORITY; - New_Configuration.work_space_size = sizeof( Workspace ); - Case_in_switch = FATAL_TASK_CREATE; - break; - - case FATAL_TASK_CREATE: - Initialization_tasks[ 0 ].initial_priority = 1; - Initialization_tasks[ 0 ].entry_point = NULL; - Case_in_switch = FATAL_TASK_START; - break; - - case FATAL_TASK_START: - /* this extension exits the test */ - Initialization_tasks[ 0 ].entry_point = Init; - break; - } - rtems_initialize_executive( &New_Configuration, &Cpu_table ); -} - diff --git a/testsuites/sptests/spfatal/init.c b/testsuites/sptests/spfatal/init.c deleted file mode 100644 index 5abcec46a4..0000000000 --- a/testsuites/sptests/spfatal/init.c +++ /dev/null @@ -1,51 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * 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$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); - - status = rtems_task_create( - Task_name[ 1 ], - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create of TA1" ); - - status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); - directive_failed( status, "rtems_task_start of TA1" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/sptests/spfatal/puterr.c b/testsuites/sptests/spfatal/puterr.c deleted file mode 100644 index f7d79e5f34..0000000000 --- a/testsuites/sptests/spfatal/puterr.c +++ /dev/null @@ -1,68 +0,0 @@ -/* put_error - * - * This routine verifies that the given error is the expected error. - * - * Input parameters: - * error - actual error code - * expected - expected error code - * - * 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" - -char *Errors[] = { - "RTEMS_SUCCESSFUL", /* successful completion */ - "RTEMS_TASK_EXITTED", /* returned from a task */ - "RTEMS_MP_NOT_CONFIGURED", /* multiprocessing not configured */ - "RTEMS_INVALID_NAME", /* invalid object name */ - "RTEMS_INVALID_ID", /* invalid object id */ - "RTEMS_TOO_MANY", /* too many */ - "RTEMS_TIMEOUT", /* timed out waiting */ - "RTEMS_OBJECT_WAS_DELETED", /* object was deleted while waiting */ - "RTEMS_INVALID_SIZE", /* specified size was invalid */ - "RTEMS_INVALID_ADDRESS", /* address specified is invalid */ - "RTEMS_INVALID_NUMBER", /* number was invalid */ - "RTEMS_NOT_DEFINED", /* item has not been initialized */ - "RTEMS_RESOURCE_IN_USE", /* resources still outstanding */ - "RTEMS_UNSATISFIED", /* request not satisfied */ - "RTEMS_INCORRECT_STATE", /* task is in wrong state */ - "RTEMS_ALREADY_SUSPENDED", /* task already in state */ - "RTEMS_ILLEGAL_ON_SELF", /* illegal operation on calling task */ - "RTEMS_ILLEGAL_ON_REMOTE_OBJECT", /* illegal operation for remote object */ - "RTEMS_CALLED_FROM_ISR", /* called from ISR */ - "RTEMS_INVALID_PRIORITY", /* invalid task priority */ - "RTEMS_INVALID_CLOCK", /* invalid date/time */ - "RTEMS_INVALID_NODE", /* invalid node id */ - "RTEMS_NOT_OWNER_OF_RESOURCE", /* not owner of resource */ - "RTEMS_NOT_CONFIGURED", /* directive not configured */ - "RTEMS_NOT_IMPLEMENTED" /* directive not implemented */ -}; - -/* Task states */ - -void put_error( - rtems_unsigned32 error, - rtems_status_code expected -) -{ - - if ( error <= RTEMS_NOT_IMPLEMENTED ) - printf( "EXPECTED FATAL - error code is correctly %s\n", Errors[ error ] ); - else - printf( "ERROR - out of range error code is %d\n", error ); - - if ( error != expected ) { - printf( "ERROR - did not get expected code of %d\n", expected ); - } -} diff --git a/testsuites/sptests/spfatal/spfatal.doc b/testsuites/sptests/spfatal/spfatal.doc deleted file mode 100644 index 501f278670..0000000000 --- a/testsuites/sptests/spfatal/spfatal.doc +++ /dev/null @@ -1,28 +0,0 @@ -# -# $Id$ -# -# 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. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: testfatal - -directives: none - -concepts: - - a. Verifies that the proper error is reported by k_fatal when a task - exits. - - b. Verifies that the task exitted extension works correctly. - - c. Verifies that the fatal error extension works corectly. - diff --git a/testsuites/sptests/spfatal/spfatal.scn b/testsuites/sptests/spfatal/spfatal.scn deleted file mode 100644 index ecb9f63597..0000000000 --- a/testsuites/sptests/spfatal/spfatal.scn +++ /dev/null @@ -1,8 +0,0 @@ -*** TEST FATAL *** -EXPECTED FATAL - error code is correctly RTEMS_UNSATISFIED -EXPECTED FATAL - error code is correctly RTEMS_INVALID_ADDRESS -EXPECTED FATAL - error code is correctly RTEMS_UNSATISFIED -EXPECTED FATAL - error code is correctly RTEMS_INVALID_PRIORITY -EXPECTED FATAL - error code is correctly RTEMS_TASK_EXITTED -NOT TESTING FATAL ERROR WHEN TASK EXITS -- C LIBRARY CATCHES THIS -*** END OF TEST FATAL *** diff --git a/testsuites/sptests/spfatal/system.h b/testsuites/sptests/spfatal/system.h deleted file mode 100644 index a1e3578a64..0000000000 --- a/testsuites/sptests/spfatal/system.h +++ /dev/null @@ -1,79 +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$ - */ - -#include <tmacros.h> - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -void put_error( - rtems_unsigned32 error, - rtems_status_code expected -); - -rtems_extension Fatal_extension( - rtems_unsigned32 error, - boolean is_internal -); - -rtems_task Task_1( - rtems_task_argument argument -); - -/* configuration information */ - -extern rtems_extensions_table initial_extensions; - -#ifdef TEST_INIT -rtems_extensions_table initial_extensions = { - NULL, /* create */ - NULL, /* start */ - NULL, /* restart */ - NULL, /* delete */ - NULL, /* switch */ - NULL, /* begin */ - NULL, /* exitted */ - Fatal_extension /* fatal */ -}; -#endif - -#define CONFIGURE_SPTEST - -#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(0) -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_INITIAL_EXTENSIONS &initial_extensions - -#include <confdefs.h> - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_configuration_table New_Configuration; - -extern rtems_extensions_table Extensions; -extern rtems_configuration_table BSP_Configuration; -extern rtems_cpu_table Cpu_table; - -/* end of include file */ diff --git a/testsuites/sptests/spfatal/task1.c b/testsuites/sptests/spfatal/task1.c deleted file mode 100644 index d06d25e690..0000000000 --- a/testsuites/sptests/spfatal/task1.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Task_1 - * - * This routine serves as a test task. It verifies the task manager. - * - * 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" - -rtems_task Task_1( - rtems_task_argument argument -) -{ - puts( "\n\n*** TEST FATAL ***" ); - puts( "TA1 - exitting task" ); -} |