27 #include "unity_fixture.h"
31 #include "test_common.h"
65 TEST_TEAR_DOWN(utrzsm)
80 TEST(utrzsm, expectEventOk)
87 sm_trn_expect(CST(&s21), CST(&s211));
101 p = unitrazer_getLastOut();
102 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
105 TEST(utrzsm, expectEventOutOfSequence)
109 sm_trn_expect(CST(&s21), CST(&s211));
113 p = unitrazer_getLastOut();
114 TEST_ASSERT_EQUAL(UT_PROC_FAIL, p->status);
115 TEST_ASSERT_EQUAL_STRING(
"Out of order Trace event. occurred: 'ENSTATE' "
116 "expected: 'TRN'.", p->msg);
119 TEST(utrzsm, expectEventWithUnexpectedArg)
123 sm_trn_expect(CST(&s21), CST(&s211));
127 p = unitrazer_getLastOut();
128 TEST_ASSERT_EQUAL(UT_PROC_FAIL, p->status);
129 TEST_ASSERT_EQUAL_STRING(
"Event 'TRN' occurred with unexpected "
130 "value for argument 'tst=s21' expected "
131 "value='s211'.", p->msg);
134 TEST(utrzsm, ignoreEvt)
143 p = unitrazer_getLastOut();
144 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
148 p = unitrazer_getLastOut();
149 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
152 TEST(utrzsm, ignoreOneArg)
156 sm_trn_expect(CST(&s21), CST(&s211));
157 sm_trn_ignoreArg_sourceState();
161 p = unitrazer_getLastOut();
162 TEST_ASSERT_EQUAL(UT_PROC_SUCCESS, p->status);
165 TEST(utrzsm, ignoreOneArgBeforeExpect)
169 sm_trn_expect(CST(&s21), CST(&s211));
171 sm_trn_ignoreArg_sourceState();
173 p = unitrazer_getLastOut();
174 TEST_ASSERT_EQUAL(UT_PROC_FAIL, p->status);
175 TEST_ASSERT_EQUAL_STRING(
"IgnoreArg called before Expect on event 'TRN'."
181 TEST(utrzsm, eventMoreThanExpect)
185 sm_trn_expect(CST(&s21), CST(&s211));
191 p = unitrazer_getLastOut();
192 TEST_ASSERT_EQUAL(UT_PROC_FAIL, p->status);
193 TEST_ASSERT_EQUAL_STRING(
"Event 'ENSTATE' occurred more times than"
194 " expected.", p->msg);
#define RKH_ROM_STATIC_EVENT(ev_obj, ev_sig)
This macro declares and initializes the event structure ev_ob with ev_sig signal number and establish...
#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_TRN(actObj_, sourceState_, targetState_)
Source and target state of the transition. The target could be either basic state,...
RKH framwwork platform - independent interface.
Interface of unit test with Trazer application.