diff options
Diffstat (limited to 'testsuites/sptests/sp02')
-rw-r--r-- | testsuites/sptests/sp02/init.c | 152 | ||||
-rw-r--r-- | testsuites/sptests/sp02/preempt.c | 32 | ||||
-rw-r--r-- | testsuites/sptests/sp02/sp02.doc | 37 | ||||
-rw-r--r-- | testsuites/sptests/sp02/sp02.scn | 15 | ||||
-rw-r--r-- | testsuites/sptests/sp02/system.h | 58 | ||||
-rw-r--r-- | testsuites/sptests/sp02/task1.c | 66 | ||||
-rw-r--r-- | testsuites/sptests/sp02/task2.c | 34 | ||||
-rw-r--r-- | testsuites/sptests/sp02/task3.c | 37 |
8 files changed, 0 insertions, 431 deletions
diff --git a/testsuites/sptests/sp02/init.c b/testsuites/sptests/sp02/init.c deleted file mode 100644 index b7be2dd680..0000000000 --- a/testsuites/sptests/sp02/init.c +++ /dev/null @@ -1,152 +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; - - puts( "\n\n*** TEST 2 ***" ); - - Preempt_task_name = rtems_build_name( 'P', 'R', 'M', 'T' ); - - status = rtems_task_create( - Preempt_task_name, - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Preempt_task_id - ); - directive_failed( status, "rtems_task_create of RTEMS_PREEMPT" ); - - status = rtems_task_start( Preempt_task_id, Preempt_task, 0 ); - directive_failed( status, "rtems_task_start of RTEMS_PREEMPT" ); - - puts( "INIT - rtems_task_wake_after - yielding processor" ); - status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); - directive_failed( status, "rtems_task_wake_after" ); - - Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); - Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' ); - Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' ); - - status = rtems_task_create( - Task_name[ 1 ], - 3, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create of TA1" ); - - status = rtems_task_create( - Task_name[ 2 ], - 3, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 2 ] - ); - directive_failed( status, "rtems_task_create of TA2" ); - - status = rtems_task_create( - Task_name[ 3 ], - 3, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 3 ] - ); - directive_failed( status, "rtems_task_create of TA3" ); - - status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); - directive_failed( status, "rtems_task_start of TA1" ); - - status = rtems_task_start( Task_id[ 2 ], Task_2, 0 ); - directive_failed( status, "rtems_task_start of TA2" ); - - status = rtems_task_start( Task_id[ 3 ], Task_3, 0 ); - directive_failed( status, "rtems_task_start of TA3" ); - - puts( "INIT - suspending TA2 while middle task on a ready chain" ); - status = rtems_task_suspend( Task_id[ 2 ] ); - directive_failed( status, "rtems_task_suspend of TA2" ); - - status = rtems_task_delete( Task_id[ 1 ] ); - directive_failed( status, "rtems_task_delete of TA1" ); - - status = rtems_task_delete( Task_id[ 2 ] ); - directive_failed( status, "rtems_task_delete of TA2" ); - - status = rtems_task_delete( Task_id[ 3 ] ); - directive_failed( status, "rtems_task_delete of TA3" ); - - 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_create( - Task_name[ 2 ], - 3, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 2 ] - ); - directive_failed( status, "rtems_task_create of TA2" ); - - status = rtems_task_create( - Task_name[ 3 ], - 3, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 3 ] - ); - directive_failed( status, "rtems_task_create of TA3" ); - - status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); - directive_failed( status, "rtems_task_start of TA1" ); - - status = rtems_task_start( Task_id[ 2 ], Task_2, 0 ); - directive_failed( status, "rtems_task_start of TA2" ); - - status = rtems_task_start( Task_id[ 3 ], Task_3, 0 ); - directive_failed( status, "rtems_task_start of TA3" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/sptests/sp02/preempt.c b/testsuites/sptests/sp02/preempt.c deleted file mode 100644 index 7e93f7af57..0000000000 --- a/testsuites/sptests/sp02/preempt.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Preempt_task - * - * 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 Preempt_task( - rtems_task_argument argument -) -{ - rtems_status_code status; - - puts( "PREEMPT - rtems_task_delete - deleting self" ); - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_PREEMPT" ); -} diff --git a/testsuites/sptests/sp02/sp02.doc b/testsuites/sptests/sp02/sp02.doc deleted file mode 100644 index 00f2e0e7b3..0000000000 --- a/testsuites/sptests/sp02/sp02.doc +++ /dev/null @@ -1,37 +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: test2 - -directives: - ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident, - t_delete, tm_wkafter, t_setpri, t_suspend - -concepts: - - a. Verifies that a task can delete another task and also delete itself. - - b. Verifies that memory is freed back to the heap correctly. - - c. Verifies that TCBs are freed back to the inactive chain correctly. - - d. Verifies that a task can get the task identification number of - another task. - - e. Verifies the _Set_state routine where the task is not READY. - - f. Verifies the break statement in the _Block_activate routine. - - g. Verifies the while loop in the _Prev_tcb routine. diff --git a/testsuites/sptests/sp02/sp02.scn b/testsuites/sptests/sp02/sp02.scn deleted file mode 100644 index d3f3d61cd1..0000000000 --- a/testsuites/sptests/sp02/sp02.scn +++ /dev/null @@ -1,15 +0,0 @@ -*** TEST 2 *** -INIT - rtems_task_wake_after - yielding processor -PREEMPT - rtems_task_delete - deleting self -INIT - suspending TA2 while middle task on a ready chain -TA1 - rtems_task_wake_after - sleep 1 second -TA2 - rtems_task_wake_after - sleep 1 minute -TA3 - rtems_task_wake_after - sleep 5 seconds -TA1 - rtems_task_ident - tid of TA2 (0x08010007) -TA1 - rtems_task_ident - tid of TA3 (0x08010008) -TA1 - rtems_task_set_priority - set TA3's priority to 2 -TA1 - rtems_task_suspend - suspend TA2 -TA1 - rtems_task_delete - delete TA2 -TA1 - rtems_task_wake_after - sleep for 5 seconds -TA3 - rtems_task_delete - delete self -*** END OF TEST 2 *** diff --git a/testsuites/sptests/sp02/system.h b/testsuites/sptests/sp02/system.h deleted file mode 100644 index 95cae6c0e2..0000000000 --- a/testsuites/sptests/sp02/system.h +++ /dev/null @@ -1,58 +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 -); - -rtems_task Preempt_task( - rtems_task_argument argument -); - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Task_2( - rtems_task_argument argument -); - -rtems_task Task_3( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_SPTEST - -#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER - -#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_id Preempt_task_id; /* preempt task id */ -TEST_EXTERN rtems_name Preempt_task_name; /* preempt task name */ - -/* end of include file */ diff --git a/testsuites/sptests/sp02/task1.c b/testsuites/sptests/sp02/task1.c deleted file mode 100644 index 0f6152dbb2..0000000000 --- a/testsuites/sptests/sp02/task1.c +++ /dev/null @@ -1,66 +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 -) -{ - rtems_id tid2; - rtems_id tid3; - rtems_status_code status; - rtems_unsigned32 previous_priority; - - puts( "TA1 - rtems_task_wake_after - sleep 1 second" ); - status = rtems_task_wake_after( 1*TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after" ); - - status = rtems_task_ident( Task_name[ 2 ], RTEMS_SEARCH_ALL_NODES, &tid2 ); - directive_failed( status, "rtems_task_ident of TA2" ); - - printf( "TA1 - rtems_task_ident - tid of TA2 (0x%.8x)\n", tid2 ); - - status = rtems_task_ident( Task_name[ 3 ], RTEMS_SEARCH_ALL_NODES, &tid3 ); - directive_failed( status, "rtems_task_ident of TA3" ); - - printf( "TA1 - rtems_task_ident - tid of TA3 (0x%.8x)\n", tid3 ); - - status = rtems_task_set_priority( tid3, 2, &previous_priority ); - directive_failed( status, "rtems_task_set_priority" ); - - puts( "TA1 - rtems_task_set_priority - set TA3's priority to 2" ); - - - puts( "TA1 - rtems_task_suspend - suspend TA2" ); - status = rtems_task_suspend( tid2 ); - directive_failed( status, "rtems_task_suspend of TA2" ); - - puts( "TA1 - rtems_task_delete - delete TA2" ); - status = rtems_task_delete( tid2 ); - directive_failed( status, "rtems_task_delete of TA2" ); - - puts( "TA1 - rtems_task_wake_after - sleep for 5 seconds" ); - status = rtems_task_wake_after( 5*TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after" ); - - puts( "*** END OF TEST 2 ***" ); - exit( 0 ); -} diff --git a/testsuites/sptests/sp02/task2.c b/testsuites/sptests/sp02/task2.c deleted file mode 100644 index f39cc5b9fc..0000000000 --- a/testsuites/sptests/sp02/task2.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Task_2 - * - * This routine serves as a test task. It sleeps for 1 minute but - * does not expect to wake up. Task 1 should suspend then delete it - * so that it appears to never wake up. - * - * 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_2( - rtems_task_argument argument -) -{ - rtems_status_code status; - - puts( "TA2 - rtems_task_wake_after - sleep 1 minute" ); - status = rtems_task_wake_after( 60*TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after in TA2" ); -} diff --git a/testsuites/sptests/sp02/task3.c b/testsuites/sptests/sp02/task3.c deleted file mode 100644 index 89bda38b7c..0000000000 --- a/testsuites/sptests/sp02/task3.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Task_3 - * - * This routine serves as a test task. It simply sleeps for 5 seconds - * and then deletes itself. - * - * 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_3( - rtems_task_argument argument -) -{ - rtems_status_code status; - - puts( "TA3 - rtems_task_wake_after - sleep 5 seconds" ); - status = rtems_task_wake_after( 5*TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after in TA3" ); - - puts( "TA3 - rtems_task_delete - delete self" ); - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of TA3" ); -} |