#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include tieMountingSide ieMountingSide; tisMxSegStatusError isMxSegStatusError; teucAlsCmdAfsLmpMd ucSigPrepSignal_AFS_LmpMd; tesAdbEcuLeftLampCmdUap AdbEcuLeftLampCmdUap; tisMxSegStatusError isMxSegStatusError; tesAdbEcuLeftLampCmdUap AdbEcuLeftLampCmdUap; tisHighBeamFct isHighBeamFct; tisMatrixLedTgt isMatrixLedTgt; tisStepperTgt isStepperTgt; //tisAfsModeReq AfsModeReq; tesLhsLeftLampFeedback1Uap LhsLeftLampFeedback1Uap; tesRhsRightLampFeedBack1 RhsRightLampFeedBack1; int val = 0; uint8 value = 0u; uint8 g_DataRead = 1; STATIC_AL uint32 g_ReturnValue = (uint32)RTE_E_OK; extern void SigPrep_Init(void); extern void SigPrep_DeInit(void); //- MsgADBECURightLampCMD - extern void SigPrep_initSignalData_ADBECU_RightLampCMD(void); //-- Helper for initialization extern void SigPrepRxForwardPrepare_ADBECU_RightLampCMD(tisHighBeamFct* const other, SigPrep_EnumErrorIndicationType eErr); extern Std_ReturnType SigPrepRxForwardToPxa_ADBECU_RightLampCMD(SigPrep_EnumErrorIndicationType eErr); extern void SigPrep_CAN1CANRxRightCmdMsg(void); extern void SigPrep_CAN1CANRxLeftCmdMsg(void); extern void SigPrep_CAN1CANRxAlsCmdMsg(void); extern void SigPrep_CAN1CANRxLeftLedLevel_1Msg(void); extern void SigPrep_CAN1CANRxLeftLedLevel_2Msg(void); extern void SigPrep_CAN1CANRxRightLedLevel_1Msg(void); extern void SigPrep_CAN1CANRxRightLedLevel_2Msg(void); extern void SigPrep_GetHBFaultErrorSts(boolean *HBLEDStatusVal, boolean *ECUStatusVal); //-- RightLampLed1Level ----- void MT_SigPrepRxProcessMsg_RightLampLedLevel_1(void); //---SigPrep_MsgLampFeedBack1Tx void MT_SigPrep_GetLedStatusError(void); const tRomPara_CodingArea applicationCodingData; //---AlsCmdMsg-- Std_ReturnType change_retVal(uint8 value) { if (value == 0) { return RTE_E_OK; } else if (value == 1) { return RTE_E_NOK; } } SigPrep_EnumErrorIndicationType change_value(int val) { if (val == 0) { return eSigPrepErrNone; } else if (val == 1) { return eSigPrepErrIndRteTimeout; } else if (val == 2) { return eSigPrepErrIndRteAliveCounter; } else if (val == 3) { return eSigPrepErrIndRteCrc; } } //---------------------------------------------------------------------- //mmmmm Src\Src_AL\Cust\Bw\Bw16\Swc\SigPrep\SigPrep.c //---------------------------------------------------------------------- //----------------------------------------------------------------------------- /// \Test Case : MT_riSigPrepInit /// /// \Functional Safety: NA /// /// \Test methods: /// - Requirements-based test /// \Test Case Description /// - Test subject: /// Check if the function riSigPrepInit calls SigPrep_Init /// Access internal SigPrep data mg_SigPrep_isInitialized /// - Test Design Technique: ET (Exploratory Testing) /// /// - Preconditions: none /// /// - Expected result: After the initializaiton, the variable mg_SigPrep_isInitialized shall be true indicating the /// the intialization process is done and the mounting side is correctly set. ///----------------------------------------------------------------------------- void MT_riSigPrepInit(void) { extern boolean mg_SigPrep_isInitialized; extern boolean mg_SigPrep_isRightHandEcu; mg_SigPrep_isRightHandEcu = TRUE; mg_SigPrep_isInitialized = FALSE; //-- call function to test riSigPrepInit(); //-- check initialization AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)TRUE, == ); } //----------------------------------------------------------------------------- /// \Test Case : MT_riSigPrepDeInit /// /// \Functional Safety: NA /// /// \Test methods: /// - Requirements-based test /// \Test Case Description /// - Test subject: /// Check if the function rdSigPrepDeInit calls SigPrep_DeInit /// Access interanl SigPrep data mg_SigPrep_isInitialized /// - Test Design Technique: ET (Exploratory Testing) /// /// - Preconditions: none /// /// - Expected result: After the deinitializaiton, the variable mg_SigPrep_isInitialized shall be false inditating the /// the intialization process hasn't been taken out yet. ///----------------------------------------------------------------------------- void MT_rdSigPrepDeInit(void) { extern boolean mg_SigPrep_isInitialized; mg_SigPrep_isInitialized = TRUE; rdSigPrepDeInit(); //AL_UNITTEST_CHECK((boolean)mg_SigPrep_isInitialized, (boolean)TRUE, == ); //ToDo mg_SigPrep_isInitialized = TRUE; SigPrep_DeInit(); //AL_UNITTEST_CHECK((boolean)mg_SigPrep_isInitialized, (boolean)TRUE, == ); //ToDo } //----------------------------------------------------------------------------- /// \Test Case : MT_SigPrep_isRightEcu /// /// \Functional Safety: NA /// /// \Test methods: /// - Requirements-based test /// /// \Test Case Description /// - Test subject: /// Check if the getter function MT_SigPrep_isRightEcu retuns the correct /// mouting side information. /// /// - Test Design Technique: ET (Exploratory Testing) /// - Preconditions: none /// /// - Expected result: The variable mg_SigPrep_isRightHandEcu is giving out the correct detected mounting side. ///--------------------------------------------------------------------------------------------------------------- void MT_SigPrep_isRightEcu(void) { extern STATIC_AL uint8 mg_SigPrep_isRightHandEcu; //-- SigPrep only ever knows left or right uint8 retVal; mg_SigPrep_isRightHandEcu = TRUE; retVal = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((uint8)retVal, (boolean)TRUE, == ); mg_SigPrep_isRightHandEcu = FALSE; retVal = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((uint8)retVal, (boolean)FALSE, == ); } void MT_SigPrep_isBusOff(void) { extern STATIC_AL boolean mg_SigPrep_isBusOff; boolean retVal; mg_SigPrep_isBusOff = TRUE; retVal = SigPrep_isBusOff(); AL_UNITTEST_CHECK((boolean)retVal, (boolean)TRUE, == ); mg_SigPrep_isBusOff = FALSE; retVal = SigPrep_isBusOff(); AL_UNITTEST_CHECK((boolean)retVal, (boolean)FALSE, == ); } void MT_SigPrep_Cycle10ms(void) { extern STATIC_AL uint8 mg_SigPrep_isRightHandEcu; //-- SigPrep only ever knows left or right uint8 retVal; mg_SigPrep_isRightHandEcu = TRUE; retVal = SigPrep_isRightEcu(); rpSigPrep10ms(); SigPrep_Cycle10ms(); AL_UNITTEST_CHECK((uint8)retVal, (boolean)TRUE, == ); mg_SigPrep_isRightHandEcu = TRUE; for (int i = 0; i < 8; i++) { SigPrep_Cycle10ms_Status(); } mg_SigPrep_isRightHandEcu = FALSE; for (int i = 0; i < 10; i++) { SigPrep_Cycle10ms_Status(); } } //----------------------------------------------------------------------------- /// \Test Case : MT_rrCan1AdbEcuRightLampLedLevel1Msg /// \Functional Safety: NA /// /// \Test methods: /// - Requirements-based test /// \Test Case Description /// - Test subject: /// Test CAN PDU handler /// Invoke cyclic function with normal /// - Test Design Technique:ET (Exploratory Testing) /// /// input: RET read returns success. The test verifies that state and /// monitor show no error. /// - Preconditions: none /// /// -Expected result: Standard behaviour shall be performed after initialization ///------------------------------------------------------------------------------------------------------------------- //-------------------SigPrep_MsgADBECURightLampLedLevel_1.c------------------------ void MT_rrCan1AdbEcuRightLampLedLevel1Msg(void) { extern boolean mg_SigPrep_isRightHandEcu; boolean ret; riSigPrepInit(); mg_SigPrep_isRightHandEcu = TRUE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)TRUE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((boolean)ret, (boolean)TRUE, == ); Std_ReturnType readRetCode = RTE_E_OK; tSigPrepCanMsg_ADBECU_RightLampLedLevel_1 msg_ADBECU_RightLampLedLevel_1; E2E_GaaStatusUpdate[6] = 1; rrCan1AdbEcuRightLampLedLevel1Msg(); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.quality.state, (int)eSigPrepPduState_Passed, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.quality.monitor.monitorAliveCounter.monitorFail.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.quality.monitor.monitorAliveCounter.monitorDTC.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.quality.monitor.monitorCrc.monitorFail.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.quality.monitor.monitorCrc.monitorDTC.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.quality.monitor.monitorRteTimeout.monitorFail.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.quality.monitor.monitorRteTimeout.monitorDTC.isDebounced, (int)FALSE, == ); SigPrepRxProcessMsg_LeftLampLedLevel1(); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_RIGHT; val = 0; value = 1; rrCan1AdbEcuRightLampLedLevel1Msg(); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_UNKNOWN; val = 1; value = 2; msg_ADBECU_RightLampLedLevel_1.quality.state = eSigPrepPduState_Failed; rrCan1AdbEcuRightLampLedLevel1Msg(); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_UNKNOWN; val = 0; value = 0; rrCan1AdbEcuRightLampLedLevel1Msg(); } void MT_SigPrep_initSignalData_ADBECU_RightLampLedLevel_1(void) { tSigPrepCanMsg_ADBECU_RightLampLedLevel_1 msg_ADBECU_RightLampLedLevel_1; SigPrep_initSignalData_ADBECU_RightLampLedLevel_1(); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed1Level.value, (int)SIGPREP_RIGHTLAMPLedLevel_1_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed2Level.value, (int)SIGPREP_RIGHTLAMPLedLevel_1_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed3Level.value, (int)SIGPREP_RIGHTLAMPLedLevel_1_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed4Level.value, (int)SIGPREP_RIGHTLAMPLedLevel_1_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed5Level.value, (int)SIGPREP_RIGHTLAMPLedLevel_1_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed6Level.value, (int)SIGPREP_RIGHTLAMPLedLevel_1_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLedLevel_1_CheckSum.value, (int)SIGPREP_RIGHTLAMPLedLevel_1_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLedLevel_1_MessageCnt.value, (int)SIGPREP_RIGHTLAMPLedLevel_1_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed1Level.valueOld, (int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed1Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed2Level.valueOld, (int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed2Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed3Level.valueOld, (int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed3Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed4Level.valueOld, (int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed4Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed5Level.valueOld, (int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed5Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed6Level.valueOld, (int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed6Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLedLevel_1_CheckSum.valueOld, (int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLedLevel_1_CheckSum.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLedLevel_1_MessageCnt.valueOld, (int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLedLevel_1_MessageCnt.value, == ); } //RTE Port defination// uint8 SigPrepMock_getDataRead(void) { return g_DataRead; } FUNC(uint32, ctaaSigPrep_CODE) E2EPW_Read_ctaaSigPrep_ppsreCan1RxAdbEcuLeftLampCmd_sAdbEcuLeftLampCmdUap(P2VAR(tesAdbEcuLeftLampCmdUap, AUTOMATIC, RTE_APPL_DATA)pData) { pData = (tesAdbEcuLeftLampCmdUap*)SigPrepMock_getDataRead(); return (Std_ReturnType)g_ReturnValue; } FUNC(uint32, ctaaSigPrep_CODE) E2EPW_Write_ctaaSigPrep_ppsseCan1TxLhsLeftLampFeedback1_sLhsLeftlampfeedback1(P2VAR(tesLhsLeftLampFeedback1Uap, AUTOMATIC, RTE_APPL_DATA)pData) { pData = (tesLhsLeftLampFeedback1Uap*)SigPrepMock_getDataRead(); return (Std_ReturnType)g_ReturnValue; } FUNC(uint32, ctaaSigPrep_CODE) E2EPW_Read_ctaaSigPrep_ppsreCan1RxAdbEcuLeftLampLedLevel1_sAdbEcuLeftlampledlevel1(P2VAR(tesAdbEcuLeftLampLedLevel1Uap, AUTOMATIC, RTE_APPL_DATA)pData) { pData = (tesAdbEcuLeftLampLedLevel1Uap*)SigPrepMock_getDataRead(); return (Std_ReturnType)g_ReturnValue; } FUNC(uint32, ctaaSigPrep_CODE) E2EPW_Read_ctaaSigPrep_ppsreCan1RxAdbEcuRightLampLedLevel2_sAdbEcuRightlampledlevel2(P2VAR(tesAdbEcuRightLampLedLevel2Uap, AUTOMATIC, RTE_APPL_DATA)pData) { pData = (tesAdbEcuRightLampLedLevel2Uap*)SigPrepMock_getDataRead(); return (Std_ReturnType)g_ReturnValue; } FUNC(uint32, ctaaSigPrep_CODE) E2EPW_Read_ctaaSigPrep_ppsreCan1RxAdbEcuLeftLampLedLevel2_sAdbEcuLeftlampledlevel2(P2VAR(tesAdbEcuLeftLampLedLevel2Uap, AUTOMATIC, RTE_APPL_DATA)pData) { pData = (tesAdbEcuLeftLampLedLevel2Uap*)SigPrepMock_getDataRead(); return (Std_ReturnType)g_ReturnValue; } FUNC(uint32, ctaaSigPrep_CODE) E2EPW_Read_ctaaSigPrep_ppsreCan1RxAdbEcuRightLampLedLevel1_sAdbEcuRightlampledlevel1(P2VAR(tesAdbEcuRightLampLedLevel1Uap, AUTOMATIC, RTE_APPL_DATA)pData) { pData = (tesAdbEcuRightLampLedLevel1Uap*)SigPrepMock_getDataRead(); return (Std_ReturnType)g_ReturnValue; } FUNC(uint32, ctaaSigPrep_CODE) E2EPW_Write_ctaaSigPrep_ppsseCan1TxRhsRightLampFeedback1_sRhsRightlampfeedback1(P2VAR(tesRhsRightLampFeedBack1, AUTOMATIC, RTE_APPL_DATA)pData) { pData = (tesRhsRightLampFeedBack1*)SigPrepMock_getDataRead(); return (Std_ReturnType)g_ReturnValue; } FUNC(uint32, ctaaSigPrep_CODE) E2EPW_Read_ctaaSigPrep_ppsreCan1RxAlsCmd_sAlsCmd(P2VAR(tesAlsCmdUap, AUTOMATIC, RTE_APPL_DATA)pData) { pData = (tesAlsCmdUap*)SigPrepMock_getDataRead(); return (Std_ReturnType)g_ReturnValue; } FUNC(uint32, ctaaSigPrep_CODE) E2EPW_Read_ctaaSigPrep_ppsreCan1RxAdbEcuRightLampCmd_sAdbEcuRightlampcmd(P2VAR(tesAdbEcuRightLampCmdUap, AUTOMATIC, RTE_APPL_DATA)pData) { pData = (tesAdbEcuRightLampCmdUap*)SigPrepMock_getDataRead(); return (Std_ReturnType)g_ReturnValue; } FUNC(Std_ReturnType, RTE_CODE)Rte_Read_ctaaSigPrep_ppareSysMonCan1CanStatusError0_sVal(P2VAR(tisCanStatusError, AUTOMATIC, RTE_APPL_DATA)pData) { pData = (tisCanStatusError*)SigPrepMock_getDataRead(); return (Std_ReturnType)g_ReturnValue; } FUNC(Std_ReturnType, RTE_CODE)Rte_Read_ppareAdbHighBeamSts_sHighBeamFctSts(P2VAR(tisHighBeamFctSts, AUTOMATIC, RTE_APPL_DATA)pData) { pData = (tisHighBeamFctSts*)SigPrepMock_getDataRead(); return (Std_ReturnType)g_ReturnValue; } FUNC(Std_ReturnType, RTE_CODE)Rte_Read_ppareCodMCodingDataStatus0_eCompleteCodingDataStatus(P2VAR(tieDataStatus, AUTOMATIC, RTE_APPL_DATA)pData) { pData = (tieDataStatus*)SigPrepMock_getDataRead(); return (Std_ReturnType)g_ReturnValue; } void MT_SigPrepRxProcessMsg_RightLampLedLevel_1(void) { Std_ReturnType retVal = RTE_E_OK; retVal = SigPrepRxProcessMsg_RightLampLedLevel_1(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); } void MT_SigPrepRxProcessMsg_RightLampLed2Level(void) { Std_ReturnType retVal = RTE_E_OK; retVal = SigPrepRxProcessMsg_RightLampLedLevel_2(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); } void MT_SigPrep_CAN1CANRxRightCmdMsg(void) { Std_ReturnType retVal = RTE_E_OK; extern STATIC_AL uint8 mg_SigPrep_isRightHandEcu; uint8 ret; extern SigPrep_EnumErrorIndicationType eErr; //left side status riSigPrepInit(); mg_SigPrep_isRightHandEcu = TRUE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)TRUE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((uint8)ret, (boolean)TRUE, == ); val = E2E_PHSTATUS_WRONGCRC; SigPrep_CAN1CANRxRightCmdMsg(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); } void MT_SigPrepRxForwardToPxa_ADBECU_RightLampLedLevel_1(void) { Std_ReturnType retVal = RTE_E_OK; extern STATIC_AL tSigPrepCanMsg_ADBECU_RightLampLedLevel_1 msg_ADBECU_RightLampLedLevel_1; retVal = SigPrepRxForwardToPxa_ADBECU_RightLampLedLevel_1(0); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_NOK, == ); msg_ADBECU_RightLampLedLevel_1.quality.state = eSigPrepPduState_Failed; SigPrepRxForwardToPxa_ADBECU_RightLampLedLevel_1(1); SigPrepRxForwardToPxa_ADBECU_RightLampLedLevel_1(2); SigPrepRxForwardToPxa_ADBECU_RightLampLedLevel_1(3); } void MT_SigPrepRxForwardPrepare_ADBECU_RightLampLedLevel_1(void) { tSigPrepCanMsg_ADBECU_RightLampLedLevel_1 msg_ADBECU_RightLampLedLevel_1; tisMatrixLedTgt SigPrepRx_ADB_MatrixLedTgt; msg_ADBECU_RightLampLedLevel_1.quality.state = eSigPrepPduState_Failed; SigPrepRxForwardPrepare_ADBECU_LeftLampLedLevel_1(0); /*AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget, (int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed1Level.valueOld, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[1], (int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed2Level.valueOld, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[2], (int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed3Level.valueOld, == );*/ //ToDo AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[3], (int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed4Level.valueOld, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[4], (int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed5Level.valueOld, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[5], (int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed6Level.valueOld, == ); //AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.eLed_0_5_Qty, (int)msg_ADBECU_RightLampLedLevel_1.quality.state, == ); msg_ADBECU_RightLampLedLevel_1.quality.state = eSigPrepPduState_Passed; SigPrepRxForwardPrepare_ADBECU_LeftLampLedLevel_1(0); /*AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[0], (int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed1Level.value, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[1], (int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed2Level.value, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[2], (int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed3Level.value, == );*/ //ToDo AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[3], (int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed4Level.value, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[4], (int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed5Level.value, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[5], (int)msg_ADBECU_RightLampLedLevel_1.data.sig_RightLampLed6Level.value, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.eLed_0_5_Qty, (int)msg_ADBECU_RightLampLedLevel_1.quality.state, == ); } //----------------------SigPrep_MsgADBECURightLampLedLevel_2.c--------------------------- void MT_rrCan1AdbEcuRightLampLedLevel2Msg(void) { extern boolean mg_SigPrep_isRightHandEcu; boolean ret; riSigPrepInit(); mg_SigPrep_isRightHandEcu = TRUE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)TRUE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((boolean)ret, (boolean)TRUE, == ); Std_ReturnType readRetCode = RTE_E_OK; extern tSigPrepCanMsg_ADBECU_RightLampLedLevel_2 msg_ADBECU_RightLampLedLevel_2; E2E_GaaStatusUpdate[7] = 1; rrCan1AdbEcuRightLampLedLevel2Msg(); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.quality.state, (int)eSigPrepPduState_Passed, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.quality.monitor.monitorAliveCounter.monitorFail.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.quality.monitor.monitorAliveCounter.monitorDTC.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.quality.monitor.monitorCrc.monitorFail.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.quality.monitor.monitorCrc.monitorDTC.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.quality.monitor.monitorRteTimeout.monitorFail.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.quality.monitor.monitorRteTimeout.monitorDTC.isDebounced, (int)FALSE, == ); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_RIGHT; val = 0; value = 1; rrCan1AdbEcuRightLampLedLevel2Msg(); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_UNKNOWN; val = 1; value = 2; msg_ADBECU_RightLampLedLevel_2.quality.state = eSigPrepPduState_Failed; rrCan1AdbEcuRightLampLedLevel2Msg(); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_UNKNOWN; val = 0; value = 0; rrCan1AdbEcuRightLampLedLevel2Msg(); } void MT_SigPrep_initSignalData_ADBECU_RightLampLedLevel_2(void) { tSigPrepCanMsg_ADBECU_RightLampLedLevel_2 msg_ADBECU_RightLampLedLevel_2; SigPrep_initSignalData_ADBECU_RightLampLedLevel_2(); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLed7Level.value, (int)SIGPREP_RIGHTLAMPLedLevel_2_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLed8Level.value, (int)SIGPREP_RIGHTLAMPLedLevel_2_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLed9Level.value, (int)SIGPREP_RIGHTLAMPLedLevel_2_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLed10Level.value, (int)SIGPREP_RIGHTLAMPLedLevel_2_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLed11Level.value, (int)SIGPREP_RIGHTLAMPLedLevel_2_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLed12Level.value, (int)SIGPREP_RIGHTLAMPLedLevel_2_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLedLevel_2_CheckSum.value, (int)SIGPREP_RIGHTLAMPLedLevel_2_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLedLevel_2_MessageCnt.value, (int)SIGPREP_RIGHTLAMPLedLevel_2_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLed7Level.valueOld, (int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLed7Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLed8Level.valueOld, (int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLed8Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLed9Level.valueOld, (int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLed9Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLed10Level.valueOld, (int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLed10Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLed11Level.valueOld, (int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLed11Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLed12Level.valueOld, (int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLed12Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLedLevel_2_CheckSum.valueOld, (int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLedLevel_2_CheckSum.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLedLevel_2_MessageCnt.valueOld, (int)msg_ADBECU_RightLampLedLevel_2.data.sig_RightLampLedLevel_2_MessageCnt.value, == ); } void MT_SigPrep_CAN1CANRxLeftLedLevel_2Msg(void) { Std_ReturnType retVal = RTE_E_OK; extern STATIC_AL uint8 mg_SigPrep_isRightHandEcu; uint8 ret; //right side status riSigPrepInit(); mg_SigPrep_isRightHandEcu = TRUE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)TRUE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((uint8)ret, (boolean)TRUE, == ); val = E2E_PHSTATUS_WRONGCRC; SigPrep_CAN1CANRxLeftLedLevel_2Msg(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); } void MT_SigPrepRxForwardToPxa_ADBECU_RightLampLedLevel_2(void) { Std_ReturnType retVal = RTE_E_OK; retVal = SigPrepRxForwardToPxa_ADBECU_RightLampLedLevel_2(0); //AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); //ToDo extern STATIC_AL tSigPrepCanMsg_ADBECU_RightLampLedLevel_2 msg_ADBECU_RightLampLedLevel_2; msg_ADBECU_RightLampLedLevel_2.quality.state = eSigPrepPduState_Failed; SigPrepRxForwardToPxa_ADBECU_RightLampLedLevel_2(1); SigPrepRxForwardToPxa_ADBECU_RightLampLedLevel_2(2); SigPrepRxForwardToPxa_ADBECU_RightLampLedLevel_2(3); } //------------- SigPrep_MsgADBECURightLampCMD.c----------- void MT_rrCan1AdbEcuRightLampCmdMsg(void) { extern boolean mg_SigPrep_isRightHandEcu; boolean ret; riSigPrepInit(); mg_SigPrep_isRightHandEcu = TRUE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)TRUE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((boolean)ret, (boolean)TRUE, == ); Std_ReturnType readRetCode = RTE_E_OK; extern tSigPrepCanMsg_ADBECU_RightLampCMD msg_ADBECU_RightLampCMD; E2E_GaaStatusUpdate[5] = 1; rrCan1AdbEcuRightLampCmdMsg(); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampCMD.quality.state, (int)eSigPrepPduState_Passed, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampCMD.quality.monitor.monitorAliveCounter.monitorFail.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampCMD.quality.monitor.monitorAliveCounter.monitorDTC.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampCMD.quality.monitor.monitorCrc.monitorFail.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampCMD.quality.monitor.monitorCrc.monitorDTC.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampCMD.quality.monitor.monitorRteTimeout.monitorFail.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampCMD.quality.monitor.monitorRteTimeout.monitorDTC.isDebounced, (int)FALSE, == ); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_RIGHT; val = 0; value = 1; rrCan1AdbEcuRightLampCmdMsg(); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_RIGHT; val = 0; value = 1; msg_ADBECU_RightLampCMD.quality.state = eSigPrepPduState_Failed; rrCan1AdbEcuRightLampCmdMsg(); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_UNKNOWN; val = 0; value = 0; rrCan1AdbEcuRightLampCmdMsg(); } void MT_SigPrep_initSignalData_ADBECU_RightLampCMD(void) { tSigPrepCanMsg_ADBECU_RightLampCMD msg_ADBECU_RightLampCMD; SigPrep_initSignalData_ADBECU_RightLampCMD(); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampCMD.data.sig_RightCmd.value, (int)SIGPREP_RIGHTLAMPCMD_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampCMD.data.sig_RightLevelValid.value, (int)SIGPREP_RIGHTLAMPCMD_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampCMD.data.sig_RightCmdValid.value, (int)SIGPREP_RIGHTLAMPCMD_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampCMD.data.sig_RightLampCMD_CheckSum.value, (int)SIGPREP_RIGHTLAMPCMD_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampCMD.data.sig_RightLampCMD_MessageCnt.value, (int)SIGPREP_RIGHTLAMPCMD_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampCMD.data.sig_RightCmd.valueOld, (int)msg_ADBECU_RightLampCMD.data.sig_RightCmd.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampCMD.data.sig_RightLevelValid.valueOld, (int)msg_ADBECU_RightLampCMD.data.sig_RightLevelValid.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampCMD.data.sig_RightCmdValid.valueOld, (int)msg_ADBECU_RightLampCMD.data.sig_RightCmdValid.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampCMD.data.sig_RightLampCMD_CheckSum.valueOld, (int)msg_ADBECU_RightLampCMD.data.sig_RightLampCMD_CheckSum.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_RightLampCMD.data.sig_RightLampCMD_MessageCnt.valueOld, (int)msg_ADBECU_RightLampCMD.data.sig_RightLampCMD_MessageCnt.value, == ); } void MT_SigPrepRxForwardToPxa_ADBECU_RightLampCMD(void) { Std_ReturnType retVal = RTE_E_OK; extern STATIC_AL tSigPrepCanMsg_ADBECU_RightLampCMD msg_ADBECU_RightLampCMD; retVal = SigPrepRxForwardToPxa_ADBECU_RightLampCMD(0); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); msg_ADBECU_RightLampCMD.quality.state = eSigPrepPduState_Failed; SigPrepRxForwardToPxa_ADBECU_RightLampCMD(1); SigPrepRxForwardToPxa_ADBECU_RightLampCMD(2); SigPrepRxForwardToPxa_ADBECU_RightLampCMD(3); } void MT_SigPrepRxProcessMsg_RightLampCmd(void) { Std_ReturnType retVal = RTE_E_OK; retVal = SigPrepRxProcessMsg_RightLampCmd(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); } void MT_SigPrepRx_HighBeamRightLampCmd_GetQty(void) { boolean retVal; tisHighBeamFct mg_RightLampCMD_Other_module; mg_RightLampCMD_Other_module.eHighBeamQty = 0; retVal = SigPrepRx_HighBeamRightLampCmd_GetQty(); AL_UNITTEST_CHECK((boolean)retVal, (boolean)FALSE, == ); } // -----------------SigPrep_MsgADBECULeftLampLedLevel_1.c--------------------------- void MT_rrCan1AdbEcuLeftLampLedLevel1Msg(void) { extern boolean mg_SigPrep_isRightHandEcu; boolean ret; riSigPrepInit(); mg_SigPrep_isRightHandEcu = FALSE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)FALSE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((boolean)ret, (boolean)FALSE, == ); Std_ReturnType readRetCode = RTE_E_OK; extern tSigPrepCanMsg_ADBECU_LeftLampLedLevel_1 msg_ADBECU_LeftLampLedLevel_1; E2E_GaaStatusUpdate[6] = 1; rrCan1AdbEcuLeftLampLedLevel1Msg(); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.quality.state, (int)eSigPrepPduState_Passed, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.quality.monitor.monitorAliveCounter.monitorFail.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.quality.monitor.monitorAliveCounter.monitorDTC.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.quality.monitor.monitorCrc.monitorFail.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.quality.monitor.monitorCrc.monitorDTC.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.quality.monitor.monitorRteTimeout.monitorFail.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.quality.monitor.monitorRteTimeout.monitorDTC.isDebounced, (int)FALSE, == ); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_LEFT; val = 0; value = 1; rrCan1AdbEcuLeftLampLedLevel1Msg(); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_UNKNOWN; val = 1; value = 2; msg_ADBECU_LeftLampLedLevel_1.quality.state = eSigPrepPduState_Failed; rrCan1AdbEcuLeftLampLedLevel1Msg(); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_UNKNOWN; val = 0; value = 0; rrCan1AdbEcuLeftLampLedLevel1Msg(); } void MT_SigPrep_initSignalData_ADBECU_LeftLampLedLevel_1(void) { tSigPrepCanMsg_ADBECU_LeftLampLedLevel_1 msg_ADBECU_LeftLampLedLevel_1; SigPrep_initSignalData_ADBECU_LeftLampLedLevel_1(); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed1Level.value, (int)SIGPREP_LEFTLAMPLedLevel_1_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed2Level.value, (int)SIGPREP_LEFTLAMPLedLevel_1_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed3Level.value, (int)SIGPREP_LEFTLAMPLedLevel_1_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed4Level.value, (int)SIGPREP_LEFTLAMPLedLevel_1_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed5Level.value, (int)SIGPREP_LEFTLAMPLedLevel_1_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed6Level.value, (int)SIGPREP_LEFTLAMPLedLevel_1_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLedLevel_1_CheckSum.value, (int)SIGPREP_LEFTLAMPLedLevel_1_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLedLevel_1_MessageCnt.value, (int)SIGPREP_LEFTLAMPLedLevel_1_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed1Level.valueOld, (int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed1Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed2Level.valueOld, (int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed2Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed3Level.valueOld, (int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed3Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed4Level.valueOld, (int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed4Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed5Level.valueOld, (int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed5Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed6Level.valueOld, (int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed6Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLedLevel_1_CheckSum.valueOld, (int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLedLevel_1_CheckSum.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLedLevel_1_MessageCnt.valueOld, (int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLedLevel_1_MessageCnt.value, == ); } void MT_SigPrepRxForwardPrepare_ADBECU_LeftLampLedLevel_1(void) { tSigPrepCanMsg_ADBECU_LeftLampLedLevel_1 msg_ADBECU_LeftLampLedLevel_1; tisMatrixLedTgt SigPrepRx_ADB_MatrixLedTgt; msg_ADBECU_LeftLampLedLevel_1.quality.state = eSigPrepPduState_Failed; SigPrepRxForwardPrepare_ADBECU_LeftLampLedLevel_1(0); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[0], (int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed1Level.valueOld, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[1], (int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed2Level.valueOld, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[2], (int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed3Level.valueOld, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[3], (int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed4Level.valueOld, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[4], (int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed5Level.valueOld, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[5], (int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed6Level.valueOld, == ); //AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.eLed_0_5_Qty, (int)msg_ADBECU_LeftLampLedLevel_1.quality.state, == ); //------failed------- msg_ADBECU_LeftLampLedLevel_1.quality.state = eSigPrepPduState_Passed; SigPrepRxForwardPrepare_ADBECU_LeftLampLedLevel_1(0); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[0], (int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed1Level.value, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[1], (int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed2Level.value, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[2], (int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed3Level.value, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[3], (int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed4Level.value, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[4], (int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed5Level.value, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[5], (int)msg_ADBECU_LeftLampLedLevel_1.data.sig_LeftLampLed6Level.value, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.eLed_0_5_Qty, (int)msg_ADBECU_LeftLampLedLevel_1.quality.state, == ); } void MT_SigPrepRxForwardToPxa_ADBECU_LeftLampLedLevel_1(void) { Std_ReturnType retVal = RTE_E_OK; extern STATIC_AL tSigPrepCanMsg_ADBECU_LeftLampLedLevel_1 msg_ADBECU_LeftLampLedLevel_1; retVal = SigPrepRxForwardToPxa_ADBECU_LeftLampLedLevel_1(0); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); msg_ADBECU_LeftLampLedLevel_1.quality.state = eSigPrepPduState_Failed; SigPrepRxForwardToPxa_ADBECU_LeftLampLedLevel_1(1); SigPrepRxForwardToPxa_ADBECU_LeftLampLedLevel_1(2); SigPrepRxForwardToPxa_ADBECU_LeftLampLedLevel_1(3); } //----------------SigPrep_MsgADBECULeftLampLedLevel_2.c---------------------------- void MT_rrCan1AdbEcuLeftLampLedLevel2Msg(void) { extern boolean mg_SigPrep_isRightHandEcu; boolean ret; riSigPrepInit(); mg_SigPrep_isRightHandEcu = FALSE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)FALSE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((boolean)ret, (boolean)FALSE, == ); Std_ReturnType readRetCode = RTE_E_OK; extern tSigPrepCanMsg_ADBECU_LeftLampLedLevel_2 msg_ADBECU_LeftLampLedLevel_2; E2E_GaaStatusUpdate[7] = 1; rrCan1AdbEcuLeftLampLedLevel2Msg(); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.quality.state, (int)eSigPrepPduState_Passed, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.quality.monitor.monitorAliveCounter.monitorFail.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.quality.monitor.monitorAliveCounter.monitorDTC.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.quality.monitor.monitorCrc.monitorFail.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.quality.monitor.monitorCrc.monitorDTC.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.quality.monitor.monitorRteTimeout.monitorFail.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.quality.monitor.monitorRteTimeout.monitorDTC.isDebounced, (int)FALSE, == ); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_LEFT; val = 0; value = 1; rrCan1AdbEcuLeftLampLedLevel2Msg(); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_UNKNOWN; val = 1; value = 2; msg_ADBECU_LeftLampLedLevel_2.quality.state = eSigPrepPduState_Failed; rrCan1AdbEcuLeftLampLedLevel2Msg(); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_UNKNOWN; val = 0; value = 0; rrCan1AdbEcuLeftLampLedLevel2Msg(); } void MT_SigPrep_initSignalData_ADBECU_LeftLampLedLevel_2(void) { tSigPrepCanMsg_ADBECU_LeftLampLedLevel_2 msg_ADBECU_LeftLampLedLevel_2; SigPrep_initSignalData_ADBECU_LeftLampLedLevel_2(); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed7Level.value, (int)SIGPREP_LEFTLAMPLedLevel_2_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed8Level.value, (int)SIGPREP_LEFTLAMPLedLevel_2_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed9Level.value, (int)SIGPREP_LEFTLAMPLedLevel_2_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed10Level.value, (int)SIGPREP_LEFTLAMPLedLevel_2_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed11Level.value, (int)SIGPREP_LEFTLAMPLedLevel_2_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed12Level.value, (int)SIGPREP_LEFTLAMPLedLevel_2_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLedLevel_2_CheckSum.value, (int)SIGPREP_LEFTLAMPLedLevel_2_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLedLevel_2_MessageCnt.value, (int)SIGPREP_LEFTLAMPLedLevel_2_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed7Level.valueOld, (int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed7Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed8Level.valueOld, (int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed8Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed9Level.valueOld, (int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed9Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed10Level.valueOld, (int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed10Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed11Level.valueOld, (int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed11Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed12Level.valueOld, (int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed12Level.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLedLevel_2_CheckSum.valueOld, (int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLedLevel_2_CheckSum.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLedLevel_2_MessageCnt.valueOld, (int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLedLevel_2_MessageCnt.value, == ); } void MT_SigPrepRxForwardToPxa_ADBECU_LeftLampLedLevel_2(void) { Std_ReturnType retVal = RTE_E_OK; extern STATIC_AL tSigPrepCanMsg_ADBECU_LeftLampLedLevel_2 msg_ADBECU_LeftLampLedLevel_2; retVal = SigPrepRxForwardToPxa_ADBECU_LeftLampLedLevel_2(0); msg_ADBECU_LeftLampLedLevel_2.quality.state = eSigPrepPduState_Failed; SigPrepRxForwardToPxa_ADBECU_LeftLampLedLevel_2(1); SigPrepRxForwardToPxa_ADBECU_LeftLampLedLevel_2(2); SigPrepRxForwardToPxa_ADBECU_LeftLampLedLevel_2(3); } void MT_SigPrepRxForwardPrepare_ADBECU_LeftLampLedLevel_2(void) { tSigPrepCanMsg_ADBECU_LeftLampLedLevel_2 msg_ADBECU_LeftLampLedLevel_2; tisMatrixLedTgt SigPrepRx_ADB_MatrixLedTgt; msg_ADBECU_LeftLampLedLevel_2.quality.state = eSigPrepPduState_Failed; SigPrepRxForwardPrepare_ADBECU_LeftLampLedLevel_2(0); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[6], (int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed7Level.valueOld, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[7], (int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed8Level.valueOld, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[8], (int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed9Level.valueOld, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[9], (int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed10Level.valueOld, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[10], (int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed11Level.valueOld, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[11], (int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed12Level.valueOld, == ); //AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.eLed_6_11_Qty, (int)msg_ADBECU_LeftLampLedLevel_2.quality.state, == ); //-----failed----- msg_ADBECU_LeftLampLedLevel_2.quality.state = eSigPrepPduState_Passed; SigPrepRxForwardPrepare_ADBECU_LeftLampLedLevel_2(0); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[6], (int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed7Level.value, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[7], (int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed8Level.value, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[8], (int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed9Level.value, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[9], (int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed10Level.value, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[10], (int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed11Level.value, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.aucLedTarget[11], (int)msg_ADBECU_LeftLampLedLevel_2.data.sig_LeftLampLed12Level.value, == ); AL_UNITTEST_CHECK((int)SigPrepRx_ADB_MatrixLedTgt.eLed_6_11_Qty, (int)msg_ADBECU_LeftLampLedLevel_2.quality.state, == ); } void MT_SigPrepRxProcessMsg_LeftLampLedLevel_2(void) { Std_ReturnType retVal = RTE_E_OK; retVal = SigPrepRxProcessMsg_LeftLampLedLevel_2(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); } //----------SigPrep_MsgADBECULeftLampCMD.c--------------- void MT_rrCan1AdbEcuLeftLampCmdMsg(void) { extern boolean mg_SigPrep_isRightHandEcu; boolean ret; riSigPrepInit(); mg_SigPrep_isRightHandEcu = FALSE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)FALSE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((boolean)ret, (boolean)FALSE, == ); Std_ReturnType readRetCode = RTE_E_OK; extern tSigPrepCanMsg_ADBECU_LeftLampCMD msg_ADBECU_LeftLampCMD;; E2E_GaaStatusUpdate[5] = 1; rrCan1AdbEcuLeftLampCmdMsg(); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampCMD.quality.state, (int)eSigPrepPduState_PreFailed, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampCMD.quality.monitor.monitorAliveCounter.monitorFail.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampCMD.quality.monitor.monitorAliveCounter.monitorDTC.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampCMD.quality.monitor.monitorCrc.monitorFail.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampCMD.quality.monitor.monitorCrc.monitorDTC.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampCMD.quality.monitor.monitorRteTimeout.monitorFail.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampCMD.quality.monitor.monitorRteTimeout.monitorDTC.isDebounced, (int)FALSE, == ); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_LEFT; val = 0; value = 1; rrCan1AdbEcuLeftLampCmdMsg(); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_UNKNOWN; val = 1; value = 2; msg_ADBECU_LeftLampCMD.quality.state = eSigPrepPduState_Failed; rrCan1AdbEcuLeftLampCmdMsg(); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_UNKNOWN; val = 0; value = 0; rrCan1AdbEcuLeftLampCmdMsg(); } void MT_SigPrep_initSignalData_ADBECU_LeftLampCMD(void) { tSigPrepCanMsg_ADBECU_LeftLampCMD msg_ADBECU_LeftLampCMD; SigPrep_initSignalData_ADBECU_LeftLampCMD(); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampCMD.data.sig_LeftCmd.value, (int)SIGPREP_LEFTLAMPCMD_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampCMD.data.sig_LeftLevelValid.value, (int)SIGPREP_LEFTLAMPCMD_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampCMD.data.sig_LeftCmdValid.value, (int)SIGPREP_LEFTLAMPCMD_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampCMD.data.sig_LeftLampCMD_CheckSum.value, (int)SIGPREP_LEFTLAMPCMD_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampCMD.data.sig_LeftLampCMD_MessageCnt.value, (int)SIGPREP_LEFTLAMPCMD_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampCMD.data.sig_LeftCmd.valueOld, (int)msg_ADBECU_LeftLampCMD.data.sig_LeftCmd.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampCMD.data.sig_LeftLevelValid.valueOld, (int)msg_ADBECU_LeftLampCMD.data.sig_LeftLevelValid.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampCMD.data.sig_LeftCmdValid.valueOld, (int)msg_ADBECU_LeftLampCMD.data.sig_LeftCmdValid.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampCMD.data.sig_LeftLampCMD_CheckSum.valueOld, (int)msg_ADBECU_LeftLampCMD.data.sig_LeftLampCMD_CheckSum.value, == ); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampCMD.data.sig_LeftLampCMD_MessageCnt.valueOld, (int)msg_ADBECU_LeftLampCMD.data.sig_LeftLampCMD_MessageCnt.value, == ); } void MT_SigPrep_CAN1CANRxLeftCmdMsg(void) { Std_ReturnType retVal = RTE_E_OK; extern STATIC_AL uint8 mg_SigPrep_isRightHandEcu; uint8 ret; extern SigPrep_EnumErrorIndicationType eErr; //left side status riSigPrepInit(); mg_SigPrep_isRightHandEcu = FALSE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)FALSE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((uint8)ret, (boolean)FALSE, == ); val = E2E_PHSTATUS_WRONGCRC; SigPrep_CAN1CANRxLeftCmdMsg(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); val = eSigPrepErrNone; SigPrep_CAN1CANRxLeftCmdMsg(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); } void MT_SigPrepRx_MsgADB_ForwardPrepare_HighBeamFct(void) { extern STATIC_AL tisHighBeamFct mg_LeftLampCMD_Other_module; uint8 ucCmdValid = SIGPREPRX_ADB_CMDVALID_VALID; uint8 ucCmd = SIGPREPRX_ADB_CMD_ADBMODE; uint8 ucLevelValid = SIGPREPRX_ADB_LEVELVALID_VALID; SigPrepRx_MsgADB_ForwardPrepare_HighBeamFct(ucCmd, ucLevelValid, ucCmdValid, &mg_LeftLampCMD_Other_module); AL_UNITTEST_CHECK(mg_LeftLampCMD_Other_module.eHighBeamMode, PARTIAL, == ); ucCmdValid =SIGPREPRX_ADB_CMDVALID_VALID; ucCmd = SIGPREPRX_ADB_CMD_NORMALHIGHBEAM; SigPrepRx_MsgADB_ForwardPrepare_HighBeamFct(ucCmd, ucLevelValid, ucCmdValid, &mg_LeftLampCMD_Other_module); AL_UNITTEST_CHECK(mg_LeftLampCMD_Other_module.eHighBeamMode, MANUAL, == ); } void MT_SigPrep_CAN1CANRxRightLedLevel_1Msg(void) { Std_ReturnType retVal = RTE_E_OK; extern STATIC_AL uint8 mg_SigPrep_isRightHandEcu; uint8 ret; //left side status riSigPrepInit(); mg_SigPrep_isRightHandEcu = FALSE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)FALSE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((uint8)ret, (boolean)FALSE, == ); val = E2E_PHSTATUS_WRONGCRC; SigPrep_CAN1CANRxRightLedLevel_1Msg(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); val = eSigPrepErrNone; SigPrep_CAN1CANRxRightLedLevel_1Msg(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); } void MT_SigPrepRxForwardToPxa_ADBECU_LeftLampCMD(void) { Std_ReturnType retVal = RTE_E_OK; extern STATIC_AL tSigPrepCanMsg_ADBECU_LeftLampCMD msg_ADBECU_LeftLampCMD; retVal = SigPrepRxForwardToPxa_ADBECU_LeftLampCMD(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); msg_ADBECU_LeftLampCMD.quality.state = eSigPrepPduState_Failed; SigPrepRxForwardToPxa_ADBECU_LeftLampCMD(1); SigPrepRxForwardToPxa_ADBECU_LeftLampCMD(2); SigPrepRxForwardToPxa_ADBECU_LeftLampCMD(3); } void MT_SigPrepRxProcessMsg_LeftLampCmd(void) { Std_ReturnType retVal = RTE_E_OK; retVal = SigPrepRxProcessMsg_LeftLampCmd(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); } void MT_SigPrepRx_HighBeamLeftLampCmd_GetQty(void) { boolean retVal; tisHighBeamFct mg_LeftLampCMD_Other_module; mg_LeftLampCMD_Other_module.eHighBeamQty = 0; retVal = SigPrepRx_HighBeamLeftLampCmd_GetQty(); AL_UNITTEST_CHECK((boolean)retVal, (boolean)FALSE, == ); } //----------------------------SigPrep_MsgALS_CMD.c------------------------- void MT_rrCan1AlsCmdMsg(void) { Std_ReturnType readRetCode = RTE_E_OK; extern tSigPrepCanMsg_Als_Cmd msg_Als_Cmd; extern boolean mg_SigPrep_isBusOff; extern STATIC_AL uint8 mg_SigPrep_isRightHandEcu; E2E_GaaStatusUpdate[0] = 1; rrCan1AlsCmdMsg(); AL_UNITTEST_CHECK((int)msg_Als_Cmd.quality.state, (int)eSigPrepPduState_Passed, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.quality.monitor.monitorAliveCounter.monitorFail.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.quality.monitor.monitorAliveCounter.monitorDTC.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.quality.monitor.monitorCrc.monitorFail.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.quality.monitor.monitorCrc.monitorDTC.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.quality.monitor.monitorRteTimeout.monitorFail.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.quality.monitor.monitorRteTimeout.monitorDTC.isDebounced, (int)FALSE, == ); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_RIGHT; val = 0; value = 1; rrCan1AlsCmdMsg(); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_UNKNOWN; val = 1; value = 2; msg_Als_Cmd.quality.state = eSigPrepPduState_Failed; mg_SigPrep_isBusOff = TRUE; rrCan1AlsCmdMsg(); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_UNKNOWN; val = 0; value = 0; rrCan1AlsCmdMsg(); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_RIGHT; msg_Als_Cmd.quality.state = eSigPrepPduState_Failed; mg_SigPrep_isBusOff = TRUE; rrCan1AlsCmdMsg(); riSigPrepInit(); mg_SigPrep_isRightHandEcu = SIGPREP_ECUSIDE_LEFT; msg_Als_Cmd.quality.state = eSigPrepPduState_Failed; mg_SigPrep_isBusOff = TRUE; rrCan1AlsCmdMsg(); } void MT_SigPrep_initSignalData_Als_Cmd(void) { tSigPrepCanMsg_Als_Cmd msg_Als_Cmd; SigPrep_initSignalData_Als_Cmd(); AL_UNITTEST_CHECK((int)msg_Als_Cmd.data.sig_Lhs_Lfthdrfrncrun.value, (int)SIGPREP_ALS_CMD_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.data.sig_Lhs_Lfthdlmplvllngstat.value, (int)SIGPREP_ALS_CMD_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.data.sig_Lhs_Lfthdlmplvllngpstn.value, (int)SIGPREP_ALS_CMD_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.data.sig_Rhs_Rghthdrfrncrun.value, (int)SIGPREP_ALS_CMD_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.data.sig_Rhs_Rghthdlmplvllngstat.value, (int)SIGPREP_ALS_CMD_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.data.sig_Rhs_Rghthdlmplvllngpstn.value, (int)SIGPREP_ALS_CMD_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.data.sig_Als_MessageCnt.value, (int)SIGPREP_ALS_CMD_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.data.sig_Als_CheckSum.value, (int)SIGPREP_ALS_CMD_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.data.sig_AFS_LmpMd.value, (int)SIGPREP_ALS_CMD_MESSAGE_INITVAL, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.data.sig_AFS_LmpMd.valueOld, (int)msg_Als_Cmd.data.sig_Lhs_Lfthdrfrncrun.value, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.data.sig_Lhs_Lfthdlmplvllngstat.valueOld, (int)msg_Als_Cmd.data.sig_Lhs_Lfthdlmplvllngstat.value, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.data.sig_Lhs_Lfthdlmplvllngpstn.valueOld, (int)msg_Als_Cmd.data.sig_Lhs_Lfthdlmplvllngpstn.value, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.data.sig_Rhs_Rghthdrfrncrun.valueOld, (int)msg_Als_Cmd.data.sig_Rhs_Rghthdrfrncrun.value, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.data.sig_Rhs_Rghthdlmplvllngstat.valueOld, (int)msg_Als_Cmd.data.sig_Rhs_Rghthdlmplvllngstat.value, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.data.sig_Rhs_Rghthdlmplvllngpstn.valueOld, (int)msg_Als_Cmd.data.sig_Rhs_Rghthdlmplvllngpstn.value, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.data.sig_Als_MessageCnt.valueOld, (int)msg_Als_Cmd.data.sig_Als_MessageCnt.value, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.data.sig_Als_CheckSum.valueOld, (int)msg_Als_Cmd.data.sig_Als_CheckSum.value, == ); AL_UNITTEST_CHECK((int)msg_Als_Cmd.data.sig_AFS_LmpMd.valueOld, (int)msg_Als_Cmd.data.sig_AFS_LmpMd.value, == ); } void MT_SigPrepRxProcessMsg_AlsCmd(void) { Std_ReturnType retVal = RTE_E_OK; extern STATIC_AL uint8 mg_SigPrep_isRightHandEcu; uint8 ret; //left side status riSigPrepInit(); mg_SigPrep_isRightHandEcu = FALSE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)FALSE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((uint8)ret, (boolean)FALSE, == ); retVal = SigPrepRxProcessMsg_AlsCmd(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); //Right side status riSigPrepInit(); mg_SigPrep_isRightHandEcu = TRUE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)TRUE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((boolean)ret, (boolean)TRUE, == ); retVal = SigPrepRxProcessMsg_AlsCmd(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); } void MT_SigPrepRxForwardToCtrlStp_AlsCmd(void) { Std_ReturnType retVal = RTE_E_OK; retVal = SigPrepRxForwardToCtrlStp_AlsCmd(); //AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); //ToDo } void MT_SigPrep_CAN1CANRxAlsCmdMsg(void) { Std_ReturnType retVal = RTE_E_OK; boolean ret; extern SigPrep_EnumErrorIndicationType eErr; //left side status riSigPrepInit(); //AL_UNITTEST_CHECK((boolean)ret, (boolean)TRUE, == ); //ToDo val = eSigPrepErrNone; SigPrep_CAN1CANRxAlsCmdMsg(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); } void MT_SigPrep_CAN1CANRxAlsCmdMsg_error(void) { Std_ReturnType retVal = RTE_E_OK; boolean ret; extern SigPrep_EnumErrorIndicationType eErr; //left side status riSigPrepInit(); //AL_UNITTEST_CHECK((boolean)ret, (boolean)TRUE, == ); //ToDo val = E2E_PHSTATUS_WRONGCRC; SigPrep_CAN1CANRxAlsCmdMsg(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); } void MT_SigPrepRxForwardPrepare_AlsCmd(void) { tSigPrepCanMsg_Als_Cmd msg_Als_Cmd; tisStepperTgt SigPrepStepperTgt; // tisAfsModeReq SigPrepAFSMode; extern STATIC_AL uint8 mg_SigPrep_isRightHandEcu; uint8 ret; SigPrepStepperTgt.eLevellingReqQty = 1U; SigPrepStepperTgt.eLevellingModeReq = 0U; SigPrepStepperTgt.eReferenceReq = 1U; SigPrepStepperTgt.rLevellingPosReq_deg = 1U; SigPrepAFSMode.bfAfsModeReqQty = 1U; SigPrepAFSMode.eAfsMode = 5U; msg_Als_Cmd.quality.state = 3; //left side status //riSigPrepInit(); mg_SigPrep_isRightHandEcu = TRUE; //AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)TRUE, == ); ret = SigPrep_isRightEcu(); //AL_UNITTEST_CHECK((boolean)ret, (boolean)TRUE, == ); //msg_Als_Cmd.quality.state = eSigPrepPduState_Failed; SigPrepRxForwardPrepare_AlsCmd(&SigPrepStepperTgt, &SigPrepAFSMode); AL_UNITTEST_CHECK((int)msg_Als_Cmd.quality.state, (int)eSigPrepPduState_Failed, == ); } void Mt_SigPrep_CAN1CANRxLeftLedLevel_1Msg(void) { Std_ReturnType retVal = RTE_E_OK; extern STATIC_AL uint8 mg_SigPrep_isRightHandEcu; uint8 ret; extern SigPrep_EnumErrorIndicationType eErr; //left side status riSigPrepInit(); mg_SigPrep_isRightHandEcu = FALSE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)FALSE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((uint8)ret, (boolean)FALSE, == ); val = eSigPrepErrNone; SigPrep_CAN1CANRxLeftLedLevel_1Msg(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); } void Mt_SigPrep_CAN1CANRxLeftLedLevel_1Msg_error(void) { Std_ReturnType retVal = RTE_E_OK; extern STATIC_AL uint8 mg_SigPrep_isRightHandEcu; uint8 ret; extern SigPrep_EnumErrorIndicationType eErr; //left side status riSigPrepInit(); mg_SigPrep_isRightHandEcu = FALSE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)FALSE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((uint8)ret, (boolean)FALSE, == ); val = E2E_PHSTATUS_WRONGCRC; SigPrep_CAN1CANRxLeftLedLevel_1Msg(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); } void Mt_SigPrep_CAN1CANRxLeftLedLevel_2Msg(void) { Std_ReturnType retVal = RTE_E_OK; extern STATIC_AL uint8 mg_SigPrep_isRightHandEcu; uint8 ret; extern SigPrep_EnumErrorIndicationType eErr; //left side status riSigPrepInit(); mg_SigPrep_isRightHandEcu = FALSE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)FALSE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((uint8)ret, (boolean)FALSE, == ); val = eSigPrepErrNone; SigPrep_CAN1CANRxLeftLedLevel_2Msg(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); } void Mt_SigPrep_CAN1CANRxLeftLedLevel_2Msg_error(void) { Std_ReturnType retVal = RTE_E_OK; extern STATIC_AL uint8 mg_SigPrep_isRightHandEcu; uint8 ret; extern SigPrep_EnumErrorIndicationType eErr; //left side status riSigPrepInit(); mg_SigPrep_isRightHandEcu = FALSE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)FALSE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((uint8)ret, (boolean)FALSE, == ); val = E2E_PHSTATUS_WRONGCRC; SigPrep_CAN1CANRxLeftLedLevel_2Msg(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); } void Mt_SigPrep_CAN1CANRxRightLedLevel_1Msg(void) { Std_ReturnType retVal = RTE_E_OK; extern STATIC_AL uint8 mg_SigPrep_isRightHandEcu; uint8 ret; extern SigPrep_EnumErrorIndicationType eErr; //left side status riSigPrepInit(); mg_SigPrep_isRightHandEcu = TRUE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)TRUE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((uint8)ret, (boolean)TRUE, == ); val = eSigPrepErrNone; SigPrep_CAN1CANRxRightLedLevel_1Msg(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); } void Mt_SigPrep_CAN1CANRxRightLedLevel_1Msg_error(void) { Std_ReturnType retVal = RTE_E_OK; extern STATIC_AL uint8 mg_SigPrep_isRightHandEcu; uint8 ret; extern SigPrep_EnumErrorIndicationType eErr; //left side status riSigPrepInit(); mg_SigPrep_isRightHandEcu = TRUE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)TRUE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((uint8)ret, (boolean)TRUE, == ); val = E2E_PHSTATUS_WRONGCRC; SigPrep_CAN1CANRxRightLedLevel_1Msg(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); } void Mt_SigPrep_CAN1CANRxRightLedLevel_2Msg(void) { Std_ReturnType retVal = RTE_E_OK; extern STATIC_AL uint8 mg_SigPrep_isRightHandEcu; uint8 ret; extern SigPrep_EnumErrorIndicationType eErr; //left side status riSigPrepInit(); mg_SigPrep_isRightHandEcu = TRUE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)TRUE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((uint8)ret, (boolean)TRUE, == ); val = eSigPrepErrNone; SigPrep_CAN1CANRxRightLedLevel_2Msg(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); } void Mt_SigPrep_CAN1CANRxRightLedLevel_2Msg_error(void) { Std_ReturnType retVal = RTE_E_OK; extern STATIC_AL uint8 mg_SigPrep_isRightHandEcu; uint8 ret; extern SigPrep_EnumErrorIndicationType eErr; //left side status riSigPrepInit(); mg_SigPrep_isRightHandEcu = TRUE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)TRUE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((uint8)ret, (boolean)TRUE, == ); val = E2E_PHSTATUS_WRONGCRC; SigPrep_CAN1CANRxRightLedLevel_2Msg(); AL_UNITTEST_CHECK((int)retVal, (int)RTE_E_OK, == ); } void MT_SigPrepSignalRfrncRun(void) { Std_ReturnType retVal; uint8 ret; extern STATIC_AL uint8 mg_SigPrep_isRightHandEcu; extern tSigPrepCanMsg_Als_Cmd msg_Als_Cmd; //Right side status riSigPrepInit(); mg_SigPrep_isRightHandEcu = TRUE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)TRUE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((uint8)ret, (boolean)TRUE, == ); msg_Als_Cmd.data.sig_Rhs_Rghthdrfrncrun.value = 0; retVal = SigPrepSignalRfrncRun(); AL_UNITTEST_CHECK((int)retVal, (int)1, == ); msg_Als_Cmd.data.sig_Rhs_Rghthdrfrncrun.value = 1; retVal = SigPrepSignalRfrncRun(); AL_UNITTEST_CHECK((int)retVal, (int)2, == ); msg_Als_Cmd.data.sig_Rhs_Rghthdrfrncrun.value = 2; retVal = SigPrepSignalRfrncRun(); AL_UNITTEST_CHECK((int)retVal, (int)3, == ); msg_Als_Cmd.data.sig_Rhs_Rghthdrfrncrun.value = 3; retVal = SigPrepSignalRfrncRun(); AL_UNITTEST_CHECK((int)retVal, (int)4, == ); msg_Als_Cmd.data.sig_Rhs_Rghthdrfrncrun.value = 4; retVal = SigPrepSignalRfrncRun(); AL_UNITTEST_CHECK((int)retVal, (int)0, == ); //left side status riSigPrepInit(); mg_SigPrep_isRightHandEcu = FALSE; AL_UNITTEST_CHECK((boolean)mg_SigPrep_isRightHandEcu, (boolean)FALSE, == ); ret = SigPrep_isRightEcu(); AL_UNITTEST_CHECK((boolean)ret, (boolean)FALSE, == ); msg_Als_Cmd.data.sig_Lhs_Lfthdrfrncrun.value = 0; retVal = SigPrepSignalRfrncRun(); AL_UNITTEST_CHECK((int)retVal, (int)1, == ); msg_Als_Cmd.data.sig_Lhs_Lfthdrfrncrun.value = 1; retVal = SigPrepSignalRfrncRun(); AL_UNITTEST_CHECK((int)retVal, (int)2, == ); msg_Als_Cmd.data.sig_Lhs_Lfthdrfrncrun.value = 2; retVal = SigPrepSignalRfrncRun(); AL_UNITTEST_CHECK((int)retVal, (int)3, == ); msg_Als_Cmd.data.sig_Lhs_Lfthdrfrncrun.value = 3; retVal = SigPrepSignalRfrncRun(); AL_UNITTEST_CHECK((int)retVal, (int)4, == ); msg_Als_Cmd.data.sig_Lhs_Lfthdrfrncrun.value = 4; retVal = SigPrepSignalRfrncRun(); AL_UNITTEST_CHECK((int)retVal, (int)0, == ); } //--------------------------SigPrep_MsgLampFeedBackTx.c---------------------- void MT_SigPrepTx_LampFeedBack_Init(void) { SigPrepTx_LampFeedBack_Init(); SigPrep_Can1TxHB_LED_Status_Left(); } void MT_SigPrep_GetLedStatusError(void) { boolean retval; boolean ut_HBLEDStatusVal = 0u; tisMxSegStatusErrorArr mg_Seg_Status_Error; extern STATIC_AL tisHighBeamFctSts HighBeamSts; mg_Seg_Status_Error[1].eErr = ERR_YES; SigPrep_GetHBFaultErrorSts(&ut_HBLEDStatusVal, &retval); //AL_UNITTEST_CHECK((int)retval, (int)ERR_YES, == ); AL_UNITTEST_CHECK((int)retval, (int)ERR_SNA, == ); retval = SigPrep_GetECUStatusError(); // AL_UNITTEST_CHECK((int)retval, (int)ERR_YES, == ); AL_UNITTEST_CHECK((int)retval, (int)ERR_SNA, == ); HighBeamSts.eHighBeamStsLamp2 = ACT_STS_OFF; SigPrep_GetHBFaultErrorSts(&ut_HBLEDStatusVal, &retval); HighBeamSts.eHighBeamStsLamp2 = ACT_STS_INVALID; SigPrep_GetHBFaultErrorSts(&ut_HBLEDStatusVal, &retval); HighBeamSts.eHighBeamStsLamp2 = ACT_STS_OFF_FAULT_ACTIVE; SigPrep_GetHBFaultErrorSts(&ut_HBLEDStatusVal, &retval); } //---------------------SigPrep_Common.c-------------------- void MT_SigPrep_isInSet_uint8(void) { const uint8 aSetValid[] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF }; const uint32 COUNT = sizeof(aSetValid) / sizeof(aSetValid[0]); uint8 value = 0x2; boolean retVal; retVal = SigPrep_isInSet_uint8(aSetValid, COUNT, value); AL_UNITTEST_CHECK((int)retVal, (int)TRUE, == ); value = 99U; retVal = SigPrep_isInSet_uint8(aSetValid, COUNT, value); AL_UNITTEST_CHECK((int)retVal, (int)FALSE, == ); } void MT_SigPrep_divAndRoundClosest(void) { uint32 result; result = SigPrep_divAndRoundClosest(200U, 100U); AL_UNITTEST_CHECK((int)result, (int)2U, == ); } //-------------------------SigPrepRx.c------------------------------- void MT_SigPrepRx_initPduQualityNonE2E(void) { const uint32 tcyc = 25U; const uint32 tout = 250U; const uint32 CntOnOffDtc = SigPrep_divAndRoundClosest(tout, tcyc); const uint32 CntFailPassState = SigPrep_divAndRoundClosest(CntOnOffDtc, 2U); tSigPrepPduQualityNonE2E quality; SigPrepRx_initPduQualityNonE2E(&quality, tcyc, tout); AL_UNITTEST_CHECK((int)CntOnOffDtc, (int)10U, == ); AL_UNITTEST_CHECK((int)CntFailPassState, (int)5U, == ); AL_UNITTEST_CHECK((int)quality.state, (int)eSigPrepPduState_Init, == ); AL_UNITTEST_CHECK((int)quality.monitor.monitorSelfTimer.isActiveDtc, (int)FALSE, == ); AL_UNITTEST_CHECK((int)quality.monitor.monitorSelfTimer.isTimeout, (int)FALSE, == ); /*AL_UNITTEST_CHECK((int)quality.monitor.monitorSelfTimer.toutActivate, (int)tout, == ); AL_UNITTEST_CHECK((int)quality.monitor.monitorSelfTimer.toutDeActivate, (int)tout, == );*/ //-------failed------- } void MT_SigPrepRx_initPduQualityE2E(void) { const uint32 tcyc = 25U; const uint32 tout = 250U; const uint32 CntOnOffDtc = SigPrep_divAndRoundClosest(tout, tcyc); const uint32 CntFailPassState = SigPrep_divAndRoundClosest(CntOnOffDtc, 2U); tSigPrepPduQualityE2E quality; SigPrepRx_initPduQualityE2E(&quality, tcyc, tout); AL_UNITTEST_CHECK((int)CntOnOffDtc, (int)10U, == ); AL_UNITTEST_CHECK((int)CntFailPassState, (int)5U, == ); AL_UNITTEST_CHECK((int)quality.state, (int)eSigPrepPduState_Init, == ); AL_UNITTEST_CHECK((int)quality.monitor.monitorAliveCounter.monitorDTC.cntActivate, (int)CntOnOffDtc, == ); AL_UNITTEST_CHECK((int)quality.monitor.monitorAliveCounter.monitorDTC.cnt, (int)0U, == ); AL_UNITTEST_CHECK((int)quality.monitor.monitorAliveCounter.monitorDTC.isActiveDtc, (int)FALSE, == ); AL_UNITTEST_CHECK((int)quality.monitor.monitorAliveCounter.monitorDTC.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)quality.monitor.monitorCrc.monitorDTC.cntActivate, (int)CntOnOffDtc, == ); AL_UNITTEST_CHECK((int)quality.monitor.monitorCrc.monitorDTC.cnt, (int)0U, == ); AL_UNITTEST_CHECK((int)quality.monitor.monitorCrc.monitorDTC.isActiveDtc, (int)FALSE, == ); AL_UNITTEST_CHECK((int)quality.monitor.monitorCrc.monitorDTC.isDebounced, (int)FALSE, == ); //AL_UNITTEST_CHECK((int)quality.monitor.monitorRteTimeout.monitorDTC.cntActivate, (int)CntOnOffDtc, == ); AL_UNITTEST_CHECK((int)quality.monitor.monitorRteTimeout.monitorDTC.cnt, (int)0U, == ); AL_UNITTEST_CHECK((int)quality.monitor.monitorRteTimeout.monitorDTC.isActiveDtc, (int)FALSE, == ); AL_UNITTEST_CHECK((int)quality.monitor.monitorRteTimeout.monitorDTC.isDebounced, (int)FALSE, == ); AL_UNITTEST_CHECK((int)quality.monitor.monitorSelfTimer.isActiveDtc, (int)FALSE, == ); AL_UNITTEST_CHECK((int)quality.monitor.monitorSelfTimer.isTimeout, (int)FALSE, == ); AL_UNITTEST_CHECK((int)quality.monitor.monitorSelfTimer.toutActivate, (int)tout, == ); AL_UNITTEST_CHECK((int)quality.monitor.monitorSelfTimer.toutDeActivate, (int)tout, == ); } void MT_SigPrepRx_HandleSignalQualitySuccess(void) { tSigPrepSignalQuality quality; quality.monitor.cnt = 2U; SigPrepRx_HandleSignalQualitySuccess(&quality); AL_UNITTEST_CHECK((int)quality.state, (int)eSigPrepSigState_Valid, == ); AL_UNITTEST_CHECK((int)quality.monitor.cnt, (int)1U, == ); quality.monitor.cnt = 0U; SigPrepRx_HandleSignalQualitySuccess(&quality); AL_UNITTEST_CHECK((int)quality.monitor.isDebounced, (int)FALSE, == ); } void MT_SigPrepRx_HandleSignalQualityFail(void) { tSigPrepSignalQuality quality; quality.monitor.isDebounced = FALSE; quality.monitor.cnt = 0U; quality.monitor.cntActivate = 1U; /*SigPrepRx_HandleSignalQualityFail(&quality); AL_UNITTEST_CHECK((int)quality.monitor.cnt, (int)1U, == );*/ //--------failed---------- quality.monitor.cntActivate = 0U; SigPrepRx_HandleSignalQualityFail(&quality); AL_UNITTEST_CHECK((int)quality.monitor.isDebounced, (int)TRUE, == ); AL_UNITTEST_CHECK((int)quality.state, (int)eSigPrepSigState_Invalid, == ); AL_UNITTEST_CHECK((int)quality.monitor.cnt, (int)quality.monitor.cntDeActivate, == ); quality.monitor.isDebounced = TRUE; quality.monitor.cnt = 0U; quality.monitor.cntDeActivate = 1U; SigPrepRx_HandleSignalQualityFail(&quality); AL_UNITTEST_CHECK((int)quality.monitor.cnt, (int)1U, == ); quality.monitor.cntActivate = 0U; SigPrepRx_HandleSignalQualityFail(&quality); AL_UNITTEST_CHECK((int)quality.state, (int)eSigPrepSigState_Invalid, == ); /*quality.state = eSigPrepSigState_Valid; SigPrepRx_HandleSignalQualityFail(&quality); AL_UNITTEST_CHECK((int)quality.state, (int)eSigPrepSigState_PreInvalid, == );*/ } void MT_SigPrepRx_HandlePduQualityNonE2ESuccess(void) { tSigPrepPduQualityNonE2E quality; quality.monitor.monitorRteTimeout.monitorFail.cnt = 1U; SigPrepRx_HandlePduQualityNonE2ESuccess(&quality); AL_UNITTEST_CHECK((int)quality.state, (int)eSigPrepPduState_Passed, == ); AL_UNITTEST_CHECK((int)quality.monitor.monitorRteTimeout.monitorFail.cnt, (int)0U, == ); } void MT_SigPrepRx_HandlePduQualityCounterMonitorFail(void) { tSigPrepCounterMonitor CntMon; CntMon.isDebounced = FALSE; CntMon.cntActivate = 2U; CntMon.cnt = 1U; /*SigPrepRx_HandlePduQualityCounterMonitorFail(&CntMon); AL_UNITTEST_CHECK((int)CntMon.cnt, (int)2U, == );*/ //-----failed----- CntMon.cntActivate = 1U; CntMon.cnt = 1U; SigPrepRx_HandlePduQualityCounterMonitorFail(&CntMon); AL_UNITTEST_CHECK((int)CntMon.isDebounced, (int)TRUE, == ); CntMon.isDebounced = TRUE; CntMon.cntDeActivate = 1U; CntMon.cnt = 0U; SigPrepRx_HandlePduQualityCounterMonitorFail(&CntMon); AL_UNITTEST_CHECK((int)CntMon.isDebounced, (int)1U, == ); } void MT_SigPrepRx_HandlePduQualityNonE2EFail(void) { tSigPrepPduQualityNonE2E quality; SigPrep_EnumErrorIndicationType eErrIndType; quality.monitor.monitorRteTimeout.monitorFail.isDebounced = TRUE; eErrIndType = 3; quality.monitor.monitorSelfTimer.isTimeout = TRUE; SigPrepRx_HandlePduQualityNonE2EFail(&quality, eSigPrepErrIndRteTimeout); AL_UNITTEST_CHECK((int)quality.state, (int)eSigPrepPduState_Failed, == ); } void MT_SigPrepRx_HandlePduQualityE2EFail(void) { extern STATIC_AL tSigPrepCanMsg_ADBECU_LeftLampCMD msg_ADBECU_LeftLampCMD; msg_ADBECU_LeftLampCMD.quality.state = eSigPrepPduState_PreFailed; msg_ADBECU_LeftLampCMD.quality.monitor.monitorAliveCounter.monitorFail.isDebounced = TRUE; SigPrepRx_HandlePduQualityE2EFail(&msg_ADBECU_LeftLampCMD.quality, 1); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampCMD.quality.state, (int)eSigPrepPduState_Failed, == ); msg_ADBECU_LeftLampCMD.quality.monitor.monitorCrc.monitorFail.isDebounced = TRUE; SigPrepRx_HandlePduQualityE2EFail(&msg_ADBECU_LeftLampCMD.quality, 2); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampCMD.quality.state, (int)eSigPrepPduState_Failed, == ); msg_ADBECU_LeftLampCMD.quality.monitor.monitorRteTimeout.monitorFail.isDebounced = TRUE; SigPrepRx_HandlePduQualityE2EFail(&msg_ADBECU_LeftLampCMD.quality, 3); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampCMD.quality.state, (int)eSigPrepPduState_Failed, == ); SigPrepRx_HandlePduQualityE2EFail(&msg_ADBECU_LeftLampCMD.quality, 4); SigPrepRx_HandlePduQualityE2EFail(&msg_ADBECU_LeftLampCMD.quality, 5); AL_UNITTEST_CHECK((int)msg_ADBECU_LeftLampCMD.quality.state, (int)eSigPrepPduState_Failed, == ); } void Mt_rrSigPrepCan1TxHB_LED_Status_Left(void) { rrSigPrepCan1TxHB_LED_Status_Right(); } void Mt_rrSigPrepCan1TxHB_LED_Status_Right(void) { rrSigPrepCan1TxHB_LED_Status_Left(); } void MT_SigPrepRx_initSignalQuality(void) { extern STATIC_AL tSigPrepCanMsg_ADBECU_RightLampCMD msg_ADBECU_RightLampCMD; SigPrepRx_initSignalQuality(&msg_ADBECU_RightLampCMD.data.sig_RightCmd.quality, SIGPREP_TCYC_RIGHTCmd, SIGPREP_TOUT_RIGHTCmd); } void ALUnitTest_AddTests(void) { ALUnitTest_AddFunction("MT_riSigPrepInit", MT_riSigPrepInit); ALUnitTest_AddFunction("MT_riSigPrepDeInit", MT_rdSigPrepDeInit); ALUnitTest_AddFunction("MT_SigPrep_isRightEcu", MT_SigPrep_isRightEcu); ALUnitTest_AddFunction("MT_SigPrep_isBusOff", MT_SigPrep_isBusOff); ALUnitTest_AddFunction("MT_SigPrep_Cycle10ms", MT_SigPrep_Cycle10ms); ALUnitTest_AddFunction("MT_rrCan1AdbEcuRightLampLedLevel1Msg", MT_rrCan1AdbEcuRightLampLedLevel1Msg); ALUnitTest_AddFunction("MT_SigPrep_initSignalData_ADBECU_RightLampLedLevel_1", MT_SigPrep_initSignalData_ADBECU_RightLampLedLevel_1); ALUnitTest_AddFunction("MT_SigPrepRxProcessMsg_RightLampLedLevel_1", MT_SigPrepRxProcessMsg_RightLampLedLevel_1); //ALUnitTest_AddFunction("MT_SigPrepRxProcessMsg_ADBECU_RightLampLedLevel_1", MT_SigPrepRxProcessMsg_ADBECU_RightLampLedLevel_1); ALUnitTest_AddFunction("MT_SigPrepRxForwardToPxa_ADBECU_RightLampLedLevel_1", MT_SigPrepRxForwardToPxa_ADBECU_RightLampLedLevel_1); ALUnitTest_AddFunction("MT_SigPrepRxForwardPrepare_ADBECU_RightLampLedLevel_1", MT_SigPrepRxForwardPrepare_ADBECU_RightLampLedLevel_1); ALUnitTest_AddFunction("MT_rrCan1AdbEcuRightLampLedLevel2Msg", MT_rrCan1AdbEcuRightLampLedLevel2Msg); ALUnitTest_AddFunction("MT_SigPrep_initSignalData_ADBECU_RightLampLedLevel_2", MT_SigPrep_initSignalData_ADBECU_RightLampLedLevel_2); ALUnitTest_AddFunction("MT_SigPrepRxProcessMsg_LeftLampLedLevel_2", MT_SigPrepRxProcessMsg_LeftLampLedLevel_2); ALUnitTest_AddFunction("MT_SigPrepRxForwardToPxa_ADBECU_RightLampLedLevel_2", MT_SigPrepRxForwardToPxa_ADBECU_RightLampLedLevel_2); ALUnitTest_AddFunction("MT_SigPrepRx_initSignalQuality", MT_SigPrepRx_initSignalQuality); ALUnitTest_AddFunction("MT_rrCan1AdbEcuRightLampCmdMsg", MT_rrCan1AdbEcuRightLampCmdMsg); ALUnitTest_AddFunction("MT_SigPrep_initSignalData_ADBECU_RightLampCMD", MT_SigPrep_initSignalData_ADBECU_RightLampCMD); ALUnitTest_AddFunction("MT_SigPrep_CAN1CANRxRightCmdMsg", MT_SigPrep_CAN1CANRxRightCmdMsg); ALUnitTest_AddFunction("MT_SigPrepRxForwardToPxa_ADBECU_RightLampCMD", MT_SigPrepRxForwardToPxa_ADBECU_RightLampCMD); //ALUnitTest_AddFunction("MT_SigPrepRxForwardPrepare_ADBECU_RightLampCMD", MT_SigPrepRxForwardPrepare_ADBECU_RightLampCMD); ALUnitTest_AddFunction("MT_SigPrepRxProcessMsg_RightLampCmd", MT_SigPrepRxProcessMsg_RightLampCmd); ALUnitTest_AddFunction("MT_SigPrepRx_HighBeamRightLampCmd_GetQty", MT_SigPrepRx_HighBeamRightLampCmd_GetQty); ALUnitTest_AddFunction("MT_SigPrep_CAN1CANRxRightLedLevel_1Msg", MT_SigPrep_CAN1CANRxRightLedLevel_1Msg); ALUnitTest_AddFunction("MT_rrCan1AdbEcuLeftLampLedLevel1Msg", MT_rrCan1AdbEcuLeftLampLedLevel1Msg); ALUnitTest_AddFunction("MT_SigPrepRxForwardPrepare_ADBECU_LeftLampLedLevel_1", MT_SigPrepRxForwardPrepare_ADBECU_LeftLampLedLevel_1); ALUnitTest_AddFunction("MT_SigPrep_initSignalData_ADBECU_LeftLampLedLevel_1", MT_SigPrep_initSignalData_ADBECU_LeftLampLedLevel_1); ALUnitTest_AddFunction("MT_SigPrepRxForwardToPxa_ADBECU_LeftLampLedLevel_1", MT_SigPrepRxForwardToPxa_ADBECU_LeftLampLedLevel_1); ALUnitTest_AddFunction("MT_rrCan1AdbEcuLeftLampLedLevel2Msg", MT_rrCan1AdbEcuLeftLampLedLevel2Msg); ALUnitTest_AddFunction("MT_SigPrep_initSignalData_ADBECU_LeftLampLedLevel_2", MT_SigPrep_initSignalData_ADBECU_LeftLampLedLevel_2); ALUnitTest_AddFunction("MT_SigPrep_CAN1CANRxLeftLedLevel_2Msg", MT_SigPrep_CAN1CANRxLeftLedLevel_2Msg); ALUnitTest_AddFunction("MT_SigPrepRxForwardToPxa_ADBECU_LeftLampLedLevel_2", MT_SigPrepRxForwardToPxa_ADBECU_LeftLampLedLevel_2); ALUnitTest_AddFunction("MT_SigPrepRxForwardPrepare_ADBECU_LeftLampLedLevel_2", MT_SigPrepRxForwardPrepare_ADBECU_LeftLampLedLevel_2); ALUnitTest_AddFunction("MT_rrCan1AdbEcuLeftLampCmdMsg", MT_rrCan1AdbEcuLeftLampCmdMsg); ALUnitTest_AddFunction("MT_SigPrep_initSignalData_ADBECU_LeftLampCMD", MT_SigPrep_initSignalData_ADBECU_LeftLampCMD); ALUnitTest_AddFunction("MT_SigPrep_CAN1CANRxLeftCmdMsg", MT_SigPrep_CAN1CANRxLeftCmdMsg); ALUnitTest_AddFunction("MT_SigPrepRxForwardToPxa_ADBECU_LeftLampCMD", MT_SigPrepRxForwardToPxa_ADBECU_LeftLampCMD); //ALUnitTest_AddFunction("MT_SigPrepRxForwardPrepare_ADBECU_LeftLampCMD", MT_SigPrepRxForwardPrepare_ADBECU_LeftLampCMD); ALUnitTest_AddFunction("MT_SigPrepRx_MsgADB_ForwardPrepare_HighBeamFct", MT_SigPrepRx_MsgADB_ForwardPrepare_HighBeamFct); ALUnitTest_AddFunction("MT_SigPrepRxProcessMsg_LeftLampCmd", MT_SigPrepRxProcessMsg_LeftLampCmd); ALUnitTest_AddFunction("MT_SigPrepRx_HighBeamLeftLampCmd_GetQty", MT_SigPrepRx_HighBeamLeftLampCmd_GetQty); ALUnitTest_AddFunction("MT_rrCan1AlsCmdMsg", MT_rrCan1AlsCmdMsg); ALUnitTest_AddFunction(" MT_SigPrep_initSignalData_Als_Cmd", MT_SigPrep_initSignalData_Als_Cmd); ALUnitTest_AddFunction(" MT_SigPrepRxProcessMsg_AlsCmd", MT_SigPrepRxProcessMsg_AlsCmd); ALUnitTest_AddFunction(" MT_SigPrepRxForwardToCtrlStp_AlsCmd", MT_SigPrepRxForwardToCtrlStp_AlsCmd); ALUnitTest_AddFunction(" MT_SigPrep_CAN1CANRxAlsCmdMsg", MT_SigPrep_CAN1CANRxAlsCmdMsg); ALUnitTest_AddFunction(" MT_SigPrep_CAN1CANRxAlsCmdMsg_error", MT_SigPrep_CAN1CANRxAlsCmdMsg_error); ALUnitTest_AddFunction(" MT_SigPrepSignalRfrncRun", MT_SigPrepSignalRfrncRun); ALUnitTest_AddFunction(" MT_SigPrepRxForwardPrepare_AlsCmd", MT_SigPrepRxForwardPrepare_AlsCmd); ALUnitTest_AddFunction("MT_SigPrepTx_LampFeedBack_Init", MT_SigPrepTx_LampFeedBack_Init); ALUnitTest_AddFunction("MT_SigPrep_GetLedStatusError", MT_SigPrep_GetLedStatusError); ALUnitTest_AddFunction("MT_SigPrep_isInSet_uint8", MT_SigPrep_isInSet_uint8); ALUnitTest_AddFunction("MT_SigPrep_divAndRoundClosest", MT_SigPrep_divAndRoundClosest); ALUnitTest_AddFunction("MT_SigPrepRx_initPduQualityNonE2E", MT_SigPrepRx_initPduQualityNonE2E); ALUnitTest_AddFunction("MT_SigPrepRx_initPduQualityE2E", MT_SigPrepRx_initPduQualityE2E); ALUnitTest_AddFunction("MT_SigPrepRx_HandleSignalQualitySuccess", MT_SigPrepRx_HandleSignalQualitySuccess); ALUnitTest_AddFunction("MT_SigPrepRx_HandleSignalQualityFail", MT_SigPrepRx_HandleSignalQualityFail); ALUnitTest_AddFunction("MT_SigPrepRx_HandlePduQualityNonE2ESuccess", MT_SigPrepRx_HandlePduQualityNonE2ESuccess); ALUnitTest_AddFunction("MT_SigPrepRx_HandlePduQualityCounterMonitorFail", MT_SigPrepRx_HandlePduQualityCounterMonitorFail); ALUnitTest_AddFunction("MT_SigPrepRx_HandlePduQualityNonE2EFail", MT_SigPrepRx_HandlePduQualityNonE2EFail); ALUnitTest_AddFunction("MT_SigPrepRx_HandlePduQualityE2EFail", MT_SigPrepRx_HandlePduQualityE2EFail); ALUnitTest_AddFunction(" Mt_SigPrep_CAN1CANRxLeftLedLevel_1Msg", Mt_SigPrep_CAN1CANRxLeftLedLevel_1Msg); ALUnitTest_AddFunction(" Mt_SigPrep_CAN1CANRxLeftLedLevel_1Msg_error", Mt_SigPrep_CAN1CANRxLeftLedLevel_1Msg_error); ALUnitTest_AddFunction(" Mt_SigPrep_CAN1CANRxLeftLedLevel_2Msg", Mt_SigPrep_CAN1CANRxLeftLedLevel_2Msg); ALUnitTest_AddFunction(" Mt_SigPrep_CAN1CANRxLeftLedLevel_2Msg_error", Mt_SigPrep_CAN1CANRxLeftLedLevel_2Msg_error); ALUnitTest_AddFunction(" Mt_SigPrep_CAN1CANRxRightLedLevel_1Msg", Mt_SigPrep_CAN1CANRxRightLedLevel_1Msg); ALUnitTest_AddFunction(" Mt_SigPrep_CAN1CANRxRightLedLevel_1Msg_error", Mt_SigPrep_CAN1CANRxRightLedLevel_1Msg_error); ALUnitTest_AddFunction(" Mt_SigPrep_CAN1CANRxRightLedLevel_2Msg", Mt_SigPrep_CAN1CANRxRightLedLevel_2Msg); ALUnitTest_AddFunction(" Mt_SigPrep_CAN1CANRxRightLedLevel_2Msg_error", Mt_SigPrep_CAN1CANRxRightLedLevel_2Msg_error); }