source: rtems/testsuites/sptests/sp09/screen05.c @ 3235ad9

4.104.114.84.95
Last change on this file since 3235ad9 was 3235ad9, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 23, 1995 at 7:30:23 PM

Support for variable length names added to Object Handler. This supports
both fixed length "raw" names and strings from the API's point of view.

Both inline and macro implementations were tested.

  • Property mode set to 100644
File size: 3.9 KB
Line 
1/*  Screen5
2 *
3 *  This routine generates error screen 5 for test 9.
4 *
5 *  Input parameters:  NONE
6 *
7 *  Output parameters:  NONE
8 *
9 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
10 *  On-Line Applications Research Corporation (OAR).
11 *  All rights assigned to U.S. Government, 1994.
12 *
13 *  This material may be reproduced by or for the U.S. Government pursuant
14 *  to the copyright license under the clause at DFARS 252.227-7013.  This
15 *  notice must appear in all copies of this file and its derivatives.
16 *
17 *  $Id$
18 */
19
20#include "system.h"
21
22void Screen5()
23{
24  rtems_status_code status;
25
26  status = rtems_semaphore_create( 0, 1, RTEMS_DEFAULT_ATTRIBUTES, &Junk_id );
27  fatal_directive_status(
28    status,
29    RTEMS_INVALID_NAME,
30    "rtems_semaphore_create with illegal name"
31  );
32  puts( "TA1 - rtems_semaphore_create - RTEMS_INVALID_NAME" );
33
34  status = rtems_semaphore_create(
35    Semaphore_name[ 1 ],
36    1,
37    RTEMS_DEFAULT_ATTRIBUTES,
38    &Semaphore_id[ 1 ]
39  );
40  directive_failed( status, "rtems_semaphore_create" );
41  puts( "TA1 - rtems_semaphore_create - 1 - RTEMS_SUCCESSFUL" );
42
43  status = rtems_semaphore_create(
44    Semaphore_name[ 2 ],
45    1,
46    RTEMS_BINARY_SEMAPHORE,
47    &Semaphore_id[ 2 ]
48  );
49  directive_failed( status, "rtems_semaphore_create" );
50  puts( "TA1 - rtems_semaphore_create - 2 - RTEMS_SUCCESSFUL" );
51
52  do {
53      status = rtems_semaphore_create(
54          Semaphore_name[ 3 ],
55          1,
56          RTEMS_DEFAULT_ATTRIBUTES,
57          &Junk_id);
58  } while (status == RTEMS_SUCCESSFUL);
59
60  fatal_directive_status(
61    status,
62    RTEMS_TOO_MANY,
63    "rtems_semaphore_create of too many"
64  );
65  puts( "TA1 - rtems_semaphore_create - 3 - RTEMS_TOO_MANY" );
66
67  status = rtems_semaphore_create(
68    Semaphore_name[ 1 ],
69    1,
70    RTEMS_INHERIT_PRIORITY | RTEMS_BINARY_SEMAPHORE | RTEMS_FIFO,
71    &Junk_id
72  );
73  fatal_directive_status(
74    status,
75    RTEMS_NOT_DEFINED,
76    "rtems_semaphore_create of RTEMS_FIFO RTEMS_INHERIT_PRIORITY"
77  );
78  puts( "TA1 - rtems_semaphore_create - RTEMS_NOT_DEFINED" );
79
80  status = rtems_semaphore_create(
81    Semaphore_name[ 1 ],
82    1,
83    RTEMS_INHERIT_PRIORITY | RTEMS_COUNTING_SEMAPHORE | RTEMS_PRIORITY,
84    &Junk_id
85  );
86  fatal_directive_status(
87    status,
88    RTEMS_NOT_DEFINED,
89    "rtems_semaphore_create of RTEMS_COUNTING_SEMAPHORE RTEMS_INHERIT_PRIORITY"
90  );
91  puts( "TA1 - rtems_semaphore_create - RTEMS_NOT_DEFINED" );
92
93  status = rtems_semaphore_create(
94    Semaphore_name[ 1 ],
95    2,
96    RTEMS_BINARY_SEMAPHORE,
97    &Junk_id
98  );
99  fatal_directive_status(
100    status,
101    RTEMS_INVALID_NUMBER,
102    "rtems_semaphore_create of binary semaphore with count > 1"
103  );
104  puts( "TA1 - rtems_semaphore_create - RTEMS_INVALID_NUMBER" );
105
106  status = rtems_semaphore_create(
107    Semaphore_name[ 3 ],
108    1,
109    RTEMS_GLOBAL,
110    &Junk_id
111  );
112  fatal_directive_status(
113    status,
114    RTEMS_MP_NOT_CONFIGURED,
115    "rtems_semaphore_create of mp not configured"
116  );
117  puts( "TA1 - rtems_semaphore_create - RTEMS_MP_NOT_CONFIGURED" );
118
119  status = rtems_semaphore_delete( 100 );
120  fatal_directive_status(
121    status,
122    RTEMS_INVALID_ID,
123    "rtems_semaphore_delete with illegal id"
124  );
125  puts( "TA1 - rtems_semaphore_delete - unknown RTEMS_INVALID_ID" );
126
127  status = rtems_semaphore_delete( 0x010100 );
128  fatal_directive_status(
129    status,
130    RTEMS_INVALID_ID,
131    "rtems_semaphore_delete with local illegal id"
132  );
133  puts( "TA1 - rtems_semaphore_delete - local RTEMS_INVALID_ID" );
134
135  status = rtems_semaphore_ident( 100, RTEMS_SEARCH_ALL_NODES, &Junk_id );
136  fatal_directive_status(
137    status,
138    RTEMS_INVALID_NAME,
139    "rtems_semaphore_ident will illegal name (local)"
140  );
141  puts( "TA1 - rtems_semaphore_ident - global RTEMS_INVALID_NAME" );
142
143  status = rtems_semaphore_ident( 100, 1, &Junk_id );
144  fatal_directive_status(
145    status,
146    RTEMS_INVALID_NAME,
147    "rtems_semaphore_ident will illegal name (global)"
148  );
149  puts( "TA1 - rtems_semaphore_ident - local RTEMS_INVALID_NAME" );
150}
Note: See TracBrowser for help on using the repository browser.