source: rtems/c/src/tests/sptests/sp09/screen14.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: 4.3 KB
Line 
1/*  Screen14
2 *
3 *  This routine generates error screen 14 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 Screen14()
23{
24  rtems_status_code  status;
25  rtems_time_of_day  time;
26
27  status = rtems_timer_create( 0, &Junk_id );
28  fatal_directive_status(
29    status,
30    RTEMS_INVALID_NAME,
31    "rtems_timer_create with illegal name"
32  );
33  puts( "TA1 - rtems_timer_create - RTEMS_INVALID_NAME" );
34
35  status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] );
36  directive_failed( status, "rtems_timer_create" );
37  puts( "TA1 - rtems_timer_create - 1 - RTEMS_SUCCESSFUL" );
38
39  status = rtems_timer_create( 2, &Junk_id );
40  fatal_directive_status(
41    status,
42    RTEMS_TOO_MANY,
43    "rtems_timer_create for too many"
44  );
45  puts( "TA1 - rtems_timer_create - 2 - RTEMS_TOO_MANY" );
46
47  status = rtems_timer_delete( 100 );
48  fatal_directive_status(
49    status,
50    RTEMS_INVALID_ID,
51    "rtems_timer_delete with illegal id"
52  );
53  puts( "TA1 - rtems_timer_delete - local RTEMS_INVALID_ID" );
54
55  status = rtems_timer_delete( 0x010100 );
56  fatal_directive_status(
57    status,
58    RTEMS_INVALID_ID,
59    "rtems_timer_delete with illegal id"
60  );
61  puts( "TA1 - rtems_timer_delete - global RTEMS_INVALID_ID" );
62
63  status = rtems_timer_ident( 0, &Junk_id );
64  fatal_directive_status(
65    status,
66    RTEMS_INVALID_NAME,
67    "rtems_timer_ident with illegal name"
68  );
69  puts( "TA1 - rtems_timer_ident - RTEMS_INVALID_NAME" );
70
71  status = rtems_timer_cancel( 0x010100 );
72  fatal_directive_status(
73    status,
74    RTEMS_INVALID_ID,
75    "rtems_timer_cancel with illegal id"
76  );
77  puts( "TA1 - rtems_timer_cancel - RTEMS_INVALID_ID" );
78
79  status = rtems_timer_cancel( Timer_id[ 1 ] );
80  fatal_directive_status(
81    status,
82    RTEMS_INCORRECT_STATE,
83    "rtems_timer_cancel before initiated"
84  );
85  puts( "TA1 - rtems_timer_cancel - RTEMS_INCORRECT_STATE" );
86
87  status = rtems_timer_reset( 0x010100 );
88  fatal_directive_status(
89    status,
90    RTEMS_INVALID_ID,
91    "rtems_timer_reset with illegal id"
92  );
93  puts( "TA1 - rtems_timer_reset - RTEMS_INVALID_ID" );
94
95  status = rtems_timer_reset( Timer_id[ 1 ] );
96  fatal_directive_status(
97    status,
98    RTEMS_NOT_DEFINED,
99    "rtems_timer_reset before initiated"
100  );
101  puts( "TA1 - rtems_timer_reset - RTEMS_NOT_DEFINED" );
102
103  status = rtems_timer_fire_after(
104    0x010100,
105    5 * TICKS_PER_SECOND,
106    Delayed_routine,
107    NULL
108  );
109  fatal_directive_status(
110    status,
111    RTEMS_INVALID_ID,
112    "rtems_timer_fire_after illegal id"
113  );
114  puts( "TA1 - rtems_timer_fire_after - RTEMS_INVALID_ID" );
115
116  build_time( &time, 12, 31, 1994, 9, 0, 0, 0 );
117  status = rtems_timer_fire_when( 0x010100, &time, Delayed_routine, NULL );
118  fatal_directive_status(
119    status,
120    RTEMS_INVALID_ID,
121    "rtems_timer_fire_when with illegal id"
122  );
123  puts( "TA1 - rtems_timer_fire_when - RTEMS_INVALID_ID" );
124
125  status = rtems_timer_fire_after( Timer_id[ 1 ], 0, Delayed_routine, NULL );
126  fatal_directive_status(
127    status,
128    RTEMS_INVALID_NUMBER,
129    "rtems_timer_fire_after with 0 ticks"
130  );
131  puts( "TA1 - rtems_timer_fire_after - RTEMS_INVALID_NUMBER" );
132
133  build_time( &time, 2, 5, 1987, 8, 30, 45, 0 );
134  status = rtems_timer_fire_when( Timer_id[ 1 ], &time, Delayed_routine, NULL );
135  fatal_directive_status(
136    status,
137    RTEMS_INVALID_CLOCK,
138    "rtems_timer_fire_when with illegal time"
139  );
140  print_time(
141    "TA1 - rtems_timer_fire_when - ",
142    &time,
143    " - RTEMS_INVALID_CLOCK\n"
144  );
145
146  status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
147  directive_failed( status, "rtems_clock_set" );
148  print_time( "TA1 - rtems_clock_get       - ", &time, "\n" );
149
150  build_time( &time, 2, 5, 1990, 8, 30, 45, 0 );
151  status = rtems_timer_fire_when( Timer_id[ 1 ], &time, Delayed_routine, NULL );
152  fatal_directive_status(
153    status,
154    RTEMS_INVALID_CLOCK,
155    "rtems_timer_fire_when before current time"
156  );
157  print_time(
158    "TA1 - rtems_timer_fire_when - ",
159    &time,
160    " - before RTEMS_INVALID_CLOCK\n"
161  );
162}
Note: See TracBrowser for help on using the repository browser.