source: rtems/testsuites/sptests/sp09/screen09.c @ 15fa865

4.9
Last change on this file since 15fa865 was 15fa865, checked in by Joel Sherrill <joel.sherrill@…>, on 03/02/09 at 16:13:08

2009-03-02 Joel Sherrill <joel.sherrill@…>

PR 1388/cpukit

  • sp09/screen05.c, sp09/screen09.c, sp09/sp09.scn: Classic Semaphores allow both priority inherit and ceiling attributes to be set on semaphore create. These attributes are mutually exclusive and this should be an error.
  • Property mode set to 100644
File size: 4.2 KB
Line 
1/*  Screen9
2 *
3 *  This routine generates error screen 9 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 Screen9()
22{
23  void              *converted;
24  rtems_status_code status;
25  rtems_isr_entry   old_service_routine;
26
27  #if ((CPU_SIMPLE_VECTORED_INTERRUPTS == FALSE) || \
28       defined(_C3x) || defined(_C4x))
29    puts(
30      "TA1 - rtems_interrupt_catch - "
31      "bad handler RTEMS_INVALID_ADDRESS -- SKIPPED"
32    );
33    puts(
34      "TA1 - rtems_interrupt_catch - "
35      "old isr RTEMS_INVALID_ADDRESS - SKIPPED" );
36  #else
37    status = rtems_interrupt_catch(
38      Service_routine,
39      ISR_INTERRUPT_MAXIMUM_VECTOR_NUMBER + 10,
40      &old_service_routine
41    );
42    fatal_directive_status(
43      status,
44      RTEMS_INVALID_NUMBER,
45      "rtems_interrupt_catch with invalid vector"
46    );
47    puts( "TA1 - rtems_interrupt_catch - RTEMS_INVALID_NUMBER" );
48
49    status = rtems_interrupt_catch( NULL, 3, &old_service_routine );
50    fatal_directive_status(
51      status,
52      RTEMS_INVALID_ADDRESS,
53      "rtems_interrupt_catch with invalid handler"
54    );
55    puts( "TA1 - rtems_interrupt_catch - bad handler RTEMS_INVALID_ADDRESS" );
56
57    status = rtems_interrupt_catch( Service_routine, 3, NULL );
58    fatal_directive_status(
59      status,
60      RTEMS_INVALID_ADDRESS,
61      "rtems_interrupt_catch with invalid old isr pointer"
62    );
63    puts( "TA1 - rtems_interrupt_catch - old isr RTEMS_INVALID_ADDRESS" );
64  #endif
65
66  status = rtems_signal_send( 100, RTEMS_SIGNAL_1 );
67  fatal_directive_status(
68    status,
69    RTEMS_INVALID_ID,
70    "rtems_signal_send with illegal id"
71  );
72  puts( "TA1 - rtems_signal_send - RTEMS_INVALID_ID" );
73
74  status = rtems_signal_send( RTEMS_SELF, RTEMS_SIGNAL_16 );
75  fatal_directive_status(
76    status,
77    RTEMS_NOT_DEFINED,
78    "rtems_signal_send with no handler"
79  );
80  puts( "TA1 - rtems_signal_send - RTEMS_NOT_DEFINED" );
81
82  status = rtems_port_create(
83     0,
84     Internal_port_area,
85     External_port_area,
86     sizeof( Internal_port_area ),
87     &Junk_id
88  );
89  fatal_directive_status(
90    status,
91    RTEMS_INVALID_NAME,
92    "rtems_port_create with illegal name"
93  );
94  puts( "TA1 - rtems_port_create - RTEMS_INVALID_NAME" );
95
96#if defined(_C3x) || defined(_C4x)
97  puts( "TA1 - rtems_port_create - RTEMS_INVALID_ADDRESS - SKIPPED" );
98#else
99  status = rtems_port_create(
100     Port_name[ 1 ],
101     &((char *)Internal_port_area)[ 1 ],
102     External_port_area,
103     sizeof( Internal_port_area ),
104     &Junk_id
105  );
106  fatal_directive_status(
107    status,
108    RTEMS_INVALID_ADDRESS,
109    "rtems_port_create with illegal address"
110  );
111  puts( "TA1 - rtems_port_create - RTEMS_INVALID_ADDRESS" );
112#endif
113
114  status = rtems_port_create(
115     Port_name[ 1 ],
116     Internal_port_area,
117     External_port_area,
118     sizeof( Internal_port_area ),
119     &Junk_id
120  );
121  fatal_directive_status(
122    status,
123    RTEMS_TOO_MANY,
124    "rtems_port_create of too many"
125  );
126  puts( "TA1 - rtems_port_create - RTEMS_TOO_MANY" );
127
128  status = rtems_port_delete( 0 );
129  fatal_directive_status(
130    status,
131    RTEMS_INVALID_ID,
132    "rtems_port_delete with illegal id"
133  );
134  puts( "TA1 - rtems_port_delete - RTEMS_INVALID_ID" );
135
136  status = rtems_port_ident( 0, &Junk_id );
137  fatal_directive_status(
138    status,
139    RTEMS_INVALID_NAME,
140    "rtems_port_ident with illegal name"
141  );
142  puts( "TA1 - rtems_port_ident - RTEMS_INVALID_NAME" );
143
144  status = rtems_port_external_to_internal(
145    100,
146    Internal_port_area,
147    &converted
148  );
149  fatal_directive_status(
150    status,
151    RTEMS_INVALID_ID,
152    "rtems_port_external_to_internal with illegal id"
153  );
154  puts( "TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ID" );
155  status = rtems_port_internal_to_external(
156    100,
157    Internal_port_area,
158    &converted
159  );
160  fatal_directive_status(
161    status,
162    RTEMS_INVALID_ID,
163    "rtems_port_internal_to_external with illegal id"
164  );
165  puts( "TA1 - rtems_port_internal_to_external - RTEMS_INVALID_ID" );
166}
Note: See TracBrowser for help on using the repository browser.