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/sp21/init.c | 56 +++++++++++++++++++++ testsuites/sptests/sp21/sp21.doc | 28 +++++++++++ testsuites/sptests/sp21/sp21.scn | 19 +++++++ testsuites/sptests/sp21/system.h | 30 +++++++++++ testsuites/sptests/sp21/task1.c | 106 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 239 insertions(+) create mode 100644 testsuites/sptests/sp21/init.c create mode 100644 testsuites/sptests/sp21/sp21.doc create mode 100644 testsuites/sptests/sp21/sp21.scn create mode 100644 testsuites/sptests/sp21/system.h create mode 100644 testsuites/sptests/sp21/task1.c (limited to 'testsuites/sptests/sp21') diff --git a/testsuites/sptests/sp21/init.c b/testsuites/sptests/sp21/init.c new file mode 100644 index 0000000000..bee9b931fc --- /dev/null +++ b/testsuites/sptests/sp21/init.c @@ -0,0 +1,56 @@ +/* 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 21 ***" ); + + Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); + + status = rtems_task_create( + Task_name[ 1 ], + 1, + 2048, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 1 ] + ); + directive_failed( status, "rtems_task_create of TA1" ); + + status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); + directive_failed( status, "rtems_task_start of TA1" ); + + status = rtems_task_delete( RTEMS_SELF ); + directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); +} diff --git a/testsuites/sptests/sp21/sp21.doc b/testsuites/sptests/sp21/sp21.doc new file mode 100644 index 0000000000..55ed6282bc --- /dev/null +++ b/testsuites/sptests/sp21/sp21.doc @@ -0,0 +1,28 @@ +# +# $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: test21 + +directives: + ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_delete + de_init, de_open, de_close, de_read, de_write, de_cntrl + +concepts: + + a. Verifies all I/O manager directives always return successful for + null drivers. + + b. Verifies all I/O manager directives call and return from the driver + entry points in the driver address table. diff --git a/testsuites/sptests/sp21/sp21.scn b/testsuites/sptests/sp21/sp21.scn new file mode 100644 index 0000000000..c6392e3ea3 --- /dev/null +++ b/testsuites/sptests/sp21/sp21.scn @@ -0,0 +1,19 @@ +*** TEST 21 *** +----- TESTING THE NULL DRIVER CHECKS ----- +TA1 - rtems_io_initialize - NULL DRIVER RTEMS_SUCCESSFUL +TA1 - rtems_io_open - NULL DRIVER RTEMS_SUCCESSFUL +TA1 - rtems_io_close - NULL DRIVER RTEMS_SUCCESSFUL +TA1 - rtems_io_read - NULL DRIVER RTEMS_SUCCESSFUL +TA1 - rtems_io_write - NULL DRIVER RTEMS_SUCCESSFUL +TA1 - rtems_io_control - NULL DRIVER RTEMS_SUCCESSFUL +----- TESTING THE I/O MANAGER DIRECTIVES ----- +TA1 - rtems_io_initialize - STUB DRIVER RTEMS_SUCCESSFUL +TA1 - rtems_io_open - STUB DRIVER RTEMS_SUCCESSFUL +TA1 - rtems_io_close - STUB DRIVER RTEMS_SUCCESSFUL +TA1 - rtems_io_read - STUB DRIVER RTEMS_SUCCESSFUL +TA1 - rtems_io_write - STUB DRIVER RTEMS_SUCCESSFUL +TA1 - rtems_io_control - STUB DRIVER RTEMS_SUCCESSFUL +----- RETURNING INVALID MAJOR NUMBER ----- +TA1 - rtems_io_initialize - RTEMS_INVALID_NUMBER +TA1 - rtems_io_open - RTEMS_INVALID_NUMBER +*** END OF TEST 21 *** diff --git a/testsuites/sptests/sp21/system.h b/testsuites/sptests/sp21/system.h new file mode 100644 index 0000000000..aa2c6d17e4 --- /dev/null +++ b/testsuites/sptests/sp21/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/sp21/task1.c b/testsuites/sptests/sp21/task1.c new file mode 100644 index 0000000000..3c4b284a97 --- /dev/null +++ b/testsuites/sptests/sp21/task1.c @@ -0,0 +1,106 @@ +/* Task_1 + * + * This routine serves as a test task. It tests the I/O manager. + * + * Input parameters: + * argument - task argument + * + * Output parameters: NONE + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#include "system.h" + +#define STUB_DRIVER_MAJOR 0x2 +#define NO_DRIVER_MAJOR 0x1 +#define INVALID_DRIVER_MAJOR 0x5 + +rtems_task Task_1( + rtems_task_argument argument +) +{ + rtems_status_code status; + rtems_status_code return_value; + + puts( "----- TESTING THE NULL DRIVER CHECKS -----" ); + + status = rtems_io_initialize( NO_DRIVER_MAJOR, 0, NULL, &return_value ); + directive_failed( status, "rtems_io_initialize" ); + puts( "TA1 - rtems_io_initialize - NULL DRIVER RTEMS_SUCCESSFUL" ); + + status = rtems_io_open( NO_DRIVER_MAJOR, 0, NULL, &return_value ); + directive_failed( status, "rtems_io_open" ); + puts( "TA1 - rtems_io_open - NULL DRIVER RTEMS_SUCCESSFUL" ); + + status = rtems_io_close( NO_DRIVER_MAJOR, 0, NULL, &return_value ); + directive_failed( status, "rtems_io_close" ); + puts( "TA1 - rtems_io_close - NULL DRIVER RTEMS_SUCCESSFUL" ); + + status = rtems_io_read( NO_DRIVER_MAJOR, 0, NULL, &return_value ); + directive_failed( status, "rtems_io_read" ); + puts( "TA1 - rtems_io_read - NULL DRIVER RTEMS_SUCCESSFUL" ); + + status = rtems_io_write( NO_DRIVER_MAJOR, 0, NULL, &return_value ); + directive_failed( status, "rtems_io_write" ); + puts( "TA1 - rtems_io_write - NULL DRIVER RTEMS_SUCCESSFUL" ); + + status = rtems_io_control( NO_DRIVER_MAJOR, 0, NULL, &return_value ); + directive_failed( status, "rtems_io_control" ); + puts( "TA1 - rtems_io_control - NULL DRIVER RTEMS_SUCCESSFUL" ); + + puts( "----- TESTING THE I/O MANAGER DIRECTIVES -----" ); + + status = rtems_io_initialize( STUB_DRIVER_MAJOR, 0, NULL, &return_value ); + directive_failed( status, "rtems_io_initialize" ); + puts( "TA1 - rtems_io_initialize - STUB DRIVER RTEMS_SUCCESSFUL" ); + + status = rtems_io_open( STUB_DRIVER_MAJOR, 0, NULL, &return_value ); + directive_failed( status, "rtems_io_open" ); + puts( "TA1 - rtems_io_open - STUB DRIVER RTEMS_SUCCESSFUL" ); + + status = rtems_io_close( STUB_DRIVER_MAJOR, 0, NULL, &return_value ); + directive_failed( status, "rtems_io_close" ); + puts( "TA1 - rtems_io_close - STUB DRIVER RTEMS_SUCCESSFUL" ); + + status = rtems_io_read( STUB_DRIVER_MAJOR, 0, NULL, &return_value ); + directive_failed( status, "rtems_io_read" ); + puts( "TA1 - rtems_io_read - STUB DRIVER RTEMS_SUCCESSFUL" ); + + status = rtems_io_write( STUB_DRIVER_MAJOR, 0, NULL, &return_value ); + directive_failed( status, "rtems_io_write" ); + puts( "TA1 - rtems_io_write - STUB DRIVER RTEMS_SUCCESSFUL" ); + + status = rtems_io_control( STUB_DRIVER_MAJOR, 0, NULL, &return_value ); + directive_failed( status, "rtems_io_control" ); + puts( "TA1 - rtems_io_control - STUB DRIVER RTEMS_SUCCESSFUL" ); + + puts( "----- RETURNING INVALID MAJOR NUMBER -----" ); + + status = rtems_io_initialize( INVALID_DRIVER_MAJOR, 0, NULL, &return_value ); + fatal_directive_status( + status, + RTEMS_INVALID_NUMBER, + "rtems_io_initialize" + ); + puts( "TA1 - rtems_io_initialize - RTEMS_INVALID_NUMBER" ); + + status = rtems_io_open( INVALID_DRIVER_MAJOR, 0, NULL, &return_value ); + fatal_directive_status( + status, + RTEMS_INVALID_NUMBER, + "rtems_io_open" + ); + puts( "TA1 - rtems_io_open - RTEMS_INVALID_NUMBER" ); + + puts( "*** END OF TEST 21 ***" ); + exit( 0 ); +} -- cgit v1.2.3