File indexing completed on 2025-05-11 08:24:53
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051 #ifdef HAVE_CONFIG_H
0052 #include "config.h"
0053 #endif
0054
0055 #include <rtems.h>
0056
0057 #include "tr-event-constant.h"
0058
0059 #include <rtems/test.h>
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177
0178
0179
0180
0181 typedef struct {
0182
0183
0184
0185
0186 rtems_event_set event;
0187
0188
0189
0190
0191
0192 int number;
0193 } RtemsEventValEventConstant_Context;
0194
0195 static RtemsEventValEventConstant_Context
0196 RtemsEventValEventConstant_Instance;
0197
0198 static T_fixture RtemsEventValEventConstant_Fixture = {
0199 .setup = NULL,
0200 .stop = NULL,
0201 .teardown = NULL,
0202 .scope = NULL,
0203 .initial_context = &RtemsEventValEventConstant_Instance
0204 };
0205
0206
0207
0208
0209 static void RtemsEventValEventConstant_Action_0(
0210 RtemsEventValEventConstant_Context *ctx
0211 )
0212 {
0213
0214
0215
0216
0217
0218
0219 T_step_eq_u32(
0220 0,
0221 ctx->event,
0222 ( (rtems_event_set) 1 ) << ctx->number
0223 );
0224
0225
0226
0227
0228
0229 T_step_eq_u32( 1, ctx->event & RTEMS_PENDING_EVENTS, 0 );
0230 }
0231
0232
0233
0234
0235
0236 static void RtemsEventValEventConstant_Action_1(
0237 RtemsEventValEventConstant_Context *ctx
0238 )
0239 {
0240 rtems_status_code sc;
0241 rtems_event_set out;
0242
0243 out = RTEMS_ALL_EVENTS;
0244 sc = rtems_event_receive(
0245 RTEMS_PENDING_EVENTS,
0246 RTEMS_DEFAULT_OPTIONS,
0247 0,
0248 &out
0249 );
0250
0251
0252
0253
0254 T_step_rsc_success( 2, sc );
0255
0256
0257
0258
0259 T_step_eq_u32( 3, out, 0 );
0260 }
0261
0262
0263
0264
0265 static void RtemsEventValEventConstant_Action_2(
0266 RtemsEventValEventConstant_Context *ctx
0267 )
0268 {
0269 rtems_status_code sc;
0270 rtems_event_set out;
0271
0272 out = RTEMS_ALL_EVENTS;
0273 sc = rtems_event_system_receive(
0274 RTEMS_PENDING_EVENTS,
0275 RTEMS_DEFAULT_OPTIONS,
0276 0,
0277 &out
0278 );
0279
0280
0281
0282
0283 T_step_rsc_success( 4, sc );
0284
0285
0286
0287
0288 T_step_eq_u32( 5, out, 0 );
0289 }
0290
0291
0292
0293
0294
0295 static void RtemsEventValEventConstant_Action_3(
0296 RtemsEventValEventConstant_Context *ctx
0297 )
0298 {
0299 rtems_status_code sc;
0300 rtems_event_set out;
0301
0302 out = RTEMS_ALL_EVENTS;
0303 sc = rtems_event_receive(
0304 RTEMS_ALL_EVENTS,
0305 RTEMS_NO_WAIT | RTEMS_EVENT_ANY,
0306 0,
0307 &out
0308 );
0309
0310
0311
0312
0313 T_step_rsc( 6, sc, RTEMS_UNSATISFIED );
0314
0315
0316
0317
0318 T_step_eq_u32( 7, out, 0 );
0319 }
0320
0321
0322
0323
0324
0325 static void RtemsEventValEventConstant_Action_4(
0326 RtemsEventValEventConstant_Context *ctx
0327 )
0328 {
0329 rtems_status_code sc;
0330 rtems_event_set out;
0331
0332 out = RTEMS_ALL_EVENTS;
0333 sc = rtems_event_system_receive(
0334 RTEMS_ALL_EVENTS,
0335 RTEMS_NO_WAIT | RTEMS_EVENT_ANY,
0336 0,
0337 &out
0338 );
0339
0340
0341
0342
0343 T_step_rsc( 8, sc, RTEMS_UNSATISFIED );
0344
0345
0346
0347
0348 T_step_eq_u32( 9, out, 0 );
0349 }
0350
0351
0352
0353
0354 static void RtemsEventValEventConstant_Action_5(
0355 RtemsEventValEventConstant_Context *ctx
0356 )
0357 {
0358 rtems_status_code sc;
0359
0360 sc = rtems_event_send( RTEMS_SELF, ctx->event );
0361
0362
0363
0364
0365 T_step_rsc_success( 10, sc );
0366 }
0367
0368
0369
0370
0371
0372 static void RtemsEventValEventConstant_Action_6(
0373 RtemsEventValEventConstant_Context *ctx
0374 )
0375 {
0376 rtems_status_code sc;
0377 rtems_event_set out;
0378
0379 out = RTEMS_ALL_EVENTS;
0380 sc = rtems_event_receive(
0381 RTEMS_PENDING_EVENTS,
0382 RTEMS_DEFAULT_OPTIONS,
0383 0,
0384 &out
0385 );
0386
0387
0388
0389
0390 T_step_rsc_success( 11, sc );
0391
0392
0393
0394
0395
0396 T_step_eq_u32( 12, out, ctx->event );
0397 }
0398
0399
0400
0401
0402 static void RtemsEventValEventConstant_Action_7(
0403 RtemsEventValEventConstant_Context *ctx
0404 )
0405 {
0406 rtems_status_code sc;
0407 rtems_event_set out;
0408
0409 out = RTEMS_ALL_EVENTS;
0410 sc = rtems_event_system_receive(
0411 RTEMS_PENDING_EVENTS,
0412 RTEMS_DEFAULT_OPTIONS,
0413 0,
0414 &out
0415 );
0416
0417
0418
0419
0420 T_step_rsc_success( 13, sc );
0421
0422
0423
0424
0425 T_step_eq_u32( 14, out, 0 );
0426 }
0427
0428
0429
0430
0431 static void RtemsEventValEventConstant_Action_8(
0432 RtemsEventValEventConstant_Context *ctx
0433 )
0434 {
0435 rtems_status_code sc;
0436 rtems_event_set out;
0437
0438 out = 0;
0439 sc = rtems_event_receive(
0440 RTEMS_ALL_EVENTS,
0441 RTEMS_NO_WAIT | RTEMS_EVENT_ANY,
0442 0,
0443 &out
0444 );
0445
0446
0447
0448
0449 T_step_rsc_success( 15, sc );
0450
0451
0452
0453
0454
0455 T_step_eq_u32( 16, out, ctx->event );
0456 }
0457
0458
0459
0460
0461 static void RtemsEventValEventConstant_Action_9(
0462 RtemsEventValEventConstant_Context *ctx
0463 )
0464 {
0465 rtems_status_code sc;
0466 rtems_event_set out;
0467
0468 out = RTEMS_ALL_EVENTS;
0469 sc = rtems_event_system_receive(
0470 RTEMS_ALL_EVENTS,
0471 RTEMS_NO_WAIT | RTEMS_EVENT_ANY,
0472 0,
0473 &out
0474 );
0475
0476
0477
0478
0479 T_step_rsc( 17, sc, RTEMS_UNSATISFIED );
0480
0481
0482
0483
0484 T_step_eq_u32( 18, out, 0 );
0485 }
0486
0487
0488
0489
0490 static void RtemsEventValEventConstant_Action_10(
0491 RtemsEventValEventConstant_Context *ctx
0492 )
0493 {
0494 rtems_status_code sc;
0495
0496 sc = rtems_event_system_send( RTEMS_SELF, ctx->event );
0497
0498
0499
0500
0501 T_step_rsc_success( 19, sc );
0502 }
0503
0504
0505
0506
0507
0508 static void RtemsEventValEventConstant_Action_11(
0509 RtemsEventValEventConstant_Context *ctx
0510 )
0511 {
0512 rtems_status_code sc;
0513 rtems_event_set out;
0514
0515 out = RTEMS_ALL_EVENTS;
0516 sc = rtems_event_receive(
0517 RTEMS_PENDING_EVENTS,
0518 RTEMS_DEFAULT_OPTIONS,
0519 0,
0520 &out
0521 );
0522
0523
0524
0525
0526 T_step_rsc_success( 20, sc );
0527
0528
0529
0530
0531 T_step_eq_u32( 21, out, 0 );
0532 }
0533
0534
0535
0536
0537 static void RtemsEventValEventConstant_Action_12(
0538 RtemsEventValEventConstant_Context *ctx
0539 )
0540 {
0541 rtems_status_code sc;
0542 rtems_event_set out;
0543
0544 out = RTEMS_ALL_EVENTS;
0545 sc = rtems_event_system_receive(
0546 RTEMS_PENDING_EVENTS,
0547 RTEMS_DEFAULT_OPTIONS,
0548 0,
0549 &out
0550 );
0551
0552
0553
0554
0555 T_step_rsc_success( 22, sc );
0556
0557
0558
0559
0560
0561 T_step_eq_u32( 23, out, ctx->event );
0562 }
0563
0564
0565
0566
0567 static void RtemsEventValEventConstant_Action_13(
0568 RtemsEventValEventConstant_Context *ctx
0569 )
0570 {
0571 rtems_status_code sc;
0572 rtems_event_set out;
0573
0574 out = RTEMS_ALL_EVENTS;
0575 sc = rtems_event_receive(
0576 RTEMS_ALL_EVENTS,
0577 RTEMS_NO_WAIT | RTEMS_EVENT_ANY,
0578 0,
0579 &out
0580 );
0581
0582
0583
0584
0585 T_step_rsc( 24, sc, RTEMS_UNSATISFIED );
0586
0587
0588
0589
0590 T_step_eq_u32( 25, out, 0 );
0591 }
0592
0593
0594
0595
0596 static void RtemsEventValEventConstant_Action_14(
0597 RtemsEventValEventConstant_Context *ctx
0598 )
0599 {
0600 rtems_status_code sc;
0601 rtems_event_set out;
0602
0603 out = 0;
0604 sc = rtems_event_system_receive(
0605 RTEMS_ALL_EVENTS,
0606 RTEMS_NO_WAIT | RTEMS_EVENT_ANY,
0607 0,
0608 &out
0609 );
0610
0611
0612
0613
0614 T_step_rsc_success( 26, sc );
0615
0616
0617
0618
0619
0620 T_step_eq_u32( 27, out, ctx->event );
0621 }
0622
0623
0624
0625
0626
0627 static void RtemsEventValEventConstant_Action_15(
0628 RtemsEventValEventConstant_Context *ctx
0629 )
0630 {
0631 rtems_status_code sc;
0632 rtems_event_set out;
0633
0634 out = RTEMS_ALL_EVENTS;
0635 sc = rtems_event_receive(
0636 RTEMS_PENDING_EVENTS,
0637 RTEMS_DEFAULT_OPTIONS,
0638 0,
0639 &out
0640 );
0641
0642
0643
0644
0645 T_step_rsc_success( 28, sc );
0646
0647
0648
0649
0650 T_step_eq_u32( 29, out, 0 );
0651 }
0652
0653
0654
0655
0656 static void RtemsEventValEventConstant_Action_16(
0657 RtemsEventValEventConstant_Context *ctx
0658 )
0659 {
0660 rtems_status_code sc;
0661 rtems_event_set out;
0662
0663 out = RTEMS_ALL_EVENTS;
0664 sc = rtems_event_system_receive(
0665 RTEMS_PENDING_EVENTS,
0666 RTEMS_DEFAULT_OPTIONS,
0667 0,
0668 &out
0669 );
0670
0671
0672
0673
0674 T_step_rsc_success( 30, sc );
0675
0676
0677
0678
0679 T_step_eq_u32( 31, out, 0 );
0680 }
0681
0682 static T_fixture_node RtemsEventValEventConstant_Node;
0683
0684 static T_remark RtemsEventValEventConstant_Remark = {
0685 .next = NULL,
0686 .remark = "RtemsEventValEventConstant"
0687 };
0688
0689 void RtemsEventValEventConstant_Run( rtems_event_set event, int number )
0690 {
0691 RtemsEventValEventConstant_Context *ctx;
0692
0693 ctx = &RtemsEventValEventConstant_Instance;
0694 ctx->event = event;
0695 ctx->number = number;
0696
0697 ctx = T_push_fixture(
0698 &RtemsEventValEventConstant_Node,
0699 &RtemsEventValEventConstant_Fixture
0700 );
0701
0702 T_plan( 32 );
0703
0704 RtemsEventValEventConstant_Action_0( ctx );
0705 RtemsEventValEventConstant_Action_1( ctx );
0706 RtemsEventValEventConstant_Action_2( ctx );
0707 RtemsEventValEventConstant_Action_3( ctx );
0708 RtemsEventValEventConstant_Action_4( ctx );
0709 RtemsEventValEventConstant_Action_5( ctx );
0710 RtemsEventValEventConstant_Action_6( ctx );
0711 RtemsEventValEventConstant_Action_7( ctx );
0712 RtemsEventValEventConstant_Action_8( ctx );
0713 RtemsEventValEventConstant_Action_9( ctx );
0714 RtemsEventValEventConstant_Action_10( ctx );
0715 RtemsEventValEventConstant_Action_11( ctx );
0716 RtemsEventValEventConstant_Action_12( ctx );
0717 RtemsEventValEventConstant_Action_13( ctx );
0718 RtemsEventValEventConstant_Action_14( ctx );
0719 RtemsEventValEventConstant_Action_15( ctx );
0720 RtemsEventValEventConstant_Action_16( ctx );
0721
0722 T_add_remark( &RtemsEventValEventConstant_Remark );
0723 T_pop_fixture();
0724 }
0725
0726