2009-09-04 Joel Sherrill <joel.sherrill@oarcorp.com>

* spfatal01/spfatal01.scn, spfatal01/testcase.h,
	spfatal02/spfatal02.scn, spfatal02/testcase.h,
	spfatal03/spfatal03.scn, spfatal03/testcase.h,
	spfatal04/spfatal04.scn, spfatal04/testcase.h,
	spfatal05/spfatal05.scn, spfatal05/testcase.h,
	spfatal06/spfatal06.scn, spfatal06/testcase.h,
	spfatal07/spfatal07.scn, spfatal07/testcase.h,
	spfatal08/spfatal08.scn, spfatal08/testcase.h,
	spfatal09/spfatal09.scn, spfatal09/testcase.h, spfatal10/Makefile.am,
	spfatal10/spfatal10.scn, spfatal11/Makefile.am,
	spfatal11/spfatal11.scn, spfatal12/Makefile.am,
	spfatal12/spfatal12.scn, spfatal_support/init.c: Make all fatal error
	tests use testcase.h and spfatal_support framework. Print test name
	herald in all cases.
	* spfatal10/testcase.h, spfatal11/testcase.h, spfatal12/testcase.h:
	New files.
	* spfatal10/init.c, spfatal11/init.c, spfatal12/init.c: Removed.
This commit is contained in:
Joel Sherrill
2009-09-04 21:28:56 +00:00
parent d4f932c9a2
commit d329acf46d
32 changed files with 133 additions and 130 deletions

View File

@@ -1,3 +1,23 @@
2009-09-04 Joel Sherrill <joel.sherrill@oarcorp.com>
* spfatal01/spfatal01.scn, spfatal01/testcase.h,
spfatal02/spfatal02.scn, spfatal02/testcase.h,
spfatal03/spfatal03.scn, spfatal03/testcase.h,
spfatal04/spfatal04.scn, spfatal04/testcase.h,
spfatal05/spfatal05.scn, spfatal05/testcase.h,
spfatal06/spfatal06.scn, spfatal06/testcase.h,
spfatal07/spfatal07.scn, spfatal07/testcase.h,
spfatal08/spfatal08.scn, spfatal08/testcase.h,
spfatal09/spfatal09.scn, spfatal09/testcase.h, spfatal10/Makefile.am,
spfatal10/spfatal10.scn, spfatal11/Makefile.am,
spfatal11/spfatal11.scn, spfatal12/Makefile.am,
spfatal12/spfatal12.scn, spfatal_support/init.c: Make all fatal error
tests use testcase.h and spfatal_support framework. Print test name
herald in all cases.
* spfatal10/testcase.h, spfatal11/testcase.h, spfatal12/testcase.h:
New files.
* spfatal10/init.c, spfatal11/init.c, spfatal12/init.c: Removed.
2009-09-04 Joel Sherrill <joel.sherrill@oarcorp.com>
* spfatal07/testcase.h: Indicate test is not applicable on some

View File

@@ -1 +1,2 @@
*** TEST FATAL 1 ***
Fatal error (Classic API Init task create failure) hit

View File

@@ -24,6 +24,7 @@ rtems_initialization_tasks_table Initialization_tasks[] = {
#define CONFIGURE_INIT_TASK_TABLE_SIZE \
sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
#define FATAL_ERROR_TEST_NAME "1"
#define FATAL_ERROR_DESCRIPTION "Classic API Init task create failure"
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_RTEMS_API
#define FATAL_ERROR_EXPECTED_IS_INTERNAL TRUE

View File

@@ -1 +1,2 @@
*** TEST FATAL 2 ***
Fatal error (Classic API Init task start failure) hit

View File

@@ -24,6 +24,7 @@ rtems_initialization_tasks_table Initialization_tasks[] = {
#define CONFIGURE_INIT_TASK_TABLE_SIZE \
sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
#define FATAL_ERROR_TEST_NAME "2"
#define FATAL_ERROR_DESCRIPTION "Classic API Init task start failure"
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_RTEMS_API
#define FATAL_ERROR_EXPECTED_IS_INTERNAL TRUE

View File

@@ -1,2 +1,3 @@
*** TEST FATAL 3 ***
Create semaphore S0
Obtain semaphore in dispatching critical section

View File

@@ -15,6 +15,7 @@
#define CONFIGURE_MAXIMUM_SEMAPHORES 10
#define FATAL_ERROR_TEST_NAME "3"
#define FATAL_ERROR_DESCRIPTION "Core Mutex obtain in critical section"
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
#define FATAL_ERROR_EXPECTED_IS_INTERNAL FALSE

View File

@@ -1 +1,2 @@
*** TEST FATAL 4 ***
Fatal error (Classic API call rtems_fatal_error_occurred) hit

View File

@@ -24,7 +24,9 @@ rtems_initialization_tasks_table Initialization_tasks[] = {
#define CONFIGURE_INIT_TASK_TABLE_SIZE \
sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
#define FATAL_ERROR_DESCRIPTION "Classic API call rtems_fatal_error_occurred"
#define FATAL_ERROR_TEST_NAME "4"
#define FATAL_ERROR_DESCRIPTION \
"Classic API call rtems_fatal_error_occurred"
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_RTEMS_API
#define FATAL_ERROR_EXPECTED_IS_INTERNAL FALSE
#define FATAL_ERROR_EXPECTED_ERROR 0xdead

View File

@@ -1 +1,2 @@
*** TEST FATAL 5 ***
Fatal error (Core fall out of a task) hit

View File

@@ -33,6 +33,7 @@ rtems_initialization_tasks_table Initialization_tasks[] = {
#define SPFATAL_TEST_CASE_EXTRA_TASKS 1
#define FATAL_ERROR_TEST_NAME "5"
#define FATAL_ERROR_DESCRIPTION "Core fall out of a task"
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
#define FATAL_ERROR_EXPECTED_IS_INTERNAL TRUE

View File

@@ -1 +1,2 @@
*** TEST FATAL 6 ***
Fatal error (Core initialize with invalid stack hook) hit

View File

@@ -31,14 +31,16 @@ rtems_initialization_tasks_table Initialization_tasks[] = {
#define CONFIGURE_INIT_TASK_TABLE_SIZE \
sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
#define FATAL_ERROR_DESCRIPTION "Core initialize with invalid stack hook"
#define FATAL_ERROR_TEST_NAME "6"
#define FATAL_ERROR_DESCRIPTION \
"Core initialize with invalid stack hook"
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
#define FATAL_ERROR_EXPECTED_IS_INTERNAL TRUE
#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_BAD_STACK_HOOK
void *New_stack_allocate_hook(uint32_t unused);
void *New_stack_allocate_hook(size_t unused);
void *New_stack_allocate_hook(uint32_t unused)
void *New_stack_allocate_hook(size_t unused)
{
}
@@ -47,7 +49,7 @@ void force_error()
if (Configuration.stack_free_hook != NULL)
Configuration.stack_allocate_hook = NULL;
else
Configuration.stack_allocate_hook = &New_stack_allocate_hook;
Configuration.stack_allocate_hook = New_stack_allocate_hook;
rtems_initialize_data_structures();
/* we will not run this far */

View File

@@ -1 +1,2 @@
*** TEST FATAL 7 ***
Fatal error (Core Configuration Invalid ISR stack size) hit

View File

@@ -31,7 +31,9 @@ rtems_initialization_tasks_table Initialization_tasks[] = {
#define CONFIGURE_INIT_TASK_TABLE_SIZE \
sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
#define FATAL_ERROR_DESCRIPTION "Core Configuration Invalid ISR stack size"
#define FATAL_ERROR_TEST_NAME "7"
#define FATAL_ERROR_DESCRIPTION \
"Core Configuration Invalid ISR stack size"
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
#define FATAL_ERROR_EXPECTED_IS_INTERNAL TRUE
#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL

View File

@@ -1 +1,2 @@
*** TEST FATAL 8 ***
Fatal error (Core workspace too small) hit

View File

@@ -31,6 +31,7 @@ rtems_initialization_tasks_table Initialization_tasks[] = {
#define CONFIGURE_INIT_TASK_TABLE_SIZE \
sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
#define FATAL_ERROR_TEST_NAME "8"
#define FATAL_ERROR_DESCRIPTION "Core workspace too small"
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
#define FATAL_ERROR_EXPECTED_IS_INTERNAL TRUE

View File

@@ -1 +1,2 @@
*** TEST FATAL 9 ***
Fatal error (Core invalid workspace address) hit

View File

@@ -31,6 +31,7 @@ rtems_initialization_tasks_table Initialization_tasks[] = {
#define CONFIGURE_INIT_TASK_TABLE_SIZE \
sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
#define FATAL_ERROR_TEST_NAME "9"
#define FATAL_ERROR_DESCRIPTION "Core invalid workspace address"
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
#define FATAL_ERROR_EXPECTED_IS_INTERNAL TRUE

View File

@@ -5,7 +5,8 @@
MANAGERS = all
rtems_tests_PROGRAMS = spfatal10
spfatal10_SOURCES = init.c
spfatal10_SOURCES = ../spfatal_support/init.c ../spfatal_support/system.h \
testcase.h
dist_rtems_tests_DATA = spfatal10.scn
dist_rtems_tests_DATA += spfatal10.doc

View File

@@ -1,39 +0,0 @@
/* Test __assert with function name
*
* COPYRIGHT (c) 1989-2009.
* 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>
#undef NDEBUG
#include <assert.h>
rtems_task Init(
rtems_task_argument ignored
)
{
puts( "\n\n*** TEST FATAL 10 ***" );
puts( "asserting with non-NULL strings...\n" );
__assert_func( __FILE__, __LINE__, "Init", "forced" );
}
/* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 1
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_INIT
#include <rtems/confdefs.h>
/* global variables */

View File

@@ -1,5 +1,3 @@
*** TEST FATAL 10 ***
asserting with non-NULL strings...
assertion "force" failed: file "../../../../../../../rtems/c/src/../../testsuites/sptests/spfatal10/init.c", line 24, function: Init
program stopped with signal 2.
assertion "forced" failed: file "../../../../../../../rtems/c/src/../../testsuites/sptests/spfatal10/testcase.h", line 20, function: Init
Fatal error (asserting with non-NULL strings...) hit

View File

@@ -0,0 +1,24 @@
/* Test __assert_func with NULL function name
*
* COPYRIGHT (c) 1989-2009.
* 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 FATAL_ERROR_TEST_NAME "10"
#define FATAL_ERROR_DESCRIPTION "asserting with non-NULL strings..."
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_RTEMS_API
#define FATAL_ERROR_EXPECTED_IS_INTERNAL FALSE
#define FATAL_ERROR_EXPECTED_ERROR 0
void force_error()
{
__assert_func( __FILE__, __LINE__, "Init", "forced" );
/* we will not run this far */
}

View File

@@ -5,7 +5,8 @@
MANAGERS = all
rtems_tests_PROGRAMS = spfatal11
spfatal11_SOURCES = init.c
spfatal11_SOURCES = ../spfatal_support/init.c ../spfatal_support/system.h \
testcase.h
dist_rtems_tests_DATA = spfatal11.scn
dist_rtems_tests_DATA += spfatal11.doc

View File

@@ -1,38 +0,0 @@
/* Test __assert_func with NULL function name
*
* COPYRIGHT (c) 1989-2009.
* 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>
#undef NDEBUG
#include <assert.h>
rtems_task Init(
rtems_task_argument ignored
)
{
puts( "\n\n*** TEST FATAL 11 ***" );
puts( "asserting with non-NULL strings..." );
__assert_func( __FILE__, __LINE__, NULL, "forced" );
}
/* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 1
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_INIT
#include <rtems/confdefs.h>
/* global variables */

View File

@@ -1,5 +1,5 @@
*** TEST FATAL 11 ***
asserting with non-NULL strings...
assertion "forced" failed: file "../../../../../../../rtems/c/src/../../testsuites/sptests/spfatal11/testcase.h", line 21
Fatal error (asserting with non-NULL strings...) hit
assertion "forced" failed: file "../../../../../../../rtems/c/src/../../testsuites/sptests/spfatal11/init.c", line 24
program stopped with signal 2.

View File

@@ -0,0 +1,24 @@
/* Test __assert_func with NULL function name
*
* COPYRIGHT (c) 1989-2009.
* 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 FATAL_ERROR_TEST_NAME "11"
#define FATAL_ERROR_DESCRIPTION "asserting with non-NULL strings..."
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_RTEMS_API
#define FATAL_ERROR_EXPECTED_IS_INTERNAL FALSE
#define FATAL_ERROR_EXPECTED_ERROR 0
void force_error()
{
__assert_func( __FILE__, __LINE__, NULL, "forced" );
/* we will not run this far */
}

View File

@@ -5,7 +5,8 @@
MANAGERS = all
rtems_tests_PROGRAMS = spfatal12
spfatal12_SOURCES = init.c
spfatal12_SOURCES = ../spfatal_support/init.c ../spfatal_support/system.h \
testcase.h
dist_rtems_tests_DATA = spfatal12.scn
dist_rtems_tests_DATA += spfatal12.doc

View File

@@ -1,37 +0,0 @@
/* Test fatal error when _Heap_Initialize fails during initialization
*
* COPYRIGHT (c) 1989-2009.
* 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>
rtems_task Init(
rtems_task_argument ignored
)
{
puts( "\n\n*** TEST FATAL 12 ***" );
puts( "_Heap_Initialize fails during RTEMS initialization" );
Configuration.work_space_size = sizeof(void *);
rtems_initialize_data_structures();
}
/* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 1
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_INIT
#include <rtems/confdefs.h>
/* global variables */

View File

@@ -1,2 +1,2 @@
*** TEST FATAL 12 ***
_Heap_Initialize fails during RTEMS initialization
Fatal error (_Heap_Initialize fails during RTEMS initialization) hit

View File

@@ -0,0 +1,26 @@
/* Test __assert_func with NULL function name
*
* COPYRIGHT (c) 1989-2009.
* 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 FATAL_ERROR_TEST_NAME "12"
#define FATAL_ERROR_DESCRIPTION \
"_Heap_Initialize fails during RTEMS initialization"
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
#define FATAL_ERROR_EXPECTED_IS_INTERNAL TRUE
#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_TOO_LITTLE_WORKSPACE
void force_error()
{
Configuration.work_space_size = sizeof(void *);
rtems_initialize_data_structures();
/* we will not run this far */
}

View File

@@ -28,6 +28,7 @@ rtems_task Init(
rtems_task_argument argument
)
{
printk( "\n\n\n*** TEST FATAL " FATAL_ERROR_TEST_NAME " ***\n" );
force_error();
printk( "Fatal error (%s) NOT hit\n", FATAL_ERROR_DESCRIPTION );
rtems_test_exit(0);