source: rtems/testsuites/sptests/sp09/screen11.c @ 20f54e9

4.104.114.84.95
Last change on this file since 20f54e9 was 012bb56, checked in by Joel Sherrill <joel.sherrill@…>, on 12/03/98 at 21:57:50

Insure that the same output occurs when multiprocessing is disabled.

  • Property mode set to 100644
File size: 6.4 KB
Line 
1/*  Screen11
2 *
3 *  This routine generates error screen 11 for test 9.
4 *
5 *  Input parameters:  NONE
6 *
7 *  Output parameters:  NONE
8 *
9 *  COPYRIGHT (c) 1989-1998.
10 *  On-Line Applications Research Corporation (OAR).
11 *  Copyright assigned to U.S. Government, 1994.
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.OARcorp.com/rtems/license.html.
16 *
17 *  $Id$
18 */
19
20#include "system.h"
21
22void Screen11()
23{
24  void              *buffer_address_1;
25  void              *buffer_address_2;
26  void              *buffer_address_3;
27  rtems_status_code  status;
28
29  status = rtems_partition_create(
30    0,
31    Partition_good_area,
32    128,
33    40,
34    RTEMS_DEFAULT_ATTRIBUTES,
35    &Junk_id
36  );
37  fatal_directive_status(
38    status,
39    RTEMS_INVALID_NAME,
40    "rtems_partition_create with illegal name"
41  );
42  puts( "TA1 - rtems_partition_create - RTEMS_INVALID_NAME" );
43
44  status = rtems_partition_create(
45    Partition_name[ 1 ],
46    Partition_good_area,
47    0,
48    80,
49    RTEMS_DEFAULT_ATTRIBUTES,
50    &Junk_id
51  );
52  fatal_directive_status(
53    status,
54    RTEMS_INVALID_SIZE,
55    "rtems_partition_create with illegal length"
56  );
57  puts( "TA1 - rtems_partition_create - length - RTEMS_INVALID_SIZE" );
58
59  status = rtems_partition_create(
60    Partition_name[ 1 ],
61    Partition_good_area,
62    128,
63    0,
64    RTEMS_DEFAULT_ATTRIBUTES,
65    &Junk_id
66  );
67  fatal_directive_status(
68    status,
69    RTEMS_INVALID_SIZE,
70    "rtems_partition_create with illegal buffer size"
71  );
72  puts( "TA1 - rtems_partition_create - buffer size - RTEMS_INVALID_SIZE" );
73
74  status = rtems_partition_create(
75    Partition_name[ 1 ],
76    Partition_good_area,
77    128,
78    256,
79    RTEMS_DEFAULT_ATTRIBUTES,
80    &Junk_id
81  );
82  fatal_directive_status(
83    status,
84    RTEMS_INVALID_SIZE,
85    "rtems_partition_create with buffer_size > length"
86  );
87  puts(
88    "TA1 - rtems_partition_create - length < buffer size - RTEMS_INVALID_SIZE"
89  );
90
91  /*
92   *  The check for an object being global is only made if
93   *  multiprocessing is enabled.
94   */
95
96#if defined(RTEMS_MULTIPROCESSING)
97  status = rtems_partition_create(
98    Partition_name[ 1 ],
99    Partition_good_area,
100    128,
101    64,
102    RTEMS_GLOBAL,
103    &Junk_id
104  );
105  fatal_directive_status(
106    status,
107    RTEMS_MP_NOT_CONFIGURED,
108    "rtems_partition_create of global"
109  );
110#endif
111  puts( "TA1 - rtems_partition_create - RTEMS_MP_NOT_CONFIGURED" );
112
113  status = rtems_partition_create(
114    Partition_name[ 1 ],
115    Partition_bad_area,
116    128,
117    64,
118    RTEMS_GLOBAL,
119    &Junk_id
120  );
121  fatal_directive_status(
122    status,
123    RTEMS_INVALID_ADDRESS,
124    "rtems_partition_create with bad address"
125  );
126  puts( "TA1 - rtems_partition_create - RTEMS_INVALID_ADDRESS" );
127
128  status = rtems_partition_create(
129    Partition_name[ 1 ],
130    Partition_good_area,
131    128,
132    34,
133    RTEMS_DEFAULT_ATTRIBUTES,
134    &Junk_id
135  );
136  fatal_directive_status(
137    status,
138    RTEMS_INVALID_SIZE,
139    "rtems_partition_create with unaligned buffer_size"
140  );
141  puts( "TA1 - rtems_partition_create - RTEMS_INVALID_SIZE" );
142
143  status = rtems_partition_delete( 100 );
144  fatal_directive_status(
145    status,
146    RTEMS_INVALID_ID,
147    "rtems_partition_delete with illegal id"
148  );
149  puts( "TA1 - rtems_partition_delete - unknown RTEMS_INVALID_ID" );
150
151  status = rtems_partition_delete( 0x10100 );
152  fatal_directive_status(
153    status,
154    RTEMS_INVALID_ID,
155    "rtems_partition_delete with illegal id"
156  );
157  puts( "TA1 - rtems_partition_delete - local RTEMS_INVALID_ID" );
158
159  status = rtems_partition_get_buffer( 100, &buffer_address_1 );
160  fatal_directive_status(
161    status,
162    RTEMS_INVALID_ID,
163    "rtems_partition_get_buffer with illegal id"
164  );
165  puts( "TA1 - rtems_partition_get_buffer - RTEMS_INVALID_ID" );
166
167  status = rtems_partition_ident( 0, RTEMS_SEARCH_ALL_NODES, &Junk_id );
168  fatal_directive_status(
169    status,
170    RTEMS_INVALID_NAME,
171    "rtems_partition_ident with illegal name"
172  );
173  puts( "TA1 - rtems_partition_ident - RTEMS_INVALID_NAME" );
174
175  status = rtems_partition_return_buffer( 100, buffer_address_1 );
176  fatal_directive_status(
177    status,
178    RTEMS_INVALID_ID,
179    "rtems_partition_return_buffer with illegal id"
180  );
181  puts( "TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ID" );
182
183  status = rtems_partition_create(
184    Partition_name[ 1 ],
185    Partition_good_area,
186    128,
187    64,
188    RTEMS_DEFAULT_ATTRIBUTES,
189    &Partition_id[ 1 ]
190  );
191  directive_failed( status, "rtems_partition_create" );
192  puts( "TA1 - rtems_partition_create - RTEMS_SUCCESSFUL" );
193
194  status = rtems_partition_create(
195    Partition_name[ 1 ],
196    Partition_good_area,
197    128,
198    32,
199    RTEMS_DEFAULT_ATTRIBUTES,
200    &Junk_id
201  );
202  fatal_directive_status(
203    status,
204    RTEMS_TOO_MANY,
205    "rtems_partition_create of too many"
206  );
207  puts( "TA1 - rtems_partition_create - RTEMS_TOO_MANY" );
208
209  status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer_address_1 );
210  directive_failed( status, "rtems_partition_get_buffer");
211  puts( "TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL" );
212
213  status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer_address_2 );
214  directive_failed( status, "rtems_partition_get_buffer" );
215  puts( "TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL" );
216
217  status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer_address_3 );
218  fatal_directive_status(
219    status,
220    RTEMS_UNSATISFIED,
221    "rtems_partition_get_buffer unsatisfied"
222  );
223  puts( "TA1 - rtems_partition_get_buffer - RTEMS_UNSATISFIED" );
224
225  status = rtems_partition_delete( Partition_id[ 1 ] );
226  fatal_directive_status(
227    status,
228    RTEMS_RESOURCE_IN_USE,
229    "rtems_partition_delete with buffers in use"
230  );
231  puts( "TA1 - rtems_partition_delete - RTEMS_RESOURCE_IN_USE" );
232
233  status = rtems_partition_return_buffer(
234    Partition_id[ 1 ],
235    Region_good_area                  /* NOTE: Region Memory */
236  );
237  fatal_directive_status(
238    status,
239    RTEMS_INVALID_ADDRESS,
240    "rtems_partition_return_buffer with buffer address out of partition"
241  );
242  puts(
243    "TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ADDRESS - out of range"
244  );
245
246  status = rtems_partition_return_buffer(
247    Partition_id[ 1 ],
248    &Partition_good_area[ 7 ]
249  );
250  fatal_directive_status(
251    status,
252    RTEMS_INVALID_ADDRESS,
253    "rtems_partition_return_buffer with buffer address not on boundary"
254  );
255  puts_nocr( "TA1 - rtems_partition_return_buffer - " );
256  puts     ( "RTEMS_INVALID_ADDRESS - not on boundary");
257}
Note: See TracBrowser for help on using the repository browser.