57 #include "Mockalgorithm_cfg.h"
59 #include "Mocktest_algorithm_stubs.h"
66 TEST_INCLUDE_PATH(
"../../src/app/application/algorithm")
67 TEST_INCLUDE_PATH("../../src/app/application/algorithm/config")
96 OS_EnterTaskCritical_Ignore();
97 OS_ExitTaskCritical_Ignore();
105 OS_EnterTaskCritical_Ignore();
106 OS_ExitTaskCritical_Ignore();
116 TEST_AlgorithmInitializationFunction_ExpectAndReturn(
STD_OK);
120 OS_GetTickCount_ExpectAndReturn(0u);
121 TEST_AlgorithmComputeFunction_Expect();
122 ALGO_MarkAsDone_Expect(0u);
123 OS_GetTickCount_ExpectAndReturn(0u);
124 TEST_AlgorithmComputeFunction_Expect();
125 ALGO_MarkAsDone_Expect(1u);
139 OS_EnterTaskCritical_Ignore();
140 OS_ExitTaskCritical_Ignore();
158 OS_EnterTaskCritical_Ignore();
159 OS_ExitTaskCritical_Ignore();
164 TEST_AlgorithmInitializationFunction_ExpectAndReturn(
STD_NOT_OK);
168 OS_GetTickCount_ExpectAndReturn(0u);
169 TEST_AlgorithmComputeFunction_Expect();
170 ALGO_MarkAsDone_Expect(0u);
186 OS_EnterTaskCritical_Ignore();
187 OS_ExitTaskCritical_Ignore();
188 OS_GetTickCount_IgnoreAndReturn(0u);
189 TEST_AlgorithmComputeFunction_Ignore();
190 ALGO_MarkAsDone_Ignore();
197 TEST_AlgorithmInitializationFunction_ExpectAndReturn(
STD_OK);
217 OS_EnterTaskCritical_Ignore();
218 OS_ExitTaskCritical_Ignore();
223 TEST_AlgorithmInitializationFunction_ExpectAndReturn(42u);
233 OS_EnterTaskCritical_Ignore();
234 OS_ExitTaskCritical_Ignore();
242 TEST_AlgorithmInitializationFunction_ExpectAndReturn(
STD_OK);
243 OS_GetTickCount_ExpectAndReturn(0u);
244 TEST_AlgorithmComputeFunction_Expect();
245 ALGO_MarkAsDone_Expect(0u);
246 OS_GetTickCount_ExpectAndReturn(0u);
247 TEST_AlgorithmComputeFunction_Expect();
248 ALGO_MarkAsDone_Expect(1u);
253 const uint32_t startTime = 500u;
254 const uint32_t currentTime = 0u;
259 OS_GetTickCount_ExpectAndReturn(currentTime);
265 const uint32_t startTime = 500u;
266 const uint32_t currentTime = 500u;
271 OS_GetTickCount_ExpectAndReturn(currentTime);
277 const uint32_t startTime = 500u;
278 const uint32_t currentTime = 50000u;
283 OS_GetTickCount_ExpectAndReturn(currentTime);
void ALGO_UnlockInitialization(void)
Calling this function sets a signal that lets ALGO_Initialization() know that the initialization has ...
void TEST_ALGO_ResetInitializationRequest()
void ALGO_MainFunction(void)
handles the call of different algorithm functions when cycle time has expired
void ALGO_MonitorExecutionTime(void)
monitors the calculation duration of the different algorithms
Headers for the driver for the storage in the EEPROM memory.
Definition of foxBMS standard types.
#define NULL_PTR
Null pointer.
void testUninitializedCallsNothing(void)
const uint16_t algo_length
void testUnlockInitializationInvalidAlgorithmConfiguration(void)
void testUnlockInitialization(void)
void testMonitorFunctionPassBecauseInTime(void)
void testCycleTimeZero(void)
void testTwoTimesInitialization(void)
void testMonitorFunctionStopBecauseOutOfTime(void)
void testUnsuccessfulInitialization(void)
ALGO_TASKS_s algo_algorithms[]
void testWrongInitializationImplementation(void)
void testMonitorFunctionPassBecauseNotRunning(void)
STD_RETURN_TYPE_e TEST_AlgorithmInitializationFunction(void)
void TEST_AlgorithmComputeFunction(void)
#define TEST_ASSERT_FAIL_ASSERT(_code_under_test)
assert whether assert macro has failed