diff options
author | Bjorn Larsson <bjornlarsson@oarcorp.com> | 2014-03-26 09:56:43 -0500 |
---|---|---|
committer | Jennifer Averett <jennifer.averett@oarcorp.com> | 2014-03-28 13:08:57 -0500 |
commit | d6f65e40eaee24f67fdd26fbc64fad7b7271932d (patch) | |
tree | 0330ef8fcdef4040d6f63203a6056a46bcaf1c51 /testsuites/sptests/sptask_err01 | |
parent | sptests: Split sp09 screens 7,8 into spmsg1_err01 and spmsgq_err02. (diff) | |
download | rtems-d6f65e40eaee24f67fdd26fbc64fad7b7271932d.tar.bz2 |
sptests: split sp09 screen 5,6 into spsem_err01, spsem_err02, and sptask_err01.
sp09 screen 5 split into spsem_err01, sp09 screen 6 split into
spsem_err02, and sptask_err01.
Diffstat (limited to 'testsuites/sptests/sptask_err01')
-rw-r--r-- | testsuites/sptests/sptask_err01/Makefile.am | 22 | ||||
-rw-r--r-- | testsuites/sptests/sptask_err01/init.c | 57 | ||||
-rw-r--r-- | testsuites/sptests/sptask_err01/sptask_err01.doc | 25 | ||||
-rw-r--r-- | testsuites/sptests/sptask_err01/sptask_err01.scn | 7 | ||||
-rw-r--r-- | testsuites/sptests/sptask_err01/system.h | 51 | ||||
-rw-r--r-- | testsuites/sptests/sptask_err01/task2.c | 34 |
6 files changed, 196 insertions, 0 deletions
diff --git a/testsuites/sptests/sptask_err01/Makefile.am b/testsuites/sptests/sptask_err01/Makefile.am new file mode 100644 index 0000000000..111891cad8 --- /dev/null +++ b/testsuites/sptests/sptask_err01/Makefile.am @@ -0,0 +1,22 @@ + +rtems_tests_PROGRAMS = sptask_err01 +sptask_err01_SOURCES = init.c task2.c system.h + +dist_rtems_tests_DATA = sptask_err01.scn +dist_rtems_tests_DATA += sptask_err01.doc + +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am +include $(top_srcdir)/../automake/leaf.am + + +AM_CPPFLAGS += -I$(top_srcdir)/../support/include + +LINK_OBJS = $(sptask_err01_OBJECTS) +LINK_LIBS = $(sptask_err01_LDLIBS) + +sptask_err01$(EXEEXT): $(sptask_err01_OBJECTS) $(sptask_err01_DEPENDENCIES) + @rm -f sptask_err01$(EXEEXT) + $(make-exe) + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/sptests/sptask_err01/init.c b/testsuites/sptests/sptask_err01/init.c new file mode 100644 index 0000000000..7289331608 --- /dev/null +++ b/testsuites/sptests/sptask_err01/init.c @@ -0,0 +1,57 @@ +/* + * COPYRIGHT (c) 2014. + * 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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define CONFIGURE_INIT +#include "system.h" + +const char rtems_test_name[] = "SP TASK ERROR 01"; + +rtems_task Init( + rtems_task_argument argument +) +{ + rtems_status_code status; + + TEST_BEGIN(); + + Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' ); + + status = rtems_task_create( + Task_name[ 2 ], + 1, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 2 ] + ); + directive_failed( status, "rtems_task_create of TA2" ); + puts( "TA1 - rtems_task_create - TA2 created - RTEMS_SUCCESSFUL" ); + + puts( "TA1 - rtems_task_start - start TA2 - RTEMS_SUCCESSFUL" ); + status = rtems_task_start( Task_id[ 2 ], Task_2, 0 ); + directive_failed( status, "rtems_task_start of TA2" ); + + puts( "TA1 - rtems_task_wake_after - yield processor - RTEMS_SUCCESSFUL" ); + status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); + directive_failed( status, "rtems_task_wake_after (yield)" ); + + status = rtems_task_delete( Task_id[ 2 ] ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_task_delete after the task has been deleted" + ); + puts( "TA1 - rtems_task_delete TA2 - already deleted RTEMS_INVALID_ID" ); + + TEST_END(); +} diff --git a/testsuites/sptests/sptask_err01/sptask_err01.doc b/testsuites/sptests/sptask_err01/sptask_err01.doc new file mode 100644 index 0000000000..2475cb8923 --- /dev/null +++ b/testsuites/sptests/sptask_err01/sptask_err01.doc @@ -0,0 +1,25 @@ +# COPYRIGHT (c) 1989-2014. +# 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: sptask_err01 + +directives: + t_create, t_delete, t_wkafter + +concepts: + + a. Verifies all error codes returned by the executive in single + processor configurations. + + b. Verifies error conditions in the following kernel routines or macros: + _Ck_date_time, _Expired, _Q_submit, _Get_mnodes, _Get_node, + _Free_mem, _Get_mem, _Valid_block, _Set_tcb, _Set_resource, + _In_range, _On_boundary diff --git a/testsuites/sptests/sptask_err01/sptask_err01.scn b/testsuites/sptests/sptask_err01/sptask_err01.scn new file mode 100644 index 0000000000..eccf90fce7 --- /dev/null +++ b/testsuites/sptests/sptask_err01/sptask_err01.scn @@ -0,0 +1,7 @@ +*** TEST TASK ERROR 01 *** +TA1 - rtems_task_create - TA2 created - RTEMS_SUCCESSFUL +TA1 - rtems_task_start - start TA2 - RTEMS_SUCCESSFUL +TA1 - rtems_task_wake_after - yield processor - RTEMS_SUCCESSFUL +TA2 - rtems_task_delete - delete self - RTEMS_SUCCESSFUL +TA1 - rtems_task_delete TA2 - already deleted RTEMS_INVALID_ID +*** END TEST TASK ERROR 01 *** diff --git a/testsuites/sptests/sptask_err01/system.h b/testsuites/sptests/sptask_err01/system.h new file mode 100644 index 0000000000..6b6ace72e0 --- /dev/null +++ b/testsuites/sptests/sptask_err01/system.h @@ -0,0 +1,51 @@ +/* + * This include file contains information that is included in every + * function in the test set. + */ + +/* + * COPYRIGHT (c) 1989-2014. + * 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. + */ + +#include <tmacros.h> + +/* functions */ + +rtems_task Init( + rtems_task_argument argument +); + +rtems_task Task_2( + rtems_task_argument argument +); + +/* configuration information */ + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 10 +#define CONFIGURE_MAXIMUM_TIMERS 1 +#define CONFIGURE_MAXIMUM_SEMAPHORES 2 +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 +#define CONFIGURE_MAXIMUM_PERIODS 1 +#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0 +#define CONFIGURE_TICKS_PER_TIMESLICE 100 + +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_EXTRA_TASK_STACKS (20 * RTEMS_MINIMUM_STACK_SIZE) + +#include <rtems/confdefs.h> + +/* global variables */ + +TEST_EXTERN rtems_id Task_id[ 11 ]; /* array of task ids */ +TEST_EXTERN rtems_name Task_name[ 11 ]; /* array of task names */ + +/* end of include file */ diff --git a/testsuites/sptests/sptask_err01/task2.c b/testsuites/sptests/sptask_err01/task2.c new file mode 100644 index 0000000000..c187fa7aeb --- /dev/null +++ b/testsuites/sptests/sptask_err01/task2.c @@ -0,0 +1,34 @@ +/* Task_2 + * + * This routine serves as a test task. Its only purpose is to generate the + * error where a semaphore is deleted while a task is waiting for it. + * + * 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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "system.h" + +rtems_task Task_2( + rtems_task_argument argument +) +{ + rtems_status_code status; + + puts( "TA2 - rtems_task_delete - delete self - RTEMS_SUCCESSFUL" ); + status = rtems_task_delete( RTEMS_SELF ); + directive_failed( status, "rtems_task_delete of TA2" ); +} |