source: rtems/c/src/tests/sptests/sp09/screen11.c @ 8c3c1763

4.104.114.84.95
Last change on this file since 8c3c1763 was 8c3c1763, checked in by Joel Sherrill <joel.sherrill@…>, on 07/26/00 at 20:44:11

Added ifdef on C4x to avoid invalid address alignment checks since there
is no such thing on the C4x.

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