RTEMS
tc-events.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-2-Clause */
2 
9 /*
10  * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  * notice, this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright
18  * notice, this list of conditions and the following disclaimer in the
19  * documentation and/or other materials provided with the distribution.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 /*
35  * Do not manually edit this file. It is part of the RTEMS quality process
36  * and was automatically generated.
37  *
38  * If you find something that needs to be fixed or worded better please
39  * post a report to an RTEMS mailing list or raise a bug report:
40  *
41  * https://docs.rtems.org/branches/master/user/support/bugs.html
42  *
43  * For information on updating and regenerating please refer to:
44  *
45  * https://docs.rtems.org/branches/master/eng/req/howto.html
46  */
47 
48 #ifdef HAVE_CONFIG_H
49 #include "config.h"
50 #endif
51 
52 #include <rtems.h>
53 
54 #include "tr-event-constant.h"
55 
56 #include <rtems/test.h>
57 
82 static const rtems_event_set events[] = {
115 };
116 
120 T_TEST_CASE( RtemsEventReqEvents )
121 {
122  rtems_event_set all;
123  int i;
124 
125  T_plan(36);
126 
127  for ( i = 0; i < 32; ++i ) {
128  RtemsEventReqEventConstant_Run( events[ i ], i );
129  T_step( (unsigned int) i ); /* Accounts for 32 test plan steps */
130  }
131 
132  all = 0;
133 
134  for ( i = 0; i < 32; ++i ) {
135  all |= events[ i ];
136  }
137  T_step_eq_u32( 32, all, RTEMS_ALL_EVENTS );
138 
139  /* No action */
140  T_step_eq_u32( 33, RTEMS_EVENT_ALL, 0 );
141  T_step_ne_u32( 34, RTEMS_EVENT_ANY, 0 );
142  T_step_eq_u32( 35, RTEMS_EVENT_ANY & ( RTEMS_EVENT_ANY - 1), 0 );
143 }
144 
#define RTEMS_EVENT_1
This constant defines the bit in the event set associated with event 1.
Definition: event.h:227
#define RTEMS_EVENT_0
This constant defines the bit in the event set associated with event 0.
Definition: event.h:217
#define RTEMS_EVENT_4
This constant defines the bit in the event set associated with event 4.
Definition: event.h:417
#define RTEMS_EVENT_9
This constant defines the bit in the event set associated with event 9.
Definition: event.h:467
#define RTEMS_EVENT_7
This constant defines the bit in the event set associated with event 7.
Definition: event.h:447
#define RTEMS_EVENT_25
This constant defines the bit in the event set associated with event 25.
Definition: event.h:124
#define RTEMS_EVENT_11
This constant defines the bit in the event set associated with event 11.
Definition: event.h:247
#define RTEMS_EVENT_22
This constant defines the bit in the event set associated with event 22.
Definition: event.h:367
#define RTEMS_EVENT_5
This constant defines the bit in the event set associated with event 5.
Definition: event.h:427
#define RTEMS_EVENT_28
This constant defines the bit in the event set associated with event 28.
Definition: event.h:397
#define RTEMS_EVENT_29
This constant defines the bit in the event set associated with event 29.
Definition: event.h:144
#define RTEMS_ALL_EVENTS
This constant contains all events in an event set.
Definition: event.h:207
#define RTEMS_EVENT_23
This constant defines the bit in the event set associated with event 23.
Definition: event.h:377
#define RTEMS_EVENT_13
This constant defines the bit in the event set associated with event 13.
Definition: event.h:267
#define RTEMS_EVENT_10
This constant defines the bit in the event set associated with event 10.
Definition: event.h:237
#define RTEMS_EVENT_20
This constant defines the bit in the event set associated with event 20.
Definition: event.h:347
#define RTEMS_EVENT_12
This constant defines the bit in the event set associated with event 12.
Definition: event.h:257
#define RTEMS_EVENT_8
This constant defines the bit in the event set associated with event 8.
Definition: event.h:457
#define RTEMS_EVENT_6
This constant defines the bit in the event set associated with event 6.
Definition: event.h:437
#define RTEMS_EVENT_16
This constant defines the bit in the event set associated with event 16.
Definition: event.h:297
#define RTEMS_EVENT_15
This constant defines the bit in the event set associated with event 15.
Definition: event.h:287
#define RTEMS_EVENT_27
This constant defines the bit in the event set associated with event 27.
Definition: event.h:387
#define RTEMS_EVENT_18
This constant defines the bit in the event set associated with event 18.
Definition: event.h:317
void RtemsEventReqEventConstant_Run(rtems_event_set event, int number)
Runs the parameterized test case.
#define RTEMS_EVENT_ANY
This option constant indicates that the task wishes to wait until at least one of the events of inter...
Definition: options.h:99
#define RTEMS_EVENT_3
This constant defines the bit in the event set associated with event 3.
Definition: event.h:407
This header file defines the RTEMS Classic API.
#define RTEMS_EVENT_21
This constant defines the bit in the event set associated with event 21.
Definition: event.h:357
#define RTEMS_EVENT_30
This constant defines the bit in the event set associated with event 30.
Definition: event.h:134
#define RTEMS_EVENT_19
This constant defines the bit in the event set associated with event 19.
Definition: event.h:327
#define RTEMS_EVENT_26
This constant defines the bit in the event set associated with event 26.
Definition: event.h:104
#define RTEMS_EVENT_24
This constant defines the bit in the event set associated with event 24.
Definition: event.h:114
#define RTEMS_EVENT_17
This constant defines the bit in the event set associated with event 17.
Definition: event.h:307
#define RTEMS_EVENT_14
This constant defines the bit in the event set associated with event 14.
Definition: event.h:277
uint32_t rtems_event_set
This integer type can hold an event set of up to 32 events represented as a bit field.
Definition: event.h:94
#define RTEMS_EVENT_31
This constant defines the bit in the event set associated with event 31.
Definition: event.h:84
#define RTEMS_EVENT_2
This constant defines the bit in the event set associated with event 2.
Definition: event.h:337
#define RTEMS_EVENT_ALL
This option constant indicates that the task wishes to wait until all events of interest are availabl...
Definition: options.h:89