65 #include "Mock_smTestAct.h"
67 #include "smPseudoConditionalTest.h"
68 #include "Mock_smPseudoConditionalTestAct.h"
70 #include "smPseudoTest.h"
71 #include "Mock_smPseudoTestAct.h"
73 #include "smInitialPseudoTest.h"
74 #include "Mock_smInitialPseudoTestAct.h"
76 #include "Mock_rkhassert.h"
101 typedef struct StateMachine
107 typedef struct Composite
116 static const RKH_ST_T *targetStates[16], *exitStates[16], *entryStates[16];
119 static int first = 1;
120 int GlobalExpectCount;
121 int GlobalVerifyOrder;
122 char *GlobalOrderError;
132 tzlink_open(0, NULL);
143 setUpWoutUnitrazer(
void)
150 loadStateMachineSymbols(
void)
245 setRKHTraceFilters(
void)
262 Mock_smTestAct_Init();
263 Mock_smPseudoConditionalTestAct_Init();
264 Mock_smInitialPseudoTestAct_Init();
266 loadStateMachineSymbols();
267 setRKHTraceFilters();
282 Mock_smTestAct_Verify();
283 Mock_smTestAct_Destroy();
285 Mock_smPseudoConditionalTestAct_Verify();
286 Mock_smPseudoConditionalTestAct_Destroy();
288 Mock_smInitialPseudoTestAct_Verify();
289 Mock_smInitialPseudoTestAct_Destroy();
299 test_transitionFirstStateAfterInit(
void)
304 sm_init_expect(RKH_STATE_CAST(&waiting));
305 sm_trn_expect(RKH_STATE_CAST(&waiting), RKH_STATE_CAST(&waiting));
306 sm_tsState_expect(RKH_STATE_CAST(&waiting));
307 sm_enstate_expect(RKH_STATE_CAST(&waiting));
308 sm_nenex_expect(1, 0);
309 sm_state_expect(RKH_STATE_CAST(&waiting));
314 p = unitrazer_getLastOut();
315 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
319 test_transitionSimpleToSimpleAtEqualLevel(
void)
323 stateList_create(targetStates, 1, &s1);
324 stateList_create(entryStates, 1, &s1);
325 stateList_create(exitStates, 1, &s0);
328 smTest_xS0_Expect(
RKH_CAST(SmTest, smTest));
329 smTest_tr11_Expect(
RKH_CAST(SmTest, smTest), &evA);
330 smTest_nS1_Expect(
RKH_CAST(SmTest, smTest));
332 setProfile(smTest, RKH_STATE_CAST(&waiting),
333 RKH_STATE_CAST(&s0), RKH_STATE_CAST(&s0),
335 entryStates, exitStates, RKH_STATE_CAST(&s1), 1,
336 TRN_NOT_INTERNAL, INIT_STATE_MACHINE, &evA,
337 RKH_STATE_CAST(&s0));
341 p = unitrazer_getLastOut();
342 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
346 test_transitionSimpleToSimpleFromHighToLowLevel(
void)
350 stateList_create(targetStates, 1, &s21);
351 stateList_create(entryStates, 2, &s2, &s21);
352 stateList_create(exitStates, 1, &s0);
355 smTest_xS0_Expect(
RKH_CAST(SmTest, smTest));
356 smTest_tr12_Expect(
RKH_CAST(SmTest, smTest), &evB);
357 smTest_nS2_Expect(
RKH_CAST(SmTest, smTest));
358 smTest_nS21_Expect(
RKH_CAST(SmTest, smTest));
360 setProfile(smTest, RKH_STATE_CAST(&waiting),
361 RKH_STATE_CAST(&s0), RKH_STATE_CAST(&s0),
363 entryStates, exitStates, RKH_STATE_CAST(&s21), 1,
364 TRN_NOT_INTERNAL, INIT_STATE_MACHINE, &evB,
365 RKH_STATE_CAST(&s0));
369 p = unitrazer_getLastOut();
370 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
374 test_transitionSimpleToSimpleFromLowToHighLevel(
void)
378 stateList_create(targetStates, 1, &s0);
379 stateList_create(entryStates, 1, &s0);
380 stateList_create(exitStates, 2, &s21, &s2);
383 smTest_xS21_Expect(
RKH_CAST(SmTest, smTest));
384 smTest_xS2_Expect(
RKH_CAST(SmTest, smTest));
385 smTest_tr13_Expect(
RKH_CAST(SmTest, smTest), &evB);
386 smTest_nS0_Expect(
RKH_CAST(SmTest, smTest));
388 setProfile(smTest, RKH_STATE_CAST(&waiting),
389 RKH_STATE_CAST(&s21), RKH_STATE_CAST(&s21),
391 entryStates, exitStates, RKH_STATE_CAST(&s0), 1,
392 TRN_NOT_INTERNAL, INIT_STATE_MACHINE, &evB,
393 RKH_STATE_CAST(&s21));
397 p = unitrazer_getLastOut();
398 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
402 test_transitionSimpleToCompositeAtEqualLevel(
void)
413 smTest_xS0_Expect(
RKH_CAST(SmTest, smTest));
414 smTest_tr21_Expect(
RKH_CAST(SmTest, smTest), &event);
415 smTest_nS2_Expect(
RKH_CAST(SmTest, smTest));
417 smTest_nS21_Expect(
RKH_CAST(SmTest, smTest));
419 expInitSm((
RKH_SMA_T *)smTest, RKH_STATE_CAST(&waiting));
420 sm_dch_expect(event.
e, RKH_STATE_CAST(&s0));
421 sm_trn_expect(RKH_STATE_CAST(&s0), RKH_STATE_CAST(&s2));
422 sm_tsState_expect(RKH_STATE_CAST(&s2));
423 sm_exstate_expect(RKH_STATE_CAST(&s0));
424 sm_enstate_expect(RKH_STATE_CAST(&s2));
425 sm_tsState_expect(RKH_STATE_CAST(&s21));
426 sm_enstate_expect(RKH_STATE_CAST(&s21));
427 sm_nenex_expect(nEnSt, nExSt);
428 sm_state_expect(RKH_STATE_CAST(&s21));
432 setState(smTest, RKH_STATE_CAST(&s0));
435 p = unitrazer_getLastOut();
436 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
440 test_transitionSimpleToCompositeFromHighToLowLevel(
void)
451 smTest_xS0_Expect(
RKH_CAST(SmTest, smTest));
452 smTest_tr22_Expect(
RKH_CAST(SmTest, smTest), &event);
453 smTest_nS2_Expect(
RKH_CAST(SmTest, smTest));
454 smTest_nS22_Expect(
RKH_CAST(SmTest, smTest));
456 smTest_nS221_Expect(
RKH_CAST(SmTest, smTest));
458 smTest_nS2211_Expect(
RKH_CAST(SmTest, smTest));
460 expInitSm((
RKH_SMA_T *)smTest, RKH_STATE_CAST(&waiting));
461 sm_dch_expect(event.
e, RKH_STATE_CAST(&s0));
462 sm_trn_expect(RKH_STATE_CAST(&s0), RKH_STATE_CAST(&s22));
463 sm_tsState_expect(RKH_STATE_CAST(&s22));
464 sm_exstate_expect(RKH_STATE_CAST(&s0));
465 sm_enstate_expect(RKH_STATE_CAST(&s2));
466 sm_enstate_expect(RKH_STATE_CAST(&s22));
467 sm_tsState_expect(RKH_STATE_CAST(&s221));
468 sm_enstate_expect(RKH_STATE_CAST(&s221));
469 sm_tsState_expect(RKH_STATE_CAST(&s2211));
470 sm_enstate_expect(RKH_STATE_CAST(&s2211));
471 sm_nenex_expect(nEnSt, nExSt);
472 sm_state_expect(RKH_STATE_CAST(&s2211));
476 setState(smTest, RKH_STATE_CAST(&s0));
479 p = unitrazer_getLastOut();
480 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
484 test_transitionSimpleToCompositeFromLowToHighLevel(
void)
495 smTest_xS21_Expect(
RKH_CAST(SmTest, smTest));
496 smTest_tr23_Expect(
RKH_CAST(SmTest, smTest), &event);
498 smTest_nS21_Expect(
RKH_CAST(SmTest, smTest));
500 expInitSm((
RKH_SMA_T *)smTest, RKH_STATE_CAST(&waiting));
501 sm_dch_expect(event.
e, RKH_STATE_CAST(&s21));
502 sm_trn_expect(RKH_STATE_CAST(&s21), RKH_STATE_CAST(&s2));
503 sm_tsState_expect(RKH_STATE_CAST(&s2));
504 sm_exstate_expect(RKH_STATE_CAST(&s21));
505 sm_tsState_expect(RKH_STATE_CAST(&s21));
506 sm_enstate_expect(RKH_STATE_CAST(&s21));
507 sm_nenex_expect(nEnSt, nExSt);
508 sm_state_expect(RKH_STATE_CAST(&s21));
512 setState(smTest, RKH_STATE_CAST(&s21));
515 p = unitrazer_getLastOut();
516 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
520 test_transitionCompositeToSimpleAtEqualLevel(
void)
524 stateList_create(targetStates, 1, &s0);
525 stateList_create(entryStates, 1, &s0);
526 stateList_create(exitStates, 2, &s21, &s2);
529 smTest_xS21_Expect(
RKH_CAST(SmTest, smTest));
530 smTest_xS2_Expect(
RKH_CAST(SmTest, smTest));
531 smTest_tr31_Expect(
RKH_CAST(SmTest, smTest), &evA);
532 smTest_nS0_Expect(
RKH_CAST(SmTest, smTest));
534 setProfile(smTest, RKH_STATE_CAST(&waiting),
535 RKH_STATE_CAST(&s21), RKH_STATE_CAST(&s2),
537 entryStates, exitStates, RKH_STATE_CAST(&s0), 1,
538 TRN_NOT_INTERNAL, INIT_STATE_MACHINE, &evA,
539 RKH_STATE_CAST(&s21));
543 p = unitrazer_getLastOut();
544 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
548 test_transitionCompositeToSimpleFromHighToLowLevel(
void)
552 stateList_create(targetStates, 1, &s21);
553 stateList_create(entryStates, 1, &s21);
554 stateList_create(exitStates, 1, &s21);
557 smTest_xS21_Expect(
RKH_CAST(SmTest, smTest));
558 smTest_tr32_Expect(
RKH_CAST(SmTest, smTest), &evD);
559 smTest_nS21_Expect(
RKH_CAST(SmTest, smTest));
561 setProfile(smTest, RKH_STATE_CAST(&waiting),
562 RKH_STATE_CAST(&s21), RKH_STATE_CAST(&s2),
564 entryStates, exitStates, RKH_STATE_CAST(&s21), 1,
565 TRN_NOT_INTERNAL, INIT_STATE_MACHINE, &evD,
566 RKH_STATE_CAST(&s21));
570 p = unitrazer_getLastOut();
571 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
575 test_transitionLoopSimpleStateOnTop(
void)
579 stateList_create(targetStates, 1, &s1);
580 stateList_create(entryStates, 1, &s1);
581 stateList_create(exitStates, 1, &s1);
584 smTest_xS1_Expect(
RKH_CAST(SmTest, smTest));
585 smTest_tr53_Expect(
RKH_CAST(SmTest, smTest), &evA);
586 smTest_nS1_Expect(
RKH_CAST(SmTest, smTest));
588 setProfile(smTest, RKH_STATE_CAST(&waiting),
589 RKH_STATE_CAST(&s1), RKH_STATE_CAST(&s1),
591 entryStates, exitStates, RKH_STATE_CAST(&s1), 1,
592 TRN_NOT_INTERNAL, INIT_STATE_MACHINE, &evA,
593 RKH_STATE_CAST(&s1));
597 p = unitrazer_getLastOut();
598 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
602 test_transitionLoopNestedSimpleState(
void)
606 stateList_create(targetStates, 1, &s31);
607 stateList_create(entryStates, 1, &s31);
608 stateList_create(exitStates, 1, &s31);
611 smTest_xS31_Expect(
RKH_CAST(SmTest, smTest));
612 smTest_tr52_Expect(
RKH_CAST(SmTest, smTest), &evD);
613 smTest_nS31_Expect(
RKH_CAST(SmTest, smTest));
615 setProfile(smTest, RKH_STATE_CAST(&waiting),
616 RKH_STATE_CAST(&s31), RKH_STATE_CAST(&s31),
617 targetStates, entryStates, exitStates,
618 RKH_STATE_CAST(&s31), 1, TRN_NOT_INTERNAL, INIT_STATE_MACHINE,
619 &evD, RKH_STATE_CAST(&s31));
623 p = unitrazer_getLastOut();
624 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
628 test_transitionLoopCompositeStateOnTop(
void)
639 smTest_xS31_Expect(
RKH_CAST(SmTest, smTest));
640 smTest_tr51_Expect(
RKH_CAST(SmTest, smTest), &event);
642 smTest_nS31_Expect(
RKH_CAST(SmTest, smTest));
644 expInitSm((
RKH_SMA_T *)smTest, RKH_STATE_CAST(&waiting));
645 sm_dch_expect(event.
e, RKH_STATE_CAST(&s31));
646 sm_trn_expect(RKH_STATE_CAST(&s3), RKH_STATE_CAST(&s3));
647 sm_tsState_expect(RKH_STATE_CAST(&s3));
648 sm_exstate_expect(RKH_STATE_CAST(&s31));
649 sm_tsState_expect(RKH_STATE_CAST(&s31));
650 sm_enstate_expect(RKH_STATE_CAST(&s31));
651 sm_nenex_expect(nEnSt, nExSt);
652 sm_state_expect(RKH_STATE_CAST(&s31));
656 setState(smTest, RKH_STATE_CAST(&s31));
659 p = unitrazer_getLastOut();
660 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
664 test_transitionLoopNestedCompositeState(
void)
675 smTest_xS2211_Expect(
RKH_CAST(SmTest, smTest));
676 smTest_xS221_Expect(
RKH_CAST(SmTest, smTest));
677 smTest_tr54_Expect(
RKH_CAST(SmTest, smTest), &event);
679 smTest_nS221_Expect(
RKH_CAST(SmTest, smTest));
681 smTest_nS2211_Expect(
RKH_CAST(SmTest, smTest));
683 expInitSm((
RKH_SMA_T *)smTest, RKH_STATE_CAST(&waiting));
684 sm_dch_expect(event.
e, RKH_STATE_CAST(&s2211));
685 sm_trn_expect(RKH_STATE_CAST(&s22), RKH_STATE_CAST(&s22));
686 sm_tsState_expect(RKH_STATE_CAST(&s22));
687 sm_exstate_expect(RKH_STATE_CAST(&s2211));
688 sm_exstate_expect(RKH_STATE_CAST(&s221));
689 sm_tsState_expect(RKH_STATE_CAST(&s221));
690 sm_enstate_expect(RKH_STATE_CAST(&s221));
691 sm_tsState_expect(RKH_STATE_CAST(&s2211));
692 sm_enstate_expect(RKH_STATE_CAST(&s2211));
693 sm_nenex_expect(nEnSt, nExSt);
694 sm_state_expect(RKH_STATE_CAST(&s2211));
698 setState(smTest, RKH_STATE_CAST(&s2211));
701 p = unitrazer_getLastOut();
702 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
706 test_transitionCompositeToSimpleFromLowToHighLevel(
void)
710 stateList_create(targetStates, 1, &s0);
711 stateList_create(entryStates, 1, &s0);
712 stateList_create(exitStates, 3, &s221, &s22, &s2);
715 smTest_xS221_Expect(
RKH_CAST(SmTest, smTest));
716 smTest_xS22_Expect(
RKH_CAST(SmTest, smTest));
717 smTest_xS2_Expect(
RKH_CAST(SmTest, smTest));
718 smTest_tr33_Expect(
RKH_CAST(SmTest, smTest), &evB);
719 smTest_nS0_Expect(
RKH_CAST(SmTest, smTest));
721 setProfile(smTest, RKH_STATE_CAST(&waiting),
722 RKH_STATE_CAST(&s221), RKH_STATE_CAST(&s22),
723 targetStates, entryStates, exitStates,
724 RKH_STATE_CAST(&s0), 1, TRN_NOT_INTERNAL, INIT_STATE_MACHINE,
725 &evB, RKH_STATE_CAST(&s221));
729 p = unitrazer_getLastOut();
730 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
734 test_transitionCompositeToCompositeAtEqualLevel(
void)
745 smTest_xS31_Expect(
RKH_CAST(SmTest, smTest));
746 smTest_xS3_Expect(
RKH_CAST(SmTest, smTest));
747 smTest_tr41_Expect(
RKH_CAST(SmTest, smTest), &event);
748 smTest_nS2_Expect(
RKH_CAST(SmTest, smTest));
750 smTest_nS21_Expect(
RKH_CAST(SmTest, smTest));
752 expInitSm((
RKH_SMA_T *)smTest, RKH_STATE_CAST(&waiting));
753 sm_dch_expect(event.
e, RKH_STATE_CAST(&s31));
754 sm_trn_expect(RKH_STATE_CAST(&s3), RKH_STATE_CAST(&s2));
755 sm_tsState_expect(RKH_STATE_CAST(&s2));
756 sm_exstate_expect(RKH_STATE_CAST(&s31));
757 sm_exstate_expect(RKH_STATE_CAST(&s3));
758 sm_enstate_expect(RKH_STATE_CAST(&s2));
759 sm_tsState_expect(RKH_STATE_CAST(&s21));
760 sm_enstate_expect(RKH_STATE_CAST(&s21));
761 sm_nenex_expect(nEnSt, nExSt);
762 sm_state_expect(RKH_STATE_CAST(&s21));
766 setState(smTest, RKH_STATE_CAST(&s31));
769 p = unitrazer_getLastOut();
770 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
774 test_transitionCompositeToCompositeFromHighToLowLevel(
void)
785 smTest_xS31_Expect(
RKH_CAST(SmTest, smTest));
786 smTest_xS3_Expect(
RKH_CAST(SmTest, smTest));
787 smTest_tr42_Expect(
RKH_CAST(SmTest, smTest), &event);
788 smTest_nS2_Expect(
RKH_CAST(SmTest, smTest));
789 smTest_nS22_Expect(
RKH_CAST(SmTest, smTest));
791 smTest_nS221_Expect(
RKH_CAST(SmTest, smTest));
793 smTest_nS2211_Expect(
RKH_CAST(SmTest, smTest));
795 expInitSm((
RKH_SMA_T *)smTest, RKH_STATE_CAST(&waiting));
796 sm_dch_expect(event.
e, RKH_STATE_CAST(&s31));
797 sm_trn_expect(RKH_STATE_CAST(&s3), RKH_STATE_CAST(&s22));
798 sm_tsState_expect(RKH_STATE_CAST(&s22));
799 sm_exstate_expect(RKH_STATE_CAST(&s31));
800 sm_exstate_expect(RKH_STATE_CAST(&s3));
801 sm_enstate_expect(RKH_STATE_CAST(&s2));
802 sm_enstate_expect(RKH_STATE_CAST(&s22));
803 sm_tsState_expect(RKH_STATE_CAST(&s221));
804 sm_enstate_expect(RKH_STATE_CAST(&s221));
805 sm_tsState_expect(RKH_STATE_CAST(&s2211));
806 sm_enstate_expect(RKH_STATE_CAST(&s2211));
807 sm_nenex_expect(nEnSt, nExSt);
808 sm_state_expect(RKH_STATE_CAST(&s2211));
812 setState(smTest, RKH_STATE_CAST(&s31));
815 p = unitrazer_getLastOut();
816 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
820 test_transitionCompositeToCompositeFromLowToHighLevel(
void)
831 smTest_xS2211_Expect(
RKH_CAST(SmTest, smTest));
832 smTest_xS221_Expect(
RKH_CAST(SmTest, smTest));
833 smTest_xS22_Expect(
RKH_CAST(SmTest, smTest));
834 smTest_xS2_Expect(
RKH_CAST(SmTest, smTest));
835 smTest_tr43_Expect(
RKH_CAST(SmTest, smTest), &event);
836 smTest_nS3_Expect(
RKH_CAST(SmTest, smTest));
838 smTest_nS31_Expect(
RKH_CAST(SmTest, smTest));
840 expInitSm((
RKH_SMA_T *)smTest, RKH_STATE_CAST(&waiting));
841 sm_dch_expect(event.
e, RKH_STATE_CAST(&s2211));
842 sm_trn_expect(RKH_STATE_CAST(&s22), RKH_STATE_CAST(&s3));
843 sm_tsState_expect(RKH_STATE_CAST(&s3));
844 sm_exstate_expect(RKH_STATE_CAST(&s2211));
845 sm_exstate_expect(RKH_STATE_CAST(&s221));
846 sm_exstate_expect(RKH_STATE_CAST(&s22));
847 sm_exstate_expect(RKH_STATE_CAST(&s2));
848 sm_enstate_expect(RKH_STATE_CAST(&s3));
849 sm_tsState_expect(RKH_STATE_CAST(&s31));
850 sm_enstate_expect(RKH_STATE_CAST(&s31));
851 sm_nenex_expect(nEnSt, nExSt);
852 sm_state_expect(RKH_STATE_CAST(&s31));
856 setState(smTest, RKH_STATE_CAST(&s2211));
859 p = unitrazer_getLastOut();
860 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
864 test_transitionInternalInSimpleState(
void)
868 stateList_create(targetStates, 1, &s1);
869 stateList_create(entryStates, 0);
870 stateList_create(exitStates, 0);
873 smTest_tr14_Expect(
RKH_CAST(SmTest, smTest), &evB);
875 setProfile(smTest, RKH_STATE_CAST(&waiting),
876 RKH_STATE_CAST(&s1), RKH_STATE_CAST(&s1),
877 targetStates, entryStates, exitStates,
878 RKH_STATE_CAST(&s1), 1, TRN_INTERNAL, INIT_STATE_MACHINE,
879 &evB, RKH_STATE_CAST(&s1));
883 p = unitrazer_getLastOut();
884 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
888 test_transitionInternalInCompositeState(
void)
892 stateList_create(targetStates, 1, &s3);
893 stateList_create(entryStates, 0);
894 stateList_create(exitStates, 0);
897 smTest_tr15_Expect(
RKH_CAST(SmTest, smTest), &evE);
899 setProfile(smTest, RKH_STATE_CAST(&waiting),
900 RKH_STATE_CAST(&s31), RKH_STATE_CAST(&s3),
901 targetStates, entryStates, exitStates,
902 RKH_STATE_CAST(&s31), 1, TRN_INTERNAL, INIT_STATE_MACHINE,
903 &evE, RKH_STATE_CAST(&s31));
907 p = unitrazer_getLastOut();
908 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
912 test_transitionFails_EventNotFound(
void)
918 expInitSm(smTest, RKH_STATE_CAST(&waiting));
919 sm_dch_expect(evE.e, RKH_STATE_CAST(&s1));
920 sm_evtNotFound_expect(E);
923 setState(smTest, RKH_STATE_CAST(&s1));
926 p = unitrazer_getLastOut();
927 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
931 test_transitionFails_GuardFalse(
void)
935 expInitSm(smTest, RKH_STATE_CAST(&waiting));
936 sm_grdFalse_expect();
937 sm_dch_expect(evC.e, RKH_STATE_CAST(&s1));
938 sm_evtNotFound_expect(C);
941 smTest_falseGuard_ExpectAndReturn(
RKH_CAST(SmTest, smTest), &evC,
945 setState(smTest, RKH_STATE_CAST(&s1));
948 p = unitrazer_getLastOut();
949 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
953 test_transitionFails_ExceededHierarchicalLevel(
void)
957 expInitSm(smTest, RKH_STATE_CAST(&waiting));
959 sm_dch_expect(evE.e, RKH_STATE_CAST(&s0));
960 sm_trn_expect(RKH_STATE_CAST(&s0), RKH_STATE_CAST(&s22211));
961 sm_tsState_expect(RKH_STATE_CAST(&s22211));
962 sm_exHLevel_expect();
963 rkh_assert_Expect(
"rkhsm", 0);
964 rkh_assert_IgnoreArg_file();
965 rkh_assert_IgnoreArg_line();
968 setState(smTest, RKH_STATE_CAST(&s0));
971 p = unitrazer_getLastOut();
972 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
976 test_transitionMultipleEnabledTrn_FiringFirstTrueGuard(
void)
993 sm_grdFalse_expect();
996 setState(smTest, RKH_STATE_CAST(&s4));
999 p = unitrazer_getLastOut();
1000 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
1004 test_transitionMultipleEnabledTrn_FiringFirstEmptyGuard(
void)
1015 sm_enstate_ignore();
1016 sm_exstate_ignore();
1017 sm_ntrnact_ignore();
1018 sm_evtProc_ignore();
1023 sm_tsState_expect(RKH_STATE_CAST(&waiting));
1024 sm_grdFalse_expect();
1025 sm_grdFalse_expect();
1026 sm_tsState_expect(RKH_STATE_CAST(&s4));
1029 setState(smTest, RKH_STATE_CAST(&s4));
1032 p = unitrazer_getLastOut();
1033 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
1037 test_transitionDefaultTrnWithAssociatedEffect(
void)
1048 smTest_xS0_Expect(
RKH_CAST(SmTest, smTest));
1049 smTest_tr55_Expect(
RKH_CAST(SmTest, smTest), &event);
1050 smTest_nS3_Expect(
RKH_CAST(SmTest, smTest));
1052 smTest_nS31_Expect(
RKH_CAST(SmTest, smTest));
1054 expInitSm(smTest, RKH_STATE_CAST(&waiting));
1055 sm_dch_expect(event.
e, RKH_STATE_CAST(&s0));
1056 sm_trn_expect(RKH_STATE_CAST(&s0), RKH_STATE_CAST(&s3));
1057 sm_tsState_expect(RKH_STATE_CAST(&s3));
1058 sm_exstate_expect(RKH_STATE_CAST(&s0));
1059 sm_enstate_expect(RKH_STATE_CAST(&s3));
1060 sm_tsState_expect(RKH_STATE_CAST(&s31));
1061 sm_enstate_expect(RKH_STATE_CAST(&s31));
1062 sm_nenex_expect(nEnSt, nExSt);
1063 sm_state_expect(RKH_STATE_CAST(&s31));
1064 sm_evtProc_expect();
1067 setState(smTest, RKH_STATE_CAST(&s0));
1070 p = unitrazer_getLastOut();
1071 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
1075 test_transitionGeneratedCompletionEventBySimpleState(
void)
1079 stateList_create(targetStates, 1, &s5);
1080 stateList_create(entryStates, 1, &s5);
1081 stateList_create(exitStates, 2, &s21, &s2);
1085 smTest_xS21_Expect(
RKH_CAST(SmTest, smTest));
1086 smTest_xS2_Expect(
RKH_CAST(SmTest, smTest));
1087 smTest_nS5_Expect(
RKH_CAST(SmTest, smTest));
1089 setProfile(smTest, RKH_STATE_CAST(&waiting),
1090 RKH_STATE_CAST(&s21), RKH_STATE_CAST(&s2),
1091 targetStates, entryStates, exitStates,
1092 RKH_STATE_CAST(&s5), 0, TRN_NOT_INTERNAL, INIT_STATE_MACHINE,
1093 &evE, RKH_STATE_CAST(&s21));
1096 stateList_create(targetStates, 1, &s4);
1097 stateList_create(entryStates, 1, &s4);
1098 stateList_create(exitStates, 1, &s5);
1100 smTest_xS5_Expect(
RKH_CAST(SmTest, smTest));
1103 setProfile(smTest, RKH_STATE_CAST(&waiting),
1104 NULL, RKH_STATE_CAST(&s5),
1105 targetStates, entryStates, exitStates,
1106 RKH_STATE_CAST(&s4), 1, TRN_NOT_INTERNAL,
1107 NO_INIT_STATE_MACHINE, &evCompletion, RKH_STATE_CAST(&s5));
1112 p = unitrazer_getLastOut();
1113 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
1117 test_transitionGeneratedCompletionEventByFinalState(
void)
1121 stateList_create(targetStates, 1, &s2Final);
1122 stateList_create(entryStates, 1, &s2Final);
1123 stateList_create(exitStates, 1, &s21);
1127 smTest_xS21_Expect(
RKH_CAST(SmTest, smTest));
1129 setProfile(smTest, RKH_STATE_CAST(&waiting),
1130 RKH_STATE_CAST(&s21), RKH_STATE_CAST(&s21),
1131 targetStates, entryStates, exitStates,
1132 RKH_STATE_CAST(&s2Final), 0, TRN_NOT_INTERNAL,
1133 INIT_STATE_MACHINE, &evF, RKH_STATE_CAST(&s21));
1136 stateList_create(targetStates, 1, &s4);
1137 stateList_create(entryStates, 1, &s4);
1138 stateList_create(exitStates, 2, &s2Final, &s2);
1140 smTest_guardS2_ExpectAndReturn(
RKH_CAST(SmTest, smTest),
1143 smTest_xS2_Expect(
RKH_CAST(SmTest, smTest));
1146 setProfile(smTest, RKH_STATE_CAST(&waiting),
1147 NULL, RKH_STATE_CAST(&s2),
1148 targetStates, entryStates, exitStates,
1149 RKH_STATE_CAST(&s4), 1, TRN_NOT_INTERNAL,
1150 NO_INIT_STATE_MACHINE, &evCompletion, RKH_STATE_CAST(&s2Final));
1155 p = unitrazer_getLastOut();
1156 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
1160 test_transitionSyncDispatchingToStateMachine(
void)
1166 test_transitionToStateMachineFinalState(
void)
1170 stateList_create(targetStates, 1, &SmTest_Final);
1171 stateList_create(entryStates, 1, &SmTest_Final);
1172 stateList_create(exitStates, 1, &waiting);
1176 setProfile(smTest, RKH_STATE_CAST(&waiting),
1177 RKH_STATE_CAST(&waiting), RKH_STATE_CAST(&waiting),
1178 targetStates, entryStates, exitStates,
1179 RKH_STATE_CAST(&SmTest_Final), 1, TRN_NOT_INTERNAL,
1181 &evB, RKH_STATE_CAST(&waiting));
1185 p = unitrazer_getLastOut();
1186 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
1200 test_trnWoutUnitrazerFirstStateAfterInit(
void)
1202 setUpWoutUnitrazer();
1205 expectedState = RKH_STATE_CAST(&waiting);
1209 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1213 test_trnWoutUnitrazerSimpleToSimpleAtEqualLevel(
void)
1215 setUpWoutUnitrazer();
1217 expectedState = RKH_STATE_CAST(&s1);
1220 smTest_xS0_Expect(
RKH_CAST(SmTest, smTest));
1221 smTest_tr11_Expect(
RKH_CAST(SmTest, smTest), &evA);
1222 smTest_nS1_Expect(
RKH_CAST(SmTest, smTest));
1223 setProfileWoutUnitrazer(smTest,
1224 RKH_STATE_CAST(&s0),
1225 RKH_STATE_CAST(&s0),
1227 INIT_STATE_MACHINE);
1231 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1236 test_trnWoutUnitrazerSimpleToSimpleFromHighToLowLevel(
void)
1238 setUpWoutUnitrazer();
1240 expectedState = RKH_STATE_CAST(&s21);
1243 smTest_xS0_Expect(
RKH_CAST(SmTest, smTest));
1244 smTest_tr12_Expect(
RKH_CAST(SmTest, smTest), &evB);
1245 smTest_nS2_Expect(
RKH_CAST(SmTest, smTest));
1246 smTest_nS21_Expect(
RKH_CAST(SmTest, smTest));
1247 setProfileWoutUnitrazer(smTest,
1248 RKH_STATE_CAST(&s0),
1249 RKH_STATE_CAST(&s0),
1251 INIT_STATE_MACHINE);
1255 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1260 test_trnWoutUnitrazerSimpleToSimpleFromLowToHighLevel(
void)
1262 setUpWoutUnitrazer();
1264 expectedState = RKH_STATE_CAST(&s0);
1267 smTest_xS21_Expect(
RKH_CAST(SmTest, smTest));
1268 smTest_xS2_Expect(
RKH_CAST(SmTest, smTest));
1269 smTest_tr13_Expect(
RKH_CAST(SmTest, smTest), &evB);
1270 smTest_nS0_Expect(
RKH_CAST(SmTest, smTest));
1271 setProfileWoutUnitrazer(smTest,
1272 RKH_STATE_CAST(&s21),
1273 RKH_STATE_CAST(&s21),
1275 INIT_STATE_MACHINE);
1279 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1284 test_trnWoutUnitrazerSimpleToCompositeAtEqualLevel(
void)
1286 setUpWoutUnitrazer();
1288 expectedState = RKH_STATE_CAST(&s21);
1291 smTest_xS0_Expect(
RKH_CAST(SmTest, smTest));
1292 smTest_tr21_Expect(
RKH_CAST(SmTest, smTest), &evC);
1293 smTest_nS2_Expect(
RKH_CAST(SmTest, smTest));
1294 smTest_iS2_Expect(
RKH_CAST(SmTest, smTest), &evC);
1295 smTest_nS21_Expect(
RKH_CAST(SmTest, smTest));
1296 setProfileWoutUnitrazer(smTest,
1297 RKH_STATE_CAST(&s0),
1298 RKH_STATE_CAST(&s0),
1300 INIT_STATE_MACHINE);
1304 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1309 test_trnWoutUnitrazerSimpleToCompositeFromHighToLowLevel(
void)
1311 setUpWoutUnitrazer();
1313 expectedState = RKH_STATE_CAST(&s2211);
1316 smTest_xS0_Expect(
RKH_CAST(SmTest, smTest));
1317 smTest_tr22_Expect(
RKH_CAST(SmTest, smTest), &evD);
1318 smTest_nS2_Expect(
RKH_CAST(SmTest, smTest));
1319 smTest_nS22_Expect(
RKH_CAST(SmTest, smTest));
1320 smTest_iS22_Expect(
RKH_CAST(SmTest, smTest), &evD);
1321 smTest_nS221_Expect(
RKH_CAST(SmTest, smTest));
1322 smTest_iS221_Expect(
RKH_CAST(SmTest, smTest), &evD);
1323 smTest_nS2211_Expect(
RKH_CAST(SmTest, smTest));
1324 setProfileWoutUnitrazer(smTest,
1325 RKH_STATE_CAST(&s0),
1326 RKH_STATE_CAST(&s0),
1328 INIT_STATE_MACHINE);
1332 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1337 test_trnWoutUnitrazerSimpleToCompositeFromLowToHighLevel(
void)
1339 setUpWoutUnitrazer();
1341 expectedState = RKH_STATE_CAST(&s21);
1344 smTest_xS21_Expect(
RKH_CAST(SmTest, smTest));
1345 smTest_tr23_Expect(
RKH_CAST(SmTest, smTest), &evC);
1346 smTest_iS2_Expect(
RKH_CAST(SmTest, smTest), &evC);
1347 smTest_nS21_Expect(
RKH_CAST(SmTest, smTest));
1348 setProfileWoutUnitrazer(smTest,
1349 RKH_STATE_CAST(&s21),
1350 RKH_STATE_CAST(&s21),
1352 INIT_STATE_MACHINE);
1356 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1361 test_trnWoutUnitrazerCompositeToSimpleAtEqualLevel(
void)
1363 setUpWoutUnitrazer();
1365 expectedState = RKH_STATE_CAST(&s0);
1368 smTest_xS21_Expect(
RKH_CAST(SmTest, smTest));
1369 smTest_xS2_Expect(
RKH_CAST(SmTest, smTest));
1370 smTest_tr31_Expect(
RKH_CAST(SmTest, smTest), &evA);
1371 smTest_nS0_Expect(
RKH_CAST(SmTest, smTest));
1372 setProfileWoutUnitrazer(smTest,
1373 RKH_STATE_CAST(&s21),
1374 RKH_STATE_CAST(&s2),
1376 INIT_STATE_MACHINE);
1380 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1385 test_trnWoutUnitrazerCompositeToSimpleFromHighToLowLevel(
void)
1387 setUpWoutUnitrazer();
1389 expectedState = RKH_STATE_CAST(&s21);
1392 smTest_xS21_Expect(
RKH_CAST(SmTest, smTest));
1393 smTest_tr32_Expect(
RKH_CAST(SmTest, smTest), &evD);
1394 smTest_nS21_Expect(
RKH_CAST(SmTest, smTest));
1395 setProfileWoutUnitrazer(smTest,
1396 RKH_STATE_CAST(&s21),
1397 RKH_STATE_CAST(&s2),
1399 INIT_STATE_MACHINE);
1403 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1408 test_trnWoutUnitrazerLoopSimpleStateOnTop(
void)
1410 setUpWoutUnitrazer();
1412 expectedState = RKH_STATE_CAST(&s1);
1415 smTest_xS1_Expect(
RKH_CAST(SmTest, smTest));
1416 smTest_tr53_Expect(
RKH_CAST(SmTest, smTest), &evA);
1417 smTest_nS1_Expect(
RKH_CAST(SmTest, smTest));
1418 setProfileWoutUnitrazer(smTest,
1419 RKH_STATE_CAST(&s1),
1420 RKH_STATE_CAST(&s1),
1422 INIT_STATE_MACHINE);
1426 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1431 test_trnWoutUnitrazerLoopNestedSimpleState(
void)
1433 setUpWoutUnitrazer();
1435 expectedState = RKH_STATE_CAST(&s31);
1438 smTest_xS31_Expect(
RKH_CAST(SmTest, smTest));
1439 smTest_tr52_Expect(
RKH_CAST(SmTest, smTest), &evD);
1440 smTest_nS31_Expect(
RKH_CAST(SmTest, smTest));
1441 setProfileWoutUnitrazer(smTest,
1442 RKH_STATE_CAST(&s31),
1443 RKH_STATE_CAST(&s31),
1445 INIT_STATE_MACHINE);
1449 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1454 test_trnWoutUnitrazerLoopCompositeStateOnTop(
void)
1456 setUpWoutUnitrazer();
1458 expectedState = RKH_STATE_CAST(&s31);
1461 smTest_xS31_Expect(
RKH_CAST(SmTest, smTest));
1462 smTest_tr51_Expect(
RKH_CAST(SmTest, smTest), &evA);
1463 smTest_iS3_Expect(
RKH_CAST(SmTest, smTest), &evA);
1464 smTest_nS31_Expect(
RKH_CAST(SmTest, smTest));
1465 setProfileWoutUnitrazer(smTest,
1466 RKH_STATE_CAST(&s31),
1467 RKH_STATE_CAST(&s3),
1469 INIT_STATE_MACHINE);
1473 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1478 test_trnWoutUnitrazerLoopNestedCompositeState(
void)
1480 setUpWoutUnitrazer();
1482 expectedState = RKH_STATE_CAST(&s2211);
1485 smTest_xS2211_Expect(
RKH_CAST(SmTest, smTest));
1486 smTest_xS221_Expect(
RKH_CAST(SmTest, smTest));
1487 smTest_tr54_Expect(
RKH_CAST(SmTest, smTest), &evD);
1488 smTest_iS22_Expect(
RKH_CAST(SmTest, smTest), &evD);
1489 smTest_nS221_Expect(
RKH_CAST(SmTest, smTest));
1490 smTest_iS221_Expect(
RKH_CAST(SmTest, smTest), &evD);
1491 smTest_nS2211_Expect(
RKH_CAST(SmTest, smTest));
1492 setProfileWoutUnitrazer(smTest,
1493 RKH_STATE_CAST(&s2211),
1494 RKH_STATE_CAST(&s22),
1496 INIT_STATE_MACHINE);
1500 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1505 test_trnWoutUnitrazerCompositeToSimpleFromLowToHighLevel(
void)
1507 setUpWoutUnitrazer();
1509 expectedState = RKH_STATE_CAST(&s0);
1512 smTest_xS2211_Expect(
RKH_CAST(SmTest, smTest));
1513 smTest_xS221_Expect(
RKH_CAST(SmTest, smTest));
1514 smTest_xS22_Expect(
RKH_CAST(SmTest, smTest));
1515 smTest_xS2_Expect(
RKH_CAST(SmTest, smTest));
1516 smTest_tr33_Expect(
RKH_CAST(SmTest, smTest), &evB);
1517 smTest_nS0_Expect(
RKH_CAST(SmTest, smTest));
1518 setProfileWoutUnitrazer(smTest,
1519 RKH_STATE_CAST(&s2211),
1520 RKH_STATE_CAST(&s22),
1522 INIT_STATE_MACHINE);
1526 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1531 test_trnWoutUnitrazerCompositeToCompositeAtEqualLevel(
void)
1533 setUpWoutUnitrazer();
1535 expectedState = RKH_STATE_CAST(&s21);
1538 smTest_xS31_Expect(
RKH_CAST(SmTest, smTest));
1539 smTest_xS3_Expect(
RKH_CAST(SmTest, smTest));
1540 smTest_tr41_Expect(
RKH_CAST(SmTest, smTest), &evB);
1541 smTest_nS2_Expect(
RKH_CAST(SmTest, smTest));
1542 smTest_iS2_Expect(
RKH_CAST(SmTest, smTest), &evB);
1543 smTest_nS21_Expect(
RKH_CAST(SmTest, smTest));
1544 setProfileWoutUnitrazer(smTest,
1545 RKH_STATE_CAST(&s31),
1546 RKH_STATE_CAST(&s3),
1548 INIT_STATE_MACHINE);
1552 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1557 test_trnWoutUnitrazerCompositeToCompositeFromHighToLowLevel(
void)
1559 setUpWoutUnitrazer();
1561 expectedState = RKH_STATE_CAST(&s2211);
1564 smTest_xS31_Expect(
RKH_CAST(SmTest, smTest));
1565 smTest_xS3_Expect(
RKH_CAST(SmTest, smTest));
1566 smTest_tr42_Expect(
RKH_CAST(SmTest, smTest), &evC);
1567 smTest_nS2_Expect(
RKH_CAST(SmTest, smTest));
1568 smTest_nS22_Expect(
RKH_CAST(SmTest, smTest));
1569 smTest_iS22_Expect(
RKH_CAST(SmTest, smTest), &evC);
1570 smTest_nS221_Expect(
RKH_CAST(SmTest, smTest));
1571 smTest_iS221_Expect(
RKH_CAST(SmTest, smTest), &evC);
1572 smTest_nS2211_Expect(
RKH_CAST(SmTest, smTest));
1573 setProfileWoutUnitrazer(smTest,
1574 RKH_STATE_CAST(&s31),
1575 RKH_STATE_CAST(&s3),
1577 INIT_STATE_MACHINE);
1581 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1586 test_trnWoutUnitrazerCompositeToCompositeFromLowToHighLevel(
void)
1588 setUpWoutUnitrazer();
1590 expectedState = RKH_STATE_CAST(&s31);
1593 smTest_xS2211_Expect(
RKH_CAST(SmTest, smTest));
1594 smTest_xS221_Expect(
RKH_CAST(SmTest, smTest));
1595 smTest_xS22_Expect(
RKH_CAST(SmTest, smTest));
1596 smTest_xS2_Expect(
RKH_CAST(SmTest, smTest));
1597 smTest_tr43_Expect(
RKH_CAST(SmTest, smTest), &evC);
1598 smTest_nS3_Expect(
RKH_CAST(SmTest, smTest));
1599 smTest_iS3_Expect(
RKH_CAST(SmTest, smTest), &evC);
1600 smTest_nS31_Expect(
RKH_CAST(SmTest, smTest));
1601 setProfileWoutUnitrazer(smTest,
1602 RKH_STATE_CAST(&s2211),
1603 RKH_STATE_CAST(&s3),
1605 INIT_STATE_MACHINE);
1609 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1614 test_trnWoutUnitrazerInternalInSimpleState(
void)
1616 setUpWoutUnitrazer();
1618 expectedState = RKH_STATE_CAST(&s1);
1621 smTest_tr14_Expect(
RKH_CAST(SmTest, smTest), &evB);
1622 setProfileWoutUnitrazer(smTest,
1623 RKH_STATE_CAST(&s1),
1624 RKH_STATE_CAST(&s1),
1626 INIT_STATE_MACHINE);
1630 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1635 test_trnWoutUnitrazerInternalInCompositeState(
void)
1637 setUpWoutUnitrazer();
1639 expectedState = RKH_STATE_CAST(&s31);
1642 smTest_tr15_Expect(
RKH_CAST(SmTest, smTest), &evE);
1643 setProfileWoutUnitrazer(smTest,
1644 RKH_STATE_CAST(&s31),
1645 RKH_STATE_CAST(&s3),
1647 INIT_STATE_MACHINE);
1651 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1655 test_trnWoutUnitrazerFails_EventNotFound(
void)
1657 setUpWoutUnitrazer();
1659 expectedState = RKH_STATE_CAST(&s1);
1662 setProfileWoutUnitrazer(smTest,
1663 RKH_STATE_CAST(&s1),
1664 RKH_STATE_CAST(&s1),
1666 INIT_STATE_MACHINE);
1670 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1675 test_trnWoutUnitrazerFails_GuardFalseOnInternalTrn(
void)
1677 setUpWoutUnitrazer();
1679 expectedState = RKH_STATE_CAST(&s1);
1682 smTest_falseGuard_ExpectAndReturn(
RKH_CAST(SmTest, smTest), &evC,
1684 setProfileWoutUnitrazer(smTest,
1685 RKH_STATE_CAST(&s1),
1686 RKH_STATE_CAST(&s1),
1688 INIT_STATE_MACHINE);
1692 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1697 test_trnWoutUnitrazerFails_GuardFalseOnExternalTrn(
void)
1699 setUpWoutUnitrazer();
1701 expectedState = RKH_STATE_CAST(&s1);
1704 smTest_falseGuard_ExpectAndReturn(
RKH_CAST(SmTest, smTest), &evD,
1706 setProfileWoutUnitrazer(smTest,
1707 RKH_STATE_CAST(&s1),
1708 RKH_STATE_CAST(&s1),
1710 INIT_STATE_MACHINE);
1714 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1719 test_trnWoutUnitrazerFails_ExceededHierarchicalLevel(
void)
1721 setUpWoutUnitrazer();
1723 expectedState = RKH_STATE_CAST(&s0);
1726 setProfileWoutUnitrazer(smTest,
1727 RKH_STATE_CAST(&s0),
1728 RKH_STATE_CAST(&s0),
1730 INIT_STATE_MACHINE);
1731 rkh_assert_Expect(
"rkhsm", 0);
1732 rkh_assert_IgnoreArg_file();
1733 rkh_assert_IgnoreArg_line();
1737 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1742 test_trnWoutUnitrazerMultipleEnabledTrn_FiringFirstTrueGuard(
void)
1744 setUpWoutUnitrazer();
1746 expectedState = RKH_STATE_CAST(&s4);
1751 setProfileWoutUnitrazer(smTest,
1752 RKH_STATE_CAST(&s4),
1753 RKH_STATE_CAST(&s4),
1755 INIT_STATE_MACHINE);
1759 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1764 test_trnWoutUnitrazerMultipleEnabledTrn_FiringFirstEmptyGuard(
void)
1766 setUpWoutUnitrazer();
1768 expectedState = RKH_STATE_CAST(&s4);
1773 setProfileWoutUnitrazer(smTest,
1774 RKH_STATE_CAST(&s4),
1775 RKH_STATE_CAST(&s4),
1777 INIT_STATE_MACHINE);
1781 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1786 test_trnWoutUnitrazerDefaultTrnWithAssociatedEffect(
void)
1788 setUpWoutUnitrazer();
1790 expectedState = RKH_STATE_CAST(&s31);
1793 smTest_xS0_Expect(
RKH_CAST(SmTest, smTest));
1794 smTest_tr55_Expect(
RKH_CAST(SmTest, smTest), &evF);
1795 smTest_nS3_Expect(
RKH_CAST(SmTest, smTest));
1796 smTest_iS3_Expect(
RKH_CAST(SmTest, smTest), &evF);
1797 smTest_nS31_Expect(
RKH_CAST(SmTest, smTest));
1798 setProfileWoutUnitrazer(smTest,
1799 RKH_STATE_CAST(&s0),
1800 RKH_STATE_CAST(&s0),
1802 INIT_STATE_MACHINE);
1806 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1811 test_trnWoutUnitrazerGeneratedCompletionEventBySimpleState(
void)
1813 setUpWoutUnitrazer();
1815 expectedState = RKH_STATE_CAST(&s4);
1819 smTest_xS21_Expect(
RKH_CAST(SmTest, smTest));
1820 smTest_xS2_Expect(
RKH_CAST(SmTest, smTest));
1821 smTest_nS5_Expect(
RKH_CAST(SmTest, smTest));
1823 smTest_xS5_Expect(
RKH_CAST(SmTest, smTest));
1825 setProfileWoutUnitrazer(smTest,
1826 RKH_STATE_CAST(&s21),
1827 RKH_STATE_CAST(&s2),
1829 INIT_STATE_MACHINE);
1833 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1838 test_trnWoutUnitrazerGeneratedCompletionEventByFinalState(
void)
1840 setUpWoutUnitrazer();
1842 expectedState = RKH_STATE_CAST(&s4);
1846 smTest_xS21_Expect(
RKH_CAST(SmTest, smTest));
1848 smTest_guardS2_ExpectAndReturn(
RKH_CAST(SmTest, smTest),
1851 smTest_xS2_Expect(
RKH_CAST(SmTest, smTest));
1853 setProfileWoutUnitrazer(smTest,
1854 RKH_STATE_CAST(&s21),
1855 RKH_STATE_CAST(&s21),
1857 INIT_STATE_MACHINE);
1861 TEST_ASSERT_TRUE(expectedState == getState(smTest));
1866 test_trnWoutUnitrazerSyncDispatchingToStateMachine(
void)
1870 setUpWoutUnitrazer();
1882 test_pseudostateConditionalFirstStateAfterInit(
void)
1886 sm_init_expect(RKH_STATE_CAST(&smPCT_waiting));
1887 sm_trn_expect(RKH_STATE_CAST(&smPCT_waiting),
1888 RKH_STATE_CAST(&smPCT_waiting));
1889 sm_tsState_expect(RKH_STATE_CAST(&smPCT_waiting));
1890 sm_enstate_expect(RKH_STATE_CAST(&smPCT_waiting));
1891 sm_nenex_expect(1, 0);
1892 sm_state_expect(RKH_STATE_CAST(&smPCT_waiting));
1893 sm_evtProc_expect();
1897 p = unitrazer_getLastOut();
1898 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
1902 test_pseudostateConditionalTrnToChoiceWithTrueCondition(
void)
1905 SmPseudoConditionalTest *me =
RKH_CAST(SmPseudoConditionalTest,
1906 smPseudoConditionalTest);
1909 smPCT_setCondition_Expect(
1910 RKH_CAST(SmPseudoConditionalTest, me), &evA);
1911 smPCT_onEventA_ExpectAndReturn(
1912 RKH_CAST(SmPseudoConditionalTest, me),
1915 RKH_CAST(SmPseudoConditionalTest, me), &evA);
1917 expInitSm((
RKH_SMA_T *)me, RKH_STATE_CAST(&smPCT_waiting));
1919 sm_dch_expect(evA.e, RKH_STATE_CAST(&smPCT_s0));
1920 sm_trn_expect(RKH_STATE_CAST(&smPCT_s0), RKH_STATE_CAST(&smPCT_choice1));
1921 sm_tsState_expect(RKH_STATE_CAST(&smPCT_choice1));
1924 sm_tsState_expect(RKH_STATE_CAST(&smPCT_s1));
1926 sm_exstate_expect(RKH_STATE_CAST(&smPCT_s0));
1928 sm_enstate_expect(RKH_STATE_CAST(&smPCT_s1));
1929 sm_tsState_expect(RKH_STATE_CAST(&smPCT_s11));
1930 sm_enstate_expect(RKH_STATE_CAST(&smPCT_s11));
1931 sm_nenex_expect(2, 1);
1933 sm_state_expect(RKH_STATE_CAST(&smPCT_s11));
1934 sm_evtProc_expect();
1938 setState((
RKH_SMA_T *)me, RKH_STATE_CAST(&smPCT_s0));
1942 p = unitrazer_getLastOut();
1943 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
1947 test_pseudostateConditionalTrnToChoiceWithFalseCondition(
void)
1950 SmPseudoConditionalTest *me =
RKH_CAST(SmPseudoConditionalTest,
1951 smPseudoConditionalTest);
1954 smPCT_setCondition_Expect(
1955 RKH_CAST(SmPseudoConditionalTest, me), &evB);
1956 smPCT_onEventA_ExpectAndReturn(
1957 RKH_CAST(SmPseudoConditionalTest, me),
1959 smPCT_onEventD_ExpectAndReturn(
1960 RKH_CAST(SmPseudoConditionalTest, me),
1963 RKH_CAST(SmPseudoConditionalTest, me), &evB);
1965 expInitSm((
RKH_SMA_T *)me, RKH_STATE_CAST(&smPCT_waiting));
1967 sm_dch_expect(evB.e, RKH_STATE_CAST(&smPCT_s0));
1968 sm_trn_expect(RKH_STATE_CAST(&smPCT_s0), RKH_STATE_CAST(&smPCT_choice1));
1969 sm_tsState_expect(RKH_STATE_CAST(&smPCT_choice1));
1972 sm_tsState_expect(RKH_STATE_CAST(&smPCT_s12));
1974 sm_exstate_expect(RKH_STATE_CAST(&smPCT_s0));
1976 sm_enstate_expect(RKH_STATE_CAST(&smPCT_s1));
1977 sm_enstate_expect(RKH_STATE_CAST(&smPCT_s12));
1978 sm_nenex_expect(2, 1);
1980 sm_state_expect(RKH_STATE_CAST(&smPCT_s12));
1981 sm_evtProc_expect();
1984 setState((
RKH_SMA_T *)me, RKH_STATE_CAST(&smPCT_s0));
1988 p = unitrazer_getLastOut();
1989 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
1993 test_pseudostateConditionalTrnToChoiceWithoutElse(
void)
1996 SmPseudoConditionalTest *me =
RKH_CAST(SmPseudoConditionalTest,
1997 smPseudoConditionalTest);
2000 smPCT_onEventA_ExpectAndReturn(
2001 RKH_CAST(SmPseudoConditionalTest, me),
2004 expInitSm((
RKH_SMA_T *)me, RKH_STATE_CAST(&smPCT_waiting));
2006 sm_dch_expect(evC.e, RKH_STATE_CAST(&smPCT_s0));
2007 sm_trn_expect(RKH_STATE_CAST(&smPCT_s0), RKH_STATE_CAST(&smPCT_choice2));
2008 sm_tsState_expect(RKH_STATE_CAST(&smPCT_choice2));
2010 sm_cndNotFound_expect();
2013 setState((
RKH_SMA_T *)me, RKH_STATE_CAST(&smPCT_s0));
2017 p = unitrazer_getLastOut();
2018 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2022 test_pseudostateConditionalTrnToChoiceReturnToSource(
void)
2025 SmPseudoConditionalTest *me =
RKH_CAST(SmPseudoConditionalTest,
2026 smPseudoConditionalTest);
2029 smPCT_onEventA_ExpectAndReturn(
RKH_CAST(SmPseudoConditionalTest, me),
2031 smPCT_onEventD_ExpectAndReturn(
RKH_CAST(SmPseudoConditionalTest, me),
2033 smPCT_tr4_Expect(
RKH_CAST(SmPseudoConditionalTest, me), &evD);
2035 expInitSm((
RKH_SMA_T *)me, RKH_STATE_CAST(&smPCT_waiting));
2037 sm_dch_expect(evD.e, RKH_STATE_CAST(&smPCT_s0));
2038 sm_trn_expect(RKH_STATE_CAST(&smPCT_s0), RKH_STATE_CAST(&smPCT_choice1));
2039 sm_tsState_expect(RKH_STATE_CAST(&smPCT_choice1));
2042 sm_tsState_expect(RKH_STATE_CAST(&smPCT_s0));
2044 sm_exstate_expect(RKH_STATE_CAST(&smPCT_s0));
2046 sm_enstate_expect(RKH_STATE_CAST(&smPCT_s0));
2047 sm_nenex_expect(1, 1);
2049 sm_state_expect(RKH_STATE_CAST(&smPCT_s0));
2050 sm_evtProc_expect();
2053 setState((
RKH_SMA_T *)me, RKH_STATE_CAST(&smPCT_s0));
2057 p = unitrazer_getLastOut();
2058 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2062 test_pseudostateConditionalFailsTrnSegmentsExceeded(
void)
2065 SmPseudoConditionalTest *me =
RKH_CAST(SmPseudoConditionalTest,
2066 smPseudoConditionalTest);
2069 smPCT_tr1_Expect(
RKH_CAST(SmPseudoConditionalTest, me), &evE);
2070 smPCT_guardTrue_ExpectAndReturn(
RKH_CAST(SmPseudoConditionalTest, me),
2072 smPCT_tr1_Expect(
RKH_CAST(SmPseudoConditionalTest, me), &evE);
2073 smPCT_guardTrue_ExpectAndReturn(
RKH_CAST(SmPseudoConditionalTest, me),
2075 smPCT_tr1_Expect(
RKH_CAST(SmPseudoConditionalTest, me), &evE);
2076 smPCT_guardTrue_ExpectAndReturn(
RKH_CAST(SmPseudoConditionalTest, me),
2078 smPCT_tr1_Expect(
RKH_CAST(SmPseudoConditionalTest, me), &evE);
2079 smPCT_guardTrue_ExpectAndReturn(
RKH_CAST(SmPseudoConditionalTest, me),
2081 smPCT_tr1_Expect(
RKH_CAST(SmPseudoConditionalTest, me), &evE);
2083 expInitSm((
RKH_SMA_T *)me, RKH_STATE_CAST(&smPCT_waiting));
2085 sm_dch_expect(evE.e, RKH_STATE_CAST(&smPCT_s0));
2086 sm_trn_expect(RKH_STATE_CAST(&smPCT_s0), RKH_STATE_CAST(&smPCT_choice3));
2087 sm_tsState_expect(RKH_STATE_CAST(&smPCT_choice3));
2090 sm_tsState_expect(RKH_STATE_CAST(&smPCT_choice4));
2092 sm_tsState_expect(RKH_STATE_CAST(&smPCT_choice5));
2094 sm_tsState_expect(RKH_STATE_CAST(&smPCT_choice6));
2096 sm_tsState_expect(RKH_STATE_CAST(&smPCT_s1));
2098 sm_exstate_expect(RKH_STATE_CAST(&smPCT_s0));
2100 sm_enstate_expect(RKH_STATE_CAST(&smPCT_s1));
2101 sm_tsState_expect(RKH_STATE_CAST(&smPCT_s11));
2102 sm_enstate_expect(RKH_STATE_CAST(&smPCT_s11));
2103 sm_nenex_expect(2, 1);
2105 sm_state_expect(RKH_STATE_CAST(&smPCT_s11));
2106 sm_evtProc_expect();
2109 setState((
RKH_SMA_T *)me, RKH_STATE_CAST(&smPCT_s0));
2113 p = unitrazer_getLastOut();
2114 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2126 test_pseudostateFirstStateAfterInit(
void)
2130 sm_init_expect(RKH_STATE_CAST(&smPT_waiting));
2131 sm_trn_expect(RKH_STATE_CAST(&smPT_waiting),
2132 RKH_STATE_CAST(&smPT_waiting));
2133 sm_tsState_expect(RKH_STATE_CAST(&smPT_waiting));
2134 sm_enstate_expect(RKH_STATE_CAST(&smPT_waiting));
2135 sm_nenex_expect(1, 0);
2136 sm_state_expect(RKH_STATE_CAST(&smPT_waiting));
2137 sm_evtProc_expect();
2141 p = unitrazer_getLastOut();
2142 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2146 test_pseudostateTrnToEmptyShallowHistoryWithoutDefaultTrn(
void)
2155 expInitSm((
RKH_SMA_T *)smPseudoTest, RKH_STATE_CAST(&smPT_waiting));
2156 sm_dch_expect(event.
e, RKH_STATE_CAST(&smPT_s0));
2157 sm_trn_expect(RKH_STATE_CAST(&smPT_s0), RKH_STATE_CAST(&smPT_s1Hist));
2158 sm_tsState_expect(RKH_STATE_CAST(&smPT_s1Hist));
2159 sm_tsState_expect(RKH_STATE_CAST(&smPT_s1));
2160 sm_exstate_expect(RKH_STATE_CAST(&smPT_s0));
2161 sm_enstate_expect(RKH_STATE_CAST(&smPT_s1));
2162 sm_tsState_expect(RKH_STATE_CAST(&smPT_s11));
2163 sm_enstate_expect(RKH_STATE_CAST(&smPT_s11));
2164 sm_nenex_expect(nEnSt, nExSt);
2165 sm_state_expect(RKH_STATE_CAST(&smPT_s11));
2166 sm_evtProc_expect();
2169 setState((
RKH_SMA_T *)smPseudoTest, RKH_STATE_CAST(&smPT_s0));
2172 p = unitrazer_getLastOut();
2173 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2177 test_pseudostateTrnToLoadedShallowHistoryWithoutDefaultTrn(
void)
2186 expInitSm((
RKH_SMA_T *)smPseudoTest, RKH_STATE_CAST(&smPT_waiting));
2187 sm_dch_expect(event.
e, RKH_STATE_CAST(&smPT_s0));
2188 sm_trn_expect(RKH_STATE_CAST(&smPT_s0), RKH_STATE_CAST(&smPT_s1Hist));
2189 sm_tsState_expect(RKH_STATE_CAST(&smPT_s1Hist));
2190 sm_tsState_expect(RKH_STATE_CAST(&smPT_s12));
2191 sm_exstate_expect(RKH_STATE_CAST(&smPT_s0));
2192 sm_enstate_expect(RKH_STATE_CAST(&smPT_s1));
2193 sm_enstate_expect(RKH_STATE_CAST(&smPT_s12));
2194 sm_tsState_expect(RKH_STATE_CAST(&smPT_s121));
2195 sm_enstate_expect(RKH_STATE_CAST(&smPT_s121));
2196 sm_nenex_expect(nEnSt, nExSt);
2197 sm_state_expect(RKH_STATE_CAST(&smPT_s121));
2198 sm_evtProc_expect();
2201 setState((
RKH_SMA_T *)smPseudoTest, RKH_STATE_CAST(&smPT_s0));
2202 setHistory(&smPT_s1Hist, RKH_STATE_CAST(&smPT_s12));
2205 p = unitrazer_getLastOut();
2206 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2210 test_pseudostateExitFromCompositeWithLoadedShallowHistory(
void)
2215 stateList_create(targetStates, 1, &smPT_s0);
2216 stateList_create(exitStates, 3, &smPT_s121, &smPT_s12, &smPT_s1);
2217 stateList_create(entryStates, 1, &smPT_s0);
2218 setProfile(smPseudoTest, RKH_STATE_CAST(&smPT_waiting),
2219 RKH_STATE_CAST(&smPT_s121),
2220 RKH_STATE_CAST(&smPT_s1), targetStates,
2221 entryStates, exitStates,
2222 RKH_STATE_CAST(&smPT_s0), 0, TRN_NOT_INTERNAL, 1, &evA,
2223 RKH_STATE_CAST(&smPT_s121));
2226 state = getHistory(&smPT_s1Hist);
2227 TEST_ASSERT_EQUAL_PTR(RKH_STATE_CAST(&smPT_s12), state);
2229 p = unitrazer_getLastOut();
2230 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2234 test_pseudostateTrnToEmptyDeepHistoryWithoutDefaultTrn(
void)
2243 expInitSm((
RKH_SMA_T *)smPseudoTest, RKH_STATE_CAST(&smPT_waiting));
2244 sm_dch_expect(event.
e, RKH_STATE_CAST(&smPT_s0));
2245 sm_trn_expect(RKH_STATE_CAST(&smPT_s0), RKH_STATE_CAST(&smPT_s12Hist));
2246 sm_tsState_expect(RKH_STATE_CAST(&smPT_s12Hist));
2247 sm_tsState_expect(RKH_STATE_CAST(&smPT_s12));
2248 sm_exstate_expect(RKH_STATE_CAST(&smPT_s0));
2249 sm_enstate_expect(RKH_STATE_CAST(&smPT_s1));
2250 sm_enstate_expect(RKH_STATE_CAST(&smPT_s12));
2251 sm_tsState_expect(RKH_STATE_CAST(&smPT_s121));
2252 sm_enstate_expect(RKH_STATE_CAST(&smPT_s121));
2253 sm_nenex_expect(nEnSt, nExSt);
2254 sm_state_expect(RKH_STATE_CAST(&smPT_s121));
2255 sm_evtProc_expect();
2258 setState((
RKH_SMA_T *)smPseudoTest, RKH_STATE_CAST(&smPT_s0));
2261 p = unitrazer_getLastOut();
2262 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2266 test_pseudostateTrnToLoadedDeepHistoryWithoutDefaultTrn(
void)
2270 stateList_create(targetStates, 2, &smPT_s12Hist, &smPT_s122);
2271 stateList_create(exitStates, 1, &smPT_s0);
2272 stateList_create(entryStates, 3, &smPT_s1, &smPT_s12, &smPT_s122);
2273 setProfile(smPseudoTest, RKH_STATE_CAST(&smPT_waiting),
2274 RKH_STATE_CAST(&smPT_s0),
2275 RKH_STATE_CAST(&smPT_s0), targetStates,
2276 entryStates, exitStates,
2277 RKH_STATE_CAST(&smPT_s122), 0, TRN_NOT_INTERNAL, 1, &evC,
2278 RKH_STATE_CAST(&smPT_s0));
2280 setHistory(&smPT_s12Hist, RKH_STATE_CAST(&smPT_s122));
2283 p = unitrazer_getLastOut();
2284 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2288 test_pseudostateExitFromCompositeWithLoadedDeepHistory(
void)
2293 stateList_create(targetStates, 1, &smPT_s122);
2294 stateList_create(exitStates, 1, &smPT_s0);
2295 stateList_create(entryStates, 3, &smPT_s1, &smPT_s12, &smPT_s122);
2296 setProfile(smPseudoTest, RKH_STATE_CAST(&smPT_waiting),
2297 RKH_STATE_CAST(&smPT_s0),
2298 RKH_STATE_CAST(&smPT_s0), targetStates,
2299 entryStates, exitStates,
2300 RKH_STATE_CAST(&smPT_s122), 0, TRN_NOT_INTERNAL, 1, &evD,
2301 RKH_STATE_CAST(&smPT_s0));
2304 state = getHistory(&smPT_s12Hist);
2305 TEST_ASSERT_EQUAL_PTR(RKH_STATE_CAST(&smPT_s122), state);
2307 p = unitrazer_getLastOut();
2308 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2312 test_pseudostateTrnToEmptyShallowHistoryWithDefaultTrn(
void)
2316 smPT_trueGuard_ExpectAndReturn(
RKH_CAST(SmPseudoTest, smPseudoTest),
2318 smPT_trS2History_Expect(
RKH_CAST(SmPseudoTest, smPseudoTest), &evE);
2320 stateList_create(targetStates, 2, &smPT_s2Hist, &smPT_s22);
2321 stateList_create(exitStates, 1, &smPT_s0);
2322 stateList_create(entryStates, 2, &smPT_s2, &smPT_s22);
2323 setProfile(smPseudoTest, RKH_STATE_CAST(&smPT_waiting),
2324 RKH_STATE_CAST(&smPT_s0),
2325 RKH_STATE_CAST(&smPT_s0), targetStates,
2326 entryStates, exitStates,
2327 RKH_STATE_CAST(&smPT_s22), 1, TRN_NOT_INTERNAL, 1, &evE,
2328 RKH_STATE_CAST(&smPT_s0));
2332 p = unitrazer_getLastOut();
2333 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2337 test_pseudostateTrnToLoadedShallowHistoryWithDefaultTrn(
void)
2341 stateList_create(targetStates, 2, &smPT_s2Hist, &smPT_s21);
2342 stateList_create(exitStates, 1, &smPT_s0);
2343 stateList_create(entryStates, 2, &smPT_s2, &smPT_s21);
2344 setProfile(smPseudoTest, RKH_STATE_CAST(&smPT_waiting),
2345 RKH_STATE_CAST(&smPT_s0),
2346 RKH_STATE_CAST(&smPT_s0), targetStates,
2347 entryStates, exitStates,
2348 RKH_STATE_CAST(&smPT_s21), 0, TRN_NOT_INTERNAL, 1, &evE,
2349 RKH_STATE_CAST(&smPT_s0));
2351 setHistory(&smPT_s2Hist, RKH_STATE_CAST(&smPT_s21));
2354 p = unitrazer_getLastOut();
2355 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2368 test_InitPseudostateFirstStateAfterInit(
void)
2371 SmInitialPseudoTest *me = (SmInitialPseudoTest *)smInitialPseudoTest;
2373 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2374 smIPT_nS0_Expect((SmInitialPseudoTest *)me);
2380 p = unitrazer_getLastOut();
2381 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2385 test_InitPseudostateTrnToEmptyShHistoryToSimpleState(
void)
2388 SmInitialPseudoTest *me = (SmInitialPseudoTest *)smInitialPseudoTest;
2394 stateList_create(exitStates, 1, &smIPT_s0);
2396 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2397 smIPT_nS0_Expect((SmInitialPseudoTest *)smInitialPseudoTest);
2398 smIPT_xS0_Expect((SmInitialPseudoTest *)smInitialPseudoTest);
2399 smIPT_nS1_Expect((SmInitialPseudoTest *)smInitialPseudoTest);
2400 smIPT_tr1_Expect((SmInitialPseudoTest *)smInitialPseudoTest, &evA);
2401 smIPT_nS11_Expect((SmInitialPseudoTest *)smInitialPseudoTest);
2404 (
RKH_ST_T *)&smIPT_s0, tgEnSt, exitStates, &evA);
2409 p = unitrazer_getLastOut();
2410 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2414 test_InitPseudostateTrnToLoadedShHistory(
void)
2417 SmInitialPseudoTest *me = (SmInitialPseudoTest *)smInitialPseudoTest;
2419 {(
RKH_ST_T *)&smIPT_s1Hist, NULL },
2423 stateList_create(exitStates, 1, &smIPT_s0);
2425 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2426 smIPT_nS0_Expect((SmInitialPseudoTest *)me);
2427 smIPT_xS0_Expect((SmInitialPseudoTest *)me);
2428 smIPT_nS1_Expect((SmInitialPseudoTest *)me);
2429 smIPT_nS12_Expect((SmInitialPseudoTest *)me);
2432 (
RKH_ST_T *)&smIPT_s0, tgEnSt, exitStates, &evA);
2435 setHistory(&smIPT_s1Hist, RKH_STATE_CAST(&smIPT_s12));
2438 p = unitrazer_getLastOut();
2439 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2443 test_InitPseudostateTrnToEmptyShHistoryToCmpState(
void)
2446 SmInitialPseudoTest *me = (SmInitialPseudoTest *)smInitialPseudoTest;
2453 stateList_create(exitStates, 1, &smIPT_s0);
2455 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2456 smIPT_nS0_Expect((SmInitialPseudoTest *)smInitialPseudoTest);
2457 smIPT_xS0_Expect((SmInitialPseudoTest *)smInitialPseudoTest);
2458 smIPT_nS2_Expect((SmInitialPseudoTest *)smInitialPseudoTest);
2459 smIPT_nS21_Expect((SmInitialPseudoTest *)smInitialPseudoTest);
2460 smIPT_nS211_Expect((SmInitialPseudoTest *)smInitialPseudoTest);
2463 (
RKH_ST_T *)&smIPT_s0, tgEnSt, exitStates, &evD);
2468 p = unitrazer_getLastOut();
2469 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2473 test_InitPseudostateTrnToEmptyDeepHistoryToSimpleState(
void)
2476 SmInitialPseudoTest *me = (SmInitialPseudoTest *)smInitialPseudoTest;
2482 stateList_create(exitStates, 1, &smIPT_s0);
2484 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2485 smIPT_nS0_Expect((SmInitialPseudoTest *)me);
2486 smIPT_xS0_Expect((SmInitialPseudoTest *)me);
2487 smIPT_nS3_Expect((SmInitialPseudoTest *)me);
2488 smIPT_nS31_Expect((SmInitialPseudoTest *)me);
2491 (
RKH_ST_T *)&smIPT_s0, tgEnSt, exitStates, &evB);
2496 p = unitrazer_getLastOut();
2497 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2501 test_InitPseudostateTrnToLoadedDeepHistory(
void)
2504 SmInitialPseudoTest *me = (SmInitialPseudoTest *)smInitialPseudoTest;
2510 stateList_create(exitStates, 1, &smIPT_s0);
2512 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2513 smIPT_nS0_Expect((SmInitialPseudoTest *)me);
2514 smIPT_xS0_Expect((SmInitialPseudoTest *)me);
2515 smIPT_nS3_Expect((SmInitialPseudoTest *)me);
2516 smIPT_nS32_Expect((SmInitialPseudoTest *)me);
2519 (
RKH_ST_T *)&smIPT_s0, tgEnSt, exitStates, &evB);
2522 setHistory(&smIPT_s3Hist, RKH_STATE_CAST(&smIPT_s32));
2525 p = unitrazer_getLastOut();
2526 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2530 test_InitPseudostateTrnToLoadedDeepHistoryToNestedState(
void)
2533 SmInitialPseudoTest *me = (SmInitialPseudoTest *)smInitialPseudoTest;
2534 TargetEntrySt tgEnSt[5] = {{(
RKH_ST_T *)&smIPT_s3, (
RKH_ST_T *)&smIPT_s3 },
2540 stateList_create(exitStates, 1, &smIPT_s0);
2542 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2543 smIPT_nS0_Expect((SmInitialPseudoTest *)me);
2544 smIPT_xS0_Expect((SmInitialPseudoTest *)me);
2545 smIPT_nS3_Expect((SmInitialPseudoTest *)me);
2546 smIPT_nS33_Expect((SmInitialPseudoTest *)me);
2547 smIPT_nS331_Expect((SmInitialPseudoTest *)me);
2550 (
RKH_ST_T *)&smIPT_s0, tgEnSt, exitStates, &evB);
2553 setHistory(&smIPT_s3Hist, RKH_STATE_CAST(&smIPT_s331));
2556 p = unitrazer_getLastOut();
2557 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2561 test_InitPseudostateTrnToEmptyShHistoryToNestedSimpleState(
void)
2564 SmInitialPseudoTest *me = (SmInitialPseudoTest *)smInitialPseudoTest;
2571 stateList_create(exitStates, 1, &smIPT_s0);
2573 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2574 smIPT_nS0_Expect((SmInitialPseudoTest *)smInitialPseudoTest);
2575 smIPT_xS0_Expect((SmInitialPseudoTest *)smInitialPseudoTest);
2576 smIPT_nS4_Expect((SmInitialPseudoTest *)smInitialPseudoTest);
2577 smIPT_nS41_Expect((SmInitialPseudoTest *)smInitialPseudoTest);
2578 smIPT_nS411_Expect((SmInitialPseudoTest *)smInitialPseudoTest);
2581 (
RKH_ST_T *)&smIPT_s0, tgEnSt, exitStates, &evC);
2586 p = unitrazer_getLastOut();
2587 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2591 test_InitPseudostateTrnToBranchToSimpleState(
void)
2594 SmInitialPseudoTest *me = (SmInitialPseudoTest *)smInitialPseudoTest;
2596 {(
RKH_ST_T *)&smIPT_choice1, NULL},
2601 stateList_create(exitStates, 1, &smIPT_s0);
2605 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2606 smIPT_nS0_Expect((SmInitialPseudoTest *)me);
2607 smIPT_xS0_Expect((SmInitialPseudoTest *)me);
2608 smIPT_nS5_Expect((SmInitialPseudoTest *)me);
2609 smIPT_tr2_Expect((SmInitialPseudoTest *)me, &evE);
2611 smIPT_nS52_Expect((SmInitialPseudoTest *)me);
2614 (
RKH_ST_T *)&smIPT_s0, tgEnSt, exitStates, &evE);
2619 p = unitrazer_getLastOut();
2620 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2624 test_InitPseudostateTrnToBranchToCmpState(
void)
2627 SmInitialPseudoTest *me = (SmInitialPseudoTest *)smInitialPseudoTest;
2629 {(
RKH_ST_T *)&smIPT_choice1, NULL},
2636 stateList_create(exitStates, 1, &smIPT_s0);
2639 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2640 smIPT_nS0_Expect((SmInitialPseudoTest *)me);
2641 smIPT_xS0_Expect((SmInitialPseudoTest *)me);
2642 smIPT_nS5_Expect((SmInitialPseudoTest *)me);
2643 smIPT_tr2_Expect((SmInitialPseudoTest *)me, &evE);
2648 smIPT_nS51_Expect((SmInitialPseudoTest *)me);
2649 smIPT_nS511_Expect((SmInitialPseudoTest *)me);
2652 (
RKH_ST_T *)&smIPT_s0, tgEnSt, exitStates, &evE);
2657 p = unitrazer_getLastOut();
2658 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2662 test_InitPseudostateTrnToBranchToNestedSimpleState(
void)
2665 SmInitialPseudoTest *me =
RKH_CAST(SmInitialPseudoTest,
2666 smInitialPseudoTest);
2668 {(
RKH_ST_T *)&smIPT_choice1, NULL},
2673 stateList_create(exitStates, 1, &smIPT_s0);
2675 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2676 smIPT_nS0_Expect((SmInitialPseudoTest *)me);
2677 smIPT_xS0_Expect((SmInitialPseudoTest *)me);
2678 smIPT_nS5_Expect((SmInitialPseudoTest *)me);
2679 smIPT_tr2_Expect((SmInitialPseudoTest *)me, &evE);
2682 smIPT_nS51_Expect((SmInitialPseudoTest *)me);
2683 smIPT_nS511_Expect((SmInitialPseudoTest *)me);
2686 (
RKH_ST_T *)&smIPT_s0, tgEnSt, exitStates, &evE);
2691 p = unitrazer_getLastOut();
2692 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2696 test_InitPseudostateTrnToBranchToNestedCmpState(
void)
2699 SmInitialPseudoTest *me =
RKH_CAST(SmInitialPseudoTest,
2700 smInitialPseudoTest);
2702 {(
RKH_ST_T *)&smIPT_choice1, NULL},
2708 stateList_create(exitStates, 1, &smIPT_s0);
2710 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2711 smIPT_nS0_Expect((SmInitialPseudoTest *)me);
2712 smIPT_xS0_Expect((SmInitialPseudoTest *)me);
2713 smIPT_nS5_Expect((SmInitialPseudoTest *)me);
2714 smIPT_tr2_Expect((SmInitialPseudoTest *)me, &evE);
2718 smIPT_nS51_Expect((SmInitialPseudoTest *)me);
2719 smIPT_nS512_Expect((SmInitialPseudoTest *)me);
2720 smIPT_nS5121_Expect((SmInitialPseudoTest *)me);
2723 (
RKH_ST_T *)&smIPT_s0, tgEnSt, exitStates, &evE);
2728 p = unitrazer_getLastOut();
2729 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2733 test_InitPseudostateTrnToBranchToFinalState(
void)
2736 SmInitialPseudoTest *me = (SmInitialPseudoTest *)smInitialPseudoTest;
2737 TargetEntrySt tgEnSt[4] =
2739 {(
RKH_ST_T *)&smIPT_choice1, NULL},
2744 stateList_create(exitStates, 1, &smIPT_s0);
2748 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2749 smIPT_nS0_Expect((SmInitialPseudoTest *)me);
2750 smIPT_xS0_Expect((SmInitialPseudoTest *)me);
2751 smIPT_nS5_Expect((SmInitialPseudoTest *)me);
2752 smIPT_tr2_Expect((SmInitialPseudoTest *)me, &evE);
2759 (
RKH_ST_T *)&smIPT_s0, tgEnSt, exitStates, &evE);
2762 stateList_create(targetStates, 1, &smIPT_s0);
2763 stateList_create(entryStates, 1, &smIPT_s0);
2764 stateList_create(exitStates, 2, &smIPT_s5Final, &smIPT_s5);
2766 smIPT_xS5_Expect((SmInitialPseudoTest *)me);
2767 smIPT_nS0_Expect((SmInitialPseudoTest *)me);
2769 setProfile(smInitialPseudoTest, RKH_STATE_CAST(&smIPT_s5),
2770 NULL, RKH_STATE_CAST(&smIPT_s5),
2771 targetStates, entryStates, exitStates,
2772 RKH_STATE_CAST(&smIPT_s0), 1, TRN_NOT_INTERNAL,
2773 NO_INIT_STATE_MACHINE, &evCompletion,
2774 RKH_STATE_CAST(&smIPT_s5Final));
2779 p = unitrazer_getLastOut();
2780 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2784 test_InitPseudostateTrnToJunctionToSimpleState(
void)
2787 SmInitialPseudoTest *me =
RKH_CAST(SmInitialPseudoTest,
2788 smInitialPseudoTest);
2790 {(
RKH_ST_T *)&smIPT_junction1, NULL},
2794 stateList_create(exitStates, 1, &smIPT_s0);
2796 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2797 smIPT_nS0_Expect((SmInitialPseudoTest *)me);
2798 smIPT_xS0_Expect((SmInitialPseudoTest *)me);
2799 smIPT_nS6_Expect((SmInitialPseudoTest *)me);
2801 smIPT_tr3_Expect((SmInitialPseudoTest *)me, &evF);
2802 smIPT_nS62_Expect((SmInitialPseudoTest *)me);
2805 (
RKH_ST_T *)&smIPT_s0, tgEnSt, exitStates, &evF);
2810 p = unitrazer_getLastOut();
2811 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2815 test_InitPseudostateTrnToJunctionToCmpState(
void)
2818 SmInitialPseudoTest *me =
RKH_CAST(SmInitialPseudoTest,
2819 smInitialPseudoTest);
2821 {(
RKH_ST_T *)&smIPT_junction1, NULL},
2826 stateList_create(exitStates, 1, &smIPT_s0);
2828 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2829 smIPT_nS0_Expect((SmInitialPseudoTest *)me);
2830 smIPT_xS0_Expect((SmInitialPseudoTest *)me);
2831 smIPT_nS6_Expect((SmInitialPseudoTest *)me);
2835 smIPT_tr3_Expect((SmInitialPseudoTest *)me, &evF);
2836 smIPT_nS61_Expect((SmInitialPseudoTest *)me);
2837 smIPT_nS611_Expect((SmInitialPseudoTest *)me);
2840 (
RKH_ST_T *)&smIPT_s0, tgEnSt, exitStates, &evF);
2845 p = unitrazer_getLastOut();
2846 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2850 test_InitPseudostateSMInitialToSimpleState(
void)
2855 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2856 smI0_nS0_Expect((SmInitialPseudoTest *)me);
2862 p = unitrazer_getLastOut();
2863 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2867 test_InitPseudostateSMInitialToCmpState(
void)
2872 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2873 smI1_nS0_Expect((SmInitialPseudoTest *)me);
2874 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2875 smI1_nS01_Expect((SmInitialPseudoTest *)me);
2876 sm_init_expect(RKH_STATE_CAST(&smI1_s0));
2877 sm_trn_expect(RKH_STATE_CAST(&smI1_s0), RKH_STATE_CAST(&smI1_s0));
2878 sm_tsState_expect(RKH_STATE_CAST(&smI1_s0));
2879 sm_enstate_expect(RKH_STATE_CAST(&smI1_s0));
2880 sm_tsState_expect(RKH_STATE_CAST(&smI1_s01));
2881 sm_enstate_expect(RKH_STATE_CAST(&smI1_s01));
2882 sm_nenex_expect(2, 0);
2883 sm_state_expect(RKH_STATE_CAST(&smI1_s01));
2884 sm_evtProc_expect();
2888 p = unitrazer_getLastOut();
2889 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2893 test_InitPseudostateSMInitialToNestedSimpleState(
void)
2898 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2899 smI2_nS0_Expect((SmInitialPseudoTest *)me);
2900 smI2_nS01_Expect((SmInitialPseudoTest *)me);
2901 sm_init_expect(RKH_STATE_CAST(&smI2_s01));
2902 sm_trn_expect(RKH_STATE_CAST(&smI2_s01), RKH_STATE_CAST(&smI2_s01));
2903 sm_tsState_expect(RKH_STATE_CAST(&smI2_s01));
2904 sm_enstate_expect(RKH_STATE_CAST(&smI2_s0));
2905 sm_enstate_expect(RKH_STATE_CAST(&smI2_s01));
2906 sm_nenex_expect(2, 0);
2907 sm_state_expect(RKH_STATE_CAST(&smI2_s01));
2908 sm_evtProc_expect();
2912 p = unitrazer_getLastOut();
2913 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2917 test_InitPseudostateSMInitialToNestedCmpState(
void)
2922 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2923 smI3_nS0_Expect((SmInitialPseudoTest *)me);
2924 smI3_nS01_Expect((SmInitialPseudoTest *)me);
2925 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2926 smI3_nS011_Expect((SmInitialPseudoTest *)me);
2927 sm_init_expect(RKH_STATE_CAST(&smI3_s01));
2928 sm_trn_expect(RKH_STATE_CAST(&smI3_s01), RKH_STATE_CAST(&smI3_s01));
2929 sm_tsState_expect(RKH_STATE_CAST(&smI3_s01));
2930 sm_enstate_expect(RKH_STATE_CAST(&smI3_s0));
2931 sm_enstate_expect(RKH_STATE_CAST(&smI3_s01));
2932 sm_tsState_expect(RKH_STATE_CAST(&smI3_s011));
2933 sm_enstate_expect(RKH_STATE_CAST(&smI3_s011));
2934 sm_nenex_expect(3, 0);
2935 sm_state_expect(RKH_STATE_CAST(&smI3_s011));
2936 sm_evtProc_expect();
2940 p = unitrazer_getLastOut();
2941 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2945 test_InitPseudostateSMInitialToJunctionToSimpleState(
void)
2952 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2953 smIPT_tr1_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2954 smI4_nS0_Expect((SmInitialPseudoTest *)me);
2955 sm_init_expect(RKH_STATE_CAST(&smI4_junction1));
2956 sm_trn_expect(RKH_STATE_CAST(&smI4_junction1),
2957 RKH_STATE_CAST(&smI4_junction1));
2958 sm_tsState_expect(RKH_STATE_CAST(&smI4_junction1));
2959 sm_tsState_expect(RKH_STATE_CAST(&smI4_s0));
2960 sm_enstate_expect(RKH_STATE_CAST(&smI4_s0));
2961 sm_nenex_expect(1, 0);
2962 sm_state_expect(RKH_STATE_CAST(&smI4_s0));
2963 sm_evtProc_expect();
2967 p = unitrazer_getLastOut();
2968 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
2972 test_InitPseudostateSMInitialToJunctionToCmpState(
void)
2981 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2982 smIPT_tr2_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2983 smI4_nS1_Expect((SmInitialPseudoTest *)me);
2984 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
2985 smI4_nS11_Expect((SmInitialPseudoTest *)me);
2986 sm_init_expect(RKH_STATE_CAST(&smI4_junction1));
2987 sm_trn_expect(RKH_STATE_CAST(&smI4_junction1),
2988 RKH_STATE_CAST(&smI4_junction1));
2989 sm_tsState_expect(RKH_STATE_CAST(&smI4_junction1));
2990 sm_tsState_expect(RKH_STATE_CAST(&smI4_s1));
2991 sm_enstate_expect(RKH_STATE_CAST(&smI4_s1));
2992 sm_tsState_expect(RKH_STATE_CAST(&smI4_s11));
2993 sm_enstate_expect(RKH_STATE_CAST(&smI4_s11));
2994 sm_nenex_expect(2, 0);
2995 sm_state_expect(RKH_STATE_CAST(&smI4_s11));
2996 sm_evtProc_expect();
3000 p = unitrazer_getLastOut();
3001 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
3005 test_InitPseudostateSMInitialToBranchToSimpleState(
void)
3010 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
3013 smIPT_tr1_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
3014 smI5_nS0_Expect((SmInitialPseudoTest *)me);
3015 sm_init_expect(RKH_STATE_CAST(&smI5_branch1));
3016 sm_trn_expect(RKH_STATE_CAST(&smI5_branch1),
3017 RKH_STATE_CAST(&smI5_branch1));
3018 sm_tsState_expect(RKH_STATE_CAST(&smI5_branch1));
3019 sm_tsState_expect(RKH_STATE_CAST(&smI5_s0));
3020 sm_enstate_expect(RKH_STATE_CAST(&smI5_s0));
3021 sm_nenex_expect(1, 0);
3022 sm_state_expect(RKH_STATE_CAST(&smI5_s0));
3023 sm_evtProc_expect();
3027 p = unitrazer_getLastOut();
3028 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
3032 test_InitPseudostateSMInitialToBranchToCmpState(
void)
3037 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
3042 smIPT_tr2_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
3043 smI5_nS1_Expect((SmInitialPseudoTest *)me);
3044 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
3045 smI5_nS11_Expect((SmInitialPseudoTest *)me);
3046 sm_init_expect(RKH_STATE_CAST(&smI5_branch1));
3047 sm_trn_expect(RKH_STATE_CAST(&smI5_branch1),
3048 RKH_STATE_CAST(&smI5_branch1));
3049 sm_tsState_expect(RKH_STATE_CAST(&smI5_branch1));
3050 sm_tsState_expect(RKH_STATE_CAST(&smI5_s1));
3051 sm_enstate_expect(RKH_STATE_CAST(&smI5_s1));
3052 sm_tsState_expect(RKH_STATE_CAST(&smI5_s11));
3053 sm_enstate_expect(RKH_STATE_CAST(&smI5_s11));
3054 sm_nenex_expect(2, 0);
3055 sm_state_expect(RKH_STATE_CAST(&smI5_s11));
3056 sm_evtProc_expect();
3060 p = unitrazer_getLastOut();
3061 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
3065 test_InitPseudostateTrnToInitialToSimpleStateWithNullTrn(
void)
3068 SmInitialPseudoTest *me = (SmInitialPseudoTest *)smInitialPseudoTest;
3073 stateList_create(exitStates, 1, &smIPT_s0);
3075 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
3076 smIPT_nS0_Expect((SmInitialPseudoTest *)me);
3077 smIPT_xS0_Expect((SmInitialPseudoTest *)me);
3078 smIPT_nS7_Expect((SmInitialPseudoTest *)me);
3079 smIPT_nS71_Expect((SmInitialPseudoTest *)me);
3080 smIPT_xS71_Expect((SmInitialPseudoTest *)me);
3081 smIPT_tr4_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCompletion);
3082 smIPT_nS72_Expect((SmInitialPseudoTest *)me);
3085 (
RKH_ST_T *)&smIPT_s0, tgEnSt, exitStates, &evG);
3088 sm_dch_expect(evCompletion.
e, RKH_STATE_CAST(&smIPT_s71));
3089 sm_trn_expect(RKH_STATE_CAST(&smIPT_s71), RKH_STATE_CAST(&smIPT_s72));
3090 sm_tsState_expect(RKH_STATE_CAST(&smIPT_s72));
3091 sm_exstate_expect(RKH_STATE_CAST(&smIPT_s71));
3092 sm_enstate_expect(RKH_STATE_CAST(&smIPT_s72));
3093 sm_nenex_expect(1, 1);
3094 sm_state_expect(RKH_STATE_CAST(&smIPT_s72));
3095 sm_evtProc_expect();
3100 p = unitrazer_getLastOut();
3101 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
3105 test_InitPseudostateSMInitialToSimpleStateWithNullTrn(
void)
3108 SmInitialPseudoTest *me = (SmInitialPseudoTest *)smInitial6;
3110 smIPT_init_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCreation);
3111 smIPT_tr4_Expect((SmInitialPseudoTest *)me, (
RKH_EVT_T *)&evCompletion);
3116 sm_dch_expect(evCompletion.
e, RKH_STATE_CAST(&smI6_s0));
3117 sm_trn_expect(RKH_STATE_CAST(&smI6_s0), RKH_STATE_CAST(&smI6_s1));
3118 sm_tsState_expect(RKH_STATE_CAST(&smI6_s1));
3119 sm_exstate_expect(RKH_STATE_CAST(&smI6_s0));
3120 sm_enstate_expect(RKH_STATE_CAST(&smI6_s1));
3121 sm_nenex_expect(1, 1);
3122 sm_state_expect(RKH_STATE_CAST(&smI6_s1));
3123 sm_evtProc_expect();
3127 p = unitrazer_getLastOut();
3128 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
#define RKH_FALSE
Standard define.
#define RKH_TRUE
Standard define.
#define RKH_STATIC_EVENT(ev_obj, ev_sig)
This macro declares and initializes the event structure ev_ob with ev_sig signal number and establish...
ruint rkh_sm_dispatch(RKH_SM_T *me, RKH_EVT_T *e)
Executes a state machine in a run-to-completation (RTC) model.
RKH_RCODE_T
Return codes from rkh_sm_dispatch() function.
void rkh_sm_init(RKH_SM_T *me)
Inits a previously created state machine calling its initializing action.
void rkh_sm_clear_history(RKHROM RKH_SHIST_T *h)
Erase the history of a state. It can be a shallow or deep history.
#define RKH_FILTER_OFF_ALL_SIGNALS()
Emmit all enabled trace events related to signals.
#define RKH_FILTER_OFF_GROUP_ALL_EVENTS(grp)
Emit (enable) all events in a specific group.
#define RKH_FILTER_OFF_EVENT(evt)
Emit (enable) one trace event. Use the RKH_TRC_ALL_EVENTS to enable all trace events.
#define RKH_FILTER_OFF_SMA(sma)
Emmit the enabled trace events related to a specified active object.
#define RKH_TR_FWK_AO(actObj_)
Entry symbol table for active object.
#define RKH_TR_FWK_SIG(stateObj_)
Entry symbol table for event signal.
#define RKH_TR_FWK_STATE(actObj_, stateObj_)
Entry symbol table for state object.
Specifies the interface of the mapping table manager to deal with native priority algorithm.
#define RKH_CAST(_type, _obj)
Perform downcast of a reference of a base class to one of its derived classes.
Specifies the interface of the state-machine manager.
Specifies the interface of trace facility.
#define RKH_TG_SM
State Machine group (SM)
#define RKH_TE_FWK_ASSERT
Assertion expression was evaluated to false.
Specifies the runtime filter operations for the trace facility.
Defines the trace records.
Specifies the trace stream manager (circular buffer).
Represents events without parameters.
RKH_SIG_T e
Signal of the event instance.
Describes the state machine.
Describes the SMA (active object in UML).
Describes the common properties of regular states (basic, composite, and submachine).
Interface of unit test with Trazer application.
#define sm_cleanup()
Return the system under test to its initial state after the test.
#define sm_init()
Establish the preconditions to the tests.
#define sm_verify()
Makes sure there are no unused expectations, if there are, this function causes the test to fail.