1 | /* Screen1 |
---|
2 | * |
---|
3 | * This routine generates error screen 1 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 Screen1() |
---|
22 | { |
---|
23 | uint32_t notepad_value; |
---|
24 | rtems_id self_id; |
---|
25 | rtems_task_priority previous_priority; |
---|
26 | rtems_status_code status; |
---|
27 | |
---|
28 | status = rtems_task_delete( 100 ); |
---|
29 | fatal_directive_status( |
---|
30 | status, |
---|
31 | RTEMS_INVALID_ID, |
---|
32 | "rtems_task_delete with illegal id" |
---|
33 | ); |
---|
34 | puts( "TA1 - rtems_task_delete - RTEMS_INVALID_ID" ); |
---|
35 | |
---|
36 | status = rtems_task_get_note( RTEMS_SELF, 100, ¬epad_value ); |
---|
37 | fatal_directive_status( |
---|
38 | status, |
---|
39 | RTEMS_INVALID_NUMBER, |
---|
40 | "rtems_task_get_note with illegal notepad" |
---|
41 | ); |
---|
42 | puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_NUMBER" ); |
---|
43 | |
---|
44 | status = rtems_task_get_note( 100, RTEMS_NOTEPAD_LAST, ¬epad_value ); |
---|
45 | fatal_directive_status( |
---|
46 | status, |
---|
47 | RTEMS_INVALID_ID, |
---|
48 | "rtems_task_get_note with illegal id" |
---|
49 | ); |
---|
50 | puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_ID" ); |
---|
51 | |
---|
52 | status = rtems_task_get_note( |
---|
53 | _RTEMS_tasks_Information.maximum_id, |
---|
54 | RTEMS_NOTEPAD_LAST, |
---|
55 | ¬epad_value |
---|
56 | ); |
---|
57 | fatal_directive_status( |
---|
58 | status, |
---|
59 | RTEMS_INVALID_ID, |
---|
60 | "rtems_task_get_note with illegal id" |
---|
61 | ); |
---|
62 | puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_ID" ); |
---|
63 | |
---|
64 | status = rtems_task_get_note( |
---|
65 | _RTEMS_tasks_Information.minimum_id + (3L<<OBJECTS_API_START_BIT), |
---|
66 | RTEMS_NOTEPAD_LAST, |
---|
67 | ¬epad_value |
---|
68 | ); |
---|
69 | fatal_directive_status( |
---|
70 | status, |
---|
71 | RTEMS_INVALID_ID, |
---|
72 | "rtems_task_get_note with illegal id" |
---|
73 | ); |
---|
74 | |
---|
75 | status = rtems_task_get_note( |
---|
76 | rtems_build_id( OBJECTS_CLASSIC_API, 2, 1, 1 ), |
---|
77 | RTEMS_NOTEPAD_LAST, |
---|
78 | ¬epad_value |
---|
79 | ); |
---|
80 | fatal_directive_status( |
---|
81 | status, |
---|
82 | RTEMS_INVALID_ID, |
---|
83 | "rtems_task_get_note with non-task ID" |
---|
84 | ); |
---|
85 | |
---|
86 | puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_ID (no tasks in API)" ); |
---|
87 | status = rtems_task_get_note( |
---|
88 | rtems_build_id( OBJECTS_ITRON_API, OBJECTS_ITRON_TASKS, 1, 1 ), |
---|
89 | RTEMS_NOTEPAD_LAST, |
---|
90 | ¬epad_value |
---|
91 | ); |
---|
92 | fatal_directive_status( status, RTEMS_INVALID_ID, |
---|
93 | "rtems_task_get_note with no tasks in API" |
---|
94 | ); |
---|
95 | |
---|
96 | status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &self_id ); |
---|
97 | directive_failed( status, "rtems_task_ident of self" ); |
---|
98 | |
---|
99 | if ( self_id != Task_id[ 1 ] ) { |
---|
100 | puts( "ERROR - rtems_task_ident - incorrect ID returned!" ); |
---|
101 | } |
---|
102 | puts( "TA1 - rtems_task_ident - current task RTEMS_SUCCESSFUL" ); |
---|
103 | |
---|
104 | status = rtems_task_ident( 100, RTEMS_SEARCH_ALL_NODES, &Junk_id ); |
---|
105 | fatal_directive_status( |
---|
106 | status, |
---|
107 | RTEMS_INVALID_NAME, |
---|
108 | "rtems_task_ident with illegal name (local)" |
---|
109 | ); |
---|
110 | puts( "TA1 - rtems_task_ident - global RTEMS_INVALID_NAME" ); |
---|
111 | |
---|
112 | status = rtems_task_ident( 100, 1, &Junk_id ); |
---|
113 | fatal_directive_status( |
---|
114 | status, |
---|
115 | RTEMS_INVALID_NAME, |
---|
116 | "rtems_task_ident with illegal name (global)" |
---|
117 | ); |
---|
118 | puts( "TA1 - rtems_task_ident - local RTEMS_INVALID_NAME" ); |
---|
119 | |
---|
120 | /* |
---|
121 | * This one case is different if MP is enabled/disabled. |
---|
122 | */ |
---|
123 | |
---|
124 | status = rtems_task_ident( 100, 2, &Junk_id ); |
---|
125 | #if defined(RTEMS_MULTIPROCESSING) |
---|
126 | fatal_directive_status( |
---|
127 | status, |
---|
128 | RTEMS_INVALID_NODE, |
---|
129 | "rtems_task_ident with illegal node" |
---|
130 | ); |
---|
131 | #else |
---|
132 | fatal_directive_status( |
---|
133 | status, |
---|
134 | RTEMS_INVALID_NAME, |
---|
135 | "rtems_task_ident with illegal node" |
---|
136 | ); |
---|
137 | #endif |
---|
138 | puts( "TA1 - rtems_task_ident - RTEMS_INVALID_NODE" ); |
---|
139 | |
---|
140 | status = rtems_task_restart( 100, 0 ); |
---|
141 | fatal_directive_status( |
---|
142 | status, |
---|
143 | RTEMS_INVALID_ID, |
---|
144 | "rtems_task_restart with illegal id" |
---|
145 | ); |
---|
146 | puts( "TA1 - rtems_task_restart - RTEMS_INVALID_ID" ); |
---|
147 | |
---|
148 | status = rtems_task_resume( 100 ); |
---|
149 | fatal_directive_status( |
---|
150 | status, |
---|
151 | RTEMS_INVALID_ID, |
---|
152 | "rtems_task_resume with illegal id" |
---|
153 | ); |
---|
154 | puts( "TA1 - rtems_task_resume - RTEMS_INVALID_ID" ); |
---|
155 | |
---|
156 | status = rtems_task_resume( RTEMS_SELF ); |
---|
157 | fatal_directive_status( |
---|
158 | status, |
---|
159 | RTEMS_INCORRECT_STATE, |
---|
160 | "rtems_task_resume of ready task" |
---|
161 | ); |
---|
162 | puts( "TA1 - rtems_task_resume - RTEMS_INCORRECT_STATE" ); |
---|
163 | |
---|
164 | status = rtems_task_set_priority( RTEMS_SELF, 512, &previous_priority ); |
---|
165 | fatal_directive_status( |
---|
166 | status, |
---|
167 | RTEMS_INVALID_PRIORITY, |
---|
168 | "rtems_task_set_priority with illegal priority" |
---|
169 | ); |
---|
170 | puts( "TA1 - rtems_task_set_priority - RTEMS_INVALID_PRIORITY" ); |
---|
171 | |
---|
172 | status = rtems_task_set_priority( 100, 8, &previous_priority ); |
---|
173 | fatal_directive_status( |
---|
174 | status, |
---|
175 | RTEMS_INVALID_ID, |
---|
176 | "rtems_task_set_priority with illegal id" |
---|
177 | ); |
---|
178 | puts( "TA1 - rtems_task_set_priority - RTEMS_INVALID_ID" ); |
---|
179 | |
---|
180 | status = rtems_task_set_note( |
---|
181 | RTEMS_SELF, |
---|
182 | RTEMS_NOTEPAD_LAST+10, |
---|
183 | notepad_value |
---|
184 | ); |
---|
185 | fatal_directive_status( |
---|
186 | status, |
---|
187 | RTEMS_INVALID_NUMBER, |
---|
188 | "rtems_task_set_note with illegal notepad" |
---|
189 | ); |
---|
190 | puts( "TA1 - rtems_task_set_note - RTEMS_INVALID_NUMBER" ); |
---|
191 | |
---|
192 | status = rtems_task_set_note( 100, RTEMS_NOTEPAD_LAST, notepad_value ); |
---|
193 | fatal_directive_status( |
---|
194 | status, |
---|
195 | RTEMS_INVALID_ID, |
---|
196 | "rtems_task_set_note with illegal id" |
---|
197 | ); |
---|
198 | puts( "TA1 - rtems_task_set_note - RTEMS_INVALID_ID" ); |
---|
199 | |
---|
200 | status = rtems_task_start( 100, Task_1, 0 ); |
---|
201 | fatal_directive_status( |
---|
202 | status, |
---|
203 | RTEMS_INVALID_ID, |
---|
204 | "rtems_task_start with illegal id" |
---|
205 | ); |
---|
206 | puts( "TA1 - rtems_task_start - RTEMS_INVALID_ID" ); |
---|
207 | |
---|
208 | status = rtems_task_start( 0, Task_1, 0 ); |
---|
209 | fatal_directive_status( |
---|
210 | status, |
---|
211 | RTEMS_INCORRECT_STATE, |
---|
212 | "rtems_task_start of ready task" |
---|
213 | ); |
---|
214 | puts( "TA1 - rtems_task_start - RTEMS_INCORRECT_STATE" ); |
---|
215 | |
---|
216 | status = rtems_task_suspend( 100 ); |
---|
217 | fatal_directive_status( |
---|
218 | status, |
---|
219 | RTEMS_INVALID_ID, |
---|
220 | "rtems_task_suspend with illegal id" |
---|
221 | ); |
---|
222 | puts( "TA1 - rtems_task_suspend - RTEMS_INVALID_ID" ); |
---|
223 | } |
---|