diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-06 13:44:22 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-06 13:44:22 +0000 |
commit | 70a4809f8413204e8a93d4384b239f3c73278eb2 (patch) | |
tree | 401595a356a41a646143d9729287eb1fabac5218 | |
parent | 2009-07-06 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-70a4809f8413204e8a93d4384b239f3c73278eb2.tar.bz2 |
2009-07-06 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac: Remove obsolete test now that the numbered
spfatal tests appear to cover all fatal error cases.
* spfatal/.cvsignore, spfatal/Makefile.am, spfatal/README,
spfatal/fatal.c, spfatal/init.c, spfatal/puterr.c,
spfatal/spfatal.doc, spfatal/spfatal.scn, spfatal/system.h,
spfatal/task1.c: Removed.
-rw-r--r-- | testsuites/sptests/ChangeLog | 9 | ||||
-rw-r--r-- | testsuites/sptests/Makefile.am | 3 | ||||
-rw-r--r-- | testsuites/sptests/configure.ac | 1 | ||||
-rw-r--r-- | testsuites/sptests/spfatal/.cvsignore | 2 | ||||
-rw-r--r-- | testsuites/sptests/spfatal/Makefile.am | 28 | ||||
-rw-r--r-- | testsuites/sptests/spfatal/README | 8 | ||||
-rw-r--r-- | testsuites/sptests/spfatal/fatal.c | 134 | ||||
-rw-r--r-- | testsuites/sptests/spfatal/init.c | 50 | ||||
-rw-r--r-- | testsuites/sptests/spfatal/puterr.c | 67 | ||||
-rw-r--r-- | testsuites/sptests/spfatal/spfatal.doc | 27 | ||||
-rw-r--r-- | testsuites/sptests/spfatal/spfatal.scn | 8 | ||||
-rw-r--r-- | testsuites/sptests/spfatal/system.h | 74 | ||||
-rw-r--r-- | testsuites/sptests/spfatal/task1.c | 28 |
13 files changed, 10 insertions, 429 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog index 2e0b32dfa1..9d847a2c57 100644 --- a/testsuites/sptests/ChangeLog +++ b/testsuites/sptests/ChangeLog @@ -1,5 +1,14 @@ 2009-07-06 Joel Sherrill <joel.sherrill@oarcorp.com> + * Makefile.am, configure.ac: Remove obsolete test now that the numbered + spfatal tests appear to cover all fatal error cases. + * spfatal/.cvsignore, spfatal/Makefile.am, spfatal/README, + spfatal/fatal.c, spfatal/init.c, spfatal/puterr.c, + spfatal/spfatal.doc, spfatal/spfatal.scn, spfatal/system.h, + spfatal/task1.c: Removed. + +2009-07-06 Joel Sherrill <joel.sherrill@oarcorp.com> + * Makefile.am, configure.ac, spfatal11/init.c: Add test of cannot initialize workspace heap during initialize. Can be caused by unaligned address or not enough memory to initialize heap required diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am index e5ef12526f..4572a7f5c7 100644 --- a/testsuites/sptests/Makefile.am +++ b/testsuites/sptests/Makefile.am @@ -4,7 +4,6 @@ ACLOCAL_AMFLAGS = -I ../aclocal -## spfatal is not included for now SUBDIRS = sp01 sp02 sp03 sp04 sp05 sp06 sp07 sp08 sp09 sp11 sp12 sp13 sp14 \ sp15 sp16 sp17 sp19 sp20 sp21 sp22 sp23 sp24 sp25 sp26 sp27 sp28 sp29 \ sp30 sp31 sp32 sp33 sp34 sp35 sp37 sp38 sp39 sp40 sp41 sp42 sp43 sp44 \ @@ -13,7 +12,7 @@ SUBDIRS = sp01 sp02 sp03 sp04 sp05 sp06 sp07 sp08 sp09 sp11 sp12 sp13 sp14 \ spfatal01 spfatal02 spfatal03 spfatal04 spfatal05 spfatal06 spfatal07 \ spfatal08 spfatal09 spfatal10 spfatal11 spfatal12 -DIST_SUBDIRS = $(SUBDIRS) spfatal spfatal_support +DIST_SUBDIRS = $(SUBDIRS) spfatal_support EXTRA_DIST = spfatal_support/init.c spfatal_support/system.h include $(top_srcdir)/../automake/subdirs.am diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac index 86a9e30198..4e05dfbd20 100644 --- a/testsuites/sptests/configure.ac +++ b/testsuites/sptests/configure.ac @@ -80,7 +80,6 @@ sp52/Makefile sp53/Makefile sp54/Makefile spchain/Makefile -spfatal/Makefile spfatal01/Makefile spfatal02/Makefile spfatal03/Makefile diff --git a/testsuites/sptests/spfatal/.cvsignore b/testsuites/sptests/spfatal/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/spfatal/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/spfatal/Makefile.am b/testsuites/sptests/spfatal/Makefile.am deleted file mode 100644 index 111323c88d..0000000000 --- a/testsuites/sptests/spfatal/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -## -## $Id$ -## - -MANAGERS = all - -rtems_tests_PROGRAMS = spfatal -spfatal_SOURCES = init.c puterr.c fatal.c task1.c system.h - -dist_rtems_tests_DATA = spfatal.scn -dist_rtems_tests_DATA += spfatal.doc - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../automake/compile.am -include $(top_srcdir)/../automake/leaf.am - -spfatal_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel) - -AM_CPPFLAGS += -I$(top_srcdir)/../support/include - -LINK_OBJS = $(spfatal_OBJECTS) $(spfatal_LDADD) -LINK_LIBS = $(spfatal_LDLIBS) - -spfatal$(EXEEXT): $(spfatal_OBJECTS) $(spfatal_DEPENDENCIES) - @rm -f spfatal$(EXEEXT) - $(make-exe) - -include $(top_srcdir)/../automake/local.am diff --git a/testsuites/sptests/spfatal/README b/testsuites/sptests/spfatal/README deleted file mode 100644 index ad56f040b7..0000000000 --- a/testsuites/sptests/spfatal/README +++ /dev/null @@ -1,8 +0,0 @@ -# -# $Id$ -# - -This test depends on tricks to test the fatal error paths in the -RTEMS executive initialization path. These tricks have gotten -out of sync with the implementation. So this test is no longer -included in the build set. diff --git a/testsuites/sptests/spfatal/fatal.c b/testsuites/sptests/spfatal/fatal.c deleted file mode 100644 index a87e7797d6..0000000000 --- a/testsuites/sptests/spfatal/fatal.c +++ /dev/null @@ -1,134 +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-2008. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - * - * $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. - */ - -uint32_t First_Time_Through; - -void Process_case(); - -rtems_extension Fatal_extension( - uint32_t source, - bool is_internal, - uint32_t error -) -{ - 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 = rtems_configuration_get_table(); - 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_data_structures( &New_Configuration ); -} diff --git a/testsuites/sptests/spfatal/init.c b/testsuites/sptests/spfatal/init.c deleted file mode 100644 index d16e98a02b..0000000000 --- a/testsuites/sptests/spfatal/init.c +++ /dev/null @@ -1,50 +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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - * - * $Id$ - */ - -#define CONFIGURE_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 cc274ddadd..0000000000 --- a/testsuites/sptests/spfatal/puterr.c +++ /dev/null @@ -1,67 +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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - * - * $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( - uint32_t 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 50fb76c9af..0000000000 --- a/testsuites/sptests/spfatal/spfatal.doc +++ /dev/null @@ -1,27 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.rtems.com/license/LICENSE. -# - - -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 8d1881c06c..0000000000 --- a/testsuites/sptests/spfatal/system.h +++ /dev/null @@ -1,74 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - * - * $Id$ - */ - -#include <tmacros.h> - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -void put_error( - uint32_t error, - rtems_status_code expected -); - -rtems_extension Fatal_extension( - uint32_t source, - bool is_internal, - uint32_t error -); - -rtems_task Task_1( - rtems_task_argument argument -); - -/* configuration information */ - -extern rtems_extensions_table initial_extensions; - -#define CONFIGURE_INITIAL_EXTENSIONS \ - { \ - NULL, /* create */ \ - NULL, /* start */ \ - NULL, /* restart */ \ - NULL, /* delete */ \ - NULL, /* switch */ \ - NULL, /* begin */ \ - NULL, /* exitted */ \ - Fatal_extension /* fatal */ \ - } - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(0) -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include <rtems/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; - -/* end of include file */ diff --git a/testsuites/sptests/spfatal/task1.c b/testsuites/sptests/spfatal/task1.c deleted file mode 100644 index df0ec785e5..0000000000 --- a/testsuites/sptests/spfatal/task1.c +++ /dev/null @@ -1,28 +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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_1( - rtems_task_argument argument -) -{ - puts( "\n\n*** TEST FATAL ***" ); - puts( "TA1 - exitting task" ); -} |