source: rtems/c/src/tests/sptests/sp21/task1.c @ 7979e35

4.104.114.84.95
Last change on this file since 7979e35 was 7c22114b, checked in by Joel Sherrill <joel.sherrill@…>, on 05/31/95 at 17:37:05

Corrected minor number for "Null" device driver

  • Property mode set to 100644
File size: 3.7 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 *  $Id$
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  rtems_status_code return_value;
33
34  puts( "-----  TESTING THE NULL DRIVER CHECKS  -----" );
35
36  status = rtems_io_initialize( NO_DRIVER_MAJOR, 0, NULL, &return_value );
37  directive_failed( status, "rtems_io_initialize" );
38  puts( "TA1 - rtems_io_initialize  - NULL DRIVER RTEMS_SUCCESSFUL" );
39
40  status = rtems_io_open( NO_DRIVER_MAJOR, 0, NULL, &return_value );
41  directive_failed( status, "rtems_io_open" );
42  puts( "TA1 - rtems_io_open        - NULL DRIVER RTEMS_SUCCESSFUL" );
43
44  status = rtems_io_close( NO_DRIVER_MAJOR, 0, NULL, &return_value );
45  directive_failed( status, "rtems_io_close" );
46  puts( "TA1 - rtems_io_close       - NULL DRIVER RTEMS_SUCCESSFUL" );
47
48  status = rtems_io_read( NO_DRIVER_MAJOR, 0, NULL, &return_value );
49  directive_failed( status, "rtems_io_read" );
50  puts( "TA1 - rtems_io_read        - NULL DRIVER RTEMS_SUCCESSFUL" );
51
52  status = rtems_io_write( NO_DRIVER_MAJOR, 0, NULL, &return_value );
53  directive_failed( status, "rtems_io_write" );
54  puts( "TA1 - rtems_io_write       - NULL DRIVER RTEMS_SUCCESSFUL" );
55
56  status = rtems_io_control( NO_DRIVER_MAJOR, 0, NULL, &return_value );
57  directive_failed( status, "rtems_io_control" );
58  puts( "TA1 - rtems_io_control     - NULL DRIVER RTEMS_SUCCESSFUL" );
59
60  puts( "-----  TESTING THE I/O MANAGER DIRECTIVES  -----" );
61
62  status = rtems_io_initialize( STUB_DRIVER_MAJOR, 0, NULL, &return_value );
63  directive_failed( status, "rtems_io_initialize" );
64  puts( "TA1 - rtems_io_initialize  - STUB DRIVER RTEMS_SUCCESSFUL" );
65
66  status = rtems_io_open( STUB_DRIVER_MAJOR, 0, NULL, &return_value );
67  directive_failed( status, "rtems_io_open" );
68  puts( "TA1 - rtems_io_open        - STUB DRIVER RTEMS_SUCCESSFUL" );
69
70  status = rtems_io_close( STUB_DRIVER_MAJOR, 0, NULL, &return_value );
71  directive_failed( status, "rtems_io_close" );
72  puts( "TA1 - rtems_io_close       - STUB DRIVER RTEMS_SUCCESSFUL" );
73
74  status = rtems_io_read( STUB_DRIVER_MAJOR, 0, NULL, &return_value );
75  directive_failed( status, "rtems_io_read" );
76  puts( "TA1 - rtems_io_read        - STUB DRIVER RTEMS_SUCCESSFUL" );
77
78  status = rtems_io_write( STUB_DRIVER_MAJOR, 0, NULL, &return_value );
79  directive_failed( status, "rtems_io_write" );
80  puts( "TA1 - rtems_io_write       - STUB DRIVER RTEMS_SUCCESSFUL" );
81
82  status = rtems_io_control( STUB_DRIVER_MAJOR, 0, NULL, &return_value );
83  directive_failed( status, "rtems_io_control" );
84  puts( "TA1 - rtems_io_control     - STUB DRIVER RTEMS_SUCCESSFUL" );
85
86  puts( "-----  RETURNING INVALID MAJOR NUMBER -----" );
87
88  status = rtems_io_initialize( INVALID_DRIVER_MAJOR, 0, NULL, &return_value );
89  fatal_directive_status(
90    status,
91    RTEMS_INVALID_NUMBER,
92    "rtems_io_initialize"
93  );
94  puts( "TA1 - rtems_io_initialize  - RTEMS_INVALID_NUMBER" );
95
96  status = rtems_io_open( INVALID_DRIVER_MAJOR, 0, NULL, &return_value );
97  fatal_directive_status(
98    status,
99    RTEMS_INVALID_NUMBER,
100    "rtems_io_open"
101  );
102  puts( "TA1 - rtems_io_open        - RTEMS_INVALID_NUMBER" );
103
104  puts( "*** END OF TEST 21 ***" );
105  exit( 0 );
106}
Note: See TracBrowser for help on using the repository browser.