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-2008. |
---|
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 | rtems_timer_information timer_info; |
---|
26 | bool skipUnsatisfied; |
---|
27 | |
---|
28 | status = rtems_timer_create( 0, &Junk_id ); |
---|
29 | fatal_directive_status( |
---|
30 | status, |
---|
31 | RTEMS_INVALID_NAME, |
---|
32 | "rtems_timer_create with illegal name" |
---|
33 | ); |
---|
34 | puts( "TA1 - rtems_timer_create - RTEMS_INVALID_NAME" ); |
---|
35 | |
---|
36 | status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] ); |
---|
37 | directive_failed( status, "rtems_timer_create" ); |
---|
38 | puts( "TA1 - rtems_timer_create - 1 - RTEMS_SUCCESSFUL" ); |
---|
39 | |
---|
40 | status = rtems_timer_create( 2, &Junk_id ); |
---|
41 | fatal_directive_status( |
---|
42 | status, |
---|
43 | RTEMS_TOO_MANY, |
---|
44 | "rtems_timer_create for too many" |
---|
45 | ); |
---|
46 | puts( "TA1 - rtems_timer_create - 2 - RTEMS_TOO_MANY" ); |
---|
47 | |
---|
48 | status = rtems_timer_delete( 100 ); |
---|
49 | fatal_directive_status( |
---|
50 | status, |
---|
51 | RTEMS_INVALID_ID, |
---|
52 | "rtems_timer_delete with illegal id" |
---|
53 | ); |
---|
54 | puts( "TA1 - rtems_timer_delete - local RTEMS_INVALID_ID" ); |
---|
55 | |
---|
56 | status = rtems_timer_delete( rtems_build_id( 1, 1, 1, 256 ) ); |
---|
57 | fatal_directive_status( |
---|
58 | status, |
---|
59 | RTEMS_INVALID_ID, |
---|
60 | "rtems_timer_delete with illegal id" |
---|
61 | ); |
---|
62 | puts( "TA1 - rtems_timer_delete - global RTEMS_INVALID_ID" ); |
---|
63 | |
---|
64 | status = rtems_timer_ident( 0, &Junk_id ); |
---|
65 | fatal_directive_status( |
---|
66 | status, |
---|
67 | RTEMS_INVALID_NAME, |
---|
68 | "rtems_timer_ident with illegal name" |
---|
69 | ); |
---|
70 | puts( "TA1 - rtems_timer_ident - RTEMS_INVALID_NAME" ); |
---|
71 | |
---|
72 | status = rtems_timer_cancel( rtems_build_id( 1, 1, 1, 256 ) ); |
---|
73 | fatal_directive_status( |
---|
74 | status, |
---|
75 | RTEMS_INVALID_ID, |
---|
76 | "rtems_timer_cancel with illegal id" |
---|
77 | ); |
---|
78 | puts( "TA1 - rtems_timer_cancel - RTEMS_INVALID_ID" ); |
---|
79 | |
---|
80 | status = rtems_timer_reset( rtems_build_id( 1, 1, 1, 256 ) ); |
---|
81 | fatal_directive_status( |
---|
82 | status, |
---|
83 | RTEMS_INVALID_ID, |
---|
84 | "rtems_timer_reset with illegal id" |
---|
85 | ); |
---|
86 | puts( "TA1 - rtems_timer_reset - RTEMS_INVALID_ID" ); |
---|
87 | |
---|
88 | status = rtems_timer_reset( Timer_id[ 1 ] ); |
---|
89 | fatal_directive_status( |
---|
90 | status, |
---|
91 | RTEMS_NOT_DEFINED, |
---|
92 | "rtems_timer_reset before initiated" |
---|
93 | ); |
---|
94 | puts( "TA1 - rtems_timer_reset - RTEMS_NOT_DEFINED" ); |
---|
95 | |
---|
96 | status = rtems_timer_fire_after( |
---|
97 | rtems_build_id( 1, 1, 1, 256 ), |
---|
98 | 5 * TICKS_PER_SECOND, |
---|
99 | Delayed_routine, |
---|
100 | NULL |
---|
101 | ); |
---|
102 | fatal_directive_status( |
---|
103 | status, |
---|
104 | RTEMS_INVALID_ID, |
---|
105 | "rtems_timer_fire_after illegal id" |
---|
106 | ); |
---|
107 | puts( "TA1 - rtems_timer_fire_after - RTEMS_INVALID_ID" ); |
---|
108 | |
---|
109 | build_time( &time, 12, 31, 1994, 9, 0, 0, 0 ); |
---|
110 | status = rtems_timer_fire_when( |
---|
111 | rtems_build_id( 1, 1, 1, 256 ), |
---|
112 | &time, |
---|
113 | Delayed_routine, |
---|
114 | NULL |
---|
115 | ); |
---|
116 | fatal_directive_status( |
---|
117 | status, |
---|
118 | RTEMS_INVALID_ID, |
---|
119 | "rtems_timer_fire_when with illegal id" |
---|
120 | ); |
---|
121 | puts( "TA1 - rtems_timer_fire_when - RTEMS_INVALID_ID" ); |
---|
122 | |
---|
123 | status = rtems_timer_fire_after( Timer_id[ 1 ], 0, Delayed_routine, NULL ); |
---|
124 | fatal_directive_status( |
---|
125 | status, |
---|
126 | RTEMS_INVALID_NUMBER, |
---|
127 | "rtems_timer_fire_after with 0 ticks" |
---|
128 | ); |
---|
129 | puts( "TA1 - rtems_timer_fire_after - RTEMS_INVALID_NUMBER" ); |
---|
130 | |
---|
131 | build_time( &time, 2, 5, 1987, 8, 30, 45, 0 ); |
---|
132 | status = rtems_timer_fire_when( Timer_id[ 1 ], &time, Delayed_routine, NULL ); |
---|
133 | fatal_directive_status( |
---|
134 | status, |
---|
135 | RTEMS_INVALID_CLOCK, |
---|
136 | "rtems_timer_fire_when with illegal time" |
---|
137 | ); |
---|
138 | print_time( |
---|
139 | "TA1 - rtems_timer_fire_when - ", |
---|
140 | &time, |
---|
141 | " - RTEMS_INVALID_CLOCK\n" |
---|
142 | ); |
---|
143 | |
---|
144 | status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); |
---|
145 | directive_failed( status, "rtems_clock_get" ); |
---|
146 | print_time( "TA1 - rtems_clock_get - ", &time, "\n" ); |
---|
147 | |
---|
148 | build_time( &time, 2, 5, 1990, 8, 30, 45, 0 ); |
---|
149 | status = rtems_timer_fire_when( Timer_id[ 1 ], &time, Delayed_routine, NULL ); |
---|
150 | fatal_directive_status( |
---|
151 | status, |
---|
152 | RTEMS_INVALID_CLOCK, |
---|
153 | "rtems_timer_fire_when before current time" |
---|
154 | ); |
---|
155 | print_time( |
---|
156 | "TA1 - rtems_timer_fire_when - ", |
---|
157 | &time, |
---|
158 | " - before RTEMS_INVALID_CLOCK\n" |
---|
159 | ); |
---|
160 | |
---|
161 | status = rtems_timer_get_information( 100, &timer_info ); |
---|
162 | fatal_directive_status( |
---|
163 | status, |
---|
164 | RTEMS_INVALID_ID, |
---|
165 | "rtems_timer_get_information with illegal id" |
---|
166 | ); |
---|
167 | puts( "TA1 - rtems_timer_get_information - RTEMS_INVALID_ID" ); |
---|
168 | |
---|
169 | /* timer server interface routines */ |
---|
170 | |
---|
171 | status = rtems_timer_server_fire_after( 0, 5, NULL, NULL ); |
---|
172 | fatal_directive_status( |
---|
173 | status, |
---|
174 | RTEMS_INCORRECT_STATE, |
---|
175 | "rtems_timer_server_fire_after incorrect state" |
---|
176 | ); |
---|
177 | puts( "TA1 - rtems_timer_server_fire_after - RTEMS_INCORRECT_STATE" ); |
---|
178 | |
---|
179 | status = rtems_timer_server_fire_when( 0, &time, NULL, NULL ); |
---|
180 | fatal_directive_status( |
---|
181 | status, |
---|
182 | RTEMS_INCORRECT_STATE, |
---|
183 | "rtems_timer_server_fire_when incorrect state" |
---|
184 | ); |
---|
185 | puts( "TA1 - rtems_timer_server_fire_when - RTEMS_INCORRECT_STATE" ); |
---|
186 | |
---|
187 | status = |
---|
188 | rtems_timer_initiate_server( 0, 0, 0 ); |
---|
189 | fatal_directive_status( |
---|
190 | status, |
---|
191 | RTEMS_INVALID_PRIORITY, |
---|
192 | "rtems_timer_initiate_server invalid priority" |
---|
193 | ); |
---|
194 | puts( "TA1 - rtems_timer_initiate_server - RTEMS_INVALID_PRIORITY" ); |
---|
195 | |
---|
196 | skipUnsatisfied = false; |
---|
197 | #if defined(__m32c__) |
---|
198 | skipUnsatisfied = true; |
---|
199 | #endif |
---|
200 | if (skipUnsatisfied) { |
---|
201 | puts( "TA1 - rtems_timer_initiate_server - RTEMS_UNSATISFIED -- SKIPPED" ); |
---|
202 | } else { |
---|
203 | status = rtems_timer_initiate_server( |
---|
204 | RTEMS_TIMER_SERVER_DEFAULT_PRIORITY, |
---|
205 | 0x10000000, |
---|
206 | 0 |
---|
207 | ); |
---|
208 | fatal_directive_status( |
---|
209 | status, |
---|
210 | RTEMS_UNSATISFIED, |
---|
211 | "rtems_timer_initiate_server too much stack " |
---|
212 | ); |
---|
213 | puts( "TA1 - rtems_timer_initiate_server - RTEMS_UNSATISFIED" ); |
---|
214 | } |
---|
215 | |
---|
216 | status = |
---|
217 | rtems_timer_initiate_server( RTEMS_TIMER_SERVER_DEFAULT_PRIORITY, 0, 0 ); |
---|
218 | directive_failed( status, "rtems_timer_initiate_server" ); |
---|
219 | puts( "TA1 - rtems_timer_initiate_server - SUCCESSFUL" ); |
---|
220 | |
---|
221 | status = rtems_timer_server_fire_after( |
---|
222 | rtems_build_id( 1, 1, 1, 256 ), |
---|
223 | 5 * TICKS_PER_SECOND, |
---|
224 | Delayed_routine, |
---|
225 | NULL |
---|
226 | ); |
---|
227 | fatal_directive_status( |
---|
228 | status, |
---|
229 | RTEMS_INVALID_ID, |
---|
230 | "rtems_timer_server_fire_after illegal id" |
---|
231 | ); |
---|
232 | puts( "TA1 - rtems_timer_server_fire_after - RTEMS_INVALID_ID" ); |
---|
233 | |
---|
234 | build_time( &time, 12, 31, 1994, 9, 0, 0, 0 ); |
---|
235 | status = rtems_timer_server_fire_when( |
---|
236 | rtems_build_id( 1, 1, 1, 256 ), |
---|
237 | &time, |
---|
238 | Delayed_routine, |
---|
239 | NULL |
---|
240 | ); |
---|
241 | fatal_directive_status( |
---|
242 | status, |
---|
243 | RTEMS_INVALID_ID, |
---|
244 | "rtems_timer_server_fire_when with illegal id" |
---|
245 | ); |
---|
246 | puts( "TA1 - rtems_timer_server_fire_when - RTEMS_INVALID_ID" ); |
---|
247 | |
---|
248 | status = rtems_timer_server_fire_after( Timer_id[ 1 ], 0, Delayed_routine, NULL ); |
---|
249 | fatal_directive_status( |
---|
250 | status, |
---|
251 | RTEMS_INVALID_NUMBER, |
---|
252 | "rtems_timer_server_fire_after with 0 ticks" |
---|
253 | ); |
---|
254 | puts( "TA1 - rtems_timer_server_fire_after - RTEMS_INVALID_NUMBER" ); |
---|
255 | |
---|
256 | build_time( &time, 2, 5, 1987, 8, 30, 45, 0 ); |
---|
257 | status = rtems_timer_server_fire_when( Timer_id[ 1 ], &time, Delayed_routine, NULL ); |
---|
258 | fatal_directive_status( |
---|
259 | status, |
---|
260 | RTEMS_INVALID_CLOCK, |
---|
261 | "rtems_timer_server_fire_when with illegal time" |
---|
262 | ); |
---|
263 | print_time( |
---|
264 | "TA1 - rtems_timer_server_fire_when - ", |
---|
265 | &time, |
---|
266 | " - RTEMS_INVALID_CLOCK\n" |
---|
267 | ); |
---|
268 | |
---|
269 | status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); |
---|
270 | directive_failed( status, "rtems_clock_get" ); |
---|
271 | print_time( "TA1 - rtems_clock_get - ", &time, "\n" ); |
---|
272 | |
---|
273 | build_time( &time, 2, 5, 1990, 8, 30, 45, 0 ); |
---|
274 | status = rtems_timer_server_fire_when( Timer_id[ 1 ], &time, Delayed_routine, NULL ); |
---|
275 | fatal_directive_status( |
---|
276 | status, |
---|
277 | RTEMS_INVALID_CLOCK, |
---|
278 | "rtems_timer_server_fire_when before current time" |
---|
279 | ); |
---|
280 | print_time( |
---|
281 | "TA1 - rtems_timer_server_fire_when - ", |
---|
282 | &time, |
---|
283 | " - before RTEMS_INVALID_CLOCK\n" |
---|
284 | ); |
---|
285 | } |
---|