source: rtems/c/src/tests/sptests/sp21/task1.c @ 4b374f36

4.104.114.84.95
Last change on this file since 4b374f36 was 4b374f36, checked in by Joel Sherrill <joel.sherrill@…>, on 08/17/95 at 19:36:43

maximum number of messages removed and include statement cleanup

  • Property mode set to 100644
File size: 3.5 KB
Line 
1/*  Task_1
2 *
3 *  This routine serves as a test task.  It tests the I/O manager.
4 *
5 *  Input parameters:
6 *    argument - task argument
7 *
8 *  Output parameters:  NONE
9 *
10 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
11 *  On-Line Applications Research Corporation (OAR).
12 *  All rights assigned to U.S. Government, 1994.
13 *
14 *  This material may be reproduced by or for the U.S. Government pursuant
15 *  to the copyright license under the clause at DFARS 252.227-7013.  This
16 *  notice must appear in all copies of this file and its derivatives.
17 *
18 *  task1.c,v 1.3 1995/05/31 17:37:05 joel Exp
19 */
20
21#include "system.h"
22
23#define STUB_DRIVER_MAJOR     0x2
24#define NO_DRIVER_MAJOR       0x3
25#define INVALID_DRIVER_MAJOR  0x5
26
27rtems_task Task_1(
28  rtems_task_argument argument
29)
30{
31  rtems_status_code status;
32
33  puts( "-----  TESTING THE NULL DRIVER CHECKS  -----" );
34
35  status = rtems_io_initialize( NO_DRIVER_MAJOR, 0, NULL );
36  directive_failed( status, "rtems_io_initialize" );
37  puts( "TA1 - rtems_io_initialize  - NULL DRIVER RTEMS_SUCCESSFUL" );
38
39  status = rtems_io_open( NO_DRIVER_MAJOR, 0, NULL );
40  directive_failed( status, "rtems_io_open" );
41  puts( "TA1 - rtems_io_open        - NULL DRIVER RTEMS_SUCCESSFUL" );
42
43  status = rtems_io_close( NO_DRIVER_MAJOR, 0, NULL );
44  directive_failed( status, "rtems_io_close" );
45  puts( "TA1 - rtems_io_close       - NULL DRIVER RTEMS_SUCCESSFUL" );
46
47  status = rtems_io_read( NO_DRIVER_MAJOR, 0, NULL );
48  directive_failed( status, "rtems_io_read" );
49  puts( "TA1 - rtems_io_read        - NULL DRIVER RTEMS_SUCCESSFUL" );
50
51  status = rtems_io_write( NO_DRIVER_MAJOR, 0, NULL );
52  directive_failed( status, "rtems_io_write" );
53  puts( "TA1 - rtems_io_write       - NULL DRIVER RTEMS_SUCCESSFUL" );
54
55  status = rtems_io_control( NO_DRIVER_MAJOR, 0, NULL );
56  directive_failed( status, "rtems_io_control" );
57  puts( "TA1 - rtems_io_control     - NULL DRIVER RTEMS_SUCCESSFUL" );
58
59  puts( "-----  TESTING THE I/O MANAGER DIRECTIVES  -----" );
60
61  status = rtems_io_initialize( STUB_DRIVER_MAJOR, 0, NULL );
62  directive_failed( status, "rtems_io_initialize" );
63  puts( "TA1 - rtems_io_initialize  - STUB DRIVER RTEMS_SUCCESSFUL" );
64
65  status = rtems_io_open( STUB_DRIVER_MAJOR, 0, NULL );
66  directive_failed( status, "rtems_io_open" );
67  puts( "TA1 - rtems_io_open        - STUB DRIVER RTEMS_SUCCESSFUL" );
68
69  status = rtems_io_close( STUB_DRIVER_MAJOR, 0, NULL );
70  directive_failed( status, "rtems_io_close" );
71  puts( "TA1 - rtems_io_close       - STUB DRIVER RTEMS_SUCCESSFUL" );
72
73  status = rtems_io_read( STUB_DRIVER_MAJOR, 0, NULL );
74  directive_failed( status, "rtems_io_read" );
75  puts( "TA1 - rtems_io_read        - STUB DRIVER RTEMS_SUCCESSFUL" );
76
77  status = rtems_io_write( STUB_DRIVER_MAJOR, 0, NULL );
78  directive_failed( status, "rtems_io_write" );
79  puts( "TA1 - rtems_io_write       - STUB DRIVER RTEMS_SUCCESSFUL" );
80
81  status = rtems_io_control( STUB_DRIVER_MAJOR, 0, NULL );
82  directive_failed( status, "rtems_io_control" );
83  puts( "TA1 - rtems_io_control     - STUB DRIVER RTEMS_SUCCESSFUL" );
84
85  puts( "-----  RETURNING INVALID MAJOR NUMBER -----" );
86
87  status = rtems_io_initialize( INVALID_DRIVER_MAJOR, 0, NULL );
88  fatal_directive_status(
89    status,
90    RTEMS_INVALID_NUMBER,
91    "rtems_io_initialize"
92  );
93  puts( "TA1 - rtems_io_initialize  - RTEMS_INVALID_NUMBER" );
94
95  status = rtems_io_open( INVALID_DRIVER_MAJOR, 0, NULL );
96  fatal_directive_status(
97    status,
98    RTEMS_INVALID_NUMBER,
99    "rtems_io_open"
100  );
101  puts( "TA1 - rtems_io_open        - RTEMS_INVALID_NUMBER" );
102
103  puts( "*** END OF TEST 21 ***" );
104  exit( 0 );
105}
Note: See TracBrowser for help on using the repository browser.