@@ -17,7 +17,7 @@ using config_b = interrupt::root<
17
17
interrupt::irq<17_irq, 42 , interrupt::policies<>, flow_1, flow_2>>;
18
18
} // namespace
19
19
20
- TEST_CASE (" init enables interrupts" , " [flow ]" ) {
20
+ TEST_CASE (" init enables interrupts" , " [manager ]" ) {
21
21
auto m = interrupt::manager<config_a, test_nexus>{};
22
22
inited = false ;
23
23
enabled<17_irq> = false ;
@@ -30,7 +30,7 @@ TEST_CASE("init enables interrupts", "[flow]") {
30
30
CHECK (priority<17_irq> == 42 );
31
31
}
32
32
33
- TEST_CASE (" run single flow" , " [flow ]" ) {
33
+ TEST_CASE (" run single flow" , " [manager ]" ) {
34
34
auto m = interrupt::manager<config_a, test_nexus>{};
35
35
flow_run<flow_1> = false ;
36
36
@@ -39,7 +39,7 @@ TEST_CASE("run single flow", "[flow]") {
39
39
CHECK (flow_run<flow_1>);
40
40
}
41
41
42
- TEST_CASE (" run multiple flows" , " [flow ]" ) {
42
+ TEST_CASE (" run multiple flows" , " [manager ]" ) {
43
43
auto m = interrupt::manager<config_b, test_nexus>{};
44
44
flow_run<flow_1> = false ;
45
45
flow_run<flow_2> = false ;
@@ -58,7 +58,7 @@ struct alt_nexus {
58
58
};
59
59
} // namespace
60
60
61
- TEST_CASE (" run flow across multiple nexi" , " [flow ]" ) {
61
+ TEST_CASE (" run flow across multiple nexi" , " [manager ]" ) {
62
62
auto m = interrupt::manager<config_a, test_nexus, alt_nexus>{};
63
63
flow_run<flow_1> = false ;
64
64
flow_run<alt_flow<flow_1>> = false ;
@@ -93,7 +93,7 @@ using config_shared =
93
93
interrupt::irq<38_irq, 39 , interrupt::policies<>, flow_38>>;
94
94
} // namespace
95
95
96
- TEST_CASE (" init enables mcu interrupts" , " [flow ]" ) {
96
+ TEST_CASE (" init enables mcu interrupts" , " [manager ]" ) {
97
97
auto m = interrupt::manager<config_shared, test_nexus>{};
98
98
inited = false ;
99
99
enabled<33_irq> = false ;
@@ -111,7 +111,7 @@ TEST_CASE("init enables mcu interrupts", "[flow]") {
111
111
CHECK (priority<38_irq> == 39 );
112
112
}
113
113
114
- TEST_CASE (" init enables dynamic interrupts" , " [flow ]" ) {
114
+ TEST_CASE (" init enables dynamic interrupts" , " [manager ]" ) {
115
115
auto m = interrupt::manager<config_shared, test_nexus>{};
116
116
enable_field_t <33'1 >::value = false ;
117
117
enable_field_t <33'2 >::value = false ;
@@ -122,7 +122,7 @@ TEST_CASE("init enables dynamic interrupts", "[flow]") {
122
122
CHECK (enable_field_t <33'2 >::value);
123
123
}
124
124
125
- TEST_CASE (" run flows if sub_irq is enabled" , " [flow ]" ) {
125
+ TEST_CASE (" run flows if sub_irq is enabled" , " [manager ]" ) {
126
126
auto m = interrupt::manager<config_shared, test_nexus>{};
127
127
enable_field_t <33'1 >::value = true ;
128
128
status_field_t <33'1 >::value = true ;
@@ -137,7 +137,7 @@ TEST_CASE("run flows if sub_irq is enabled", "[flow]") {
137
137
CHECK (not flow_run<flow_33_2>);
138
138
}
139
139
140
- TEST_CASE (" init enables mcu interrupt if any flow is active" , " [flow ]" ) {
140
+ TEST_CASE (" init enables mcu interrupt if any flow is active" , " [manager ]" ) {
141
141
using config_t = root<interrupt::shared_irq<
142
142
33_irq, 34 , interrupt::policies<>,
143
143
interrupt::sub_irq<enable_field_t <33'0 >, status_field_t <33'0 >,
@@ -158,7 +158,7 @@ TEST_CASE("init enables mcu interrupt if any flow is active", "[flow]") {
158
158
}
159
159
160
160
TEST_CASE (" init does not enable mcu interrupt if all flows are inactive" ,
161
- " [flow ]" ) {
161
+ " [manager ]" ) {
162
162
using config_t = root<interrupt::shared_irq<
163
163
33_irq, 34 , interrupt::policies<>,
164
164
interrupt::sub_irq<enable_field_t <33'0 >, status_field_t <33'0 >,
@@ -191,7 +191,7 @@ using config_shared_sub = root<interrupt::shared_irq<
191
191
interrupt::policies<>, flow_33_2_2>>>>;
192
192
} // namespace
193
193
194
- TEST_CASE (" run flows for shared sub irqs if enabled" , " [flow ]" ) {
194
+ TEST_CASE (" run flows for shared sub irqs if enabled" , " [manager ]" ) {
195
195
auto m = interrupt::manager<config_shared_sub, test_nexus>{};
196
196
enable_field_t <33'1 >::value = false ;
197
197
@@ -213,3 +213,49 @@ TEST_CASE("run flows for shared sub irqs if enabled", "[flow]") {
213
213
CHECK (flow_run<flow_33_2_1>);
214
214
CHECK (not flow_run<flow_33_2_2>);
215
215
}
216
+
217
+ namespace {
218
+ using config_shared_no_enable = root<interrupt::shared_irq<
219
+ 33_irq, 34 , interrupt::policies<>,
220
+ interrupt::sub_irq<interrupt::enable_t <>, status_field_t <33'1 >,
221
+ interrupt::policies<>, flow_33_1>>>;
222
+ using config_shared_no_status = root<interrupt::shared_irq<
223
+ 33_irq, 34 , interrupt::policies<>,
224
+ interrupt::sub_irq<enable_field_t <33'1 >, interrupt::status_t <>,
225
+ interrupt::policies<>, flow_33_1>>>;
226
+ } // namespace
227
+
228
+ TEST_CASE (" run flows with no enable field" , " [manager]" ) {
229
+ auto m = interrupt::manager<config_shared_no_enable, test_nexus>{};
230
+ status_field_t <33'1 >::value = true ;
231
+ flow_run<flow_33_1> = false ;
232
+
233
+ m.run <33_irq>();
234
+
235
+ CHECK (not status_field_t <33'2'1 >::value);
236
+ CHECK (flow_run<flow_33_1>);
237
+ }
238
+
239
+ TEST_CASE (" run flows with no status field" , " [manager]" ) {
240
+ auto m = interrupt::manager<config_shared_no_status, test_nexus>{};
241
+ enable_field_t <33'1 >::value = true ;
242
+ flow_run<flow_33_1> = false ;
243
+
244
+ m.run <33_irq>();
245
+
246
+ CHECK (flow_run<flow_33_1>);
247
+ }
248
+
249
+ namespace {
250
+ using config_shared_id = root<interrupt::shared_irq<
251
+ 33_irq, 34 , interrupt::policies<>,
252
+ interrupt::id_irq<enable_field_t <33'0 >, interrupt::policies<>>>>;
253
+ } // namespace
254
+
255
+ TEST_CASE (" init enables id interrupts" , " [manager]" ) {
256
+ auto m = interrupt::manager<config_shared_id, test_nexus>{};
257
+
258
+ enable_field_t <33'0 >::value = false ;
259
+ m.init ();
260
+ CHECK (enable_field_t <33'0 >::value);
261
+ }
0 commit comments