source: rtems/c/src/tests/sptests/sp09/screen07.c @ 03f2154e

4.104.114.84.95
Last change on this file since 03f2154e was 03f2154e, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 22, 1997 at 5:20:27 PM

headers updated to reflect new style copyright notice as part
of switching to the modified GNU GPL.

  • Property mode set to 100644
File size: 5.0 KB
Line 
1/*  Screen7
2 *
3 *  This routine generates error screen 7 for test 9.
4 *
5 *  Input parameters:  NONE
6 *
7 *  Output parameters:  NONE
8 *
9 *  COPYRIGHT (c) 1989-1997.
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 in
14 *  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 Screen7()
23{
24  long              buffer[ 4 ];
25  rtems_unsigned32  size;
26  rtems_unsigned32  count;
27  rtems_status_code status;
28
29  status = rtems_message_queue_broadcast( 100, (long (*)[4]) buffer, 16, &count );
30  fatal_directive_status(
31    status,
32    RTEMS_INVALID_ID,
33    "rtems_message_queue_broadcast with illegal id"
34  );
35  puts( "TA1 - rtems_message_queue_broadcast - RTEMS_INVALID_ID" );
36
37  status = rtems_message_queue_create(
38    0,
39    3,
40    16,
41    RTEMS_DEFAULT_ATTRIBUTES,
42    &Junk_id
43  );
44  fatal_directive_status(
45    status,
46    RTEMS_INVALID_NAME,
47    "rtems_message_queue_create with illegal name"
48  );
49
50  puts( "TA1 - rtems_message_queue_create - Q 1 - RTEMS_INVALID_NAME" );
51  status = rtems_message_queue_create(
52    Queue_name[ 1 ],
53    1,
54    16,
55    RTEMS_GLOBAL,
56    &Junk_id
57  );
58  fatal_directive_status(
59    status,
60    RTEMS_MP_NOT_CONFIGURED,
61    "rtems_message_queue_create of mp not configured"
62  );
63  puts( "TA1 - rtems_message_queue_create - Q 1 - RTEMS_MP_NOT_CONFIGURED" );
64
65  status = rtems_message_queue_create(
66    Queue_name[ 1 ],
67    2,
68    16,
69    RTEMS_DEFAULT_ATTRIBUTES,
70    &Queue_id[ 1 ]
71  );
72  directive_failed( status, "rtems_message_queue_create successful" );
73  puts(
74    "TA1 - rtems_message_queue_create - Q 1 - 2 DEEP - RTEMS_SUCCESSFUL"
75  );
76
77  status = rtems_message_queue_create(
78    Queue_name[ 2 ],
79    1,
80    16,
81    RTEMS_DEFAULT_ATTRIBUTES,
82    &Junk_id
83  );
84  fatal_directive_status(
85    status,
86    RTEMS_TOO_MANY,
87    "rtems_message_queue_create of too many"
88  );
89  puts( "TA1 - rtems_message_queue_create - Q 2 - RTEMS_TOO_MANY" );
90
91  status = rtems_message_queue_delete( 100 );
92  fatal_directive_status(
93    status,
94    RTEMS_INVALID_ID,
95    "rtems_message_queue_create with illegal id"
96  );
97  puts( "TA1 - rtems_message_queue_delete - unknown RTEMS_INVALID_ID" );
98
99  status = rtems_message_queue_delete( 0x10100 );
100  fatal_directive_status(
101    status,
102    RTEMS_INVALID_ID,
103    "rtems_message_queue_delete with local illegal id"
104  );
105  puts( "TA1 - rtems_message_queue_delete - local RTEMS_INVALID_ID" );
106
107  status = rtems_message_queue_ident( 100, RTEMS_SEARCH_ALL_NODES, &Junk_id );
108  fatal_directive_status(
109    status,
110    RTEMS_INVALID_NAME,
111    "rtems_message_queue_ident with illegal name"
112  );
113  puts( "TA1 - rtems_message_queue_ident - RTEMS_INVALID_NAME" );
114
115  status = rtems_message_queue_flush( 100, &count );
116  fatal_directive_status(
117    status,
118    RTEMS_INVALID_ID,
119    "rtems_message_queue_flush with illegal id"
120  );
121  puts( "TA1 - rtems_message_queue_flush - RTEMS_INVALID_ID" );
122
123  status = rtems_message_queue_receive(
124    100,
125    (long (*)[4]) buffer,
126    &size,
127    RTEMS_DEFAULT_OPTIONS,
128    0
129  );
130  fatal_directive_status(
131    status,
132    RTEMS_INVALID_ID,
133    "rtems_message_queue_receive wit illegal id"
134  );
135  puts( "TA1 - rtems_message_queue_receive - RTEMS_INVALID_ID" );
136
137  status = rtems_message_queue_receive(
138    Queue_id[ 1 ],
139    (long (*)[4]) buffer,
140    &size,
141    RTEMS_NO_WAIT,
142    RTEMS_NO_TIMEOUT
143  );
144  fatal_directive_status(
145    status,
146    RTEMS_UNSATISFIED,
147    "rtems_message_queue_receive unsatisfied"
148  );
149  puts( "TA1 - rtems_message_queue_receive - Q 1 - RTEMS_UNSATISFIED" );
150
151  puts( "TA1 - rtems_message_queue_receive - Q 1 - timeout in 3 seconds" );
152  status = rtems_message_queue_receive(
153    Queue_id[ 1 ],
154    (long (*)[4]) buffer,
155    &size,
156    RTEMS_DEFAULT_OPTIONS,
157    3 * TICKS_PER_SECOND
158  );
159  fatal_directive_status(
160    status,
161    RTEMS_TIMEOUT,
162    "rtems_message_queue_receive 3 second timeout"
163  );
164
165  puts(
166    "TA1 - rtems_message_queue_receive - Q 1 - woke up with RTEMS_TIMEOUT"
167  );
168
169  status = rtems_message_queue_send( 100, (long (*)[4]) buffer, 16 );
170  fatal_directive_status(
171    status,
172    RTEMS_INVALID_ID,
173    "rtems_message_queue_send with illegal id"
174  );
175  puts( "TA1 - rtems_message_queue_send - RTEMS_INVALID_ID" );
176
177  status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4]) buffer, 16 );
178  directive_failed( status, "rtems_message_queue_send" );
179  puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL" );
180
181  status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4]) buffer, 16 );
182  directive_failed( status, "rtems_message_queue_send" );
183  puts( "TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL" );
184
185  status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4]) buffer, 16 );
186  fatal_directive_status(
187    status,
188    RTEMS_TOO_MANY,
189    "rtems_message_queue_send too many to a limited queue"
190  );
191  puts( "TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1 - RTEMS_TOO_MANY" );
192}
Note: See TracBrowser for help on using the repository browser.