source: rtems/c/src/tests/sptests/sp09/screen11.c @ 60b791ad

4.104.114.84.95
Last change on this file since 60b791ad was 60b791ad, checked in by Joel Sherrill <joel.sherrill@…>, on 02/17/98 at 23:46:28

updated copyright to 1998

  • Property mode set to 100644
File size: 6.2 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  status = rtems_partition_create(
92    Partition_name[ 1 ],
93    Partition_good_area,
94    128,
95    64,
96    RTEMS_GLOBAL,
97    &Junk_id
98  );
99  fatal_directive_status(
100    status,
101    RTEMS_MP_NOT_CONFIGURED,
102    "rtems_partition_create of global"
103  );
104  puts( "TA1 - rtems_partition_create - RTEMS_MP_NOT_CONFIGURED" );
105
106  status = rtems_partition_create(
107    Partition_name[ 1 ],
108    Partition_bad_area,
109    128,
110    64,
111    RTEMS_GLOBAL,
112    &Junk_id
113  );
114  fatal_directive_status(
115    status,
116    RTEMS_INVALID_ADDRESS,
117    "rtems_partition_create with bad address"
118  );
119  puts( "TA1 - rtems_partition_create - RTEMS_INVALID_ADDRESS" );
120
121  status = rtems_partition_create(
122    Partition_name[ 1 ],
123    Partition_good_area,
124    128,
125    34,
126    RTEMS_DEFAULT_ATTRIBUTES,
127    &Junk_id
128  );
129  fatal_directive_status(
130    status,
131    RTEMS_INVALID_SIZE,
132    "rtems_partition_create with unaligned buffer_size"
133  );
134  puts( "TA1 - rtems_partition_create - RTEMS_INVALID_SIZE" );
135
136  status = rtems_partition_delete( 100 );
137  fatal_directive_status(
138    status,
139    RTEMS_INVALID_ID,
140    "rtems_partition_delete with illegal id"
141  );
142  puts( "TA1 - rtems_partition_delete - unknown RTEMS_INVALID_ID" );
143
144  status = rtems_partition_delete( 0x10100 );
145  fatal_directive_status(
146    status,
147    RTEMS_INVALID_ID,
148    "rtems_partition_delete with illegal id"
149  );
150  puts( "TA1 - rtems_partition_delete - local RTEMS_INVALID_ID" );
151
152  status = rtems_partition_get_buffer( 100, &buffer_address_1 );
153  fatal_directive_status(
154    status,
155    RTEMS_INVALID_ID,
156    "rtems_partition_get_buffer with illegal id"
157  );
158  puts( "TA1 - rtems_partition_get_buffer - RTEMS_INVALID_ID" );
159
160  status = rtems_partition_ident( 0, RTEMS_SEARCH_ALL_NODES, &Junk_id );
161  fatal_directive_status(
162    status,
163    RTEMS_INVALID_NAME,
164    "rtems_partition_ident with illegal name"
165  );
166  puts( "TA1 - rtems_partition_ident - RTEMS_INVALID_NAME" );
167
168  status = rtems_partition_return_buffer( 100, buffer_address_1 );
169  fatal_directive_status(
170    status,
171    RTEMS_INVALID_ID,
172    "rtems_partition_return_buffer with illegal id"
173  );
174  puts( "TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ID" );
175
176  status = rtems_partition_create(
177    Partition_name[ 1 ],
178    Partition_good_area,
179    128,
180    64,
181    RTEMS_DEFAULT_ATTRIBUTES,
182    &Partition_id[ 1 ]
183  );
184  directive_failed( status, "rtems_partition_create" );
185  puts( "TA1 - rtems_partition_create - RTEMS_SUCCESSFUL" );
186
187  status = rtems_partition_create(
188    Partition_name[ 1 ],
189    Partition_good_area,
190    128,
191    32,
192    RTEMS_DEFAULT_ATTRIBUTES,
193    &Junk_id
194  );
195  fatal_directive_status(
196    status,
197    RTEMS_TOO_MANY,
198    "rtems_partition_create of too many"
199  );
200  puts( "TA1 - rtems_partition_create - RTEMS_TOO_MANY" );
201
202  status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer_address_1 );
203  directive_failed( status, "rtems_partition_get_buffer");
204  puts( "TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL" );
205
206  status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer_address_2 );
207  directive_failed( status, "rtems_partition_get_buffer" );
208  puts( "TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL" );
209
210  status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer_address_3 );
211  fatal_directive_status(
212    status,
213    RTEMS_UNSATISFIED,
214    "rtems_partition_get_buffer unsatisfied"
215  );
216  puts( "TA1 - rtems_partition_get_buffer - RTEMS_UNSATISFIED" );
217
218  status = rtems_partition_delete( Partition_id[ 1 ] );
219  fatal_directive_status(
220    status,
221    RTEMS_RESOURCE_IN_USE,
222    "rtems_partition_delete with buffers in use"
223  );
224  puts( "TA1 - rtems_partition_delete - RTEMS_RESOURCE_IN_USE" );
225
226  status = rtems_partition_return_buffer(
227    Partition_id[ 1 ],
228    Region_good_area                  /* NOTE: Region Memory */
229  );
230  fatal_directive_status(
231    status,
232    RTEMS_INVALID_ADDRESS,
233    "rtems_partition_return_buffer with buffer address out of partition"
234  );
235  puts(
236    "TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ADDRESS - out of range"
237  );
238
239  status = rtems_partition_return_buffer(
240    Partition_id[ 1 ],
241    &Partition_good_area[ 7 ]
242  );
243  fatal_directive_status(
244    status,
245    RTEMS_INVALID_ADDRESS,
246    "rtems_partition_return_buffer with buffer address not on boundary"
247  );
248  puts_nocr( "TA1 - rtems_partition_return_buffer - " );
249  puts     ( "RTEMS_INVALID_ADDRESS - not on boundary");
250}
Note: See TracBrowser for help on using the repository browser.