1 | /* Screen14 |
---|
2 | * |
---|
3 | * This routine generates error screen 14 for test 9. |
---|
4 | * |
---|
5 | * Input parameters: NONE |
---|
6 | * |
---|
7 | * Output parameters: NONE |
---|
8 | * |
---|
9 | * COPYRIGHT (c) 1989-1999. |
---|
10 | * On-Line Applications Research Corporation (OAR). |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.com/license/LICENSE. |
---|
15 | * |
---|
16 | * $Id$ |
---|
17 | */ |
---|
18 | |
---|
19 | #include "system.h" |
---|
20 | |
---|
21 | void Screen14() |
---|
22 | { |
---|
23 | rtems_status_code status; |
---|
24 | rtems_time_of_day time; |
---|
25 | |
---|
26 | status = rtems_timer_create( 0, &Junk_id ); |
---|
27 | fatal_directive_status( |
---|
28 | status, |
---|
29 | RTEMS_INVALID_NAME, |
---|
30 | "rtems_timer_create with illegal name" |
---|
31 | ); |
---|
32 | puts( "TA1 - rtems_timer_create - RTEMS_INVALID_NAME" ); |
---|
33 | |
---|
34 | status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] ); |
---|
35 | directive_failed( status, "rtems_timer_create" ); |
---|
36 | puts( "TA1 - rtems_timer_create - 1 - RTEMS_SUCCESSFUL" ); |
---|
37 | |
---|
38 | status = rtems_timer_create( 2, &Junk_id ); |
---|
39 | fatal_directive_status( |
---|
40 | status, |
---|
41 | RTEMS_TOO_MANY, |
---|
42 | "rtems_timer_create for too many" |
---|
43 | ); |
---|
44 | puts( "TA1 - rtems_timer_create - 2 - RTEMS_TOO_MANY" ); |
---|
45 | |
---|
46 | status = rtems_timer_delete( 100 ); |
---|
47 | fatal_directive_status( |
---|
48 | status, |
---|
49 | RTEMS_INVALID_ID, |
---|
50 | "rtems_timer_delete with illegal id" |
---|
51 | ); |
---|
52 | puts( "TA1 - rtems_timer_delete - local RTEMS_INVALID_ID" ); |
---|
53 | |
---|
54 | status = rtems_timer_delete( 0x010100 ); |
---|
55 | fatal_directive_status( |
---|
56 | status, |
---|
57 | RTEMS_INVALID_ID, |
---|
58 | "rtems_timer_delete with illegal id" |
---|
59 | ); |
---|
60 | puts( "TA1 - rtems_timer_delete - global RTEMS_INVALID_ID" ); |
---|
61 | |
---|
62 | status = rtems_timer_ident( 0, &Junk_id ); |
---|
63 | fatal_directive_status( |
---|
64 | status, |
---|
65 | RTEMS_INVALID_NAME, |
---|
66 | "rtems_timer_ident with illegal name" |
---|
67 | ); |
---|
68 | puts( "TA1 - rtems_timer_ident - RTEMS_INVALID_NAME" ); |
---|
69 | |
---|
70 | status = rtems_timer_cancel( 0x010100 ); |
---|
71 | fatal_directive_status( |
---|
72 | status, |
---|
73 | RTEMS_INVALID_ID, |
---|
74 | "rtems_timer_cancel with illegal id" |
---|
75 | ); |
---|
76 | puts( "TA1 - rtems_timer_cancel - RTEMS_INVALID_ID" ); |
---|
77 | |
---|
78 | status = rtems_timer_reset( 0x010100 ); |
---|
79 | fatal_directive_status( |
---|
80 | status, |
---|
81 | RTEMS_INVALID_ID, |
---|
82 | "rtems_timer_reset with illegal id" |
---|
83 | ); |
---|
84 | puts( "TA1 - rtems_timer_reset - RTEMS_INVALID_ID" ); |
---|
85 | |
---|
86 | status = rtems_timer_reset( Timer_id[ 1 ] ); |
---|
87 | fatal_directive_status( |
---|
88 | status, |
---|
89 | RTEMS_NOT_DEFINED, |
---|
90 | "rtems_timer_reset before initiated" |
---|
91 | ); |
---|
92 | puts( "TA1 - rtems_timer_reset - RTEMS_NOT_DEFINED" ); |
---|
93 | |
---|
94 | status = rtems_timer_fire_after( |
---|
95 | 0x010100, |
---|
96 | 5 * TICKS_PER_SECOND, |
---|
97 | Delayed_routine, |
---|
98 | NULL |
---|
99 | ); |
---|
100 | fatal_directive_status( |
---|
101 | status, |
---|
102 | RTEMS_INVALID_ID, |
---|
103 | "rtems_timer_fire_after illegal id" |
---|
104 | ); |
---|
105 | puts( "TA1 - rtems_timer_fire_after - RTEMS_INVALID_ID" ); |
---|
106 | |
---|
107 | build_time( &time, 12, 31, 1994, 9, 0, 0, 0 ); |
---|
108 | status = rtems_timer_fire_when( 0x010100, &time, Delayed_routine, NULL ); |
---|
109 | fatal_directive_status( |
---|
110 | status, |
---|
111 | RTEMS_INVALID_ID, |
---|
112 | "rtems_timer_fire_when with illegal id" |
---|
113 | ); |
---|
114 | puts( "TA1 - rtems_timer_fire_when - RTEMS_INVALID_ID" ); |
---|
115 | |
---|
116 | status = rtems_timer_fire_after( Timer_id[ 1 ], 0, Delayed_routine, NULL ); |
---|
117 | fatal_directive_status( |
---|
118 | status, |
---|
119 | RTEMS_INVALID_NUMBER, |
---|
120 | "rtems_timer_fire_after with 0 ticks" |
---|
121 | ); |
---|
122 | puts( "TA1 - rtems_timer_fire_after - RTEMS_INVALID_NUMBER" ); |
---|
123 | |
---|
124 | build_time( &time, 2, 5, 1987, 8, 30, 45, 0 ); |
---|
125 | status = rtems_timer_fire_when( Timer_id[ 1 ], &time, Delayed_routine, NULL ); |
---|
126 | fatal_directive_status( |
---|
127 | status, |
---|
128 | RTEMS_INVALID_CLOCK, |
---|
129 | "rtems_timer_fire_when with illegal time" |
---|
130 | ); |
---|
131 | print_time( |
---|
132 | "TA1 - rtems_timer_fire_when - ", |
---|
133 | &time, |
---|
134 | " - RTEMS_INVALID_CLOCK\n" |
---|
135 | ); |
---|
136 | |
---|
137 | status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); |
---|
138 | directive_failed( status, "rtems_clock_get" ); |
---|
139 | print_time( "TA1 - rtems_clock_get - ", &time, "\n" ); |
---|
140 | |
---|
141 | build_time( &time, 2, 5, 1990, 8, 30, 45, 0 ); |
---|
142 | status = rtems_timer_fire_when( Timer_id[ 1 ], &time, Delayed_routine, NULL ); |
---|
143 | fatal_directive_status( |
---|
144 | status, |
---|
145 | RTEMS_INVALID_CLOCK, |
---|
146 | "rtems_timer_fire_when before current time" |
---|
147 | ); |
---|
148 | print_time( |
---|
149 | "TA1 - rtems_timer_fire_when - ", |
---|
150 | &time, |
---|
151 | " - before RTEMS_INVALID_CLOCK\n" |
---|
152 | ); |
---|
153 | |
---|
154 | /* timer server interface routines */ |
---|
155 | |
---|
156 | status = rtems_timer_server_fire_after( 0, 5, NULL, NULL ); |
---|
157 | fatal_directive_status( |
---|
158 | status, |
---|
159 | RTEMS_INCORRECT_STATE, |
---|
160 | "rtems_timer_server_fire_after incorrect state" |
---|
161 | ); |
---|
162 | puts( "TA1 - rtems_timer_server_fire_after - RTEMS_INCORRECT_STATE" ); |
---|
163 | |
---|
164 | status = rtems_timer_server_fire_when( 0, &time, NULL, NULL ); |
---|
165 | fatal_directive_status( |
---|
166 | status, |
---|
167 | RTEMS_INCORRECT_STATE, |
---|
168 | "rtems_timer_server_fire_when incorrect state" |
---|
169 | ); |
---|
170 | puts( "TA1 - rtems_timer_server_fire_when - RTEMS_INCORRECT_STATE" ); |
---|
171 | |
---|
172 | status = |
---|
173 | rtems_timer_initiate_server( 0, 0, 0 ); |
---|
174 | fatal_directive_status( |
---|
175 | status, |
---|
176 | RTEMS_INVALID_PRIORITY, |
---|
177 | "rtems_timer_initiate_server invalid priority" |
---|
178 | ); |
---|
179 | puts( "TA1 - rtems_timer_initiate_server - RTEMS_INVALID_PRIORITY" ); |
---|
180 | |
---|
181 | status = |
---|
182 | rtems_timer_initiate_server( RTEMS_TIMER_SERVER_DEFAULT_PRIORITY, 0, 0 ); |
---|
183 | directive_failed( status, "rtems_timer_initiate_server" ); |
---|
184 | puts( "TA1 - rtems_timer_initiate_server" ); |
---|
185 | |
---|
186 | status = rtems_timer_server_fire_after( |
---|
187 | 0x010100, |
---|
188 | 5 * TICKS_PER_SECOND, |
---|
189 | Delayed_routine, |
---|
190 | NULL |
---|
191 | ); |
---|
192 | fatal_directive_status( |
---|
193 | status, |
---|
194 | RTEMS_INVALID_ID, |
---|
195 | "rtems_timer_server_fire_after illegal id" |
---|
196 | ); |
---|
197 | puts( "TA1 - rtems_timer_server_fire_after - RTEMS_INVALID_ID" ); |
---|
198 | |
---|
199 | build_time( &time, 12, 31, 1994, 9, 0, 0, 0 ); |
---|
200 | status = rtems_timer_server_fire_when( 0x010100, &time, Delayed_routine, NULL ); |
---|
201 | fatal_directive_status( |
---|
202 | status, |
---|
203 | RTEMS_INVALID_ID, |
---|
204 | "rtems_timer_server_fire_when with illegal id" |
---|
205 | ); |
---|
206 | puts( "TA1 - rtems_timer_server_fire_when - RTEMS_INVALID_ID" ); |
---|
207 | |
---|
208 | status = rtems_timer_server_fire_after( Timer_id[ 1 ], 0, Delayed_routine, NULL ); |
---|
209 | fatal_directive_status( |
---|
210 | status, |
---|
211 | RTEMS_INVALID_NUMBER, |
---|
212 | "rtems_timer_server_fire_after with 0 ticks" |
---|
213 | ); |
---|
214 | puts( "TA1 - rtems_timer_server_fire_after - RTEMS_INVALID_NUMBER" ); |
---|
215 | |
---|
216 | build_time( &time, 2, 5, 1987, 8, 30, 45, 0 ); |
---|
217 | status = rtems_timer_server_fire_when( Timer_id[ 1 ], &time, Delayed_routine, NULL ); |
---|
218 | fatal_directive_status( |
---|
219 | status, |
---|
220 | RTEMS_INVALID_CLOCK, |
---|
221 | "rtems_timer_server_fire_when with illegal time" |
---|
222 | ); |
---|
223 | print_time( |
---|
224 | "TA1 - rtems_timer_server_fire_when - ", |
---|
225 | &time, |
---|
226 | " - RTEMS_INVALID_CLOCK\n" |
---|
227 | ); |
---|
228 | |
---|
229 | status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); |
---|
230 | directive_failed( status, "rtems_clock_get" ); |
---|
231 | print_time( "TA1 - rtems_clock_get - ", &time, "\n" ); |
---|
232 | |
---|
233 | build_time( &time, 2, 5, 1990, 8, 30, 45, 0 ); |
---|
234 | status = rtems_timer_server_fire_when( Timer_id[ 1 ], &time, Delayed_routine, NULL ); |
---|
235 | fatal_directive_status( |
---|
236 | status, |
---|
237 | RTEMS_INVALID_CLOCK, |
---|
238 | "rtems_timer_server_fire_when before current time" |
---|
239 | ); |
---|
240 | print_time( |
---|
241 | "TA1 - rtems_timer_server_fire_when - ", |
---|
242 | &time, |
---|
243 | " - before RTEMS_INVALID_CLOCK\n" |
---|
244 | ); |
---|
245 | } |
---|