From ac7d5ef06a6d6e8d84abbd1f0b82162725f98326 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 11 May 1995 17:39:37 +0000 Subject: Initial revision --- testsuites/sptests/sp09/delay.c | 28 ++++ testsuites/sptests/sp09/init.c | 123 ++++++++++++++ testsuites/sptests/sp09/isr.c | 27 +++ testsuites/sptests/sp09/screen01.c | 168 +++++++++++++++++++ testsuites/sptests/sp09/screen02.c | 192 ++++++++++++++++++++++ testsuites/sptests/sp09/screen03.c | 204 +++++++++++++++++++++++ testsuites/sptests/sp09/screen04.c | 85 ++++++++++ testsuites/sptests/sp09/screen05.c | 148 +++++++++++++++++ testsuites/sptests/sp09/screen06.c | 125 ++++++++++++++ testsuites/sptests/sp09/screen07.c | 184 +++++++++++++++++++++ testsuites/sptests/sp09/screen08.c | 121 ++++++++++++++ testsuites/sptests/sp09/screen09.c | 140 ++++++++++++++++ testsuites/sptests/sp09/screen10.c | 164 +++++++++++++++++++ testsuites/sptests/sp09/screen11.c | 250 ++++++++++++++++++++++++++++ testsuites/sptests/sp09/screen12.c | 327 +++++++++++++++++++++++++++++++++++++ testsuites/sptests/sp09/screen13.c | 115 +++++++++++++ testsuites/sptests/sp09/screen14.c | 162 ++++++++++++++++++ testsuites/sptests/sp09/sp09.doc | 36 ++++ testsuites/sptests/sp09/sp09.scn | 249 ++++++++++++++++++++++++++++ testsuites/sptests/sp09/system.h | 30 ++++ testsuites/sptests/sp09/task1.c | 74 +++++++++ testsuites/sptests/sp09/task2.c | 48 ++++++ testsuites/sptests/sp09/task3.c | 51 ++++++ testsuites/sptests/sp09/task4.c | 50 ++++++ 24 files changed, 3101 insertions(+) create mode 100644 testsuites/sptests/sp09/delay.c create mode 100644 testsuites/sptests/sp09/init.c create mode 100644 testsuites/sptests/sp09/isr.c create mode 100644 testsuites/sptests/sp09/screen01.c create mode 100644 testsuites/sptests/sp09/screen02.c create mode 100644 testsuites/sptests/sp09/screen03.c create mode 100644 testsuites/sptests/sp09/screen04.c create mode 100644 testsuites/sptests/sp09/screen05.c create mode 100644 testsuites/sptests/sp09/screen06.c create mode 100644 testsuites/sptests/sp09/screen07.c create mode 100644 testsuites/sptests/sp09/screen08.c create mode 100644 testsuites/sptests/sp09/screen09.c create mode 100644 testsuites/sptests/sp09/screen10.c create mode 100644 testsuites/sptests/sp09/screen11.c create mode 100644 testsuites/sptests/sp09/screen12.c create mode 100644 testsuites/sptests/sp09/screen13.c create mode 100644 testsuites/sptests/sp09/screen14.c create mode 100644 testsuites/sptests/sp09/sp09.doc create mode 100644 testsuites/sptests/sp09/sp09.scn create mode 100644 testsuites/sptests/sp09/system.h create mode 100644 testsuites/sptests/sp09/task1.c create mode 100644 testsuites/sptests/sp09/task2.c create mode 100644 testsuites/sptests/sp09/task3.c create mode 100644 testsuites/sptests/sp09/task4.c (limited to 'testsuites/sptests/sp09') diff --git a/testsuites/sptests/sp09/delay.c b/testsuites/sptests/sp09/delay.c new file mode 100644 index 0000000000..dd78610be8 --- /dev/null +++ b/testsuites/sptests/sp09/delay.c @@ -0,0 +1,28 @@ +/* Delayed_routine + * + * This routine is used as the timer routine for Timer Manager tests. + * + * Input parameters: + * ignored - this parameter is ignored + * + * 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_timer_service_routine Delayed_routine( + rtems_id ignored_id, + void *ignored_address +) +{ +} diff --git a/testsuites/sptests/sp09/init.c b/testsuites/sptests/sp09/init.c new file mode 100644 index 0000000000..3ca4b62404 --- /dev/null +++ b/testsuites/sptests/sp09/init.c @@ -0,0 +1,123 @@ +/* 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$ + */ + +#include "system.h" +#undef EXTERN +#define EXTERN +#include "conftbl.h" +#include "gvar.h" + +rtems_task Init( + rtems_task_argument argument +) +{ + rtems_status_code status; + + puts( "\n\n*** TEST 9 ***" ); + + 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', ' ' ); + Task_name[ 4 ] = rtems_build_name( 'T', 'A', '4', ' ' ); + Task_name[ 5 ] = rtems_build_name( 'T', 'A', '5', ' ' ); + Task_name[ 6 ] = rtems_build_name( 'T', 'A', '6', ' ' ); + Task_name[ 7 ] = rtems_build_name( 'T', 'A', '7', ' ' ); + Task_name[ 8 ] = rtems_build_name( 'T', 'A', '8', ' ' ); + Task_name[ 9 ] = rtems_build_name( 'T', 'A', '9', ' ' ); + Task_name[ 10 ] = rtems_build_name( 'T', 'A', 'A', ' ' ); + + Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' ); + + Semaphore_name[ 1 ] = rtems_build_name( 'S', 'M', '1', ' ' ); + Semaphore_name[ 2 ] = rtems_build_name( 'S', 'M', '2', ' ' ); + Semaphore_name[ 3 ] = rtems_build_name( 'S', 'M', '3', ' ' ); + + Queue_name[ 1 ] = rtems_build_name( 'M', 'Q', '1', ' ' ); + Queue_name[ 2 ] = rtems_build_name( 'M', 'Q', '2', ' ' ); + + Partition_name[ 1 ] = rtems_build_name( 'P', 'T', '1', ' ' ); + + Region_name[ 1 ] = rtems_build_name( 'R', 'N', '1', ' ' ); + + Port_name[ 1 ] = rtems_build_name( 'D', 'P', '1', ' ' ); + + Period_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' ); + +#if 0 + status = rtems_task_create( + Task_name[1], + 4, + 10, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 1 ] + ); + fatal_directive_status( + status, + RTEMS_INVALID_SIZE, + "rtems_task_create with illegal stack size" + ); + puts( "INIT - rtems_task_create - RTEMS_INVALID_SIZE" ); +#endif + puts( "INIT - rtems_task_create - RTEMS_INVALID_SIZE -- NOT CHECKED" ); + + status = rtems_task_create( + Task_name[1], + 0, + 2048, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 1 ] + ); + fatal_directive_status( + status, + RTEMS_INVALID_PRIORITY, + "rtems_task_create with illegal priority" + ); + puts( "INIT - rtems_task_create - RTEMS_INVALID_PRIORITY" ); + + status = rtems_task_create( + Task_name[ 1 ], + 4, + 2048, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 1 ] + ); + directive_failed( status, "rtems_task_create of TA1" ); + + status = rtems_task_restart( Task_id[ 1 ], 0 ); + fatal_directive_status( + status, + RTEMS_INCORRECT_STATE, + "rtems_task_restart of DORMANT task" + ); + puts( "INIT - rtems_task_restart - RTEMS_INCORRECT_STATE" ); + + 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/sp09/isr.c b/testsuites/sptests/sp09/isr.c new file mode 100644 index 0000000000..292e9c0225 --- /dev/null +++ b/testsuites/sptests/sp09/isr.c @@ -0,0 +1,27 @@ +/* Service_routine + * + * This routine is used as the timer routine for Interrupt Manager tests. + * + * Input parameters: + * ignored - this parameter is ignored + * + * 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_isr Service_routine( + rtems_vector_number ignored +) +{ +} diff --git a/testsuites/sptests/sp09/screen01.c b/testsuites/sptests/sp09/screen01.c new file mode 100644 index 0000000000..39012f5051 --- /dev/null +++ b/testsuites/sptests/sp09/screen01.c @@ -0,0 +1,168 @@ +/* Screen1 + * + * This routine generates error screen 1 for test 9. + * + * Input parameters: NONE + * + * 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" + +void Screen1() +{ + rtems_unsigned32 notepad_value; + rtems_id self_id; + rtems_task_priority previous_priority; + rtems_status_code status; + + status = rtems_task_delete( 100 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_task_delete with illegal id" + ); + puts( "TA1 - rtems_task_delete - RTEMS_INVALID_ID" ); + + status = rtems_task_get_note( RTEMS_SELF, 100, ¬epad_value ); + fatal_directive_status( + status, + RTEMS_INVALID_NUMBER, + "rtems_task_get_note with illegal notepad" + ); + puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_NUMBER" ); + + status = rtems_task_get_note( 100, RTEMS_NOTEPAD_LAST, ¬epad_value ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_task_get_note with illegal id" + ); + puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_ID" ); + + status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &self_id ); + directive_failed( status, "rtems_task_ident of self" ); + + if ( self_id != Task_id[ 1 ] ) { + puts( "ERROR - rtems_task_ident - incorrect ID returned!" ); + } + puts( "TA1 - rtems_task_ident - current task RTEMS_SUCCESSFUL" ); + + status = rtems_task_ident( 100, RTEMS_SEARCH_ALL_NODES, &Junk_id ); + fatal_directive_status( + status, + RTEMS_INVALID_NAME, + "rtems_task_ident with illegal name (local)" + ); + puts( "TA1 - rtems_task_ident - global RTEMS_INVALID_NAME" ); + + status = rtems_task_ident( 100, 1, &Junk_id ); + fatal_directive_status( + status, + RTEMS_INVALID_NAME, + "rtems_task_ident with illegal name (global)" + ); + puts( "TA1 - rtems_task_ident - local RTEMS_INVALID_NAME" ); + + status = rtems_task_ident( 100, 2, &Junk_id ); + fatal_directive_status( + status, + RTEMS_INVALID_NODE, + "rtems_task_ident with illegal node" + ); + puts( "TA1 - rtems_task_ident - RTEMS_INVALID_NODE" ); + + status = rtems_task_restart( 100, 0 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_task_restart with illegal id" + ); + puts( "TA1 - rtems_task_restart - RTEMS_INVALID_ID" ); + + status = rtems_task_resume( 100 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_task_resume with illegal id" + ); + puts( "TA1 - rtems_task_resume - RTEMS_INVALID_ID" ); + + status = rtems_task_resume( RTEMS_SELF ); + fatal_directive_status( + status, + RTEMS_INCORRECT_STATE, + "rtems_task_resume of ready task" + ); + puts( "TA1 - rtems_task_resume - RTEMS_INCORRECT_STATE" ); + + status = rtems_task_set_priority( RTEMS_SELF, 512, &previous_priority ); + fatal_directive_status( + status, + RTEMS_INVALID_PRIORITY, + "rtems_task_set_priority with illegal priority" + ); + puts( "TA1 - rtems_task_set_priority - RTEMS_INVALID_PRIORITY" ); + + status = rtems_task_set_priority( 100, 8, &previous_priority ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_task_set_priority with illegal id" + ); + puts( "TA1 - rtems_task_set_priority - RTEMS_INVALID_ID" ); + + status = rtems_task_set_note( + RTEMS_SELF, + RTEMS_NOTEPAD_LAST+10, + notepad_value + ); + fatal_directive_status( + status, + RTEMS_INVALID_NUMBER, + "rtems_task_set_note with illegal notepad" + ); + puts( "TA1 - rtems_task_set_note - RTEMS_INVALID_NUMBER" ); + + status = rtems_task_set_note( 100, RTEMS_NOTEPAD_LAST, notepad_value ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_task_set_note with illegal id" + ); + puts( "TA1 - rtems_task_set_note - RTEMS_INVALID_ID" ); + + status = rtems_task_start( 100, Task_1, 0 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_task_start with illegal id" + ); + puts( "TA1 - rtems_task_start - RTEMS_INVALID_ID" ); + + status = rtems_task_start( 0, Task_1, 0 ); + fatal_directive_status( + status, + RTEMS_INCORRECT_STATE, + "rtems_task_start of ready task" + ); + puts( "TA1 - rtems_task_start - RTEMS_INCORRECT_STATE" ); + + status = rtems_task_suspend( 100 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_task_suspend with illegal id" + ); + puts( "TA1 - rtems_task_suspend - RTEMS_INVALID_ID" ); +} diff --git a/testsuites/sptests/sp09/screen02.c b/testsuites/sptests/sp09/screen02.c new file mode 100644 index 0000000000..02eb5e4498 --- /dev/null +++ b/testsuites/sptests/sp09/screen02.c @@ -0,0 +1,192 @@ +/* Screen2 + * + * This routine generates error screen 2 for test 9. + * + * Input parameters: NONE + * + * 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" + +void Screen2() +{ + rtems_time_of_day time; + rtems_status_code status; + +/* errors before clock is set */ + + status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); + if ( status == RTEMS_SUCCESSFUL ) { + puts( + "TA1 - rtems_clock_get - RTEMS_NOT_DEFINED -- DID BSP SET THE TIME OF DAY?" + ); + } else { + fatal_directive_status( + status, + RTEMS_NOT_DEFINED, + "rtems_clock_get before clock is set" + ); + puts( "TA1 - rtems_clock_get - RTEMS_NOT_DEFINED" ); + } + + status = rtems_task_wake_when( &time ); + if ( status == RTEMS_SUCCESSFUL ) { + puts( +"TA1 - rtems_task_wake_when - RTEMS_NOT_DEFINED -- DID BSP SET THE TIME OF DAY?" + ); + } else { + fatal_directive_status( + status, + RTEMS_NOT_DEFINED, + "rtems_task_wake_when before clock is set" + ); + puts( "TA1 - rtems_task_wake_when - RTEMS_NOT_DEFINED" ); + } + + status = rtems_timer_fire_when( 0, &time, Delayed_routine, NULL ); + if ( status == RTEMS_SUCCESSFUL ) { + puts( + "TA1 - timer_wake_when - RTEMS_NOT_DEFINED -- DID BSP SET THE TIME OF DAY?" + ); + } else { + fatal_directive_status( + status, + RTEMS_NOT_DEFINED, + "task_fire_when before clock is set" + ); + puts( "TA1 - rtems_timer_fire_when - RTEMS_NOT_DEFINED" ); + } + + build_time( &time, 2, 5, 1987, 8, 30, 45, 0 ); + print_time( "TA1 - rtems_clock_set - ", &time, "" ); + status = rtems_clock_set( &time ); + fatal_directive_status( + status, + RTEMS_INVALID_CLOCK, + "rtems_clock_set with invalid year" + ); + puts( " - RTEMS_INVALID_CLOCK" ); + + build_time( &time, 15, 5, 1988, 8, 30, 45, 0 ); + print_time( "TA1 - rtems_clock_set - ", &time, "" ); + status = rtems_clock_set( &time ); + fatal_directive_status( + status, + RTEMS_INVALID_CLOCK, + "rtems_clock_set with invalid month" + ); + puts( " - RTEMS_INVALID_CLOCK" ); + + build_time( &time, 2, 32, 1988, 8, 30, 45, 0 ); + print_time( "TA1 - rtems_clock_set - ", &time, "" ); + status = rtems_clock_set( &time ); + fatal_directive_status( + status, + RTEMS_INVALID_CLOCK, + "rtems_clock_set with invalid day" + ); + puts( " - RTEMS_INVALID_CLOCK" ); + + build_time( &time, 2, 5, 1988, 25, 30, 45, 0 ); + print_time( "TA1 - rtems_clock_set - ", &time, "" ); + status = rtems_clock_set( &time ); + fatal_directive_status( + status, + RTEMS_INVALID_CLOCK, + "rtems_clock_set with invalid hour" + ); + puts( " - RTEMS_INVALID_CLOCK" ); + + build_time( &time, 2, 5, 1988, 8, 61, 45, 0 ); + print_time( "TA1 - rtems_clock_set - ", &time, "" ); + status = rtems_clock_set( &time ); + fatal_directive_status( + status, + RTEMS_INVALID_CLOCK, + "rtems_clock_set with invalid minute" + ); + puts( " - RTEMS_INVALID_CLOCK" ); + + build_time( &time, 2, 5, 1988, 8, 30, 61, 0 ); + print_time( "TA1 - rtems_clock_set - ", &time, "" ); + status = rtems_clock_set( &time ); + fatal_directive_status( + status, + RTEMS_INVALID_CLOCK, + "rtems_clock_set with invalid second" + ); + puts( " - RTEMS_INVALID_CLOCK" ); + + build_time( &time, 2, 5, 1988, 8, 30, 45, TICKS_PER_SECOND + 1 ); + print_time( "TA1 - rtems_clock_set - ", &time, "" ); + status = rtems_clock_set( &time ); + fatal_directive_status( + status, + RTEMS_INVALID_CLOCK, + "rtems_clock_set with invalid ticks per second" + ); + puts( " - RTEMS_INVALID_CLOCK" ); + + build_time( &time, 2, 5, 1988, 8, 30, 45, 0 ); + print_time( "TA1 - rtems_clock_set - ", &time, "" ); + status = rtems_clock_set( &time ); + directive_failed( status, "rtems_clock_set successful" ); + puts( " - RTEMS_SUCCESSFUL" ); + +/* rtems_task_wake_when */ + + build_time( &time, 2, 5, 1988, 8, 30, 48, TICKS_PER_SECOND + 1 ); + time.second += 3; + puts( "TA1 - rtems_task_wake_when - TICKINVALID - sleep about 3 seconds" ); + + status = rtems_task_wake_when( &time ); + directive_failed( + status, + "rtems_task_wake_when with invalid ticks per second" + ); + puts( "TA1 - rtems_task_wake_when - TICKINVALID - woke up RTEMS_SUCCESSFUL" ); + + build_time( &time, 2, 5, 1961, 8, 30, 48, 0 ); + print_time( "TA1 - rtems_task_wake_when - ", &time, "" ); + status = rtems_task_wake_when( &time ); + fatal_directive_status( + status, + RTEMS_INVALID_CLOCK, + "rtems_task_wake_when with invalid year" + ); + puts( " - RTEMS_INVALID_CLOCK" ); + + build_time( &time, 2, 5, 1988, 25, 30, 48, 0 ); + print_time( "TA1 - rtems_task_wake_when - ", &time, "" ); + status = rtems_task_wake_when( &time ); + fatal_directive_status( + status, + RTEMS_INVALID_CLOCK, + "rtems_task_wake_when with invalid hour" + ); + puts( " - RTEMS_INVALID_CLOCK" ); + + rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); + print_time( "TA1 - current time - ", &time, "\n" ); + + time.month = 1; + print_time( "TA1 - rtems_task_wake_when - ", &time, "" ); + status = rtems_task_wake_when( &time ); + fatal_directive_status( + status, + RTEMS_INVALID_CLOCK, + "rtems_task_wake_when before current time" + ); + puts( " - RTEMS_INVALID_CLOCK" ); +} diff --git a/testsuites/sptests/sp09/screen03.c b/testsuites/sptests/sp09/screen03.c new file mode 100644 index 0000000000..7f431c45df --- /dev/null +++ b/testsuites/sptests/sp09/screen03.c @@ -0,0 +1,204 @@ +/* Screen3 + * + * This routine generates error screen 3 for test 9. + * + * Input parameters: NONE + * + * 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" + +extern rtems_configuration_table BSP_Configuration; + +void Screen3() +{ + rtems_name task_name; + rtems_status_code status; + + task_name = 1; + status = rtems_task_create( + 0, + 1, + 2048, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_INVALID_NAME, + "rtems_task_create with illegal name" + ); + puts( "TA1 - rtems_task_create - RTEMS_INVALID_NAME" ); + + status = rtems_task_create( + task_name, + 1, + BSP_Configuration.work_space_size, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_UNSATISFIED, + "rtems_task_create with a stack size larger than the workspace" + ); + puts( "TA1 - rtems_task_create - stack size - RTEMS_UNSATISFIED" ); + + status = rtems_task_create( + Task_name[ 2 ], + 4, + 2048, + 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" ); + + status = rtems_task_suspend( Task_id[ 2 ] ); + directive_failed( status, "rtems_task_suspend of TA2" ); + puts( "TA1 - rtems_task_suspend - suspend TA2 - RTEMS_SUCCESSFUL" ); + + status = rtems_task_suspend( Task_id[ 2 ] ); + fatal_directive_status( + status, + RTEMS_ALREADY_SUSPENDED, + "rtems_task_suspend of suspended TA2" + ); + puts( "TA1 - rtems_task_suspend - suspend TA2 - RTEMS_ALREADY_SUSPENDED" ); + + status = rtems_task_resume( Task_id[ 2 ] ); + directive_failed( status, "rtems_task_resume of TA2" ); + puts( "TA1 - rtems_task_resume - TA2 resumed - RTEMS_SUCCESSFUL" ); + + status = rtems_task_create( + Task_name[ 3 ], + 4, + 2048, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 3 ] + ); + directive_failed( status, "rtems_task_create of TA3" ); + puts( "TA1 - rtems_task_create - TA3 created - RTEMS_SUCCESSFUL" ); + + status = rtems_task_create( + Task_name[ 4 ], + 4, + 2048, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 4 ] + ); + directive_failed( status, "rtems_task_create of TA4" ); + puts( "TA1 - rtems_task_create - 4 created - RTEMS_SUCCESSFUL" ); + + status = rtems_task_create( + Task_name[ 5 ], + 4, + 2048, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 5 ] + ); + directive_failed( status, "rtems_task_create of TA5" ); + puts( "TA1 - rtems_task_create - 5 created - RTEMS_SUCCESSFUL" ); + + status = rtems_task_create( + Task_name[ 6 ], + 4, + 2048, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 6 ] + ); + directive_failed( status, "rtems_task_create of TA6" ); + puts( "TA1 - rtems_task_create - 6 created - RTEMS_SUCCESSFUL" ); + + status = rtems_task_create( + Task_name[ 7 ], + 4, + 2048, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 7 ] + ); + directive_failed( status, "rtems_task_create of TA7" ); + puts( "TA1 - rtems_task_create - 7 created - RTEMS_SUCCESSFUL" ); + + status = rtems_task_create( + Task_name[ 8 ], + 4, + 2048, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 8 ] + ); + directive_failed( status, "rtems_task_create of TA8" ); + puts( "TA1 - rtems_task_create - 8 created - RTEMS_SUCCESSFUL" ); + + status = rtems_task_create( + Task_name[ 9 ], + 4, + 2048, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 9 ] + ); + directive_failed( status, "rtems_task_create of TA9" ); + puts( "TA1 - rtems_task_create - 9 created - RTEMS_SUCCESSFUL" ); + + status = rtems_task_create( + Task_name[ 10 ], + 4, + 2048, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 10 ] + ); + directive_failed( status, "rtems_task_create of TA10" ); + puts( "TA1 - rtems_task_create - 10 created - RTEMS_SUCCESSFUL" ); + + status = rtems_task_create( + task_name, + 4, + 2048, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_TOO_MANY, + "rtems_task_create for too many tasks" + ); + puts( "TA1 - rtems_task_create - 11 - RTEMS_TOO_MANY" ); + + status = rtems_task_create( + task_name, + 4, + 2048, + RTEMS_DEFAULT_MODES, + RTEMS_GLOBAL, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_MP_NOT_CONFIGURED, + "rtems_task_create of global task in a single cpu system" + ); + puts( "TA1 - rtems_task_create - RTEMS_MP_NOT_CONFIGURED" ); +} diff --git a/testsuites/sptests/sp09/screen04.c b/testsuites/sptests/sp09/screen04.c new file mode 100644 index 0000000000..6e3866cb05 --- /dev/null +++ b/testsuites/sptests/sp09/screen04.c @@ -0,0 +1,85 @@ +/* Screen4 + * + * This routine generates error screen 4 for test 9. + * + * Input parameters: NONE + * + * 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" + +void Screen4() +{ + rtems_event_set event_out; + rtems_time_of_day time; + rtems_status_code status; + + status = rtems_event_receive( + RTEMS_EVENT_16, + RTEMS_NO_WAIT, + RTEMS_NO_TIMEOUT, + &event_out + ); + fatal_directive_status( + status, + RTEMS_UNSATISFIED, + "rtems_event_receive unsatisfied (ALL)" + ); + puts( "TA1 - rtems_event_receive - RTEMS_UNSATISFIED ( all conditions )" ); + + status = rtems_event_receive( + RTEMS_EVENT_16, + RTEMS_EVENT_ANY | RTEMS_NO_WAIT, + RTEMS_NO_TIMEOUT, + &event_out + ); + fatal_directive_status( + status, + RTEMS_UNSATISFIED, + "rtems_event_receive unsatisfied (ANY)" + ); + puts( "TA1 - rtems_event_receive - RTEMS_UNSATISFIED ( any condition )" ); + + puts( "TA1 - rtems_event_receive - timeout in 3 seconds" ); + status = rtems_event_receive( + RTEMS_EVENT_16, + RTEMS_DEFAULT_OPTIONS, + 3 * TICKS_PER_SECOND, + &event_out + ); + fatal_directive_status( + status, + RTEMS_TIMEOUT, + "rtems_event_receive" + ); + puts( "TA1 - rtems_event_receive - woke up with RTEMS_TIMEOUT" ); + + status = rtems_event_send( 100, RTEMS_EVENT_16 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_event_send with illegal id" + ); + puts( "TA1 - rtems_event_send - RTEMS_INVALID_ID" ); + + puts( "TA1 - rtems_task_wake_after - sleep 1 second - RTEMS_SUCCESSFUL" ); + status = rtems_task_wake_after( TICKS_PER_SECOND ); + directive_failed( status, "rtems_task_wake_after" ); + + build_time( &time, 2, 5, 1988, 8, 30, 45, 0 ); + print_time( "TA1 - rtems_clock_set - ", &time, "" ); + status = rtems_clock_set( &time ); + directive_failed( status, "rtems_clock_set" ); + puts( " - RTEMS_SUCCESSFUL" ); +} diff --git a/testsuites/sptests/sp09/screen05.c b/testsuites/sptests/sp09/screen05.c new file mode 100644 index 0000000000..9b091a407a --- /dev/null +++ b/testsuites/sptests/sp09/screen05.c @@ -0,0 +1,148 @@ +/* Screen5 + * + * This routine generates error screen 5 for test 9. + * + * Input parameters: NONE + * + * 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" + +void Screen5() +{ + rtems_status_code status; + + status = rtems_semaphore_create( 0, 1, RTEMS_DEFAULT_ATTRIBUTES, &Junk_id ); + fatal_directive_status( + status, + RTEMS_INVALID_NAME, + "rtems_semaphore_create with illegal name" + ); + puts( "TA1 - rtems_semaphore_create - RTEMS_INVALID_NAME" ); + + status = rtems_semaphore_create( + Semaphore_name[ 1 ], + 1, + RTEMS_DEFAULT_ATTRIBUTES, + &Semaphore_id[ 1 ] + ); + directive_failed( status, "rtems_semaphore_create" ); + puts( "TA1 - rtems_semaphore_create - 1 - RTEMS_SUCCESSFUL" ); + + status = rtems_semaphore_create( + Semaphore_name[ 2 ], + 1, + RTEMS_BINARY_SEMAPHORE, + &Semaphore_id[ 2 ] + ); + directive_failed( status, "rtems_semaphore_create" ); + puts( "TA1 - rtems_semaphore_create - 2 - RTEMS_SUCCESSFUL" ); + + status = rtems_semaphore_create( + Semaphore_name[ 3 ], + 1, + RTEMS_DEFAULT_ATTRIBUTES, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_TOO_MANY, + "rtems_semaphore_create of too many" + ); + puts( "TA1 - rtems_semaphore_create - 3 - RTEMS_TOO_MANY" ); + + status = rtems_semaphore_create( + Semaphore_name[ 1 ], + 1, + RTEMS_INHERIT_PRIORITY | RTEMS_BINARY_SEMAPHORE | RTEMS_FIFO, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_NOT_DEFINED, + "rtems_semaphore_create of RTEMS_FIFO RTEMS_INHERIT_PRIORITY" + ); + puts( "TA1 - rtems_semaphore_create - RTEMS_NOT_DEFINED" ); + + status = rtems_semaphore_create( + Semaphore_name[ 1 ], + 1, + RTEMS_INHERIT_PRIORITY | RTEMS_COUNTING_SEMAPHORE | RTEMS_PRIORITY, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_NOT_DEFINED, + "rtems_semaphore_create of RTEMS_COUNTING_SEMAPHORE RTEMS_INHERIT_PRIORITY" + ); + puts( "TA1 - rtems_semaphore_create - RTEMS_NOT_DEFINED" ); + + status = rtems_semaphore_create( + Semaphore_name[ 1 ], + 2, + RTEMS_BINARY_SEMAPHORE, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_INVALID_NUMBER, + "rtems_semaphore_create of binary semaphore with count > 1" + ); + puts( "TA1 - rtems_semaphore_create - RTEMS_INVALID_NUMBER" ); + + status = rtems_semaphore_create( + Semaphore_name[ 3 ], + 1, + RTEMS_GLOBAL, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_MP_NOT_CONFIGURED, + "rtems_semaphore_create of mp not configured" + ); + puts( "TA1 - rtems_semaphore_create - RTEMS_MP_NOT_CONFIGURED" ); + + status = rtems_semaphore_delete( 100 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_semaphore_delete with illegal id" + ); + puts( "TA1 - rtems_semaphore_delete - unknown RTEMS_INVALID_ID" ); + + status = rtems_semaphore_delete( 0x010100 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_semaphore_delete with local illegal id" + ); + puts( "TA1 - rtems_semaphore_delete - local RTEMS_INVALID_ID" ); + + status = rtems_semaphore_ident( 100, RTEMS_SEARCH_ALL_NODES, &Junk_id ); + fatal_directive_status( + status, + RTEMS_INVALID_NAME, + "rtems_semaphore_ident will illegal name (local)" + ); + puts( "TA1 - rtems_semaphore_ident - global RTEMS_INVALID_NAME" ); + + status = rtems_semaphore_ident( 100, 1, &Junk_id ); + fatal_directive_status( + status, + RTEMS_INVALID_NAME, + "rtems_semaphore_ident will illegal name (global)" + ); + puts( "TA1 - rtems_semaphore_ident - local RTEMS_INVALID_NAME" ); +} diff --git a/testsuites/sptests/sp09/screen06.c b/testsuites/sptests/sp09/screen06.c new file mode 100644 index 0000000000..40ad75d606 --- /dev/null +++ b/testsuites/sptests/sp09/screen06.c @@ -0,0 +1,125 @@ +/* Screen6 + * + * This routine generates error screen 6 for test 9. + * + * Input parameters: NONE + * + * 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" + +void Screen6() +{ + rtems_status_code status; + + status = rtems_semaphore_obtain( + 100, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT + ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_semaphore_obtain with illegal id" + ); + puts( "TA1 - rtems_semaphore_obtain - RTEMS_INVALID_ID" ); + + status = rtems_semaphore_obtain( + Semaphore_id[ 1 ], + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT + ); + directive_failed( status, "rtems_semaphore_obtain successful" ); + puts( "TA1 - rtems_semaphore_obtain - got sem 1 - RTEMS_SUCCESSFUL" ); + + status = rtems_semaphore_obtain( + Semaphore_id[ 1 ], + RTEMS_NO_WAIT, + RTEMS_NO_TIMEOUT + ); + fatal_directive_status( + status, + RTEMS_UNSATISFIED, + "rtems_semaphore_obtain not available" + ); + puts( "TA1 - rtems_semaphore_obtain - RTEMS_UNSATISFIED" ); + + puts( "TA1 - rtems_semaphore_obtain - timeout in 3 seconds" ); + status = rtems_semaphore_obtain( + Semaphore_id[ 1 ], + RTEMS_DEFAULT_OPTIONS, + 3 * TICKS_PER_SECOND + ); + fatal_directive_status( + status, + RTEMS_TIMEOUT, + "rtems_semaphore_obtain timeout" + ); + puts( "TA1 - rtems_semaphore_obtain - woke up with RTEMS_TIMEOUT" ); + + status = rtems_semaphore_release( Semaphore_id[ 2 ] ); + fatal_directive_status( + status, + RTEMS_NOT_OWNER_OF_RESOURCE, + "rtems_semaphore_release and not owner" + ); + puts( "TA1 - rtems_semaphore_release - RTEMS_NOT_OWNER_OF_RESOURCE" ); + + status = rtems_semaphore_release( 100 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_semaphore_release with illegal id" + ); + puts( "TA1 - rtems_semaphore_release - RTEMS_INVALID_ID" ); + + 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)" ); + + puts( "TA1 - rtems_semaphore_delete - delete sem 1 - RTEMS_SUCCESSFUL" ); + status = rtems_semaphore_delete( Semaphore_id[ 1 ] ); + directive_failed( status, "rtems_semaphore_delete of SM1" ); + + puts( "TA1 - rtems_semaphore_obtain - binary semaphore" ); + status = rtems_semaphore_obtain( + Semaphore_id[ 2 ], + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT + ); + directive_failed( status, "rtems_semaphore_obtain"); + + puts( "TA1 - rtems_semaphore_delete - delete sem 2 - RTEMS_RESOURCE_IN_USE" ); + status = rtems_semaphore_delete( Semaphore_id[ 2 ] ); + fatal_directive_status( + status, + RTEMS_RESOURCE_IN_USE, + "rtems_semaphore_delete of SM2" + ); + + 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" + ); +} diff --git a/testsuites/sptests/sp09/screen07.c b/testsuites/sptests/sp09/screen07.c new file mode 100644 index 0000000000..fd808f833d --- /dev/null +++ b/testsuites/sptests/sp09/screen07.c @@ -0,0 +1,184 @@ +/* Screen7 + * + * This routine generates error screen 7 for test 9. + * + * Input parameters: NONE + * + * 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" + +void Screen7() +{ + long buffer[ 4 ]; + rtems_unsigned32 count; + rtems_status_code status; + + status = rtems_message_queue_broadcast( 100, (long (*)[4]) buffer, &count ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_message_queue_broadcast with illegal id" + ); + puts( "TA1 - rtems_message_queue_broadcast - RTEMS_INVALID_ID" ); + + status = rtems_message_queue_create( + 0, + 3, + RTEMS_DEFAULT_ATTRIBUTES, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_INVALID_NAME, + "rtems_message_queue_create with illegal name" + ); + + puts( "TA1 - rtems_message_queue_create - Q 1 - RTEMS_INVALID_NAME" ); + status = rtems_message_queue_create( + Queue_name[ 1 ], + 1, + RTEMS_GLOBAL, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_MP_NOT_CONFIGURED, + "rtems_message_queue_create of mp not configured" + ); + puts( "TA1 - rtems_message_queue_create - Q 1 - RTEMS_MP_NOT_CONFIGURED" ); + + status = rtems_message_queue_create( + Queue_name[ 1 ], + 2, + RTEMS_LIMIT, + &Queue_id[ 1 ] + ); + directive_failed( status, "rtems_message_queue_create successful" ); + puts( + "TA1 - rtems_message_queue_create - Q 1 - RTEMS_LIMIT - RTEMS_SUCCESSFUL" + ); + + status = rtems_message_queue_create( + Queue_name[ 2 ], + 1, + RTEMS_DEFAULT_ATTRIBUTES, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_TOO_MANY, + "rtems_message_queue_create of too many" + ); + puts( "TA1 - rtems_message_queue_create - Q 2 - RTEMS_TOO_MANY" ); + + status = rtems_message_queue_delete( 100 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_message_queue_create with illegal id" + ); + puts( "TA1 - rtems_message_queue_delete - unknown RTEMS_INVALID_ID" ); + + status = rtems_message_queue_delete( 0x10100 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_message_queue_delete with local illegal id" + ); + puts( "TA1 - rtems_message_queue_delete - local RTEMS_INVALID_ID" ); + + status = rtems_message_queue_ident( 100, RTEMS_SEARCH_ALL_NODES, &Junk_id ); + fatal_directive_status( + status, + RTEMS_INVALID_NAME, + "rtems_message_queue_ident with illegal name" + ); + puts( "TA1 - rtems_message_queue_ident - RTEMS_INVALID_NAME" ); + + status = rtems_message_queue_flush( 100, &count ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_message_queue_flush with illegal id" + ); + puts( "TA1 - rtems_message_queue_flush - RTEMS_INVALID_ID" ); + + status = rtems_message_queue_receive( + 100, + (long (*)[4]) buffer, + RTEMS_DEFAULT_OPTIONS, + 0 + ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_message_queue_receive wit illegal id" + ); + puts( "TA1 - rtems_message_queue_receive - RTEMS_INVALID_ID" ); + + status = rtems_message_queue_receive( + Queue_id[ 1 ], + (long (*)[4]) buffer, + RTEMS_NO_WAIT, + RTEMS_NO_TIMEOUT + ); + fatal_directive_status( + status, + RTEMS_UNSATISFIED, + "rtems_message_queue_receive unsatisfied" + ); + puts( "TA1 - rtems_message_queue_receive - Q 1 - RTEMS_UNSATISFIED" ); + + puts( "TA1 - rtems_message_queue_receive - Q 1 - timeout in 3 seconds" ); + status = rtems_message_queue_receive( + Queue_id[ 1 ], + (long (*)[4]) buffer, + RTEMS_DEFAULT_OPTIONS, + 3 * TICKS_PER_SECOND + ); + fatal_directive_status( + status, + RTEMS_TIMEOUT, + "rtems_message_queue_receive 3 second timeout" + ); + + puts( + "TA1 - rtems_message_queue_receive - Q 1 - woke up with RTEMS_TIMEOUT" + ); + + status = rtems_message_queue_send( 100, (long (*)[4]) buffer ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_message_queue_send with illegal id" + ); + puts( "TA1 - rtems_message_queue_send - RTEMS_INVALID_ID" ); + + status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4]) buffer ); + directive_failed( status, "rtems_message_queue_send" ); + puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL" ); + + status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4]) buffer ); + directive_failed( status, "rtems_message_queue_send" ); + puts( "TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL" ); + + status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4]) buffer ); + fatal_directive_status( + status, + RTEMS_TOO_MANY, + "rtems_message_queue_send too many to a limited queue" + ); + puts( "TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1 - RTEMS_TOO_MANY" ); +} diff --git a/testsuites/sptests/sp09/screen08.c b/testsuites/sptests/sp09/screen08.c new file mode 100644 index 0000000000..18c9b8d2d8 --- /dev/null +++ b/testsuites/sptests/sp09/screen08.c @@ -0,0 +1,121 @@ +/* Screen8 + * + * This routine generates error screen 8 for test 9. + * + * Input parameters: NONE + * + * 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" + +void Screen8() +{ + long buffer[ 4 ]; + rtems_status_code status; + + status = rtems_message_queue_delete( Queue_id[ 1 ] ); + directive_failed( status, "rtems_message_queue_delete successful" ); + puts( "TA1 - rtems_message_queue_delete - Q 1 - RTEMS_SUCCESSFUL" ); + + status = rtems_message_queue_create( + Queue_name[ 1 ], + 2, + RTEMS_LIMIT, + &Queue_id[ 1 ] + ); + directive_failed( status, "rtems_message_queue_create successful" ); + puts( + "TA1 - rtems_message_queue_create - Q 1 - RTEMS_LIMIT - RTEMS_SUCCESSFUL" + ); + + status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer ); + directive_failed( status, "rtems_message_queue_send successful" ); + puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL" ); + + status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer ); + directive_failed( status, "rtems_message_queue_send successful" ); + puts( "TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL" ); + + status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer ); + fatal_directive_status( + status, + RTEMS_TOO_MANY, + "rtems_message_queue_send too many to limited queue" + ); + puts( "TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1 - RTEMS_TOO_MANY" ); + + status = rtems_message_queue_delete( Queue_id[ 1 ] ); + directive_failed( status, "rtems_message_queue_delete successful" ); + puts( "TA1 - rtems_message_queue_delete - Q 1 - RTEMS_SUCCESSFUL" ); + + status = rtems_message_queue_create( + Queue_name[ 1 ], + 3, + RTEMS_LIMIT, + &Queue_id[ 1 ] + ); + directive_failed( status, "rtems_message_queue_create successful" ); + puts( + "TA1 - rtems_message_queue_create - Q 1 - RTEMS_LIMIT - RTEMS_SUCCESSFUL" + ); + + status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer ); + directive_failed( status, "rtems_message_queue_send successful" ); + puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL" ); + + status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer ); + directive_failed( status, "rtems_message_queue_send successful" ); + puts( "TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL" ); + + status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer ); + fatal_directive_status( + status, + RTEMS_UNSATISFIED, + "rtems_message_queue_send too many to limited queue" + ); + puts( + "TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1 - RTEMS_UNSATISFIED" + ); + + status = rtems_message_queue_delete( Queue_id[ 1 ] ); + directive_failed( status, "rtems_message_queue_delete successful" ); + puts( "TA1 - rtems_message_queue_delete - Q 1 - RTEMS_SUCCESSFUL" ); + + status = rtems_message_queue_create( + Queue_name[ 1 ], + 3, + RTEMS_LIMIT, + &Queue_id[ 1 ] + ); + directive_failed( status, "rtems_message_queue_create successful" ); + puts( + "TA1 - rtems_message_queue_create - Q 1 - RTEMS_LIMIT - RTEMS_SUCCESSFUL" + ); + + puts( "TA1 - rtems_task_start - start TA3 - RTEMS_SUCCESSFUL" ); + status = rtems_task_start( Task_id[ 3 ], Task_3, 0 ); + directive_failed( status, "rtems_task_start of TA3" ); + + 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)" ); + + puts( "TA1 - rtems_message_queue_delete - delete Q 1 - RTEMS_SUCCESSFUL" ); + status = rtems_message_queue_delete( Queue_id[ 1 ] ); + directive_failed( status, "rtems_message_queue_delete successful" ); + + 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)" ); +} diff --git a/testsuites/sptests/sp09/screen09.c b/testsuites/sptests/sp09/screen09.c new file mode 100644 index 0000000000..5c6eece679 --- /dev/null +++ b/testsuites/sptests/sp09/screen09.c @@ -0,0 +1,140 @@ +/* Screen9 + * + * This routine generates error screen 9 for test 9. + * + * Input parameters: NONE + * + * 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" + +void Screen9() +{ + void *converted; + rtems_status_code status; + rtems_isr_entry old_service_routine; + + status = rtems_interrupt_catch( Service_routine, 500, &old_service_routine ); + fatal_directive_status( + status, + RTEMS_INVALID_NUMBER, + "rtems_interrupt_catch with invalid vector" + ); + puts( "TA1 - rtems_interrupt_catch - RTEMS_INVALID_NUMBER" ); + + status = rtems_interrupt_catch( NULL, 3, &old_service_routine ); + fatal_directive_status( + status, + RTEMS_INVALID_ADDRESS, + "rtems_interrupt_catch with invalid handler" + ); + puts( "TA1 - rtems_interrupt_catch - RTEMS_INVALID_ADDRESS" ); + + status = rtems_signal_send( 100, RTEMS_SIGNAL_1 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_signal_send with illegal id" + ); + puts( "TA1 - rtems_signal_send - RTEMS_INVALID_ID" ); + + status = rtems_signal_send( RTEMS_SELF, RTEMS_SIGNAL_16 ); + fatal_directive_status( + status, + RTEMS_NOT_DEFINED, + "rtems_signal_send with no handler" + ); + puts( "TA1 - rtems_signal_send - RTEMS_NOT_DEFINED" ); + + status = rtems_port_create( + 0, + Internal_port_area, + External_port_area, + sizeof( Internal_port_area ), + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_INVALID_NAME, + "rtems_port_create with illegal name" + ); + puts( "TA1 - rtems_port_create - RTEMS_INVALID_NAME" ); + + status = rtems_port_create( + Port_name[ 1 ], + &((char *)Internal_port_area)[ 1 ], + External_port_area, + sizeof( Internal_port_area ), + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_INVALID_ADDRESS, + "rtems_port_create with illegal address" + ); + puts( "TA1 - rtems_port_create - RTEMS_INVALID_ADDRESS" ); + + status = rtems_port_create( + Port_name[ 1 ], + Internal_port_area, + External_port_area, + sizeof( Internal_port_area ), + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_TOO_MANY, + "rtems_port_create of too many" + ); + puts( "TA1 - rtems_port_create - RTEMS_TOO_MANY" ); + + status = rtems_port_delete( 0 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_port_delete with illegal id" + ); + puts( "TA1 - rtems_port_delete - RTEMS_INVALID_ID" ); + + status = rtems_port_ident( 0, &Junk_id ); + fatal_directive_status( + status, + RTEMS_INVALID_NAME, + "rtems_port_ident with illegal name" + ); + puts( "TA1 - rtems_port_ident - RTEMS_INVALID_NAME" ); + + status = rtems_port_external_to_internal( + 100, + Internal_port_area, + &converted + ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_port_external_to_internal with illegal id" + ); + puts( "TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ID" ); + status = rtems_port_internal_to_external( + 100, + Internal_port_area, + &converted + ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_port_internal_to_external with illegal id" + ); + puts( "TA1 - rtems_port_internal_to_external - RTEMS_INVALID_ID" ); +} diff --git a/testsuites/sptests/sp09/screen10.c b/testsuites/sptests/sp09/screen10.c new file mode 100644 index 0000000000..53a5a8d6dc --- /dev/null +++ b/testsuites/sptests/sp09/screen10.c @@ -0,0 +1,164 @@ +/* Screen10 + * + * This routine generates error screen 10 for test 9. + * + * Input parameters: NONE + * + * 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" + +void Screen10() +{ + rtems_status_code status; + + status = rtems_rate_monotonic_create( 0, &Junk_id ); + fatal_directive_status( + status, + RTEMS_INVALID_NAME, + "rtems_rate_monotonic_create with illegal name" + ); + puts( "TA1 - rtems_rate_monotonic_create - RTEMS_INVALID_NAME" ); + + status = rtems_rate_monotonic_create( Period_name[ 1 ], &Period_id[ 1 ] ); + directive_failed( status, "rtems_rate_monotonic_create successful" ); + puts( "TA1 - rtems_rate_monotonic_create - RTEMS_SUCCESSFUL" ); + + status = rtems_rate_monotonic_create( Period_name[ 1 ], &Junk_id ); + fatal_directive_status( + status, + RTEMS_TOO_MANY, + "rtems_rate_monotonic_create of too many" + ); + puts( "TA1 - rtems_rate_monotonic_create - RTEMS_TOO_MANY" ); + + status = rtems_rate_monotonic_ident( 0, &Junk_id ); + fatal_directive_status( + status, + RTEMS_INVALID_NAME, + "rtems_rate_monotonic_ident with illegal name" + ); + puts( "TA1 - rtems_rate_monotonic_ident - RTEMS_INVALID_NAME" ); + + status = rtems_rate_monotonic_period( 100, 5 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_rate_monotonic_period with illegal id" + ); + puts( "TA1 - rtems_rate_monotonic_period - unknown RTEMS_INVALID_ID" ); + + status = rtems_rate_monotonic_period( 0x10100, 5 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_rate_monotonic_period with illegal id" + ); + puts( "TA1 - rtems_rate_monotonic_period - local RTEMS_INVALID_ID" ); + + status = rtems_rate_monotonic_period( Period_id[ 1 ], RTEMS_PERIOD_STATUS ); + fatal_directive_status( + status, + RTEMS_NOT_DEFINED, + "rtems_rate_monotonic_period status not defined" + ); + puts( + "TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_NOT_DEFINED" + ); + + status = rtems_rate_monotonic_period( Period_id[ 1 ], 100 ); + directive_failed( status, "rtems_rate_monotonic_period successful" ); + puts( "TA1 - rtems_rate_monotonic_period - 100 ticks - RTEMS_SUCCESSFUL" ); + + status = rtems_rate_monotonic_period( Period_id[ 1 ], RTEMS_PERIOD_STATUS ); + directive_failed( status, "rtems_rate_monotonic_period status" ); + puts( + "TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_SUCCESSFUL" + ); + + while ( FOREVER ) { + + status = rtems_rate_monotonic_period(Period_id[ 1 ], RTEMS_PERIOD_STATUS); + + if ( status == RTEMS_TIMEOUT ) break; + + directive_failed( + status, + "rtems_rate_monotonic_period waiting for timeout" + ); + } + puts( + "TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_TIMEOUT" + ); + + status = rtems_rate_monotonic_cancel( 100 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_rate_monotonic_cancel with illegal id" + ); + puts( "TA1 - rtems_rate_monotonic_cancel - unknown RTEMS_INVALID_ID" ); + + status = rtems_rate_monotonic_cancel( 0x10100 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_rate_monotonic_cancel will illegal id" + ); + puts( "TA1 - rtems_rate_monotonic_cancel - local RTEMS_INVALID_ID" ); + + status = rtems_rate_monotonic_cancel( Period_id[ 1 ] ); + directive_failed( status, "rtems_rate_monotonic_cancel" ); + puts( "TA1 - rtems_rate_monotonic_cancel - RTEMS_SUCCESSFUL" ); + + status = rtems_rate_monotonic_period( Period_id[ 1 ], 5 ); + directive_failed( status, "rtems_rate_monotonic_period restart" ); + + status = rtems_task_wake_after( 1 * TICKS_PER_SECOND ); + directive_failed( status, "rtems_task_wake_after" ); + + status = rtems_rate_monotonic_period( Period_id[ 1 ], 5 ); + fatal_directive_status( + status, + RTEMS_TIMEOUT, + "rtems_rate_monotonic_period" + ); + puts( "TA1 - rtems_rate_monotonic_period - 5 ticks - RTEMS_TIMEOUT" ); + + status = rtems_task_start( Task_id[ 4 ], Task_4, 0 ); + directive_failed( status, "rtems_task_start of TA4" ); + + puts( "TA1 - yielding to TA4" ); + status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); + + status = rtems_rate_monotonic_delete( 100 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_rate_monotonic_delete with illegal id" + ); + puts( "TA1 - rtems_rate_monotonic_delete - unknown RTEMS_INVALID_ID" ); + + status = rtems_rate_monotonic_delete( 0x10100 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_rate_monotonic_delete with illegal id" + ); + puts( "TA1 - rtems_rate_monotonic_delete - local RTEMS_INVALID_ID" ); + + status = rtems_rate_monotonic_delete( Period_id[ 1 ] ); + directive_failed( status, "rtems_rate_monotonic_delete" ); + puts( "TA1 - rtems_rate_monotonic_delete - RTEMS_SUCCESSFUL" ); +} diff --git a/testsuites/sptests/sp09/screen11.c b/testsuites/sptests/sp09/screen11.c new file mode 100644 index 0000000000..8c13cd2490 --- /dev/null +++ b/testsuites/sptests/sp09/screen11.c @@ -0,0 +1,250 @@ +/* Screen11 + * + * This routine generates error screen 11 for test 9. + * + * Input parameters: NONE + * + * 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" + +void Screen11() +{ + void *buffer_address_1; + void *buffer_address_2; + void *buffer_address_3; + rtems_status_code status; + + status = rtems_partition_create( + 0, + Partition_good_area, + 128, + 40, + RTEMS_DEFAULT_ATTRIBUTES, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_INVALID_NAME, + "rtems_partition_create with illegal name" + ); + puts( "TA1 - rtems_partition_create - RTEMS_INVALID_NAME" ); + + status = rtems_partition_create( + Partition_name[ 1 ], + Partition_good_area, + 0, + 80, + RTEMS_DEFAULT_ATTRIBUTES, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_INVALID_SIZE, + "rtems_partition_create with illegal length" + ); + puts( "TA1 - rtems_partition_create - length - RTEMS_INVALID_SIZE" ); + + status = rtems_partition_create( + Partition_name[ 1 ], + Partition_good_area, + 128, + 0, + RTEMS_DEFAULT_ATTRIBUTES, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_INVALID_SIZE, + "rtems_partition_create with illegal buffer size" + ); + puts( "TA1 - rtems_partition_create - buffer size - RTEMS_INVALID_SIZE" ); + + status = rtems_partition_create( + Partition_name[ 1 ], + Partition_good_area, + 128, + 256, + RTEMS_DEFAULT_ATTRIBUTES, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_INVALID_SIZE, + "rtems_partition_create with buffer_size > length" + ); + puts( + "TA1 - rtems_partition_create - length < buffer size - RTEMS_INVALID_SIZE" + ); + + status = rtems_partition_create( + Partition_name[ 1 ], + Partition_good_area, + 128, + 64, + RTEMS_GLOBAL, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_MP_NOT_CONFIGURED, + "rtems_partition_create of global" + ); + puts( "TA1 - rtems_partition_create - RTEMS_MP_NOT_CONFIGURED" ); + + status = rtems_partition_create( + Partition_name[ 1 ], + Partition_bad_area, + 128, + 64, + RTEMS_GLOBAL, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_INVALID_ADDRESS, + "rtems_partition_create with bad address" + ); + puts( "TA1 - rtems_partition_create - RTEMS_INVALID_ADDRESS" ); + + status = rtems_partition_create( + Partition_name[ 1 ], + Partition_good_area, + 128, + 34, + RTEMS_DEFAULT_ATTRIBUTES, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_INVALID_SIZE, + "rtems_partition_create with unaligned buffer_size" + ); + puts( "TA1 - rtems_partition_create - RTEMS_INVALID_SIZE" ); + + status = rtems_partition_delete( 100 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_partition_delete with illegal id" + ); + puts( "TA1 - rtems_partition_delete - unknown RTEMS_INVALID_ID" ); + + status = rtems_partition_delete( 0x10100 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_partition_delete with illegal id" + ); + puts( "TA1 - rtems_partition_delete - local RTEMS_INVALID_ID" ); + + status = rtems_partition_get_buffer( 100, &buffer_address_1 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_partition_get_buffer with illegal id" + ); + puts( "TA1 - rtems_partition_get_buffer - RTEMS_INVALID_ID" ); + + status = rtems_partition_ident( 0, RTEMS_SEARCH_ALL_NODES, &Junk_id ); + fatal_directive_status( + status, + RTEMS_INVALID_NAME, + "rtems_partition_ident with illegal name" + ); + puts( "TA1 - rtems_partition_ident - RTEMS_INVALID_NAME" ); + + status = rtems_partition_return_buffer( 100, buffer_address_1 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_partition_return_buffer with illegal id" + ); + puts( "TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ID" ); + + status = rtems_partition_create( + Partition_name[ 1 ], + Partition_good_area, + 128, + 64, + RTEMS_DEFAULT_ATTRIBUTES, + &Partition_id[ 1 ] + ); + directive_failed( status, "rtems_partition_create" ); + puts( "TA1 - rtems_partition_create - RTEMS_SUCCESSFUL" ); + + status = rtems_partition_create( + Partition_name[ 1 ], + Partition_good_area, + 128, + 32, + RTEMS_DEFAULT_ATTRIBUTES, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_TOO_MANY, + "rtems_partition_create of too many" + ); + puts( "TA1 - rtems_partition_create - RTEMS_TOO_MANY" ); + + status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer_address_1 ); + directive_failed( status, "rtems_partition_get_buffer"); + puts( "TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL" ); + + status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer_address_2 ); + directive_failed( status, "rtems_partition_get_buffer" ); + puts( "TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL" ); + + status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer_address_3 ); + fatal_directive_status( + status, + RTEMS_UNSATISFIED, + "rtems_partition_get_buffer unsatisfied" + ); + puts( "TA1 - rtems_partition_get_buffer - RTEMS_UNSATISFIED" ); + + status = rtems_partition_delete( Partition_id[ 1 ] ); + fatal_directive_status( + status, + RTEMS_RESOURCE_IN_USE, + "rtems_partition_delete with buffers in use" + ); + puts( "TA1 - rtems_partition_delete - RTEMS_RESOURCE_IN_USE" ); + + status = rtems_partition_return_buffer( + Partition_id[ 1 ], + Region_good_area /* NOTE: Region Memory */ + ); + fatal_directive_status( + status, + RTEMS_INVALID_ADDRESS, + "rtems_partition_return_buffer with buffer address out of partition" + ); + puts( + "TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ADDRESS - out of range" + ); + + status = rtems_partition_return_buffer( + Partition_id[ 1 ], + &Partition_good_area[ 7 ] + ); + fatal_directive_status( + status, + RTEMS_INVALID_ADDRESS, + "rtems_partition_return_buffer with buffer address not on boundary" + ); + puts_nocr( "TA1 - rtems_partition_return_buffer - " ); + puts ( "RTEMS_INVALID_ADDRESS - not on boundary"); +} diff --git a/testsuites/sptests/sp09/screen12.c b/testsuites/sptests/sp09/screen12.c new file mode 100644 index 0000000000..300d54043a --- /dev/null +++ b/testsuites/sptests/sp09/screen12.c @@ -0,0 +1,327 @@ +/* Screen12 + * + * This routine generates error screen 12 for test 9. + * + * Input parameters: NONE + * + * 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" + +void Screen12() +{ + void *segment_address_1; + void *segment_address_2; + void *segment_address_3; + rtems_unsigned32 offset; + rtems_unsigned32 good_front_flag; + rtems_unsigned32 good_back_flag; + rtems_status_code status; + + status = rtems_region_create( + 0, + Region_good_area, + 128, + 32, + RTEMS_DEFAULT_ATTRIBUTES, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_INVALID_NAME, + "rtems_region_create with illegal name" + ); + puts( "TA1 - rtems_region_create - RTEMS_INVALID_NAME" ); + + status = rtems_region_create( + Region_name[ 1 ], + Region_bad_area, + 128, + 32, + RTEMS_DEFAULT_ATTRIBUTES, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_INVALID_ADDRESS, + "rtems_region_create with illegal address" + ); + puts( "TA1 - rtems_region_create - RTEMS_INVALID_ADDRESS" ); + + status = rtems_region_create( + Region_name[ 1 ], + Region_good_area, + 128, + 34, + RTEMS_DEFAULT_ATTRIBUTES, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_INVALID_SIZE, + "rtems_region_create with illegal size" + ); + puts( "TA1 - rtems_region_create - RTEMS_INVALID_SIZE" ); + + status = rtems_region_create( + Region_name[ 1 ], + &Region_good_area[ REGION_START_OFFSET ], + REGION_LENGTH, + 128, + RTEMS_DEFAULT_ATTRIBUTES, + &Region_id[ 1 ] + ); + directive_failed( status, "rtems_region_create" ); + puts( "TA1 - rtems_region_create - RTEMS_SUCCESSFUL" ); + + status = rtems_region_create( + Region_name[ 1 ], + Region_good_area, + 512, + 128, + RTEMS_DEFAULT_ATTRIBUTES, + &Junk_id + ); + fatal_directive_status( + status, + RTEMS_TOO_MANY, + "rtems_region_create of too many" + ); + puts( "TA1 - rtems_region_create - RTEMS_TOO_MANY" ); + + status = rtems_region_delete( 100 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_region_delete with illegal id" + ); + puts( "TA1 - rtems_region_delete - unknown RTEMS_INVALID_ID" ); + + status = rtems_region_delete( 0x10100 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_region_delete with illegal id" + ); + puts( "TA1 - rtems_region_delete - local RTEMS_INVALID_ID" ); + + status = rtems_region_ident( 0, &Junk_id ); + fatal_directive_status( + status, + RTEMS_INVALID_NAME, + "rtems_region_ident with illegal name" + ); + puts( "TA1 - rtems_region_ident - RTEMS_INVALID_NAME" ); + + status = rtems_region_get_segment( + 100, + 128, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT, + &segment_address_1 + ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_region_get_segment with illegal id" + ); + puts( "TA1 - rtems_region_get_segment - RTEMS_INVALID_ID" ); + + status = rtems_region_get_segment( + Region_id[ 1 ], + sizeof( Region_good_area ) * 2, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT, + &segment_address_1 + ); + fatal_directive_status( + status, + RTEMS_INVALID_SIZE, + "rtems_region_get_segment with illegal size" + ); + puts( "TA1 - rtems_region_get_segment - RTEMS_INVALID_SIZE" ); + + status = rtems_region_get_segment( + Region_id[ 1 ], + 384, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT, + &segment_address_1 + ); + directive_failed( status, "rtems_region_get_segment" ); + puts( "TA1 - rtems_region_get_segment - RTEMS_SUCCESSFUL" ); + + status = rtems_region_get_segment( + Region_id[ 1 ], + 384, + RTEMS_NO_WAIT, + RTEMS_NO_TIMEOUT, + &segment_address_2 + ); + fatal_directive_status( + status, + RTEMS_UNSATISFIED, + "rtems_region_get_segment unsatisfied" + ); + puts( "TA1 - rtems_region_get_segment - RTEMS_UNSATISFIED" ); + + puts( "TA1 - rtems_region_get_segment - timeout in 3 seconds" ); + status = rtems_region_get_segment( + Region_id[ 1 ], + 128, + RTEMS_DEFAULT_OPTIONS, + 3 * TICKS_PER_SECOND, + &segment_address_3 + ); + fatal_directive_status( + status, + RTEMS_TIMEOUT, + "rtems_region_get_segment timeout" + ); + puts( "TA1 - rtems_region_get_segment - woke up with RTEMS_TIMEOUT" ); + + status = rtems_region_delete( Region_id[ 1 ] ); + fatal_directive_status( + status, + RTEMS_RESOURCE_IN_USE, + "rtems_region_delete with buffers in use" + ); + puts( "TA1 - rtems_region_delete - RTEMS_RESOURCE_IN_USE" ); + + status = rtems_region_return_segment( 100, segment_address_1 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_region_return_segment with illegal id" + ); + puts( "TA1 - rtems_region_return_segment - RTEMS_INVALID_ID" ); + + status = rtems_region_return_segment( Region_id[ 1 ], Region_good_area ); + fatal_directive_status( + status, + RTEMS_INVALID_ADDRESS, + "rtems_region_return_segment with illegal segment" + ); + puts( "TA1 - rtems_region_return_segment - RTEMS_INVALID_ADDRESS" ); + +/* + * The following generate internal heap errors. Thus this code + * is subject to change if the heap code changes. + */ + + puts( "TA1 - rtems_debug_disable - RTEMS_DEBUG_REGION" ); + rtems_debug_disable( RTEMS_DEBUG_REGION ); + + offset = (segment_address_1 - (void *)Region_good_area) / 4; + +/* bad FRONT_FLAG error */ + + good_front_flag = Region_good_area[ offset - 1 ]; + Region_good_area[ offset - 1 ] = good_front_flag + 2; + + status = rtems_region_return_segment( Region_id[ 1 ], segment_address_1 ); + fatal_directive_status( + status, + RTEMS_INVALID_ADDRESS, + "rtems_region_return_segment with back_flag != front_flag" + ); + puts( "TA1 - rtems_region_return_segment - RTEMS_INVALID_ADDRESS" ); + + Region_good_area[ offset - 1 ] = good_front_flag; + +/* bad FRONT_FLAG error */ + + good_back_flag = Region_good_area[ offset - 2 ]; + Region_good_area[ offset - 2 ] = 1024; + + status = rtems_region_return_segment( Region_id[ 1 ], segment_address_1 ); + fatal_directive_status( + status, + RTEMS_INVALID_ADDRESS, + "rtems_region_return_segment with back_flag != front_flag" + ); + puts( "TA1 - rtems_region_return_segment - RTEMS_INVALID_ADDRESS" ); + + Region_good_area[ offset - 2 ] = good_back_flag; + + puts( "TA1 - rtems_debug_enable - RTEMS_DEBUG_REGION" ); + rtems_debug_enable( RTEMS_DEBUG_REGION ); + + status = rtems_region_extend( + 100, + Region_good_area, + 128 + ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_region_extend with illegal id" + ); + puts( "TA1 - rtems_region_extend - RTEMS_INVALID_ID" ); + + status = rtems_region_extend( + Region_id[ 1 ], + &Region_good_area[ REGION_START_OFFSET + 16 ], + 128 + ); + fatal_directive_status( + status, + RTEMS_INVALID_ADDRESS, + "rtems_region_extend with illegal starting address" + ); + puts( "TA1 - rtems_region_extend - within heap - RTEMS_INVALID_ADDRESS" ); + + status = rtems_region_extend( + Region_id[ 1 ], + Region_bad_area, + 128 + ); + fatal_directive_status( + status, + RTEMS_NOT_IMPLEMENTED, + "rtems_region_extend with unsupported starting address" + ); + puts( + "TA1 - rtems_region_extend - non-contiguous lower - RTEMS_NOT_IMPLEMENTED" + ); + + status = rtems_region_extend( + Region_id[ 1 ], + &Region_good_area[ REGION_START_OFFSET - REGION_LENGTH ], + 128 + ); + fatal_directive_status( + status, + RTEMS_NOT_IMPLEMENTED, + "rtems_region_extend with unsupported starting address" + ); + puts( + "TA1 - rtems_region_extend - contiguous lower - RTEMS_NOT_IMPLEMENTED" + ); + + status = rtems_region_extend( + Region_id[ 1 ], + &Region_good_area[ REGION_START_OFFSET + REGION_LENGTH + 16 ], + 128 + ); + fatal_directive_status( + status, + RTEMS_NOT_IMPLEMENTED, + "rtems_region_extend with unsupported starting address" + ); + puts( + "TA1 - rtems_region_extend - non-contiguous higher - RTEMS_NOT_IMPLEMENTED" + ); + +} diff --git a/testsuites/sptests/sp09/screen13.c b/testsuites/sptests/sp09/screen13.c new file mode 100644 index 0000000000..c96adeec40 --- /dev/null +++ b/testsuites/sptests/sp09/screen13.c @@ -0,0 +1,115 @@ +/* Screen13 + * + * This routine generates error screen 13 for test 9. + * + * Input parameters: NONE + * + * 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" + +void Screen13() +{ + rtems_unsigned32 result; + rtems_time_of_day time; + rtems_status_code status; + + status = rtems_io_close( 0xffff, 0x0000, NULL, &result ); + fatal_directive_status( + status, + RTEMS_INVALID_NUMBER, + "rtems_io_close with bad major number" + ); + puts( "TA1 - rtems_io_close - RTEMS_INVALID_NUMBER" ); + status = rtems_io_control( 0xffff, 0x00000, NULL, &result ); + fatal_directive_status( + status, + RTEMS_INVALID_NUMBER, + "rtems_io_close with bad major number" + ); + puts( "TA1 - rtems_io_control - RTEMS_INVALID_NUMBER" ); + status = rtems_io_initialize( 0xffff, 0x00000, NULL, &result ); + fatal_directive_status( + status, + RTEMS_INVALID_NUMBER, + "rtems_io_initialize with bad major number" + ); + puts( "TA1 - rtems_io_initialize - RTEMS_INVALID_NUMBER" ); + status = rtems_io_open( 0xffff, 0x00000, NULL, &result ); + fatal_directive_status( + status, + RTEMS_INVALID_NUMBER, + "rtems_io_open with bad major number" + ); + puts( "TA1 - rtems_io_open - RTEMS_INVALID_NUMBER" ); + status = rtems_io_read( 0xffff, 0x00000, NULL, &result ); + fatal_directive_status( + status, + RTEMS_INVALID_NUMBER, + "rtems_io_read with bad major number" + ); + puts( "TA1 - rtems_io_read - RTEMS_INVALID_NUMBER" ); + status = rtems_io_write( 0xffff, 0x0ffff, NULL, &result ); + fatal_directive_status( + status, + RTEMS_INVALID_NUMBER, + "rtems_io_write with bad major number" + ); + puts( "TA1 - rtems_io_write - RTEMS_INVALID_NUMBER" ); + + build_time( &time, 12, 31, 2000, 23, 59, 59, 0 ); + status = rtems_clock_set( &time ); + directive_failed( status, "rtems_clock_set" ); + print_time( "TA1 - rtems_clock_set - ", &time, " - RTEMS_SUCCESSFUL\n" ); + status = rtems_task_wake_after( 1 * TICKS_PER_SECOND ); + status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); + directive_failed( status, "rtems_clock_set" ); + print_time( "TA1 - rtems_clock_get - ", &time, " - RTEMS_SUCCESSFUL\n" ); + + build_time( &time, 12, 31, 1999, 23, 59, 59, 0 ); + status = rtems_clock_set( &time ); + directive_failed( status, "rtems_clock_set" ); + print_time( "TA1 - rtems_clock_set - ", &time, " - RTEMS_SUCCESSFUL\n" ); + status = rtems_task_wake_after( 1 * TICKS_PER_SECOND ); + status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); + directive_failed( status, "rtems_clock_set" ); + print_time( "TA1 - rtems_clock_get - ", &time, " - RTEMS_SUCCESSFUL\n" ); + + build_time( &time, 12, 31, 2100, 23, 59, 59, 0 ); + status = rtems_clock_set( &time ); + directive_failed( status, "rtems_clock_set" ); + print_time( "TA1 - rtems_clock_set - ", &time, " - RTEMS_SUCCESSFUL\n" ); + status = rtems_task_wake_after( 1 * TICKS_PER_SECOND ); + status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); + directive_failed( status, "rtems_clock_set" ); + print_time( "TA1 - rtems_clock_get - ", &time, " - RTEMS_SUCCESSFUL\n" ); + + build_time( &time, 12, 31, 2099, 23, 59, 59, 0 ); + status = rtems_clock_set( &time ); + directive_failed( status, "rtems_clock_set" ); + print_time( "TA1 - rtems_clock_set - ", &time, " - RTEMS_SUCCESSFUL\n" ); + status = rtems_task_wake_after( 1 * TICKS_PER_SECOND ); + status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); + directive_failed( status, "rtems_clock_set" ); + print_time( "TA1 - rtems_clock_get - ", &time, " - RTEMS_SUCCESSFUL\n" ); + + build_time( &time, 12, 31, 1991, 23, 59, 59, 0 ); + status = rtems_clock_set( &time ); + directive_failed( status, "rtems_clock_set" ); + print_time( "TA1 - rtems_clock_set - ", &time, " - RTEMS_SUCCESSFUL\n" ); + status = rtems_task_wake_after( 1 * TICKS_PER_SECOND ); + status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); + directive_failed( status, "rtems_clock_set" ); + print_time( "TA1 - rtems_clock_get - ", &time, " - RTEMS_SUCCESSFUL\n" ); +} diff --git a/testsuites/sptests/sp09/screen14.c b/testsuites/sptests/sp09/screen14.c new file mode 100644 index 0000000000..bf80f04c3c --- /dev/null +++ b/testsuites/sptests/sp09/screen14.c @@ -0,0 +1,162 @@ +/* Screen14 + * + * This routine generates error screen 14 for test 9. + * + * Input parameters: NONE + * + * 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" + +void Screen14() +{ + rtems_status_code status; + rtems_time_of_day time; + + status = rtems_timer_create( 0, &Junk_id ); + fatal_directive_status( + status, + RTEMS_INVALID_NAME, + "rtems_timer_create with illegal name" + ); + puts( "TA1 - rtems_timer_create - RTEMS_INVALID_NAME" ); + + status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] ); + directive_failed( status, "rtems_timer_create" ); + puts( "TA1 - rtems_timer_create - 1 - RTEMS_SUCCESSFUL" ); + + status = rtems_timer_create( 2, &Junk_id ); + fatal_directive_status( + status, + RTEMS_TOO_MANY, + "rtems_timer_create for too many" + ); + puts( "TA1 - rtems_timer_create - 2 - RTEMS_TOO_MANY" ); + + status = rtems_timer_delete( 100 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_timer_delete with illegal id" + ); + puts( "TA1 - rtems_timer_delete - local RTEMS_INVALID_ID" ); + + status = rtems_timer_delete( 0x010100 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_timer_delete with illegal id" + ); + puts( "TA1 - rtems_timer_delete - global RTEMS_INVALID_ID" ); + + status = rtems_timer_ident( 0, &Junk_id ); + fatal_directive_status( + status, + RTEMS_INVALID_NAME, + "rtems_timer_ident with illegal name" + ); + puts( "TA1 - rtems_timer_ident - RTEMS_INVALID_NAME" ); + + status = rtems_timer_cancel( 0x010100 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_timer_cancel with illegal id" + ); + puts( "TA1 - rtems_timer_cancel - RTEMS_INVALID_ID" ); + + status = rtems_timer_cancel( Timer_id[ 1 ] ); + fatal_directive_status( + status, + RTEMS_INCORRECT_STATE, + "rtems_timer_cancel before initiated" + ); + puts( "TA1 - rtems_timer_cancel - RTEMS_INCORRECT_STATE" ); + + status = rtems_timer_reset( 0x010100 ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_timer_reset with illegal id" + ); + puts( "TA1 - rtems_timer_reset - RTEMS_INVALID_ID" ); + + status = rtems_timer_reset( Timer_id[ 1 ] ); + fatal_directive_status( + status, + RTEMS_NOT_DEFINED, + "rtems_timer_reset before initiated" + ); + puts( "TA1 - rtems_timer_reset - RTEMS_NOT_DEFINED" ); + + status = rtems_timer_fire_after( + 0x010100, + 5 * TICKS_PER_SECOND, + Delayed_routine, + NULL + ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_timer_fire_after illegal id" + ); + puts( "TA1 - rtems_timer_fire_after - RTEMS_INVALID_ID" ); + + build_time( &time, 12, 31, 1994, 9, 0, 0, 0 ); + status = rtems_timer_fire_when( 0x010100, &time, Delayed_routine, NULL ); + fatal_directive_status( + status, + RTEMS_INVALID_ID, + "rtems_timer_fire_when with illegal id" + ); + puts( "TA1 - rtems_timer_fire_when - RTEMS_INVALID_ID" ); + + status = rtems_timer_fire_after( Timer_id[ 1 ], 0, Delayed_routine, NULL ); + fatal_directive_status( + status, + RTEMS_INVALID_NUMBER, + "rtems_timer_fire_after with 0 ticks" + ); + puts( "TA1 - rtems_timer_fire_after - RTEMS_INVALID_NUMBER" ); + + build_time( &time, 2, 5, 1987, 8, 30, 45, 0 ); + status = rtems_timer_fire_when( Timer_id[ 1 ], &time, Delayed_routine, NULL ); + fatal_directive_status( + status, + RTEMS_INVALID_CLOCK, + "rtems_timer_fire_when with illegal time" + ); + print_time( + "TA1 - rtems_timer_fire_when - ", + &time, + " - RTEMS_INVALID_CLOCK\n" + ); + + status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); + directive_failed( status, "rtems_clock_set" ); + print_time( "TA1 - rtems_clock_get - ", &time, "\n" ); + + build_time( &time, 2, 5, 1990, 8, 30, 45, 0 ); + status = rtems_timer_fire_when( Timer_id[ 1 ], &time, Delayed_routine, NULL ); + fatal_directive_status( + status, + RTEMS_INVALID_CLOCK, + "rtems_timer_fire_when before current time" + ); + print_time( + "TA1 - rtems_timer_fire_when - ", + &time, + " - before RTEMS_INVALID_CLOCK\n" + ); +} diff --git a/testsuites/sptests/sp09/sp09.doc b/testsuites/sptests/sp09/sp09.doc new file mode 100644 index 0000000000..f4e8391c47 --- /dev/null +++ b/testsuites/sptests/sp09/sp09.doc @@ -0,0 +1,36 @@ +# +# $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: test9 + +directives: + ex_init, ex_start, tm_tick, i_return, + t_create,t_delete, t_getreg, t_ident, t_restart, t_resume, t_setpri, + t_setreg, t_start, t_suspend, tm_delete, tm_get, + tm_set, tm_wkafter, tm_wkwhen, ev_receive, ev_send, sm_create, sm_delete, + sm_ident, sm_p, sm_v, q_broadcast, q_create, q_delete, q_ident, q_receive, + q_send, q_urgent, as_catch, as_send, as_return, rn_create, rn_delete, + rn_getseg, rn_ident, rn_retseg, pt_create, pt_delete, pt_getbug, pt_ident, + pt_retbuf, de_close, de_cntrl, de_init, de_open, de_read, de_write + +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/sp09/sp09.scn b/testsuites/sptests/sp09/sp09.scn new file mode 100644 index 0000000000..534fc47e09 --- /dev/null +++ b/testsuites/sptests/sp09/sp09.scn @@ -0,0 +1,249 @@ +*** TEST 9 *** +INIT - rtems_task_create - RTEMS_INVALID_SIZE -- NOT CHECKED +INIT - rtems_task_create - RTEMS_INVALID_PRIORITY +INIT - rtems_task_restart - RTEMS_INCORRECT_STATE +TA1 - rtems_task_delete - RTEMS_INVALID_ID +TA1 - rtems_task_get_note - RTEMS_INVALID_NUMBER +TA1 - rtems_task_get_note - RTEMS_INVALID_ID +TA1 - rtems_task_ident - current task RTEMS_SUCCESSFUL +TA1 - rtems_task_ident - global RTEMS_INVALID_NAME +TA1 - rtems_task_ident - local RTEMS_INVALID_NAME +TA1 - rtems_task_ident - RTEMS_INVALID_NODE +TA1 - rtems_task_restart - RTEMS_INVALID_ID +TA1 - rtems_task_resume - RTEMS_INVALID_ID +TA1 - rtems_task_resume - RTEMS_INCORRECT_STATE +TA1 - rtems_task_set_priority - RTEMS_INVALID_PRIORITY +TA1 - rtems_task_set_priority - RTEMS_INVALID_ID +TA1 - rtems_task_set_note - RTEMS_INVALID_NUMBER +TA1 - rtems_task_set_note - RTEMS_INVALID_ID +TA1 - rtems_task_start - RTEMS_INVALID_ID +TA1 - rtems_task_start - RTEMS_INCORRECT_STATE +TA1 - rtems_task_suspend - RTEMS_INVALID_ID + +TA1 - rtems_clock_get - RTEMS_NOT_DEFINED +TA1 - rtems_task_wake_when - RTEMS_NOT_DEFINED +TA1 - rtems_timer_fire_when - RTEMS_NOT_DEFINED +TA1 - rtems_clock_set - 08:30:45 02/05/1987 - RTEMS_INVALID_CLOCK +TA1 - rtems_clock_set - 08:30:45 15/05/1988 - RTEMS_INVALID_CLOCK +TA1 - rtems_clock_set - 08:30:45 02/32/1988 - RTEMS_INVALID_CLOCK +TA1 - rtems_clock_set - 25:30:45 02/05/1988 - RTEMS_INVALID_CLOCK +TA1 - rtems_clock_set - 08:61:45 02/05/1988 - RTEMS_INVALID_CLOCK +TA1 - rtems_clock_set - 08:30:61 02/05/1988 - RTEMS_INVALID_CLOCK +TA1 - rtems_clock_set - 08:30:45 02/05/1988 - RTEMS_INVALID_CLOCK +TA1 - rtems_clock_set - 08:30:45 02/05/1988 - RTEMS_SUCCESSFUL +TA1 - rtems_task_wake_when - TICKINVALID - sleep about 3 seconds +TA1 - rtems_task_wake_when - TICKINVALID - woke up RTEMS_SUCCESSFUL +TA1 - rtems_task_wake_when - 08:30:48 02/05/1961 - RTEMS_INVALID_CLOCK +TA1 - rtems_task_wake_when - 25:30:48 02/05/1988 - RTEMS_INVALID_CLOCK +TA1 - current time - 08:30:51 02/05/1988 +TA1 - rtems_task_wake_when - 08:30:51 01/05/1988 - RTEMS_INVALID_CLOCK + +TA1 - rtems_task_create - RTEMS_INVALID_NAME +TA1 - rtems_task_create - stack size - RTEMS_UNSATISFIED +TA1 - rtems_task_create - TA2 created - RTEMS_SUCCESSFUL +TA1 - rtems_task_suspend - suspend TA2 - RTEMS_SUCCESSFUL +TA1 - rtems_task_suspend - suspend TA2 - RTEMS_ALREADY_SUSPENDED +TA1 - rtems_task_resume - TA2 resumed - RTEMS_SUCCESSFUL +TA1 - rtems_task_create - TA3 created - RTEMS_SUCCESSFUL +TA1 - rtems_task_create - 4 created - RTEMS_SUCCESSFUL +TA1 - rtems_task_create - 5 created - RTEMS_SUCCESSFUL +TA1 - rtems_task_create - 6 created - RTEMS_SUCCESSFUL +TA1 - rtems_task_create - 7 created - RTEMS_SUCCESSFUL +TA1 - rtems_task_create - 8 created - RTEMS_SUCCESSFUL +TA1 - rtems_task_create - 9 created - RTEMS_SUCCESSFUL +TA1 - rtems_task_create - 10 created - RTEMS_SUCCESSFUL +TA1 - rtems_task_create - 11 - RTEMS_TOO_MANY +TA1 - rtems_task_create - RTEMS_MP_NOT_CONFIGURED + +TA1 - rtems_event_receive - RTEMS_UNSATISFIED ( all conditions ) +TA1 - rtems_event_receive - RTEMS_UNSATISFIED ( any condition ) +TA1 - rtems_event_receive - timeout in 3 seconds +TA1 - rtems_event_receive - woke up with RTEMS_TIMEOUT +TA1 - rtems_event_send - RTEMS_INVALID_ID +TA1 - rtems_task_wake_after - sleep 1 second - RTEMS_SUCCESSFUL +TA1 - rtems_clock_set - 08:30:45 02/05/1988 - RTEMS_SUCCESSFUL + +TA1 - rtems_semaphore_create - RTEMS_INVALID_NAME +TA1 - rtems_semaphore_create - 1 - RTEMS_SUCCESSFUL +TA1 - rtems_semaphore_create - 2 - RTEMS_SUCCESSFUL +TA1 - rtems_semaphore_create - 3 - RTEMS_TOO_MANY +TA1 - rtems_semaphore_create - RTEMS_NOT_DEFINED +TA1 - rtems_semaphore_create - RTEMS_NOT_DEFINED +TA1 - rtems_semaphore_create - RTEMS_INVALID_NUMBER +TA1 - rtems_semaphore_create - RTEMS_MP_NOT_CONFIGURED +TA1 - rtems_semaphore_delete - unknown RTEMS_INVALID_ID +TA1 - rtems_semaphore_delete - local RTEMS_INVALID_ID +TA1 - rtems_semaphore_ident - global RTEMS_INVALID_NAME +TA1 - rtems_semaphore_ident - local RTEMS_INVALID_NAME + +TA1 - rtems_semaphore_obtain - RTEMS_INVALID_ID +TA1 - rtems_semaphore_obtain - got sem 1 - RTEMS_SUCCESSFUL +TA1 - rtems_semaphore_obtain - RTEMS_UNSATISFIED +TA1 - rtems_semaphore_obtain - timeout in 3 seconds +TA1 - rtems_semaphore_obtain - woke up with RTEMS_TIMEOUT +TA1 - rtems_semaphore_release - RTEMS_NOT_OWNER_OF_RESOURCE +TA1 - rtems_semaphore_release - RTEMS_INVALID_ID +TA1 - rtems_task_start - start TA2 - RTEMS_SUCCESSFUL +TA1 - rtems_task_wake_after - yield processor - RTEMS_SUCCESSFUL +TA2 - rtems_semaphore_obtain - sem 1 - RTEMS_WAIT FOREVER +TA1 - rtems_semaphore_delete - delete sem 1 - RTEMS_SUCCESSFUL +TA1 - rtems_semaphore_obtain - binary semaphore +TA1 - rtems_semaphore_delete - delete sem 2 - RTEMS_RESOURCE_IN_USE +TA1 - rtems_task_wake_after - yield processor - RTEMS_SUCCESSFUL +TA2 - rtems_semaphore_obtain - woke up with RTEMS_OBJECT_WAS_DELETED +TA2 - rtems_task_delete - delete self - RTEMS_SUCCESSFUL + +TA1 - rtems_message_queue_broadcast - RTEMS_INVALID_ID +TA1 - rtems_message_queue_create - Q 1 - RTEMS_INVALID_NAME +TA1 - rtems_message_queue_create - Q 1 - RTEMS_MP_NOT_CONFIGURED +TA1 - rtems_message_queue_create - Q 1 - RTEMS_LIMIT - RTEMS_SUCCESSFUL +TA1 - rtems_message_queue_create - Q 2 - RTEMS_TOO_MANY +TA1 - rtems_message_queue_delete - unknown RTEMS_INVALID_ID +TA1 - rtems_message_queue_delete - local RTEMS_INVALID_ID +TA1 - rtems_message_queue_ident - RTEMS_INVALID_NAME +TA1 - rtems_message_queue_flush - RTEMS_INVALID_ID +TA1 - rtems_message_queue_receive - RTEMS_INVALID_ID +TA1 - rtems_message_queue_receive - Q 1 - RTEMS_UNSATISFIED +TA1 - rtems_message_queue_receive - Q 1 - timeout in 3 seconds +TA1 - rtems_message_queue_receive - Q 1 - woke up with RTEMS_TIMEOUT +TA1 - rtems_message_queue_send - RTEMS_INVALID_ID +TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL +TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL +TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1 - RTEMS_TOO_MANY + +TA1 - rtems_message_queue_delete - Q 1 - RTEMS_SUCCESSFUL +TA1 - rtems_message_queue_create - Q 1 - RTEMS_LIMIT - RTEMS_SUCCESSFUL +TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL +TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL +TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1 - RTEMS_TOO_MANY +TA1 - rtems_message_queue_delete - Q 1 - RTEMS_SUCCESSFUL +TA1 - rtems_message_queue_create - Q 1 - RTEMS_LIMIT - RTEMS_SUCCESSFUL +TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL +TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL +TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1 - RTEMS_UNSATISFIED +TA1 - rtems_message_queue_delete - Q 1 - RTEMS_SUCCESSFUL +TA1 - rtems_message_queue_create - Q 1 - RTEMS_LIMIT - RTEMS_SUCCESSFUL +TA1 - rtems_task_start - start TA3 - RTEMS_SUCCESSFUL +TA1 - rtems_task_wake_after - yield processor - RTEMS_SUCCESSFUL +TA3 - rtems_message_queue_receive - Q 1 - RTEMS_WAIT FOREVER +TA1 - rtems_message_queue_delete - delete Q 1 - RTEMS_SUCCESSFUL +TA1 - rtems_task_wake_after - yield processor - RTEMS_SUCCESSFUL +TA3 - rtems_message_queue_receive - woke up with RTEMS_OBJECT_WAS_DELETED +TA3 - rtems_task_delete - delete self - RTEMS_SUCCESSFUL + +TA1 - rtems_interrupt_catch - RTEMS_INVALID_NUMBER +TA1 - rtems_interrupt_catch - RTEMS_INVALID_ADDRESS +TA1 - rtems_signal_send - RTEMS_INVALID_ID +TA1 - rtems_signal_send - RTEMS_NOT_DEFINED +TA1 - rtems_port_create - RTEMS_INVALID_NAME +TA1 - rtems_port_create - RTEMS_INVALID_ADDRESS +TA1 - rtems_port_create - RTEMS_TOO_MANY +TA1 - rtems_port_delete - RTEMS_INVALID_ID +TA1 - rtems_port_ident - RTEMS_INVALID_NAME +TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ID +TA1 - rtems_port_internal_to_external - RTEMS_INVALID_ID + +TA1 - rtems_rate_monotonic_create - RTEMS_INVALID_NAME +TA1 - rtems_rate_monotonic_create - RTEMS_SUCCESSFUL +TA1 - rtems_rate_monotonic_create - RTEMS_TOO_MANY +TA1 - rtems_rate_monotonic_ident - RTEMS_INVALID_NAME +TA1 - rtems_rate_monotonic_period - unknown RTEMS_INVALID_ID +TA1 - rtems_rate_monotonic_period - local RTEMS_INVALID_ID +TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_NOT_DEFINED +TA1 - rtems_rate_monotonic_period - 100 ticks - RTEMS_SUCCESSFUL +TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_SUCCESSFUL +TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_TIMEOUT +TA1 - rtems_rate_monotonic_cancel - unknown RTEMS_INVALID_ID +TA1 - rtems_rate_monotonic_cancel - local RTEMS_INVALID_ID +TA1 - rtems_rate_monotonic_cancel - RTEMS_SUCCESSFUL +TA1 - rtems_rate_monotonic_period - 5 ticks - RTEMS_TIMEOUT +TA1 - yielding to TA4 +TA4 - rtems_rate_monotonic_cancel - RTEMS_NOT_OWNER_OF_RESOURCE +TA4 - rtems_rate_monotonic_period - RTEMS_NOT_OWNER_OF_RESOURCE +TA4 - rtems_task_delete - delete self - RTEMS_SUCCESSFUL +TA1 - rtems_rate_monotonic_delete - unknown RTEMS_INVALID_ID +TA1 - rtems_rate_monotonic_delete - local RTEMS_INVALID_ID +TA1 - rtems_rate_monotonic_delete - RTEMS_SUCCESSFUL + +TA1 - rtems_partition_create - RTEMS_INVALID_NAME +TA1 - rtems_partition_create - length - RTEMS_INVALID_SIZE +TA1 - rtems_partition_create - buffer size - RTEMS_INVALID_SIZE +TA1 - rtems_partition_create - length < buffer size - RTEMS_INVALID_SIZE +TA1 - rtems_partition_create - RTEMS_MP_NOT_CONFIGURED +TA1 - rtems_partition_create - RTEMS_INVALID_ADDRESS +TA1 - rtems_partition_create - RTEMS_INVALID_SIZE +TA1 - rtems_partition_delete - unknown RTEMS_INVALID_ID +TA1 - rtems_partition_delete - local RTEMS_INVALID_ID +TA1 - rtems_partition_get_buffer - RTEMS_INVALID_ID +TA1 - rtems_partition_ident - RTEMS_INVALID_NAME +TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ID +TA1 - rtems_partition_create - RTEMS_SUCCESSFUL +TA1 - rtems_partition_create - RTEMS_TOO_MANY +TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL +TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL +TA1 - rtems_partition_get_buffer - RTEMS_UNSATISFIED +TA1 - rtems_partition_delete - RTEMS_RESOURCE_IN_USE +TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ADDRESS - out of range +TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ADDRESS - not on boundary + +TA1 - rtems_region_create - RTEMS_INVALID_NAME +TA1 - rtems_region_create - RTEMS_INVALID_ADDRESS +TA1 - rtems_region_create - RTEMS_INVALID_SIZE +TA1 - rtems_region_create - RTEMS_SUCCESSFUL +TA1 - rtems_region_create - RTEMS_TOO_MANY +TA1 - rtems_region_delete - unknown RTEMS_INVALID_ID +TA1 - rtems_region_delete - local RTEMS_INVALID_ID +TA1 - rtems_region_ident - RTEMS_INVALID_NAME +TA1 - rtems_region_get_segment - RTEMS_INVALID_ID +TA1 - rtems_region_get_segment - RTEMS_INVALID_SIZE +TA1 - rtems_region_get_segment - RTEMS_SUCCESSFUL +TA1 - rtems_region_get_segment - RTEMS_UNSATISFIED +TA1 - rtems_region_get_segment - timeout in 3 seconds +TA1 - rtems_region_get_segment - woke up with RTEMS_TIMEOUT +TA1 - rtems_region_delete - RTEMS_RESOURCE_IN_USE +TA1 - rtems_region_return_segment - RTEMS_INVALID_ID +TA1 - rtems_region_return_segment - RTEMS_INVALID_ADDRESS +TA1 - rtems_debug_disable - RTEMS_DEBUG_REGION +TA1 - rtems_region_return_segment - RTEMS_INVALID_ADDRESS +TA1 - rtems_region_return_segment - RTEMS_INVALID_ADDRESS +TA1 - rtems_debug_enable - RTEMS_DEBUG_REGION +TA1 - rtems_region_extend - RTEMS_INVALID_ID +TA1 - rtems_region_extend - within heap - RTEMS_INVALID_ADDRESS +TA1 - rtems_region_extend - non-contiguous lower - RTEMS_NOT_IMPLEMENTED +TA1 - rtems_region_extend - contiguous lower - RTEMS_NOT_IMPLEMENTED +TA1 - rtems_region_extend - non-contiguous higher - RTEMS_NOT_IMPLEMENTED + +TA1 - rtems_io_close - RTEMS_INVALID_NUMBER +TA1 - rtems_io_control - RTEMS_INVALID_NUMBER +TA1 - rtems_io_initialize - RTEMS_INVALID_NUMBER +TA1 - rtems_io_open - RTEMS_INVALID_NUMBER +TA1 - rtems_io_read - RTEMS_INVALID_NUMBER +TA1 - rtems_io_write - RTEMS_INVALID_NUMBER +TA1 - rtems_clock_set - 23:59:59 12/31/2000 - RTEMS_SUCCESSFUL +TA1 - rtems_clock_get - 00:00:00 01/01/2001 - RTEMS_SUCCESSFUL +TA1 - rtems_clock_set - 23:59:59 12/31/1999 - RTEMS_SUCCESSFUL +TA1 - rtems_clock_get - 00:00:00 01/01/2000 - RTEMS_SUCCESSFUL +TA1 - rtems_clock_set - 23:59:59 12/31/2100 - RTEMS_SUCCESSFUL +TA1 - rtems_clock_get - 00:00:00 01/01/2101 - RTEMS_SUCCESSFUL +TA1 - rtems_clock_set - 23:59:59 12/31/2099 - RTEMS_SUCCESSFUL +TA1 - rtems_clock_get - 00:00:00 01/01/2100 - RTEMS_SUCCESSFUL +TA1 - rtems_clock_set - 23:59:59 12/31/1991 - RTEMS_SUCCESSFUL +TA1 - rtems_clock_get - 00:00:00 01/01/1992 - RTEMS_SUCCESSFUL + +TA1 - rtems_timer_create - RTEMS_INVALID_NAME +TA1 - rtems_timer_create - 1 - RTEMS_SUCCESSFUL +TA1 - rtems_timer_create - 2 - RTEMS_TOO_MANY +TA1 - rtems_timer_delete - local RTEMS_INVALID_ID +TA1 - rtems_timer_delete - global RTEMS_INVALID_ID +TA1 - rtems_timer_ident - RTEMS_INVALID_NAME +TA1 - rtems_timer_cancel - RTEMS_INVALID_ID +TA1 - rtems_timer_cancel - RTEMS_INCORRECT_STATE +TA1 - rtems_timer_reset - RTEMS_INVALID_ID +TA1 - rtems_timer_reset - RTEMS_NOT_DEFINED +TA1 - rtems_timer_fire_after - RTEMS_INVALID_ID +TA1 - rtems_timer_fire_when - RTEMS_INVALID_ID +TA1 - rtems_timer_fire_after - RTEMS_INVALID_NUMBER +TA1 - rtems_timer_fire_when - 08:30:45 02/05/1987 - RTEMS_INVALID_CLOCK +TA1 - rtems_clock_get - 00:00:00 01/01/1992 +TA1 - rtems_timer_fire_when - 08:30:45 02/05/1990 - before RTEMS_INVALID_CLOCK +*** END OF TEST 9 *** diff --git a/testsuites/sptests/sp09/system.h b/testsuites/sptests/sp09/system.h new file mode 100644 index 0000000000..aa2c6d17e4 --- /dev/null +++ b/testsuites/sptests/sp09/system.h @@ -0,0 +1,30 @@ +/* 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 +#include "tmacros.h" + +/* Miscellaneous */ + +#define EXTERN extern /* external definition */ + +/* macros */ + +/* structures */ + +#include "gvar.h" + +/* end of include file */ diff --git a/testsuites/sptests/sp09/task1.c b/testsuites/sptests/sp09/task1.c new file mode 100644 index 0000000000..dbf28f57a8 --- /dev/null +++ b/testsuites/sptests/sp09/task1.c @@ -0,0 +1,74 @@ +/* Task_1 + * + * This task generates all possible errors for the RTEMS executive. + * + * 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" + +#ifdef pause +#undef pause +#endif + +rtems_task Task_1( + rtems_task_argument argument +) +{ + Screen1(); + pause_and_screen_number( 2 ); + + Screen2(); + pause_and_screen_number( 3 ); + + Screen3(); + pause_and_screen_number( 4 ); + + Screen4(); + pause_and_screen_number( 5 ); + + Screen5(); + pause_and_screen_number( 6 ); + + Screen6(); + pause_and_screen_number( 7 ); + + Screen7(); + pause_and_screen_number( 8 ); + + Screen8(); + pause_and_screen_number( 9 ); + + Screen9(); + pause_and_screen_number( 10 ); + + Screen10(); + pause_and_screen_number( 11 ); + + Screen11(); + pause_and_screen_number( 12 ); + + Screen12(); + pause_and_screen_number( 13 ); + + Screen13(); + pause_and_screen_number( 14 ); + + Screen14(); + + puts( "*** END OF TEST 9 ***" ); + exit( 0 ); +} diff --git a/testsuites/sptests/sp09/task2.c b/testsuites/sptests/sp09/task2.c new file mode 100644 index 0000000000..e9bda81fa3 --- /dev/null +++ b/testsuites/sptests/sp09/task2.c @@ -0,0 +1,48 @@ +/* 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, 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_semaphore_obtain - sem 1 - RTEMS_WAIT FOREVER" ); + status = rtems_semaphore_obtain( + Semaphore_id[ 1 ], + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT + ); + fatal_directive_status( + status, + RTEMS_OBJECT_WAS_DELETED, + "rtems_semaphore_obtain waiting to be deleted" + ); + puts( + "TA2 - rtems_semaphore_obtain - woke up with RTEMS_OBJECT_WAS_DELETED" + ); + + puts( "TA2 - rtems_task_delete - delete self - RTEMS_SUCCESSFUL" ); + status = rtems_task_delete( RTEMS_SELF ); + directive_failed( status, "rtems_task_delete of TA2" ); +} diff --git a/testsuites/sptests/sp09/task3.c b/testsuites/sptests/sp09/task3.c new file mode 100644 index 0000000000..8420c51f4d --- /dev/null +++ b/testsuites/sptests/sp09/task3.c @@ -0,0 +1,51 @@ +/* Task_3 + * + * This routine serves as a test task. Its only purpose in life is to + * generate the error where a message queue is deleted while a task + * is waiting there for a message. + * + * 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; + long buffer[ 4 ]; + + puts( "TA3 - rtems_message_queue_receive - Q 1 - RTEMS_WAIT FOREVER" ); + status = rtems_message_queue_receive( + Queue_id[ 1 ], + (long (*)[4])buffer, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT + ); + fatal_directive_status( + status, + RTEMS_OBJECT_WAS_DELETED, + "rtems_message_queue_receive waiting to be deleted" + ); + puts( + "TA3 - rtems_message_queue_receive - woke up with RTEMS_OBJECT_WAS_DELETED" + ); + + puts( "TA3 - rtems_task_delete - delete self - RTEMS_SUCCESSFUL" ); + status = rtems_task_delete( RTEMS_SELF ); + directive_failed( status, "rtems_task_delete of TA3" ); +} diff --git a/testsuites/sptests/sp09/task4.c b/testsuites/sptests/sp09/task4.c new file mode 100644 index 0000000000..73cd63373c --- /dev/null +++ b/testsuites/sptests/sp09/task4.c @@ -0,0 +1,50 @@ +/* Task_4 + * + * This routine serves as a test task. Its only purpose in life is to + * generate the error where a rate monotonic period is accessed by a + * task other than its creator. + * + * 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_4( + rtems_task_argument argument +) +{ + rtems_status_code status; + + status = rtems_rate_monotonic_cancel( Period_id[ 1 ] ); + fatal_directive_status( + status, + RTEMS_NOT_OWNER_OF_RESOURCE, + "rtems_rate_monotonic_cancel not the owner" + ); + puts( "TA4 - rtems_rate_monotonic_cancel - RTEMS_NOT_OWNER_OF_RESOURCE" ); + + status = rtems_rate_monotonic_period( Period_id[ 1 ], 5 ); + fatal_directive_status( + status, + RTEMS_NOT_OWNER_OF_RESOURCE, + "rtems_rate_monotonic_period not the owner" + ); + puts( "TA4 - rtems_rate_monotonic_period - RTEMS_NOT_OWNER_OF_RESOURCE" ); + + puts( "TA4 - rtems_task_delete - delete self - RTEMS_SUCCESSFUL" ); + status = rtems_task_delete( RTEMS_SELF ); + directive_failed( status, "rtems_task_delete of TA4" ); +} -- cgit v1.2.3