OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [tests/] [sptests/] [sp09/] [screen14.c] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  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-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.OARcorp.com/rtems/license.html.
15
 *
16
 *  $Id: screen14.c,v 1.2 2001-09-27 12:02:31 chris Exp $
17
 */
18
 
19
#include "system.h"
20
 
21
void Screen14()
22
{
23
  rtems_status_code  status;
24
  rtems_time_of_day  time;
25
 
26
  status = rtems_timer_create( 0, &Junk_id );
27
  fatal_directive_status(
28
    status,
29
    RTEMS_INVALID_NAME,
30
    "rtems_timer_create with illegal name"
31
  );
32
  puts( "TA1 - rtems_timer_create - RTEMS_INVALID_NAME" );
33
 
34
  status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] );
35
  directive_failed( status, "rtems_timer_create" );
36
  puts( "TA1 - rtems_timer_create - 1 - RTEMS_SUCCESSFUL" );
37
 
38
  status = rtems_timer_create( 2, &Junk_id );
39
  fatal_directive_status(
40
    status,
41
    RTEMS_TOO_MANY,
42
    "rtems_timer_create for too many"
43
  );
44
  puts( "TA1 - rtems_timer_create - 2 - RTEMS_TOO_MANY" );
45
 
46
  status = rtems_timer_delete( 100 );
47
  fatal_directive_status(
48
    status,
49
    RTEMS_INVALID_ID,
50
    "rtems_timer_delete with illegal id"
51
  );
52
  puts( "TA1 - rtems_timer_delete - local RTEMS_INVALID_ID" );
53
 
54
  status = rtems_timer_delete( 0x010100 );
55
  fatal_directive_status(
56
    status,
57
    RTEMS_INVALID_ID,
58
    "rtems_timer_delete with illegal id"
59
  );
60
  puts( "TA1 - rtems_timer_delete - global RTEMS_INVALID_ID" );
61
 
62
  status = rtems_timer_ident( 0, &Junk_id );
63
  fatal_directive_status(
64
    status,
65
    RTEMS_INVALID_NAME,
66
    "rtems_timer_ident with illegal name"
67
  );
68
  puts( "TA1 - rtems_timer_ident - RTEMS_INVALID_NAME" );
69
 
70
  status = rtems_timer_cancel( 0x010100 );
71
  fatal_directive_status(
72
    status,
73
    RTEMS_INVALID_ID,
74
    "rtems_timer_cancel with illegal id"
75
  );
76
  puts( "TA1 - rtems_timer_cancel - RTEMS_INVALID_ID" );
77
 
78
  status = rtems_timer_reset( 0x010100 );
79
  fatal_directive_status(
80
    status,
81
    RTEMS_INVALID_ID,
82
    "rtems_timer_reset with illegal id"
83
  );
84
  puts( "TA1 - rtems_timer_reset - RTEMS_INVALID_ID" );
85
 
86
  status = rtems_timer_reset( Timer_id[ 1 ] );
87
  fatal_directive_status(
88
    status,
89
    RTEMS_NOT_DEFINED,
90
    "rtems_timer_reset before initiated"
91
  );
92
  puts( "TA1 - rtems_timer_reset - RTEMS_NOT_DEFINED" );
93
 
94
  status = rtems_timer_fire_after(
95
    0x010100,
96
    5 * TICKS_PER_SECOND,
97
    Delayed_routine,
98
    NULL
99
  );
100
  fatal_directive_status(
101
    status,
102
    RTEMS_INVALID_ID,
103
    "rtems_timer_fire_after illegal id"
104
  );
105
  puts( "TA1 - rtems_timer_fire_after - RTEMS_INVALID_ID" );
106
 
107
  build_time( &time, 12, 31, 1994, 9, 0, 0, 0 );
108
  status = rtems_timer_fire_when( 0x010100, &time, Delayed_routine, NULL );
109
  fatal_directive_status(
110
    status,
111
    RTEMS_INVALID_ID,
112
    "rtems_timer_fire_when with illegal id"
113
  );
114
  puts( "TA1 - rtems_timer_fire_when - RTEMS_INVALID_ID" );
115
 
116
  status = rtems_timer_fire_after( Timer_id[ 1 ], 0, Delayed_routine, NULL );
117
  fatal_directive_status(
118
    status,
119
    RTEMS_INVALID_NUMBER,
120
    "rtems_timer_fire_after with 0 ticks"
121
  );
122
  puts( "TA1 - rtems_timer_fire_after - RTEMS_INVALID_NUMBER" );
123
 
124
  build_time( &time, 2, 5, 1987, 8, 30, 45, 0 );
125
  status = rtems_timer_fire_when( Timer_id[ 1 ], &time, Delayed_routine, NULL );
126
  fatal_directive_status(
127
    status,
128
    RTEMS_INVALID_CLOCK,
129
    "rtems_timer_fire_when with illegal time"
130
  );
131
  print_time(
132
    "TA1 - rtems_timer_fire_when - ",
133
    &time,
134
    " - RTEMS_INVALID_CLOCK\n"
135
  );
136
 
137
  status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
138
  directive_failed( status, "rtems_clock_set" );
139
  print_time( "TA1 - rtems_clock_get       - ", &time, "\n" );
140
 
141
  build_time( &time, 2, 5, 1990, 8, 30, 45, 0 );
142
  status = rtems_timer_fire_when( Timer_id[ 1 ], &time, Delayed_routine, NULL );
143
  fatal_directive_status(
144
    status,
145
    RTEMS_INVALID_CLOCK,
146
    "rtems_timer_fire_when before current time"
147
  );
148
  print_time(
149
    "TA1 - rtems_timer_fire_when - ",
150
    &time,
151
    " - before RTEMS_INVALID_CLOCK\n"
152
  );
153
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.