//***************************************************************************** // (C) Automotive Lighting Reutlingen GmbH // Tuebinger Strasse 123, 72762 Reutlingen, Germany // // Automotive Lighting Reutlingen GmbH owns all the rights to this work. // This work shall not be copied, reproduced, used, modified, transferred // or its information shall not be disclosed without the prior written // authorization of Automotive Lighting Reutlingen GmbH. //***************************************************************************** //----------------------------------------------------------------------------- /// \file Test.c /// /// \brief Unit Test Cases for Stepper-Complex-Device-Driver CddStp /// /// Docu in 'Stages' /// Process > Guidance > Software Design, Construction, Unit Testing > Unit Testing Architecture /// http://derut01stagesmp:8080/stages/#/workspace/2296/_vv/(process/guidance/_UmrmUEOfGt6vUrwWBN-guQ) /// /// All the docu in one file: /// \\derut01quest11\ECU_FLM3_Docu\04_SW\01_DOCU\05_MSIT\Unit testing arch.docx /// /// FYI: /// I have tried several combinations of Compiler and Code Coverage tools for the unit tests. /// This table could be helpful.For your purpose you can choose the proper combination. /// NMake (Src-Properties) | License | Debuggen | Coverage /// WIN_GCC + GCOV | free | No | C0 - Coverage /// WIN_GCC + CTC | CTC license | No | C0 / C1 - Coverage /// WIN_VC + GCOV | free | Yes | No /// WIN_VC + CTC | CTC license | Yes | C0 / C1 - Coverage /// Little Tips for CTC - Users: /// We have few licenses.Please activate CTC only if it is necessary. /// Use Rebuild instead of Build to make sure all the test cases are run properly. /// /// /// \author Jürgen Kling ALDE-RT (f84304b) /// mailTo: Kling.Juergen[at]marelli.com //----------------------------------------------------------------------------- #include #include #include // tbd-FLM3 #include #include #include #include #include #include #include #include <../../Cust/Hq/Hh001/App/Bsw/Cdd/CddStp/CddStpPrj.h> #include <../../Cust/Hq/Hh001/App/Bsw/Cdd/CddStp/CddStpData.h> #include "CddStp.h" #include #include #include #include <88XX/_CddStp88XX.h> #include <88XX/CddStp88XX.h> #include <88XX/CddStp88XXVolt.h> #include <88XX/CddStp88XX_FctTables.h> #include <88XX/CddStp88XX_HalStp.h> #include <88XX/CddStp88XXTemp.h> #include <88XX/CddStp88XXVolt.h> #include <8899/CddStp8899Com.h> #include <8889A/CddStp8889A_StallDetection.h> #include <../../Cust/Hq/Hh001/App/Bsw/Cdd/CddStp/CddStp_Tsp.h> #include <../../Cust/Hq/Hh001/App/Bsw/Cdd/CddStp/ctscCddStp.h> #include <../../Cust/Hq/Hh001/App/Bsw/Cdd/CddStp/CodM_Para/CodM_Para_System.h> #include <../../Cust/Hq/Hh001/App/Bsw/Cdd/CddStp/CodM_Para/CodM_Para_Lwr.h> #include // tCddStp_Eft_EcuVarCfg #ifdef CDDSTP_CFG_SIMULATION // defined in '.\Asr6\Src\Src_AL\Cust\Bw\Bw16\App\Bsw\Cdd\CddStp\CddStpPrj.h' #include #endif #ifndef UNIT_TEST // NOT Unit-Tests = 'regular' #error NOT Unit-Tests = 'regular' #else // Unit-Tests! // ok: UT! #endif //============================================================================= // Private typedefs //============================================================================= typedef struct { tiu32Voltage_mV lVal; tiu8Crc0 ucCrc; } tisVBat_ASIL; typedef enum { eInit = 0, eLow3 = 1, eLow2 = 2, eLow1 = 3, eNormal = 4, eHigh1 = 5, eHigh2 = 6, eUndef = 99 // only UT } tVolt_Range; //typedef unsigned char tieMountingSide; //============================================================================= // defines //============================================================================= #define CFA_CNT_STP_88XX (4u) #define CFA_CNT_STP_ONBRD (4u) #ifndef eIoHwAbUser_MountingSide_Right #define eIoHwAbUser_MountingSide_Right 170U #endif /*eIoHwAbUser_MountingSide_Right*/ #ifndef eIoHwAbUser_MountingSide_Left #define eIoHwAbUser_MountingSide_Left 85U #endif /*eIoHwAbUser_MountingSide_Left*/ //============================================================================= // global variables //============================================================================= unsigned long CddStp_UnitTest__u32Voltage_mV; uint32 CddStp_UnitTest__TspTickCount; boolean CddStp_UnitTest__TspIsIni; boolean CddStp_UnitTest__TspIsRunning; uint8 CddStpDyn_UnitTest___tCodingAreaLwr_Modus_eSchrittMod; tFTimer CddStp88XX_aftWaitErrInh[CFA_CNT_STP_88XX]; boolean CtrlStp_boInit = FALSE; // FLM3 - should NOT happen in Hongqi-H5 boolean boCddStp_Cycle10ms_Initialized = FALSE; boolean CddStp_boDioErrLwr = FALSE; boolean CddStp8899_boEftCodValid = FALSE; // flag to check only once boolean bIsLowtemp = FALSE; uint8 ucNormalTiming = 0u; tStpState CddStp88XX_aStpStateOld[CFA_CNT_STP_88XX]; TIMER CddStp88XX_astWaitErrPrealarm[CFA_CNT_STP_88XX]; tStateTempCddStp88XX CddStp88XX_aeTempState[CFA_CNT_STP_88XX]; tRomPara_CodingArea Test_applicationCodingData; // used via 'CDDSTP_ApplCodData_...' //============================================================================= // local variables //============================================================================= static uint32 CddStp_UnitTest__GptTickCount; static uint32 CddStp_UnitTest__GptIsIni; static uint32 CddStp_UnitTest__GptIsRunning; static tieMountingSide CddStp_UnitTest__MountingSide = eIoHwAbUser_MountingSide_Left; extern tieDataStatus CddStp_UnitTest__EftDataStatus; extern tCddStp_Eft_EcuVarCfg Test_Eft_EcuVarCfg_Used[2]; // = CDDTPS92520_Eft_EcuVarCfg_Default; -- 00: not fitted | 01 : DRV8899 | 02 : DRV8889A static tieDataStatus CddStp_UnitTest__CodDataStatus = tieDataStatus_Invalid; static tCddStp_Eft_EcuVarCfg CddStp_UnitTest__tieEftData[3]; static tisAllStpActual CddStp_UnitTest__tisAllStpActual; // Rte_Write_ppCddStpActual0_sStpActualValues / Rte_Write_ctacCddStp_ppCddStpActual0_sStpActualValues static tis32Temperature_mCelsius CddStp_UnitTest__SensPcbTemperature0_lActual = tieDataStatus_Invalid; static uint8 CddStpDyn_UnitTest___tCodingAreaSys_STP_SPANNUNG_LO3 = 73; // [0.1 V] Spannungsschwelle fuer die harte Abschaltung des Treibers bei Unterspannung static uint8 CddStpDyn_UnitTest___tCodingAreaSys_STP_SPANNUNG_LO2 = 83; // [0.1 V] Spannungsschwelle für das Anhalten des Motors bei Unterspannung (N.b.: KEIN Anhalten bei Ref-Run) static uint8 CddStpDyn_UnitTest___tCodingAreaSys_STP_SPANNUNG_LO1 = 93; // [0.1 V] Spannungsschwelle für die Reaktivierung des Motors nach Unterspannung static uint8 CddStpDyn_UnitTest___tCodingAreaSys_STP_SPANNUNG_HI1 = 173; // [0.1 V] Spannungsschwelle für die Reaktivierung des Motors nach Ueberspannung static uint8 CddStpDyn_UnitTest___tCodingAreaSys_STP_SPANNUNG_HI2 = 183; // [0.1 V] Spannungsschwelle für das Anhalten des Motors bei Ueberspannung static uint8 CddStpDyn_UnitTest___tCodingAreaSys_STP_SPANNUNG_RED = 113; // [0.1 V] Spannung, unter der die maximale Verstellfrequenz reduziert wird. Die Reduktion der maximalen Verstellfrequenz erfolgt annaehernd linear zur Versorgungsspannung. static uint8 CddStpDyn_UnitTest___tCodingAreaSys_STP_ZEIT_TT = 63; // [s] Dauer des Tieftemperaturmodus, unabhaengig davon, ob die Tieftemperaturinformation nach Ende des Zeitintervalls noch anliegt. Der Tieftemperaturzustand kann nur einmal pro Power-On-Zyklus aktiviert werden. static uint8 CddStpDyn_UnitTest___tCodingAreaSys_STP_ZEIT_HT = 63; // [s] Minimale Dauer des Hochtemperaturmodus. Der Hochtemperaturmodus wird jedes Mal aktiviert, wenn vom Schrittmotortreiber eine Uebertemperaturwarnung erfolgt und verbleibt für mindestens STP_ZEIT_HT in diesem Zustand. static uint8 CddStpDyn_UnitTest___tCodingAreaSys_STP_WERT_TT = 33; // [Deg + 40] Temperaturgrenzwert, unter dem der Tieftemperaturmodus aktiviert wird static uint8 CddStpDyn_UnitTest___tCodingAreaSys_STP_QUELLE_TT = 16; // Source of temp.: 1..12=NTC1-12, 16=PCB, 17=CAN - SWRS.27423 ----- < 0 = Temperaturmessung durch Sensor im FLE //static boolean CddStpDyn_UnitTest___tCodingAreaLwr_Modus_biEnable = FALSE; uint8 CddStpDyn_UnitTest___tCodingAreaLwr_Modus_eSchrittMod = NvmPara_eSchrittMod8; static uint8 CddStpDyn_UnitTest___tCodingAreaLwr_Modus_u4OlFehlerzaehler = 3; static boolean CddStpDyn_UnitTest___tCodingAreaLwr_Modus_biTestKeinFehlereintrag = FALSE; static boolean CddStpDyn_UnitTest___tCodingAreaLwr_Modus_biTestOlIgnor = FALSE; static boolean CddStpDyn_UnitTest___tCodingAreaLwr_Modus_biVorwarnNeuref = FALSE; //?? static uint8 CddStpDyn_UnitTest___tCodingAreaLwr_Modus_eVorwarnQuelle = 0; //?? #define DEM_EVENT_STATUS_UNITTEST_DEFAULT 0xDD static Dem_EventStatusType CddStp_UnitTest__EventStatus = DEM_EVENT_STATUS_UNITTEST_DEFAULT; //static uint16 CddStp_UnitTest__EventStatus = DEM_EVENT_STATUS_UNITTEST_DEFAULT; //============================================================================= // local function stubs //============================================================================= static void CleanUp(void); // Gpt_ValueType Gpt_GetTimeElapsed( Gpt_ChannelType ct) { return 0; } FUNC(Gpt_ValueType, GPT_CODE) Gpt_GetTimeElapsed( Gpt_ChannelType Channel) { return CddStp_UnitTest__GptTickCount; } FUNC(Gpt_ValueType, GPT_CODE) Gpt_GetTimeRemaining(Gpt_ChannelType Channel) { return CddStp_UnitTest__GptTickCount; } FUNC(void, GPT_CODE) Gpt_StopTimer( Gpt_ChannelType Channel) { CddStp_UnitTest__GptIsRunning = FALSE; } FUNC(void, GPT_CODE) Gpt_StartTimer( Gpt_ChannelType Channel, Gpt_ValueType Value) { CddStp_UnitTest__GptIsRunning = TRUE; } void IoHwAbUser_GetMountingSide(tieMountingSide* peVal) { *peVal = CddStp_UnitTest__MountingSide; } void IoHwAbUser_SetLwrDrvOff(boolean boValue) {} void IoHwAbUser_SetLwrSleep(boolean boValue) {} void IoHwAbUser_SetDirLwr(boolean boValue) {} Std_ReturnType Rte_Read_ppareCodMCodingDataStatus0_eCompleteCodingDataStatus(tieDataStatus * ptr) { *ptr = CddStp_UnitTest__CodDataStatus; return (Std_ReturnType)RTE_E_OK; } Std_ReturnType Rte_Read_ppareCodMEftCrcStatus0_sVal (tieDataStatus * ptr) { return 0; } Std_ReturnType Rte_Read_ppareCtrlStpTarget0_StpTargetValues (tisAllStpTarget * ptr) { return 0; } Std_ReturnType Rte_Read_ppareRSensPcbTemperature0_lActual (tis32Temperature_mCelsius * ptr) { return *ptr = CddStp_UnitTest__SensPcbTemperature0_lActual; } Std_ReturnType Rte_Write_ppaseCddStpActual0_sStpActualValues (const tisAllStpActual * ptr) { return 0; } //============================================================================= // external variables //============================================================================= extern uint32 CddStp_Counter_Init; // yet not available in Hongqi-H5 extern uint32 CddStp_Counter_DeInit; extern uint32 CddStp_Counter_Cycle; extern uint32 CddStp_Counter_StartRefRun; extern uint8 CddStp88XX_ucNumOfSteppers_EFT; extern uint8 CddStp88XX_ucNumOfSteppers_Coding; extern tActCtrl CddStp88XX_aStpCtrl[CFA_CNT_STP_88XX]; extern tNvmPara_SystemBlock CddStp_tCodingAreaSys; // system part of NvmPara_CodingArea extern tNvmPara_LwrBlock CddStp_tCodingAreaLwr; // LWR part of NvmPara_CodingArea extern tVolt_Range CddStpVolt_ucVoltRange; extern uint32 IoHwAb_SystemTick_1Ms; // every millisecond this variable is incremented extern uint16 CddStpDyn_unRefSteps[CFA_CNT_STP_88XX]; // - referencing extern uint16 CddStp_unPreStepLen[CFA_CNT_STP_88XX]; // length of pre step in microseconds extern uint16 CddStp_unPostStepLen[CFA_CNT_STP_88XX]; // length of post step in microseconds extern tCddStp_Simulation_Data CddStp_Simulation_Data; // simulation for validation purposes extern tNvmPara_StallDetection CddStp_tCodingArea_StallDetection; //============================================================================= // external/internal 'UT'-Vars ('STATIC_UT' etc) //============================================================================= // CddStp8899Temp_CheckLowTemp boolean bIsLowtemp; // 'CddStp8899Temp_CheckLowTemp' TIMER CddStp88XX_astWaitErrPrealarm[CFA_CNT_STP_88XX]; tStateTempCddStp88XX CddStp88XX_aeTempState[CFA_CNT_STP_88XX]; uint8 ucNormalTiming; // FLM3 - should NOT happen in Hongqi-H5 boolean boCddStp_Cycle10ms_Initialized; boolean CddStp8899_boEftCodValid; // flag to check only once tFTimer CddStp88XX_aftWaitErrInh[CFA_CNT_STP_88XX]; tStpState CddStp88XX_aStpStateOld[CFA_CNT_STP_88XX]; boolean CddStp_boDioErrLwr; boolean CddStp88XX_boDoSendOnce; //============================================================================= // external API-Functions //============================================================================= extern void CddStp_Init(void); // yet not available in Hongqi-H5 extern void CddStp_DeInit(void); extern void CddStp_Cycle10ms(void); extern Std_ReturnType CddStp_StpOff(void); extern Std_ReturnType CddStp_StpOn(void); extern void rrCddStp_TgtSig0(void); extern Std_ReturnType CddStp_StartRefRun(tieStepperIndex stepperIndex, ti16StepperPosition_halfsteps position); //============================================================================= // Implementation //============================================================================= // ************* CddStp.c **************************** // void riCddStpInit(void); // .\Asr6\Src\Src_ThirdParty\Src_FLM3\Src_KPIT-FLM3\ApplicationStack\AppMode\Configuration\Generated_Files\2_Rte\inc\Rte_ctacCddStp.h // STATIC_AL void CddStp_Init(void); // void riCddStpDeInit(void); // yet NOT available in RTE!! // STATIC_AL void CddStp_DeInit(void); // void rpCddStp10ms(void); // // STATIC_AL void CddStp_Cycle10ms(void); // Std_ReturnType roCddStpOff(void); // STATIC_AL Std_ReturnType CddStp_StpOff(void); // Std_ReturnType roCddStpOn(void); // STATIC_AL Std_ReturnType CddStp_StpOn(void); //----------------------------------------------------------------------------- /// \brief Mt_riCddStpInit /// /// \Test Case Description /// - Test subject: /// Call the API function riCddStpInit(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.167 /// - FLM3.MDRS.CddStp.202 /// - FLM3.MDRS.CddStp.577 /// //----------------------------------------------------------------------------- void Mt_riCddStpInit(void) { // Step1: do some ini const uint32 cIniValue = 10; CddStp_Counter_Init = cIniValue; // Step2: call function riCddStpInit(); // Step3: call check AL_UNITTEST_CHECK(CddStp_Counter_Init, 2, == ); // extended tests are done in fct 'Mt_CddStp_Init' } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_Init /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_Init(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.167 /// - FLM3.MDRS.CddStp.168 /// - FLM3.MDRS.CddStp.179 /// - FLM3.MDRS.CddStp.202 /// - FLM3.MDRS.CddStp.577 /// //----------------------------------------------------------------------------- void Mt_CddStp_Init(void) { CddStp_UnitTest_Printf("\n"); // nice formatting if 'CDDSTP_UNIT_TEST_DEBUGGING' is set // Step1: do some ini const uint32 cIniValue = 10; CddStp_Counter_Init = cIniValue; CddStp8899_boEftCodValid = FALSE; CddStp_UnitTest__MountingSide = eIoHwAbUser_MountingSide_Left; // tbd: 'eIdentityUndef' CddStp_UnitTest__EftDataStatus = tieDataStatus_Invalid; // tbd: 'tieDataStatus_Valid' CddStp_UnitTest__CodDataStatus = tieDataStatus_Invalid; // tbd: 'tieDataStatus_Valid' CddStp_ActAll.sLwrActual.sStatusError.eStatSupported = (tieSupportInfo)SUPPORT_SNA; // obsolet: CddStp_UnitTest__tieEftData.EFT_ECUVARCFG_STEPPER[0] = 0; CddStp_UnitTest__tieEftData[0].ucType /*EFT_ECUVARCFG_STEPPER[0]*/ = 0; // Test_Eft_EcuVarCfg_Used[0].ucType = 0; // 00: not fitted | 01 : DRV8899 | 02 : DRV8889A CddStp_tCodingAreaLwr.Modus.biEnable = FALSE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = FALSE; //CddStpDyn_UnitTest___tCodingAreaLwr_Modus_biEnable = FALSE; CddStp88XX_ucNumOfSteppers_EFT = 0; // Step2: call function CddStp_Init(); // -> 'CddStp88XX_EftCodingLr' & 'CddStp_StpOff' // Step3: call check AL_UNITTEST_CHECK(CddStp_Counter_Init, (cIniValue + 1), == ); AL_UNITTEST_CHECK(CddStp8899_boEftCodValid, FALSE, == ); AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.eStatSupported, (tieSupportInfo)SUPPORT_UNKNOWN, == ); // Step1: do some ini CddStp8899_boEftCodValid = FALSE; CddStp_UnitTest__MountingSide = eIoHwAbUser_MountingSide_Left; // tbd: 'eIdentityUndef' CddStp_UnitTest__EftDataStatus = tieDataStatus_Valid; CddStp_UnitTest__CodDataStatus = tieDataStatus_Valid; CddStp_ActAll.sLwrActual.sStatusError.eStatSupported = (tieSupportInfo)SUPPORT_SNA; CddStp_UnitTest__tieEftData[0].ucType = 0u; CddStp88XX_ucNumOfSteppers_EFT = 0; // Step2: call function CddStp_Init(); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_ucNumOfSteppers_EFT, 0, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899_boEftCodValid, /*TRUE*/FALSE, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.eStatSupported, /*(tieSupportInfo)SUPPORT_NO*/(tieSupportInfo)SUPPORT_UNKNOWN, == ); // Step1: do some ini CddStp8899_boEftCodValid = FALSE; CddStp_ActAll.sLwrActual.sStatusError.eStatSupported = (tieSupportInfo)SUPPORT_SNA; CddStp_UnitTest__tieEftData[0].ucType = 1u; CddStp_tCodingAreaLwr.Modus.biEnable = FALSE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = FALSE; // Step2: call function CddStp_Init(); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899_boEftCodValid, /*TRUE*/FALSE, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.eStatSupported, /*(tieSupportInfo)SUPPORT_NO*/(tieSupportInfo)SUPPORT_UNKNOWN, == ); // Step1: do some ini CddStp8899_boEftCodValid = FALSE; CddStp_ActAll.sLwrActual.sStatusError.eStatSupported = (tieSupportInfo)SUPPORT_SNA; CddStp_tCodingAreaLwr.Modus.biEnable = FALSE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = FALSE; //CddStpDyn_UnitTest___tCodingAreaLwr_Modus_biEnable = TRUE; CddStp88XX_ucNumOfSteppers_EFT = 0; CddStp88XX_ucNumOfSteppers_Coding = 0; // Step2: call function CddStp_Init(); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899_boEftCodValid, /*TRUE*/FALSE, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp88XX_ucNumOfSteppers_EFT, /*1*/0, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp88XX_ucNumOfSteppers_Coding, /*1*/0, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.eStatSupported, /*(tieSupportInfo)SUPPORT_YES*/(tieSupportInfo)SUPPORT_UNKNOWN, == ); CddStp_UnitTest_Printf(" ... "); // shift the following 'passed' a little bit right } // yet NOT available in RTE!! //----------------------------------------------------------------------------- // yet NOT available in RTE!! /// \brief Mt_riCddStpDeInit // yet NOT available in RTE!! /// // yet NOT available in RTE!! /// \Test Case Description // yet NOT available in RTE!! /// - Test subject: // yet NOT available in RTE!! /// Call the API function riCddStpDeInit(). // yet NOT available in RTE!! /// // yet NOT available in RTE!! /// - Test Design Technique: // yet NOT available in RTE!! /// none // yet NOT available in RTE!! /// // yet NOT available in RTE!! /// - Preconditions: // yet NOT available in RTE!! /// none // yet NOT available in RTE!! /// // yet NOT available in RTE!! /// - Expected test results: // yet NOT available in RTE!! /// - State change correct // yet NOT available in RTE!! /// // yet NOT available in RTE!! /// - DOORS-ID: // yet NOT available in RTE!! /// - FLM3.MDRS.CddStp.175 // yet NOT available in RTE!! /// - FLM3.MDRS.CddStp.216 // yet NOT available in RTE!! /// - FLM3.MDRS.CddStp.577 // yet NOT available in RTE!! /// // yet NOT available in RTE!! //----------------------------------------------------------------------------- // yet NOT available in RTE!! void Mt_riCddStpDeInit(void) // yet NOT available in RTE!! { // yet NOT available in RTE!! // Step1: do some ini // yet NOT available in RTE!! const uint32 cIniValue = 10; // yet NOT available in RTE!! CddStp_Counter_DeInit = cIniValue; // yet NOT available in RTE!! // yet NOT available in RTE!! // Step2: call function // yet NOT available in RTE!! riCddStpDeInit(); // yet NOT available in RTE!! // yet NOT available in RTE!! // Step3: call check // yet NOT available in RTE!! AL_UNITTEST_CHECK(CddStp_Counter_DeInit, 2, == ); // yet NOT available in RTE!! } // yet not available in Hongqi-H5 //----------------------------------------------------------------------------- // yet not available in Hongqi-H5 /// \brief Mt_CddStp_DeInit // yet not available in Hongqi-H5 /// // yet not available in Hongqi-H5 /// \Test Case Description // yet not available in Hongqi-H5 /// - Test subject: // yet not available in Hongqi-H5 /// Call the API function CddStp_DeInit(). // yet not available in Hongqi-H5 /// // yet not available in Hongqi-H5 /// - Test Design Technique: // yet not available in Hongqi-H5 /// none // yet not available in Hongqi-H5 /// // yet not available in Hongqi-H5 /// - Preconditions: // yet not available in Hongqi-H5 /// none // yet not available in Hongqi-H5 /// // yet not available in Hongqi-H5 /// - Expected test results: // yet not available in Hongqi-H5 /// - State change correct // yet not available in Hongqi-H5 /// // yet not available in Hongqi-H5 /// - DOORS-ID: // yet not available in Hongqi-H5 /// - FLM3.MDRS.CddStp.176 // yet not available in Hongqi-H5 /// - FLM3.MDRS.CddStp.183 // yet not available in Hongqi-H5 /// - FLM3.MDRS.CddStp.216 // yet not available in Hongqi-H5 /// - FLM3.MDRS.CddStp.577 // yet not available in Hongqi-H5 /// // yet not available in Hongqi-H5 //----------------------------------------------------------------------------- // yet not available in Hongqi-H5 void Mt_CddStp_DeInit(void) // yet not available in Hongqi-H5 { // yet not available in Hongqi-H5 // Step1: do some ini // yet not available in Hongqi-H5 const uint32 cIniValue = 10; // yet not available in Hongqi-H5 CddStp_Counter_DeInit = cIniValue; // yet not available in Hongqi-H5 // yet not available in Hongqi-H5 // Step2: call function // yet not available in Hongqi-H5 CddStp_DeInit(); // yet not available in Hongqi-H5 CddStp_DeInit(); // yet not available in Hongqi-H5 // yet not available in Hongqi-H5 // Step3: call check // yet not available in Hongqi-H5 AL_UNITTEST_CHECK(CddStp_Counter_DeInit, (cIniValue + 2), == ); // yet not available in Hongqi-H5 } //----------------------------------------------------------------------------- /// \brief Mt_rpCddStp10ms /// /// \Test Case Description /// - Test subject: /// Call the API function rpCddStp10ms(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.171 /// - FLM3.MDRS.CddStp.211 /// - FLM3.MDRS.CddStp.577 /// //----------------------------------------------------------------------------- void Mt_rpCddStp10ms(void) { CddStp_UnitTest_Printf("\n"); // nice formatting if 'CDDSTP_UNIT_TEST_DEBUGGING' is set // Step1: do some ini const uint32 cIniValue = 10; CddStp_Counter_Cycle = cIniValue; // Step2: call function rpCddStp10ms(); // calls mainly 'CddStp_Cycle10ms' // Step3: call check AL_UNITTEST_CHECK(CddStp_Counter_Cycle, 2, == ); // N.b.: Extended tests are done in fct 'Mt_CddStp_Cycle10ms' CddStp_UnitTest_Printf(" ... "); // shift the following 'passed' a little bit right } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_Cycle10ms /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_Cycle10ms(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.172 /// - FLM3.MDRS.CddStp.185 /// - FLM3.MDRS.CddStp.211 /// - FLM3.MDRS.CddStp.577 /// //----------------------------------------------------------------------------- void Mt_CddStp_Cycle10ms(void) { CddStp_UnitTest_Printf("\n"); // nice formatting if 'CDDSTP_UNIT_TEST_DEBUGGING' is set // Step1: do some ini const uint32 cIniValue = 10; CddStp_Counter_Cycle = cIniValue; // FLM3 - should NOT happen in Hongqi-H5 boCddStp_Cycle10ms_Initialized = TRUE; // Step2: call function CddStp_Cycle10ms(); // calls once 'CddStp_Init' & every time 'rpCddStp_Cycle0' CddStp_Cycle10ms(); // Step3: call check AL_UNITTEST_CHECK(CddStp_Counter_Cycle, (cIniValue + 2), == ); // Step1: do some ini CddStp_Counter_Init = cIniValue; // FLM3 - should NOT happen in Hongqi-H5 boCddStp_Cycle10ms_Initialized = FALSE; // Step2: call function CddStp_Cycle10ms(); // Step3: call check AL_UNITTEST_CHECK(CddStp_Counter_Init, (cIniValue /*+ 1*/), == ); // FLM3 - should NOT happen in Hongqi-H5 AL_UNITTEST_CHECK(boCddStp_Cycle10ms_Initialized, TRUE, == ); // N.b.: Extended tests are done in fct 'Mt_rpCddStp_Cycle0' CddStp_UnitTest_Printf(" ... "); // shift the following 'passed' a little bit right } //----------------------------------------------------------------------------- /// \brief Mt_roCddStpOff /// /// \Test Case Description /// - Test subject: /// Call the API function roCddStpOff(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.472 /// - FLM3.MDRS.CddStp.515 /// - FLM3.MDRS.CddStp.528 /// - FLM3.MDRS.CddStp.577 /// //----------------------------------------------------------------------------- void Mt_roCddStpOff(void) { // Step1: do some ini // Step2: call function Std_ReturnType ret = roCddStpOff(); // Step3: call check AL_UNITTEST_CHECK(ret, RTE_E_NOK, == ); // N.b.: Extended tests are done in fct 'Mt_CddStp_StpOff' } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_StpOff /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_StpOff(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.472 /// - FLM3.MDRS.CddStp.521 /// - FLM3.MDRS.CddStp.528 /// - FLM3.MDRS.CddStp.577 /// //----------------------------------------------------------------------------- void Mt_CddStp_StpOff(void) { // Step1: do some ini // Step2: call function Std_ReturnType ret = CddStp_StpOff(); // Step3: call check AL_UNITTEST_CHECK(ret, RTE_E_NOK, == ); } //----------------------------------------------------------------------------- /// \brief Mt_roCddStpOn /// /// \Test Case Description /// - Test subject: /// Call the API function roCddStpOn(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.472 /// - FLM3.MDRS.CddStp.512 /// - FLM3.MDRS.CddStp.526 /// - FLM3.MDRS.CddStp.577 /// //----------------------------------------------------------------------------- void Mt_roCddStpOn(void) { // Step1: do some ini // Step2: call function Std_ReturnType ret = roCddStpOn(); // Step3: call check AL_UNITTEST_CHECK(ret, RTE_E_NOK, == ); // N.b.: Extended tests are done in fct 'Mt_CddStp_StpOn' } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_StpOn /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_StpOn(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.472 /// - FLM3.MDRS.CddStp.519 /// - FLM3.MDRS.CddStp.526 /// - FLM3.MDRS.CddStp.577 /// //----------------------------------------------------------------------------- void Mt_CddStp_StpOn(void) { // Step1: do some ini // Step2: call function Std_ReturnType ret = CddStp_StpOn(); // Step3: call check AL_UNITTEST_CHECK(ret, RTE_E_NOK, == ); } // ************* ctscCddStp_.c **************************** // void riCddStp_Init(void); // void rpCddStp_Cycle0(void); // void roCddStpStartRefRun( tieStepperIndex stepperIndex, ti16StepperPosition_halfsteps position) // STATIC_AL Std_ReturnType CddStp_StartRefRun(tieStepperIndex stepperIndex, ti16StepperPosition_halfsteps position); // void CddStp_CtrlFct0(tiulCtrlCmd ulCmd, tiucCtrlIndex ucIndex, tisCtrlData0* pData) // STATIC_AL void rrCddStp_TgtSig0(void); // void* CddStp_GetVirtData_TestIfc(uint32* pulSize) // Std_ReturnType CddStp_GetData( uint32* pulOpTimeHoldCur, uint32* pulOpTimeMoveCur, uint32* pulOpMovedHs, uint8* pucStartRefRunCnt, uint8* pucFinishedRefRunCnt) // STATIC_AL Std_ReturnType CddStp_GetData_Internal(uint32* pulOpTimeHoldCur, uint32* pulOpTimeMoveCur, uint32* pulOpMovedHs, uint8* pucStartRefRunCnt, uint8* pucFinishedRefRunCnt) //----------------------------------------------------------------------------- /// \brief Mt_riCddStp_Init /// /// \Test Case Description /// - Test subject: /// Call the API function riCddStp_Init(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.202 /// - FLM3.MDRS.CddStp.577 /// //----------------------------------------------------------------------------- void Mt_riCddStp_Init(void) { CddStp_UnitTest_Printf("\n"); // nice formatting if 'CDDSTP_UNIT_TEST_DEBUGGING' is set // Step1: do some ini const uint32 cIniValue = 10; CddStp_Counter_Init = 10; // Step2: call function riCddStp_Init(); // usually just calls 'CddStp88XX_Init' & 'CddStp88XX_GetState' // Step3: call check AL_UNITTEST_CHECK(CddStp_Counter_Init, (cIniValue + 0), == ); // -> asertion ?!?! // N.b.: Extended tests are done in fct 'Mt_CddStp_Init' CddStp_UnitTest_Printf(" ... "); // shift the following 'passed' a little bit right } //----------------------------------------------------------------------------- /// \brief Mt_rpCddStp_Cycle0 /// /// \Test Case Description /// - Test subject: /// Call the API function rpCddStp_Cycle0(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.211 /// - FLM3.MDRS.CddStp.577 /// //----------------------------------------------------------------------------- void Mt_rpCddStp_Cycle0(void) { CddStp_UnitTest_Printf("\n"); // nice formatting if 'CDDSTP_UNIT_TEST_DEBUGGING' is set // Step1: do some ini const uint32 cIniValue = 123; ucNormalTiming = cIniValue; // -> 'CddStp88XXVolt_StpVoltRng' CddStp_UnitTest__u32Voltage_mV = 13567; // 13,567V CddStpVolt_ucVoltRange = eUndef; // only UT CddStp_ActAll.sLwrActual.sStatusError.eStatSupported = (tieSupportInfo)SUPPORT_YES; bIsLowtemp = TRUE; IoHwAb_SystemTick_1Ms = 12345; CddStp_ActAll.sLwrActual.nPosition = 1234; CddStp88XX_aStpPos[0].nPos = CddStp_ActAll.sLwrActual.nPosition + 10; CddStp_UnitTest__tisAllStpActual.sLwrActual.nPosition = 0; // Step2: call function rpCddStp_Cycle0(); // FLM3: 'rpCddStp10ms' // calls usually: // * CddStp88XXVolt_StpVoltRng(); // * CddStp8899Temp_CheckLowTemp(); // * rrCddStp_TgtSig0(); // * CddStp88XX_Cycle0(0); // * CddStp88XX_GetState(0); // * Rte_Write_ctacCddStp_ppCddStpActual0_sStpActualValues(&CddStp_ActAll); == 'Rte_Write_ppCddStpActual0_sStpActualValues' // Step3: call check AL_UNITTEST_CHECK(IoHwAb_SystemTick_1Ms, (12345 + 10), == ); AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.nPosition, CddStp88XX_aStpPos[0].nPos, == ); AL_UNITTEST_CHECK(CddStp_UnitTest__tisAllStpActual.sLwrActual.nPosition, CddStp88XX_aStpPos[0].nPos, == ); CddStp_UnitTest_Printf(" ... "); // shift the following 'passed' a little bit right } //----------------------------------------------------------------------------- /// \brief Mt_roCddStpStartRefRun /// /// \Test Case Description /// - Test subject: /// Call the API function roCddStpStartRefRun(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.272 /// - FLM3.MDRS.CddStp.281 /// - FLM3.MDRS.CddStp.305 /// - FLM3.MDRS.CddStp.577 /// //----------------------------------------------------------------------------- void Mt_roCddStpStartRefRun(void) { // Step1: do some ini const uint32 cIniValue = 10; CddStp_Counter_StartRefRun = cIniValue; // Step2: call function roCddStpStartRefRun((tieStepperIndex)0, (ti16StepperPosition_halfsteps)0); // usually just calls 'CddStp_StartRefRun' // Step3: call check AL_UNITTEST_CHECK(CddStp_Counter_StartRefRun, (cIniValue + 1), == ); // -> asertion ?!?! } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_StartRefRun /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_StartRefRun(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.272 /// - FLM3.MDRS.CddStp.283 /// - FLM3.MDRS.CddStp.286 /// - FLM3.MDRS.CddStp.305 /// - FLM3.MDRS.CddStp.577 /// //----------------------------------------------------------------------------- void Mt_CddStp_StartRefRun(void) { // Step1: do some ini const uint32 cIniValue = 10; CddStp_Counter_StartRefRun = cIniValue; tieStepperIndex idx = 0; ti16StepperPosition_halfsteps hs = 1234; CddStp88XX_anRef1Pos[0] = hs + 10; // Step2: call function CddStp_StartRefRun(idx, hs); // Step3: call check AL_UNITTEST_CHECK(CddStp_Counter_StartRefRun, (cIniValue + 1), == ); // -> asertion ?!?! AL_UNITTEST_CHECK(CddStp88XX_anRef1Pos[0], hs, == ); // -> asertion ?!?! } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_CtrlFct0 /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_CtrlFct0(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.577 /// //----------------------------------------------------------------------------- void Mt_CddStp_CtrlFct0() { // Step1: do some ini const uint32 cIniValue = 1234; tiulCtrlCmd cmd = 0; tisCtrlData0 ctrlData; const tiucCtrlIndex cIdx = 0; CddStp_ActAll.sLwrActual.sStatusError.eStatSupported = (tieSupportInfo)SUPPORT_YES; CddStp_ActAll.sLwrActual.nPosition = cIniValue; CddStp88XX_aStpPos[0].nPos = cIniValue + 10; CddStp_UnitTest__tisAllStpActual.sLwrActual.nPosition = cIniValue + 20; // Step2: call function CddStp_CtrlFct0(cmd, cIdx, &ctrlData); // Step3: call check AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.nPosition, CddStp88XX_aStpPos[0].nPos, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp_UnitTest__tisAllStpActual.sLwrActual.nPosition, CddStp88XX_aStpPos[0].nPos, == ); // Step1: do some ini cmd = CddStp_eCtrlFct0_ModeOff; // Treiber ausschalten CddStp88XX_aStpCtrl[cIdx].Bit.On = 1u; // already switched on driver? CddStp88XX_aStpCtrl[cIdx].Bit.Stop = 1u; CddStp88XX_aStpState[cIdx].Bit.IsReady = 1u; // Step2: call function CddStp_CtrlFct0(cmd, cIdx, &ctrlData); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpCtrl[cIdx].Bit.On, 0u, == ); AL_UNITTEST_CHECK(CddStp88XX_aStpCtrl[cIdx].Bit.Stop, 0u, == ); AL_UNITTEST_CHECK(CddStp88XX_aStpState[cIdx].Bit.IsReady, 0u, == ); // Step1: do some ini cmd = CddStp_eCtrlFct0_ModeOn; // Treiber einschalten CddStp88XX_aStpCtrl[cIdx].Bit.On = 0u; // already switched on driver? CddStp88XX_aStpCtrl[cIdx].Bit.Stop = 1u; CddStp88XX_aStpState[cIdx].Bit.IsReady = 1u; // Step2: call function CddStp_CtrlFct0(cmd, cIdx, &ctrlData); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpCtrl[cIdx].Bit.On, 1u, == ); AL_UNITTEST_CHECK(CddStp88XX_aStpCtrl[cIdx].Bit.Stop, 0u, == ); AL_UNITTEST_CHECK(CddStp88XX_aStpState[cIdx].Bit.IsReady, 0u, == ); // Step1: do some ini cmd = CddStp_eCtrlFct0_ModeRel; // Verstellmodus bezogen auf Anfangsposition (!only used in case of failed reference run!) // UWY SS - obsolete CddStp88XX_aStpState[cIdx].Bit.IsRef = 1u; // already switched on driver? CddStp88XX_aStpCtrl[cIdx].Bit.Stop = 1u; CddStp88XX_aStpState[cIdx].Bit.IsReady = 1u; // Step2: call function CddStp_CtrlFct0(cmd, cIdx, &ctrlData); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[cIdx].Bit.IsRef, 0u, == ); AL_UNITTEST_CHECK(CddStp88XX_aStpCtrl[cIdx].Bit.Stop, 0u, == ); AL_UNITTEST_CHECK(CddStp88XX_aStpState[cIdx].Bit.IsReady, 0u, == ); // Step1: do some ini cmd = CddStp_eCtrlFct0_ModeAbs; // Verstellmodus bezogen auf Referenzierposition // UWY SS - standard CddStp88XX_aStpState[cIdx].Bit.IsRef = 1u; // already switched on driver? CddStp88XX_aStpCtrl[cIdx].Bit.Stop = 1u; CddStp88XX_aStpState[cIdx].Bit.IsReady = 1u; // Step2: call function CddStp_CtrlFct0(cmd, cIdx, &ctrlData); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[cIdx].Bit.IsRef, 1u, == ); AL_UNITTEST_CHECK(CddStp88XX_aStpCtrl[cIdx].Bit.Stop, 0u, == ); AL_UNITTEST_CHECK(CddStp88XX_aStpState[cIdx].Bit.IsReady, 0u, == ); // Step1: do some ini cmd = CddStp_eCtrlFct0_ModeStop; // Motor mit Bremsrampe stoppen / starten // UWY SS boStop CddStp88XX_aStpState[cIdx].Bit.RefActive = 0u; // Step2: call function CddStp_CtrlFct0(cmd, cIdx, &ctrlData); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[cIdx].Bit.RefActive, 0u, == ); // Step1: do some ini cmd = CddStp_eCtrlFct0_ModeRef; // Referenzieranforderung // UWY SS roCddStpStartRefRun() CddStp88XX_aStpCtrl[cIdx].Bit.Stop = 1u; CddStp88XX_aStpCtrl[cIdx].Bit.Ref = 0u; // Step2: call function CddStp_CtrlFct0(cmd, cIdx, &ctrlData); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpCtrl[cIdx].Bit.Stop, 0u, == ); AL_UNITTEST_CHECK(CddStp88XX_aStpCtrl[cIdx].Bit.Ref, 1u, == ); cmd = CddStp_eCtrlFct0_ErrInhibit; // Unterdrueckung der Fehlererkennung (ErrElecOL/SC and step loss) // UWY SS ??? /// check: CddStp88XX_aStpCtrl[ucIx].Bit.ErrInh = pBuffer_->ErrInhibit.boErrInhibit; /// check: CddStpPrj_SetEventFinishMove(ucIx); CddStp_CtrlFct0(cmd, cIdx, &ctrlData); cmd = CddStp_eCtrlFct0_ErrActivate; // Reaktivierung der Fehlererkennung // UWY SS ??? CddStp_CtrlFct0(cmd, cIdx, &ctrlData); cmd = CddStp_eCtrlFct0_ErrClr; // unlock error state // UWY SS ??? /// check: CddStp88XX_aStpCtrl[ucIx].Bit.ErrClr = 1u; /// check: CddStpPrj_SetEventFinishMove(ucIx); CddStp_CtrlFct0(cmd, cIdx, &ctrlData); cmd = CddStp_eCtrlFct0_LowTemp; // low temperature // UWY SS ??? /// check: CddStp88XX_aBits[ucIx].Bit.biLT = pBuffer_->LowTemp.boLT; // not cleared at call of CddStp88XX_Init_() (not compatible to Afs2) CddStp_CtrlFct0(cmd, cIdx, &ctrlData); cmd = CddStp_eCtrlFct0_GetTempState; // get temperature state // UWY SS ??? CddStp_CtrlFct0(cmd, cIdx, &ctrlData); cmd = CddStp_eCtrlFct0_SetCARunRef; // set run current of next 12 HS to reference current for bump reference run // UWY SS ??? CddStp_CtrlFct0(cmd, cIdx, &ctrlData); cmd = CddStp_eCtrlFct0_SetIsReady; // set CddStpState IsReady bit // Step2: call function CddStp_CtrlFct0(cmd, cIdx, &ctrlData); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[cIdx].Bit.IsReady, 1u, == ); AL_UNITTEST_CHECK(CddStp88XX_aStpCtrl[cIdx].Bit.Ref, 1u, == ); } //----------------------------------------------------------------------------- /// \brief Mt_rrCddStp_TgtSig0 /// /// \Test Case Description /// - Test subject: /// Call the API function rrCddStp_TgtSig0(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_rrCddStp_TgtSig0() { CddStp_UnitTest_Printf("\n"); // nice formatting if 'CDDSTP_UNIT_TEST_DEBUGGING' is set // Step1: do some ini const uint32 cIniValue = 1234; CddStp_ActAll.sLwrActual.sStatusError.eStatSupported = (tieSupportInfo)SUPPORT_YES; CddStp_ActAll.sLwrActual.nPosition = cIniValue; CddStp88XX_aStpPos[0].nPos = cIniValue + 10; CddStp_UnitTest__tisAllStpActual.sLwrActual.nPosition = cIniValue + 20; // Step2: call function rrCddStp_TgtSig0(); // Step3: call check AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.nPosition, CddStp88XX_aStpPos[0].nPos, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp_UnitTest__tisAllStpActual.sLwrActual.nPosition, CddStp88XX_aStpPos[0].nPos, == ); CddStp_UnitTest_Printf(" ... "); // shift the following 'passed' a little bit right } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetData /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetData() ('Rte_Call_ctaaStatM_ppCddStpGetStepperStatisticData_GetData') /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.469 /// //----------------------------------------------------------------------------- void Mt_CddStp_GetData(void) { // Step1: do some ini void * pTestIf = NULL; uint32 pulSize = 0; Std_ReturnType ret = 0; uint32 ulOpTimeHoldCur, ulOpTimeMoveCur, ulOpMovedHs; uint8 ucStartRefRunCnt, ucFinishedRefRunCnt; // Step2: call function // called via RTRE-Fct 'Rte_Call_ctaaStatM_ppCddStpGetStepperStatisticData_GetData' ret = RTE_E_OK; // tbd-FLM3-HH5: CddStp_GetData(&ulOpTimeHoldCur, &ulOpTimeMoveCur, &ulOpMovedHs, &ucStartRefRunCnt, &ucFinishedRefRunCnt); // Step3: call check AL_UNITTEST_CHECK(ret, RTE_E_OK, == ); } extern Std_ReturnType CddStp_GetData_Internal(uint32* pulOpTimeHoldCur, uint32* pulOpTimeMoveCur, uint32* pulOpMovedHs, uint8* pucStartRefRunCnt, uint8* pucFinishedRefRunCnt); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetData_Internal /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetData_Internal(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_GetData_Internal(void) { // Step1: do some ini void * pTestIf = NULL; uint32 pulSize = 0; Std_ReturnType ret = 0; uint32 ulOpTimeHoldCur, ulOpTimeMoveCur, ulOpMovedHs; uint8 ucStartRefRunCnt, ucFinishedRefRunCnt; // Step2: call function ret = RTE_E_OK; // tbd-FLM3-HH5: CddStp_GetData_Internal(&ulOpTimeHoldCur, &ulOpTimeMoveCur, &ulOpMovedHs, &ucStartRefRunCnt, &ucFinishedRefRunCnt); // Step3: call check AL_UNITTEST_CHECK(ret, RTE_E_OK, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_GetVirtData_TestIfc(void) { // Step1: do some ini void * pTestIf = NULL; uint32 pulSize = 0; // Step2: call function pTestIf = CddStp_GetVirtData_TestIfc(&pulSize); // Step3: call check (void)pTestIf; AL_UNITTEST_CHECK(pulSize, 0, != ); } // ************* CddStp8899_FctTables.c **************************** extern uint8 CddStp8899_FctTables_UT_Dummy(uint8 ucVal); //----------------------------------------------------------------------------- /// \brief Mt_CddStp8899_FctTables_UT_Dummy /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp8899_FctTables_UT_Dummy(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899_FctTables_UT_Dummy(void) { // Step1: do some ini const uint8 cIniValue = 123; uint8 ucVal1 = cIniValue; uint8 ucVal2 = cIniValue; // Step2: call function ucVal2 = CddStp8899_FctTables_UT_Dummy(ucVal1); // Step3: call check AL_UNITTEST_CHECK(ucVal1, (ucVal2 - 1), == ); } // ************* CddStpDyn.c **************************** // void CddStpDyn_Init(uint8 ucIx, boolean boHsMode); // void CddStpDyn_CodingDataValid(void); // boolean CddStpDyn_SetFreq(uint8 ucIx, uint16 unTmin, uint16 unVolt); // void CddStpDyn_CalcNextSteps(uint8 ucIx, tHsInfo* pHsBuf, uint32 ulBufIx, sint32 lTgtPos, sint32 lActPos, uint32 ulRemainingTicks, tCddStpDyn_CalcMode CalcMode); // STATIC_AL inline void CddStpDyn_DecActTabIx(void); // STATIC_AL inline void CddStpDyn_IncActTabIx(void); // STATIC_AL inline sint32 CddStpDyn_GetSign(sint32 lValue); extern void CddStpDyn_CalcNormal(void); extern void CddStpDyn_CalcRef2(void); extern void CddStpDyn_CalcRef1(void); extern void CddStpDyn_PreStep(void); extern void CddStpDyn_GetStartConditions(void); extern uint8 CddStpDyn_GetIx(uint8 ucIx, uint16 unStepTime); extern uint16 CddStpDyn_GetStpTime(uint8 ucTabIx); extern uint16 CddStpDyn_CalcNextHalfStepTime(uint8 ucIx, uint16 unT_n1); extern void CddStpDyn_DecActTabIx(void); extern void CddStpDyn_IncActTabIx(void); extern sint32 CddStpDyn_GetSign(sint32 lValue); extern tStpInfo* CddStp88XX_HalStpLwr_GetStpInfo(void); extern void CddStp88XX_HalStpLwr_EmptyBuffer(void); typedef struct { unsigned int biFirstStep : 1; unsigned int biAboveResF1 : 1; // !resonance frequency 1 is lower than 2! unsigned int biAboveResF2 : 1; // !resonance frequency 2 is higher than 1! unsigned int biStop : 1; }tCddStpDynBits; typedef struct { unsigned biDummy1 : 16; // do not use bit access to this variable unsigned biDummy2 : 8; // do not use bit access to this variable unsigned biInit : 1; // reset dynamic calculation if this bit is set unsigned biReserved : 7; }tStpTabRamBit; typedef struct { uint16 unMinPeriod; // min. HS duration (frequency limitation) uint8 ucMaxIx; // max. index to step table uint8 ucDummy; // used for bitwise access }tStpTabRamVal; typedef union { tStpTabRamVal Val; // use Val for initialization tStpTabRamBit Bit; }tStpTabRam; extern tStpTabRam StpTabRam[]; #define CDDSTPDYN_StpTableSize (76u) // maximum size for step table (according to slowest AL profile) extern uint16 CddStpDyn_aunHsZeit[CFA_CNT_STP_88XX][CDDSTPDYN_StpTableSize]; extern uint8 CddStpDyn_aucLastTabIx[CFA_CNT_STP_88XX]; extern uint32 CddStpDynBuf_ulAccStepTime; extern uint8 CddStpDyn_ucIx; extern uint32 CddStpDynBuf_ulBufIx; extern tHsInfo* CddStpDynBuf_pHsBuf; extern tHsInfo CddStpDynBuf_HsEntry; extern uint8 CddStpDyn_ucActTabIx; extern sint32 CddStpDyn_lCurrentDir; extern tCddStpDynBits CddStpDyn_Bits; extern sint32 CddStpDyn_lStepsToDo; void Mt_CddStpDynBuf_ReadLastEntry(void); //----------------------------------------------------------------------------- /// \brief Mt_CddStpDyn_Init /// /// \Test Case Description /// - Test subject: /// Call the API function CddStpDyn_Init(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpDyn_Init(void) { // Step1: do some ini uint8 ucIx = 0; boolean boHsMode = FALSE; StpTabRam->Bit.biInit = 0; CddStpDyn_unRefSteps[ucIx] = 1; CddStp_tCodingAreaLwr.Dynamik.unAcc = 12000; CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_Acceleration = 1200; { // external ini required tStpInfo* pStpInfo = CddStp88XX_HalStpLwr_GetStpInfo(); CddStpDynBuf_OpenBuffer(pStpInfo->HsInfoBuf, 0, 0); CddStp88XX_HalStpLwr_EmptyBuffer(); } // Step2: call function CddStpDyn_Init(ucIx, boHsMode); // Step3: call check AL_UNITTEST_CHECK(StpTabRam->Bit.biInit, 1, == ); AL_UNITTEST_CHECK(CddStpDyn_unRefSteps[ucIx], 0, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStpDyn_CodingDataValid /// /// \Test Case Description /// - Test subject: /// Call the API function CddStpDyn_CodingDataValid(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpDyn_CodingDataValid(void) { // Step1: do some ini CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_PreStepTime = 0; CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_PostStepTime = 0; CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_V_min = 0; CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_V_max = 0; CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_Reversing_Time = 0; CddStp_unPreStepLen[0] = 0; CddStp_unPostStepLen[0] = 0; // Step2: call function CddStpDyn_CodingDataValid(); // Step3: call check AL_UNITTEST_CHECK(CddStp_unPreStepLen[0], 2000, == ); AL_UNITTEST_CHECK(CddStp_unPostStepLen[0], 2000, == ); // Step1: do some ini #define CDDSTPDYN_PrePostStepScale (10000u) // scaling of pre/post step parameters #define CDDSTPDYN_PrePostStepMin (2000u) // minimum step time because of SPI jitter #define CDDSTPDYN_PrePostStepMax (65535u) // maximum step time to avoid overflow #define CDDSTPDYN_PostStepAdd (4000u) // minimum delta between post step time and direction change time #define CDDSTPDYN_StpTableSize (76u) // maximum size for step table (according to slowest AL profile) #define CDDSTPDYN_ZeitUmkehrMin (4000u) // minimum value needed in case of wrong coding parameters #define CDDSTPDYN_AnzahlRef2Min (16u) // minimum value needed in case of wrong coding parameters CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_PreStepTime = 3; CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_PostStepTime = 4; CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_V_min = 600; CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_V_max = 400; CddStpDyn_aunHsZeit[0][0u] = CDDSTPDYN_ZeitUmkehrMin; CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_Reversing_Time = 16; // Step2: call function CddStpDyn_CodingDataValid(); // Step3: call check AL_UNITTEST_CHECK(CddStp_unPreStepLen[0], 30000, == ); AL_UNITTEST_CHECK(CddStp_unPostStepLen[0], 40000, == ); // Step1: do some ini CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_PreStepTime = 0x0F; // max 4 bit CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_PostStepTime = 0x0F; // max 4 bit // Step2: call function CddStpDyn_CodingDataValid(); // Step3: call check AL_UNITTEST_CHECK(CddStp_unPreStepLen[0], CDDSTPDYN_PrePostStepMax, == ); AL_UNITTEST_CHECK(CddStp_unPostStepLen[0], CDDSTPDYN_PrePostStepMax, == ); // Step1: do some ini CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_PreStepTime = 3; CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_PostStepTime = 4; CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_V_min = 100; CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_V_max = 800; // Step2: call function CddStpDyn_CodingDataValid(); // Step3: call check AL_UNITTEST_CHECK(CddStp_unPreStepLen[0], 30000, == ); AL_UNITTEST_CHECK(CddStp_unPostStepLen[0], 40000, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpDyn_GetIx(void) { // Step1: do some ini uint8 ucIx = 0; uint16 unStepTime = 10; CddStpDyn_aucLastTabIx[0] = 5; uint8 ret; // Step2: call function ret = CddStpDyn_GetIx(ucIx, unStepTime); // Step3: call check AL_UNITTEST_CHECK(ret, 5, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpDyn_SetFreq(void) { // Step1: do some ini uint8 ucIx = 0; uint16 unTmin = 5; uint16 unVolt = 12; CddStp_tCodingAreaSys.STP_SPANNUNG_RED = 123; // 12,3V# CDDSTP_ApplCodData_Sys.Stp_Voltage_High_Reduce = 123; boolean boReduced; // Step2: call function boReduced = CddStpDyn_SetFreq(ucIx, unTmin, unVolt); // Step3: call check AL_UNITTEST_CHECK(boReduced, TRUE, == ); // Step1: do some ini unVolt = 13; // Step2: call function boReduced = CddStpDyn_SetFreq(ucIx, unTmin, unVolt); // Step3: call check AL_UNITTEST_CHECK(boReduced, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpDyn_GetStartConditions(void) { // Step1: do some ini StpTabRam->Bit.biInit = TRUE; CddStpDyn_ucActTabIx = 5; // Step2: call function CddStpDyn_GetStartConditions(); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_ucActTabIx, 0, == ); // Step1: do some ini StpTabRam->Bit.biInit = FALSE; CddStpDynBuf_HsEntry.Bit.biPause = TRUE; Mt_CddStpDynBuf_ReadLastEntry(); // Step2: call function CddStpDyn_GetStartConditions(); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_lCurrentDir, TRUE, == ); // Step1: do some ini CddStpDynBuf_HsEntry.Bit.biPause = FALSE; Mt_CddStpDynBuf_ReadLastEntry(); // Step2: call function CddStpDyn_GetStartConditions(); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_Bits.biFirstStep, 0, == ); // Step1: do some ini CddStpDynBuf_ulBufIx = 3; CddStpDynBuf_pHsBuf[(CddStpDynBuf_ulBufIx)& CDDSTP_HsInfoBufMask].Bit.biSet = TRUE; CddStpDynBuf_pHsBuf[(CddStpDynBuf_ulBufIx)& CDDSTP_HsInfoBufMask].Bit.biPause = TRUE; CddStpDynBuf_pHsBuf[(CddStpDynBuf_ulBufIx - 1u) & CDDSTP_HsInfoBufMask].Bit.biPause = TRUE; CddStpDyn_lStepsToDo = 0; // Step2: call function CddStpDyn_GetStartConditions(); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_Bits.biAboveResF2, 0, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpDyn_PreStep(void) { // Step1: do some ini CddStp_tCodingAreaLwr.Modus.eSchrittMod = (uint32)NvmPara_eSchrittMod2; CddStpDyn_ucActTabIx = 5; CddStpDyn_lStepsToDo = 3; // Step2: call function CddStpDyn_PreStep(); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_lStepsToDo, 2, == ); // Step1: do some ini CddStp_tCodingAreaLwr.Modus.eSchrittMod = (uint32)NvmPara_eSchrittMod8; CddStpDyn_ucActTabIx = 5; CddStpDyn_lStepsToDo = -3; // Step2: call function CddStpDyn_PreStep(); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_lStepsToDo, -2, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpDyn_CalcRef1(void) { // Step1: do some ini CddStpDyn_lStepsToDo = -2; CddStp_tCodingAreaLwr.Dynamik.unHsZeitRef1 = 1506; // e.g. '1506' CddStp_tCodingAreaLwr.Dynamik.unHsZeitRef2 = 4082; // e.g. '4082' CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_HsPeriod_ref1 = 1506; CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_HsPeriod_ref2 = 4082; // Step2: call function CddStpDyn_CalcRef1(); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_lStepsToDo, 2, == ); // Step1: do some ini CddStpDyn_lStepsToDo = 20; CddStpDyn_ucIx = 0; // Step2: call function CddStpDyn_CalcRef1(); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_lStepsToDo, 21, == ); // Step1: do some ini CddStpDyn_lStepsToDo = 0; CddStpDyn_ucIx = 0; CddStp_tCodingAreaLwr.Dynamik.unHsZeitRef1 = 15; // e.g. '1506' CddStp_tCodingAreaLwr.Dynamik.unHsZeitRef2 = 15; // e.g. '4082' CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_HsPeriod_ref1 = 15; CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_HsPeriod_ref2 = 15; // Step2: call function CddStpDyn_CalcRef1(); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_lStepsToDo, 1, == ); // Step1: do some ini CddStpDyn_lStepsToDo = 2; // Step2: call function CddStpDyn_CalcRef1(); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_lStepsToDo, 3, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpDyn_CalcRef2(void) { // Step1: do some ini // Step2: call function CddStpDyn_CalcRef2(); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_lStepsToDo, 0, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpDyn_CalcNormal(void) { // Step1: do some ini CddStpDyn_Bits.biFirstStep = 0; CddStpDyn_ucActTabIx = 0; // Step2: call function CddStpDyn_CalcNormal(); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_lStepsToDo, 0, == ); // Step1: do some ini CddStpDyn_Bits.biFirstStep = 1; CddStpDyn_ucActTabIx = 0; CddStp_unPostStepLen[0] = 20; // Step2: call function CddStpDyn_CalcNormal(); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_lStepsToDo, 0, == ); // Step1: do some ini CddStpDyn_ucActTabIx = 1; CddStpDyn_Bits.biFirstStep = 0; CddStp_tCodingAreaLwr.Dynamik.biBremsSchnell = 0; CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_Fast_Deceleration = 0; CddStpDyn_lStepsToDo = -3; // Step2: call function CddStpDyn_CalcNormal(); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_lStepsToDo, -2, == ); // Step1: do some ini CddStpDyn_ucActTabIx = 1; CddStp_tCodingAreaLwr.Dynamik.biBremsSchnell = 0; CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_Fast_Deceleration = 0; CddStpDyn_lStepsToDo = +3; // Step2: call function CddStpDyn_CalcNormal(); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_lStepsToDo, 3, == ); // Step1: do some ini CddStpDyn_ucActTabIx = 0; CddStpDyn_lStepsToDo = +3; // Step2: call function CddStpDyn_CalcNormal(); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_lStepsToDo, 2, == ); // Step1: do some ini CddStpDyn_ucActTabIx = 1; CddStp_tCodingAreaLwr.Dynamik.biBremsSchnell = 1; CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_Fast_Deceleration = 1; // Step2: call function CddStpDyn_CalcNormal(); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_lStepsToDo, 1, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpDyn_CalcNextSteps(void) { // Step1: do some ini uint8 ucIx = 0; const sint16 nPos = 345; tStpInfo* pStpInfo = CddStp88XX_HalStpLwr_GetStpInfo(); tHsInfo* pHsBuf = pStpInfo->HsInfoBuf; CddStpDynBuf_OpenBuffer(pHsBuf, 0, 0); CddStp88XX_HalStpLwr_EmptyBuffer(); tCddStpDyn_CalcMode CalcMode; CalcMode.ucData = 0; CddStpDyn_lStepsToDo = 5; // Step2: call function CddStpDyn_CalcNextSteps(0, pHsBuf, 0, nPos, 0, 0, CalcMode); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_lStepsToDo, nPos - 1, == ); // Step1: do some ini CalcMode.Bit.Ref1 = 1; // Step2: call function CddStpDyn_CalcNextSteps(0, pHsBuf, 0, nPos, 0, 0, CalcMode); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_lStepsToDo, nPos, == ); // Step1: do some ini CalcMode.Bit.Ref1 = 0; CalcMode.Bit.Ref2 = 1; // Step2: call function CddStpDyn_CalcNextSteps(0, pHsBuf, 0, nPos, 0, 0, CalcMode); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_lStepsToDo, 0, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpDyn_GetStpTime(void) { // Step1: do some ini uint8 ucTabIx = 3; uint16 ret; CddStpDyn_ucIx = 0; const uint16 cIniValue = 1234; const uint16 cIniValue2 = cIniValue + 2; CddStpDyn_aunHsZeit[CddStpDyn_ucIx][ucTabIx] = 123; CddStpDyn_aunHsZeit[CddStpDyn_ucIx][ucTabIx - 1u] = cIniValue; CddStp_tCodingAreaLwr.Dynamik.unResHsZeitO2 = 0; CddStp_tCodingAreaLwr.Dynamik.unResHsZeitU2 = 0; CddStp_tCodingAreaLwr.Dynamik.unResHsZeitO1 = 0; CddStp_tCodingAreaLwr.Dynamik.unResHsZeitU1 = 0; CddStpDyn_Bits.biAboveResF2 = TRUE; // Step2: call function ret = CddStpDyn_GetStpTime(ucTabIx); // Step3: call check AL_UNITTEST_CHECK(ret, 123, == ); // Step1: do some ini CddStp_tCodingAreaLwr.Dynamik.unResHsZeitO2 = cIniValue2; // Step2: call function ret = CddStpDyn_GetStpTime(ucTabIx); // Step3: call check AL_UNITTEST_CHECK(ret, 123, == ); // Step1: do some ini CddStp_tCodingAreaLwr.Dynamik.unResHsZeitO2 = 0; CddStp_tCodingAreaLwr.Dynamik.unResHsZeitU2 = cIniValue2; CddStpDyn_Bits.biAboveResF2 = FALSE; // Step2: call function ret = CddStpDyn_GetStpTime(ucTabIx); // Step3: call check AL_UNITTEST_CHECK(ret, 123, == ); // Step1: do some ini CddStpDyn_Bits.biAboveResF2 = TRUE; // Step2: call function ret = CddStpDyn_GetStpTime(ucTabIx); // Step3: call check AL_UNITTEST_CHECK(ret, 123, == ); // Step1: do some ini CddStp_tCodingAreaLwr.Dynamik.unResHsZeitO2 = 0; CddStp_tCodingAreaLwr.Dynamik.unResHsZeitU2 = 0; CddStp_tCodingAreaLwr.Dynamik.unResHsZeitO1 = cIniValue2; CddStp_tCodingAreaLwr.Dynamik.unResHsZeitU1 = 0; // Step2: call function ret = CddStpDyn_GetStpTime(ucTabIx); // Step3: call check AL_UNITTEST_CHECK(ret, 123, == ); // Step1: do some ini CddStp_tCodingAreaLwr.Dynamik.unResHsZeitO2 = 0; CddStp_tCodingAreaLwr.Dynamik.unResHsZeitU2 = 0; CddStp_tCodingAreaLwr.Dynamik.unResHsZeitO1 = 0; CddStp_tCodingAreaLwr.Dynamik.unResHsZeitU1 = cIniValue2; CddStpDyn_Bits.biAboveResF1 = TRUE; // Step2: call function ret = CddStpDyn_GetStpTime(ucTabIx); // Step3: call check AL_UNITTEST_CHECK(ret, 123, == ); // Step1: do some ini CddStpDyn_Bits.biAboveResF1 = FALSE; // Step2: call function ret = CddStpDyn_GetStpTime(ucTabIx); // Step3: call check AL_UNITTEST_CHECK(ret, 123, == ); } extern uint8 CddStpDyn_ucActTabIx; //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpDyn_CalcNextHalfStepTime(void) { // Step1: do some ini uint8 ucIx = 0; uint16 unT_n1 = 5; uint16 ret; CddStp_tCodingAreaLwr.Dynamik.unAcc = 0; CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_Acceleration = 0; // Step2: call function ret = CddStpDyn_CalcNextHalfStepTime(ucIx, unT_n1); // Step3: call check AL_UNITTEST_CHECK(ret, 0, == ); // Step1: do some ini CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_Acceleration = 1200; // Step2: call function ret = CddStpDyn_CalcNextHalfStepTime(ucIx, unT_n1); // Step3: call check AL_UNITTEST_CHECK(ret, 0, == ); } extern void CddStpDyn_DecActTabIx(void); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpDyn_DecActTabIx(void) { // Step1: do some ini const uint8 cIniValue = 5; CddStpDyn_ucActTabIx = cIniValue; // Step2: call function CddStpDyn_DecActTabIx(); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_ucActTabIx, (cIniValue - 1), == ); // Step1: do some ini CddStpDyn_ucActTabIx++; CddStp_tCodingAreaLwr.Dynamik.biBremsSchnell = FALSE; CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_Fast_Deceleration = FALSE; // Step2: call function CddStpDyn_DecActTabIx(); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_ucActTabIx, (cIniValue - 1), == ); // Step1: do some ini CddStpDyn_ucActTabIx++; CddStpDyn_ucActTabIx++; CddStp_tCodingAreaLwr.Dynamik.biBremsSchnell = TRUE; CDDSTP_ApplCodData_AvacStp_Dyn.AvacStp_Fast_Deceleration = TRUE; // Step2: call function CddStpDyn_DecActTabIx(); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_ucActTabIx, (cIniValue - 1), == ); } extern void CddStpDyn_IncActTabIx(void); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpDyn_IncActTabIx(void) { // Step1: do some ini const uint8 cIniValue = 5; CddStpDyn_ucActTabIx = cIniValue; // Step2: call function CddStpDyn_IncActTabIx(); // Step3: call check AL_UNITTEST_CHECK(CddStpDyn_ucActTabIx, (cIniValue + 1), == ); } extern sint32 CddStpDyn_GetSign(sint32 lValue); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpDyn_GetSign(void) { // Step1: do some ini sint32 lValue = 5; sint32 ret; // Step2: call function ret = CddStpDyn_GetSign(lValue); // Step3: call check AL_UNITTEST_CHECK(ret, TRUE, == ); } // ************* CddStpDynBuf.c **************************** //void CddStpDynBuf_ReadLastEntry(void); //void CddStpDynBuf_ReadActualEntry(void); //void CddStpDynBuf_WriteToBuffer(void); //void CddStpDynBuf_IncBufIx(void); extern uint32 CddStpDynBuf_ulBufIx; //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpDynBuf_ReadLastEntry(void) { // Step1: do some ini CddStpDynBuf_HsEntry.ulRaw = 0xAB; tHsInfo HsBuf; tHsInfo* pHsBuf = &HsBuf; pHsBuf[0].ulRaw = 0x11; uint32 ulBufIx = 0; uint32 ulRemainingStepTime = 22; CddStpDynBuf_OpenBuffer(pHsBuf, ulBufIx, ulRemainingStepTime); // Step2: call function CddStpDynBuf_ReadLastEntry(); // Step3: call check AL_UNITTEST_CHECK(CddStpDynBuf_HsEntry.ulRaw, 0, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpDynBuf_ReadActualEntry(void) { // Step1: do some ini const uint32 cIniValue = 0x11; CddStpDynBuf_HsEntry.ulRaw = 0xAB; tHsInfo HsBuf; tHsInfo* pHsBuf = &HsBuf; pHsBuf[0].ulRaw = cIniValue; uint32 ulBufIx = 0; uint32 ulRemainingStepTime = 22; CddStpDynBuf_OpenBuffer(pHsBuf, ulBufIx, ulRemainingStepTime); // Step2: call function CddStpDynBuf_ReadActualEntry(); // Step3: call check AL_UNITTEST_CHECK(CddStpDynBuf_HsEntry.ulRaw, cIniValue, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpDynBuf_WriteToBuffer(void) { // Step1: do some ini const uint32 cIniValue = 2; CddStpDynBuf_ulBufIx = cIniValue; CddStpDynBuf_HsEntry.Val.ucDynTableIx = 2; CddStpDynBuf_HsEntry.ulRaw = 0xAB; CddStpDynBuf_HsEntry.Bit.biSet = 0; tHsInfo HsBuf; tHsInfo* pHsBuf = &HsBuf; pHsBuf[0].ulRaw = 0x11; uint32 ulBufIx = 0; uint32 ulRemainingStepTime = 22; CddStpDynBuf_OpenBuffer(pHsBuf, ulBufIx, ulRemainingStepTime); // Step2: call function CddStpDynBuf_WriteToBuffer(); // jk: does somehow disturb Unit-Test-Execution // Step3: call check AL_UNITTEST_CHECK(CddStpDynBuf_HsEntry.Bit.biSet, 1, == ); AL_UNITTEST_CHECK(CddStpDynBuf_ulBufIx, (cIniValue - 1), == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpDynBuf_IncBufIx(void) { // Step1: do some ini const uint32 cIniValue = 2; CddStpDynBuf_ulBufIx = cIniValue; // Step2: call function CddStpDynBuf_IncBufIx(); // Step3: call check AL_UNITTEST_CHECK(CddStpDynBuf_ulBufIx, (cIniValue + 1), == ); // Step1: do some ini CddStpDynBuf_ulBufIx = CDDSTP88XX_HALSTP_HsInfoBufLen; // Step2: call function CddStpDynBuf_IncBufIx(); // Step3: call check AL_UNITTEST_CHECK(CddStpDynBuf_ulBufIx, (cIniValue - 1), == ); // Step1: do some ini CddStpDynBuf_ulBufIx = CDDSTP88XX_HALSTP_HsInfoBufLen - 1; // Step2: call function CddStpDynBuf_IncBufIx(); // Step3: call check AL_UNITTEST_CHECK(CddStpDynBuf_ulBufIx, 0, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_Util_SameSign(void) { // Step1: do some ini boolean ret; sint32 a, b; a = -123; b = -12345; // Step2: call function ret = Util_SameSign(a, b); // Step3: call check AL_UNITTEST_CHECK(ret, TRUE, == ); // Step1: do some ini b = +12345; // Step2: call function ret = Util_SameSign(a, b); // Step3: call check AL_UNITTEST_CHECK(ret, FALSE, == ); } // ************* CddStp88XXVolt.c **************************** //uint8 CddStp88XXVolt_GetStpVoltState(void); //void CddStp88XXVolt_StpVoltRng(void); //void CddStp88XXVolt_StpVoltCycle(void); // local prototypes // STATIC_AL void CddStpVolt_TimerStop(void); // STATIC_AL void CddStpVolt_TimerRestart(uint16 unTime_Cnt, uint8 ucPreResult); // STATIC_AL void CddStpVolt_FinalResult(uint8 ucEndResult); // STATIC_AL inline uint16 CddStpVolt_ConvMsToCnt(uint16 unTime_ms); extern uint8 CddStpVolt_ucPreResult; // StateVoltOff=0, StateVoltUnder=1, StateVoltNormal=2, StateVoltOver=3, StateVoltStartValue=0xFF extern uint8 CddStpVolt_ucEndResult; // StateVoltOff=0, StateVoltUnder=1, StateVoltNormal=2, StateVoltOver=3, StateVoltStartValue=0xFF extern uint16 CddStpVolt_unTimerCnt; extern tVolt_Range CddStpVolt_ucVoltRange; // Lo3=1, Lo2=2, Lo1=3, Norm=4, Hi1=5, Hi2=6 extern uint8 CddStp88XX_ucStateVolt; // state of Volt state machine - StateVoltOff=0, StateVoltUnder=1, StateVoltNormal=2, StateVoltOver=3, StateVoltStartValue=0xFF //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XXVolt_GetStpVoltState(void) { // Step1: do some ini uint8 ucResult = 0xEE; CddStpVolt_ucEndResult = 0xFF; // StateVoltOff=0, StateVoltUnder=1, StateVoltNormal=2, StateVoltOver=3, StateVoltStartValue=0xFF // Step2: call function ucResult = CddStp88XXVolt_GetStpVoltState(); // Step3: call check AL_UNITTEST_CHECK(ucResult, 0, == ); } #define CDDSTP88XXVOLT_HI_DISABLEOFFSET (0u) // '0'=disable, '400'=active - [0.1 V] - add 40 V to disable high voltage detection! #define CDDSTP88XX_StateVoltStartValue (0xffu) extern uint8 ucNormalTiming; //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XXVolt_StpVoltRng_EndResultHandling(void) { // uint8 CddStpVolt_ucEndResult: StateVoltOff=0, StateVoltUnder=1, StateVoltNormal=2, StateVoltOver=3, StateVoltStartValue=0xFF CddStpVolt_ucEndResult = 0xFF; // StateVoltOff=0, StateVoltUnder = 1, StateVoltNormal = 2, StateVoltOver = 3, StateVoltStartValue = 0xFF CddStpVolt_ucVoltRange = eInit; ucNormalTiming = 0; CddStp88XXVolt_StpVoltRng(); CddStpVolt_ucVoltRange = eInit; ucNormalTiming = 1; CddStp88XXVolt_StpVoltRng(); CddStpVolt_ucEndResult = 0xFE; // StateVoltOff=0, StateVoltUnder = 1, StateVoltNormal = 2, StateVoltOver = 3, StateVoltStartValue = 0xFF CddStpVolt_ucVoltRange = eInit; ucNormalTiming = 0; CddStp88XXVolt_StpVoltRng(); CddStpVolt_ucVoltRange = eInit; ucNormalTiming = 1; CddStp88XXVolt_StpVoltRng(); CddStpVolt_ucEndResult = 0; // StateVoltOff=0, StateVoltUnder = 1, StateVoltNormal = 2, StateVoltOver = 3, StateVoltStartValue = 0xFF CddStpVolt_ucVoltRange = eInit; ucNormalTiming = 0; CddStp88XXVolt_StpVoltRng(); CddStpVolt_ucVoltRange = eInit; ucNormalTiming = 1; CddStp88XXVolt_StpVoltRng(); CddStpVolt_ucEndResult = 1; // StateVoltOff=0, StateVoltUnder = 1, StateVoltNormal = 2, StateVoltOver = 3, StateVoltStartValue = 0xFF CddStpVolt_ucVoltRange = eInit; ucNormalTiming = 0; CddStp88XXVolt_StpVoltRng(); CddStpVolt_ucVoltRange = eInit; ucNormalTiming = 1; CddStp88XXVolt_StpVoltRng(); CddStpVolt_ucEndResult = 3; // StateVoltOff=0, StateVoltUnder = 1, StateVoltNormal = 2, StateVoltOver = 3, StateVoltStartValue = 0xFF CddStpVolt_ucVoltRange = eInit; ucNormalTiming = 0; CddStp88XXVolt_StpVoltRng(); CddStpVolt_ucVoltRange = eInit; ucNormalTiming = 1; CddStp88XXVolt_StpVoltRng(); CddStpVolt_ucEndResult = 2; // StateVoltOff=0, StateVoltUnder = 1, StateVoltNormal = 2, StateVoltOver = 3, StateVoltStartValue = 0xFF CddStpVolt_ucVoltRange = eInit; ucNormalTiming = 0; CddStp88XXVolt_StpVoltRng(); CddStpVolt_ucVoltRange = eInit; ucNormalTiming = 1; CddStp88XXVolt_StpVoltRng(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XXVolt_StpVoltRng(void) { CddStp_UnitTest_Printf("\n"); // nice formatting if 'CDDSTP_UNIT_TEST_DEBUGGING' is set // Step1: do some ini CleanUp(); CddStpVolt_ucVoltRange = eNormal; CddStp_UnitTest__u32Voltage_mV = 13500; // 13,5V CDDSTP_ApplCodData_Sys.Stp_Voltage_High2 = 197; // Hi2 - applicationCodingData CddStpVolt_ucEndResult = CDDSTP88XX_StateVoltStartValue; CddStp_UnitTest__CodDataStatus = tieDataStatus_Invalid; // Step2: call function CddStp88XXVolt_StpVoltRng(); // Step3: call check AL_UNITTEST_CHECK(CddStpVolt_ucVoltRange, eNormal, == ); // Step1: do some ini CddStpVolt_ucVoltRange = eNormal; CddStp_UnitTest__CodDataStatus = tieDataStatus_Valid; // Step2: call function CddStp88XXVolt_StpVoltRng(); // Step3: call check AL_UNITTEST_CHECK(CddStpVolt_ucVoltRange, eNormal, == ); // Step1: do some ini CddStpVolt_ucVoltRange = CddStpVolt_ucVoltRange; // if (unVoltage_mV >= (((uint16)Cod_StpSpannungHi2() + CDDSTP88XXVOLT_HI_DISABLEOFFSET) * 100u)) // [mv] // else if (unVoltage_mV >= (((uint16)Cod_StpSpannungHi1() + CDDSTP88XXVOLT_HI_DISABLEOFFSET) * 100u)) // [mv] // else if (unVoltage_mV >= ((uint16)Cod_StpSpannungLo1() * 100u)) // [mv] // e.g. Lo1=96 -> *100 = 9600 -> 9,6V // else if (unVoltage_mV >= ((uint16)Cod_StpSpannungLo2() * 100u)) // [mv] // else if (unVoltage_mV >= ((uint16)Cod_StpSpannungLo3() * 100u)) // [mv] // else CddStp_UnitTest__u32Voltage_mV = (((uint16)Cod_StpSpannungHi2() + CDDSTP88XXVOLT_HI_DISABLEOFFSET) * 100u) + 1u; // Step2: call function CddStp88XXVolt_StpVoltRng(); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStpVolt_ucVoltRange, eHigh2, == ); Mt_CddStp88XXVolt_StpVoltRng_EndResultHandling(); // Step1: do some ini CddStpVolt_ucVoltRange = CddStpVolt_ucVoltRange; // if (unVoltage_mV >= (((uint16)Cod_StpSpannungHi2() + CDDSTP88XXVOLT_HI_DISABLEOFFSET) * 100u)) // [mv] // else if (unVoltage_mV >= (((uint16)Cod_StpSpannungHi1() + CDDSTP88XXVOLT_HI_DISABLEOFFSET) * 100u)) // [mv] // else if (unVoltage_mV >= ((uint16)Cod_StpSpannungLo1() * 100u)) // [mv] // e.g. Lo1=96 -> *100 = 9600 -> 9,6V // else if (unVoltage_mV >= ((uint16)Cod_StpSpannungLo2() * 100u)) // [mv] // else if (unVoltage_mV >= ((uint16)Cod_StpSpannungLo3() * 100u)) // [mv] // else CddStp_UnitTest__u32Voltage_mV = (((uint16)Cod_StpSpannungHi1() + CDDSTP88XXVOLT_HI_DISABLEOFFSET) * 100u) + 1u; // Step2: call function CddStp88XXVolt_StpVoltRng(); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStpVolt_ucVoltRange, eHigh1, == ); Mt_CddStp88XXVolt_StpVoltRng_EndResultHandling(); // Step1: do some ini CddStpVolt_ucVoltRange = CddStpVolt_ucVoltRange; // if (unVoltage_mV >= (((uint16)Cod_StpSpannungHi2() + CDDSTP88XXVOLT_HI_DISABLEOFFSET) * 100u)) // [mv] // else if (unVoltage_mV >= (((uint16)Cod_StpSpannungHi1() + CDDSTP88XXVOLT_HI_DISABLEOFFSET) * 100u)) // [mv] // else if (unVoltage_mV >= ((uint16)Cod_StpSpannungLo1() * 100u)) // [mv] // e.g. Lo1=96 -> *100 = 9600 -> 9,6V // else if (unVoltage_mV >= ((uint16)Cod_StpSpannungLo2() * 100u)) // [mv] // else if (unVoltage_mV >= ((uint16)Cod_StpSpannungLo3() * 100u)) // [mv] // else CddStp_UnitTest__u32Voltage_mV = ((uint16)Cod_StpSpannungLo1() * 100u) + 1u; // Step2: call function CddStp88XXVolt_StpVoltRng(); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStpVolt_ucVoltRange, eNormal, == ); Mt_CddStp88XXVolt_StpVoltRng_EndResultHandling(); // Step1: do some ini CddStpVolt_ucVoltRange = CddStpVolt_ucVoltRange; // if (unVoltage_mV >= (((uint16)Cod_StpSpannungHi2() + CDDSTP88XXVOLT_HI_DISABLEOFFSET) * 100u)) // [mv] // else if (unVoltage_mV >= (((uint16)Cod_StpSpannungHi1() + CDDSTP88XXVOLT_HI_DISABLEOFFSET) * 100u)) // [mv] // else if (unVoltage_mV >= ((uint16)Cod_StpSpannungLo1() * 100u)) // [mv] // e.g. Lo1=96 -> *100 = 9600 -> 9,6V // else if (unVoltage_mV >= ((uint16)Cod_StpSpannungLo2() * 100u)) // [mv] // else if (unVoltage_mV >= ((uint16)Cod_StpSpannungLo3() * 100u)) // [mv] // else CddStp_UnitTest__u32Voltage_mV = ((uint16)Cod_StpSpannungLo2() * 100u) + 1u; // Step2: call function CddStp88XXVolt_StpVoltRng(); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStpVolt_ucVoltRange, eLow1, == ); Mt_CddStp88XXVolt_StpVoltRng_EndResultHandling(); // Step1: do some ini CddStpVolt_ucVoltRange = CddStpVolt_ucVoltRange; // if (unVoltage_mV >= (((uint16)Cod_StpSpannungHi2() + CDDSTP88XXVOLT_HI_DISABLEOFFSET) * 100u)) // [mv] // else if (unVoltage_mV >= (((uint16)Cod_StpSpannungHi1() + CDDSTP88XXVOLT_HI_DISABLEOFFSET) * 100u)) // [mv] // else if (unVoltage_mV >= ((uint16)Cod_StpSpannungLo1() * 100u)) // [mv] // e.g. Lo1=96 -> *100 = 9600 -> 9,6V // else if (unVoltage_mV >= ((uint16)Cod_StpSpannungLo2() * 100u)) // [mv] // else if (unVoltage_mV >= ((uint16)Cod_StpSpannungLo3() * 100u)) // [mv] // else CddStp_UnitTest__u32Voltage_mV = ((uint16)Cod_StpSpannungLo3() * 100u) + 1u; // Step2: call function CddStp88XXVolt_StpVoltRng(); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStpVolt_ucVoltRange, eLow2, == ); Mt_CddStp88XXVolt_StpVoltRng_EndResultHandling(); // Step1: do some ini CddStpVolt_ucVoltRange = CddStpVolt_ucVoltRange; // if (unVoltage_mV >= (((uint16)Cod_StpSpannungHi2() + CDDSTP88XXVOLT_HI_DISABLEOFFSET) * 100u)) // [mv] // else if (unVoltage_mV >= (((uint16)Cod_StpSpannungHi1() + CDDSTP88XXVOLT_HI_DISABLEOFFSET) * 100u)) // [mv] // else if (unVoltage_mV >= ((uint16)Cod_StpSpannungLo1() * 100u)) // [mv] // e.g. Lo1=96 -> *100 = 9600 -> 9,6V // else if (unVoltage_mV >= ((uint16)Cod_StpSpannungLo2() * 100u)) // [mv] // else if (unVoltage_mV >= ((uint16)Cod_StpSpannungLo3() * 100u)) // [mv] // else CddStp_UnitTest__u32Voltage_mV = ((uint16)Cod_StpSpannungLo3() * 100u) - 1u; CddStp_tCodingAreaSys.STP_QUELLE_TT = 16; // Step2: call function CddStp88XXVolt_StpVoltRng(); uint8 ucResult = Cod_StpQuelleTT(); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStpVolt_ucVoltRange, eLow3, == ); AL_UNITTEST_CHECK(ucResult, 0, == ); Mt_CddStp88XXVolt_StpVoltRng_EndResultHandling(); // Step4: Clean up CleanUp(); CddStp_UnitTest_Printf(" ... "); // shift the following 'passed' a little bit right } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XXVolt_StpVoltCycle(void) { // Step1: do some ini CddStpVolt_unTimerCnt = 1; CddStpVolt_ucPreResult = 3; // StateVoltOff=0, StateVoltUnder=1, StateVoltNormal=2, StateVoltOver=3, StateVoltStartValue=0xFF CddStpVolt_ucEndResult = 2; CddStp88XX_ucStateVolt = 1; // Step2: call function CddStp88XXVolt_StpVoltCycle(); // Step3: call check AL_UNITTEST_CHECK(CddStpVolt_ucEndResult, CddStpVolt_ucPreResult, == ); AL_UNITTEST_CHECK(CddStpVolt_ucEndResult, CddStpVolt_ucPreResult, == ); AL_UNITTEST_CHECK(CddStpVolt_ucEndResult, CddStp88XX_ucStateVolt, == ); // Step1: do some ini CddStpVolt_unTimerCnt = 2; // Step2: call function CddStp88XXVolt_StpVoltCycle(); // Step3: call check AL_UNITTEST_CHECK(CddStpVolt_ucEndResult, CddStp88XX_ucStateVolt, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpVolt_IoHwAbUser_GetECUSupply(void) { // Step1: do some ini uint16 unVoltage_mV = 0x1234u; CddStp_UnitTest__u32Voltage_mV = 13500; // 13,5V // Step2: call function CddStpVolt_IoHwAbUser_GetECUSupply(&unVoltage_mV); // Step3: call check AL_UNITTEST_CHECK(unVoltage_mV, CddStp_UnitTest__u32Voltage_mV, == ); // Step1: do some ini unVoltage_mV = 0x2345u; CddStp_UnitTest__u32Voltage_mV = 13550; // 13,5V CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; CddStp_Simulation_Data.unVBatt_EcuSupply_mV = CDDSTP_SIMULATION_UNUSED_VALUE; // Step2: call function CddStpVolt_IoHwAbUser_GetECUSupply(&unVoltage_mV); // Step3: call check CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; AL_UNITTEST_CHECK(unVoltage_mV, CddStp_UnitTest__u32Voltage_mV, == ); // Step1: do some ini CddStp_Simulation_Data.unVBatt_EcuSupply_mV = CddStp_UnitTest__u32Voltage_mV + 500; // Step2: call function CddStpVolt_IoHwAbUser_GetECUSupply(&unVoltage_mV); // Step3: call check AL_UNITTEST_CHECK(unVoltage_mV, CddStp_Simulation_Data.unVBatt_EcuSupply_mV, == ); // Step1: do some ini CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; CddStp_Simulation_Data.unVBatt_EcuSupply_mV = CddStp_UnitTest__u32Voltage_mV + 500; // Step2: call function CddStpVolt_IoHwAbUser_GetECUSupply(&unVoltage_mV); // Step3: call check AL_UNITTEST_CHECK(unVoltage_mV, CddStp_Simulation_Data.unVBatt_EcuSupply_mV, == ); // Step4: Clean up CleanUp(); } extern void CddStpVolt_TimerStop(void); // local prototype //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpVolt_TimerStop(void) { // Step1: do some ini CddStpVolt_unTimerCnt = 123; // Step2: call function CddStpVolt_TimerStop(); // Step3: call check AL_UNITTEST_CHECK(CddStpVolt_unTimerCnt, 0, == ); } extern void CddStpVolt_TimerRestart(uint16 unTime_Cnt, uint8 ucPreResult); // local prototype //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpVolt_TimerRestart(void) { // Step1: do some ini uint16 unTime_Cnt = 0x1234u; uint8 ucPreResult = 0x23u; CddStpVolt_unTimerCnt = 123; // Step2: call function CddStpVolt_TimerRestart(unTime_Cnt, ucPreResult); // Step3: call check AL_UNITTEST_CHECK(CddStpVolt_unTimerCnt, unTime_Cnt, == ); // Step1: do some ini unTime_Cnt = 0u; CddStpVolt_unTimerCnt = 123; // Step2: call function CddStpVolt_TimerRestart(unTime_Cnt, ucPreResult); // Step3: call check AL_UNITTEST_CHECK(CddStpVolt_unTimerCnt, 0, == ); } extern void CddStpVolt_FinalResult(uint8 ucEndResult); // local prototype //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpVolt_FinalResult(void) { // Step1: do some ini const uint8 ucEndResult = 0x12u; CddStpVolt_ucEndResult = ucEndResult; // Step2: call function CddStpVolt_FinalResult(ucEndResult); // Step3: call check AL_UNITTEST_CHECK(ucEndResult, CddStpVolt_ucEndResult, == ); // Step1: do some ini CddStpVolt_ucEndResult = ucEndResult + 1; // Step2: call function CddStpVolt_FinalResult(ucEndResult); // Step3: call check AL_UNITTEST_CHECK(ucEndResult, CddStpVolt_ucEndResult, == ); } extern uint16 CddStpVolt_ConvMsToCnt(uint16 unTime_ms); // local prototype //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpVolt_ConvMsToCnt(void) { // Step1: do some ini uint16 unTime_ms = 0x1234u; uint16 unResult; // Step2: call function unResult = CddStpVolt_ConvMsToCnt(unTime_ms); // Step3: call check AL_UNITTEST_CHECK(unResult, 466, == ); } // ************* CddStp8899.c **************************** // void CddStp88XX_Init(uint8 ucIx) // void CddStp88XX_EftCodingLr(void) //STATIC_AL void CddStp88XX_EftCodingLr_2(void) // void CddStp88XX_GetState(uint8 ucIx) // void CddStp88XX_Event(uint8 ucIx, tEventCmdCddStp eEventCmd) // void CddStp88XX_Volt(const uint8 ucStateVolt) //STATIC_AL tIdentityConfig Appl_GetIdentity(void) // ... and many more //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_Init(void) { CddStp_UnitTest_Printf("\n"); // nice formatting if 'CDDSTP_UNIT_TEST_DEBUGGING' is set // Step1: do some ini uint8 ucIx = 0; CddStp88XX_aBitsMod[ucIx].ulRaw = 0xAB; CddStp88XX_aBitsMod[0].Bit.biHalStpInit = 0; CddStp_UnitTest_Printf("\n *#*#*#*#*#*#*#* JK - Mt_CddStp88XX_Init *#*#*#*#*#*#*#*\n"); // #include // Step2: call function CddStp88XX_Init(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].ulRaw, 0x4000000, == ); CddStp_UnitTest_Printf(" ... "); // shift the following 'passed' a little bit right } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_EftCodingLr(void) { CddStp_UnitTest_Printf("\n"); // nice formatting if 'CDDSTP_UNIT_TEST_DEBUGGING' is set // Step1: do some ini const uint32 cIniValue = 10; CddStp8899_boEftCodValid = FALSE; CddStp_UnitTest__MountingSide = eIoHwAbUser_MountingSide_Left; // tbd: 'eIdentityUndef' CddStp_UnitTest__EftDataStatus = tieDataStatus_Invalid; // tbd: 'tieDataStatus_Valid' CddStp_UnitTest__CodDataStatus = tieDataStatus_Invalid; // tbd: 'tieDataStatus_Valid' CddStp_ActAll.sLwrActual.sStatusError.eStatSupported = (tieSupportInfo)SUPPORT_SNA; CddStp_UnitTest__tieEftData[0].ucType = 0; CddStp_tCodingAreaLwr.Modus.biEnable = FALSE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = FALSE; //CddStpDyn_UnitTest___tCodingAreaLwr_Modus_biEnable = FALSE; CddStp88XX_ucNumOfSteppers_EFT = 0; // Step2: call function CddStp88XX_EftCodingLr(); // -> 'CddStp88XX_EftCodingLr_2' // Step3: call check AL_UNITTEST_CHECK(CddStp8899_boEftCodValid, FALSE, == ); AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.eStatSupported, (tieSupportInfo)SUPPORT_UNKNOWN, == ); // Step1: do some ini CddStp8899_boEftCodValid = FALSE; CddStp_UnitTest__MountingSide = eIoHwAbUser_MountingSide_Left; // tbd: 'eIdentityUndef' CddStp_UnitTest__EftDataStatus = tieDataStatus_Valid; CddStp_UnitTest__CodDataStatus = tieDataStatus_Valid; CddStp_ActAll.sLwrActual.sStatusError.eStatSupported = (tieSupportInfo)SUPPORT_SNA; CddStp_UnitTest__tieEftData[0].ucType = 0u; CddStp88XX_ucNumOfSteppers_EFT = 0; // Step2: call function CddStp88XX_EftCodingLr(); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_ucNumOfSteppers_EFT, 0, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899_boEftCodValid, TRUE, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.eStatSupported, (tieSupportInfo)SUPPORT_NO, == ); // Step1: do some ini CddStp8899_boEftCodValid = FALSE; CddStp_ActAll.sLwrActual.sStatusError.eStatSupported = (tieSupportInfo)SUPPORT_SNA; CddStp_UnitTest__tieEftData[0].ucType = 1u; CddStp_tCodingAreaLwr.Modus.biEnable = FALSE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = FALSE; // Step2: call function CddStp88XX_EftCodingLr(); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899_boEftCodValid, TRUE, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.eStatSupported, (tieSupportInfo)SUPPORT_NO, == ); // Step1: do some ini CddStp8899_boEftCodValid = FALSE; CddStp_ActAll.sLwrActual.sStatusError.eStatSupported = (tieSupportInfo)SUPPORT_SNA; CddStp_tCodingAreaLwr.Modus.biEnable = FALSE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = FALSE; //CddStpDyn_UnitTest___tCodingAreaLwr_Modus_biEnable = TRUE; CddStp88XX_ucNumOfSteppers_EFT = 0; CddStp88XX_ucNumOfSteppers_Coding = 0; // Step2: call function CddStp88XX_EftCodingLr(); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899_boEftCodValid, TRUE, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp88XX_ucNumOfSteppers_EFT, 1, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp88XX_ucNumOfSteppers_Coding, 1, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.eStatSupported, (tieSupportInfo)SUPPORT_YES, == ); CddStp_UnitTest_Printf(" ... "); // shift the following 'passed' a little bit right } extern void CddStp88XX_EftCodingLr_2(void); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_EftCodingLr_2(void) { CddStp_UnitTest_Printf("\n"); // nice formatting if 'CDDSTP_UNIT_TEST_DEBUGGING' is set // Step1: do some ini const uint32 cIniValue = 10; CddStp_ActAll.sLwrActual.sStatusError.eStatSupported = (tieSupportInfo)SUPPORT_SNA; CddStp_tCodingAreaLwr.Modus.biEnable = FALSE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = FALSE; //CddStpDyn_UnitTest___tCodingAreaLwr_Modus_biEnable = TRUE; CddStp88XX_ucNumOfSteppers_EFT = 0; CddStp88XX_ucNumOfSteppers_Coding = 0; CddStp_UnitTest__tieEftData[0].ucType = 0u; CddStp_UnitTest__tieEftData[1].ucType = 0u; CddStp_UnitTest__tieEftData[2].ucType = 0u; Test_Eft_EcuVarCfg_Used[0].ucType = CDDSTP88XX_Hw_eMax + 1; // Step2: call function CddStp88XX_EftCodingLr_2(); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_ucNumOfSteppers_EFT, 1, == ); AL_UNITTEST_CHECK(CddStp88XX_ucNumOfSteppers_Coding, 0, == ); AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.eStatSupported, (tieSupportInfo)SUPPORT_NO, == ); // Step1: do some ini CddStp8899_boEftCodValid = FALSE; CddStp_ActAll.sLwrActual.sStatusError.eStatSupported = (tieSupportInfo)SUPPORT_SNA; CddStp_UnitTest__tieEftData[0].ucType = 1u; CddStp_tCodingAreaLwr.Modus.biEnable = FALSE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = FALSE; Test_Eft_EcuVarCfg_Used[0].ucType = STP_HW_TYPE_8899; // Step2: call function CddStp88XX_EftCodingLr_2(); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_ucNumOfSteppers_EFT, 1, == ); AL_UNITTEST_CHECK(CddStp88XX_ucNumOfSteppers_Coding, 0, == ); AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.eStatSupported, (tieSupportInfo)SUPPORT_NO, == ); // Step1: do some ini CddStp_ActAll.sLwrActual.sStatusError.eStatSupported = (tieSupportInfo)SUPPORT_SNA; CddStp_tCodingAreaLwr.Modus.biEnable = TRUE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = TRUE; //CddStpDyn_UnitTest___tCodingAreaLwr_Modus_biEnable = TRUE; CddStp88XX_ucNumOfSteppers_EFT = 0; CddStp88XX_ucNumOfSteppers_Coding = 0; // Step2: call function CddStp88XX_EftCodingLr_2(); (void)Cod_StpSpgDebOn(); (void)Cod_LwrRichtungLi(); (void)Cod_LwrRichtung(); (void)Cod_LwrParkingLowering(); (void)Cod_LwrSafetyLowering1(); (void)Cod_LwrSafetyLowering2(); (void)Cod_LwrResHsZeitU1(); (void)Cod_LwrResHsZeitO1(); (void)Cod_LwrResHsZeitU2(); (void)Cod_LwrResHsZeitO2(); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_ucNumOfSteppers_EFT, 1, == ); AL_UNITTEST_CHECK(CddStp88XX_ucNumOfSteppers_Coding, 1, == ); AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.eStatSupported, (tieSupportInfo)SUPPORT_YES, == ); // Step1: do some ini CddStp8899_boEftCodValid = FALSE; CddStp_ActAll.sLwrActual.sStatusError.eStatSupported = (tieSupportInfo)SUPPORT_SNA; CddStp_UnitTest__tieEftData[0].ucType = 1u; CddStp_UnitTest__tieEftData[1].ucType = 1u; CddStp_UnitTest__tieEftData[2].ucType = 1u; CddStpDyn_UnitTest___tCodingAreaLwr_Modus_eSchrittMod = NvmPara_eSchrittMod2; // = 0, // 1/2 step (half step) CddStp_tCodingAreaLwr.Modus.eSchrittMod = CddStpDyn_UnitTest___tCodingAreaLwr_Modus_eSchrittMod; // = 0, // 1/2 step (half step) CddStp_tCodingAreaLwr.Modus.biEnable = TRUE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = TRUE; // Step2: call function CddStp88XX_EftCodingLr_2(); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp88XX_ucNumOfSteppers_EFT, 3, == ); AL_UNITTEST_CHECK(CddStp88XX_ucNumOfSteppers_Coding, 1, == ); AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.eStatSupported, (tieSupportInfo)SUPPORT_YES, == ); // Step1: do some ini CddStpDyn_UnitTest___tCodingAreaLwr_Modus_eSchrittMod = NvmPara_eSchrittMod8; // = 2, // 1/8 step (micro step) CddStp_tCodingAreaLwr.Modus.eSchrittMod = CddStpDyn_UnitTest___tCodingAreaLwr_Modus_eSchrittMod; // = 2, // 1/8 step (micro step) // Step2: call function CDDSTP_ApplCodData_AvacStp_Geo.AvacStp_Direction = 1; (void)Cod_LwrRichtungLi(); (void)Cod_LwrRichtungRe(); (void)Cod_LwrRichtung(); CDDSTP_ApplCodData_AvacStp_Geo.AvacStp_Direction = 0; (void)Cod_LwrRichtungLi(); (void)Cod_LwrRichtungRe(); (void)Cod_LwrRichtung(); CddStp_UnitTest__EftDataStatus = tieDataStatus_Invalid; (void)CddStp_ReadCodingData(); CddStp_UnitTest__EftDataStatus = tieDataStatus_Valid; (void)CddStp_ReadCodingData(); CddStp88XX_EftCodingLr_2(); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp88XX_ucNumOfSteppers_EFT, 3, == ); AL_UNITTEST_CHECK(CddStp88XX_ucNumOfSteppers_Coding, 1, == ); AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.eStatSupported, (tieSupportInfo)SUPPORT_YES, == ); CddStp_UnitTest_Printf(" ... "); // shift the following 'passed' a little bit right } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_GetState(void) { CddStp_UnitTest_Printf("\n"); // nice formatting if 'CDDSTP_UNIT_TEST_DEBUGGING' is set // Step1: do some ini uint8 ucIx = 0; CddStp_ActAll.sLwrActual.sStatusError.boIsReady = FALSE; CddStp88XX_aStpState[ucIx].Bit.IsReady = TRUE; // Step2: call function CddStp88XX_GetState(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.boIsReady, TRUE, == ); // Step1: do some ini CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; CddStp_ActAll.sLwrActual.sStatusError.boIsFatalError = FALSE; CddStp_Simulation_Data.ucSim_DriverDefect = eSimuHandling_Active; // Step2: call function CddStp88XX_GetState(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.boIsFatalError, TRUE, == ); // Step1: do some ini CddStp88XX_aeState[ucIx] = CddStp88XX_eStateErr; CddStp88XX_aStpState[ucIx].Bit.ErrSpiError = 1u; // Step2: call function CddStp88XX_GetState(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.boIsFatalError, TRUE, == ); // Step1: do some ini CddStp88XX_aeState[ucIx] = CddStp88XX_eStateIdle; CddStp88XX_aStpState[ucIx].Bit.ErrSpiError = 1u; // Step2: call function CddStp88XX_GetState(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.boIsFatalError, TRUE, == ); // Step1: do some ini CddStp88XX_aeState[ucIx] = CddStp88XX_eStateErr; CddStp88XX_aStpState[ucIx].Bit.ErrSpiError = 1u; // Step2: call function CddStp88XX_GetState(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.boIsFatalError, TRUE, == ); // Step3: call check AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.boIsFatalError, TRUE, == ); // Step1: do some ini CddStp88XX_aeState[ucIx] = CddStp88XX_eStateIdle; CddStp88XX_aStpState[ucIx].Bit.ErrSpiError = 0u; // Step2: call function CddStp88XX_GetState(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.boIsFatalError, TRUE, == ); // Step4: Clean up CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_DEACTIVATED; CddStp_UnitTest_Printf(" ... "); // shift the following 'passed' a little bit right } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_Event(void) { CddStp_UnitTest_Printf("\n"); // nice formatting if 'CDDSTP_UNIT_TEST_DEBUGGING' is set // Step1: do some ini uint8 ucIx = 0; tEventCmdCddStp eEventCmd = CDDSTP_eStandardEvent; CddStp88XX_aEventBits[ucIx].Bit.biFinishMove = 1; CddStp88XX_aEventBits[ucIx].unData = 0; // Step2: call function CddStp88XX_Event(ucIx, eEventCmd); // Step3: call check // Step1: do some ini eEventCmd = CDDSTP_eAlternativeTrigger; // Step2: call function CddStp88XX_Event(ucIx, eEventCmd); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini CddStp88XX_aEventBits[ucIx].unData = 1; CddStp88XX_aEventBits[ucIx].Bit.biFinishMove = 1; // Step2: call function CddStp88XX_Event(ucIx, eEventCmd); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini CddStp88XX_aEventBits[ucIx].unData = 0xFFFFu; CddStp88XX_aEventBits[ucIx].Bit.biFinishMove = 0u; // Step2: call function CddStp88XX_Event(ucIx, eEventCmd); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_Volt(void) { // Step1: do some ini uint8 ucStateVolt = CDDSTP88XX_StateVoltNormal; CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltOff; // Step2: call function CddStp88XX_Volt(ucStateVolt); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_ucStateVolt, CDDSTP88XX_StateVoltNormal, == ); // Step1: do some ini ucStateVolt = CDDSTP88XX_StateVoltUnder; CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltOff; // Step2: call function CddStp88XX_Volt(ucStateVolt); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_ucStateVolt, CDDSTP88XX_StateVoltUnder, == ); // Step1: do some ini ucStateVolt = CDDSTP88XX_StateVoltOver; CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltOff; // Step2: call function CddStp88XX_Volt(ucStateVolt); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_ucStateVolt, CDDSTP88XX_StateVoltOver, == ); } // STATIC_AL tIdentityConfig Appl_GetIdentity(void) // { return ePluggedLeft; } typedef enum { ePluggedLeft = 0, ePluggedRight = 1, eIdentityUndef = 255 } tIdentityConfig; extern tIdentityConfig Appl_GetIdentity(void); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_Appl_GetIdentity(void) { // Step1: do some ini tIdentityConfig conf; CddStp_UnitTest__MountingSide = eIoHwAbUser_MountingSide_Left; // Step2: call function conf = Appl_GetIdentity(); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(conf, ePluggedLeft, == ); // Step1: do some ini CddStp_UnitTest__MountingSide = 0; // Step2: call function conf = Appl_GetIdentity(); // Step3: call check AL_UNITTEST_CHECK(conf, eIdentityUndef, == ); // Step1: do some ini CddStp_UnitTest__MountingSide = eIoHwAbUser_MountingSide_Right; // Step2: call function conf = Appl_GetIdentity(); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(conf, ePluggedRight, == ); } //STATIC_AL void CddStp88XX_DeInit(uint8 ucIx) extern void CddStp88XX_DeInit(uint8 ucIx); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_DeInit(void) { // Step1: do some ini uint8 ucIx = 0; CddStp88XX_aStpCtrl[ucIx].Bit.Stop = 0; // Step2: call function CddStp88XX_DeInit(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpCtrl[ucIx].Bit.Stop, 1, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_Cycle0() { // Step1: do some ini uint8 ucIx = 1; CddStp88XX_aBits[ucIx].Bit.biActPosValid = TRUE; // Step2: call function CddStp88XX_Cycle0(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBits[ucIx].Bit.biActPosValid, FALSE, == ); // Step1: do some ini ucIx = 0; CddStp88XX_aStpState[ucIx].Group.ucErrLock = 0u; CddStp88XX_aStpState[ucIx].Bit.VoltNorm = 1u; CddStp88XX_aStpState[ucIx].Bit.IsRef = 1u; CddStp88XX_aBits[ucIx].Bit.biActPosValid = FALSE; CddStp88XX_aEventBits[ucIx].unData = 0; CddStpVolt_ucEndResult = 2; // StateVoltOff=0, StateVoltUnder=1, StateVoltNormal=2, StateVoltOver=3, StateVoltStartValue=0xFF // Step2: call function CddStp88XX_Cycle0(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBits[ucIx].Bit.biActPosValid, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TgtVal(void) { // Step1: do some ini uint8 ucIx = 0; CddStp88XX_aBits[ucIx].Bit.biActPosValid = TRUE; // Step2: call function CddStp88XX_TgtVal(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBits[ucIx].Bit.biActPosValid, TRUE, == ); // Step1: do some ini //ucIx = 1; CddStp88XX_aStpState[ucIx].Group.ucErrLock = 0u; CddStp88XX_aStpState[ucIx].Bit.VoltNorm = 1u; CddStp88XX_aStpState[ucIx].Bit.IsRef = 1u; CddStp88XX_aBits[ucIx].Bit.biActPosValid = FALSE; // Step2: call function CddStp88XX_TgtVal(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBits[ucIx].Bit.biActPosValid, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_CtrlFct0(void) { // Step1: do some ini uint8 ucIx = 0; uint32 ulCmd = CddStp_eCtrlFct0_ErrActivate; tisCtrlData0 data; data.ucData0 = 0; CddStp88XX_aStpState[ucIx].Bit.IsReady = 0; // Step2: call function CddStp88XX_CtrlFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini ulCmd = CddStp_eCtrlFct0_ModeOff; data.ucData0 = 0; CddStp88XX_aStpCtrl[ucIx].Bit.On = 1; // Step2: call function CddStp88XX_CtrlFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpCtrl[ucIx].Bit.On, 0, == ); // Step1: do some ini ulCmd = CddStp_eCtrlFct0_ModeOn; data.ucData0 = 0; CddStp88XX_aStpCtrl[ucIx].Bit.On = 0; // Step2: call function CddStp88XX_CtrlFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpCtrl[ucIx].Bit.On, 1, == ); // Step1: do some ini ulCmd = CddStp_eCtrlFct0_ModeOn; data.ucData0 = 0; CddStp88XX_aStpCtrl[ucIx].Bit.On = 1u; // Step2: call function CddStp88XX_CtrlFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpCtrl[ucIx].Bit.On, 1, == ); // Step1: do some ini ulCmd = CddStp_eCtrlFct0_ModeRel; data.ucData0 = 0; CddStp88XX_aStpState[ucIx].Bit.IsRef = 1; // Step2: call function CddStp88XX_CtrlFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsRef, 0, == ); // Step1: do some ini ulCmd = CddStp_eCtrlFct0_ModeAbs; data.ucData0 = 0; CddStp88XX_aStpState[ucIx].Bit.IsRef = 0; // Step2: call function CddStp88XX_CtrlFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsRef, 0, == ); // Step1: do some ini ulCmd = CddStp_eCtrlFct0_ModeStop; data.ucData0 = 0; CddStp88XX_aStpState[ucIx].Bit.RefActive = 0u; CddStp88XX_aStpCtrl[ucIx].Bit.Stop = 1u; // Step2: call function CddStp88XX_CtrlFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpCtrl[ucIx].Bit.Stop, 0, == ); // Step1: do some ini ulCmd = CddStp_eCtrlFct0_ModeStop; CddStp88XX_aStpState[ucIx].Bit.RefActive = 0u; CddStp88XX_aStpCtrl[ucIx].Bit.Stop = 0u; //(tCddStpCtrlFct0_DataBuffer)data.SoftStop = 1u; data.ucData0 = 1u; // Step2: call function CddStp88XX_CtrlFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpCtrl[ucIx].Bit.Stop, 1, == ); // Step1: do some ini ulCmd = CddStp_eCtrlFct0_ModeStop; data.ucData0 = 0x0; CddStp88XX_aStpState[ucIx].Bit.RefActive = 0u; // Step2: call function CddStp88XX_CtrlFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpCtrl[ucIx].Bit.Stop, 0, == ); // Step1: do some ini ulCmd = CddStp_eCtrlFct0_ModeStop; data.ucData0 = 0; CddStp88XX_aStpState[ucIx].Bit.RefActive = 1u; // Step2: call function CddStp88XX_CtrlFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpCtrl[ucIx].Bit.Stop, 0, == ); // Step1: do some ini ulCmd = CddStp_eCtrlFct0_ModeRef; data.ucData0 = 0; CddStp88XX_aStpCtrl[ucIx].Bit.Stop = 1; // Step2: call function CddStp88XX_CtrlFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpCtrl[ucIx].Bit.Stop, 0, == ); // Step1: do some ini ulCmd = CddStp_eCtrlFct0_ErrInhibit; data.ucData0 = 0; // Step2: call function CddStp88XX_CtrlFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpCtrl[ucIx].Bit.Stop, 0, == ); // Step1: do some ini ulCmd = CddStp_eCtrlFct0_ErrClr; data.ucData0 = 0; CddStp88XX_aStpCtrl[ucIx].Bit.ErrClr = 0; // Step2: call function CddStp88XX_CtrlFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpCtrl[ucIx].Bit.ErrClr, 1, == ); // Step1: do some ini ulCmd = CddStp_eCtrlFct0_LowTemp; CddStp88XX_aBits[ucIx].Bit.biLT = 0; data.ucData0 = 0xFF; // Step2: call function CddStp88XX_CtrlFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBits[ucIx].Bit.biLT, 1, == ); // Step1: do some ini ulCmd = CddStp_eCtrlFct0_GetTempState; data.ucData0 = 0; CddStp88XX_aeTemp[ucIx] = 0xAB; // Step2: call function CddStp88XX_CtrlFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(data.ucData0, CddStp88XX_aeTemp[ucIx], == ); // Step1: do some ini ulCmd = CddStp_eCtrlFct0_SetIsReady; CddStp88XX_aStpState[ucIx].Bit.IsReady = 0; // Step2: call function CddStp88XX_CtrlFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 1, == ); // Step1: do some ini ulCmd = 0xFF; CddStp88XX_aStpState[ucIx].Bit.IsReady = 0; // Step2: call function CddStp88XX_CtrlFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_ParaFct0(void) { // Step1: do some ini uint8 ucIx = 0; uint32 ulCmd = eParaFct0_CodingDataInvalid; tisParaData0 data; CddStp88XX_BitsGlobalInitOnce.Bit.biCodingDataValid = 1; // Step2: call function CddStp88XX_ParaFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_BitsGlobalInitOnce.Bit.biCodingDataValid, 0, == ); // Step1: do some ini ulCmd = eParaFct0_CodingDataValid; CddStp88XX_BitsGlobalInitOnce.Bit.biCodingDataValid = 0; // Step2: call function CddStp88XX_ParaFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_BitsGlobalInitOnce.Bit.biCodingDataValid, 1, == ); // Step1: do some ini ulCmd = 0xFF; CddStp88XX_BitsGlobalInitOnce.Bit.biCodingDataValid = 0; // Step2: call function CddStp88XX_ParaFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_BitsGlobalInitOnce.Bit.biCodingDataValid, 0, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_CntFct0(void) { // Step1: do some ini uint8 ucIx = 0; uint32 ulCmd = CddStp_eCntCmd_GetHsCnt; tisCntData0 data; data.ucData0 = 0xAB; // Step2: call function CddStp88XX_CntFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(data.ucData0, 0, == ); // Step1: do some ini ulCmd = CddStp_eCntCmd_GetIrunTime; data.ucData0 = 0xAB; // Step2: call function CddStp88XX_CntFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(data.ucData0, 0, == ); ulCmd = CddStp_eCntCmd_GetIrunTime; CddStp88XX_CntFct0(ulCmd, ucIx, &data); ulCmd = CddStp_eCntCmd_GetStpOnTime; CddStp88XX_CntFct0(ulCmd, ucIx, &data); ulCmd = CddStp_eCntCmd_GetRefStartCnt; CddStp88XX_CntFct0(ulCmd, ucIx, &data); ulCmd = CddStp_eCntCmd_GetIsRefCnt; CddStp88XX_CntFct0(ulCmd, ucIx, &data); ulCmd = CddStp_eCntCmd_GetKlPosDevHistCnts; CddStp88XX_CntFct0(ulCmd, ucIx, &data); // Step1: do some ini data.ucData0 = 0xAB; ulCmd = CddStp_eCntCmd_GetLastDeviation; // Step2: call function CddStp88XX_CntFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(data.ucData0, 0, == ); // Step1: do some ini data.ucData0 = 0; ulCmd = 0xFF; // Step2: call function CddStp88XX_CntFct0(ulCmd, ucIx, &data); // Step3: call check AL_UNITTEST_CHECK(data.ucData0, 0, == ); } extern tActCtrl CddStp88XX_aStpCtrlOld[CFA_CNT_STP_88XX]; extern void CddStp88XX_Ctrl(uint8 ucIx); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_Ctrl(void) { // Step1: do some ini uint8 ucIx = 0; CddStp88XX_aBits[ucIx].Bit.biWaitErrInh = 1; // Step2: call function CddStp88XX_Ctrl(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBits[ucIx].Bit.biTransitionErrDone, 0, == ); // Step1: do some ini CddStp88XX_aBits[ucIx].Bit.biWaitErrInh = 0; CddStp88XX_aStpCtrlOld[ucIx].Bit.ErrInh = 1; CddStp88XX_aStpCtrl[ucIx].Bit.ErrInh = 0; CddStp88XX_aBitsMod[ucIx].Bit.biRefWaitExit = 1u; // Step2: call function CddStp88XX_Ctrl(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBits[ucIx].Bit.biWaitErrInh, 1, == ); // Step1: do some ini CddStp88XX_aBits[ucIx].Bit.biWaitErrInh = 1; CddStp88XX_aftWaitErrInh[ucIx] = CddStp_UnitTest__GptTickCount + 1; // timeout CddStp88XX_aftWaitErrInh[ucIx] // Step2: call function CddStp88XX_Ctrl(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBits[ucIx].Bit.biWaitErrInh, 1, == ); } extern void CddStp88XX_StpStateVoltNormSet(void); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_StpStateVoltNormSet() { // Step1: do some ini CddStp88XX_aStpState[0].Bit.VoltNorm = 0; // Step2: call function CddStp88XX_StpStateVoltNormSet(); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[0].Bit.VoltNorm, 1, == ); } extern void CddStp88XX_StpStateVoltNormClear(void); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_StpStateVoltNormClear() { // Step1: do some ini CddStp88XX_aStpState[0].Bit.VoltNorm = 1; // Step2: call function CddStp88XX_StpStateVoltNormClear(); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[0].Bit.VoltNorm, 0, == ); } extern void CddStp88XX_StpStateOvSet(void); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_StpStateOvSet() { // Step1: do some ini CddStp88XX_aStpState[0].Bit.VoltOver = 0; // Step2: call function CddStp88XX_StpStateOvSet(); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[0].Bit.VoltOver, 1, == ); } extern void CddStp88XX_StpStateOvClear(void); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_StpStateOvClear() { // Step1: do some ini CddStp88XX_aStpState[0].Bit.VoltOver = 1; // Step2: call function CddStp88XX_StpStateOvClear(); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[0].Bit.VoltOver, 0, == ); } extern void CddStp88XX_StpStateUvSSMSet(void); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_StpStateUvSSMSet() { // Step1: do some ini CddStp88XX_aStpState[0].Bit.VoltUSSM = 0; // Step2: call function CddStp88XX_StpStateUvSSMSet(); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[0].Bit.VoltUSSM, 1, == ); } extern void CddStp88XX_StpStateUvSSMClear(void); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_StpStateUvSSMClear() { // Step1: do some ini CddStp88XX_aStpState[0].Bit.VoltUSSM = 1; // Step2: call function CddStp88XX_StpStateUvSSMClear(); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[0].Bit.VoltUSSM, 0, == ); } extern uint8 CddStp88XX_GetCurrentIndex(const uint8 ucCurrent); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_GetCurrentIndex(void) { // Step1: do some ini uint8 ret; uint8 ucCurrent = 0; // Step2: call function ret = CddStp88XX_GetCurrentIndex(ucCurrent); // Step3: call check AL_UNITTEST_CHECK(ret, 15, == ); // Step1: do some ini ucCurrent = 255; // Step2: call function ret = CddStp88XX_GetCurrentIndex(ucCurrent); // Step3: call check AL_UNITTEST_CHECK(ret, 0, == ); // Step1: do some ini ucCurrent = 55; // Step2: call function ret = CddStp88XX_GetCurrentIndex(ucCurrent); // Step3: call check AL_UNITTEST_CHECK(ret, 7, == ); } extern void CddStp88XX_SetCurrent(uint8 ucIx); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_SetCurrent(void) { // Step1: do some ini uint8 ucIx = 0; CddStp88XX_aucCurAmpltRunTemp[ucIx][CddStp_eTempState_NormTemp] = 123; // Step2: call function CddStp88XX_SetCurrent(ucIx); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp88XX_aucCurAmpltRunTemp[ucIx][CddStp_eTempState_NormTemp], 15, == ); } extern void CddStp88XX_HandleStpOnTime(uint8 ucIx, boolean boStpOn); extern uint32 CddStp88XX_aulStpOnStart[]; extern uint32 CddStp88XX_aulStpOnTime[]; //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HandleStpOnTime(void) { // Step1: do some ini uint8 ucIx = 0; boolean boStpOn = FALSE; CddStp88XX_aBitsMod[ucIx].Bit.biStpOn = !boStpOn; IoHwAb_SystemTick_1Ms = 12345; CddStp88XX_aulStpOnStart[ucIx] = 0; CddStp88XX_aulStpOnTime[ucIx] = 0; // Step2: call function CddStp88XX_HandleStpOnTime(ucIx, boStpOn); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aulStpOnStart[ucIx], 0, == ); AL_UNITTEST_CHECK(CddStp88XX_aulStpOnTime[ucIx], 12345, == ); // Step1: do some ini boStpOn = TRUE; CddStp88XX_aBitsMod[ucIx].Bit.biStpOn = !boStpOn; IoHwAb_SystemTick_1Ms = 12345; CddStp88XX_aulStpOnStart[ucIx] = 0; CddStp88XX_aulStpOnTime[ucIx] = 0; // Step2: call function CddStp88XX_HandleStpOnTime(ucIx, boStpOn); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aulStpOnStart[ucIx], 12345, == ); AL_UNITTEST_CHECK(CddStp88XX_aulStpOnTime[ucIx], 0, == ); } extern uint32 CddStp88XX_GetStpOnTime(uint8 ucIx); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_GetStpOnTime(void) { // Step1: do some ini uint8 ucIx = 0; uint32 result = 0; CddStp88XX_aBitsMod[ucIx].Bit.biStpOn = 1u; IoHwAb_SystemTick_1Ms = 12345; CddStp88XX_aulStpOnStart[ucIx] = 20000; CddStp88XX_aulStpOnTime[ucIx] = 30000; // Step2: call function result = CddStp88XX_GetStpOnTime(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aulStpOnStart[ucIx], 12345, == ); AL_UNITTEST_CHECK(CddStp88XX_aulStpOnTime[ucIx], 0, == ); AL_UNITTEST_CHECK(result, 22345, == ); } extern void IoHwAb_User_GetDio_ERRN_LWR(boolean* pResult); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_IoHwAb_User_GetDio_ERRN_LWR(void) { // Step1: do some ini uint8 ucIx = 0; boolean boResult = TRUE; Gpt_ChannelType Channel = 1; // Step2: call function IoHwAb_User_GetDio_ERRN_LWR(&boResult); Gpt_EnableNotification(Channel); Gpt_DisableNotification(Channel); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); } extern void CddStp88XX_GetAhlPosDevHistCnts(uint8 ucIx, uint16* punAhlPosDevHistCnts); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_GetAhlPosDevHistCnts(void) { // Step1: do some ini uint8 ucIx = 0; uint16 unAhlPosDevHistCnts = 5; // Step2: call function CddStp88XX_GetAhlPosDevHistCnts(ucIx, &unAhlPosDevHistCnts); // Step3: call check AL_UNITTEST_CHECK(unAhlPosDevHistCnts, 5, == ); } extern void CddStp88XX_StartWait88XXVoltage(uint8 ucIx); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_StartWait88XXVoltage(void) { // Step1: do some ini uint8 ucIx = 0; CddStp88XX_aBitsMod[ucIx].Bit.biOldStateNotInit = 1u; CddStp88XX_aBitsMod[ucIx].Bit.biWaitVoltage = 0u; // Step2: call function CddStp88XX_StartWait88XXVoltage(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biWaitVoltage, 1, == ); } extern void CddStp88XX_StartWaitVoltage(uint8 ucIx); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_StartWaitVoltage(void) { // Step1: do some ini uint8 ucIx = 0; CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltOver; CddStp88XX_aBitsMod[ucIx].Bit.biWaitVoltage = 0u; // Step2: call function CddStp88XX_StartWaitVoltage(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biWaitVoltage, 1, == ); } extern void CddStp88XX_HandleWaitVoltage(uint8 ucIx); extern tFTimer CddStp88XX_aftWaitVoltage[]; //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HandleWaitVoltage(void) { // Step1: do some ini uint8 ucIx = 0; CddStp88XX_aBitsMod[ucIx].Bit.biWaitVoltage = 1u; CddStp_UnitTest__GptTickCount = 1234; CddStp88XX_aftWaitVoltage[ucIx] = CddStp_UnitTest__GptTickCount - 1; // Step2: call function CddStp88XX_HandleWaitVoltage(ucIx); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biWaitVoltage, 0, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biWaitVoltage = 0u; CddStp_UnitTest__GptTickCount = 1234; CddStp88XX_aftWaitVoltage[ucIx] = CddStp_UnitTest__GptTickCount - 1; // Step2: call function CddStp88XX_HandleWaitVoltage(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biWaitVoltage, 0, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biWaitVoltage = 1u; CddStp_UnitTest__GptTickCount = 1234; CddStp88XX_aftWaitVoltage[ucIx] = CddStp_UnitTest__GptTickCount + 1; // Step2: call function CddStp88XX_HandleWaitVoltage(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biWaitVoltage, 1, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biWaitVoltage = 0u; CddStp_UnitTest__GptTickCount = 1234; CddStp88XX_aftWaitVoltage[ucIx] = CddStp_UnitTest__GptTickCount + 1; // Step2: call function CddStp88XX_HandleWaitVoltage(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biWaitVoltage, 0, == ); } extern boolean CddStp88XX_HandleWaitStabilize(uint8 ucIx); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HandleWaitStabilize(void) { // Step1: do some ini uint8 ucIx = 0; boolean boResult = FALSE; CddStp88XX_aBitsMod[ucIx].Bit.biWaitStabilize = 1u; CddStp_UnitTest__GptTickCount = 1234; CddStp88XX_aftWaitVoltage[ucIx] = CddStp_UnitTest__GptTickCount - 1; // Step2: call function boResult = CddStp88XX_HandleWaitStabilize(ucIx); // Step3: call check AL_UNITTEST_CHECK(boResult, 0, == ); AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biWaitStabilize, 0, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biWaitStabilize = 0u; CddStp_UnitTest__GptTickCount = 1234; CddStp88XX_aftWaitVoltage[ucIx] = CddStp_UnitTest__GptTickCount - 1; // Step2: call function boResult = CddStp88XX_HandleWaitStabilize(ucIx); // Step3: call check AL_UNITTEST_CHECK(boResult, 0, == ); AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biWaitStabilize, 0, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biWaitStabilize = 1u; CddStp_UnitTest__GptTickCount = 1234; CddStp88XX_aftWaitVoltage[ucIx] = CddStp_UnitTest__GptTickCount + 1; // Step2: call function boResult = CddStp88XX_HandleWaitStabilize(ucIx); // Step3: call check AL_UNITTEST_CHECK(boResult, 0, == ); AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biWaitStabilize, 0, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biWaitStabilize = 0u; CddStp_UnitTest__GptTickCount = 1234; CddStp88XX_aftWaitVoltage[ucIx] = CddStp_UnitTest__GptTickCount + 1; // Step2: call function boResult = CddStp88XX_HandleWaitStabilize(ucIx); // Step3: call check AL_UNITTEST_CHECK(boResult, 0, == ); AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biWaitStabilize, 0, == ); } extern void CddStp88XX_ReadDRV88XXTestRegAll(uint8 ucIx); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_ReadDRV88XXTestRegAll(void) { // Step1: do some ini uint8 ucIx = 0; CddStp88XX_aBits[ucIx].Bit.biGetRegAll = 1u; // Step2: call function CddStp88XX_ReadDRV88XXTestRegAll(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBits[ucIx].Bit.biGetRegAll, 1, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_DemReportErrorStatus(void) { // Step1: do some ini uint8 ucIx = 0; tCddStp88XXDemErrorType DemErrorType = CddStp88XX_eDemEType_OL; Dem_EventStatusType EventStatus = (Dem_EventStatusType)DEM_EVENT_STATUS_FAILED; CddStp_tCodingAreaLwr.Modus.biTestKeinFehlereintrag = 0u; CddStp_UnitTest__EventStatus = DEM_EVENT_STATUS_UNITTEST_DEFAULT; // Step2: call function CddStp88XX_DemReportErrorStatus(ucIx, DemErrorType, EventStatus); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp_UnitTest__EventStatus, DEM_EVENT_STATUS_FAILED, == ); // Step1: do some ini DemErrorType = CddStp88XX_eDemEType_Driver; EventStatus = DEM_EVENT_STATUS_FAILED; // Step2: call function CddStp88XX_DemReportErrorStatus(ucIx, DemErrorType, EventStatus); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp_UnitTest__EventStatus, DEM_EVENT_STATUS_FAILED, == ); // Step1: do some ini DemErrorType = CddStp88XX_eDemEType_Driver; EventStatus = DEM_EVENT_STATUS_PASSED; // Step2: call function CddStp88XX_DemReportErrorStatus(ucIx, DemErrorType, EventStatus); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp_UnitTest__EventStatus, DEM_EVENT_STATUS_PASSED, == ); // Step1: do some ini DemErrorType = CddStp88XX_eDemEType_TempSD; CddStp_UnitTest__EventStatus = DEM_EVENT_STATUS_UNITTEST_DEFAULT; // Step2: call function CddStp88XX_DemReportErrorStatus(ucIx, DemErrorType, EventStatus); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp_UnitTest__EventStatus, DEM_EVENT_STATUS_PASSED, == ); // Step1: do some ini DemErrorType = CddStp88XX_eDemEType_RefUVolt; CddStp_UnitTest__EventStatus = DEM_EVENT_STATUS_UNITTEST_DEFAULT; // Step2: call function CddStp88XX_DemReportErrorStatus(ucIx, DemErrorType, EventStatus); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp_UnitTest__EventStatus, DEM_EVENT_STATUS_PASSED, == ); // Step1: do some ini DemErrorType = CddStp88XX_eDemEType_MoveUVolt; CddStp_UnitTest__EventStatus = DEM_EVENT_STATUS_UNITTEST_DEFAULT; // Step2: call function CddStp88XX_DemReportErrorStatus(ucIx, DemErrorType, EventStatus); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp_UnitTest__EventStatus, DEM_EVENT_STATUS_PASSED, == ); // Step1: do some ini DemErrorType = 0xFF; CddStp_UnitTest__EventStatus = DEM_EVENT_STATUS_UNITTEST_DEFAULT; // Step2: call function CddStp88XX_DemReportErrorStatus(ucIx, DemErrorType, EventStatus); // Step3: call check AL_UNITTEST_CHECK(CddStp_UnitTest__EventStatus, DEM_EVENT_STATUS_UNITTEST_DEFAULT, == ); } extern void CddStp88XX_CalcCorrQuota(uint8 ucIx); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_CalcCorrQuota(void) { // Step1: do some ini uint8 ucIx = 0; // Step2: call function CddStp88XX_CalcCorrQuota(ucIx); // Step3: call check AL_UNITTEST_CHECK(ucIx, 0, == ); // Step4: Clean up CleanUp(); } extern void CddStp88XX_HandleResetErrVolt(uint8 ucIx, boolean boClearSRegsScOl); extern uint8 CddStp88XX_aucErrVoltHiLimitSCCnt[]; extern uint16 CddStp88XX_HalStp_unErrVoltLwr; //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HandleResetErrVolt(void) { // Step1: do some ini uint8 ucIx = 0; boolean boClearSRegsScOl = TRUE; CddStp_tCodingAreaSys.STP_SPANNUNG_LO1 = 96; CddStp_tCodingAreaSys.STP_SPANNUNG_HI1 = 187; // [0.1 V] // CddStp_UnitTest__u32Voltage_mV = (Cod_StpSpannungHi1() * 100u) - 1u; CDDSTP_ApplCodData_Sys.Stp_Voltage_Low1 = CddStp_tCodingAreaSys.STP_SPANNUNG_LO1; CDDSTP_ApplCodData_Sys.Stp_Voltage_High1 = CddStp_tCodingAreaSys.STP_SPANNUNG_HI1; CddStp88XX_HalStp_unErrVoltLwr = (CddStp_tCodingAreaSys.STP_SPANNUNG_HI1 * 100u) + 1u; CddStp_UnitTest__u32Voltage_mV = (CddStp_tCodingAreaSys.STP_SPANNUNG_HI1 * 100u) - 1u; CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[ucIx].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].Bit.u1UVLO = 1u; CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].Bit.u1OCP = 1u; CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].Bit.u1OL = 1u; CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[ucIx].Bit.u1OTW = 1u; CddStp88XX_aucErrVoltHiLimitSCCnt[ucIx] = 0u; // Step2: call function CddStp88XX_HandleResetErrVolt(ucIx, boClearSRegsScOl); // Step3: call check AL_UNITTEST_CHECK(CddStp8899_aSRegFault[ucIx].Bit.u1OL, 0, == ); // Step1: do some ini boClearSRegsScOl = FALSE; CddStp_tCodingAreaSys.STP_SPANNUNG_LO1 = 96; CddStp_tCodingAreaSys.STP_SPANNUNG_HI1 = 187; // [0.1 V] CDDSTP_ApplCodData_Sys.Stp_Voltage_Low1 = CddStp_tCodingAreaSys.STP_SPANNUNG_LO1; CDDSTP_ApplCodData_Sys.Stp_Voltage_High1 = CddStp_tCodingAreaSys.STP_SPANNUNG_HI1; CddStp88XX_HalStp_unErrVoltLwr = (CddStp_tCodingAreaSys.STP_SPANNUNG_LO1 * 100u) - 1u; CddStp_UnitTest__u32Voltage_mV = (CddStp_tCodingAreaSys.STP_SPANNUNG_LO1 * 100u) + 1u; CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[ucIx].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].Bit.u1UVLO = 1u; CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].Bit.u1OCP = 1u; CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].Bit.u1OL = 1u; CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[ucIx].Bit.u1OTW = 1u; CddStp88XX_aucErrVoltHiLimitSCCnt[ucIx] = 0u; // Step2: call function CddStp88XX_HandleResetErrVolt(ucIx, boClearSRegsScOl); // Step3: call check AL_UNITTEST_CHECK(CddStp8899_aSRegFault[ucIx].Bit.u1OL, 1, == ); // Step4: Clean up CleanUp(); } extern void CddStp88XX_HandleStepLoss(uint8 ucIx); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HandleStepLoss(void) { // Step1: do some ini uint8 ucIx = 0; CddStp_tCodingAreaLwr.Modus.biVorwarnNeuref = TRUE; CddStp88XX_aStpCtrl[ucIx].Bit.ErrInh = 1u; CddStp88XX_aBits[ucIx].Bit.biWaitErrInh = 1u; CddStp88XX_aStpState[ucIx].Bit.StepLoss = 0u; // Step2: call function CddStp88XX_HandleStepLoss(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.StepLoss, 0, == ); // Step1: do some ini CddStp_tCodingAreaLwr.Modus.biVorwarnNeuref = FALSE; CddStp88XX_aStpCtrl[ucIx].Bit.ErrInh = 1u; CddStp88XX_aBits[ucIx].Bit.biWaitErrInh = 0u; CddStp88XX_aStpState[ucIx].Bit.StepLoss = 0u; // Step2: call function CddStp88XX_HandleStepLoss(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.StepLoss, 0, == ); // Step1: do some ini CddStp_tCodingAreaLwr.Modus.biVorwarnNeuref = FALSE; CddStp88XX_aStpCtrl[ucIx].Bit.ErrInh = 0u; CddStp88XX_aBits[ucIx].Bit.biWaitErrInh = 0u; CddStp88XX_aStpState[ucIx].Bit.StepLoss = 0u; // Step2: call function CddStp88XX_HandleStepLoss(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.StepLoss, 1u, == ); } extern boolean CddStp88XX_HandleStepHanging(uint8 ucIx, boolean boRef); extern uint8 CddStp88XX_aucActPosMemCnt[]; extern sint32 CddStp88XX_alActPosMem[]; //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HandleStepHanging(void) { // Step1: do some ini uint8 ucIx = 0; boolean boRef = TRUE; boolean boResult = TRUE; const uint8 CDDSTP88XX_ACTPOSMEMCNT_MAX = (30u); CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltNormal; CddStp88XX_aucActPosMemCnt[ucIx] = CDDSTP88XX_ACTPOSMEMCNT_MAX; // Step2: call function boResult = CddStp88XX_HandleStepHanging(ucIx, boRef); // Step3: call check AL_UNITTEST_CHECK(boResult, 0, == ); // Step1: do some ini boRef = TRUE; CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltNormal; CddStp88XX_aucActPosMemCnt[ucIx] = CDDSTP88XX_ACTPOSMEMCNT_MAX + 1; CddStpDyn_UnitTest___tCodingAreaLwr_Modus_eSchrittMod = NvmPara_eSchrittMod2; // = 0, // 1/2 step (half step) CddStp_tCodingAreaLwr.Modus.eSchrittMod = CddStpDyn_UnitTest___tCodingAreaLwr_Modus_eSchrittMod; // = 0, // 1/2 step (half step) // Step2: call function boResult = CddStp88XX_HandleStepHanging(ucIx, boRef); // Step3: call check AL_UNITTEST_CHECK(boResult, 1u, == ); // Step1: do some ini boRef = TRUE; CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltNormal; CddStp88XX_aucActPosMemCnt[ucIx] = CDDSTP88XX_ACTPOSMEMCNT_MAX + 1; CddStpDyn_UnitTest___tCodingAreaLwr_Modus_eSchrittMod = NvmPara_eSchrittMod8; // = 2, // 1/8 step (micro step) CddStp_tCodingAreaLwr.Modus.eSchrittMod = CddStpDyn_UnitTest___tCodingAreaLwr_Modus_eSchrittMod; // = 2, // 1/8 step (micro step) // Step2: call function boResult = CddStp88XX_HandleStepHanging(ucIx, boRef); // Step3: call check AL_UNITTEST_CHECK(boResult, 1u, == ); // Step1: do some ini boRef = TRUE; CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltNormal; CddStp88XX_aucActPosMemCnt[ucIx] = CDDSTP88XX_ACTPOSMEMCNT_MAX + 1; CddStp88XX_alActPosMem[ucIx]++; // Step2: call function boResult = CddStp88XX_HandleStepHanging(ucIx, boRef); // Step3: call check AL_UNITTEST_CHECK(boResult, 0, == ); } // only AHL-Stepper extern void CddStp88XX_HandleWrongRef1Motion(uint8 ucIx); // only AHL-Stepper #ifndef UNIT_TEST // NOT Unit-Tests = 'regular' // only AHL-Stepper extern const tCddStp88XX_Attr CddStp88XX_aAttr[]; // only AHL-Stepper #else // Unit-Tests! // only AHL-Stepper extern tCddStp88XX_Attr CddStp88XX_aAttr[]; // only AHL-Stepper #endif // UNIT_TEST // only AHL-Stepper extern tPsensInf CddStp88XX_aPsensInf[]; // only AHL-Stepper extern uint8 CddStp88XX_ucAhlErrPsensCnt; // only AHL-Stepper extern sint32 CddStp88XX_alDeviation[]; // only AHL-Stepper void Mt_CddStp88XX_HandleWrongRef1Motion(void) // only AHL-Stepper { // only AHL-Stepper // Step1: do some ini // only AHL-Stepper uint8 ucIx = 0; // only AHL-Stepper // only AHL-Stepper // Step2: call function // only AHL-Stepper CddStp88XX_HandleWrongRef1Motion(ucIx); // only AHL-Stepper // only AHL-Stepper // Step3: call check // only AHL-Stepper // nothing to check // only AHL-Stepper // only AHL-Stepper // no AHL: // Step1: do some ini // only AHL-Stepper // no AHL: CddStp88XX_aAttr[ucIx].biUsePsens = 1u; // only AHL-Stepper // no AHL: CddStp88XX_ucAhlErrPsensCnt = 1u; // only AHL-Stepper // no AHL: CddStp88XX_aStpState[ucIx].Bit.IsInside = 0; // only AHL-Stepper // no AHL: CddStp88XX_aPsensInf[ucIx].Bit.biIsPositive = 1u; // only AHL-Stepper // no AHL: CddStp88XX_anRef1Pos[ucIx] = 0; // only AHL-Stepper // no AHL: CddStp88XX_alDeviation[ucIx] = 1; // only AHL-Stepper // no AHL: // only AHL-Stepper // no AHL: // Step2: call function // only AHL-Stepper // no AHL: CddStp88XX_HandleWrongRef1Motion(ucIx); // only AHL-Stepper // no AHL: // only AHL-Stepper // no AHL: // Step3: call check // only AHL-Stepper // no AHL: AL_UNITTEST_CHECK(CddStp88XX_alDeviation[ucIx], 0, == ); // only AHL-Stepper // no AHL: // only AHL-Stepper // no AHL: // Step1: do some ini // only AHL-Stepper // no AHL: CddStp88XX_ucAhlErrPsensCnt = 1u; // only AHL-Stepper // no AHL: CddStp88XX_aStpState[ucIx].Bit.IsInside = 0; // only AHL-Stepper // no AHL: CddStp88XX_aPsensInf[ucIx].Bit.biIsPositive = 0u; // only AHL-Stepper // no AHL: CddStp88XX_anRef1Pos[ucIx] = 0; // only AHL-Stepper // no AHL: CddStp88XX_alDeviation[ucIx] = 1; // only AHL-Stepper // no AHL: // only AHL-Stepper // no AHL: // Step2: call function // only AHL-Stepper // no AHL: CddStp88XX_HandleWrongRef1Motion(ucIx); // only AHL-Stepper // no AHL: // only AHL-Stepper // no AHL: // Step3: call check // only AHL-Stepper // no AHL: AL_UNITTEST_CHECK(CddStp88XX_alDeviation[ucIx], 0, == ); // only AHL-Stepper // no AHL: // only AHL-Stepper // no AHL: // Step4: Clean up // only AHL-Stepper // no AHL: CddStp88XX_aAttr[ucIx].biUsePsens = 0u; // only AHL-Stepper } extern void CddStp88XX_ConvertTemp2Mode(uint8 ucIx); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_ConvertTemp2Mode() { // Step1: do some ini uint8 ucIx = 0; CddStp88XX_aeTemp[ucIx] = CddStp_eTempState_LowTemp; CddStp_ActAll.sLwrActual.sStatusError.eTempMode = 0; // Step2: call function CddStp88XX_ConvertTemp2Mode(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.eTempMode, LOW_TEMP, == ); // Step1: do some ini CddStp88XX_aeTemp[ucIx] = CddStp_eTempState_HighTemp; CddStp_ActAll.sLwrActual.sStatusError.eTempMode = 0; // Step2: call function CddStp88XX_ConvertTemp2Mode(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.eTempMode, HIGH_TEMP, == ); // Step1: do some ini CddStp88XX_aeTemp[ucIx] = CddStp_eTempState_NormTemp; CddStp_ActAll.sLwrActual.sStatusError.eTempMode = 0; // Step2: call function CddStp88XX_ConvertTemp2Mode(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.eTempMode, NORMAL_TEMP, == ); } extern void CddStp88XX_ConvertState2Progress(uint8 ucIx); extern boolean CddStp88XX_boMovesDown; //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_ConvertState2Progress() { //Step 1) Set pre - conditions //Step 2) Assign all input values to the corresponding input variables identified in the FUT uint8 ucIx = 0; static struct { tStateCddStp88XX eNewState; tieStepperProgress ucLWRState; } asTestCaseData[] = { { CddStp88XX_eStateInit, STP_PROGRESS_NO_ACTION }, { CddStp88XX_eStateOff, STP_PROGRESS_NO_ACTION }, { CddStp88XX_eStateStby, STP_PROGRESS_NO_ACTION }, { CddStp88XX_eStateIdle, STP_PROGRESS_WAITING }, { CddStp88XX_eStateMove, STP_PROGRESS_MOVING_DOWN }, // check again because this is also the init value { CddStp88XX_eStateRef1, STP_PROGRESS_MOVING_DOWN }, // no change in this state { CddStp88XX_eStateRef2, STP_PROGRESS_MOVING_DOWN }, { CddStp88XX_eStateRefWait, STP_PROGRESS_MOVING_DOWN }, { CddStp88XX_eStateTestStep, STP_PROGRESS_MOVING_DOWN }, { CddStp88XX_eStateErr, STP_PROGRESS_ERROR }, { 99, STP_PROGRESS_INIT } }; CddStp88XX_boMovesDown = TRUE; for (uint32 ul = 0; ul < _countof(asTestCaseData); ul++) { CddStp88XX_aeState[ucIx] = asTestCaseData[ul].eNewState; //Step 3) Call the FUT CddStp88XX_ConvertState2Progress(ucIx); //Step 4) Check that the value of the output variables set/changed by the FUT matchs the corresponding expected output value AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.eStpProgress, asTestCaseData[ul].ucLWRState, == ); } // Step1: do some ini CddStp88XX_boMovesDown = FALSE; CddStp88XX_aeState[ucIx] = CddStp88XX_eStateMove; //Step 2) Call the FUT CddStp88XX_ConvertState2Progress(ucIx); //Step 3) Check that the value of the output variables set/changed by the FUT matchs the corresponding expected output value AL_UNITTEST_CHECK(CddStp_ActAll.sLwrActual.sStatusError.eStpProgress, STP_PROGRESS_MOVING_UP, == ); } extern void CddStp88XX_StateMachine(uint8 ucIx, const tCommandCddStp88XX eCmd); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_StateMachine() { CddStp_UnitTest_Printf("\n"); // nice formatting if 'CDDSTP_UNIT_TEST_DEBUGGING' is set // Step1: do some ini uint8 ucIx = 0; CddStp88XX_aeState[ucIx] = CddStp88XX_eStateIdle; // will be 'eStateBegin' const tCommandCddStp88XX eCmd = CddStp88XX_eCmdInit; CddStp88XX_aeState[ucIx] = CddStp88XX_eMaxStates; // 'boPowerOn'=TRUE // Step2: call function CddStp88XX_StateMachine(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aeState[ucIx], CddStp88XX_eStateInit, == ); // Step1: do some ini CddStp88XX_aeState[ucIx] = CddStp88XX_eStateRef1; // Step2: call function CddStp88XX_StateMachine(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aeState[ucIx], 5, == ); CddStp_UnitTest_Printf(" ... "); // shift the following 'passed' a little bit right } extern uint32 CddStp88XX_TransFct_Init(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp88XX_TransFct_InitOff(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp88XX_TransFct_Off(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp88XX_TransFct_StbyIdle(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp88XX_TransFct_IdleStby(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp88XX_TransFct_MoveIdle(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp88XX_TransFct_MoveOff(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp88XX_TransFct_IdleMove(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp88XX_TransFct_RefOff(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp88XX_TransFct_Ref1(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp88XX_TransFct_RefWait(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp88XX_TransFct_RefWaitIdle(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp88XX_TransFct_Ref1Ref2(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp88XX_TransFct_Ref1RefWait(uint8 ucIx, const tCommandCddStp88XX eCmd); // * Sref reference run uses Psens * extern uint32 CddStp88XX_TransFct_Ref2RefWait(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp88XX_TransFct_TestStep(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp88XX_TransFct_TestStepIdle(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp88XX_TransFct_Err(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp88XX_TransFct_Err_Sub(uint8 ucIx, const tCommandCddStp88XX eCmd, boolean boLessThanErrVoltHiLimit); extern uint32 CddStp88XX_TransFct_OffStby(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp88XX_TransFct_OffIdle(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp88XX_TransFct_ErrClr(uint8 ucIx, const tCommandCddStp88XX eCmd); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_Init(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; CddStp88XX_aStpCtrl[ucIx].Bit.On = 0u; // Step2: call function ulResult = CddStp88XX_TransFct_Init(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini CddStp88XX_aStpCtrl[ucIx].Bit.On = 1u; // Step2: call function ulResult = CddStp88XX_TransFct_Init(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_InitOff(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; CddStp_tCodingAreaLwr.Modus.biEnable = TRUE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = TRUE; // Step2: call function ulResult = CddStp88XX_TransFct_InitOff(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini ucIx = 1; // Step2: call function ulResult = CddStp88XX_TransFct_InitOff(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // jk // jk // jk // Step1: do some ini // jk ucIx = 0xFF; // jk // jk // Step2: call function // jk ulResult = CddStp88XX_TransFct_InitOff(ucIx, eCmd); // jk // jk // Step3: call check // jk AL_UNITTEST_CHECK(ulResult, TRUE, == ); } extern uint8 CddStp88XX_HalStp_ucOLCntLwr; extern uint8 CddStp88XX_HalStp_ucSCCntLwr; //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_Off(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; CddStp_tCodingAreaLwr.Modus.biEnable = TRUE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = TRUE; // Step2: call function ulResult = CddStp88XX_TransFct_Off(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini // CddStp8899_aSRegDiag2[ucIx].Bit.u1OTS) != 0u) CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[0].Bit.u1OTS = 1; CddStp88XX_ucStateVolt = 1; // StateVoltOff=0, StateVoltUnder=1, StateVoltNormal=2, StateVoltOver=3, StateVoltStartValue=0xFF // Step2: call function ulResult = CddStp88XX_TransFct_Off(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[0].Bit.u1OTS = 0; CddStp88XX_HalStp_ucSCCntLwr = 0; CddStp88XX_HalStp_ucOLCntLwr = CddStp88XX_aucOLCntMax[0]; // Step2: call function ulResult = CddStp88XX_TransFct_Off(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini ucIx = 1; // Step2: call function ulResult = CddStp88XX_TransFct_Off(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini ucIx = 2; // Step2: call function ulResult = CddStp88XX_TransFct_Off(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini ucIx = 0; CddStp_boDioErrLwr = TRUE; // Step2: call function ulResult = CddStp88XX_TransFct_Off(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step4: Clean up CleanUp(); } #define CDDSTP88XX_ErrVoltHiLimitSCCntMax (3u) //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_RefOff(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; CddStp_tCodingAreaLwr.Modus.biEnable = TRUE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = TRUE; CddStp88XX_aBitsMod[ucIx].Bit.biTransOff = 1u; // Step2: call function ulResult = CddStp88XX_TransFct_RefOff(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biTransOff = 0u; CDDSTP_ApplCodData_Sys.Stp_Voltage_High1 = CddStp_tCodingAreaSys.STP_SPANNUNG_HI1; CddStp88XX_HalStp_unErrVoltLwr = (CddStp_tCodingAreaSys.STP_SPANNUNG_HI1 * 100u) + 1u; CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].Bit.u1OL = 1u; CddStp88XX_aucErrVoltHiLimitSCCnt[ucIx] = CDDSTP88XX_ErrVoltHiLimitSCCntMax; // Step2: call function ulResult = CddStp88XX_TransFct_RefOff(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].Bit.u1OL = 0u; CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].Bit.u1OCP = 1u; CddStp88XX_aucErrVoltHiLimitSCCnt[ucIx] = 0; // Step2: call function ulResult = CddStp88XX_TransFct_RefOff(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini CDDSTP_ApplCodData_Sys.Stp_Voltage_High1 = CddStp_tCodingAreaSys.STP_SPANNUNG_HI1; CddStp88XX_HalStp_unErrVoltLwr = (CddStp_tCodingAreaSys.STP_SPANNUNG_HI1 * 100u) - 1u; // Step2: call function ulResult = CddStp88XX_TransFct_RefOff(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_Ref1(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; CddStp88XX_aStpCtrl[ucIx].Bit.Ref = 1u; CddStp88XX_aStpCtrlOld[ucIx].Bit.Ref = 0u; // Step2: call function ulResult = CddStp88XX_TransFct_Ref1(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini CddStp88XX_aStpCtrl[ucIx].Bit.Ref = 0u; CddStp88XX_aStpCtrlOld[ucIx].Bit.Ref = 0u; // Step2: call function ulResult = CddStp88XX_TransFct_Ref1(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini CddStp88XX_aStpCtrl[ucIx].Bit.Ref = 1u; CddStp88XX_aStpCtrlOld[ucIx].Bit.Ref = 1u; // Step2: call function ulResult = CddStp88XX_TransFct_Ref1(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini CddStp88XX_aStpCtrl[ucIx].Bit.Ref = 0u; CddStp88XX_aStpCtrlOld[ucIx].Bit.Ref = 1u; // Step2: call function ulResult = CddStp88XX_TransFct_Ref1(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_RefWait(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; CddStp_tCodingAreaLwr.Modus.biEnable = TRUE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = TRUE; // Step2: call function ulResult = CddStp88XX_TransFct_RefWait(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_RefWaitIdle(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; CddStp88XX_aStpCtrl[ucIx].Bit.Ref = 1u; // Step2: call function ulResult = CddStp88XX_TransFct_RefWaitIdle(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini CddStp88XX_aStpCtrl[ucIx].Bit.Ref = 0u; // Step2: call function ulResult = CddStp88XX_TransFct_RefWaitIdle(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); } extern tStateHalStp CddStp88XX_HalStp_eStateLwr; //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_Ref1Ref2(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; CddStp_tCodingAreaLwr.Modus.biEnable = TRUE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = TRUE; //CddStp88XX_anRef1Pos[ucIx] = 1234; CddStp88XX_HalStp_StpInfoLwr.lActPos = CddStp88XX_anRef1Pos[ucIx]; CddStp88XX_HalStp_eStateLwr = CddStp88XX_HalStp_eStateHoldCont; // Step2: call function ulResult = CddStp88XX_TransFct_Ref1Ref2(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini CddStp88XX_HalStp_StpInfoLwr.lActPos = CddStp88XX_anRef1Pos[ucIx] - 1; // Step2: call function ulResult = CddStp88XX_TransFct_Ref1Ref2(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini CddStp88XX_aStpCtrl[ucIx].Bit.Ref = 1u; CddStp88XX_HalStp_StpInfoLwr.lActPos = CddStp88XX_anRef1Pos[ucIx]; // Step2: call function ulResult = CddStp88XX_TransFct_Ref1Ref2(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_Ref1RefWait(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; CddStp_tCodingAreaLwr.Modus.biEnable = TRUE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = TRUE; CddStp88XX_aStpCtrl[ucIx].Bit.Stop = 1u; CddStp88XX_aStpCtrl[ucIx].Bit.Ref = 0u; CddStp88XX_HalStp_eStateLwr = CddStp88XX_HalStp_eStateHoldCont; // Step2: call function ulResult = CddStp88XX_TransFct_Ref1RefWait(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini CddStp88XX_aStpCtrl[ucIx].Bit.Stop = 0u; CddStp88XX_aStpCtrl[ucIx].Bit.Ref = 1u; // Step2: call function ulResult = CddStp88XX_TransFct_Ref1RefWait(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini CddStp88XX_aStpCtrl[ucIx].Bit.Stop = 0u; CddStp88XX_aStpCtrl[ucIx].Bit.Ref = 0u; // Step2: call function ulResult = CddStp88XX_TransFct_Ref1RefWait(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_Ref2RefWait(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; CddStp_tCodingAreaLwr.Modus.biEnable = TRUE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = TRUE; // Step2: call function ulResult = CddStp88XX_TransFct_Ref2RefWait(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_MoveIdle(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; CddStp_tCodingAreaLwr.Modus.biEnable = TRUE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = TRUE; // Step2: call function ulResult = CddStp88XX_TransFct_MoveIdle(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_MoveOff(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; CddStp_tCodingAreaLwr.Modus.biEnable = TRUE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = TRUE; CddStp88XX_aBitsMod[ucIx].Bit.biTransOff = 0; CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltOver; // Step2: call function ulResult = CddStp88XX_TransFct_MoveOff(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini // boolean boLessThanErrVoltHiLimit = (CddStp88XX_HalStpFct[ucIx].pGetErrVolt() < ((uint32)Cod_StpSpannungHi1() * 100u)) ? TRUE : FALSE; // error voltage in specified range in case of ErrElecSC or ErrElecOL? CddStp_tCodingAreaSys.STP_SPANNUNG_HI1 = 173; CDDSTP_ApplCodData_Sys.Stp_Voltage_High1 = CddStp_tCodingAreaSys.STP_SPANNUNG_HI1; CddStp88XX_HalStp_unErrVoltLwr = (CddStp_tCodingAreaSys.STP_SPANNUNG_HI1 * 100u) + 1u; CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].Bit.u1OL = 1u; // Step2: call function ulResult = CddStp88XX_TransFct_MoveOff(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini CddStp88XX_aucErrVoltHiLimitSCCnt[ucIx] = CDDSTP88XX_ErrVoltHiLimitSCCntMax; // 0; // Step2: call function ulResult = CddStp88XX_TransFct_MoveOff(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biTransOff = 1u; CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltNormal; CddStp88XX_aucErrVoltHiLimitSCCnt[ucIx] = CDDSTP88XX_ErrVoltHiLimitSCCntMax; // = '3' but will be incremented to '4' // Step2: call function ulResult = CddStp88XX_TransFct_MoveOff(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].Bit.u1OL = 0u; CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].Bit.u1OCP = 1u; CddStp88XX_aucErrVoltHiLimitSCCnt[ucIx] = 0; // will be incremented to '1' // Step2: call function ulResult = CddStp88XX_TransFct_MoveOff(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biTransOff = 1u; // 'CddStp88XX_TransFct_Off' CddStp88XX_aStpState[ucIx].Bit.IsRef = 1u; CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltOff; // Step2: call function ulResult = CddStp88XX_TransFct_MoveOff(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini CddStp88XX_aStpState[ucIx].Bit.IsRef = 0u; // Step2: call function ulResult = CddStp88XX_TransFct_MoveOff(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step4: Clean up CleanUp(); } extern tPsensInf CddStp88XX_aPsensInf[]; // only AHL-Stepper //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_StbyIdle(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; // CddStp88XX_TransFct_TestStepIdle...: CddStp88XX_aPsensInf[ucIx].Bit.StateErrAll.StateErr.biState = 0u; // 0=LIT_SigWarn // Step2: call function ulResult = CddStp88XX_TransFct_StbyIdle(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_IdleStby(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltOver; // Step2: call function ulResult = CddStp88XX_TransFct_IdleStby(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltOff; // Step2: call function ulResult = CddStp88XX_TransFct_IdleStby(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltNormal; // Step2: call function ulResult = CddStp88XX_TransFct_IdleStby(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_IdleMove(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; CddStp88XX_aStpState[ucIx].Bit.IsRef = 1u; CddStp88XX_aStpCtrl[ucIx].Bit.Ref = 0u; CddStp88XX_aStpCtrl[ucIx].Bit.Stop = 0u; CddStp88XX_aStpCtrl[ucIx].Val.nPos = 1234; CddStp88XX_aBitsMod[ucIx].Bit.biWaitStabilize = 0u; // 'CddStp88XX_HalStpFct[ucIx].pIsFinishMove()': -> 'CddStp88XX_HalStpLwr_IsFinishMove' -> 'CddStp88XX_HalStpLwr_IsStateHoldCont_' -> '(CddStp88XX_HalStp_eStateLwr == CddStp88XX_HalStp_eStateHoldCont) ? TRUE : FALSE;' CddStp88XX_HalStp_eStateLwr = CddStp88XX_HalStp_eStateHoldCont; // Step2: call function ulResult = CddStp88XX_TransFct_IdleMove(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini CddStp88XX_aStpCtrl[ucIx].Bit.Stop = 1u; // Step2: call function ulResult = CddStp88XX_TransFct_IdleMove(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); } typedef struct { uint16 biInit : 1; uint16 biTestStep : 1; uint16 biTestStepDone : 1; uint16 biStopStpPZ : 1; uint16 biStopStp : 1; uint16 biHsMode : 1; uint16 biReserved : 2; uint16 biMotEn : 1; uint16 biDriverReset : 1; uint16 biTbdClrTiFaultBits : 1; uint16 biTbdEnOlDtctn : 1; uint16 biReserved4 : 4; } tHSBits; typedef union { tHSBits Bit; uint16 unRaw; } tHalStpBits; extern tHalStpBits CddStp88XX_HalStp_BitsLwr; //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_TestStep(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; //CddStp88XX_HalStp_BitsLwr.unRaw = 0; CddStp88XX_HalStp_BitsLwr.Bit.biDriverReset = 0; CddStp88XX_aBits[ucIx].Bit.biTestStepDone = 0; CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltNormal; CddStp88XX_aStpState[0].Bit.SpiValid = 1; // Step2: call function ulResult = CddStp88XX_TransFct_TestStep(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini CddStp88XX_aBits[ucIx].Bit.biTestStepDone = 1u; // Step2: call function ulResult = CddStp88XX_TransFct_TestStep(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_TestStepIdle(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; CddStp88XX_aPsensInf[ucIx].Bit.StateErrAll.StateErr.biState = 1u; // 1=LIT_SigOk // Step2: call function ulResult = CddStp88XX_TransFct_TestStepIdle(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_Err_Sub(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; boolean boLessThanErrVoltHiLimit = TRUE; CddStp88XX_HalStp_ucSCCntLwr = CddStp88XX_aucOLCntMax[0]; CddStp88XX_HalStp_ucOLCntLwr = CddStp88XX_aucOLCntMax[0]; CddStp_tCodingAreaLwr.Modus.biTestOlIgnor = 0u; // Step2: call function ulResult = CddStp88XX_TransFct_Err_Sub(ucIx, eCmd, boLessThanErrVoltHiLimit); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[0].Bit.u1OTS = 1u; CddStp88XX_aStpState[ucIx].Bit.ErrTherm = 1u; // Step2: call function ulResult = CddStp88XX_TransFct_Err_Sub(ucIx, eCmd, boLessThanErrVoltHiLimit); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini CddStp88XX_aStpState[ucIx].Bit.ErrTherm = 0; // Step2: call function ulResult = CddStp88XX_TransFct_Err_Sub(ucIx, eCmd, boLessThanErrVoltHiLimit); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[0].Bit.u1OTS = 0u; CddStp88XX_aBitsMod[ucIx].Bit.biDemErrSpiError = 0; // Step2: call function ulResult = CddStp88XX_TransFct_Err_Sub(ucIx, eCmd, boLessThanErrVoltHiLimit); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini CddStp88XX_aStpState[ucIx].Bit.ErrSpiError = 1u; CddStp88XX_aBitsMod[ucIx].Bit.biDemErrSpiError = 1u; // Step2: call function ulResult = CddStp88XX_TransFct_Err_Sub(ucIx, eCmd, boLessThanErrVoltHiLimit); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biDemErrSpiError = 0; // Step2: call function ulResult = CddStp88XX_TransFct_Err_Sub(ucIx, eCmd, boLessThanErrVoltHiLimit); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini CddStp88XX_aStpState[ucIx].Bit.ErrSpiError = 0; CddStp88XX_aStpState[ucIx].Bit.ErrElecOL = 1u; CddStp88XX_HalStp_ucSCCntLwr = 0; // Step2: call function ulResult = CddStp88XX_TransFct_Err_Sub(ucIx, eCmd, boLessThanErrVoltHiLimit); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini CddStp88XX_aStpState[ucIx].Bit.ErrElecOL = 0u; // Step2: call function ulResult = CddStp88XX_TransFct_Err_Sub(ucIx, eCmd, boLessThanErrVoltHiLimit); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini // boolean boHigherThanErrVoltLoLimit = (CddStp88XX_HalStpFct[ucIx].pGetErrVolt() > ((uint32)Cod_StpSpannungLo1() * 100u)) ? TRUE : FALSE; // error voltage in specified range in case of ErrElecSC or ErrElecOL? // boolean boHigherThanErrVoltHiLimitSCCntMax = (CddStp88XX_aucErrVoltHiLimitSCCnt[ucIx] >= CDDSTP88XX_ErrVoltHiLimitSCCntMax) ? TRUE : FALSE; // check to detect case of no pseudo SC error (ErrElecSC) CddStp_tCodingAreaSys.STP_SPANNUNG_LO1 = 96; CDDSTP_ApplCodData_Sys.Stp_Voltage_Low1 = CddStp_tCodingAreaSys.STP_SPANNUNG_LO1; CddStp88XX_HalStp_unErrVoltLwr = (Cod_StpSpannungLo1() * 100u) - 1u; CddStp88XX_aucErrVoltHiLimitSCCnt[ucIx] = CDDSTP88XX_ErrVoltHiLimitSCCntMax; boLessThanErrVoltHiLimit = TRUE; // Step2: call function ulResult = CddStp88XX_TransFct_Err_Sub(ucIx, eCmd, boLessThanErrVoltHiLimit); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_Err(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].Bit.u1OL = 0; CddStp88XX_aBitsMod[ucIx].Bit.biDisOLDetect = 0; CddStp88XX_aStpState[ucIx].Bit.ErrElecOL = 1u; CddStp88XX_HalStp_ucOLCntLwr = 0; // Step2: call function ulResult = CddStp88XX_TransFct_Err(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].Bit.u1OL = 1u; CddStp88XX_aStpState[ucIx].Bit.ErrElecOL = 0u; // Step2: call function ulResult = CddStp88XX_TransFct_Err(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].Bit.u1OL = 0u; CddStp88XX_aBitsMod[ucIx].Bit.biDisOLDetect = 1u; CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].Bit.u1OCP = 1u; CddStp88XX_aStpState[ucIx].Bit.ErrElecSC = 1u; // Step2: call function ulResult = CddStp88XX_TransFct_Err(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini CddStp88XX_aStpState[ucIx].Bit.ErrElecSC = 0; // Step2: call function ulResult = CddStp88XX_TransFct_Err(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini CddStp88XX_aStpCtrl[ucIx].Bit.ErrInh = 1; // Step2: call function ulResult = CddStp88XX_TransFct_Err(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini // boHigherThanErrVoltLoLimit = (CddStp88XX_HalStpFct[ucIx].pGetErrVolt() > ((uint32)Cod_StpSpannungLo1() * 100u)) ? TRUE : FALSE; // error voltage in specified range in case of ErrElecSC or ErrElecOL? // boLessThanErrVoltHiLimit = (CddStp88XX_HalStpFct[ucIx].pGetErrVolt() < ((uint32)Cod_StpSpannungHi1() * 100u)) ? TRUE : FALSE; // error voltage in specified range in case of ErrElecSC or ErrElecOL? // boHigherThanErrVoltHiLimitSCCntMax = (CddStp88XX_aucErrVoltHiLimitSCCnt[ucIx] >= CDDSTP88XX_ErrVoltHiLimitSCCntMax) ? TRUE : FALSE; // check to detect case of no pseudo SC error (ErrElecSC) // if (ucIx == 0u) // LWR stepper driver? ucIx = 1; CddStp_tCodingAreaSys.STP_SPANNUNG_LO1 = 96; CddStp_tCodingAreaSys.STP_SPANNUNG_HI1 = 86; CDDSTP_ApplCodData_Sys.Stp_Voltage_Low1 = CddStp_tCodingAreaSys.STP_SPANNUNG_LO1; CDDSTP_ApplCodData_Sys.Stp_Voltage_High1 = CddStp_tCodingAreaSys.STP_SPANNUNG_HI1; CddStp88XX_HalStp_unErrVoltLwr = (Cod_StpSpannungLo1() * 100u) - 1u; CddStp88XX_aucErrVoltHiLimitSCCnt[ucIx] = CDDSTP88XX_ErrVoltHiLimitSCCntMax; // Step2: call function ulResult = CddStp88XX_TransFct_Err(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini ucIx = 0; CddStp_boDioErrLwr = TRUE; // Step2: call function ulResult = CddStp88XX_TransFct_Err(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step1: do some ini CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].Bit.u1OL = 0; CddStp88XX_aBitsMod[ucIx].Bit.biDisOLDetect = 0; CddStp88XX_aStpState[ucIx].Bit.ErrElecOL = 1u; CddStp88XX_HalStp_ucOLCntLwr = 0; // Step2: call function ulResult = CddStp88XX_TransFct_Err(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step4: Clean up CddStp88XX_aStpCtrl[ucIx].Bit.ErrInh = 0; CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_OffStby(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; CddStp_tCodingAreaLwr.Modus.biEnable = TRUE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = TRUE; CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].ucRaw = 0; CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltOver; CddStp88XX_aBits[ucIx].Bit.biTestStepDone = 1u; CddStp88XX_aStpState[ucIx].Bit.SpiValid = 1u; // Step2: call function ulResult = CddStp88XX_TransFct_OffStby(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_OffIdle(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; CddStp_tCodingAreaLwr.Modus.biEnable = TRUE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = TRUE; CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltNormal; // Step2: call function ulResult = CddStp88XX_TransFct_OffIdle(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_TransFct_ErrClr(void) { // Step1: do some ini uint8 ucIx = 0; tCommandCddStp88XX eCmd = CddStp88XX_eCmdMain; uint32 ulResult = 0; CddStp_tCodingAreaLwr.Modus.biEnable = TRUE; CDDSTP_ApplCodData_AvacStp_Mode.AvacStp_Enable = TRUE; // Step2: call function ulResult = CddStp88XX_TransFct_ErrClr(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); } extern void CddStp88XX_StateFct_Init(uint8 ucIx, tAction Action); extern void CddStp88XX_StateFct_Off(uint8 ucIx, tAction Action); extern void CddStp88XX_StateFct_Stby(uint8 ucIx, tAction Action); extern void CddStp88XX_StateFct_Idle(uint8 ucIx, tAction Action); extern void CddStp88XX_StateFct_Move(uint8 ucIx, tAction Action); extern void CddStp88XX_StateFct_Ref1(uint8 ucIx, tAction Action); extern void CddStp88XX_StateFct_Ref2(uint8 ucIx, tAction Action); extern void CddStp88XX_StateFct_RefWait(uint8 ucIx, tAction Action); extern void CddStp88XX_StateFct_RefWait_Do(uint8 ucIx); extern void CddStp88XX_StateFct_TestStep(uint8 ucIx, tAction Action); extern void CddStp88XX_StateFct_Err(uint8 ucIx, tAction Action); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_StateFct_Init(void) { // Step1: do some ini uint8 ucIx = 0; tAction Action = ActEntry; // Step2: call function CddStp88XX_StateFct_Init(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 1, == ); // Step1: do some ini Action = ActDo; // Step2: call function CddStp88XX_StateFct_Init(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 1, == ); // Step1: do some ini Action = ActExit; // Step2: call function CddStp88XX_StateFct_Init(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 1, == ); // Step1: do some ini CddStpDyn_UnitTest___tCodingAreaLwr_Modus_eSchrittMod = NvmPara_eSchrittMod2; // = 0, // 1/2 step (half step) CddStp_tCodingAreaLwr.Modus.eSchrittMod = CddStpDyn_UnitTest___tCodingAreaLwr_Modus_eSchrittMod; // = 0, // 1/2 step (half step) // Step2: call function CddStp88XX_StateFct_Init(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 1, == ); // Step1: do some ini Action = 0xFF; // Step2: call function CddStp88XX_StateFct_Init(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 1, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_StateFct_Off(void) { // Step1: do some ini uint8 ucIx = 0; tAction Action = ActEntry; // Step2: call function CddStp88XX_StateFct_Off(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = ActDo; // CddStp88XX_HalStpFct[ucIx].pIsDriverReset()) // boIsErrnInactive == FALSE) ? TRUE : FALSE) // CddStp8899_aSRegFault[ucIx].Bit.u1UVLO != 0u) // (((CddStp8899_aSRegDiag2[ucIx].Bit.u1OTS) != 0u) // CddStp8899_aSRegDiag2[ucIx].Bit.u1OTW) != 0u) // CddStp8899_aSRegFault[ucIx].Bit.u1OCP) != 0u) // CddStp8899_aSRegFault[ucIx].Bit.u1OL) != 0u)))) CddStp88XX_HalStp_BitsLwr.Bit.biDriverReset = 0; CddStp_boDioErrLwr = TRUE; CddStp8899_aSRegFault[ucIx].Bit.u1UVLO = 0u; CddStp8899_aSRegDiag2[ucIx].Bit.u1OTS = 0u; CddStp8899_aSRegDiag2[ucIx].Bit.u1OTW = 0u; CddStp8899_aSRegFault[ucIx].Bit.u1OCP = 0u; CddStp8899_aSRegFault[ucIx].Bit.u1OL = 0u; // Step2: call function CddStp88XX_StateFct_Off(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini CddStp_boDioErrLwr = FALSE; // Step2: call function CddStp88XX_StateFct_Off(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini ucIx = 1; // Step2: call function CddStp88XX_StateFct_Off(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 1, == ); // Step1: do some ini ucIx = 2; // Step2: call function CddStp88XX_StateFct_Off(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini ucIx = 0; Action = ActExit; // Step2: call function CddStp88XX_StateFct_Off(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biOldStateNotInit = 1u; CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltOff; // Step2: call function CddStp88XX_StateFct_Off(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = 0xFF; CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltNormal; // Step2: call function CddStp88XX_StateFct_Off(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_StateFct_Stby(void) { // Step1: do some ini uint8 ucIx = 0; tAction Action = ActEntry; // Step2: call function CddStp88XX_StateFct_Stby(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = ActDo; CddStp88XX_aBitsMod[ucIx].Bit.biWaitStabilize = 0u; CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].Bit.u1OL = 1u; CddStp88XX_aBitsMod[ucIx].Bit.biWaitStabilizeChg = 1; // Step2: call function CddStp88XX_StateFct_Stby(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biWaitStabilizeChg = 0; // Step2: call function CddStp88XX_StateFct_Stby(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biWaitStabilize = 1u; CddStp88XX_aBitsMod[ucIx].Bit.biWaitStabilizeChg = 1u; // Step2: call function CddStp88XX_StateFct_Stby(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = ActExit; // Step2: call function CddStp88XX_StateFct_Stby(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = 0xFF; // Step2: call function CddStp88XX_StateFct_Stby(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_StateFct_Idle(void) { // Step1: do some ini uint8 ucIx = 0; tAction Action = ActEntry; // Step2: call function CddStp88XX_StateFct_Idle(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 1, == ); // Step1: do some ini Action = ActDo; // Step2: call function CddStp88XX_StateFct_Idle(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 1, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biWaitStabilize = 0; CddStp88XX_aBitsMod[ucIx].Bit.biWaitStabilizeChg = 1u; CddStp88XX_aStpCtrl[ucIx].Bit.Ref = 0u; // Step2: call function CddStp88XX_StateFct_Idle(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 1, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biWaitStabilizeChg = 0u; CddStp88XX_aStpCtrl[ucIx].Bit.Ref = 1u; // Step2: call function CddStp88XX_StateFct_Idle(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 1, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biWaitStabilize = 0; CddStp88XX_aBitsMod[ucIx].Bit.biWaitStabilizeChg = 0; CddStp88XX_aStpCtrl[ucIx].Bit.Ref = 0u; CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[ucIx].Bit.u1OTW = 1; // Step2: call function CddStp88XX_StateFct_Idle(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 1, == ); // Step1: do some ini Action = ActExit; // Step2: call function CddStp88XX_StateFct_Idle(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = 0xFF; // Step2: call function CddStp88XX_StateFct_Idle(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step4: Clean up CleanUp(); } #define CDDSTP88XX_ACTPOSMEMCNT_MAX (30u) //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_StateFct_Move(void) { // Step1: do some ini uint8 ucIx = 0; tAction Action = ActEntry; CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltOver; CddStp88XX_aStpCtrl[ucIx].Bit.Stop = 0; // Step2: call function CddStp88XX_StateFct_Move(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = ActDo; CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltUnder; // Step2: call function CddStp88XX_StateFct_Move(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltNormal; CddStp88XX_aucActPosMemCnt[ucIx] = CDDSTP88XX_ACTPOSMEMCNT_MAX + 1; CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[ucIx].Bit.u1OTW = 1; // Step2: call function CddStp88XX_StateFct_Move(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = ActExit; CddStp88XX_aucActPosMemCnt[ucIx] = 0; // Step2: call function CddStp88XX_StateFct_Move(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = 0xFF; // Step2: call function CddStp88XX_StateFct_Move(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_StateFct_Ref1(void) { // Step1: do some ini uint8 ucIx = 0; tAction Action = ActEntry; CddStp88XX_aStpCtrl[ucIx].Bit.Stop = 1u; CddStp88XX_aStpCtrl[ucIx].Bit.Ref = 1u; // Step2: call function CddStp88XX_StateFct_Ref1(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini CddStp88XX_aStpCtrl[ucIx].Bit.Stop = 0; CddStp88XX_aStpCtrl[ucIx].Bit.Ref = 1u; // Step2: call function CddStp88XX_StateFct_Ref1(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini CddStp88XX_aBits[ucIx].Bit.biRichtung = 0; // Step2: call function CddStp88XX_StateFct_Ref1(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = ActDo; CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltNormal; CddStp88XX_aucActPosMemCnt[ucIx] = CDDSTP88XX_ACTPOSMEMCNT_MAX + 1; // Step2: call function CddStp88XX_StateFct_Ref1(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini // CddStp88XX_HandleStepHanging: // Step2: call function CddStp88XX_StateFct_Ref1(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = ActExit; // Step2: call function CddStp88XX_StateFct_Ref1(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = 0xFF; // Step2: call function CddStp88XX_StateFct_Ref1(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_StateFct_Ref2(void) { // Step1: do some ini uint8 ucIx = 0; tAction Action = ActEntry; CddStp88XX_aStpCtrl[ucIx].Bit.Stop = 0u; CddStp88XX_aStpCtrl[ucIx].Bit.Ref = 1u; // Step2: call function CddStp88XX_StateFct_Ref2(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini CddStp88XX_aStpCtrl[ucIx].Bit.Stop = 1u; CddStp88XX_aStpCtrl[ucIx].Bit.Ref = 1u; // Step2: call function CddStp88XX_StateFct_Ref2(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = ActDo; CddStp88XX_aStpCtrl[ucIx].Bit.Stop = 0u; // Step2: call function CddStp88XX_StateFct_Ref2(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = ActExit; // Step2: call function CddStp88XX_StateFct_Ref2(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = 0xFF; // Step2: call function CddStp88XX_StateFct_Ref2(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_StateFct_RefWait(void) { // Step1: do some ini uint8 ucIx = 0; tAction Action = ActEntry; CddStp88XX_aStpCtrl[ucIx].Bit.Stop = 0u; CddStp88XX_aStpCtrl[ucIx].Bit.Ref = 1u; // Step2: call function CddStp88XX_StateFct_RefWait(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 1, == ); // Step1: do some ini CddStp88XX_aStpCtrl[ucIx].Bit.Stop = 1u; CddStp88XX_aStpCtrl[ucIx].Bit.Ref = 1u; // Step2: call function CddStp88XX_StateFct_RefWait(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 1, == ); // Step1: do some ini Action = ActDo; CddStp88XX_boDoSendOnce = FALSE; // CddStp88XX_HandleStepHanging: CddStp88XX_ucStateVolt = CDDSTP88XX_StateVoltNormal; CddStp88XX_aucActPosMemCnt[ucIx] = CDDSTP88XX_ACTPOSMEMCNT_MAX + 1; CddStp88XX_aStpCtrl[ucIx].Bit.Stop = 0u; // Step2: call function CddStp88XX_StateFct_RefWait(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); AL_UNITTEST_CHECK(CddStp88XX_boDoSendOnce, TRUE, == ); // Step1: do some ini Action = ActExit; CddStp88XX_boDoSendOnce = FALSE; // Step2: call function CddStp88XX_StateFct_RefWait(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini CddStp88XX_boDoSendOnce = TRUE; // Step2: call function CddStp88XX_StateFct_RefWait(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = 0xFF; // Step2: call function CddStp88XX_StateFct_RefWait(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step4: Clean up CleanUp(); } void Mt_CddStp88XX_StateFct_RefWait_Do(void) { // Step1: do some ini uint8 ucIx = 0; CddStp88XX_aStpCtrl[ucIx].Bit.Stop = 0u; CddStp88XX_aStpCtrl[ucIx].Bit.Ref = 1u; // Step2: call function CddStp88XX_StateFct_RefWait_Do(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_StateFct_TestStep(void) { // Step1: do some ini uint8 ucIx = 0; tAction Action = ActEntry; // Step2: call function CddStp88XX_StateFct_TestStep(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = ActDo; CddStp88XX_HalStp_eStateLwr = CddStp88XX_HalStp_eStateHoldCont; // Step2: call function CddStp88XX_StateFct_TestStep(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biSetTestStep = 1u; // Step2: call function CddStp88XX_StateFct_TestStep(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = ActExit; // Step2: call function CddStp88XX_StateFct_TestStep(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biWaitStabilize = 1u; // Step2: call function CddStp88XX_StateFct_TestStep(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini // boolean boIsSCCntMax = CddStp88XX_HalStpFct[ucIx].pIsSCCntMax(); // maximal value of overcurrent counter // boolean boIsOLCntMax = CddStp88XX_HalStpFct[ucIx].pIsOLCntMax(); // maximal value of openload counter CddStp88XX_aucErrVoltHiLimitSCCnt[ucIx] = CDDSTP88XX_ErrVoltHiLimitSCCntMax; CddStp88XX_HalStp_ucSCCntLwr = CddStp88XX_aucOLCntMax[0]; CddStp88XX_HalStp_ucOLCntLwr = CddStp88XX_aucOLCntMax[0]; //CddStp8899_aSRegDiag2[ucIx].Bit.u1OTS = 1u; CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[0].Bit.u1OTS = 1; // Step2: call function CddStp88XX_StateFct_TestStep(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = 0xFF; // Step2: call function CddStp88XX_StateFct_TestStep(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_StateFct_Err(void) { // Step1: do some ini uint8 ucIx = 0; tAction Action = ActEntry; // Step2: call function CddStp88XX_StateFct_Err(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = ActDo; // Step2: call function CddStp88XX_StateFct_Err(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = ActExit; // Step2: call function CddStp88XX_StateFct_Err(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step1: do some ini Action = 0xFF; // Step2: call function CddStp88XX_StateFct_Err(ucIx, Action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.IsReady, 0, == ); // Step4: Clean up CleanUp(); } // ************* CddStp8899_HalStp.c **************************** //void CddStp88XX_HalStp_Init(void); //void CddStp88XX_HalStp_Deinit(void); //void CddStp88XX_HalStp_TSPCfgCtrlRegInit(void); //uint16 CddStp88XX_HalStp_GetTimerCnt(void); extern void CddStpPrj_TSPInit(void); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpPrj_TSPInit(void) { // Step1: do some ini CddStp_UnitTest__TspIsIni = FALSE; CddStp_UnitTest__TspIsRunning = TRUE; // Step2: call function CddStpPrj_TSPInit(); // Step3: call check AL_UNITTEST_CHECK(CddStp_UnitTest__TspIsIni, TRUE, == ); AL_UNITTEST_CHECK(CddStp_UnitTest__TspIsRunning, FALSE, == ); } extern void CddStpPrj_TSPDeinit(void); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpPrj_TSPDeinit(void) { // Step1: do some ini CddStp_UnitTest__TspIsRunning = TRUE; // Step2: call function CddStpPrj_TSPDeinit(); // Step3: call check AL_UNITTEST_CHECK(CddStp_UnitTest__TspIsRunning, FALSE, == ); } extern void CddStpPrjLwr_GPT_StartHelp(uint32 ulCount); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpPrjLwr_GPT_StartHelp(void) { // Step1: do some ini uint32 ulCount = 123; CddStp_UnitTest__GptIsRunning = FALSE; // Step2: call function CddStpPrjLwr_GPT_StartHelp(ulCount); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp_UnitTest__GptIsRunning, TRUE, == ); } extern void CddStpPrjLwr_BothTimers_Prepare(uint32 ulTimerCount_GPT, uint32 ulTimerCount_TSP); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpPrjLwr_BothTimers_Prepare(void) { // Step1: do some ini uint32 ulTimerCount_GPT = 234; uint32 ulTimerCount_TSP = 567; CddStp_UnitTest__GptIsRunning = TRUE; CddStp_UnitTest__TspIsRunning = TRUE; // Step2: call function CddStpPrjLwr_BothTimers_Prepare(ulTimerCount_GPT, ulTimerCount_TSP); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp_UnitTest__GptIsRunning, FALSE, == ); AL_UNITTEST_CHECK(CddStp_UnitTest__TspIsRunning, FALSE, == ); } extern void CddStpPrjLwr_BothTimers_Start(void); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpPrjLwr_BothTimers_Start(void) { // Step1: do some ini CddStp_UnitTest__GptIsRunning = FALSE; CddStp_UnitTest__TspIsRunning = FALSE; // Step2: call function CddStpPrjLwr_BothTimers_Start(); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp_UnitTest__GptIsRunning, TRUE, == ); AL_UNITTEST_CHECK(CddStp_UnitTest__TspIsRunning, TRUE, == ); } extern void CddStpPrjLwr_TSP_ForceTimerLow(void); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpPrjLwr_TSP_ForceTimerLow(void) { // Step1: do some ini CddStp_UnitTest__TspIsRunning = TRUE; // Step2: call function CddStpPrjLwr_TSP_ForceTimerLow(); // Step3: call check AL_UNITTEST_CHECK(CddStp_UnitTest__TspIsRunning, FALSE, == ); } extern uint32 CddStpPrjLwr_GPT_GetRemainingCnt(void); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpPrjLwr_GPT_GetRemainingCnt(void) { // Step1: do some ini CddStp_UnitTest__GptTickCount = 0x12345678; // Step2: call function uint32 ulResult = CddStpPrjLwr_GPT_GetRemainingCnt(); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(ulResult, 0x12345678, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStp_Init(void) { // Step1: do some ini // Step2: call function CddStp88XX_HalStp_Init(); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStp_Deinit(void) { // Step1: do some ini // Step2: call function CddStp88XX_HalStp_Deinit(); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); } extern void CddStp88XX_HalStpLwr_SetCARunRefCnt(uint8 ucCntVal); extern boolean CddStp88XX_HalStpLwr_SetHsMode(boolean boHsMode, uint8 ucCurAmpltRun); extern boolean CddStp88XX_HalStpLwr_IsTestStepDone(void); extern void CddStp88XX_HalStpLwr_ResetTestStepCnt(void); extern boolean CddStp88XX_HalStpLwr_SpiSendCReg0(boolean boSend); extern boolean CddStp88XX_HalStpLwr_SpiSendCReg1(boolean boSend); extern boolean CddStp88XX_HalStpLwr_SpiSendCReg2(boolean boSend); extern boolean CddStp88XX_HalStpLwr_SpiSendCReg3(boolean boSend); extern boolean CddStp88XX_HalStpLwr_SpiSendCReg4(boolean boSend); extern void CddStp88XX_HalStpLwr_SpiSendCReg5(void); extern void CddStp88XX_HalStpLwr_SpiSendCReg6(void); extern boolean CddStp88XX_HalStpLwr_IsDriverReset(void); extern void CddStp88XX_HalStpLwr_ClrDriverReset(void); extern void CddStp88XX_HalStpLwr_SetDriverReset(void); extern boolean CddStp88XX_HalStpLwr_IncOLCnt_(void); extern boolean CddStp88XX_HalStpLwr_IsOLCntMax_(void); extern boolean CddStp88XX_HalStpLwr_IncSCCnt_(void); extern boolean CddStp88XX_HalStpLwr_IsSCCntMax_(void); extern boolean CddStp88XX_HalStpLwr_GetPsensPort(void); extern boolean CddStp88XX_HalStpLwr_IsStateTestStep_(void); extern uint32 CddStp88XX_HalStpLwr_GetWriteIx(sint32* plActPos, uint32* pulRemainingTicks); extern uint8 CddStp88XX_HalStpLwr_GetPhaseCounter(void); extern void CddStp88XX_HalStpLwr_HandleMotEn_(boolean boMotEn, boolean boSendCReg12); extern void CddStp88XX_HalStpLwr_StopStp_(boolean boMotEn); extern void CddStp88XX_HalStpLwr_StopStp(boolean boMotEn); extern boolean CddStp88XX_HalStpLwr_SendCReg3(boolean boSend); extern boolean CddStp88XX_HalStpLwr_SendCReg4(boolean boSend); extern boolean CddStp88XX_HalStpLwr_SendCRegAll(void); extern void CddStp88XX_HalStpLwr_HandleCurAmplt_(tCurAmpltStateCddStp88XX eCurAmpltState, uint8 ucCurAmpltHold, uint8 ucCurAmpltRun); extern uint8 CddStp88XX_HalStpLwr_GetCurAmplt(void); extern void CddStp88XX_HalStpLwr_HandleInc(boolean boIncCntActPos, boolean boIncBufIx); extern boolean CddStp88XX_HalStpLwr_HandleDir(void); extern boolean CddStp88XX_HalStpLwr_GetPause(void); extern void CddStp88XX_HalStpLwr_HandleTestStep(void); extern void CddStp88XX_HalStpLwr_HandleCommonStep(const tStateHalStp eState); extern uint32 CddStp88XX_HalStpLwr_TransFct_TestStepHoldCont(const tCommandHalStp eCmd); extern uint32 CddStp88XX_HalStpLwr_TransFct_LastStep(const tCommandHalStp eCmd); extern uint32 CddStp88XX_HalStpLwr_TransFct_Step(const tCommandHalStp eCmd); extern uint32 CddStp88XX_HalStpLwr_TransFct_StepHold(const tCommandHalStp eCmd); extern uint32 CddStp88XX_HalStpLwr_TransFct_HoldHoldCont(const tCommandHalStp eCmd); extern void CddStp88XX_HalStpLwr_StateFct_Init(tAction Action); extern void CddStp88XX_HalStpLwr_StateFct_FirstStep(tAction Action); extern void CddStp88XX_HalStpLwr_StateFct_LastStep(tAction Action); extern void CddStp88XX_HalStpLwr_StateFct_Step(tAction Action); extern void CddStp88XX_HalStpLwr_StateFct_Hold(tAction Action); extern void CddStp88XX_HalStpLwr_StateFct_HoldCont(tAction Action); extern void CddStp88XX_HalStpLwr_StateFct_TestStep(tAction Action); void StpTimer0Notification(void); void CddStp88XX_HalStpVer_TimerCb(void); void CddStp88XX_HalStpVer_TimerHelpCb(void); void CddStp88XX_HalStpVer_ErrnCb(void); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_SetCARunRefCnt(void) { // Step1: do some ini uint8 ucCntVal = 123; // Step2: call function CddStp88XX_HalStpLwr_SetCARunRefCnt(ucCntVal); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ) // Step1: do some ini ucCntVal = 0; // Step2: call function CddStp88XX_HalStpLwr_SetCARunRefCnt(ucCntVal); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step4: Clean up CleanUp(); } extern uint32 CddStp_UnitTestHelper_ul1; extern uint32 CddStp_UnitTestHelper_ul2; extern boolean CddStp_UnitTestHelper_bo1; extern boolean CddStp_UnitTestHelper_bo2; //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_SetHsMode(void) { // Step1: do some ini boolean boResult; boolean boHsMode = TRUE; uint8 ucCurAmpltRun = 12; CddStp_UnitTestHelper_bo1 = FALSE; CddStp_UnitTestHelper_bo2 = TRUE; // Step2: call function boResult = CddStp88XX_HalStpLwr_SetHsMode(boHsMode, ucCurAmpltRun); // Step3: call check AL_UNITTEST_CHECK(boResult, TRUE, == ); // Step1: do some ini boHsMode = FALSE; CddStp_UnitTestHelper_bo1 = TRUE; CddStp_UnitTestHelper_bo2 = FALSE; // Step2: call function boResult = CddStp88XX_HalStpLwr_SetHsMode(boHsMode, ucCurAmpltRun); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_IsTestStepDone(void) { // Step1: do some ini boolean boResult; CddStp88XX_HalStp_BitsLwr.Bit.biTestStepDone = 1u; // Step2: call function boResult = CddStp88XX_HalStpLwr_IsTestStepDone(); // Step3: call check AL_UNITTEST_CHECK(boResult, TRUE, == ); // Step1: do some ini CddStp88XX_HalStp_BitsLwr.Bit.biTestStepDone = 0; // Step2: call function boResult = CddStp88XX_HalStpLwr_IsTestStepDone(); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_ResetTestStepCnt(void) { // Step1: do some ini // Step2: call function CddStp88XX_HalStpLwr_ResetTestStepCnt(); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_SpiSendCReg0(void) { // Step1: do some ini boolean boResult; boolean boSend = TRUE; // Step2: call function boResult = CddStp88XX_HalStpLwr_SpiSendCReg0(boSend); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_SpiSendCReg1(void) { // Step1: do some ini boolean boResult; boolean boSend = TRUE; // Step2: call function boResult = CddStp88XX_HalStpLwr_SpiSendCReg1(boSend); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_SpiSendCReg2(void) { // Step1: do some ini boolean boResult; boolean boSend = TRUE; // Step2: call function boResult = CddStp88XX_HalStpLwr_SpiSendCReg2(boSend); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_SpiSendCReg3(void) { // Step1: do some ini boolean boResult; boolean boSend = TRUE; // Step2: call function boResult = CddStp88XX_HalStpLwr_SpiSendCReg3(boSend); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_SpiSendCReg4(void) { // Step1: do some ini boolean boResult; boolean boSend = TRUE; // Step2: call function boResult = CddStp88XX_HalStpLwr_SpiSendCReg4(boSend); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); // Step4: Clean up CleanUp(); } extern uint8 CddStp88XX_HalStp_aucSPI_TX[CFA_CNT_STP_88XX][CddStp88XX_HalStp_eRegBSize]; // SPI TX buffer which contents raw register values to transmit //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_SpiSendCReg5(void) { // Step1: do some ini CddStp88XX_HalStp_aucSPI_TX[CFG_Stp_IdxVer][CddStp88XX_HalStp_eCReg5] = 0xFF; // Step2: call function CddStp88XX_HalStpLwr_SpiSendCReg5(); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_HalStp_aucSPI_TX[CFG_Stp_IdxVer][CddStp88XX_HalStp_eCReg5], 0xFF, != ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_SpiSendCReg6(void) { // Step1: do some ini CddStp88XX_HalStp_aucSPI_TX[CFG_Stp_IdxVer][CddStp88XX_HalStp_eCReg6] = 0; // Step2: call function CddStp88XX_HalStpLwr_SpiSendCReg6(); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_HalStp_aucSPI_TX[CFG_Stp_IdxVer][CddStp88XX_HalStp_eCReg6], 0, != ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_IsDriverReset(void) { // Step1: do some ini boolean boResult; CddStp88XX_HalStp_BitsLwr.Bit.biDriverReset = 1u; // Step2: call function boResult = CddStp88XX_HalStpLwr_IsDriverReset(); // Step3: call check AL_UNITTEST_CHECK(boResult, TRUE, == ); // Step1: do some ini CddStp88XX_HalStp_BitsLwr.Bit.biDriverReset = 0u; // Step2: call function boResult = CddStp88XX_HalStpLwr_IsDriverReset(); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_ClrDriverReset(void) { // Step1: do some ini // Step2: call function CddStp88XX_HalStpLwr_ClrDriverReset(); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_SetDriverReset(void) { // Step1: do some ini // Step2: call function CddStp88XX_HalStpLwr_SetDriverReset(); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step4: Clean up CleanUp(); } #define CDDSTP88XX_HALSTP_OLCntMaxHS (2u) //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_IncOLCnt_(void) { // Step1: do some ini boolean boResult; const uint8 ucIx = 0; CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].Bit.u1OL = 1u; CddStp88XX_aStpState[ucIx].Bit.ErrElecOL = 0u; CddStp88XX_HalStp_BitsLwr.Bit.biHsMode = 1u; CddStp88XX_HalStp_ucOLCntLwr = 0; // Step2: call function boResult = CddStp88XX_HalStpLwr_IncOLCnt_(); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); // Step1: do some ini CddStp8899Com_DataMirror.StatvRx.aSRegBasic[ucIx].Bit.u1OL = 1; CddStp88XX_HalStp_ucOLCntLwr = CDDSTP88XX_HALSTP_OLCntMaxHS; // Step2: call function boResult = CddStp88XX_HalStpLwr_IncOLCnt_(); // Step3: call check AL_UNITTEST_CHECK(boResult, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_IsOLCntMax_(void) { // Step1: do some ini boolean boResult; CddStp88XX_HalStp_BitsLwr.Bit.biHsMode = 1u; CddStp88XX_HalStp_ucOLCntLwr = CDDSTP88XX_HALSTP_OLCntMaxHS - 1; // Step2: call function boResult = CddStp88XX_HalStpLwr_IsOLCntMax_(); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); // Step1: do some ini CddStp88XX_HalStp_ucOLCntLwr = CDDSTP88XX_HALSTP_OLCntMaxHS; // Step2: call function boResult = CddStp88XX_HalStpLwr_IsOLCntMax_(); // Step3: call check AL_UNITTEST_CHECK(boResult, TRUE, == ); // Step1: do some ini CddStp88XX_HalStp_BitsLwr.Bit.biHsMode = 0; CddStp88XX_HalStp_ucOLCntLwr = CddStp88XX_aucOLCntMax[0]; CddStp_tCodingAreaLwr.Modus.biTestOlIgnor = 1u; // Step2: call function boResult = CddStp88XX_HalStpLwr_IsOLCntMax_(); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); // Step4: Clean up CddStp_tCodingAreaLwr.Modus.biTestOlIgnor = 0u; CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_IncSCCnt_(void) { // Step1: do some ini boolean boResult; uint8 ucIx = 0; CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].Bit.u1OL = 0u; CddStp8899Com_DataMirror.StatvRx.aSRegFault[ucIx].Bit.u1OCP = 1u; CddStp88XX_aBitsMod[ucIx].Bit.biDisOLDetect = 1u; CddStp88XX_aStpState[ucIx].Bit.ErrElecSC = 1u; CddStp_tCodingAreaLwr.Modus.biTestOlIgnor = 1u; // Step2: call function boResult = CddStp88XX_HalStpLwr_IncSCCnt_(); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); // Step1: do some ini CddStp8899Com_DataMirror.StatvRx.aSRegBasic[ucIx].Bit.u1OL = 0u; CddStp8899Com_DataMirror.StatvRx.aSRegBasic[ucIx].Bit.u1OCP = 1u; CddStp88XX_HalStp_ucSCCntLwr = 0; CddStp_tCodingAreaLwr.Modus.biTestOlIgnor = FALSE; // Step2: call function boResult = CddStp88XX_HalStpLwr_IncSCCnt_(); // Step3: call check AL_UNITTEST_CHECK(boResult, TRUE, == ); // Step1: do some ini CddStp88XX_HalStp_ucSCCntLwr = 1; CddStp_tCodingAreaLwr.Modus.biTestOlIgnor = TRUE; // Step2: call function boResult = CddStp88XX_HalStpLwr_IncSCCnt_(); // Step3: call check AL_UNITTEST_CHECK(boResult, TRUE, == ); // Step1: do some ini CddStp88XX_HalStp_ucSCCntLwr = 255; // Step2: call function boResult = CddStp88XX_HalStpLwr_IncSCCnt_(); // Step3: call check AL_UNITTEST_CHECK(boResult, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_IsSCCntMax_(void) { // Step1: do some ini boolean boResult; // Step2: call function boResult = CddStp88XX_HalStpLwr_IsSCCntMax_(); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); // Step4: Clean up CleanUp(); } void CddStp88XX_HalStpLwr_ResetErrVolt(void); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_GetPsensPort(void) { // Step1: do some ini boolean boResult; // Step2: call function boResult = CddStp88XX_HalStpLwr_GetPsensPort(); CddStp88XX_HalStpLwr_ResetErrVolt(); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_IsStateTestStep_(void) { // Step1: do some ini boolean boResult; CddStp88XX_HalStp_eStateLwr = CddStp88XX_HalStp_eStateTestStep; // Step2: call function boResult = CddStp88XX_HalStpLwr_IsStateTestStep_(); // Step3: call check AL_UNITTEST_CHECK(boResult, TRUE, == ); // Step4: Clean up CleanUp(); } #define CDDSTP88XX_HALSTP_MaxTimerVal (0x3FFFFFFFu) // maximal timer CDR value #define CDDSTP88XX_HALSTP_RT_MIN ST_R_USEC(1000u) // 1000 us minimum remaining ticks //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_GetWriteIx(void) { // Step1: do some ini uint32 ulResult; sint32 lActPos = 1234; uint32 ulRemainingTicks = 123435; uint32 ulBufferIndexAct = 0; CddStp88XX_HalStp_eStateLwr = CddStp88XX_HalStp_eStateFirstStep; CddStp88XX_HalStp_StpInfoLwr.HsInfoBuf[ulBufferIndexAct].Bit.biSet = 1u; // #define CDDSTP88XX_HALSTP_MaxTimerVal (0x3FFFFFFFu) // maximal timer CDR value CddStp_UnitTest__GptTickCount = CDDSTP88XX_HALSTP_MaxTimerVal + 1; // Step2: call function ulResult = CddStp88XX_HalStpLwr_GetWriteIx(&lActPos, &ulRemainingTicks); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini // #define CDDSTP88XX_HALSTP_RT_MIN ST_R_USEC(1000u) // 1000 us - minimum remaining ticks CddStp_UnitTest__GptTickCount = CDDSTP88XX_HALSTP_RT_MIN - 1; CddStp88XX_HalStp_StpInfoLwr.HsInfoBuf[ulBufferIndexAct].Bit.biPause = 0; CddStp88XX_HalStp_StpInfoLwr.HsInfoBuf[ulBufferIndexAct].Bit.biDirection = 0; // Step2: call function ulResult = CddStp88XX_HalStpLwr_GetWriteIx(&lActPos, &ulRemainingTicks); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini CddStp88XX_HalStp_StpInfoLwr.HsInfoBuf[ulBufferIndexAct].Bit.biPause = 0; CddStp88XX_HalStp_StpInfoLwr.HsInfoBuf[ulBufferIndexAct].Bit.biDirection = 1u; // Step2: call function ulResult = CddStp88XX_HalStpLwr_GetWriteIx(&lActPos, &ulRemainingTicks); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step1: do some ini CddStp88XX_HalStp_StpInfoLwr.HsInfoBuf[ulBufferIndexAct].Bit.biPause = 1u; // Step2: call function ulResult = CddStp88XX_HalStpLwr_GetWriteIx(&lActPos, &ulRemainingTicks); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_GetPhaseCounter(void) { // Step1: do some ini uint8 ucResult; // Step2: call function ucResult = CddStp88XX_HalStpLwr_GetPhaseCounter(); // Step3: call check AL_UNITTEST_CHECK(ucResult, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_HandleMotEn_(void) { // Step1: do some ini boolean boMotEn = TRUE; boolean boSendCReg12 = TRUE; CddStp88XX_HalStp_BitsLwr.Bit.biMotEn = 0u; // Step2: call function CddStp88XX_HalStpLwr_HandleMotEn_(boMotEn, boSendCReg12); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini boSendCReg12 = FALSE; boMotEn = FALSE; CddStp88XX_HalStp_BitsLwr.Bit.biMotEn = 1u; // Step2: call function CddStp88XX_HalStpLwr_HandleMotEn_(boMotEn, boSendCReg12); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step4: Clean up CleanUp(); } extern tCddStp88XXBits CddStp88XX_aBits[CFA_CNT_STP_88XX]; //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_StopStp_(void) { // Step1: do some ini uint8 ucIx = 0; boolean boMotEn = TRUE; CddStp_UnitTestHelper_bo1 = TRUE; // Step2: call function CddStp88XX_HalStpLwr_StopStp_(boMotEn); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini CddStp_UnitTestHelper_bo1 = FALSE; CddStp88XX_aBits[ucIx].Bit.biRichtung = 1u; // Step2: call function CddStp88XX_HalStpLwr_StopStp_(boMotEn); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini CddStp_UnitTestHelper_bo1 = TRUE; // Step2: call function CddStp88XX_HalStpLwr_StopStp_(boMotEn); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_StopStp(void) { // Step1: do some ini boolean boMotEn = TRUE; // CddStp88XX_HalStp_eStateLwr = CddStp88XX_HalStp_eStateHoldCont || CddStp88XX_HalStp_eStateTestStep; CddStp88XX_HalStp_eStateLwr = CddStp88XX_HalStp_eStateHoldCont; // Step2: call function CddStp88XX_HalStpLwr_StopStp(boMotEn); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_HalStp_BitsLwr.Bit.biStopStp, FALSE, == ); // Step1: do some ini CddStp88XX_HalStp_eStateLwr = CddStp88XX_HalStp_eStateTestStep; // Step2: call function CddStp88XX_HalStpLwr_StopStp(boMotEn); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_HalStp_BitsLwr.Bit.biStopStp, FALSE, == ); // Step1: do some ini CddStp88XX_HalStp_eStateLwr = CddStp88XX_HalStp_eStateHold; // Step2: call function CddStp88XX_HalStpLwr_StopStp(boMotEn); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_HalStp_BitsLwr.Bit.biStopStp, TRUE, == ); // Step1: do some ini boMotEn = FALSE; // Step2: call function CddStp88XX_HalStpLwr_StopStp(boMotEn); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_HalStp_BitsLwr.Bit.biStopStp, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_SendCReg3(void) { // Step1: do some ini boolean boResult; boolean boSend = TRUE; // Step2: call function boResult = CddStp88XX_HalStpLwr_SendCReg3(boSend); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_SendCReg4(void) { // Step1: do some ini boolean boResult; boolean boSend = TRUE; // tbd: CddStp88__LwrDisableOlDetection = TRUE; // Step2: call function boResult = CddStp88XX_HalStpLwr_SendCReg4(boSend); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); // Step4: Clean up // CddStp88__LwrDisableOlDetection = FALSE; CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_SendCRegAll(void) { // Step1: do some ini boolean boResult; CddStp_UnitTestHelper_bo1 = TRUE; // Step2: call function boResult = CddStp88XX_HalStpLwr_SendCRegAll(); // Step3: call check AL_UNITTEST_CHECK(boResult, TRUE, == ); // Step1: do some ini CddStp_UnitTestHelper_bo1 = FALSE; // Step2: call function boResult = CddStp88XX_HalStpLwr_SendCRegAll(); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_HandleCurAmplt_(void) { // Step1: do some ini tCurAmpltStateCddStp88XX eCurAmpltState = CDDSTP88XX_eCurAmpltStateNorm; uint8 ucCurAmpltHold = 123; uint8 ucCurAmpltRun = 234; // Step2: call function CddStp88XX_HalStpLwr_HandleCurAmplt_(eCurAmpltState, ucCurAmpltHold, ucCurAmpltRun); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini CddStp_UnitTestHelper_bo1 = TRUE; CddStp_UnitTestHelper_ul1 = 0xFF; // Step2: call function CddStp88XX_HalStpLwr_HandleCurAmplt_(eCurAmpltState, ucCurAmpltHold, ucCurAmpltRun); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_GetCurAmplt(void) { // Step1: do some ini uint8 ucResult; // Step2: call function ucResult = CddStp88XX_HalStpLwr_GetCurAmplt(); // Step3: call check AL_UNITTEST_CHECK(ucResult, 234, == ); // Step4: Clean up CleanUp(); } extern tHalStpBitsInt CddStp88XX_HalStp_BitsIntLwr; //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_HandleInc(void) { // Step1: do some ini boolean boIncCntActPos = TRUE; boolean boIncBufIx = TRUE; CddStp88XX_HalStp_BitsIntLwr.Bit.biDirection = 0; // Step2: call function CddStp88XX_HalStpLwr_HandleInc(boIncCntActPos, boIncBufIx); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini CddStp88XX_HalStp_BitsIntLwr.Bit.biDirection = 1; // Step2: call function CddStp88XX_HalStpLwr_HandleInc(boIncCntActPos, boIncBufIx); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_HandleDir(void) { // Step1: do some ini boolean boResult; // Step2: call function boResult = CddStp88XX_HalStpLwr_HandleDir(); // Step3: call check AL_UNITTEST_CHECK(boResult, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_GetPause(void) { // Step1: do some ini boolean boResult; // Step2: call function boResult = CddStp88XX_HalStpLwr_GetPause(); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_HandleTestStep(void) { // Step1: do some ini uint8 idx = 0; // Step2: call function for (idx = 0; idx < 10; idx++) { CddStp88XX_HalStpLwr_HandleTestStep(); } // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step4: Clean up CleanUp(); } extern tHsInfo CddStp88XX_HalStp_HSInfoBufSaveLwr; //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_HandleCommonStep(void) { // Step1: do some ini tStateHalStp eState = CddStp88XX_HalStp_eStateHold; CddStp88XX_HalStp_StpInfoLwr.HsInfoBuf[CddStp88XX_HalStp_StpInfoLwr.ulHsInfoBufIx].Bit.biPause = 0; CddStp88XX_HalStp_HSInfoBufSaveLwr.Bit.biPause = 0; // Step2: call function CddStp88XX_HalStpLwr_HandleCommonStep(eState); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_TransFct_TestStepHoldCont(void) { // Step1: do some ini uint32 ulResult; tCommandHalStp eCmd = CddStp88XX_HalStp_eCmdStartStp; // Step2: call function ulResult = CddStp88XX_HalStpLwr_TransFct_TestStepHoldCont(eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_TransFct_LastStep(void) { // Step1: do some ini uint32 ulResult; tCommandHalStp eCmd = CddStp88XX_HalStp_eCmdStartStp; // Step2: call function ulResult = CddStp88XX_HalStpLwr_TransFct_LastStep(eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_TransFct_Step(void) { // Step1: do some ini uint32 ulResult; tCommandHalStp eCmd = CddStp88XX_HalStp_eCmdStartStp; // Step2: call function ulResult = CddStp88XX_HalStpLwr_TransFct_Step(eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_TransFct_StepHold(void) { // Step1: do some ini uint32 ulResult; tCommandHalStp eCmd = CddStp88XX_HalStp_eCmdStartStp; // Step2: call function ulResult = CddStp88XX_HalStpLwr_TransFct_StepHold(eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_TransFct_HoldHoldCont(void) { // Step1: do some ini uint32 ulResult; tCommandHalStp eCmd = CddStp88XX_HalStp_eCmdStartStp; // Step2: call function ulResult = CddStp88XX_HalStpLwr_TransFct_HoldHoldCont(eCmd); // Step3: call check AL_UNITTEST_CHECK(ulResult, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_StateFct_Init(void) { // Step1: do some ini tAction Action = ActEntry; // Step2: call function CddStp88XX_HalStpLwr_StateFct_Init(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini Action = ActDo; // Step2: call function CddStp88XX_HalStpLwr_StateFct_Init(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini Action = 255; // Step2: call function CddStp88XX_HalStpLwr_StateFct_Init(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_StateFct_FirstStep(void) { // Step1: do some ini tAction Action = ActEntry; // Step2: call function CddStp88XX_HalStpLwr_StateFct_FirstStep(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini Action = ActExit; // Step2: call function CddStp88XX_HalStpLwr_StateFct_FirstStep(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini Action = 255; // Step2: call function CddStp88XX_HalStpLwr_StateFct_FirstStep(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_StateFct_LastStep(void) { // Step1: do some ini tAction Action = ActEntry; // Step2: call function CddStp88XX_HalStpLwr_StateFct_LastStep(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini Action = ActExit; // Step2: call function CddStp88XX_HalStpLwr_StateFct_LastStep(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini Action = 255; // Step2: call function CddStp88XX_HalStpLwr_StateFct_LastStep(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_StateFct_Step(void) { // Step1: do some ini tAction Action = ActEntry; // Step2: call function CddStp88XX_HalStpLwr_StateFct_Step(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini Action = ActDo; // Step2: call function CddStp88XX_HalStpLwr_StateFct_Step(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini Action = ActExit; // Step2: call function CddStp88XX_HalStpLwr_StateFct_Step(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini Action = 255; // Step2: call function CddStp88XX_HalStpLwr_StateFct_Step(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_StateFct_Hold(void) { // Step1: do some ini tAction Action = ActEntry; // Step2: call function CddStp88XX_HalStpLwr_StateFct_Hold(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini Action = ActDo; // Step2: call function CddStp88XX_HalStpLwr_StateFct_Hold(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini Action = ActExit; // Step2: call function CddStp88XX_HalStpLwr_StateFct_Hold(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini Action = 255; // Step2: call function CddStp88XX_HalStpLwr_StateFct_Hold(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_StateFct_HoldCont(void) { // Step1: do some ini tAction Action = ActEntry; // Step2: call function CddStp88XX_HalStpLwr_StateFct_HoldCont(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpLwr_StateFct_TestStep(void) { // Step1: do some ini tAction Action = ActEntry; // Step2: call function CddStp88XX_HalStpLwr_StateFct_TestStep(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini Action = ActDo; // Step2: call function CddStp88XX_HalStpLwr_StateFct_TestStep(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini Action = ActExit; // Step2: call function CddStp88XX_HalStpLwr_StateFct_TestStep(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step1: do some ini Action = 255; // Step2: call function CddStp88XX_HalStpLwr_StateFct_TestStep(Action); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_StpTimer0Notification(void) { // Step1: do some ini // Step2: call function StpTimer0Notification(); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpVer_TimerCb(void) { // Step1: do some ini // Step2: call function CddStp88XX_HalStpVer_TimerCb(); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpVer_TimerHelpCb(void) { // Step1: do some ini // Step2: call function CddStp88XX_HalStpVer_TimerHelpCb(); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_HalStpVer_ErrnCb(void) { // Step1: do some ini // Step2: call function CddStp88XX_HalStpVer_ErrnCb(); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); // Step4: Clean up CleanUp(); } // ************* CddStp8899Com.h **************************** // INLINE boolean CddStp8899Com_CheckStReady(uint8 ucIx, uint32 ulSt) // INLINE void CddStp8899Com_StReqSingle(uint8 ucIx, uint32 ulSt) // INLINE void CddStp8899Com_SetCReg1(uint8 ucIx, uint8 uc) { CddStp8899Com_DataMirror.CtrlTx.aCReg1[ucIx].ucRaw = uc; } // INLINE void CddStp8899Com_SetCReg2(uint8 ucIx, uint8 uc) { CddStp8899Com_DataMirror.CtrlTx.aCReg2[ucIx].ucRaw = uc; } // INLINE void CddStp8899Com_SetCReg3(uint8 ucIx, uint8 uc) { CddStp8899Com_DataMirror.CtrlTx.aCReg3[ucIx].ucRaw = uc; } // INLINE void CddStp8899Com_SetCReg4(uint8 ucIx, uint8 uc) { CddStp8899Com_DataMirror.CtrlTx.aCReg4[ucIx].ucRaw = uc; } // INLINE boolean CddStp8899Com_GetCRegRxMotEn(const uint8 ucIx) //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Com_CheckStReady(void) { // Step1: do some ini const uint8 ucData = 0xDB; const uint32 ulData = 0xAFFE; const uint8 ucIx = 0; uint32 ulSt = ulData; boolean retValue; CddStp8899Com_aucStReqSingle[ucIx] = ucData; // Step2: call function retValue = CddStp8899Com_CheckStReady(ucIx, ulSt); // Step3: call check AL_UNITTEST_CHECK(retValue, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Com_StReqSingle(void) { // Step1: do some ini const uint8 ucData = 0xDB; const uint32 ulData = 0xAFFE; const uint8 ucIx = 0; uint32 ulSt = ulData; CddStp8899Com_aucStReqSingle[ucIx] = ucData; // Step2: call function CddStp8899Com_StReqSingle(ucIx, ulSt); // Step3: call check AL_UNITTEST_CHECK(CddStp8899Com_aucStReqSingle[ucIx], ucData, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Com_GetCRegRxMotEn(void) { // Step1: do some ini const uint8 ucIx = 0; boolean retValue; // Step2: call function retValue = CddStp8899Com_GetCRegRxMotEn(ucIx); // Step3: call check AL_UNITTEST_CHECK(retValue, TRUE, == ); } // ************* CddStp8899Com.c **************************** //void CddStp_SpiRx(uint16 unIx, uint32 ulData); //uint32 CddStp_SpiTx(uint16 unIx); // boolean CddStp_GetStpConfigMask(uint16* punData); // boolean CddStp_GetStpConfig(uint16* punData, uint8* pucNumOfStp); // boolean CddStp8899Com_GetSRegBsc(uint8 ucIx, uint8* pucSRegBsc); // boolean CddStp8899Com_GetSRegFlt(uint8 ucIx, uint8* pucSRegFlt); // boolean CddStp8899Com_GetSRegDiag1(uint8 ucIx, uint8* pucSRegDiag1); // boolean CddStp8899Com_GetSRegDiag2(uint8 ucIx, uint8* pucSRegDiag2); // boolean CddStp8899Com_GetSRegDiag12(uint8 ucIx, uint8* pucSRegDiag1, uint8* pucSRegDiag2); // boolean CddStp8899Com_GetSRegFltDiag2(uint8 ucIx, uint8* pucSRegFlt, uint8* pucSRegDiag2); // boolean CddStp8899Com_GetSRegBscFltDiag12(uint8 ucIx, uint8* pucSRegBsc, uint8* pucSRegFlt, uint8* pucSRegDiag1, uint8* pucSRegDiag2); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_SpiRx(void) { // Step1: do some ini uint16 unIx = 0; uint32 ulData = 0xAFFE; CddStp88XX_ucNumOfSteppers_EFT = 0; // CddStp_UnitTest__tieEftData[0].ucType = 0u; CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw = 0xAF; // Step2: call function CddStp_SpiRx(unIx, ulData); // Step3: call check AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 0xAF, == ); // Step1: do some ini unIx = 0xFF; // Step2: call function CddStp_SpiRx(unIx, ulData); // Step3: call check AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 0xAF, == ); // Step4: Clean up CleanUp(); } typedef struct { uint8 ucNextEntry; // index of next schedule table entry uint8 ucAddr; // SPI address (combination of low and high nibble) const uint8* pucCtrlTx; // SPI control register data for transmission - offset related to 1st address of stuct uint8* pucRxDataByte; // SPI control/status register data 1 for reception - offset related to 1st address of stuct uint8* pucRxDummy; // SPI status register data 2 for reception - use instead of this: 'uint8* pucStatusBasic = ST_STAT_RX_SRB' } tCddStp8899Com_SpiSchedTable; extern const tCddStp8899Com_SpiSchedTable CddStp8899Com_SpiSchedTable[CDDSTP8899_SpiSt_IxMax + 1u]; extern const tCddStp8899Com_SpiSchedTable CddStp8899Com_SpiSchedTable_XT[CDDSTP8899_SpiSt_IxMax_XT + 1u]; extern void CddStp8899Com_SpiRx(uint16 unIx, uint16 unData); extern uint8 CddStp8899Com_aucStReqOnceMore[]; extern uint8 CddStp8899Com_aucActSchedTable[]; extern uint8 CddStp8899Com_aucSchedState[]; extern void CddStp8899Com_DEBUG_Check_EnOl_DisOut(void); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Com_SpiRx(void) { // Step1: do some ini uint16 unIx = 0; uint32 ulData = 0xAFFE; CddStp88XX_ucNumOfSteppers_EFT = 2; CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw = 0xAF; // Step2: call function CddStp8899Com_SpiRx(unIx, ulData); // Step3: call check AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 0xAF, == ); // Step1: do some ini unIx = 3; CddStp88XX_ucNumOfSteppers_EFT = 3; CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw = 0xAF; // Step2: call function CddStp8899Com_SpiRx(unIx, ulData); // Step3: call check AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 0xAF, == ); // Step1: do some ini unIx = 2; // CddStp88XX_ucNumOfSteppers_EFT = 3; CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw = 0xAF; // Step2: call function CddStp8899Com_SpiRx(unIx, ulData); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 47, == ); // Step1: do some ini unIx = 1; // CddStp88XX_ucNumOfSteppers_EFT = 3; CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw = 0xAF; // Step2: call function CddStp8899Com_SpiRx(unIx, ulData); // Step3: call check AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 0xAF, == ); // Step1: do some ini unIx = 0; // CddStp88XX_ucNumOfSteppers_EFT = 3; CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw = 0xAF; // Step2: call function CddStp8899Com_SpiRx(unIx, ulData); // Step3: call check AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 0xAF, == ); // jk: not meaningful: // Step1: do some ini unIx = 4; // CddStp88XX_ucNumOfSteppers_EFT = 3; CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw = 0xAF; // Step2: call function CddStp8899Com_SpiRx(unIx, ulData); // Step3: call check AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 0xAF, == ); // Step1: do some ini unIx = 1; CddStp88XX_ucNumOfSteppers_EFT = 1; CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw = 0xAF; // Step2: call function CddStp8899Com_SpiRx(unIx, ulData); // Step3: call check AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 0xAF, == ); // Step1: do some ini unIx = 0; // CddStp88XX_ucNumOfSteppers_EFT = 1; CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw = 0xAF; // Step2: call function CddStp8899Com_SpiRx(unIx, ulData); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 47, == ); // Step1: do some ini // unIx = 0; & CddStp88XX_ucNumOfSteppers_EFT = 1; CddStp8899Com_aucActSchedTable[unIx] = (uint8)CddStp8899Com_eSt0; CddStp8899Com_aucStReqOnceMore[unIx] = CDDSTP8899_SpiSt_Bit0; CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw = 0xAF; // Step2: call function CddStp8899Com_SpiRx(unIx, ulData); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 47, == ); // Step1: do some ini // unIx = 0; & CddStp88XX_ucNumOfSteppers_EFT = 1; CddStp8899Com_aucSchedState[unIx] = 11; // end of table CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw = 0xAF; CddStp8899Com_aucStReqSingle[unIx] = 0; // Step2: call function CddStp8899Com_SpiRx(unIx, ulData); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 47, == ); // Step1: do some ini // unIx = 0; & CddStp88XX_ucNumOfSteppers_EFT = 1; CddStp8899Com_aucSchedState[unIx] = 11; // end of table CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw = 0xAF; CddStp8899Com_DataMirror.CtrlRx.aCReg1[0].Bit.u4TRQ_DAC = 0x0Fu; CddStp8899Com_DataMirror.CtrlTx.aCReg1[0].Bit.u4TRQ_DAC = CddStp8899Com_DataMirror.CtrlRx.aCReg1[0].Bit.u4TRQ_DAC; CddStp8899Com_aucStReqSingle[unIx] = CDDSTP8899_SpiSt_Bit0; CddStp_UnitTestHelper_bo1 = TRUE; // Step2: call function CddStp8899Com_SpiRx(unIx, ulData); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 47, == ); // Step1: do some ini unIx = 0; CddStp88XX_ucNumOfSteppers_EFT = 1; CddStp88XX_eTypeOfStepper_LWR = CDDSTP88XX_Hw_e8889A; CddStp8899Com_aucSchedState[unIx] = 5; // Step2: call function CddStp8899Com_SpiRx(unIx, ulData); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 47, == ); // Step1: do some ini CddStp8899Com_aucSchedState[unIx] = 0; CddStp8899Com_DataMirror.CtrlTx.aCReg1[0].ucRaw = CddStp8899Com_DataMirror.CtrlRx.aCReg1[0].ucRaw; // Step2: call function CddStp8899Com_SpiRx(unIx, ulData); CddStp8899Com_SpiRx(unIx, ulData); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 47, == ); // Step1: do some ini CddStp8899Com_aucSchedState[unIx] = 0; CddStp8899Com_DataMirror.CtrlTx.aCReg1[0].ucRaw = CddStp8899Com_DataMirror.CtrlRx.aCReg1[0].ucRaw + 1; // Step2: call function CddStp8899Com_SpiRx(unIx, ulData); CddStp8899Com_SpiRx(unIx, ulData); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 47, == ); // Step1: do some ini CddStp8899Com_aucSchedState[unIx] = 35; CddStp8899Com_DataMirror.CtrlTx.aCReg3[0].ucRaw = CddStp8899Com_DataMirror.CtrlRx.aCReg3[0].ucRaw; // Step2: call function CddStp8899Com_SpiRx(unIx, ulData); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 47, == ); // Step1: do some ini CddStp8899Com_aucSchedState[unIx] = 1; CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; CddStp_Simulation_Data.bStallDtctn_WriteClrFltOnce = TRUE; CddStp88xx__LwrSleepAndDisable = TRUE; // Step2: call function CddStp8899Com_SpiRx(unIx, ulData); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 47, == ); // Step1: do some ini CddStp8899Com_aucSchedState[unIx] = 5; CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; CddStp_Simulation_Data.bStallDtctn_WriteStlLrn = TRUE; // Step2: call function CddStp8899Com_SpiRx(unIx, ulData); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 47, == ); // Step1: do some ini CddStp8899Com_aucSchedState[unIx] = 44; CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; CddStp_Simulation_Data.bStallDtctn_WriteCReg6Once = TRUE; // Step2: call function CddStp8899Com_SpiRx(unIx, ulData); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 47, == ); // Step1: do some ini CleanUp(); unIx = 2; CddStp88XX_ucNumOfSteppers_EFT = 2; // Step2: call function CddStp8899Com_SpiRx(unIx, ulData); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 47, == ); // Step1: do some ini unIx = 3; // Step2: call function CddStp8899Com_SpiRx(unIx, ulData); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegBasic[0].ucRaw, 47, == ); // Step4: Clean up CddStp88XX_ucNumOfSteppers_EFT = 1; CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_SpiTx(void) { // Step1: do some ini uint16 unIx = 0; // Step2: call function uint32 ulData = CddStp_SpiTx(unIx); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(ulData, 4096, == ); // Step1: do some ini unIx = 0xFF; // Step2: call function ulData = CddStp_SpiTx(unIx); // Step3: call check AL_UNITTEST_CHECK(ulData, 0, == ); // Step1: do some ini CleanUp(); unIx = 2; CddStp88XX_ucNumOfSteppers_EFT = 2; // Step2: call function ulData = CddStp_SpiTx(unIx); // Step3: call check AL_UNITTEST_CHECK(ulData, 0, != ); // Step2: call function ulData = CddStp_SpiTx(0); ulData = CddStp_SpiTx(1); ulData = CddStp_SpiTx(2); ulData = CddStp_SpiTx(3); ulData = CddStp_SpiTx(4); CddStp88XX_ucNumOfSteppers_EFT = 3; ulData = CddStp_SpiTx(0); CddStp88XX_ucNumOfSteppers_EFT = 4; ulData = CddStp_SpiTx(0); tStateCddStp88XX tmp = CddStp88XX_aeState[0]; CddStp88XX_aeState[0] = CddStp88XX_eStateErr; CddStp8899Com_DEBUG_Check_EnOl_DisOut(); CddStp88XX_aeState[0] = tmp; // Step4: Clean up CddStp88XX_ucNumOfSteppers_EFT = 1; CleanUp(); } typedef struct { uint32 ulRead; uint32 ulWrite; } tCddStp8899Com_DEBUG_StlLrn_Cntr; extern volatile tCddStp8899Com_DEBUG_StlLrn_Cntr CddStp8899Com_DEBUG_StlLrn_Cntr[6 + 1]; // 2x Ctrl-Reg (of totally '8') are only 'READ' extern volatile uint8 CddStp8899Com_DEBUG_StlLrn_Cntr__Cr5LastData; extern uint16 CddStp8899Com_SpiTx(uint16 unIx); extern uint16 CddStp8899Com_aunTxData[CFA_CNT_STP_88XX]; //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Com_SpiTx(void) { // Step1: do some ini uint16 unIx = 0; uint16 unResult; CddStp88XX_ucNumOfSteppers_EFT = 0; // Step2: call function unResult = CddStp8899Com_SpiTx(unIx); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(unResult, 0, == ); // Step1: do some ini CddStp88XX_ucNumOfSteppers_EFT = 1; // Step2: call function unResult = CddStp8899Com_SpiTx(unIx); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(unResult, 4096, == ); // Step1: do some ini CddStp88XX_ucNumOfSteppers_EFT = 2; // Step2: call function unResult = CddStp8899Com_SpiTx(unIx); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(unResult, 0, == ); // Step1: do some ini CddStp88XX_ucNumOfSteppers_EFT = 3; // Step2: call function unResult = CddStp8899Com_SpiTx(unIx); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(unResult, 36608, == ); // Step1: do some ini unIx = 1; // CddStp88XX_ucNumOfSteppers_EFT = 3; // Step2: call function unResult = CddStp8899Com_SpiTx(unIx); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(unResult, 2273, == ); // Step1: do some ini unIx = 2; // CddStp88XX_ucNumOfSteppers_EFT = 3; // Step2: call function unResult = CddStp8899Com_SpiTx(unIx); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(unResult, 1542, == ); // Step1: do some ini unIx = 3; // CddStp88XX_ucNumOfSteppers_EFT = 3; // Step2: call function unResult = CddStp8899Com_SpiTx(unIx); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(unResult, 33664, == ); // Step1: do some ini unIx = 4; // CddStp88XX_ucNumOfSteppers_EFT = 3; // Step2: call function unResult = CddStp8899Com_SpiTx(unIx); // Step3: call check AL_UNITTEST_CHECK(unResult, 0, == ); // Step1: do some ini #define DRV8899_rCR1_ (0x46u) // 'real'-Adr 3 #define DRV8899_rCR2_ (0x48u) // 'real'-Adr 4 #define DRV8899_rCR3_ (0x4Au) // 'real'-Adr 5 #define DRV8899_rCR4_ (0x4Cu) // 'real'-Adr 6 #define DRV8899_rCR5_ (0x4Eu) // 'real'-Adr 7 #define DRV8899_rCR6_ (0x50u) // 'real'-Adr 8 #define DRV8899_wCR1_ (0x06u) // 'real'-Adr 3 #define DRV8899_wCR2_ (0x08u) // 'real'-Adr 4 #define DRV8899_wCR3_ (0x0Au) // 'real'-Adr 5 #define DRV8899_wCR4_ (0x0Cu) // 'real'-Adr 6 #define DRV8899_wCR5_ (0x0Eu) // 'real'-Adr 7 #define DRV8899_wCR6_ (0x10u) // 'real'-Adr 8 CddStp88XX_ucNumOfSteppers_EFT = 1; for (unIx = 0; unIx < 7; unIx++) { CddStp8899Com_DEBUG_StlLrn_Cntr[unIx].ulWrite = 0; CddStp8899Com_DEBUG_StlLrn_Cntr[unIx].ulRead = 0; } unIx = 0; CddStp8899Com_aunTxData[0] = DRV8899_wCR1_ << 8; // Step2: call function unResult = CddStp8899Com_SpiTx(unIx); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DEBUG_StlLrn_Cntr[1].ulWrite, 1, == ); CddStp8899Com_aunTxData[0] = DRV8899_rCR1_ << 8; unResult = CddStp8899Com_SpiTx(unIx); CddStp8899Com_aunTxData[0] = DRV8899_rCR2_ << 8; unResult = CddStp8899Com_SpiTx(unIx); unResult = CddStp8899Com_SpiTx(unIx); CddStp8899Com_aunTxData[0] = DRV8899_wCR2_ << 8; unResult = CddStp8899Com_SpiTx(unIx); CddStp8899Com_aunTxData[0] = DRV8899_rCR3_ << 8; unResult = CddStp8899Com_SpiTx(unIx); CddStp8899Com_aunTxData[0] = DRV8899_wCR3_ << 8; unResult = CddStp8899Com_SpiTx(unIx); unResult = CddStp8899Com_SpiTx(unIx); CddStp8899Com_aunTxData[0] = DRV8899_rCR4_ << 8; unResult = CddStp8899Com_SpiTx(unIx); unResult = CddStp8899Com_SpiTx(unIx); CddStp8899Com_aunTxData[0] = DRV8899_wCR4_ << 8; unResult = CddStp8899Com_SpiTx(unIx); CddStp8899Com_aunTxData[0] = DRV8899_rCR5_ << 8; unResult = CddStp8899Com_SpiTx(unIx); CddStp8899Com_aunTxData[0] = DRV8899_wCR5_ << 8; unResult = CddStp8899Com_SpiTx(unIx); unResult = CddStp8899Com_SpiTx(unIx); CddStp8899Com_aunTxData[0] = DRV8899_rCR6_ << 8; unResult = CddStp8899Com_SpiTx(unIx); unResult = CddStp8899Com_SpiTx(unIx); CddStp8899Com_aunTxData[0] = DRV8899_wCR6_ << 8; unResult = CddStp8899Com_SpiTx(unIx); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DEBUG_StlLrn_Cntr[2].ulWrite, 1, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DEBUG_StlLrn_Cntr[2].ulRead, 2, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DEBUG_StlLrn_Cntr[3].ulWrite, 2, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DEBUG_StlLrn_Cntr[3].ulRead, 1, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DEBUG_StlLrn_Cntr[4].ulWrite, 1, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DEBUG_StlLrn_Cntr[4].ulRead, 2, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DEBUG_StlLrn_Cntr[5].ulWrite, 2, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DEBUG_StlLrn_Cntr[5].ulRead, 1, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DEBUG_StlLrn_Cntr[6].ulWrite, 1, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8899Com_DEBUG_StlLrn_Cntr[6].ulRead, 2, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_GetStpConfigMask(void) { // Step1: do some ini uint16 unData = 123; // Step2: call function // boolean CddStp_GetStpConfigMask(uint16* punData); (void)CddStp_GetStpConfigMask(&unData); // Step3: call check AL_UNITTEST_CHECK(unData, 1, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_GetStpConfig(void) { // Step1: do some ini uint16 unData = 123; uint8 ucNumOfStp = 99; // CddTps92520: Test_Eft_EcuVarCfg()[0].ucDrvType = 0; CddStp_UnitTest__tieEftData[0].ucType = 1; // size: '3' CddStp_UnitTest__tieEftData[1].ucType = 1; // size: '3' CddStp_UnitTest__tieEftData[2].ucType = 1; // size: '3' Test_Eft_EcuVarCfg_Used[0].ucType = CDDSTP88XX_Hw_e8899; Test_Eft_EcuVarCfg_Used[1].ucType = CDDSTP88XX_Hw_eUnknown; CddStp_UnitTest__EftDataStatus = tieDataStatus_Invalid; // Step2: call function // boolean CddStp_GetStpConfig(uint16* punData, uint8* pucNumOfStp); (void)CddStp_GetStpConfig(&unData, &ucNumOfStp); // Step3: call check AL_UNITTEST_CHECK(unData, 0, == ); AL_UNITTEST_CHECK(ucNumOfStp, 0, == ); // Step1: do some ini unData = 123; ucNumOfStp = 99; CddStp_UnitTest__EftDataStatus = tieDataStatus_Valid; // Step2: call function (void)CddStp_GetStpConfig(&unData, &ucNumOfStp); // Step3: call check AL_UNITTEST_CHECK(unData, 1, == ); AL_UNITTEST_CHECK(ucNumOfStp, 1 , == ); // Step1: do some ini unData = 123; ucNumOfStp = 99; Test_Eft_EcuVarCfg_Used[1].ucType = CDDSTP88XX_Hw_e8889A; // Step2: call function (void)CddStp_GetStpConfig(&unData, &ucNumOfStp); // Step3: call check AL_UNITTEST_CHECK(unData, 0x07, == ); // 7 = '0000.0111' AL_UNITTEST_CHECK(ucNumOfStp, 2, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Com_GetSRegBsc(void) { // Step1: do some ini tCddStp8899Com_StatReg_Basic CddStp88XX_aSRegBasic[CFA_CNT_STP_88XX]; uint8 ucIx = 0; // Step2: call function (void)CddStp8899Com_GetSRegBsc(ucIx, &CddStp88XX_aSRegBasic[ucIx].ucRaw); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Com_GetSRegFlt(void) { // Step1: do some ini tCddStp8899Com_StatReg_Fault CddStp88XX_aSRegFault[CFA_CNT_STP_88XX]; uint8 ucIx = 0; // Step2: call function (void)CddStp8899Com_GetSRegFlt(ucIx, &CddStp88XX_aSRegFault[ucIx].ucRaw); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Com_GetSRegDiag1(void) { // Step1: do some ini tCddStp8899Com_StatReg_Diag1 CddStp88XX_aSRegDiag1[CFA_CNT_STP_88XX]; uint8 ucIx = 0; // Step2: call function (void)CddStp8899Com_GetSRegDiag1(ucIx, &CddStp88XX_aSRegDiag1[ucIx].ucRaw); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Com_GetSRegDiag2(void) { // Step1: do some ini tCddStp8899Com_StatReg_Diag2 CddStp88XX_aSRegDiag2[CFA_CNT_STP_88XX]; uint8 ucIx = 0; // Step2: call function // not used: (void)CddStp8899Com_GetSRegDiag2(ucIx, &CddStp88XX_aSRegDiag2[ucIx].ucRaw); // Step3: call check // AL_UNITTEST_CHECK(TRUE, TRUE, ==); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Com_GetSRegDiag12(void) { // Step1: do some ini //boolean CddStp8899Com_GetSRegBscFltDiag12(uint8 ucIx, uint8* pucSRegBsc, uint8* pucSRegFlt, uint8* pucSRegDiag1, uint8* pucSRegDiag2); tCddStp8899Com_StatReg_Diag1 CddStp88XX_aSRegDiag1[CFA_CNT_STP_88XX]; tCddStp8899Com_StatReg_Diag2 CddStp88XX_aSRegDiag2[CFA_CNT_STP_88XX]; uint8 ucIx = 0; // Step2: call function (void)CddStp8899Com_GetSRegDiag12(ucIx, &CddStp88XX_aSRegDiag1[ucIx].ucRaw, &CddStp88XX_aSRegDiag2[ucIx].ucRaw); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Com_GetSRegFltDiag2(void) { // Step1: do some ini //boolean CddStp8899Com_GetSRegBscFltDiag12(uint8 ucIx, uint8* pucSRegBsc, uint8* pucSRegFlt, uint8* pucSRegDiag1, uint8* pucSRegDiag2); tCddStp8899Com_StatReg_Basic CddStp88XX_aSRegBasic[CFA_CNT_STP_88XX]; tCddStp8899Com_StatReg_Fault CddStp88XX_aSRegFault[CFA_CNT_STP_88XX]; tCddStp8899Com_StatReg_Diag1 CddStp88XX_aSRegDiag1[CFA_CNT_STP_88XX]; tCddStp8899Com_StatReg_Diag2 CddStp88XX_aSRegDiag2[CFA_CNT_STP_88XX]; uint8 ucIx = 0; // Step2: call function (void)CddStp8899Com_GetSRegFltDiag2(ucIx, &CddStp88XX_aSRegFault[ucIx].ucRaw, &CddStp88XX_aSRegDiag2[ucIx].ucRaw); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Com_GetSRegBscFltDiag12(void) { // Step1: do some ini //boolean CddStp8899Com_GetSRegBscFltDiag12(uint8 ucIx, uint8* pucSRegBsc, uint8* pucSRegFlt, uint8* pucSRegDiag1, uint8* pucSRegDiag2); tCddStp8899Com_StatReg_Basic CddStp88XX_aSRegBasic[CFA_CNT_STP_88XX]; tCddStp8899Com_StatReg_Fault CddStp88XX_aSRegFault[CFA_CNT_STP_88XX]; tCddStp8899Com_StatReg_Diag1 CddStp88XX_aSRegDiag1[CFA_CNT_STP_88XX]; tCddStp8899Com_StatReg_Diag2 CddStp88XX_aSRegDiag2[CFA_CNT_STP_88XX]; uint8 ucIx = 0; // Step2: call function (void)CddStp8899Com_GetSRegBscFltDiag12(ucIx, &CddStp88XX_aSRegBasic[ucIx].ucRaw , &CddStp88XX_aSRegFault[ucIx].ucRaw , &CddStp88XX_aSRegDiag1[ucIx].ucRaw , &CddStp88XX_aSRegDiag2[ucIx].ucRaw); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); } extern boolean CddStp8899Com_CheckSpiComSt0(tCddSpiL2Channel SpiL2Channel); uint8 CddStp8899Com_aucCheckDrvDefectCnt[CFA_CNT_STP_88XX]; #define CDDSTP8899_CHECKDRVDEFECT_MAX (83u) #define CDDSTP8899_VBATSDrvDefect (5500u) // [mV] VBATS < 2.5 V but 5.5 V because of 2 ms SysVolt average - DRV88XX specific // Handle Pre-Evaluation Stall-Detection extern uint8 CddStp8899Com_PreEvalStallDtctn_ucSTALL_TH; extern boolean CddStp8899Com_StallDtctn_CR7_bIsNewValue; // Stall-Debug // extern volatile tCddStp8899Com_DEBUG_StlLrn_Cntr CddStp8899Com_DEBUG_StlLrn_Cntr[6 + 1]; // 2x Ctrl-Reg (of totally '8') are only 'READ' // extern volatile uint8 CddStp8899Com_DEBUG_StlLrn_Cntr__Cr5LastData; //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Com_CheckSpiComSt0(void) { // Step1: do some ini tCddSpiL2Channel SpiL2Channel = 0; boolean boResult; CddStp8899Com_DataMirror.StatRx.aSRegBasic[SpiL2Channel].ucRaw = 0; // ... != CDDSTP8899_SRBValVBATSDD) CddStp8899Com_DataMirror.StatRx.aSRegFault[SpiL2Channel].ucRaw = 0; // ... != CDDSTP8899_RegValVBATSDD) CddStp8899Com_DataMirror.StatRx.aSRegDiag1[SpiL2Channel].ucRaw = 0; // ... != CDDSTP8899_RegValVBATSDD) CddStp8899Com_DataMirror.StatRx.aSRegDiag2[SpiL2Channel].ucRaw = 0; // ... != CDDSTP8899_RegValVBATSDD) CddStp_Simulation_Data.ucSim_SPI_ERROR_SpiProtocolError = TRUE; // boSim_SPI_ERROR_SpiProtocolError... CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; CddStp88XX_aStpCtrl[SpiL2Channel].Bit.On = 1u; CddStp8899Com_aucCheckDrvDefectCnt[SpiL2Channel] = CDDSTP8899_CHECKDRVDEFECT_MAX; CddStp88XX_aucCheckDrvDefectCnt[SpiL2Channel] = CDDSTP8899_CHECKDRVDEFECT_MAX; // Step2: call function boResult = CddStp8899Com_CheckSpiComSt0(SpiL2Channel); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegFault[SpiL2Channel].Bit.u1SPI_ERROR, TRUE, == ); // Step1: do some ini CddStp8899Com_aucCheckDrvDefectCnt[SpiL2Channel] = 0; CddStp88XX_aucCheckDrvDefectCnt[SpiL2Channel] = 0; // Step2: call function boResult = CddStp8899Com_CheckSpiComSt0(SpiL2Channel); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegFault[SpiL2Channel].Bit.u1SPI_ERROR, TRUE, == ); // Step1: do some ini CddStp88XX_aStpCtrl[SpiL2Channel].Bit.On = 0; // Step2: call function boResult = CddStp8899Com_CheckSpiComSt0(SpiL2Channel); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegFault[SpiL2Channel].Bit.u1SPI_ERROR, TRUE, == ); // Step1: do some ini CddStp8899Com_DataMirror.StatRx.aSRegBasic[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatRx.aSRegFault[SpiL2Channel].ucRaw = 0; // ... != CDDSTP8899_RegValVBATSDD) CddStp8899Com_DataMirror.StatRx.aSRegDiag1[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatRx.aSRegDiag2[SpiL2Channel].ucRaw = 0; // ... != CDDSTP8899_RegValVBATSDD) CddStp_Simulation_Data.ucSim_SPI_ERROR_SpiProtocolError = FALSE; // boSim_SPI_ERROR_SpiProtocolError... CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_DEACTIVATED; CddStp8899Com_DataMirror.StatRx.aSRegFault[SpiL2Channel].Bit.u1SPI_ERROR = TRUE; // Step2: call function boResult = CddStp8899Com_CheckSpiComSt0(SpiL2Channel); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegFault[SpiL2Channel].Bit.u1SPI_ERROR, TRUE, == ); // Step1: do some ini CddStp8899Com_DataMirror.StatRx.aSRegBasic[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatRx.aSRegFault[SpiL2Channel].ucRaw = 0; // ... != CDDSTP8899_RegValVBATSDD) CddStp8899Com_DataMirror.StatRx.aSRegDiag1[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatRx.aSRegDiag2[SpiL2Channel].ucRaw = 0; // ... != CDDSTP8899_RegValVBATSDD) CddStp8899Com_DataMirror.StatRx.aSRegFault[SpiL2Channel].Bit.u1SPI_ERROR = FALSE; CddStp8899Com_DataMirror.CtrlRx.aCReg1[SpiL2Channel].Bit.u4TRQ_DAC = 6u; CddStp8899Com_DataMirror.CtrlTx.aCReg1[SpiL2Channel].Bit.u4TRQ_DAC = CddStp8899Com_DataMirror.CtrlRx.aCReg1[SpiL2Channel].Bit.u4TRQ_DAC; CddStp8899Com_StallDtctn_CR7_bIsNewValue = TRUE; // Step2: call function boResult = CddStp8899Com_CheckSpiComSt0(SpiL2Channel); // Step3: call check AL_UNITTEST_CHECK(boResult, FALSE, == ); AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatRx.aSRegFault[SpiL2Channel].Bit.u1SPI_ERROR, FALSE, == ); // Step1: do some ini CddStp8899Com_DataMirror.StatRx.aSRegBasic[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatRx.aSRegFault[SpiL2Channel].ucRaw = 0; // ... != CDDSTP8899_RegValVBATSDD) CddStp8899Com_DataMirror.StatRx.aSRegDiag1[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatRx.aSRegDiag2[SpiL2Channel].ucRaw = 0; // ... != CDDSTP8899_RegValVBATSDD) CddStp8899Com_DataMirror.CtrlTx.aCReg1[SpiL2Channel].Bit.u4TRQ_DAC = CddStp8899Com_DataMirror.CtrlRx.aCReg1[SpiL2Channel].Bit.u4TRQ_DAC + 1; CddStp88XX_aucCheckDrvDefectCnt[SpiL2Channel] = CDDSTP8899_CHECKDRVDEFECT_MAX; CddStp_UnitTest__u32Voltage_mV = CDDSTP8899_VBATSDrvDefect + 1; CddStp88XX_aStpCtrl[SpiL2Channel].Bit.On = 1; CddStp8899Com_DataMirror.CtrlRx.aCReg1[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.CtrlRx.aCReg2[SpiL2Channel].ucRaw = 0; // Step2: call function boResult = CddStp8899Com_CheckSpiComSt0(SpiL2Channel); // Step3: call check AL_UNITTEST_CHECK(boResult, TRUE, == ); AL_UNITTEST_CHECK(CddStp8899Com_aucCheckDrvDefectCnt[SpiL2Channel], 0, == ); // Step1: do some ini CddStp88XX_aucCheckDrvDefectCnt[SpiL2Channel] = CDDSTP8899_CHECKDRVDEFECT_MAX; CddStp_UnitTest__u32Voltage_mV = CDDSTP8899_VBATSDrvDefect - 1; // Step2: call function boResult = CddStp8899Com_CheckSpiComSt0(SpiL2Channel); // Step3: call check AL_UNITTEST_CHECK(boResult, TRUE, == ); AL_UNITTEST_CHECK(CddStp8899Com_aucCheckDrvDefectCnt[SpiL2Channel], 0, == ); // Step1: do some ini CddStp8899Com_DataMirror.StatRx.aSRegBasic[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatRx.aSRegFault[SpiL2Channel].ucRaw = 0; // ... != CDDSTP8899_RegValVBATSDD) CddStp8899Com_DataMirror.StatRx.aSRegDiag1[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatRx.aSRegDiag2[SpiL2Channel].ucRaw = 0; // ... != CDDSTP8899_RegValVBATSDD) CddStp_UnitTest__u32Voltage_mV = 13500; CddStp88XX_aStpCtrl[SpiL2Channel].Bit.On = 0; // Step2: call function boResult = CddStp8899Com_CheckSpiComSt0(SpiL2Channel); // Step3: call check AL_UNITTEST_CHECK(boResult, TRUE, == ); AL_UNITTEST_CHECK(CddStp8899Com_aucCheckDrvDefectCnt[SpiL2Channel], 0, == ); // Step1: do some ini CddStp8899Com_DataMirror.StatRx.aSRegBasic[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatRx.aSRegFault[SpiL2Channel].ucRaw = 0; // ... != CDDSTP8899_RegValVBATSDD) CddStp8899Com_DataMirror.StatRx.aSRegDiag1[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatRx.aSRegDiag2[SpiL2Channel].ucRaw = 0; // ... != CDDSTP8899_RegValVBATSDD) CddStp_UnitTest__u32Voltage_mV = 13500; CddStp88XX_aStpCtrl[SpiL2Channel].Bit.On = 1; CddStp8899Com_aucCheckDrvDefectCnt[SpiL2Channel] = CDDSTP8899_CHECKDRVDEFECT_MAX; // Step2: call function boResult = CddStp8899Com_CheckSpiComSt0(SpiL2Channel); // Step3: call check AL_UNITTEST_CHECK(boResult, TRUE, == ); AL_UNITTEST_CHECK(CddStp8899Com_aucCheckDrvDefectCnt[SpiL2Channel], CDDSTP8899_CHECKDRVDEFECT_MAX, == ); // Step4: Clean up CddStp8899Com_aucCheckDrvDefectCnt[SpiL2Channel] = 0; CleanUp(); } extern void CddStp8899Com_Simulation_HandleSpiRxStatusBits(tCddSpiL2Channel SpiL2Channel, const boolean *pboSim_DriverDefect, const boolean *pboSim_UVLO_UnderVoltageLockout, const boolean *pboSim_CPUV_ChargePumpUndervoltage, const boolean *pboSim_OCP_OverCurrentProtection, const boolean *pboSim_OL_OpenLoad, const boolean *pboSim_OTW_OverThermalWarning, const boolean *pboSim_OTS_OverTemperatureShutdown, const boolean *pboSim_UTW_UnderTemperatureWarning); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Com_Simulation_HandleSpiRxStatusBits(void) { // Step1: do some ini uint8 ucIx = 0; tCddSpiL2Channel SpiL2Channel = ucIx; boolean boSim_DriverDefect = TRUE; boolean boSim_UVLO_UnderVoltageLockout = FALSE; boolean boSim_CPUV_ChargePumpUndervoltage = FALSE; boolean boSim_OCP_OverCurrentProtection = FALSE; boolean boSim_OL_OpenLoad = FALSE; boolean boSim_OTW_OverThermalWarning = FALSE; boolean boSim_OTS_OverTemperatureShutdown = FALSE; boolean boSim_UTW_UnderTemperatureWarning = FALSE; CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_DEACTIVATED; CddStp88XX_aStpState[SpiL2Channel].ulData = 0; CddStp8899Com_DataMirror.StatvRx.aSRegBasic[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegFault[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegDiag1[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[SpiL2Channel].ucRaw = 0; // Step2: call function CddStp8899Com_Simulation_HandleSpiRxStatusBits(SpiL2Channel, &boSim_DriverDefect, &boSim_UVLO_UnderVoltageLockout, &boSim_CPUV_ChargePumpUndervoltage, &boSim_OCP_OverCurrentProtection, &boSim_OL_OpenLoad, &boSim_OTW_OverThermalWarning, &boSim_OTS_OverTemperatureShutdown, &boSim_UTW_UnderTemperatureWarning); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[SpiL2Channel].Bit.ErrSpiError, FALSE, == ); // Step1: do some ini boSim_DriverDefect = TRUE; CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; CddStp88XX_aStpState[SpiL2Channel].ulData = 0; CddStp8899Com_DataMirror.StatvRx.aSRegBasic[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegFault[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegDiag1[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[SpiL2Channel].ucRaw = 0; // Step2: call function CddStp8899Com_Simulation_HandleSpiRxStatusBits(SpiL2Channel, &boSim_DriverDefect, &boSim_UVLO_UnderVoltageLockout, &boSim_CPUV_ChargePumpUndervoltage, &boSim_OCP_OverCurrentProtection, &boSim_OL_OpenLoad, &boSim_OTW_OverThermalWarning, &boSim_OTS_OverTemperatureShutdown, &boSim_UTW_UnderTemperatureWarning); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[SpiL2Channel].Bit.ErrSpiError, TRUE, == ); // Step1: do some ini boSim_DriverDefect = FALSE; boSim_UVLO_UnderVoltageLockout = TRUE; CddStp8899Com_DataMirror.StatvRx.aSRegBasic[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegFault[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegDiag1[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[SpiL2Channel].ucRaw = 0; // Step2: call function CddStp8899Com_Simulation_HandleSpiRxStatusBits(SpiL2Channel, &boSim_DriverDefect, &boSim_UVLO_UnderVoltageLockout, &boSim_CPUV_ChargePumpUndervoltage, &boSim_OCP_OverCurrentProtection, &boSim_OL_OpenLoad, &boSim_OTW_OverThermalWarning, &boSim_OTS_OverTemperatureShutdown, &boSim_UTW_UnderTemperatureWarning); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[SpiL2Channel].Bit.ErrSpiError, TRUE, == ); AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatvRx.aSRegBasic[SpiL2Channel].Bit.u1UVLO, TRUE, == ); // Step1: do some ini boSim_CPUV_ChargePumpUndervoltage = TRUE; boSim_UVLO_UnderVoltageLockout = FALSE; CddStp8899Com_DataMirror.StatvRx.aSRegBasic[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegFault[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegDiag1[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[SpiL2Channel].ucRaw = 0; // Step2: call function CddStp8899Com_Simulation_HandleSpiRxStatusBits(SpiL2Channel, &boSim_DriverDefect, &boSim_UVLO_UnderVoltageLockout, &boSim_CPUV_ChargePumpUndervoltage, &boSim_OCP_OverCurrentProtection, &boSim_OL_OpenLoad, &boSim_OTW_OverThermalWarning, &boSim_OTS_OverTemperatureShutdown, &boSim_UTW_UnderTemperatureWarning); // Step3: call check AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatvRx.aSRegBasic[SpiL2Channel].Bit.u1CPUV, TRUE, == ); AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatvRx.aSRegBasic[SpiL2Channel].Bit.u1UVLO, FALSE, == ); // Step1: do some ini boSim_CPUV_ChargePumpUndervoltage = FALSE; boSim_OCP_OverCurrentProtection = TRUE; boSim_OL_OpenLoad = TRUE; boSim_OTW_OverThermalWarning = TRUE; boSim_OTS_OverTemperatureShutdown = TRUE; boSim_UTW_UnderTemperatureWarning = TRUE; CddStp8899Com_DataMirror.StatvRx.aSRegBasic[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegFault[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegDiag1[SpiL2Channel].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[SpiL2Channel].ucRaw = 0; // Step2: call function CddStp8899Com_Simulation_HandleSpiRxStatusBits(SpiL2Channel, &boSim_DriverDefect, &boSim_UVLO_UnderVoltageLockout, &boSim_CPUV_ChargePumpUndervoltage, &boSim_OCP_OverCurrentProtection, &boSim_OL_OpenLoad, &boSim_OTW_OverThermalWarning, &boSim_OTS_OverTemperatureShutdown, &boSim_UTW_UnderTemperatureWarning); // Step3: call check AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatvRx.aSRegBasic[SpiL2Channel].Bit.u1CPUV, FALSE, == ); AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatvRx.aSRegBasic[SpiL2Channel].Bit.u1OCP, TRUE, == ); AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatvRx.aSRegBasic[SpiL2Channel].Bit.u1OL, TRUE, == ); AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[SpiL2Channel].Bit.u1OTW, TRUE, == ); AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[SpiL2Channel].Bit.u1OTS, TRUE, == ); AL_UNITTEST_CHECK(CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[SpiL2Channel].Bit.u1OTW, TRUE, == ); // Step4: Clean up CleanUp(); } // ************* CddStp8899Temp.c **************************** // void CddStp8899Temp_CheckLowTemp(void); // void CddStp88XXTemp_StateMachine(uint8 ucIx, const tCommandCddStp88XX eCmd); // STATIC_AL uint32 CddStp8899Temp_TransitionInitNorm(uint8 ucIx, const tCommandCddStp88XX eCmd); // STATIC_AL uint32 CddStp8899Temp_TransitionNormLow(uint8 ucIx, const tCommandCddStp88XX eCmd); // STATIC_AL uint32 CddStp8899Temp_TransitionNormHigh(uint8 ucIx, const tCommandCddStp88XX eCmd); // STATIC_AL uint32 CddStp8899Temp_TransitionLowNorm(uint8 ucIx, const tCommandCddStp88XX eCmd); // STATIC_AL uint32 CddStp8899Temp_TransitionHighNorm(uint8 ucIx, const tCommandCddStp88XX eCmd); // STATIC_AL uint32 CddStp8899Temp_TransitionLowHigh(uint8 ucIx, const tCommandCddStp88XX eCmd); // STATIC_AL void CddStp8899Temp_StateFctInit(uint8 ucIx, tAction Action); // STATIC_AL void CddStp8899Temp_StateFctNorm(uint8 ucIx, tAction Action); // STATIC_AL void CddStp8899Temp_StateFctLow(uint8 ucIx, tAction Action); // STATIC_AL void CddStp8899Temp_StateFctHigh(uint8 ucIx, tAction Action); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Temp_CheckLowTemp(void) { // Step1: do some ini CleanUp(); CddStp_ActAll.sLwrActual.sStatusError.eStatSupported = (tieSupportInfo)SUPPORT_YES; // depends on PAV/EFT & Coding and on validity of them CddStpDyn_UnitTest___tCodingAreaSys_STP_QUELLE_TT = 17u; // PCB-Temperature? (N.b.: Future use will be probably 0 or 1 or 2 !!!) CddStp88XX_aBits[0].Bit.biLT = 1; CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; // Step2: call function CddStp8899Temp_CheckLowTemp(); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBits[0].Bit.biLT, 0, == ); // Step1: do some ini CddStpDyn_UnitTest___tCodingAreaSys_STP_QUELLE_TT = 24u; // PCB-Temperature? (N.b.: Future use will be probably 0 or 1 or 2 !!!) CddStp88XX_aBits[0].Bit.biLT = 1; CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; // Step2: call function CddStp8899Temp_CheckLowTemp(); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBits[0].Bit.biLT, 0, == ); // Step1: do some ini CddStpDyn_UnitTest___tCodingAreaSys_STP_QUELLE_TT = 16u; // PCB-Temperature? (N.b.: Future use will be probably 0 or 1 or 2 !!!) CddStp88XX_aBits[0].Bit.biLT = 1; CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_DEACTIVATED; CddStp_tCodingAreaSys.STP_WERT_TT = 65; // orig.: '33' - CddStpDyn_UnitTest___tCodingAreaSys_STP_WERT_TT?? CDDSTP_ApplCodData_Sys.Stp_LowTempModeThreshold = 65; CddStp_UnitTest__SensPcbTemperature0_lActual = 23450; // 23,45°C = '23450' - orig.: '0' // Step2: call function CddStp8899Temp_CheckLowTemp(); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp88XX_aBits[0].Bit.biLT, 1, == ); // Step4: Clean up CddStp_tCodingAreaSys.STP_WERT_TT = 33; CDDSTP_ApplCodData_Sys.Stp_LowTempModeThreshold = 33; CddStp_UnitTest__SensPcbTemperature0_lActual = 0; // Step1: do some ini CddStp_ActAll.sLwrActual.sStatusError.eStatSupported = (tieSupportInfo)SUPPORT_UNKNOWN; // check 'else' CddStp88XX_aBits[0].Bit.biLT = 1; // Step2: call function CddStp8899Temp_CheckLowTemp(); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBits[0].Bit.biLT, 1, == ); // Step4: Clean up CddStp_ActAll.sLwrActual.sStatusError.eStatSupported = (tieSupportInfo)SUPPORT_YES; // depends on PAV/EFT & Coding and on validity of them CddStp88XX_aBits[0].Bit.biLT = 0; CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XXTemp_StateMachine(void) { // Step1: do some ini const uint8 ucIx = 0; const tCommandCddStp88XX eCmd = CddStp88XX_eCmdInit; CddStp88XX_aeTempState[ucIx] = CddStp88XX_eStateTempLow; // = '2' -> 'eStateBegin' CddStp_UnitTest_Printf("\n"); // simple line-feed for additional Debug-Output // Step2: call function CddStp88XXTemp_StateMachine(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aeTempState[ucIx], CddStp88XX_eStateTempNorm, == ); CddStp_UnitTest_Printf(" ... "); // shift the following 'passed' a little bit to the right } extern uint32 CddStp8899Temp_TransitionInitNorm(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp8899Temp_TransitionNormLow(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp8899Temp_TransitionNormHigh(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp8899Temp_TransitionLowNorm(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp8899Temp_TransitionHighNorm(uint8 ucIx, const tCommandCddStp88XX eCmd); extern uint32 CddStp8899Temp_TransitionLowHigh(uint8 ucIx, const tCommandCddStp88XX eCmd); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Temp_TransitionInitNorm(void) { CddStp_UnitTest_Printf("\n"); // nice formatting if 'CDDSTP_UNIT_TEST_DEBUGGING' is set // Step1: do some ini const uint8 ucIx = 0; const tCommandCddStp88XX eCmd = CddStp88XX_eCmdInit; uint32 ulRet = 0; // Step2: call function ulRet = CddStp8899Temp_TransitionInitNorm(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulRet, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Temp_TransitionNormLow(void) { CddStp_UnitTest_Printf("\n"); // nice formatting if 'CDDSTP_UNIT_TEST_DEBUGGING' is set // Step1: do some ini const uint8 ucIx = 0; const tCommandCddStp88XX eCmd = CddStp88XX_eCmdCtrl; CddStp88XX_aBitsMod[ucIx].Bit.biLockLT = 0; uint32 ulRet = 0; // Step2: call function ulRet = CddStp8899Temp_TransitionNormLow(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulRet, FALSE, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biLockLT = 1; // Step2: call function ulRet = CddStp8899Temp_TransitionNormLow(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulRet, FALSE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Temp_TransitionNormHigh(void) { CddStp_UnitTest_Printf("\n"); // nice formatting if 'CDDSTP_UNIT_TEST_DEBUGGING' is set // Step1: do some ini const uint8 ucIx = 0; const tCommandCddStp88XX eCmd = CddStp88XX_eCmdCtrl; uint32 ulRet = 0; CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[ucIx].Bit.u1OTW = 0; // Step2: call function ulRet = CddStp8899Temp_TransitionNormHigh(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulRet, FALSE, == ); // Step1: do some ini CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[ucIx].Bit.u1OTW = 1; // Step2: call function ulRet = CddStp8899Temp_TransitionNormHigh(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulRet, TRUE, == ); } extern tFTimer CddStp88XX_astWaitDurLT[]; //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Temp_TransitionLowNorm(void) { CddStp_UnitTest_Printf("\n"); // nice formatting if 'CDDSTP_UNIT_TEST_DEBUGGING' is set // Step1: do some ini const uint8 ucIx = 0; const tCommandCddStp88XX eCmd = CddStp88XX_eCmdCtrl; uint32 ulRet = 0; CddStp88XX_aBitsMod[ucIx].Bit.biWaitDurLT = 0; CddStp_UnitTest__GptTickCount = 0; CddStp_ActAll.sLwrActual.sStatusError.eStatSupported = (tieSupportInfo)SUPPORT_YES; // Step2: call function ulRet = CddStp8899Temp_TransitionLowNorm(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulRet, TRUE, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biWaitDurLT = 1; CddStp_UnitTest__GptTickCount = 123; CddStp88XX_aBitsMod[ucIx].Bit.biWaitVoltage = 0u; // Step2: call function ulRet = CddStp8899Temp_TransitionLowNorm(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulRet, FALSE, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biWaitDurLT = 1; // timeout: CddStp_UnitTest__GptTickCount = 5; CddStp88XX_astWaitDurLT[ucIx] = 0; // Step2: call function ulRet = CddStp8899Temp_TransitionLowNorm(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulRet, TRUE, == ); // Step1: do some ini CddStp_ActAll.sLwrActual.sStatusError.eStatSupported = (tieSupportInfo)SUPPORT_UNKNOWN; // Step2: call function ulRet = CddStp8899Temp_TransitionLowNorm(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulRet, TRUE, == ); CddStp_ActAll.sLwrActual.sStatusError.eStatSupported = (tieSupportInfo)SUPPORT_YES; } extern tFTimer CddStp88XX_astWaitMinHT[]; //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Temp_TransitionHighNorm(void) { CddStp_UnitTest_Printf("\n"); // nice formatting if 'CDDSTP_UNIT_TEST_DEBUGGING' is set // Step1: do some ini const uint8 ucIx = 0; const tCommandCddStp88XX eCmd = CddStp88XX_eCmdCtrl; uint32 ulRet = 0; CddStp88XX_aBitsMod[ucIx].Bit.biWaitMinHT = 0; CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[ucIx].Bit.u1OTW = 1; CddStp88XX_aBitsMod[ucIx].Bit.biWaitMinHT = 0; CddStp_UnitTest__GptTickCount = 0; // Step2: call function ulRet = CddStp8899Temp_TransitionHighNorm(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulRet, FALSE, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biWaitMinHT = 1; CddStp_UnitTest__GptTickCount = 0; CddStp88XX_astWaitMinHT[ucIx] = 5; // Step2: call function ulRet = CddStp8899Temp_TransitionHighNorm(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulRet, FALSE, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biWaitMinHT = 1; // timeout: CddStp_UnitTest__GptTickCount = 5; CddStp88XX_astWaitMinHT[ucIx] = 0; CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[ucIx].Bit.u1OTW = 0; // Step2: call function ulRet = CddStp8899Temp_TransitionHighNorm(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulRet, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Temp_TransitionLowHigh(void) { CddStp_UnitTest_Printf("\n"); // nice formatting if 'CDDSTP_UNIT_TEST_DEBUGGING' is set // Step1: do some ini const uint8 ucIx = 0; const tCommandCddStp88XX eCmd = CddStp88XX_eCmdCtrl; uint32 ulRet = 0; // Step2: call function ulRet = CddStp8899Temp_TransitionLowHigh(ucIx, eCmd); // Step3: call check AL_UNITTEST_CHECK(ulRet, FALSE, == ); } extern void CddStp8899Temp_StateFctInit(uint8 ucIx, tAction Action); extern void CddStp8899Temp_StateFctNorm(uint8 ucIx, tAction Action); extern void CddStp8899Temp_StateFctLow(uint8 ucIx, tAction Action); extern void CddStp8899Temp_StateFctHigh(uint8 ucIx, tAction Action); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Temp_StateFctInit(void) { // Step1: do some ini const uint8 ucIx = 0; tAction action = ActEntry; // Step2: call function CddStp8899Temp_StateFctInit(ucIx, action); // Step3: call check // tbd: yet nothing to check // Step1: do some ini action = ActDo; // Step2: call function CddStp8899Temp_StateFctInit(ucIx, action); // Step3: call check // tbd: yet nothing to check // Step1: do some ini action = ActExit; // Step2: call function CddStp8899Temp_StateFctInit(ucIx, action); // Step3: call check // tbd: yet nothing to check // Step1: do some ini action = 255; // Step2: call function CddStp8899Temp_StateFctInit(ucIx, action); // Step3: call check // tbd: yet nothing to check } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Temp_StateFctNorm(void) { // Step1: do some ini const uint8 ucIx = 0; tAction action = ActEntry; CddStp88XX_aeTemp[ucIx] = CddStp_eTempState_LowTemp; // Step2: call function CddStp8899Temp_StateFctNorm(ucIx, action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aeTemp[ucIx], CddStp_eTempState_NormTemp, == ); // Step1: do some ini action = ActDo; CddStp88XX_aBitsMod[ucIx].Bit.biExitLT = 1; // Step2: call function CddStp8899Temp_StateFctNorm(ucIx, action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biExitLT, 0, == ); // Step1: do some ini action = 255; CddStp88XX_aBitsMod[ucIx].Bit.biExitLT = 1; // Step2: call function CddStp8899Temp_StateFctNorm(ucIx, action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biExitLT, 1, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Temp_StateFctLow(void) { // Step1: do some ini const uint8 ucIx = 0; tAction action = ActEntry; CddStp88XX_aeTemp[ucIx] = CddStp_eTempState_NormTemp; // Step2: call function CddStp8899Temp_StateFctLow(ucIx, action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aeTemp[ucIx], CddStp_eTempState_LowTemp, == ); // Step1: do some ini action = ActExit; CddStp88XX_aBitsMod[ucIx].Bit.biExitLT = 0; // Step2: call function CddStp8899Temp_StateFctLow(ucIx, action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biExitLT, 1, == ); // Step1: do some ini action = 255; CddStp88XX_aBitsMod[ucIx].Bit.biExitLT = 0; // Step2: call function CddStp8899Temp_StateFctLow(ucIx, action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biExitLT, 0, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp8899Temp_StateFctHigh(void) { // Step1: do some ini const uint8 ucIx = 0; tAction action = ActEntry; CddStp88XX_aeTemp[ucIx] = CddStp_eTempState_NormTemp; CddStp88XX_aBitsMod[ucIx].Bit.biWaitErrPrealarm = 0; // Step2: call function CddStp8899Temp_StateFctHigh(ucIx, action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aeTemp[ucIx], CddStp_eTempState_HighTemp, == ); AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biWaitErrPrealarm, 1, == ); // Step1: do some ini action = ActDo; CddStp88XX_aBitsMod[ucIx].Bit.biWaitErrPrealarm = 0; CddStp88XX_aBitsMod[ucIx].Bit.biExitLT = 1; CddStp88XX_aeTemp[ucIx] = CddStp_eTempState_NormTemp; // Step2: call function CddStp8899Temp_StateFctHigh(ucIx, action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aeTemp[ucIx], CddStp_eTempState_NormTemp, == ); AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biWaitErrPrealarm, 0, == ); AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biExitLT, 0, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biWaitErrPrealarm = 1; // Step2: call function CddStp8899Temp_StateFctHigh(ucIx, action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aeTemp[ucIx], CddStp_eTempState_NormTemp, == ); AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biWaitErrPrealarm, 1, == ); AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biExitLT, 0, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biWaitErrPrealarm = 1; // timeout: CddStp_UnitTest__GptTickCount & CddStp88XX_astWaitErrPrealarm[ucIx] CddStp_UnitTest__GptTickCount = 5; CddStp88XX_astWaitErrPrealarm[ucIx] = 0; CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[ucIx].Bit.u1OTW = 0u; // Step2: call function CddStp8899Temp_StateFctHigh(ucIx, action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aeTemp[ucIx], CddStp_eTempState_NormTemp, == ); AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biWaitErrPrealarm, 0, == ); AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biExitLT, 0, == ); // Step1: do some ini CddStp88XX_aBitsMod[ucIx].Bit.biWaitErrPrealarm = 1; // timeout: CddStp_UnitTest__GptTickCount & CddStp88XX_astWaitErrPrealarm[ucIx] CddStp_UnitTest__GptTickCount = 5; CddStp88XX_astWaitErrPrealarm[ucIx] = 0; CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[ucIx].Bit.u1OTW = 1u; // Step2: call function CddStp8899Temp_StateFctHigh(ucIx, action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aeTemp[ucIx], CddStp_eTempState_NormTemp, == ); AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biWaitErrPrealarm, 0, == ); AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biExitLT, 0, == ); // Step1: do some ini action = ActExit; CddStp88XX_aStpState[ucIx].Bit.ErrPrealarm = 1; CddStp88XX_aBitsMod[ucIx].Bit.biExitLT = 1; // Step2: call function CddStp8899Temp_StateFctHigh(ucIx, action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.ErrPrealarm, 0, == ); AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biExitLT, 0, == ); // Step1: do some ini action = 255; CddStp88XX_aStpState[ucIx].Bit.ErrPrealarm = 1; CddStp88XX_aBitsMod[ucIx].Bit.biExitLT = 1; // Step2: call function CddStp8899Temp_StateFctHigh(ucIx, action); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aStpState[ucIx].Bit.ErrPrealarm, 1, == ); AL_UNITTEST_CHECK(CddStp88XX_aBitsMod[ucIx].Bit.biExitLT, 1, == ); } // ************* CddStp88XX.h **************************** // inline functions // INLINE void CddStp88XX_SetTgtVal(uint8 ucIx, sint16 nPos, uint16 unTmin) // INLINE boolean CddStp88XX_ActPosIsValid(uint8 ucIx) // INLINE sint16 CddStp88XX_GetActPos(uint8 ucIx) // INLINE uint8 CddStp88XX_GetNumOfSteppers_EFT(void) // INLINE uint8 CddStp88XX_GetNumOfSteppers_Coding(void) // INLINE const tCddStp88XXBitsMod* CddStp88XX_GetBitsMod(const uint8 ucIx) // INLINE const tCddStp_Bits* CddStp88XX_GetBits(const uint8 ucIx) // INLINE sint32 CddStp88XX_GetLastDeviation(uint8 ucIx) // INLINE void CddStpVolt_IoHwAbUser_GetECUSupply(uint16* pio_signal) //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_SetTgtVal(void) { // Step1: do some ini uint8 ucIx = 0; sint16 nPos = 0; uint16 unTmin = 7; // Step2: call function CddStp88XX_SetTgtVal(ucIx, nPos, unTmin); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_ActPosIsValid(void) { // Step1: do some ini uint8 ucIx = 0; // Step2: call function CddStp88XX_ActPosIsValid(ucIx); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_GetActPos(void) { // Step1: do some ini uint8 ucIx = 0; // Step2: call function CddStp88XX_GetActPos(ucIx); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_GetNumOfSteppers_EFT(void) { // Step1: do some ini // Step2: call function CddStp88XX_GetNumOfSteppers_EFT(); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_GetNumOfSteppers_Coding(void) { // Step1: do some ini // Step2: call function CddStp88XX_GetNumOfSteppers_Coding(); // Step3: call check AL_UNITTEST_CHECK(TRUE, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_GetBitsMod(void) { // Step1: do some ini const uint32 cIniValue = 0xAFFE; uint8 ucIx = 0; tCddStp88XXBitsMod bits; bits.ulRaw = cIniValue; CddStp88XX_aBitsMod[0].ulRaw = cIniValue + 0x1234; // Step2: call function bits = *CddStp88XX_GetBitsMod(ucIx); // Step3: call check AL_UNITTEST_CHECK(bits.ulRaw, (cIniValue + 0x1234), == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_GetBits(void) { // Step1: do some ini const uint32 cIniValue = 0xAB; uint8 ucIx = 0; tCddStp_Bits bits; bits.unRaw = cIniValue; CddStp88XX_aBits[0].unRaw = cIniValue + 10; // Step2: call function bits = *CddStp88XX_GetBits(ucIx); // Step3: call check AL_UNITTEST_CHECK(bits.unRaw, (cIniValue + 10), == ); } extern sint32 CddStp88XX_alLastDeviation[CFA_CNT_STP_88XX]; //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp88XX_GetLastDeviation(void) { // Step1: do some ini const uint32 cIniValue = 10; uint8 ucIx = 0; sint32 result = cIniValue; CddStp88XX_alLastDeviation[ucIx] = cIniValue; // Step2: call function result = CddStp88XX_GetLastDeviation(ucIx); // Step3: call check AL_UNITTEST_CHECK(result, CddStp88XX_alLastDeviation[ucIx], == ); } // ************* CddStpPrj.c **************************** // uint32 CddStpPrjLwr_CalcRemainingTicks(/*boolean boHsMode, */uint32 ulBufferIndexNow/*, volatile uint16* punDtc*/); // void CddStpPrj_SetEventFinishMove(uint8 ucIx); // INLINE void CddStpPrj_AddTimerOffset(uint32 ulIx, uint32* pulVal) // INLINE const tCddStp_Bits* CddStp_GetBits(const uint8 ucIx) // INLINE const tCddStp_Attr* CddStp_GetAttr(const uint8 ucIx) // INLINE uint32 ST_R_USEC(uint32 ulTime); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpPrjLwr_CalcRemainingTicks(void) { // Step1: do some ini const uint32 cIniValue = 0xAB; const uint32 cIniValue2 = 0xABCD; uint32 ulBufferIndexNow = 0; uint32 ret; CddStp88XX_HalStp_StpInfoLwr.HsInfoBuf[ulBufferIndexNow].Val.unHsTime = cIniValue; CddStp_UnitTest__TspTickCount = cIniValue2; // Step2: call function ret = CddStpPrjLwr_CalcRemainingTicks(ulBufferIndexNow); // Step3: call check AL_UNITTEST_CHECK(ret, (cIniValue - cIniValue2), == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStpPrj_SetEventFinishMove(void) { // Step1: do some ini uint8 ucIx = 0; CddStp88XX_aeState[ucIx] = CddStp88XX_eStateIdle; CddStp88XX_aEventBits[ucIx].Bit.biFinishMove = 0; // Step2: call function CddStpPrj_SetEventFinishMove(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp88XX_aEventBits[ucIx].Bit.biFinishMove, 1, == ); } // ************* CddStp_Tsp.c **************************** //void CddStp_Tsp_Init(void); //void CddStp_Tsp_Start(uint8 ucIdx, uint16 period); //void CddStp_Tsp_Stop(uint8 ucIdx); //uint32 CddStp_Tsp_GetTicks(uint8 ucIdx); //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_Tsp_Init(void) { // Step1: do some ini CddStp_UnitTest__TspIsIni = FALSE; CddStp_UnitTest__TspIsRunning = FALSE; // Step2: call function CddStp_Tsp_Init(); // Step3: call check AL_UNITTEST_CHECK(CddStp_UnitTest__TspIsIni, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_Tsp_Start(void) { // Step1: do some ini const uint32 cIniValue = 10; uint8 ucIx = 0; uint16 period = cIniValue; CddStp_UnitTest__TspIsRunning = FALSE; // Step2: call function CddStp_Tsp_Start(ucIx, period); // Step3: call check AL_UNITTEST_CHECK(CddStp_UnitTest__TspIsRunning, TRUE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_Tsp_Stop(void) { // Step1: do some ini uint8 ucIx = 0; CddStp_UnitTest__TspIsRunning = TRUE; // Step2: call function CddStp_Tsp_Stop(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp_UnitTest__TspIsRunning, FALSE, == ); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_Tsp_GetTicks(void) { // Step1: do some ini const uint32 cIniValue = 10; uint8 ucIx = 0; CddStp_UnitTest__TspTickCount = cIniValue; // Step2: call function CddStp_Tsp_GetTicks(ucIx); // Step3: call check AL_UNITTEST_CHECK(CddStp_UnitTest__TspTickCount, cIniValue, == ); } // ************* CddStp_Simulation.c **************************** // boolean CddStp_Simulation_IsSimActive(void); // boolean CddStp_Simulation_HandleVBatt_EcuSupply(uint16 * punVoltage_mV); // void CddStp_Simulation_HandleSpiRxStatusBits(boolean * pboSim_DriverDefect, boolean * pboSim_SPI_ERROR_SpiProtocolError , boolean * pboSim_UVLO_UnderVoltageLockout // , boolean * pboSim_CPUV_ChargePumpUndervoltage, boolean * pboSim_OCP_OverCurrentProtection // , boolean * pboSim_OL_OpenLoad // , boolean * pboSim_TF_ThermalFault, boolean * pboSim_OTW_OverThermalWarning // , boolean * pboSim_OTS_OverTemperatureShutdown, boolean * pboSim_UTW_UnderTemperatureWarning); // void CddStp_Simulation_HandleStatusRegisters(uint8 * pucBasic, uint8 * pucFault, uint8 * pucDiagStatus1, uint8 * pucDiagStatus2); // boolean CddStp_Simulation_HandleDriverDefect_FatalError(void); // boolean CddStp_Simulation_HandleLowTempMode(void); // // void CddStp_Simulation_PreEvalStallDtctn(void); // boolean CddStp_Simulation_PreEvalStallDtctn_ReadCodingOnce(void); // void CddStp_Simulation_PreEvalStallDtctn_SetCodingParams(tCddStp_Simulation_PreEvalStallDtctn_CodingParams * pCodingParams); // void CddStp_Simulation_PreEvalStallDtctn_GetCodingParams(tCddStp_Simulation_PreEvalStallDtctn_CodingParams * pCodingParams); // void CddStp_Simulation_PreEvalStallDtctn_GetControlRegs(tCddStp_Simulation_PreEvalStallDtctn_CtrlReg * pControlRegisters); // void CddStp_Simulation_PreEvalStallDtctn_SetPosAtStall(sint32 lPosAtStop); // sint32 CddStp_Simulation_PreEvalStallDtctn_GetPosAtStall(void); // boolean CddStp_Simulation_PreEvalStallDtctn_GetWriteCReg6Once(void); // boolean CddStp_Simulation_PreEvalStallDtctn_GetWriteClrFltOnce(void); // // lean CddStp_Simulation_PreEvalStallDtctn_GetWriteStlLrnOnce(void); // boolean CddStp_Simulation_PreEvalStallDtctn_GetWriteStlLrn(void); // void CddStp_Simulation_PreEvalStallDtctn_ResetStlLrn(void); // void CddStp_Simulation_PreEvalStallDtctn_GetStpSpeed(uint16 * punTmin); #ifdef CDDSTP_CFG_SIMULATION // defined in '.\Asr6\Src\Src_AL\Cust\Bw\Bw16\App\Bsw\Cdd\CddStp\CddStpPrj.h' extern tCddStp_Simulation_Data CddStp_Simulation_Data; //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_Simulation_IsSimActive(void) { // Step1: do some ini const uint32 cIniValue = 0xAB; boolean retValue; CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; // Step2: call function retValue = CddStp_Simulation_IsSimActive(); // Step3: call check AL_UNITTEST_CHECK(retValue, TRUE, == ); // Step4: Clean up CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_DEACTIVATED; } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_Simulation_HandleVBatt_EcuSupply(void) { // Step1: do some ini const uint32 cIniValue = 12345; boolean retValue; uint16 unVoltage_mV; CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; CddStp_Simulation_Data.unVBatt_EcuSupply_mV = cIniValue; // Step2: call function retValue = CddStp_Simulation_HandleVBatt_EcuSupply(&unVoltage_mV); // Step3: call check AL_UNITTEST_CHECK(retValue, TRUE, == ); AL_UNITTEST_CHECK(unVoltage_mV, cIniValue, == ); // Step1: do some ini CddStp_Simulation_Data.unVBatt_EcuSupply_mV = CDDSTP_SIMULATION_UNUSED_VALUE; // Step2: call function retValue = CddStp_Simulation_HandleVBatt_EcuSupply(&unVoltage_mV); // Step3: call check AL_UNITTEST_CHECK(retValue, FALSE, == ); AL_UNITTEST_CHECK(unVoltage_mV, CDDSTP_SIMULATION_UNUSED_VALUE, == ); // Step4: Clean up CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_DEACTIVATED; CddStp_Simulation_Data.unVBatt_EcuSupply_mV = CDDSTP_SIMULATION_UNUSED_VALUE; } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_Simulation_HandleSpiRxStatusBits(void) { // Step1: do some ini boolean boSim_DriverDefect, boSim_SPI_ERROR_SpiProtocolError, boSim_UVLO_UnderVoltageLockout, boSim_CPUV_ChargePumpUndervoltage, boSim_OCP_OverCurrentProtection/*, boSim_TF_ThermalFault*/, boSim_OL_OpenLoad, boSim_OTW_OverThermalWarning, boSim_OTS_OverTemperatureShutdown, boSim_UTW_UnderTemperatureWarning; boSim_DriverDefect = TRUE; CddStp_Simulation_Data.ucSim_DriverDefect = FALSE; CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_DEACTIVATED; // Step2: call function CddStp_Simulation_HandleSpiRxStatusBits(&boSim_DriverDefect, &boSim_SPI_ERROR_SpiProtocolError, &boSim_UVLO_UnderVoltageLockout , &boSim_CPUV_ChargePumpUndervoltage, &boSim_OCP_OverCurrentProtection , &boSim_OL_OpenLoad, &boSim_OTW_OverThermalWarning , &boSim_OTS_OverTemperatureShutdown, &boSim_UTW_UnderTemperatureWarning); // Step3: call check AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_DriverDefect, boSim_DriverDefect, != ); // Step1: do some ini CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; CddStp_Simulation_Data.ucSim_DriverDefect = TRUE; CddStp_Simulation_Data.ucSim_SPI_ERROR_SpiProtocolError = TRUE; CddStp_Simulation_Data.ucSim_OL_OpenLoad = TRUE; CddStp_Simulation_Data.ucSim_OCP_OverCurrentProtection = TRUE; CddStp_Simulation_Data.ucSim_UVLO_UnderVoltageLockout = TRUE; CddStp_Simulation_Data.ucSim_CPUV_ChargePumpUndervoltage = TRUE; //CddStp_Simulation_Data.ucSim_TF_ThermalFault = TRUE; CddStp_Simulation_Data.ucSim_OTW_OverThermalWarning = TRUE; CddStp_Simulation_Data.ucSim_OTS_OverTemperatureShutdown = TRUE; CddStp_Simulation_Data.ucSim_UTW_UnderTemperatureWarning = TRUE; // Step2: call function CddStp_Simulation_HandleSpiRxStatusBits(&boSim_DriverDefect, &boSim_SPI_ERROR_SpiProtocolError, &boSim_UVLO_UnderVoltageLockout , &boSim_CPUV_ChargePumpUndervoltage, &boSim_OCP_OverCurrentProtection , &boSim_OL_OpenLoad /*, &boSim_TF_ThermalFault*/, &boSim_OTW_OverThermalWarning , &boSim_OTS_OverTemperatureShutdown, &boSim_UTW_UnderTemperatureWarning); // Step3: call check AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_DriverDefect, boSim_DriverDefect, == ); AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_SPI_ERROR_SpiProtocolError, boSim_SPI_ERROR_SpiProtocolError, == ); AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_OL_OpenLoad, boSim_OL_OpenLoad, == ); AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_OCP_OverCurrentProtection, boSim_OCP_OverCurrentProtection, == ); AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_UVLO_UnderVoltageLockout, boSim_UVLO_UnderVoltageLockout, == ); AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_CPUV_ChargePumpUndervoltage, boSim_CPUV_ChargePumpUndervoltage, == ); //AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_TF_ThermalFault, boSim_TF_ThermalFault, ==); AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_OTW_OverThermalWarning, boSim_OTW_OverThermalWarning, == ); AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_OTS_OverTemperatureShutdown, boSim_OTS_OverTemperatureShutdown, == ); AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_UTW_UnderTemperatureWarning, boSim_UTW_UnderTemperatureWarning, == ); // Step1: do some ini CddStp_Simulation_Data.ucSim_DriverDefect = FALSE; CddStp_Simulation_Data.ucSim_SPI_ERROR_SpiProtocolError = FALSE; CddStp_Simulation_Data.ucSim_OL_OpenLoad = FALSE; CddStp_Simulation_Data.ucSim_OCP_OverCurrentProtection = FALSE; CddStp_Simulation_Data.ucSim_UVLO_UnderVoltageLockout = FALSE; CddStp_Simulation_Data.ucSim_CPUV_ChargePumpUndervoltage = FALSE; //CddStp_Simulation_Data.ucSim_TF_ThermalFault = FALSE; CddStp_Simulation_Data.ucSim_OTW_OverThermalWarning = FALSE; CddStp_Simulation_Data.ucSim_OTS_OverTemperatureShutdown = FALSE; CddStp_Simulation_Data.ucSim_UTW_UnderTemperatureWarning = FALSE; // Step2: call function CddStp_Simulation_HandleSpiRxStatusBits(&boSim_DriverDefect, &boSim_SPI_ERROR_SpiProtocolError, &boSim_UVLO_UnderVoltageLockout , &boSim_CPUV_ChargePumpUndervoltage, &boSim_OCP_OverCurrentProtection , &boSim_OL_OpenLoad /*, &boSim_TF_ThermalFault*/, &boSim_OTW_OverThermalWarning , &boSim_OTS_OverTemperatureShutdown, &boSim_UTW_UnderTemperatureWarning); // Step3: call check AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_DriverDefect, boSim_DriverDefect, == ); AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_SPI_ERROR_SpiProtocolError, boSim_SPI_ERROR_SpiProtocolError, == ); AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_OL_OpenLoad, boSim_OL_OpenLoad, == ); AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_OCP_OverCurrentProtection, boSim_OCP_OverCurrentProtection, == ); AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_UVLO_UnderVoltageLockout, boSim_UVLO_UnderVoltageLockout, == ); AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_CPUV_ChargePumpUndervoltage, boSim_CPUV_ChargePumpUndervoltage, == ); //AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_TF_ThermalFault, boSim_TF_ThermalFault, == ); AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_OTW_OverThermalWarning, boSim_OTW_OverThermalWarning, == ); AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_OTS_OverTemperatureShutdown, boSim_OTS_OverTemperatureShutdown, == ); AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_UTW_UnderTemperatureWarning, boSim_UTW_UnderTemperatureWarning, == ); // Step4: Clean up CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_DEACTIVATED; } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_Simulation_HandleStatusRegisters(void) { // Step1: do some ini const uint32 cIniValue = 0xAB; boolean retValue; uint8 ucBasic, ucFault, ucDiagStatus1, ucDiagStatus2; CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; CddStp_Simulation_Data.ucSim_StReg_Basic = cIniValue + 0; CddStp_Simulation_Data.ucSim_StReg_Fault = cIniValue + 1; CddStp_Simulation_Data.ucSim_StReg_DiagStatus1 = cIniValue + 3; CddStp_Simulation_Data.ucSim_StReg_DiagStatus2 = cIniValue + 4; // Step2: call function CddStp_Simulation_HandleStatusRegisters(&ucBasic, &ucFault, &ucDiagStatus1, &ucDiagStatus2); // Step3: call check AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_StReg_Basic, ucBasic, == ); AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_StReg_Fault, ucFault, == ); AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_StReg_DiagStatus1, ucDiagStatus1, == ); AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_StReg_DiagStatus2, ucDiagStatus2, == ); // Step1: do some ini CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_DEACTIVATED; ucBasic = cIniValue + 10; // Step2: call function CddStp_Simulation_HandleStatusRegisters(&ucBasic, &ucFault, &ucDiagStatus1, &ucDiagStatus2); // Step3: call check AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_StReg_Basic, ucBasic, == ); // Step4: Clean up CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_DEACTIVATED; } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_Simulation_HandleDriverDefect_FatalError(void) { // Step1: do some ini const uint32 cIniValue = 0xAB; boolean retValue; CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; CddStp_Simulation_Data.ucSim_DriverDefect = eSimuHandling_Active; // Step2: call function retValue = CddStp_Simulation_HandleDriverDefect_FatalError(); // Step3: call check AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_DriverDefect, retValue, == ); // Step1: do some ini CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; CddStp_Simulation_Data.ucSim_DriverDefect = FALSE; // Step2: call function retValue = CddStp_Simulation_HandleDriverDefect_FatalError(); // Step3: call check AL_UNITTEST_CHECK(CddStp_Simulation_Data.ucSim_DriverDefect, retValue, == ); // Step4: Clean up CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_DEACTIVATED; CddStp_Simulation_Data.ucSim_DriverDefect = eSimuHandling_Inactive; } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_Simulation_HandleLowTempMode /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_Simulation_HandleLowTempMode(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.584 /// //----------------------------------------------------------------------------- void Mt_CddStp_Simulation_HandleLowTempMode(void) { // Step1: do some ini const uint32 cIniValue = 0xAB; boolean retValue; CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; CddStp_Simulation_Data.ucSim_LT_IsLowTemperature = eSimuHandling_Active; // Step2: call function retValue = CddStp_Simulation_HandleLowTempMode(); // Step3: call check AL_UNITTEST_CHECK(retValue, CddStp_Simulation_Data.ucSim_LT_IsLowTemperature, == ); // Step1: do some ini CddStp_Simulation_Data.ucSim_LT_IsLowTemperature = FALSE; // Step2: call function retValue = CddStp_Simulation_HandleLowTempMode(); // Step3: call check AL_UNITTEST_CHECK(retValue, CddStp_Simulation_Data.ucSim_LT_IsLowTemperature, == ); // Step4: Clean up CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_DEACTIVATED; CddStp_Simulation_Data.ucSim_LT_IsLowTemperature = eSimuHandling_Inactive; } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_Simulation_PreEvalStallDtctn(void) { // Step1: do some ini CddStp_Simulation_Data.bStallDtctn_ReadCodingOnce = FALSE; // Step2: call function CddStp_Simulation_PreEvalStallDtctn(); // Step3: call check AL_UNITTEST_CHECK(CddStp_Simulation_Data.bStallDtctn_ReadCodingOnce, FALSE, == ); // Step1: do some ini CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; CddStp_Simulation_Data.bStallDtctn_ReadCodingOnce = FALSE; // Step2: call function CddStp_Simulation_PreEvalStallDtctn(); // Step3: call check AL_UNITTEST_CHECK(CddStp_Simulation_Data.bStallDtctn_ReadCodingOnce, FALSE, == ); // Step1: do some ini CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; CddStp_Simulation_Data.bStallDtctn_ReadCodingOnce = TRUE; // Step2: call function CddStp_Simulation_PreEvalStallDtctn(); // Step3: call check AL_UNITTEST_CHECK(CddStp_Simulation_Data.bStallDtctn_ReadCodingOnce, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_Simulation_PreEvalStallDtctn_ReadCodingOnce(void) { // Step1: do some ini const uint32 cIniValue = 0xAB; boolean bValue = TRUE; boolean retValue; CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; // Step2: call function retValue = CddStp_Simulation_PreEvalStallDtctn_ReadCodingOnce(); // Step3: call check AL_UNITTEST_CHECK(retValue, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_Simulation_PreEvalStallDtctn_SetCodingParams(void) { // Step1: do some ini const uint32 cIniValue = 0xAB; tCddStp_Simulation_PreEvalStallDtctn_CodingParams codingParams; codingParams.ucStallDtctn_Haltestrom = cIniValue; CddStp_Simulation_Data.codingParams.ucStallDtctn_Haltestrom = cIniValue - 1; // Step2: call function CddStp_Simulation_PreEvalStallDtctn_SetCodingParams(&codingParams); // Step3: call check AL_UNITTEST_CHECK(CddStp_Simulation_Data.codingParams.ucStallDtctn_Haltestrom, cIniValue, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_Simulation_PreEvalStallDtctn_GetCodingParams(void) { // Step1: do some ini const uint32 cIniValue = 0xAB; tCddStp_Simulation_PreEvalStallDtctn_CodingParams codingParams; codingParams.ucStallDtctn_Haltestrom = cIniValue - 1; CddStp_Simulation_Data.codingParams.ucStallDtctn_Haltestrom = cIniValue; // Step2: call function CddStp_Simulation_PreEvalStallDtctn_GetCodingParams(&codingParams); // Step3: call check AL_UNITTEST_CHECK(codingParams.ucStallDtctn_Haltestrom, cIniValue, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_Simulation_PreEvalStallDtctn_GetControlRegs(void) { // Step1: do some ini tCddStp_Simulation_PreEvalStallDtctn_CtrlReg ctrlReg; ctrlReg.bStallDtctn_EN_STL = 1; CddStp_Simulation_Data.controlRegisters.bStallDtctn_EN_STL = 0; // Step2: call function CddStp_Simulation_PreEvalStallDtctn_GetControlRegs(&ctrlReg); // Step3: call check AL_UNITTEST_CHECK(ctrlReg.bStallDtctn_EN_STL, 0, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_Simulation_PreEvalStallDtctn_SetPosAtStall(void) { // Step1: do some ini sint32 lPosAtStop = 1234; CddStp_Simulation_Data.lStallDtctn_PosAtStop = 0; // Step2: call function CddStp_Simulation_PreEvalStallDtctn_SetPosAtStall(lPosAtStop); // Step3: call check AL_UNITTEST_CHECK(CddStp_Simulation_Data.lStallDtctn_PosAtStop, lPosAtStop, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_Simulation_PreEvalStallDtctn_GetPosAtStall(void) { // Step1: do some ini sint32 retValue; CddStp_Simulation_Data.lStallDtctn_PosAtStop = 1234; // Step2: call function retValue = CddStp_Simulation_PreEvalStallDtctn_GetPosAtStall(); // Step3: call check AL_UNITTEST_CHECK(retValue, CddStp_Simulation_Data.lStallDtctn_PosAtStop, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_Simulation_PreEvalStallDtctn_GetWriteCReg6Once(void) { // Step1: do some ini boolean retValue; // Step2: call function retValue = CddStp_Simulation_PreEvalStallDtctn_GetWriteCReg6Once(); // Step3: call check AL_UNITTEST_CHECK(retValue, FALSE, == ); // Step1: do some ini CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; CddStp_Simulation_Data.bStallDtctn_WriteCReg6Once = TRUE; // Step2: call function retValue = CddStp_Simulation_PreEvalStallDtctn_GetWriteCReg6Once(); // Step3: call check AL_UNITTEST_CHECK(retValue, TRUE, == ); AL_UNITTEST_CHECK(CddStp_Simulation_Data.bStallDtctn_WriteCReg6Once, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_GetVirtData_TestIfc /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_GetVirtData_TestIfc(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_Simulation_PreEvalStallDtctn_GetWriteClrFltOnce(void) { // Step1: do some ini boolean retValue; // Step2: call function retValue = CddStp_Simulation_PreEvalStallDtctn_GetWriteClrFltOnce(); // Step3: call check AL_UNITTEST_CHECK(retValue, FALSE, == ); // Step1: do some ini CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; CddStp_Simulation_Data.bStallDtctn_WriteClrFltOnce = TRUE; // Step2: call function retValue = CddStp_Simulation_PreEvalStallDtctn_GetWriteClrFltOnce(); // Step3: call check AL_UNITTEST_CHECK(retValue, TRUE, == ); AL_UNITTEST_CHECK(CddStp_Simulation_Data.bStallDtctn_WriteClrFltOnce, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_Simulation_PreEvalStallDtctn_GetWriteStlLrn /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_Simulation_PreEvalStallDtctn_GetWriteStlLrn(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_Simulation_PreEvalStallDtctn_GetWriteStlLrn(void) { // Step1: do some ini boolean retValue; // Step2: call function retValue = CddStp_Simulation_PreEvalStallDtctn_GetWriteStlLrn(); // Step3: call check AL_UNITTEST_CHECK(retValue, FALSE, == ); // Step1: do some ini CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; CddStp_Simulation_Data.bStallDtctn_WriteStlLrn = TRUE; // Step2: call function retValue = CddStp_Simulation_PreEvalStallDtctn_GetWriteStlLrn(); // Step3: call check AL_UNITTEST_CHECK(retValue, TRUE, == ); AL_UNITTEST_CHECK(CddStp_Simulation_Data.bStallDtctn_WriteStlLrn, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_Simulation_PreEvalStallDtctn_ResetStlLrn /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_Simulation_PreEvalStallDtctn_ResetStlLrn(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_Simulation_PreEvalStallDtctn_ResetStlLrn(void) { // Step1: do some ini CddStp_Simulation_Data.bStallDtctn_WriteStlLrn = TRUE; // Step2: call function CddStp_Simulation_PreEvalStallDtctn_ResetStlLrn(); // Step3: call check AL_UNITTEST_CHECK(CddStp_Simulation_Data.bStallDtctn_WriteStlLrn, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp_Simulation_PreEvalStallDtctn_GetStpSpeed /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp_Simulation_PreEvalStallDtctn_GetStpSpeed(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// //----------------------------------------------------------------------------- void Mt_CddStp_Simulation_PreEvalStallDtctn_GetStpSpeed(void) { // Step1: do some ini uint16 unTmin; CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_PASSWORD; CddStp_Simulation_Data.unStallDtctn_SpeedViaTime = 123; // Step2: call function CddStp_Simulation_PreEvalStallDtctn_GetStpSpeed(&unTmin); // Step3: call check AL_UNITTEST_CHECK(unTmin, 123, == ); // Step4: Clean up CleanUp(); } #endif // CDDSTP_CFG_SIMULATION // ************* CddStp8889A_StallDetection.c **************************** // void CddStp8889A_StallDetection_Enable(boolean bDoEnable); // boolean CddStp8889A_StallDetection_IsStalled(void); // void CddStp8889A_StallDetection_ResetStalled(void); // boolean CddStp8889A_StallDetection_SetCurrentTrqCnt(uint8 ucTrqCnt); // void CddStp8889A_StallDetection_CheckStatReg(void); //STATIC_AL void CddStp8889A_StallDetection_CheckCoding(void); //STATIC_AL boolean CddStp8889A_StallDetection_IsEnabled(void); extern tNvmPara_StallDetection CddStp8889A_StallDetection_CodingData; extern boolean CddStp8889A_StallDetection_CodingData_bReadOnceDone; extern boolean CddStp8889A_StallDetection_bEnabled; extern uint8 CddStp8889A_StallDetection_ucStallCounter; extern uint8 CddStp8889A_StallDetection_ucStallCounter_Max; extern boolean CddStp8889A_StallDetection_bIsStalled; extern void CddStp8889A_StallDetection_CheckCoding(void); extern boolean CddStp8889A_StallDetection_IsEnabled(void); //----------------------------------------------------------------------------- /// \brief Mt_CddStp8889A_StallDetection_Enable /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp8889A_StallDetection_Enable(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.584 /// //----------------------------------------------------------------------------- void Mt_CddStp8889A_StallDetection_Enable(void) { // Step1: do some ini const uint32 cIniValue = 0xAB; boolean bValue = TRUE; boolean retValue; CddStp8889A_StallDetection_bEnabled = FALSE; // Step2: call function CddStp8889A_StallDetection_Enable(bValue); // Step3: call check AL_UNITTEST_CHECK(CddStp8889A_StallDetection_bEnabled, bValue, == ); // Step1: do some ini bValue = FALSE; // Step2: call function CddStp8889A_StallDetection_Enable(bValue); // Step3: call check AL_UNITTEST_CHECK(CddStp8889A_StallDetection_bEnabled, bValue, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp8889A_StallDetection_IsStalled /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp8889A_StallDetection_IsStalled(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.584 /// //----------------------------------------------------------------------------- void Mt_CddStp8889A_StallDetection_IsStalled(void) { // Step1: do some ini const uint32 cIniValue = 0xAB; boolean bValue = TRUE; boolean retValue; CddStp8889A_StallDetection_CodingData_bReadOnceDone = TRUE; CddStp8889A_StallDetection_ucStallCounter = 4; CddStp8889A_StallDetection_bIsStalled = FALSE; CDDSTP_ApplCodData_AvacStp_StllDtctn.AvacStp_StllDtctn_Enable = FALSE; // Step2: call function retValue = CddStp8889A_StallDetection_IsStalled(); // Step3: call check AL_UNITTEST_CHECK(CddStp8889A_StallDetection_bIsStalled, FALSE, == ); AL_UNITTEST_CHECK(retValue, FALSE, == ); // Step1: do some ini CddStp8889A_StallDetection_bIsStalled = FALSE; CddStp8889A_StallDetection_CodingData_bReadOnceDone = TRUE; CddStp8889A_StallDetection_ucStallCounter = CddStp8889A_StallDetection_ucStallCounter_Max; CddStp8889A_StallDetection_bEnabled = TRUE; CddStp8889A_StallDetection_CodingData.bEN = TRUE; CDDSTP_ApplCodData_AvacStp_StllDtctn.AvacStp_StllDtctn_Enable = TRUE; CddStp8899Temp_cTemperaturePCB = 25; CddStp_UnitTest__SensPcbTemperature0_lActual = 25; CddStp_UnitTest__u32Voltage_mV = 13500; CddStp8889A_StallDetection_CodingData.ucLowTemp = 5; CddStp8889A_StallDetection_CodingData.ucHighTemp = 65; // Step2: call function retValue = CddStp8889A_StallDetection_IsStalled(); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8889A_StallDetection_bIsStalled, TRUE, == ); AL_UNITTEST_CHECK(retValue, FALSE, == ); CDDSTP_ApplCodData_Sys.Stp_Source_LowTemp = 1; retValue = CddStp8889A_StallDetection_IsStalled(); AL_UNITTEST_CHECK(retValue, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp8889A_StallDetection_ResetStalled /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp8889A_StallDetection_ResetStalled(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.584 /// //----------------------------------------------------------------------------- void Mt_CddStp8889A_StallDetection_ResetStalled(void) { // Step1: do some ini const uint32 cIniValue = 0xAB; boolean bValue = TRUE; boolean retValue; CddStp8889A_StallDetection_bIsStalled = TRUE; // Step2: call function CddStp8889A_StallDetection_ResetStalled(); // Step3: call check AL_UNITTEST_CHECK(CddStp8889A_StallDetection_bIsStalled, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp8889A_StallDetection_SetCurrentTrqCnt /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp8889A_StallDetection_SetCurrentTrqCnt(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.584 /// //----------------------------------------------------------------------------- void Mt_CddStp8889A_StallDetection_SetCurrentTrqCnt(void) { // Step1: do some ini uint8 ucTrqCnt = 0x10; boolean bValue = TRUE; boolean retValue; CddStp8889A_StallDetection_CodingData.ucSTALL_THRESHOLD = ucTrqCnt - 1; // TH is LOWER then CNT CddStp8889A_StallDetection_bIsStalled = FALSE; CddStp8889A_StallDetection_ucStallCounter = 2; CddStp8889A_StallDetection_CodingData_bReadOnceDone = TRUE; CddStp8889A_StallDetection_bEnabled = TRUE; CddStp8889A_StallDetection_CodingData.bEN = TRUE; // Step2: call function retValue = CddStp8889A_StallDetection_SetCurrentTrqCnt(ucTrqCnt); // Step3: call check AL_UNITTEST_CHECK(retValue, FALSE, == ); AL_UNITTEST_CHECK(CddStp8889A_StallDetection_ucStallCounter, 0, == ); // Step1: do some ini CddStp8889A_StallDetection_CodingData.ucSTALL_THRESHOLD = ucTrqCnt + 1; // TH is LARGER then CNT CddStp8889A_StallDetection_bIsStalled = FALSE; CddStp8889A_StallDetection_ucStallCounter = 1; CddStp8889A_StallDetection_CodingData_bReadOnceDone = TRUE; CddStp8889A_StallDetection_bEnabled = TRUE; CddStp8889A_StallDetection_CodingData.bEN = TRUE; // Step2: call function retValue = CddStp8889A_StallDetection_SetCurrentTrqCnt(ucTrqCnt); // Step3: call check AL_UNITTEST_CHECK(retValue, FALSE, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8889A_StallDetection_ucStallCounter, 2, == ); // Step1: do some ini CddStp8889A_StallDetection_CodingData.ucSTALL_THRESHOLD = ucTrqCnt + 1; // TH is LARGER then CNT CddStp8889A_StallDetection_bIsStalled = FALSE; CddStp8889A_StallDetection_ucStallCounter = CddStp8889A_StallDetection_ucStallCounter_Max; // max already reached CddStp8889A_StallDetection_CodingData_bReadOnceDone = TRUE; CddStp8889A_StallDetection_bEnabled = TRUE; CddStp8889A_StallDetection_CodingData.bEN = TRUE; // Step2: call function retValue = CddStp8889A_StallDetection_SetCurrentTrqCnt(ucTrqCnt); // Step3: call check AL_UNITTEST_CHECK(retValue, FALSE, == ); // tbd-FLM3-HH5: AL_UNITTEST_CHECK(CddStp8889A_StallDetection_ucStallCounter, CddStp8889A_StallDetection_ucStallCounter_Max, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp8889A_StallDetection_CheckStatReg /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp8889A_StallDetection_CheckStatReg(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.584 /// //----------------------------------------------------------------------------- void Mt_CddStp8889A_StallDetection_CheckStatReg(void) { // Step1: do some ini const uint32 cIniValue = 0xAB; boolean bValue = TRUE; boolean retValue; CddStp8899Com_DataMirror.StatvRx.aSRegBasic[0].Bit.u1STL = 1; CddStp8899Com_DataMirror.StatvRx.aSRegFault[0].Bit.u1STL = 1; CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[0].Bit.u1STALL = 1; CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[0].Bit.u1STL_LRN_OK = 1; CddStp_Simulation_Data.bStallDtctn_WriteStlLrn = TRUE; // Step2: call function CddStp8889A_StallDetection_CheckStatReg(); // Step3: call check AL_UNITTEST_CHECK(CddStp_Simulation_Data.bStallDtctn_WriteStlLrn, FALSE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp8889A_StallDetection_CheckCoding /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp8889A_StallDetection_CheckCoding(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.584 /// //----------------------------------------------------------------------------- void Mt_CddStp8889A_StallDetection_CheckCoding(void) { // Step1: do some ini const uint32 cIniValue = 0xAB; boolean bValue = TRUE; boolean retValue; CddStp_UnitTest__CodDataStatus = tieDataStatus_Invalid; CddStp8889A_StallDetection_CodingData_bReadOnceDone = TRUE; // Step2: call function CddStp8889A_StallDetection_CheckCoding(); // -> 'Rte_Read_ppareCodMCodingDataStatus0_sVal' -> 'Rte_Read_ctadCddStp_ppareCodMCodingDataStatus0_sVal' // Step3: call check AL_UNITTEST_CHECK(CddStp8889A_StallDetection_CodingData_bReadOnceDone, FALSE, == ); // Step1: do some ini CddStp_UnitTest__CodDataStatus = tieDataStatus_Valid; CddStp8889A_StallDetection_CodingData_bReadOnceDone = FALSE; CddStp_tCodingArea_StallDetection.ucPARAMETER_1 = 33; CDDSTP_ApplCodData_AvacStp_StllDtctn.AvacStp_StllDtctn_Param[0] = 33; CddStp8889A_StallDetection_ucStallCounter_Max = 22; // Step2: call function CddStp8889A_StallDetection_CheckCoding(); // -> 'Rte_Read_ppareCodMCodingDataStatus0_sVal' -> 'Rte_Read_ctadCddStp_ppareCodMCodingDataStatus0_sVal' // Step3: call check AL_UNITTEST_CHECK(CddStp_tCodingArea_StallDetection.ucPARAMETER_1, CddStp8889A_StallDetection_ucStallCounter_Max, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief Mt_CddStp8889A_StallDetection_IsEnabled /// /// \Test Case Description /// - Test subject: /// Call the API function CddStp8889A_StallDetection_IsEnabled(). /// /// - Test Design Technique: /// none /// /// - Preconditions: /// none /// /// - Expected test results: /// - State change correct /// /// - DOORS-ID: /// - FLM3.MDRS.CddStp.584 /// //----------------------------------------------------------------------------- void Mt_CddStp8889A_StallDetection_IsEnabled(void) { // Step1: do some ini const uint32 cIniValue = 0xAB; boolean bValue = TRUE; boolean retValue; CddStp8889A_StallDetection_CodingData_bReadOnceDone = FALSE; // Step2: call function retValue = CddStp8889A_StallDetection_IsEnabled(); // Step3: call check AL_UNITTEST_CHECK(retValue, FALSE, == ); // Step1: do some ini CddStp8889A_StallDetection_CodingData_bReadOnceDone = TRUE; CddStp8889A_StallDetection_bEnabled = FALSE; CddStp8889A_StallDetection_CodingData.bEN = FALSE; // Step2: call function retValue = CddStp8889A_StallDetection_IsEnabled(); // Step3: call check AL_UNITTEST_CHECK(retValue, FALSE, == ); // Step1: do some ini CddStp8889A_StallDetection_bEnabled = TRUE; CddStp8889A_StallDetection_CodingData.bEN = FALSE; // Step2: call function retValue = CddStp8889A_StallDetection_IsEnabled(); // Step3: call check AL_UNITTEST_CHECK(retValue, FALSE, == ); // Step1: do some ini CddStp8889A_StallDetection_bEnabled = TRUE; CddStp8889A_StallDetection_CodingData.bEN = TRUE; CddStpDyn_UnitTest___tCodingAreaSys_STP_QUELLE_TT = 0; // Step2: call function retValue = CddStp8889A_StallDetection_IsEnabled(); // Step3: call check AL_UNITTEST_CHECK(retValue, FALSE, == ); // Step1: do some ini CddStpDyn_UnitTest___tCodingAreaSys_STP_QUELLE_TT = 17; // Step2: call function retValue = CddStp8889A_StallDetection_IsEnabled(); // Step3: call check AL_UNITTEST_CHECK(retValue, FALSE, == ); // Step1: do some ini CddStpDyn_UnitTest___tCodingAreaSys_STP_QUELLE_TT = 16; CddStp8889A_StallDetection_CodingData.ucUBAT_MIN = 115; CddStp8889A_StallDetection_CodingData.ucUBAT_Max = 145; CddStp8889A_StallDetection_CodingData.ucLowTemp = 45; CddStp8889A_StallDetection_CodingData.ucHighTemp = 90; // Step2: call function retValue = CddStp8889A_StallDetection_IsEnabled(); // Step3: call check // tbd-FLM3-HH5: AL_UNITTEST_CHECK(retValue, TRUE, == ); // Step4: Clean up CleanUp(); } //----------------------------------------------------------------------------- /// \brief CleanUp /// /// \descr Reset all major vars to default /// /// \param - /// /// \return void //----------------------------------------------------------------------------- static void CleanUp(void) { // Step 4: Reset all major vars to default CddStp_UnitTest__u32Voltage_mV = 13500; CddStpVolt_ucPreResult = 2; // StateVoltOff=0, StateVoltUnder=1, StateVoltNormal=2, StateVoltOver=3, StateVoltStartValue=0xFF CddStpVolt_ucEndResult = 2; CddStp88XX_ucStateVolt = 2; CddStpVolt_ucVoltRange = 4; // Lo3=1, Lo2=2, Lo1=3, Norm=4, Hi1=5, Hi2=6 CddStp8899Com_DataMirror.StatvRx.aSRegBasic[0].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegFault[0].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegDiag1[0].ucRaw = 0; CddStp8899Com_DataMirror.StatvRx.aSRegDiag2[0].ucRaw = 0; CddStp8899_aSRegBasic[0].ucRaw = 0; CddStp8899_aSRegFault[0].ucRaw = 0; CddStp8899_aSRegDiag1[0].ucRaw = 0; CddStp8899_aSRegDiag2[0].ucRaw = 0; // EFT CddStp_UnitTest__EftDataStatus = tieDataStatus_Valid; CddStp_UnitTest__tieEftData[0].ucType = 0u; CddStp_UnitTest__tieEftData[1].ucType = 0u; CddStp_UnitTest__tieEftData[2].ucType = 0u; CddStp_tCodingAreaSys.STP_SPANNUNG_LO3 = 73; // [0.1 V] CddStp_tCodingAreaSys.STP_SPANNUNG_LO2 = 83; // [0.1 V] CddStp_tCodingAreaSys.STP_SPANNUNG_LO1 = 93; // [0.1 V] CddStp_tCodingAreaSys.STP_SPANNUNG_HI1 = 173; // [0.1 V] CddStp_tCodingAreaSys.STP_SPANNUNG_HI2 = 183; // [0.1 V] CddStp_tCodingAreaSys.STP_SPANNUNG_RED = 113; // [0.1 V] CddStp_tCodingAreaSys.STP_ZEIT_TT = 63; // [s] CddStp_tCodingAreaSys.STP_ZEIT_HT = 63; // [s] CddStp_tCodingAreaSys.STP_WERT_TT = 33; // [Deg + 40] CddStp_tCodingAreaSys.STP_QUELLE_TT = 16; CDDSTP_ApplCodData_Sys.Stp_Voltage_Low3 = 73; // [0.1 V] CDDSTP_ApplCodData_Sys.Stp_Voltage_Low2 = 83; // [0.1 V] CDDSTP_ApplCodData_Sys.Stp_Voltage_Low1 = 93; // [0.1 V] CDDSTP_ApplCodData_Sys.Stp_Voltage_High1 = 173; // [0.1 V] CDDSTP_ApplCodData_Sys.Stp_Voltage_High2 = 183; // [0.1 V] CDDSTP_ApplCodData_Sys.Stp_Voltage_High_Reduce = 113; // [0.1 V] CDDSTP_ApplCodData_Sys.Stp_DurationLowTempMode = 63; // [s] CDDSTP_ApplCodData_Sys.Stp_DurationHighTempMode = 63; // [s] CDDSTP_ApplCodData_Sys.Stp_LowTempModeThreshold = 33; // [Deg + 40] CDDSTP_ApplCodData_Sys.Stp_Source_LowTemp = 0; // only 2 bits: 0 = Temperature measurement through the sensor of ECU | 1 = evaluation CAN-Signal | any other = reserved CddStp_tCodingAreaLwr.Modus.biTestOlIgnor = 0u; CddStp_tCodingAreaLwr.Modus.eSchrittMod = NvmPara_eSchrittMod8; // = 2, // 1/8 step (micro step) CddStpDyn_UnitTest___tCodingAreaLwr_Modus_eSchrittMod = CddStp_tCodingAreaLwr.Modus.eSchrittMod; CddStpDyn_UnitTest___tCodingAreaSys_STP_SPANNUNG_LO3 = CddStp_tCodingAreaSys.STP_SPANNUNG_LO3; // [0.1 V] Spannungsschwelle fuer die harte Abschaltung des Treibers bei Unterspannung CddStpDyn_UnitTest___tCodingAreaSys_STP_SPANNUNG_LO2 = CddStp_tCodingAreaSys.STP_SPANNUNG_LO2; // [0.1 V] Spannungsschwelle für das Anhalten des Motors bei Unterspannung (N.b.: KEIN Anhalten bei Ref-Run) CddStpDyn_UnitTest___tCodingAreaSys_STP_SPANNUNG_LO1 = CddStp_tCodingAreaSys.STP_SPANNUNG_LO1; // [0.1 V] Spannungsschwelle für die Reaktivierung des Motors nach Unterspannung CddStpDyn_UnitTest___tCodingAreaSys_STP_SPANNUNG_HI1 = CddStp_tCodingAreaSys.STP_SPANNUNG_HI1; // [0.1 V] Spannungsschwelle für die Reaktivierung des Motors nach Ueberspannung CddStpDyn_UnitTest___tCodingAreaSys_STP_SPANNUNG_HI2 = CddStp_tCodingAreaSys.STP_SPANNUNG_HI2; // [0.1 V] Spannungsschwelle für das Anhalten des Motors bei Ueberspannung CddStpDyn_UnitTest___tCodingAreaSys_STP_SPANNUNG_RED = CddStp_tCodingAreaSys.STP_SPANNUNG_RED; // [0.1 V] Spannung, unter der die maximale Verstellfrequenz reduziert wird. Die Reduktion der maximalen Verstellfrequenz erfolgt annaehernd linear zur Versorgungsspannung. CddStpDyn_UnitTest___tCodingAreaSys_STP_ZEIT_TT = CddStp_tCodingAreaSys.STP_ZEIT_TT; // [s] Dauer des Tieftemperaturmodus, unabhaengig davon, ob die Tieftemperaturinformation nach Ende des Zeitintervalls noch anliegt. Der Tieftemperaturzustand kann nur einmal pro Power-On-Zyklus aktiviert werden. CddStpDyn_UnitTest___tCodingAreaSys_STP_ZEIT_HT = CddStp_tCodingAreaSys.STP_ZEIT_HT; // [s] Minimale Dauer des Hochtemperaturmodus. Der Hochtemperaturmodus wird jedes Mal aktiviert, wenn vom Schrittmotortreiber eine Uebertemperaturwarnung erfolgt und verbleibt für mindestens STP_ZEIT_HT in diesem Zustand. CddStpDyn_UnitTest___tCodingAreaSys_STP_WERT_TT = CddStp_tCodingAreaSys.STP_WERT_TT; // [Deg + 40] Temperaturgrenzwert, unter dem der Tieftemperaturmodus aktiviert wird CddStpDyn_UnitTest___tCodingAreaSys_STP_QUELLE_TT = CddStp_tCodingAreaSys.STP_QUELLE_TT; // Source of temp.: 1..12=NTC1-12, 16=PCB, 17=CAN - SWRS.27423 ----- < 0 = Temperaturmessung durch Sensor im FLE CddStp_Simulation_Data.ulSimActivated = CDDSTP_SIMULATION_DEACTIVATED; CddStp88XX_HalStp_ucSCCntLwr = 0; CddStp88XX_HalStp_ucOLCntLwr = 0; CddStp_boDioErrLwr = FALSE; CddStp88XX_HalStp_unErrVoltLwr = 13500; CddStp_UnitTestHelper_bo1 = FALSE; CddStp_UnitTestHelper_bo2 = FALSE; CddStp_UnitTestHelper_ul1 = 0; CddStp_UnitTestHelper_ul2 = 0; CddStp88XX_ucNumOfSteppers_EFT = 1; CddStp_UnitTest__tieEftData[0].ucType = 1u; CddStp_UnitTest__tieEftData[1].ucType = 0u; CddStp8889A_StallDetection_bEnabled = FALSE; CddStp8889A_StallDetection_bIsStalled = FALSE; CddStp8889A_StallDetection_ucStallCounter = 0; CddStp8889A_StallDetection_CodingData_bReadOnceDone = FALSE; CddStp8889A_StallDetection_CodingData.bEN = FALSE; CddStp8889A_StallDetection_CodingData.ucSTALL_THRESHOLD = 0x20; /*=30*/ CddStp8889A_StallDetection_CodingData.ucUBAT_MIN = 115; CddStp8889A_StallDetection_CodingData.ucUBAT_Max = 145; CddStp8889A_StallDetection_CodingData.ucLowTemp = 45; CddStp8889A_StallDetection_CodingData.ucHighTemp = 90; } //----------------------------------------------------------------------------- /// \brief ALUnitTest_AddTests /// /// \descr Add all tc to big list /// /// \param - /// /// \return void //----------------------------------------------------------------------------- void ALUnitTest_AddTests(void) { // ************* CddStp.c **************************** ALUnitTest_AddFunction("Mt_riCddStpInit", Mt_riCddStpInit); ALUnitTest_AddFunction("Mt_CddStp_Init", Mt_CddStp_Init); //ALUnitTest_AddFunction("Mt_riCddStpDeInit", Mt_riCddStpDeInit); // yet NOT available in RTE!! //ALUnitTest_AddFunction("Mt_CddStp_DeInit", Mt_CddStp_DeInit); // yet not available in Hongqi-H5 ALUnitTest_AddFunction("Mt_rpCddStp10ms", Mt_rpCddStp10ms); ALUnitTest_AddFunction("Mt_CddStp_Cycle10ms", Mt_CddStp_Cycle10ms); ALUnitTest_AddFunction("Mt_roCddStpOff", Mt_roCddStpOff); ALUnitTest_AddFunction("Mt_CddStp_StpOff", Mt_CddStp_StpOff); ALUnitTest_AddFunction("Mt_roCddStpOn", Mt_roCddStpOn); ALUnitTest_AddFunction("Mt_CddStp_StpOn", Mt_CddStp_StpOn); // ************* ctscCddStp_.c **************************** ALUnitTest_AddFunction("Mt_riCddStp_Init", Mt_riCddStp_Init); ALUnitTest_AddFunction("Mt_rpCddStp_Cycle0", Mt_rpCddStp_Cycle0); ALUnitTest_AddFunction("Mt_roCddStpStartRefRun", Mt_roCddStpStartRefRun); ALUnitTest_AddFunction("Mt_CddStp_StartRefRun", Mt_CddStp_StartRefRun); ALUnitTest_AddFunction("Mt_CddStp_CtrlFct0", Mt_CddStp_CtrlFct0); ALUnitTest_AddFunction("Mt_rrCddStp_TgtSig0", Mt_rrCddStp_TgtSig0); ALUnitTest_AddFunction("Mt_CddStp_GetData", Mt_CddStp_GetData); ALUnitTest_AddFunction("Mt_CddStp_GetData_Internal", Mt_CddStp_GetData_Internal); ALUnitTest_AddFunction("Mt_CddStp_GetVirtData_TestIfc", Mt_CddStp_GetVirtData_TestIfc); // ************* CddStp8899_FctTables.c **************************** ALUnitTest_AddFunction("Mt_CddStp8899_FctTables_UT_Dummy", Mt_CddStp8899_FctTables_UT_Dummy); // ************* CddStpDyn.c **************************** ALUnitTest_AddFunction("Mt_CddStpDyn_Init", Mt_CddStpDyn_Init); ALUnitTest_AddFunction("Mt_CddStpDyn_CodingDataValid", Mt_CddStpDyn_CodingDataValid); ALUnitTest_AddFunction("Mt_CddStpDyn_SetFreq", Mt_CddStpDyn_SetFreq); ALUnitTest_AddFunction("Mt_CddStpDyn_CalcNextSteps", Mt_CddStpDyn_CalcNextSteps); ALUnitTest_AddFunction("Mt_CddStpDyn_CalcNormal", Mt_CddStpDyn_CalcNormal); ALUnitTest_AddFunction("Mt_CddStpDyn_CalcRef2", Mt_CddStpDyn_CalcRef2); ALUnitTest_AddFunction("Mt_CddStpDyn_CalcRef1", Mt_CddStpDyn_CalcRef1); ALUnitTest_AddFunction("Mt_CddStpDyn_PreStep", Mt_CddStpDyn_PreStep); ALUnitTest_AddFunction("Mt_CddStpDyn_GetStartConditions", Mt_CddStpDyn_GetStartConditions); ALUnitTest_AddFunction("Mt_CddStpDyn_GetIx", Mt_CddStpDyn_GetIx); ALUnitTest_AddFunction("Mt_CddStpDyn_GetStpTime", Mt_CddStpDyn_GetStpTime); ALUnitTest_AddFunction("Mt_CddStpDyn_CalcNextHalfStepTime", Mt_CddStpDyn_CalcNextHalfStepTime); ALUnitTest_AddFunction("Mt_CddStpDyn_DecActTabIx", Mt_CddStpDyn_DecActTabIx); ALUnitTest_AddFunction("Mt_CddStpDyn_IncActTabIx", Mt_CddStpDyn_IncActTabIx); ALUnitTest_AddFunction("Mt_CddStpDyn_GetSign", Mt_CddStpDyn_GetSign); // ************* CddStpDynBuf.c **************************** ALUnitTest_AddFunction("Mt_CddStpDynBuf_ReadLastEntry", Mt_CddStpDynBuf_ReadLastEntry); ALUnitTest_AddFunction("Mt_CddStpDynBuf_ReadActualEntry", Mt_CddStpDynBuf_ReadActualEntry); ALUnitTest_AddFunction("Mt_CddStpDynBuf_WriteToBuffer", Mt_CddStpDynBuf_WriteToBuffer); ALUnitTest_AddFunction("Mt_CddStpDynBuf_IncBufIx", Mt_CddStpDynBuf_IncBufIx); ALUnitTest_AddFunction("Mt_Util_SameSign", Mt_Util_SameSign); // ************* CddStp88XXVolt.c **************************** ALUnitTest_AddFunction("Mt_CddStp88XXVolt_GetStpVoltState", Mt_CddStp88XXVolt_GetStpVoltState); ALUnitTest_AddFunction("Mt_CddStp88XXVolt_StpVoltRng", Mt_CddStp88XXVolt_StpVoltRng); ALUnitTest_AddFunction("Mt_CddStp88XXVolt_StpVoltCycle", Mt_CddStp88XXVolt_StpVoltCycle); ALUnitTest_AddFunction("Mt_CddStpVolt_IoHwAbUser_GetECUSupply", Mt_CddStpVolt_IoHwAbUser_GetECUSupply); // local prototype ALUnitTest_AddFunction("Mt_CddStpVolt_TimerStop", Mt_CddStpVolt_TimerStop); ALUnitTest_AddFunction("Mt_CddStpVolt_TimerRestart", Mt_CddStpVolt_TimerRestart); ALUnitTest_AddFunction("Mt_CddStpVolt_FinalResult", Mt_CddStpVolt_FinalResult); ALUnitTest_AddFunction("Mt_CddStpVolt_ConvMsToCnt", Mt_CddStpVolt_ConvMsToCnt); // ************* CddStp8899.c **************************** ALUnitTest_AddFunction("Mt_CddStp88XX_Init", Mt_CddStp88XX_Init); ALUnitTest_AddFunction("Mt_CddStp88XX_EftCodingLr", Mt_CddStp88XX_EftCodingLr); ALUnitTest_AddFunction("Mt_CddStp88XX_EftCodingLr_2", Mt_CddStp88XX_EftCodingLr_2); ALUnitTest_AddFunction("Mt_CddStp88XX_GetState", Mt_CddStp88XX_GetState); ALUnitTest_AddFunction("Mt_CddStp88XX_Event", Mt_CddStp88XX_Event); ALUnitTest_AddFunction("Mt_CddStp88XX_Volt", Mt_CddStp88XX_Volt); ALUnitTest_AddFunction("Mt_Appl_GetIdentity", Mt_Appl_GetIdentity); ALUnitTest_AddFunction("Mt_CddStp88XX_DeInit", Mt_CddStp88XX_DeInit); ALUnitTest_AddFunction("Mt_CddStp88XX_Cycle0", Mt_CddStp88XX_Cycle0); ALUnitTest_AddFunction("Mt_CddStp88XX_TgtVal", Mt_CddStp88XX_TgtVal); ALUnitTest_AddFunction("Mt_CddStp88XX_CtrlFct0", Mt_CddStp88XX_CtrlFct0); ALUnitTest_AddFunction("Mt_CddStp88XX_ParaFct0", Mt_CddStp88XX_ParaFct0); ALUnitTest_AddFunction("Mt_CddStp88XX_CntFct0", Mt_CddStp88XX_CntFct0); ALUnitTest_AddFunction("Mt_CddStp88XX_Ctrl", Mt_CddStp88XX_Ctrl); ALUnitTest_AddFunction("Mt_CddStp88XX_StpStateVoltNormSet", Mt_CddStp88XX_StpStateVoltNormSet); ALUnitTest_AddFunction("Mt_CddStp88XX_StpStateVoltNormClear", Mt_CddStp88XX_StpStateVoltNormClear); ALUnitTest_AddFunction("Mt_CddStp88XX_StpStateOvSet", Mt_CddStp88XX_StpStateOvSet); ALUnitTest_AddFunction("Mt_CddStp88XX_StpStateOvClear", Mt_CddStp88XX_StpStateOvClear); ALUnitTest_AddFunction("Mt_CddStp88XX_StpStateUvSSMSet", Mt_CddStp88XX_StpStateUvSSMSet); ALUnitTest_AddFunction("Mt_CddStp88XX_StpStateUvSSMClear", Mt_CddStp88XX_StpStateUvSSMClear); ALUnitTest_AddFunction("Mt_CddStp88XX_GetCurrentIndex", Mt_CddStp88XX_GetCurrentIndex); ALUnitTest_AddFunction("Mt_CddStp88XX_SetCurrent", Mt_CddStp88XX_SetCurrent); ALUnitTest_AddFunction("Mt_CddStp88XX_HandleStpOnTime", Mt_CddStp88XX_HandleStpOnTime); ALUnitTest_AddFunction("Mt_CddStp88XX_GetStpOnTime", Mt_CddStp88XX_GetStpOnTime); ALUnitTest_AddFunction("Mt_IoHwAb_User_GetDio_ERRN_LWR", Mt_IoHwAb_User_GetDio_ERRN_LWR); ALUnitTest_AddFunction("Mt_CddStp88XX_GetAhlPosDevHistCnts", Mt_CddStp88XX_GetAhlPosDevHistCnts); ALUnitTest_AddFunction("Mt_CddStp88XX_StartWait88XXVoltage", Mt_CddStp88XX_StartWait88XXVoltage); ALUnitTest_AddFunction("Mt_CddStp88XX_StartWaitVoltage", Mt_CddStp88XX_StartWaitVoltage); ALUnitTest_AddFunction("Mt_CddStp88XX_HandleWaitVoltage", Mt_CddStp88XX_HandleWaitVoltage); ALUnitTest_AddFunction("Mt_CddStp88XX_HandleWaitStabilize", Mt_CddStp88XX_HandleWaitStabilize); ALUnitTest_AddFunction("Mt_CddStp88XX_ReadDRV88XXTestRegAll", Mt_CddStp88XX_ReadDRV88XXTestRegAll); ALUnitTest_AddFunction("Mt_CddStp88XX_DemReportErrorStatus", Mt_CddStp88XX_DemReportErrorStatus); ALUnitTest_AddFunction("Mt_CddStp88XX_CalcCorrQuota", Mt_CddStp88XX_CalcCorrQuota); ALUnitTest_AddFunction("Mt_CddStp88XX_HandleResetErrVolt", Mt_CddStp88XX_HandleResetErrVolt); ALUnitTest_AddFunction("Mt_CddStp88XX_HandleStepLoss", Mt_CddStp88XX_HandleStepLoss); ALUnitTest_AddFunction("Mt_CddStp88XX_HandleStepHanging", Mt_CddStp88XX_HandleStepHanging); //UnitTest_AddFunction("Mt_CddStp88XX_HandleWrongRef1Motion", Mt_CddStp88XX_HandleWrongRef1Motion); // only AHL-Stepper ALUnitTest_AddFunction("Mt_CddStp88XX_ConvertTemp2Mode", Mt_CddStp88XX_ConvertTemp2Mode); ALUnitTest_AddFunction("Mt_CddStp88XX_ConvertState2Progress", Mt_CddStp88XX_ConvertState2Progress); ALUnitTest_AddFunction("Mt_CddStp88XX_StateMachine", Mt_CddStp88XX_StateMachine); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_Init", Mt_CddStp88XX_TransFct_Init); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_InitOff", Mt_CddStp88XX_TransFct_InitOff); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_Off", Mt_CddStp88XX_TransFct_Off); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_StbyIdle", Mt_CddStp88XX_TransFct_StbyIdle); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_IdleStby", Mt_CddStp88XX_TransFct_IdleStby); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_MoveIdle", Mt_CddStp88XX_TransFct_MoveIdle); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_MoveOff", Mt_CddStp88XX_TransFct_MoveOff); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_IdleMove", Mt_CddStp88XX_TransFct_IdleMove); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_RefOff", Mt_CddStp88XX_TransFct_RefOff); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_Ref1", Mt_CddStp88XX_TransFct_Ref1); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_RefWait", Mt_CddStp88XX_TransFct_RefWait); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_RefWaitIdle", Mt_CddStp88XX_TransFct_RefWaitIdle); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_Ref1Ref2", Mt_CddStp88XX_TransFct_Ref1Ref2); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_Ref1RefWait", Mt_CddStp88XX_TransFct_Ref1RefWait); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_Ref2RefWait", Mt_CddStp88XX_TransFct_Ref2RefWait); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_TestStep", Mt_CddStp88XX_TransFct_TestStep); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_TestStepIdle", Mt_CddStp88XX_TransFct_TestStepIdle); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_Err", Mt_CddStp88XX_TransFct_Err); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_Err_Sub", Mt_CddStp88XX_TransFct_Err_Sub); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_OffStby", Mt_CddStp88XX_TransFct_OffStby); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_OffIdle", Mt_CddStp88XX_TransFct_OffIdle); ALUnitTest_AddFunction("Mt_CddStp88XX_TransFct_ErrClr", Mt_CddStp88XX_TransFct_ErrClr); ALUnitTest_AddFunction("Mt_CddStp88XX_StateFct_Init", Mt_CddStp88XX_StateFct_Init); ALUnitTest_AddFunction("Mt_CddStp88XX_StateFct_Off", Mt_CddStp88XX_StateFct_Off); ALUnitTest_AddFunction("Mt_CddStp88XX_StateFct_Stby", Mt_CddStp88XX_StateFct_Stby); ALUnitTest_AddFunction("Mt_CddStp88XX_StateFct_Idle", Mt_CddStp88XX_StateFct_Idle); ALUnitTest_AddFunction("Mt_CddStp88XX_StateFct_Move", Mt_CddStp88XX_StateFct_Move); ALUnitTest_AddFunction("Mt_CddStp88XX_StateFct_Ref1", Mt_CddStp88XX_StateFct_Ref1); ALUnitTest_AddFunction("Mt_CddStp88XX_StateFct_Ref2", Mt_CddStp88XX_StateFct_Ref2); ALUnitTest_AddFunction("Mt_CddStp88XX_StateFct_RefWait", Mt_CddStp88XX_StateFct_RefWait); ALUnitTest_AddFunction("Mt_CddStp88XX_StateFct_RefWait_Do", Mt_CddStp88XX_StateFct_RefWait_Do); ALUnitTest_AddFunction("Mt_CddStp88XX_StateFct_TestStep", Mt_CddStp88XX_StateFct_TestStep); ALUnitTest_AddFunction("Mt_CddStp88XX_StateFct_Err", Mt_CddStp88XX_StateFct_Err); // ************* CddStp8899_HalStp.c **************************** ALUnitTest_AddFunction("Mt_CddStpPrj_TSPInit", Mt_CddStpPrj_TSPInit); ALUnitTest_AddFunction("Mt_CddStpPrj_TSPDeinit", Mt_CddStpPrj_TSPDeinit); ALUnitTest_AddFunction("Mt_CddStpPrjLwr_GPT_StartHelp", Mt_CddStpPrjLwr_GPT_StartHelp); ALUnitTest_AddFunction("Mt_CddStpPrjLwr_BothTimers_Prepare", Mt_CddStpPrjLwr_BothTimers_Prepare); ALUnitTest_AddFunction("Mt_CddStpPrjLwr_BothTimers_Start", Mt_CddStpPrjLwr_BothTimers_Start); ALUnitTest_AddFunction("Mt_CddStpPrjLwr_TSP_ForceTimerLow", Mt_CddStpPrjLwr_TSP_ForceTimerLow); ALUnitTest_AddFunction("Mt_CddStpPrjLwr_GPT_GetRemainingCnt", Mt_CddStpPrjLwr_GPT_GetRemainingCnt); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStp_Init", Mt_CddStp88XX_HalStp_Init); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStp_Deinit", Mt_CddStp88XX_HalStp_Deinit); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_SetCARunRefCnt", Mt_CddStp88XX_HalStpLwr_SetCARunRefCnt); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_SetHsMode", Mt_CddStp88XX_HalStpLwr_SetHsMode); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_IsTestStepDone", Mt_CddStp88XX_HalStpLwr_IsTestStepDone); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_ResetTestStepCnt", Mt_CddStp88XX_HalStpLwr_ResetTestStepCnt); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_SpiSendCReg0", Mt_CddStp88XX_HalStpLwr_SpiSendCReg0); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_SpiSendCReg1", Mt_CddStp88XX_HalStpLwr_SpiSendCReg0); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_SpiSendCReg2", Mt_CddStp88XX_HalStpLwr_SpiSendCReg0); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_SpiSendCReg3", Mt_CddStp88XX_HalStpLwr_SpiSendCReg3); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_SpiSendCReg4", Mt_CddStp88XX_HalStpLwr_SpiSendCReg4); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_SpiSendCReg5", Mt_CddStp88XX_HalStpLwr_SpiSendCReg5); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_SpiSendCReg6", Mt_CddStp88XX_HalStpLwr_SpiSendCReg6); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_IsDriverReset", Mt_CddStp88XX_HalStpLwr_IsDriverReset); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_ClrDriverReset", Mt_CddStp88XX_HalStpLwr_ClrDriverReset); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_SetDriverReset", Mt_CddStp88XX_HalStpLwr_SetDriverReset); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_IncOLCnt_", Mt_CddStp88XX_HalStpLwr_IncOLCnt_); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_IsOLCntMax_", Mt_CddStp88XX_HalStpLwr_IsOLCntMax_); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_IncSCCnt_", Mt_CddStp88XX_HalStpLwr_IncSCCnt_); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_IsSCCntMax_", Mt_CddStp88XX_HalStpLwr_IsSCCntMax_); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_GetPsensPort", Mt_CddStp88XX_HalStpLwr_GetPsensPort); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_IsStateTestStep_", Mt_CddStp88XX_HalStpLwr_IsStateTestStep_); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_GetWriteIx", Mt_CddStp88XX_HalStpLwr_GetWriteIx); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_GetPhaseCounter", Mt_CddStp88XX_HalStpLwr_GetPhaseCounter); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_HandleMotEn_", Mt_CddStp88XX_HalStpLwr_HandleMotEn_); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_StopStp_", Mt_CddStp88XX_HalStpLwr_StopStp_); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_StopStp", Mt_CddStp88XX_HalStpLwr_StopStp); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_SendCReg3", Mt_CddStp88XX_HalStpLwr_SendCReg3); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_SendCReg4", Mt_CddStp88XX_HalStpLwr_SendCReg4); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_SendCRegAll", Mt_CddStp88XX_HalStpLwr_SendCRegAll); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_HandleCurAmplt_", Mt_CddStp88XX_HalStpLwr_HandleCurAmplt_); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_GetCurAmplt", Mt_CddStp88XX_HalStpLwr_GetCurAmplt); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_HandleInc", Mt_CddStp88XX_HalStpLwr_HandleInc); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_HandleDir", Mt_CddStp88XX_HalStpLwr_HandleDir); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_GetPause", Mt_CddStp88XX_HalStpLwr_GetPause); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_HandleTestStep", Mt_CddStp88XX_HalStpLwr_HandleTestStep); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_HandleCommonStep", Mt_CddStp88XX_HalStpLwr_HandleCommonStep); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_TransFct_TestStepHoldCont", Mt_CddStp88XX_HalStpLwr_TransFct_TestStepHoldCont); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_TransFct_LastStep", Mt_CddStp88XX_HalStpLwr_TransFct_LastStep); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_TransFct_Step", Mt_CddStp88XX_HalStpLwr_TransFct_Step); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_TransFct_StepHold", Mt_CddStp88XX_HalStpLwr_TransFct_StepHold); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_TransFct_HoldHoldCont", Mt_CddStp88XX_HalStpLwr_TransFct_HoldHoldCont); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_StateFct_Init", Mt_CddStp88XX_HalStpLwr_StateFct_Init); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_StateFct_FirstStep", Mt_CddStp88XX_HalStpLwr_StateFct_FirstStep); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_StateFct_LastStep", Mt_CddStp88XX_HalStpLwr_StateFct_LastStep); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_StateFct_Step", Mt_CddStp88XX_HalStpLwr_StateFct_Step); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_StateFct_Hold", Mt_CddStp88XX_HalStpLwr_StateFct_Hold); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_StateFct_HoldCont", Mt_CddStp88XX_HalStpLwr_StateFct_HoldCont); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpLwr_StateFct_TestStep", Mt_CddStp88XX_HalStpLwr_StateFct_TestStep); ALUnitTest_AddFunction("Mt_StpTimer0Notification", Mt_StpTimer0Notification); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpVer_TimerCb", Mt_CddStp88XX_HalStpVer_TimerCb); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpVer_TimerHelpCb", Mt_CddStp88XX_HalStpVer_TimerHelpCb); ALUnitTest_AddFunction("Mt_CddStp88XX_HalStpVer_ErrnCb", Mt_CddStp88XX_HalStpVer_ErrnCb); // ************* CddStp8899Com.h **************************** ALUnitTest_AddFunction("Mt_CddStp8899Com_CheckStReady", Mt_CddStp8899Com_CheckStReady); ALUnitTest_AddFunction("Mt_CddStp8899Com_StReqSingle", Mt_CddStp8899Com_StReqSingle); ALUnitTest_AddFunction("Mt_CddStp8899Com_GetCRegRxMotEn", Mt_CddStp8899Com_GetCRegRxMotEn); // ************* CddStp8899Com.c **************************** ALUnitTest_AddFunction("Mt_CddStp_SpiRx", Mt_CddStp_SpiRx); ALUnitTest_AddFunction("Mt_CddStp8899Com_SpiRx", Mt_CddStp8899Com_SpiRx); ALUnitTest_AddFunction("Mt_CddStp_SpiTx", Mt_CddStp_SpiTx); ALUnitTest_AddFunction("Mt_CddStp8899Com_SpiTx", Mt_CddStp8899Com_SpiTx); ALUnitTest_AddFunction("Mt_CddStp_GetStpConfigMask", Mt_CddStp_GetStpConfigMask); ALUnitTest_AddFunction("Mt_CddStp_GetStpConfig", Mt_CddStp_GetStpConfig); ALUnitTest_AddFunction("Mt_CddStp8899Com_GetSRegBsc", Mt_CddStp8899Com_GetSRegBsc); ALUnitTest_AddFunction("Mt_CddStp8899Com_GetSRegFlt", Mt_CddStp8899Com_GetSRegFlt); ALUnitTest_AddFunction("Mt_CddStp8899Com_GetSRegDiag1", Mt_CddStp8899Com_GetSRegDiag1); ALUnitTest_AddFunction("Mt_CddStp8899Com_GetSRegDiag2", Mt_CddStp8899Com_GetSRegDiag2); ALUnitTest_AddFunction("Mt_CddStp8899Com_GetSRegDiag12", Mt_CddStp8899Com_GetSRegDiag12); ALUnitTest_AddFunction("Mt_CddStp8899Com_GetSRegFltDiag2", Mt_CddStp8899Com_GetSRegFltDiag2); ALUnitTest_AddFunction("Mt_CddStp8899Com_GetSRegBscFltDiag12", Mt_CddStp8899Com_GetSRegBscFltDiag12); ALUnitTest_AddFunction("Mt_CddStp8899Com_CheckSpiComSt0", Mt_CddStp8899Com_CheckSpiComSt0); ALUnitTest_AddFunction("Mt_CddStp8899Com_Simulation_HandleSpiRxStatusBits", Mt_CddStp8899Com_Simulation_HandleSpiRxStatusBits); // ************* CddStp8899Temp.c **************************** ALUnitTest_AddFunction("Mt_CddStp8899Temp_CheckLowTemp", Mt_CddStp8899Temp_CheckLowTemp); ALUnitTest_AddFunction("Mt_CddStp88XXTemp_StateMachine", Mt_CddStp88XXTemp_StateMachine); ALUnitTest_AddFunction("Mt_CddStp8899Temp_TransitionInitNorm", Mt_CddStp8899Temp_TransitionInitNorm); ALUnitTest_AddFunction("Mt_CddStp8899Temp_TransitionNormLow", Mt_CddStp8899Temp_TransitionNormLow); ALUnitTest_AddFunction("Mt_CddStp8899Temp_TransitionNormHigh", Mt_CddStp8899Temp_TransitionNormHigh); ALUnitTest_AddFunction("Mt_CddStp8899Temp_TransitionLowNorm", Mt_CddStp8899Temp_TransitionLowNorm); ALUnitTest_AddFunction("Mt_CddStp8899Temp_TransitionHighNorm", Mt_CddStp8899Temp_TransitionHighNorm); ALUnitTest_AddFunction("Mt_CddStp8899Temp_TransitionLowHigh", Mt_CddStp8899Temp_TransitionLowHigh); ALUnitTest_AddFunction("Mt_CddStp8899Temp_StateFctInit", Mt_CddStp8899Temp_StateFctInit); ALUnitTest_AddFunction("Mt_CddStp8899Temp_StateFctNorm", Mt_CddStp8899Temp_StateFctNorm); ALUnitTest_AddFunction("Mt_CddStp8899Temp_StateFctLow", Mt_CddStp8899Temp_StateFctLow); ALUnitTest_AddFunction("Mt_CddStp8899Temp_StateFctHigh", Mt_CddStp8899Temp_StateFctHigh); // ************* CddStp88XX.h **************************** // inline functions ALUnitTest_AddFunction("Mt_CddStp88XX_SetTgtVal", Mt_CddStp88XX_SetTgtVal); ALUnitTest_AddFunction("Mt_CddStp88XX_ActPosIsValid", Mt_CddStp88XX_ActPosIsValid); ALUnitTest_AddFunction("Mt_CddStp88XX_GetActPos", Mt_CddStp88XX_GetActPos); ALUnitTest_AddFunction("Mt_CddStp88XX_GetNumOfSteppers_EFT", Mt_CddStp88XX_GetNumOfSteppers_EFT); ALUnitTest_AddFunction("Mt_CddStp88XX_GetNumOfSteppers_Coding", Mt_CddStp88XX_GetNumOfSteppers_Coding); ALUnitTest_AddFunction("Mt_CddStp88XX_GetBitsMod", Mt_CddStp88XX_GetBitsMod); ALUnitTest_AddFunction("Mt_CddStp88XX_GetBits", Mt_CddStp88XX_GetBits); ALUnitTest_AddFunction("Mt_CddStp88XX_GetLastDeviation", Mt_CddStp88XX_GetLastDeviation); // ************* CddStpPrj.c **************************** ALUnitTest_AddFunction("Mt_CddStpPrjLwr_CalcRemainingTicks", Mt_CddStpPrjLwr_CalcRemainingTicks); ALUnitTest_AddFunction("Mt_CddStpPrj_SetEventFinishMove", Mt_CddStpPrj_SetEventFinishMove); // ************* CddStp_Tsp.c **************************** ALUnitTest_AddFunction("Mt_CddStp_Tsp_Init", Mt_CddStp_Tsp_Init); ALUnitTest_AddFunction("Mt_CddStp_Tsp_Start", Mt_CddStp_Tsp_Start); ALUnitTest_AddFunction("Mt_CddStp_Tsp_Stop", Mt_CddStp_Tsp_Stop); ALUnitTest_AddFunction("Mt_CddStp_Tsp_GetTicks", Mt_CddStp_Tsp_GetTicks); // ************* CddStp_Simulation.c **************************** #ifdef CDDSTP_CFG_SIMULATION // defined in '.\Asr6\Src\Src_AL\Cust\Bw\Bw16\App\Bsw\Cdd\CddStp\CddStpPrj.h' ALUnitTest_AddFunction("Mt_CddStp_Simulation_IsSimActive", Mt_CddStp_Simulation_IsSimActive); ALUnitTest_AddFunction("Mt_CddStp_Simulation_HandleVBatt_EcuSupply", Mt_CddStp_Simulation_HandleVBatt_EcuSupply); ALUnitTest_AddFunction("Mt_CddStp_Simulation_HandleSpiRxStatusBits", Mt_CddStp_Simulation_HandleSpiRxStatusBits); ALUnitTest_AddFunction("Mt_CddStp_Simulation_HandleStatusRegisters", Mt_CddStp_Simulation_HandleStatusRegisters); ALUnitTest_AddFunction("Mt_CddStp_Simulation_HandleDriverDefect_FatalError", Mt_CddStp_Simulation_HandleDriverDefect_FatalError); ALUnitTest_AddFunction("Mt_CddStp_Simulation_HandleLowTempMode", Mt_CddStp_Simulation_HandleLowTempMode); ALUnitTest_AddFunction("Mt_CddStp_Simulation_PreEvalStallDtctn", Mt_CddStp_Simulation_PreEvalStallDtctn); ALUnitTest_AddFunction("Mt_CddStp_Simulation_PreEvalStallDtctn_ReadCodingOnce", Mt_CddStp_Simulation_PreEvalStallDtctn_ReadCodingOnce); ALUnitTest_AddFunction("Mt_CddStp_Simulation_PreEvalStallDtctn_SetCodingParams", Mt_CddStp_Simulation_PreEvalStallDtctn_SetCodingParams); ALUnitTest_AddFunction("Mt_CddStp_Simulation_PreEvalStallDtctn_GetCodingParams", Mt_CddStp_Simulation_PreEvalStallDtctn_GetCodingParams); ALUnitTest_AddFunction("Mt_CddStp_Simulation_PreEvalStallDtctn_GetControlRegs", Mt_CddStp_Simulation_PreEvalStallDtctn_GetControlRegs); ALUnitTest_AddFunction("Mt_CddStp_Simulation_PreEvalStallDtctn_SetPosAtStall", Mt_CddStp_Simulation_PreEvalStallDtctn_SetPosAtStall); ALUnitTest_AddFunction("Mt_CddStp_Simulation_PreEvalStallDtctn_GetPosAtStall", Mt_CddStp_Simulation_PreEvalStallDtctn_GetPosAtStall); ALUnitTest_AddFunction("Mt_CddStp_Simulation_PreEvalStallDtctn_GetWriteCReg6Once", Mt_CddStp_Simulation_PreEvalStallDtctn_GetWriteCReg6Once); ALUnitTest_AddFunction("Mt_CddStp_Simulation_PreEvalStallDtctn_GetWriteClrFltOnce", Mt_CddStp_Simulation_PreEvalStallDtctn_GetWriteClrFltOnce); ALUnitTest_AddFunction("Mt_CddStp_Simulation_PreEvalStallDtctn_GetWriteStlLrn", Mt_CddStp_Simulation_PreEvalStallDtctn_GetWriteStlLrn); ALUnitTest_AddFunction("Mt_CddStp_Simulation_PreEvalStallDtctn_ResetStlLrn", Mt_CddStp_Simulation_PreEvalStallDtctn_ResetStlLrn); ALUnitTest_AddFunction("Mt_CddStp_Simulation_PreEvalStallDtctn_GetStpSpeed", Mt_CddStp_Simulation_PreEvalStallDtctn_GetStpSpeed); #endif // CDDSTP_CFG_SIMULATION // ************* CddStp8889A_StallDetection.c **************************** ALUnitTest_AddFunction("Mt_CddStp8889A_StallDetection_Enable", Mt_CddStp8889A_StallDetection_Enable); ALUnitTest_AddFunction("Mt_CddStp8889A_StallDetection_IsStalled", Mt_CddStp8889A_StallDetection_IsStalled); ALUnitTest_AddFunction("Mt_CddStp8889A_StallDetection_ResetStalled", Mt_CddStp8889A_StallDetection_ResetStalled); ALUnitTest_AddFunction("Mt_CddStp8889A_StallDetection_SetCurrentTrqCnt", Mt_CddStp8889A_StallDetection_SetCurrentTrqCnt); ALUnitTest_AddFunction("Mt_CddStp8889A_StallDetection_CheckStatReg", Mt_CddStp8889A_StallDetection_CheckStatReg); ALUnitTest_AddFunction("Mt_CddStp8889A_StallDetection_CheckCoding", Mt_CddStp8889A_StallDetection_CheckCoding); ALUnitTest_AddFunction("Mt_CddStp8889A_StallDetection_IsEnabled", Mt_CddStp8889A_StallDetection_IsEnabled); } // EOF