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

4.104.115
Last change on this file since d5ae827 was 9c691ef, checked in by Joel Sherrill <joel.sherrill@…>, on 12/13/07 at 21:45:23

2007-12-13 Joel Sherrill <joel.sherrill@…>

  • sp07/init.c, sp07/sp07.scn, sp07/task1.c: Add tests for using notepad with the current task's ID or SELF
  • sp09/screen02.c, sp09/screen04.c, sp09/sp09.scn: Add test missing test cases for clock_get.
  • Property mode set to 100644
File size: 2.3 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-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 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    &event_out
34  );
35  fatal_directive_status(
36    status,
37    RTEMS_UNSATISFIED,
38    "rtems_event_receive unsatisfied (ALL)"
39  );
40  puts( "TA1 - rtems_event_receive - RTEMS_UNSATISFIED ( all conditions )" );
41
42  status = rtems_event_receive(
43    RTEMS_EVENT_16,
44    RTEMS_EVENT_ANY | 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 (ANY)"
52  );
53  puts( "TA1 - rtems_event_receive - RTEMS_UNSATISFIED ( any condition )" );
54
55  puts( "TA1 - rtems_event_receive - timeout in 3 seconds" );
56  status = rtems_event_receive(
57    RTEMS_EVENT_16,
58    RTEMS_DEFAULT_OPTIONS,
59    3 * TICKS_PER_SECOND,
60    &event_out
61  );
62  fatal_directive_status(
63    status,
64    RTEMS_TIMEOUT,
65    "rtems_event_receive"
66  );
67  puts( "TA1 - rtems_event_receive - woke up with RTEMS_TIMEOUT" );
68
69  status = rtems_event_send( 100, RTEMS_EVENT_16 );
70  fatal_directive_status(
71    status,
72    RTEMS_INVALID_ID,
73    "rtems_event_send with illegal id"
74  );
75  puts( "TA1 - rtems_event_send - RTEMS_INVALID_ID" );
76
77  puts( "TA1 - rtems_task_wake_after - sleep 1 second - RTEMS_SUCCESSFUL" );
78  status = rtems_task_wake_after( TICKS_PER_SECOND );
79  directive_failed( status, "rtems_task_wake_after" );
80
81  build_time( &time, 2, 5, 1988, 8, 30, 45, 0 );
82  print_time( "TA1 - rtems_clock_set - ", &time, "" );
83  status = rtems_clock_set( &time );
84  directive_failed( status, "rtems_clock_set" );
85  puts( " - RTEMS_SUCCESSFUL" );
86
87  status = rtems_clock_get( RTEMS_CLOCK_GET_TIME_VALUE, &tv );
88  directive_failed( status, "clock_get time value OK" );
89
90  seconds = tv.tv_sec;
91  printf( "TA1 - current time - %s\n", ctime(&seconds) );
92
93}
Note: See TracBrowser for help on using the repository browser.