1 | /* Screen10 |
---|
2 | * |
---|
3 | * This routine generates error screen 10 for test 9. |
---|
4 | * |
---|
5 | * Input parameters: NONE |
---|
6 | * |
---|
7 | * Output parameters: NONE |
---|
8 | * |
---|
9 | * COPYRIGHT (c) 1989-2009. |
---|
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 Screen10() |
---|
22 | { |
---|
23 | rtems_rate_monotonic_period_status period_status; |
---|
24 | rtems_status_code status; |
---|
25 | |
---|
26 | /* |
---|
27 | * Check create error cases. |
---|
28 | */ |
---|
29 | status = rtems_rate_monotonic_create( 0, &Junk_id ); |
---|
30 | fatal_directive_status( |
---|
31 | status, |
---|
32 | RTEMS_INVALID_NAME, |
---|
33 | "rtems_rate_monotonic_create with illegal name" |
---|
34 | ); |
---|
35 | puts( "TA1 - rtems_rate_monotonic_create - RTEMS_INVALID_NAME" ); |
---|
36 | |
---|
37 | status = rtems_rate_monotonic_create( Period_name[ 1 ], &Period_id[ 1 ] ); |
---|
38 | directive_failed( status, "rtems_rate_monotonic_create successful" ); |
---|
39 | puts( "TA1 - rtems_rate_monotonic_create - RTEMS_SUCCESSFUL" ); |
---|
40 | |
---|
41 | status = rtems_rate_monotonic_create( Period_name[ 1 ], &Junk_id ); |
---|
42 | fatal_directive_status( |
---|
43 | status, |
---|
44 | RTEMS_TOO_MANY, |
---|
45 | "rtems_rate_monotonic_create of too many" |
---|
46 | ); |
---|
47 | puts( "TA1 - rtems_rate_monotonic_create - RTEMS_TOO_MANY" ); |
---|
48 | |
---|
49 | /* |
---|
50 | * Check ident error cases. |
---|
51 | */ |
---|
52 | status = rtems_rate_monotonic_ident( 0, &Junk_id ); |
---|
53 | fatal_directive_status( |
---|
54 | status, |
---|
55 | RTEMS_INVALID_NAME, |
---|
56 | "rtems_rate_monotonic_ident with illegal name" |
---|
57 | ); |
---|
58 | puts( "TA1 - rtems_rate_monotonic_ident - RTEMS_INVALID_NAME" ); |
---|
59 | |
---|
60 | /* |
---|
61 | * Check period error cases. |
---|
62 | */ |
---|
63 | status = rtems_rate_monotonic_period( 100, 5 ); |
---|
64 | fatal_directive_status( |
---|
65 | status, |
---|
66 | RTEMS_INVALID_ID, |
---|
67 | "rtems_rate_monotonic_period with illegal id" |
---|
68 | ); |
---|
69 | puts( "TA1 - rtems_rate_monotonic_period - RTEMS_INVALID_ID" ); |
---|
70 | |
---|
71 | status = rtems_rate_monotonic_period( rtems_build_id( 1, 1, 1, 256 ), 5 ); |
---|
72 | fatal_directive_status( |
---|
73 | status, |
---|
74 | RTEMS_INVALID_ID, |
---|
75 | "rtems_rate_monotonic_period with illegal id" |
---|
76 | ); |
---|
77 | puts( "TA1 - rtems_rate_monotonic_period - local RTEMS_INVALID_ID" ); |
---|
78 | |
---|
79 | status = rtems_rate_monotonic_period( Period_id[ 1 ], RTEMS_PERIOD_STATUS ); |
---|
80 | fatal_directive_status( |
---|
81 | status, |
---|
82 | RTEMS_NOT_DEFINED, |
---|
83 | "rtems_rate_monotonic_period status not defined" |
---|
84 | ); |
---|
85 | puts( |
---|
86 | "TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_NOT_DEFINED" |
---|
87 | ); |
---|
88 | |
---|
89 | status = rtems_rate_monotonic_period( Period_id[ 1 ], 100 ); |
---|
90 | directive_failed( status, "rtems_rate_monotonic_period successful" ); |
---|
91 | puts( "TA1 - rtems_rate_monotonic_period - 100 ticks - RTEMS_SUCCESSFUL" ); |
---|
92 | |
---|
93 | status = rtems_rate_monotonic_period( Period_id[ 1 ], RTEMS_PERIOD_STATUS ); |
---|
94 | directive_failed( status, "rtems_rate_monotonic_period status" ); |
---|
95 | puts( |
---|
96 | "TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_SUCCESSFUL" |
---|
97 | ); |
---|
98 | |
---|
99 | while ( FOREVER ) { |
---|
100 | |
---|
101 | status = rtems_rate_monotonic_period(Period_id[ 1 ], RTEMS_PERIOD_STATUS); |
---|
102 | |
---|
103 | if ( status == RTEMS_TIMEOUT ) break; |
---|
104 | |
---|
105 | directive_failed( |
---|
106 | status, |
---|
107 | "rtems_rate_monotonic_period waiting for timeout" |
---|
108 | ); |
---|
109 | |
---|
110 | rtems_task_wake_after( 1 ); |
---|
111 | } |
---|
112 | puts( |
---|
113 | "TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_TIMEOUT" |
---|
114 | ); |
---|
115 | |
---|
116 | /* |
---|
117 | * Check get_status error cases. |
---|
118 | */ |
---|
119 | status = rtems_rate_monotonic_get_status( 100, &period_status ); |
---|
120 | fatal_directive_status( |
---|
121 | status, |
---|
122 | RTEMS_INVALID_ID, |
---|
123 | "rtems_rate_monotonic_get_status with illegal id" |
---|
124 | ); |
---|
125 | puts( "TA1 - rtems_rate_monotonic_get_status - RTEMS_INVALID_ID" ); |
---|
126 | |
---|
127 | /* |
---|
128 | * Check cancel error cases. |
---|
129 | */ |
---|
130 | status = rtems_rate_monotonic_cancel( 100 ); |
---|
131 | fatal_directive_status( |
---|
132 | status, |
---|
133 | RTEMS_INVALID_ID, |
---|
134 | "rtems_rate_monotonic_cancel with illegal id" |
---|
135 | ); |
---|
136 | puts( "TA1 - rtems_rate_monotonic_cancel - RTEMS_INVALID_ID" ); |
---|
137 | |
---|
138 | status = rtems_rate_monotonic_cancel( rtems_build_id( 1, 1, 1, 256 ) ); |
---|
139 | fatal_directive_status( |
---|
140 | status, |
---|
141 | RTEMS_INVALID_ID, |
---|
142 | "rtems_rate_monotonic_cancel will illegal id" |
---|
143 | ); |
---|
144 | puts( "TA1 - rtems_rate_monotonic_cancel - local RTEMS_INVALID_ID" ); |
---|
145 | |
---|
146 | status = rtems_rate_monotonic_cancel( Period_id[ 1 ] ); |
---|
147 | directive_failed( status, "rtems_rate_monotonic_cancel" ); |
---|
148 | puts( "TA1 - rtems_rate_monotonic_cancel - RTEMS_SUCCESSFUL" ); |
---|
149 | |
---|
150 | status = rtems_rate_monotonic_period( Period_id[ 1 ], 5 ); |
---|
151 | directive_failed( status, "rtems_rate_monotonic_period restart" ); |
---|
152 | |
---|
153 | status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() ); |
---|
154 | directive_failed( status, "rtems_task_wake_after" ); |
---|
155 | |
---|
156 | status = rtems_rate_monotonic_period( Period_id[ 1 ], 5 ); |
---|
157 | fatal_directive_status( |
---|
158 | status, |
---|
159 | RTEMS_TIMEOUT, |
---|
160 | "rtems_rate_monotonic_period" |
---|
161 | ); |
---|
162 | puts( "TA1 - rtems_rate_monotonic_period - 5 ticks - RTEMS_TIMEOUT" ); |
---|
163 | |
---|
164 | status = rtems_task_start( Task_id[ 4 ], Task_4, 0 ); |
---|
165 | directive_failed( status, "rtems_task_start of TA4" ); |
---|
166 | |
---|
167 | puts( "TA1 - yielding to TA4" ); |
---|
168 | status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); |
---|
169 | |
---|
170 | /* |
---|
171 | * Check delete error cases. |
---|
172 | */ |
---|
173 | status = rtems_rate_monotonic_delete( 100 ); |
---|
174 | fatal_directive_status( |
---|
175 | status, |
---|
176 | RTEMS_INVALID_ID, |
---|
177 | "rtems_rate_monotonic_delete with illegal id" |
---|
178 | ); |
---|
179 | puts( "TA1 - rtems_rate_monotonic_delete - RTEMS_INVALID_ID" ); |
---|
180 | |
---|
181 | status = rtems_rate_monotonic_delete( rtems_build_id( 1, 1, 1, 256 ) ); |
---|
182 | fatal_directive_status( |
---|
183 | status, |
---|
184 | RTEMS_INVALID_ID, |
---|
185 | "rtems_rate_monotonic_delete with illegal id" |
---|
186 | ); |
---|
187 | puts( "TA1 - rtems_rate_monotonic_delete - local RTEMS_INVALID_ID" ); |
---|
188 | |
---|
189 | status = rtems_rate_monotonic_delete( Period_id[ 1 ] ); |
---|
190 | directive_failed( status, "rtems_rate_monotonic_delete" ); |
---|
191 | puts( "TA1 - rtems_rate_monotonic_delete - RTEMS_SUCCESSFUL" ); |
---|
192 | } |
---|