source: rtems/c/src/tests/sptests/sp09/screen10.c @ ac7d5ef0

4.104.114.84.95
Last change on this file since ac7d5ef0 was ac7d5ef0, checked in by Joel Sherrill <joel.sherrill@…>, on 05/11/95 at 17:39:37

Initial revision

  • Property mode set to 100644
File size: 5.0 KB
Line 
1/*  Screen10
2 *
3 *  This routine generates error screen 10 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 Screen10()
23{
24  rtems_status_code status;
25
26  status = rtems_rate_monotonic_create( 0, &Junk_id );
27  fatal_directive_status(
28    status,
29    RTEMS_INVALID_NAME,
30    "rtems_rate_monotonic_create with illegal name"
31  );
32  puts( "TA1 - rtems_rate_monotonic_create - RTEMS_INVALID_NAME" );
33
34  status = rtems_rate_monotonic_create( Period_name[ 1 ], &Period_id[ 1 ] );
35  directive_failed( status, "rtems_rate_monotonic_create successful" );
36  puts( "TA1 - rtems_rate_monotonic_create - RTEMS_SUCCESSFUL" );
37
38  status = rtems_rate_monotonic_create( Period_name[ 1 ], &Junk_id );
39  fatal_directive_status(
40    status,
41    RTEMS_TOO_MANY,
42    "rtems_rate_monotonic_create of too many"
43  );
44  puts( "TA1 - rtems_rate_monotonic_create - RTEMS_TOO_MANY" );
45
46  status = rtems_rate_monotonic_ident( 0, &Junk_id );
47  fatal_directive_status(
48    status,
49    RTEMS_INVALID_NAME,
50    "rtems_rate_monotonic_ident with illegal name"
51  );
52  puts( "TA1 - rtems_rate_monotonic_ident - RTEMS_INVALID_NAME" );
53
54  status = rtems_rate_monotonic_period( 100, 5 );
55  fatal_directive_status(
56    status,
57    RTEMS_INVALID_ID,
58    "rtems_rate_monotonic_period with illegal id"
59  );
60  puts( "TA1 - rtems_rate_monotonic_period - unknown RTEMS_INVALID_ID" );
61
62  status = rtems_rate_monotonic_period( 0x10100, 5 );
63  fatal_directive_status(
64    status,
65    RTEMS_INVALID_ID,
66    "rtems_rate_monotonic_period with illegal id"
67  );
68  puts( "TA1 - rtems_rate_monotonic_period - local RTEMS_INVALID_ID" );
69
70  status = rtems_rate_monotonic_period( Period_id[ 1 ], RTEMS_PERIOD_STATUS );
71  fatal_directive_status(
72    status,
73    RTEMS_NOT_DEFINED,
74    "rtems_rate_monotonic_period status not defined"
75  );
76  puts(
77    "TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_NOT_DEFINED"
78  );
79
80  status = rtems_rate_monotonic_period( Period_id[ 1 ], 100 );
81  directive_failed( status, "rtems_rate_monotonic_period successful" );
82  puts( "TA1 - rtems_rate_monotonic_period - 100 ticks - RTEMS_SUCCESSFUL" );
83
84  status = rtems_rate_monotonic_period( Period_id[ 1 ], RTEMS_PERIOD_STATUS );
85  directive_failed( status, "rtems_rate_monotonic_period status" );
86  puts(
87    "TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_SUCCESSFUL"
88  );
89
90  while ( FOREVER ) {
91
92     status = rtems_rate_monotonic_period(Period_id[ 1 ], RTEMS_PERIOD_STATUS);
93
94     if ( status == RTEMS_TIMEOUT ) break;
95
96     directive_failed(
97       status,
98       "rtems_rate_monotonic_period waiting for timeout"
99     );
100  }
101  puts(
102    "TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_TIMEOUT"
103  );
104
105  status = rtems_rate_monotonic_cancel( 100 );
106  fatal_directive_status(
107    status,
108    RTEMS_INVALID_ID,
109    "rtems_rate_monotonic_cancel with illegal id"
110  );
111  puts( "TA1 - rtems_rate_monotonic_cancel - unknown RTEMS_INVALID_ID" );
112
113  status = rtems_rate_monotonic_cancel( 0x10100 );
114  fatal_directive_status(
115    status,
116    RTEMS_INVALID_ID,
117    "rtems_rate_monotonic_cancel will illegal id"
118  );
119  puts( "TA1 - rtems_rate_monotonic_cancel - local RTEMS_INVALID_ID" );
120
121  status = rtems_rate_monotonic_cancel( Period_id[ 1 ] );
122  directive_failed( status, "rtems_rate_monotonic_cancel" );
123  puts( "TA1 - rtems_rate_monotonic_cancel - RTEMS_SUCCESSFUL" );
124
125  status = rtems_rate_monotonic_period( Period_id[ 1 ], 5 );
126  directive_failed( status, "rtems_rate_monotonic_period restart" );
127
128  status = rtems_task_wake_after( 1 * TICKS_PER_SECOND );
129  directive_failed( status, "rtems_task_wake_after" );
130
131  status = rtems_rate_monotonic_period( Period_id[ 1 ], 5 );
132  fatal_directive_status(
133    status,
134    RTEMS_TIMEOUT,
135    "rtems_rate_monotonic_period"
136  );
137  puts( "TA1 - rtems_rate_monotonic_period - 5 ticks - RTEMS_TIMEOUT" );
138
139  status = rtems_task_start( Task_id[ 4 ], Task_4, 0 );
140  directive_failed( status, "rtems_task_start of TA4" );
141
142  puts( "TA1 - yielding to TA4" );
143  status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
144
145  status = rtems_rate_monotonic_delete( 100 );
146  fatal_directive_status(
147    status,
148    RTEMS_INVALID_ID,
149    "rtems_rate_monotonic_delete with illegal id"
150  );
151  puts( "TA1 - rtems_rate_monotonic_delete - unknown RTEMS_INVALID_ID" );
152
153  status = rtems_rate_monotonic_delete( 0x10100 );
154  fatal_directive_status(
155    status,
156    RTEMS_INVALID_ID,
157    "rtems_rate_monotonic_delete with illegal id"
158  );
159  puts( "TA1 - rtems_rate_monotonic_delete - local RTEMS_INVALID_ID" );
160
161  status = rtems_rate_monotonic_delete( Period_id[ 1 ] );
162  directive_failed( status, "rtems_rate_monotonic_delete" );
163  puts( "TA1 - rtems_rate_monotonic_delete - RTEMS_SUCCESSFUL" );
164}
Note: See TracBrowser for help on using the repository browser.