source: rtems/testsuites/sptests/sp09/screen04.c @ b1274bd9

4.104.115
Last change on this file since b1274bd9 was b1274bd9, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/30/09 at 03:33:25

Whitespace removal.

  • Property mode set to 100644
File size: 2.6 KB
Line 
1/*  Screen4
2 *
3 *  This routine generates error screen 4 for test 9.
4 *
5 *  Input parameters:  NONE
6 *
7 *  Output parameters:  NONE
8 *
9 *  COPYRIGHT (c) 1989-2009.
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 Screen4()
22{
23  rtems_event_set   event_out;
24  rtems_time_of_day time;
25  struct timeval    tv;
26  time_t            seconds;
27  rtems_status_code status;
28
29  status = rtems_event_receive(
30    RTEMS_EVENT_16,
31    RTEMS_NO_WAIT,
32    RTEMS_NO_TIMEOUT,
33    NULL
34  );
35  fatal_directive_status(
36    status,
37    RTEMS_INVALID_ADDRESS,
38    "rtems_event_receive NULL param"
39  );
40  puts( "TA1 - rtems_event_receive - NULL param - RTEMS_INVALID_ADDRESS" );
41
42  status = rtems_event_receive(
43    RTEMS_EVENT_16,
44    RTEMS_NO_WAIT,
45    RTEMS_NO_TIMEOUT,
46    &event_out
47  );
48  fatal_directive_status(
49    status,
50    RTEMS_UNSATISFIED,
51    "rtems_event_receive unsatisfied (ALL)"
52  );
53  puts( "TA1 - rtems_event_receive - RTEMS_UNSATISFIED ( all conditions )" );
54
55  status = rtems_event_receive(
56    RTEMS_EVENT_16,
57    RTEMS_EVENT_ANY | RTEMS_NO_WAIT,
58    RTEMS_NO_TIMEOUT,
59    &event_out
60  );
61  fatal_directive_status(
62    status,
63    RTEMS_UNSATISFIED,
64    "rtems_event_receive unsatisfied (ANY)"
65  );
66  puts( "TA1 - rtems_event_receive - RTEMS_UNSATISFIED ( any condition )" );
67
68  puts( "TA1 - rtems_event_receive - timeout in 3 seconds" );
69  status = rtems_event_receive(
70    RTEMS_EVENT_16,
71    RTEMS_DEFAULT_OPTIONS,
72    3 * rtems_clock_get_ticks_per_second(),
73    &event_out
74  );
75  fatal_directive_status(
76    status,
77    RTEMS_TIMEOUT,
78    "rtems_event_receive"
79  );
80  puts( "TA1 - rtems_event_receive - woke up with RTEMS_TIMEOUT" );
81
82  status = rtems_event_send( 100, RTEMS_EVENT_16 );
83  fatal_directive_status(
84    status,
85    RTEMS_INVALID_ID,
86    "rtems_event_send with illegal id"
87  );
88  puts( "TA1 - rtems_event_send - RTEMS_INVALID_ID" );
89
90  puts( "TA1 - rtems_task_wake_after - sleep 1 second - RTEMS_SUCCESSFUL" );
91  status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
92  directive_failed( status, "rtems_task_wake_after" );
93
94  build_time( &time, 2, 5, 1988, 8, 30, 45, 0 );
95  print_time( "TA1 - rtems_clock_set - ", &time, "" );
96  status = rtems_clock_set( &time );
97  directive_failed( status, "rtems_clock_set" );
98  puts( " - RTEMS_SUCCESSFUL" );
99
100  status = rtems_clock_get_tod_timeval( &tv );
101  directive_failed( status, "clock_get_tod_timeval OK" );
102
103  seconds = tv.tv_sec;
104  printf( "TA1 - current time - %s\n", ctime(&seconds) );
105
106}
Note: See TracBrowser for help on using the repository browser.