1 |
30 |
unneback |
/* 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-1999.
|
11 |
|
|
* On-Line Applications Research Corporation (OAR).
|
12 |
|
|
*
|
13 |
|
|
* The license and distribution terms for this file may be
|
14 |
|
|
* found in the file LICENSE in this distribution or at
|
15 |
|
|
* http://www.OARcorp.com/rtems/license.html.
|
16 |
|
|
*
|
17 |
|
|
* $Id: task1.c,v 1.2 2001-09-27 12:02:35 chris Exp $
|
18 |
|
|
*/
|
19 |
|
|
|
20 |
|
|
#include "system.h"
|
21 |
|
|
|
22 |
|
|
#define STUB_DRIVER_MAJOR 0x2
|
23 |
|
|
#define NO_DRIVER_MAJOR 0x3
|
24 |
|
|
#define INVALID_DRIVER_MAJOR 0x5
|
25 |
|
|
|
26 |
|
|
rtems_task Task_1(
|
27 |
|
|
rtems_task_argument argument
|
28 |
|
|
)
|
29 |
|
|
{
|
30 |
|
|
rtems_status_code status;
|
31 |
|
|
|
32 |
|
|
puts( "----- TESTING THE NULL DRIVER CHECKS -----" );
|
33 |
|
|
|
34 |
|
|
status = rtems_io_initialize( NO_DRIVER_MAJOR, 0, NULL );
|
35 |
|
|
directive_failed( status, "rtems_io_initialize" );
|
36 |
|
|
puts( "TA1 - rtems_io_initialize - NULL DRIVER RTEMS_SUCCESSFUL" );
|
37 |
|
|
|
38 |
|
|
status = rtems_io_open( NO_DRIVER_MAJOR, 0, NULL );
|
39 |
|
|
directive_failed( status, "rtems_io_open" );
|
40 |
|
|
puts( "TA1 - rtems_io_open - NULL DRIVER RTEMS_SUCCESSFUL" );
|
41 |
|
|
|
42 |
|
|
status = rtems_io_close( NO_DRIVER_MAJOR, 0, NULL );
|
43 |
|
|
directive_failed( status, "rtems_io_close" );
|
44 |
|
|
puts( "TA1 - rtems_io_close - NULL DRIVER RTEMS_SUCCESSFUL" );
|
45 |
|
|
|
46 |
|
|
status = rtems_io_read( NO_DRIVER_MAJOR, 0, NULL );
|
47 |
|
|
directive_failed( status, "rtems_io_read" );
|
48 |
|
|
puts( "TA1 - rtems_io_read - NULL DRIVER RTEMS_SUCCESSFUL" );
|
49 |
|
|
|
50 |
|
|
status = rtems_io_write( NO_DRIVER_MAJOR, 0, NULL );
|
51 |
|
|
directive_failed( status, "rtems_io_write" );
|
52 |
|
|
puts( "TA1 - rtems_io_write - NULL DRIVER RTEMS_SUCCESSFUL" );
|
53 |
|
|
|
54 |
|
|
status = rtems_io_control( NO_DRIVER_MAJOR, 0, NULL );
|
55 |
|
|
directive_failed( status, "rtems_io_control" );
|
56 |
|
|
puts( "TA1 - rtems_io_control - NULL DRIVER RTEMS_SUCCESSFUL" );
|
57 |
|
|
|
58 |
|
|
puts( "----- TESTING THE I/O MANAGER DIRECTIVES -----" );
|
59 |
|
|
|
60 |
|
|
status = rtems_io_initialize( STUB_DRIVER_MAJOR, 0, NULL );
|
61 |
|
|
directive_failed( status, "rtems_io_initialize" );
|
62 |
|
|
puts( "TA1 - rtems_io_initialize - STUB DRIVER RTEMS_SUCCESSFUL" );
|
63 |
|
|
|
64 |
|
|
status = rtems_io_open( STUB_DRIVER_MAJOR, 0, NULL );
|
65 |
|
|
directive_failed( status, "rtems_io_open" );
|
66 |
|
|
puts( "TA1 - rtems_io_open - STUB DRIVER RTEMS_SUCCESSFUL" );
|
67 |
|
|
|
68 |
|
|
status = rtems_io_close( STUB_DRIVER_MAJOR, 0, NULL );
|
69 |
|
|
directive_failed( status, "rtems_io_close" );
|
70 |
|
|
puts( "TA1 - rtems_io_close - STUB DRIVER RTEMS_SUCCESSFUL" );
|
71 |
|
|
|
72 |
|
|
status = rtems_io_read( STUB_DRIVER_MAJOR, 0, NULL );
|
73 |
|
|
directive_failed( status, "rtems_io_read" );
|
74 |
|
|
puts( "TA1 - rtems_io_read - STUB DRIVER RTEMS_SUCCESSFUL" );
|
75 |
|
|
|
76 |
|
|
status = rtems_io_write( STUB_DRIVER_MAJOR, 0, NULL );
|
77 |
|
|
directive_failed( status, "rtems_io_write" );
|
78 |
|
|
puts( "TA1 - rtems_io_write - STUB DRIVER RTEMS_SUCCESSFUL" );
|
79 |
|
|
|
80 |
|
|
status = rtems_io_control( STUB_DRIVER_MAJOR, 0, NULL );
|
81 |
|
|
directive_failed( status, "rtems_io_control" );
|
82 |
|
|
puts( "TA1 - rtems_io_control - STUB DRIVER RTEMS_SUCCESSFUL" );
|
83 |
|
|
|
84 |
|
|
puts( "----- RETURNING INVALID MAJOR NUMBER -----" );
|
85 |
|
|
|
86 |
|
|
status = rtems_io_initialize( INVALID_DRIVER_MAJOR, 0, NULL );
|
87 |
|
|
fatal_directive_status(
|
88 |
|
|
status,
|
89 |
|
|
RTEMS_INVALID_NUMBER,
|
90 |
|
|
"rtems_io_initialize"
|
91 |
|
|
);
|
92 |
|
|
puts( "TA1 - rtems_io_initialize - RTEMS_INVALID_NUMBER" );
|
93 |
|
|
|
94 |
|
|
status = rtems_io_open( INVALID_DRIVER_MAJOR, 0, NULL );
|
95 |
|
|
fatal_directive_status(
|
96 |
|
|
status,
|
97 |
|
|
RTEMS_INVALID_NUMBER,
|
98 |
|
|
"rtems_io_open"
|
99 |
|
|
);
|
100 |
|
|
puts( "TA1 - rtems_io_open - RTEMS_INVALID_NUMBER" );
|
101 |
|
|
|
102 |
|
|
puts( "*** END OF TEST 21 ***" );
|
103 |
|
|
exit( 0 );
|
104 |
|
|
}
|