26 #include "unity_fixture.h"
30 #include "aotest_act.h"
31 #include "test_common.h"
38 TEST_GROUP(utrzexeact);
45 TEST_SETUP(utrzexeact)
53 TEST_TEAR_DOWN(utrzexeact)
68 TEST(utrzexeact, expectEventOk)
76 CST(&s21), foo_set2zero );
90 p = unitrazer_getLastOut();
91 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
94 TEST(utrzexeact, expectEventOutOfSequence)
98 sm_trn_expect(CST(&s21), CST(&s211));
102 p = unitrazer_getLastOut();
103 TEST_ASSERT_EQUAL(UT_PROC_FAIL, p->status);
104 TEST_ASSERT_EQUAL_STRING(
"Out of order Trace event. occurred: 'ENSTATE' "
105 "expected: 'TRN'.", p->msg);
108 TEST(utrzexeact, expectEventWithUnexpectedArg)
112 sm_trn_expect(CST(&s21), CST(&s211));
116 p = unitrazer_getLastOut();
117 TEST_ASSERT_EQUAL(UT_PROC_FAIL, p->status);
118 TEST_ASSERT_EQUAL_STRING(
"Event 'TRN' occurred with unexpected "
119 "value for argument 'tst=s21' expected "
120 "value='s211'.", p->msg);
123 TEST(utrzexeact, ignoreEvt)
132 p = unitrazer_getLastOut();
133 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
137 p = unitrazer_getLastOut();
138 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
141 TEST(utrzexeact, ignoreOneArg)
145 sm_trn_expect(CST(&s21), CST(&s211));
146 sm_trn_ignoreArg_sourceState();
150 p = unitrazer_getLastOut();
151 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
154 TEST(utrzexeact, ignoreOneArgBeforeExpect)
158 sm_trn_expect(CST(&s21), CST(&s211));
160 sm_trn_ignoreArg_sourceState();
162 p = unitrazer_getLastOut();
163 TEST_ASSERT_EQUAL(UT_PROC_FAIL, p->status);
164 TEST_ASSERT_EQUAL_STRING(
"IgnoreArg called before Expect on event 'TRN'."
#define RKH_TR_SM_EVT_PROC(actObj_)
The arrived event was succesfully processed and HSM resides in an allowed state.
#define RKH_TR_SM_ENSTATE(actObj_, state_)
Entered state.
#define RKH_TR_SM_EXE_ACT(actionType_, actObj_, state_, action_)
Executes a behavior (action) of state machine, it could be an entry, exit, effect,...
#define RKH_TR_SM_TRN(actObj_, sourceState_, targetState_)
Source and target state of the transition. The target could be either basic state,...
RKH framwwork platform - independent interface.
@ RKH_SUBTE_SM_EXE_ACT_EN
Executes a behavior (action) of state machine, it could be an entry, exit, effect,...
Interface of unit test with Trazer application.