source: rtems/testsuites/sptests/sp09/screen03.c @ 1b4f2b30

4.104.114.84.95
Last change on this file since 1b4f2b30 was 1b4f2b30, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/16/04 at 09:24:30

Remove stray white spaces.

  • Property mode set to 100644
File size: 5.5 KB
Line 
1/*  Screen3
2 *
3 *  This routine generates error screen 3 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
21void Screen3()
22{
23  rtems_name        task_name;
24  rtems_status_code status;
25
26  task_name = 1;
27  status = rtems_task_create(
28    0,
29    1,
30    RTEMS_MINIMUM_STACK_SIZE,
31    RTEMS_DEFAULT_MODES,
32    RTEMS_DEFAULT_ATTRIBUTES,
33    &Junk_id
34  );
35  fatal_directive_status(
36    status,
37    RTEMS_INVALID_NAME,
38    "rtems_task_create with illegal name"
39  );
40  puts( "TA1 - rtems_task_create - RTEMS_INVALID_NAME" );
41
42  /*
43   * If the bsp provides its own stack allocator, then
44   * skip the test that tries to allocate a stack that is too big.
45   */
46
47  if (rtems_cpu_configuration_get_stack_allocate_hook()) {
48      puts( "TA1 - rtems_task_create - stack size - RTEMS_UNSATISFIED  -- SKIPPED" );
49  } else {
50      status = rtems_task_create(
51        task_name,
52        1,
53        rtems_configuration_get_work_space_size(),
54        RTEMS_DEFAULT_MODES,
55        RTEMS_DEFAULT_ATTRIBUTES,
56        &Junk_id
57      );
58      fatal_directive_status(
59        status,
60        RTEMS_UNSATISFIED,
61        "rtems_task_create with a stack size larger than the workspace"
62      );
63      puts( "TA1 - rtems_task_create - stack size - RTEMS_UNSATISFIED" );
64  }
65
66  status = rtems_task_create(
67    Task_name[ 2 ],
68    4,
69    RTEMS_MINIMUM_STACK_SIZE,
70    RTEMS_DEFAULT_MODES,
71    RTEMS_DEFAULT_ATTRIBUTES,
72    &Task_id[ 2 ]
73  );
74  directive_failed( status, "rtems_task_create of TA2" );
75  puts( "TA1 - rtems_task_create - TA2 created - RTEMS_SUCCESSFUL" );
76
77  status = rtems_task_suspend( Task_id[ 2 ] );
78  directive_failed( status, "rtems_task_suspend of TA2" );
79  puts( "TA1 - rtems_task_suspend - suspend TA2 - RTEMS_SUCCESSFUL" );
80
81  status = rtems_task_suspend( Task_id[ 2 ] );
82  fatal_directive_status(
83    status,
84    RTEMS_ALREADY_SUSPENDED,
85    "rtems_task_suspend of suspended TA2"
86  );
87  puts( "TA1 - rtems_task_suspend - suspend TA2 - RTEMS_ALREADY_SUSPENDED" );
88
89  status = rtems_task_resume( Task_id[ 2 ] );
90  directive_failed( status, "rtems_task_resume of TA2" );
91  puts( "TA1 - rtems_task_resume - TA2 resumed - RTEMS_SUCCESSFUL" );
92
93  status = rtems_task_create(
94    Task_name[ 3 ],
95    4,
96    RTEMS_MINIMUM_STACK_SIZE,
97    RTEMS_DEFAULT_MODES,
98    RTEMS_DEFAULT_ATTRIBUTES,
99    &Task_id[ 3 ]
100  );
101  directive_failed( status, "rtems_task_create of TA3" );
102  puts( "TA1 - rtems_task_create - TA3 created - RTEMS_SUCCESSFUL" );
103
104  status = rtems_task_create(
105    Task_name[ 4 ],
106    4,
107    RTEMS_MINIMUM_STACK_SIZE,
108    RTEMS_DEFAULT_MODES,
109    RTEMS_DEFAULT_ATTRIBUTES,
110    &Task_id[ 4 ]
111  );
112  directive_failed( status, "rtems_task_create of TA4" );
113  puts( "TA1 - rtems_task_create - 4 created - RTEMS_SUCCESSFUL" );
114
115  status = rtems_task_create(
116    Task_name[ 5 ],
117    4,
118    RTEMS_MINIMUM_STACK_SIZE,
119    RTEMS_DEFAULT_MODES,
120    RTEMS_DEFAULT_ATTRIBUTES,
121    &Task_id[ 5 ]
122  );
123  directive_failed( status, "rtems_task_create of TA5" );
124  puts( "TA1 - rtems_task_create - 5 created - RTEMS_SUCCESSFUL" );
125
126  status = rtems_task_create(
127    Task_name[ 6 ],
128    4,
129    RTEMS_MINIMUM_STACK_SIZE,
130    RTEMS_DEFAULT_MODES,
131    RTEMS_DEFAULT_ATTRIBUTES,
132    &Task_id[ 6 ]
133  );
134  directive_failed( status, "rtems_task_create of TA6" );
135  puts( "TA1 - rtems_task_create - 6 created - RTEMS_SUCCESSFUL" );
136
137  status = rtems_task_create(
138    Task_name[ 7 ],
139    4,
140    RTEMS_MINIMUM_STACK_SIZE,
141    RTEMS_DEFAULT_MODES,
142    RTEMS_DEFAULT_ATTRIBUTES,
143    &Task_id[ 7 ]
144  );
145  directive_failed( status, "rtems_task_create of TA7" );
146  puts( "TA1 - rtems_task_create - 7 created - RTEMS_SUCCESSFUL" );
147
148  status = rtems_task_create(
149    Task_name[ 8 ],
150    4,
151    RTEMS_MINIMUM_STACK_SIZE,
152    RTEMS_DEFAULT_MODES,
153    RTEMS_DEFAULT_ATTRIBUTES,
154    &Task_id[ 8 ]
155  );
156  directive_failed( status, "rtems_task_create of TA8" );
157  puts( "TA1 - rtems_task_create - 8 created - RTEMS_SUCCESSFUL" );
158
159  status = rtems_task_create(
160    Task_name[ 9 ],
161    4,
162    RTEMS_MINIMUM_STACK_SIZE,
163    RTEMS_DEFAULT_MODES,
164    RTEMS_DEFAULT_ATTRIBUTES,
165    &Task_id[ 9 ]
166  );
167  directive_failed( status, "rtems_task_create of TA9" );
168  puts( "TA1 - rtems_task_create - 9 created - RTEMS_SUCCESSFUL" );
169
170  status = rtems_task_create(
171    Task_name[ 10 ],
172    4,
173    RTEMS_MINIMUM_STACK_SIZE,
174    RTEMS_DEFAULT_MODES,
175    RTEMS_DEFAULT_ATTRIBUTES,
176    &Task_id[ 10 ]
177  );
178  directive_failed( status, "rtems_task_create of TA10" );
179  puts( "TA1 - rtems_task_create - 10 created - RTEMS_SUCCESSFUL" );
180
181  status = rtems_task_create(
182    task_name,
183    4,
184    RTEMS_MINIMUM_STACK_SIZE,
185    RTEMS_DEFAULT_MODES,
186    RTEMS_DEFAULT_ATTRIBUTES,
187    &Junk_id
188  );
189  fatal_directive_status(
190    status,
191    RTEMS_TOO_MANY,
192    "rtems_task_create for too many tasks"
193  );
194  puts( "TA1 - rtems_task_create - 11 - RTEMS_TOO_MANY" );
195
196  /*
197   *  The check for an object being global is only made if
198   *  multiprocessing is enabled.
199   */
200
201#if defined(RTEMS_MULTIPROCESSING)
202  status = rtems_task_create(
203    task_name,
204    4,
205    RTEMS_MINIMUM_STACK_SIZE,
206    RTEMS_DEFAULT_MODES,
207    RTEMS_GLOBAL,
208    &Junk_id
209  );
210  fatal_directive_status(
211    status,
212    RTEMS_MP_NOT_CONFIGURED,
213    "rtems_task_create of global task in a single cpu system"
214  );
215#endif
216  puts( "TA1 - rtems_task_create - RTEMS_MP_NOT_CONFIGURED" );
217}
Note: See TracBrowser for help on using the repository browser.