58 #include "Mocksys_mon_cfg.h"
65 #define DUMMY_TSK_ID_0 0
66 #define DUMMY_TSK_ID_1 1
67 #define DUMMY_CYCLETIME 10
68 #define DUMMY_MAX_JITTER 1
116 OS_GetTickCount_ExpectAndReturn(0u);
122 OS_GetTickCount_ExpectAndReturn(0u);
125 OS_GetTickCount_ExpectAndReturn(100u);
131 OS_GetTickCount_ExpectAndReturn(0u);
139 OS_GetTickCount_ExpectAndReturn(100u);
140 DIAG_Handler_ExpectAndReturn(
149 TEST_ASSERT_NOT_EQUAL(424242, notifications[
SYSM_TASK_ID_MAX + 1u].timestampEnter);
154 OS_EnterTaskCritical_Expect();
155 OS_ExitTaskCritical_Expect();
158 TEST_ASSERT_EQUAL(UINT32_MAX, notifications[
DUMMY_TSK_ID_0].timestampEnter);
160 OS_EnterTaskCritical_Expect();
161 OS_ExitTaskCritical_Expect();
164 TEST_ASSERT_EQUAL(0, notifications[
DUMMY_TSK_ID_0].timestampEnter);
169 OS_EnterTaskCritical_Expect();
170 OS_ExitTaskCritical_Expect();
173 TEST_ASSERT_EQUAL(UINT32_MAX, notifications[
DUMMY_TSK_ID_0].timestampEnter);
175 const uint32 exitTime = 100;
176 OS_EnterTaskCritical_Expect();
177 OS_ExitTaskCritical_Expect();
180 TEST_ASSERT_EQUAL(exitTime, notifications[
DUMMY_TSK_ID_0].timestampExit);
182 TEST_ASSERT_EQUAL(exitTime + 1, notifications[
DUMMY_TSK_ID_0].duration);
187 OS_EnterTaskCritical_Ignore();
192 TEST_ASSERT_NOT_EQUAL(UINT32_MAX, notifications[
DUMMY_TSK_ID_0].timestampEnter);
193 TEST_ASSERT_NOT_EQUAL(UINT32_MAX, notifications[
DUMMY_TSK_ID_0].timestampExit);
@ DIAG_ID_SYSTEMMONITORING
Assert macro implementation.
SYSM_NOTIFICATION_s * TEST_SYSM_GetNotifications(void)
void SYSM_CheckNotifications(void)
overall system monitoring
void SYSM_Notify(SYSM_TASK_ID_e tsk_id, SYSM_NOTIFY_TYPE_e state, uint32_t time)
Sets needed bits to indicate that a task is running.
@ SYSM_HANDLING_SWITCHOFFCONTACTOR
enum SYSM_TASK_ID SYSM_TASK_ID_e
#define TEST_ASSERT_PASS_ASSERT(_code_under_test)
assert whether assert macro has passed
#define TEST_ASSERT_FAIL_ASSERT(_code_under_test)
assert whether assert macro has failed
void testSYSM_NotifyHitAssertWithIllegalNotifyType(void)
void testSYSM_NotifyInvalidTaskID(void)
void testSYSM_CheckNotificationsSYSMDisabled(void)
void testSYSM_CheckNotificationsProvokeDurationViolation(void)
void testSYSM_CheckNotificationsEarlyExitOnTimestampEquality(void)
void TEST_SYSM_DummyCallback_0(SYSM_TASK_ID_e tsk_id)
void testSYSM_NotifyEnterTimestampProperlySet(void)
void TEST_SYSM_DummyCallback_1(SYSM_TASK_ID_e tsk_id)
void testSYSM_NotifyExitTimestampProperlySetAndDurationCalculated(void)
SYSM_MONITORING_CFG_s sysm_ch_cfg[2]