source: rtems/c/src/tests/sptests/sp09/screen02.c @ d2b93bfd

4.104.114.84.95
Last change on this file since d2b93bfd was d2b93bfd, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:53:48

2003-09-04 Joel Sherrill <joel@…>

  • sp01/init.c, sp01/sp01.doc, sp01/system.h, sp01/task1.c, sp02/init.c, sp02/preempt.c, sp02/sp02.doc, sp02/system.h, sp02/task1.c, sp02/task2.c, sp02/task3.c, sp03/init.c, sp03/sp03.doc, sp03/system.h, sp03/task1.c, sp03/task2.c, sp04/init.c, sp04/sp04.doc, sp04/system.h, sp04/task1.c, sp04/task2.c, sp04/task3.c, sp04/tswitch.c, sp05/init.c, sp05/sp05.doc, sp05/system.h, sp05/task1.c, sp05/task2.c, sp05/task3.c, sp06/init.c, sp06/sp06.doc, sp06/system.h, sp06/task1.c, sp06/task2.c, sp06/task3.c, sp07/init.c, sp07/sp07.doc, sp07/system.h, sp07/task1.c, sp07/task2.c, sp07/task3.c, sp07/task4.c, sp07/taskexit.c, sp07/tcreate.c, sp07/tdelete.c, sp07/trestart.c, sp07/tstart.c, sp08/init.c, sp08/sp08.doc, sp08/system.h, sp08/task1.c, sp09/delay.c, sp09/init.c, sp09/isr.c, sp09/screen01.c, sp09/screen02.c, sp09/screen03.c, sp09/screen04.c, sp09/screen05.c, sp09/screen06.c, sp09/screen07.c, sp09/screen08.c, sp09/screen09.c, sp09/screen10.c, sp09/screen11.c, sp09/screen12.c, sp09/screen13.c, sp09/screen14.c, sp09/sp09.doc, sp09/system.h, sp09/task1.c, sp09/task2.c, sp09/task3.c, sp09/task4.c, sp11/init.c, sp11/sp11.doc, sp11/system.h, sp11/task1.c, sp11/task2.c, sp11/timer.c, sp12/init.c, sp12/pridrv.c, sp12/pritask.c, sp12/sp12.doc, sp12/system.h, sp12/task1.c, sp12/task2.c, sp12/task3.c, sp12/task4.c, sp12/task5.c, sp13/fillbuff.c, sp13/init.c, sp13/putbuff.c, sp13/sp13.doc, sp13/system.h, sp13/task1.c, sp13/task2.c, sp13/task3.c, sp14/asr.c, sp14/init.c, sp14/sp14.doc, sp14/system.h, sp14/task1.c, sp14/task2.c, sp15/init.c, sp15/sp15.doc, sp15/system.h, sp15/task1.c, sp16/init.c, sp16/sp16.doc, sp16/system.h, sp16/task1.c, sp16/task2.c, sp16/task3.c, sp16/task4.c, sp16/task5.c, sp17/asr.c, sp17/init.c, sp17/sp17.doc, sp17/system.h, sp17/task1.c, sp17/task2.c, sp19/first.c, sp19/fptask.c, sp19/fptest.h, sp19/init.c, sp19/inttest.h, sp19/sp19.doc, sp19/system.h, sp19/task1.c, sp20/getall.c, sp20/init.c, sp20/sp20.doc, sp20/system.h, sp20/task1.c, sp21/init.c, sp21/sp21.doc, sp21/system.h, sp21/task1.c, sp22/delay.c, sp22/init.c, sp22/prtime.c, sp22/sp22.doc, sp22/system.h, sp22/task1.c, sp23/init.c, sp23/sp23.doc, sp23/system.h, sp23/task1.c, sp24/init.c, sp24/resume.c, sp24/sp24.doc, sp24/system.h, sp24/task1.c, sp25/init.c, sp25/sp25.doc, sp25/system.h, sp25/task1.c, sp26/init.c, sp26/sp26.doc, sp26/system.h, sp26/task1.c, sp30/init.c, sp30/resume.c, sp30/sp30.doc, sp30/system.h, sp30/task1.c, sp31/delay.c, sp31/init.c, sp31/prtime.c, sp31/sp31.doc, sp31/system.h, sp31/task1.c, sp32/init.c, spfatal/fatal.c, spfatal/init.c, spfatal/puterr.c, spfatal/spfatal.doc, spfatal/system.h, spfatal/task1.c, spsize/getint.c, spsize/init.c, spsize/size.c, spsize/system.h: URL for license changed.
  • Property mode set to 100644
File size: 5.2 KB
Line 
1/*  Screen2
2 *
3 *  This routine generates error screen 2 for test 9.
4 *
5 *  Input parameters:  NONE
6 *
7 *  Output parameters:  NONE
8 *
9 *  COPYRIGHT (c) 1989-1999.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.com/license/LICENSE.
15 *
16 *  $Id$
17 */
18
19#include "system.h"
20
21void Screen2()
22{
23  rtems_time_of_day time;
24  rtems_status_code status;
25
26/* errors before clock is set */
27
28  status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
29  if ( status == RTEMS_SUCCESSFUL ) {
30    puts(
31     "TA1 - rtems_clock_get - RTEMS_NOT_DEFINED -- DID BSP SET THE TIME OF DAY?"
32    );
33  } else {
34    fatal_directive_status(
35      status,
36      RTEMS_NOT_DEFINED,
37      "rtems_clock_get before clock is set"
38    );
39    puts( "TA1 - rtems_clock_get - RTEMS_NOT_DEFINED" );
40  }
41
42  status = rtems_task_wake_when( &time );
43  if ( status == RTEMS_SUCCESSFUL ) {
44    puts(
45"TA1 - rtems_task_wake_when - RTEMS_NOT_DEFINED -- DID BSP SET THE TIME OF DAY?"
46    );
47  } else {
48    fatal_directive_status(
49      status,
50      RTEMS_NOT_DEFINED,
51      "rtems_task_wake_when before clock is set"
52    );
53    puts( "TA1 - rtems_task_wake_when - RTEMS_NOT_DEFINED" );
54  }
55
56  status = rtems_timer_fire_when( 0, &time, Delayed_routine, NULL );
57  if ( status == RTEMS_SUCCESSFUL ) {
58    puts(
59    "TA1 - timer_wake_when - RTEMS_NOT_DEFINED -- DID BSP SET THE TIME OF DAY?"
60    );
61  } else {
62    fatal_directive_status(
63      status,
64      RTEMS_NOT_DEFINED,
65      "task_fire_when before clock is set"
66    );
67    puts( "TA1 - rtems_timer_fire_when - RTEMS_NOT_DEFINED" );
68  }
69
70  build_time( &time, 2, 5, 1987, 8, 30, 45, 0 );
71  print_time( "TA1 - rtems_clock_set - ", &time, "" );
72  status = rtems_clock_set( &time );
73  fatal_directive_status(
74    status,
75    RTEMS_INVALID_CLOCK,
76    "rtems_clock_set with invalid year"
77  );
78  puts( " - RTEMS_INVALID_CLOCK" );
79
80  build_time( &time, 15, 5, 1988, 8, 30, 45, 0 );
81  print_time( "TA1 - rtems_clock_set - ", &time, "" );
82  status = rtems_clock_set( &time );
83  fatal_directive_status(
84    status,
85    RTEMS_INVALID_CLOCK,
86    "rtems_clock_set with invalid month"
87  );
88  puts( " - RTEMS_INVALID_CLOCK" );
89
90  build_time( &time, 2, 32, 1988, 8, 30, 45, 0 );
91  print_time( "TA1 - rtems_clock_set - ", &time, "" );
92  status = rtems_clock_set( &time );
93  fatal_directive_status(
94    status,
95    RTEMS_INVALID_CLOCK,
96    "rtems_clock_set with invalid day"
97  );
98  puts( " - RTEMS_INVALID_CLOCK" );
99
100  build_time( &time, 2, 5, 1988, 25, 30, 45, 0 );
101  print_time( "TA1 - rtems_clock_set - ", &time, "" );
102  status = rtems_clock_set( &time );
103  fatal_directive_status(
104    status,
105    RTEMS_INVALID_CLOCK,
106    "rtems_clock_set with invalid hour"
107  );
108  puts( " - RTEMS_INVALID_CLOCK" );
109
110  build_time( &time, 2, 5, 1988, 8, 61, 45, 0 );
111  print_time( "TA1 - rtems_clock_set - ", &time, "" );
112  status = rtems_clock_set( &time );
113  fatal_directive_status(
114    status,
115    RTEMS_INVALID_CLOCK,
116    "rtems_clock_set with invalid minute"
117  );
118  puts( " - RTEMS_INVALID_CLOCK" );
119
120  build_time( &time, 2, 5, 1988, 8, 30, 61, 0 );
121  print_time( "TA1 - rtems_clock_set - ", &time, "" );
122  status = rtems_clock_set( &time );
123  fatal_directive_status(
124    status,
125    RTEMS_INVALID_CLOCK,
126    "rtems_clock_set with invalid second"
127  );
128  puts( " - RTEMS_INVALID_CLOCK" );
129
130  build_time( &time, 2, 5, 1988, 8, 30, 45, TICKS_PER_SECOND + 1 );
131  print_time( "TA1 - rtems_clock_set - ", &time, "" );
132  status = rtems_clock_set( &time );
133  fatal_directive_status(
134    status,
135    RTEMS_INVALID_CLOCK,
136    "rtems_clock_set with invalid ticks per second"
137  );
138  puts( " - RTEMS_INVALID_CLOCK" );
139
140  build_time( &time, 2, 5, 1988, 8, 30, 45, 0 );
141  print_time( "TA1 - rtems_clock_set - ", &time, "" );
142  status = rtems_clock_set( &time );
143  directive_failed( status, "rtems_clock_set successful" );
144  puts( " - RTEMS_SUCCESSFUL" );
145
146/* rtems_task_wake_when */
147
148  build_time( &time, 2, 5, 1988, 8, 30, 48, TICKS_PER_SECOND + 1 );
149  time.second += 3;
150  puts( "TA1 - rtems_task_wake_when - TICKINVALID - sleep about 3 seconds" );
151
152  status = rtems_task_wake_when( &time );
153  directive_failed(
154    status,
155    "rtems_task_wake_when with invalid ticks per second"
156  );
157  puts( "TA1 - rtems_task_wake_when - TICKINVALID - woke up RTEMS_SUCCESSFUL" );
158
159  build_time( &time, 2, 5, 1961, 8, 30, 48, 0 );
160  print_time( "TA1 - rtems_task_wake_when - ", &time, "" );
161  status = rtems_task_wake_when( &time );
162  fatal_directive_status(
163    status,
164    RTEMS_INVALID_CLOCK,
165    "rtems_task_wake_when with invalid year"
166  );
167  puts( " - RTEMS_INVALID_CLOCK" );
168
169  build_time( &time, 2, 5, 1988, 25, 30, 48, 0 );
170  print_time( "TA1 - rtems_task_wake_when - ", &time, "" );
171  status = rtems_task_wake_when( &time );
172  fatal_directive_status(
173    status,
174    RTEMS_INVALID_CLOCK,
175    "rtems_task_wake_when with invalid hour"
176  );
177  puts( " - RTEMS_INVALID_CLOCK" );
178
179  rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
180  print_time( "TA1 - current time - ", &time, "\n" );
181
182  time.month = 1;
183  print_time( "TA1 - rtems_task_wake_when - ", &time, "" );
184  status = rtems_task_wake_when( &time );
185  fatal_directive_status(
186    status,
187    RTEMS_INVALID_CLOCK,
188    "rtems_task_wake_when before current time"
189  );
190  puts( " - RTEMS_INVALID_CLOCK" );
191}
Note: See TracBrowser for help on using the repository browser.