source: rtems/testsuites/sptests/sp09/screen07.c @ 13f09e6

4.104.114.84.95
Last change on this file since 13f09e6 was 13f09e6, checked in by Joel Sherrill <joel.sherrill@…>, on Jul 31, 1997 at 7:48:23 PM

Added support for rtems_message_queue_get_number_pending.

  • Property mode set to 100644
File size: 5.2 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_get_number_pending( 100, &count );
116  fatal_directive_status(
117    status,
118    RTEMS_INVALID_ID,
119    "rtems_message_queue_get_number_pending with illegal id"
120  );
121  puts( "TA1 - rtems_message_queue_get_number_pending - RTEMS_INVALID_ID" );
122
123  status = rtems_message_queue_flush( 100, &count );
124  fatal_directive_status(
125    status,
126    RTEMS_INVALID_ID,
127    "rtems_message_queue_flush with illegal id"
128  );
129  puts( "TA1 - rtems_message_queue_flush - RTEMS_INVALID_ID" );
130
131  status = rtems_message_queue_receive(
132    100,
133    (long (*)[4]) buffer,
134    &size,
135    RTEMS_DEFAULT_OPTIONS,
136    0
137  );
138  fatal_directive_status(
139    status,
140    RTEMS_INVALID_ID,
141    "rtems_message_queue_receive wit illegal id"
142  );
143  puts( "TA1 - rtems_message_queue_receive - RTEMS_INVALID_ID" );
144
145  status = rtems_message_queue_receive(
146    Queue_id[ 1 ],
147    (long (*)[4]) buffer,
148    &size,
149    RTEMS_NO_WAIT,
150    RTEMS_NO_TIMEOUT
151  );
152  fatal_directive_status(
153    status,
154    RTEMS_UNSATISFIED,
155    "rtems_message_queue_receive unsatisfied"
156  );
157  puts( "TA1 - rtems_message_queue_receive - Q 1 - RTEMS_UNSATISFIED" );
158
159  puts( "TA1 - rtems_message_queue_receive - Q 1 - timeout in 3 seconds" );
160  status = rtems_message_queue_receive(
161    Queue_id[ 1 ],
162    (long (*)[4]) buffer,
163    &size,
164    RTEMS_DEFAULT_OPTIONS,
165    3 * TICKS_PER_SECOND
166  );
167  fatal_directive_status(
168    status,
169    RTEMS_TIMEOUT,
170    "rtems_message_queue_receive 3 second timeout"
171  );
172
173  puts(
174    "TA1 - rtems_message_queue_receive - Q 1 - woke up with RTEMS_TIMEOUT"
175  );
176
177  status = rtems_message_queue_send( 100, (long (*)[4]) buffer, 16 );
178  fatal_directive_status(
179    status,
180    RTEMS_INVALID_ID,
181    "rtems_message_queue_send with illegal id"
182  );
183  puts( "TA1 - rtems_message_queue_send - RTEMS_INVALID_ID" );
184
185  status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4]) buffer, 16 );
186  directive_failed( status, "rtems_message_queue_send" );
187  puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL" );
188
189  status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4]) buffer, 16 );
190  directive_failed( status, "rtems_message_queue_send" );
191  puts( "TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL" );
192
193  status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4]) buffer, 16 );
194  fatal_directive_status(
195    status,
196    RTEMS_TOO_MANY,
197    "rtems_message_queue_send too many to a limited queue"
198  );
199  puts( "TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1 - RTEMS_TOO_MANY" );
200}
Note: See TracBrowser for help on using the repository browser.