/* ** Initialization test, must be called first */ void Test_Init (void) { CFE_EVS_BitMaskCmd_t bitmaskcmd; /* Initialize the CFE_EVS */ CFE_EVS_EarlyInit(); CFE_EVS_TaskMain(); /* make the ES register fail */ UT_SetRtnCode( &ES_RegisterRtn, -1 ,1 ); CFE_EVS_TaskMain(); /* make EVS_LogPtr fail */ UT_SetStatusBSPResetArea(-1, CFE_TIME_RESET_SIGNATURE); CFE_EVS_EarlyInit(); UT_SetStatusBSPResetArea(OS_SUCCESS, CFE_TIME_RESET_SIGNATURE); UT_SetRtnCode(&CreatePoolRtn, -1, 1); CFE_EVS_EarlyInit(); UT_SetRtnCode(&MutSemCreateRtn, -1, 1); CFE_EVS_EarlyInit(); UT_SetRtnCode(&ES_RegisterRtn, -1, 1); CFE_EVS_TaskInit(); UT_SetRtnCode(&SB_CreatePipeRtn, -1, 1); CFE_EVS_TaskInit(); UT_SetRtnCode(&SB_SubscribeExRtn, -1, 1); CFE_EVS_TaskInit(); UT_SetRtnCode(&SB_SubscribeExRtn, -1, 2); CFE_EVS_TaskInit(); /* Get the EVS registration to fail */ UT_SetAppID(10000); CFE_EVS_TaskInit(); /* TEST: initialize the task WARM */ UT_SetAppID(0); CFE_EVS_TaskInit(); /* Disable ports */ bitmaskcmd.BitMask = 0x0F; UT_SetSBTotalMsgLen(sizeof(CFE_EVS_BitMaskCmd_t)); UT_SendMsg((CFE_SB_MsgPtr_t)&bitmaskcmd, CFE_EVS_CMD_MID, CFE_EVS_DISABLE_PORTS_CC); }
/* ** Initialize unit test variables */ void UT_InitData(void) { int i; /* Initialize queue */ for (i = 0; i < OS_MAX_QUEUES; i++) { UT_Queue[i].free = TRUE; UT_Queue[i].size = 0; } UT_ClearEventHistory(); UT_ResetPoolBufferIndex(); UT_SetOSFail(OS_NO_FAIL); UT_SetBSPFail(0); /* Initialize values and counters used for forcing return values * from stubs */ UT_SetRtnCode(&CreatePoolRtn, 0, 0); UT_SetRtnCode(&PoolCreateExRtn, 0, 0); UT_SetRtnCode(&PutPoolRtn, 0, 0); UT_SetRtnCode(&GetPoolRtn, 0, 0); UT_SetRtnCode(&QueuePutRtn, 0, 0); UT_SetRtnCode(&MutSemGiveRtn, 0, 0); UT_SetRtnCode(&MutSemTakeRtn, 0, 0); UT_SetRtnCode(&QueueCreateRtn, 0, 0); UT_SetRtnCode(&BSPWriteCDSRtn, 0, 0); UT_SetRtnCode(&BSPReadCDSRtn, 0, 0); UT_SetRtnCode(&QueueDelRtn, 0, 0); UT_SetRtnCode(&QueueGetRtn, 0, 0); UT_SetRtnCode(&QueuePutRtn, 0, 0); UT_SetRtnCode(&FileWriteRtn, 0, 0); UT_SetRtnCode(&OSReadRtn, 0, 0); UT_SetRtnCode(&OSReadRtn2, 0, 0); UT_SetRtnCode(&SBSendMsgRtn, 0, 0); UT_SetRtnCode(&FSSetTimestampRtn, 0, 0); UT_SetRtnCode(&FSWriteHdrRtn, 0, 0); UT_SetRtnCode(&FSReadHdrRtn, 0, 0); UT_SetRtnCode(&ES_RegisterRtn, 0, 0); UT_SetRtnCode(&ES_CreateChildRtn, 0, 0); UT_SetRtnCode(&SB_SubscribeRtn, 0, 0); UT_SetRtnCode(&SB_SubscribeLocalRtn, 0, 0); UT_SetRtnCode(&SB_CreatePipeRtn, 0, 0); UT_SetRtnCode(&OS_BinSemCreateRtn, 0, 0); UT_SetRtnCode(&EVS_SendEventRtn, 0, 0); UT_SetRtnCode(&EVS_RegisterRtn, 0, 0); UT_SetRtnCode(&SB_SubscribeExRtn, 0, 0); UT_SetRtnCode(&MutSemCreateRtn, 0, 0); UT_SetRtnCode(&OSlseekRtn, 0, 0); UT_SetRtnCode(&CountSemDelRtn, 0, 0); UT_SetRtnCode(&MutSemDelRtn, 0, 0); UT_SetRtnCode(&BinSemDelRtn, 0, 0); UT_SetRtnCode(&BlocksFreeRtn, 0, 0); UT_SetRtnCode(&UnmountRtn, 0, 0); UT_SetRtnCode(&RmfsRtn, 0, 0); UT_SetRtnCode(&BSPUnloadAppFileRtn, 0, 0); UT_SetRtnCode(&SBCleanUpRtn, 0, 0); UT_SetRtnCode(&EVSCleanUpRtn, 0, 0); UT_SetRtnCode(&GetAppIDRtn, 0, 0); UT_SetRtnCode(&BSPGetCFETextRtn, 0, 0); UT_SetRtnCode(&FSIsGzFileRtn, 0, 0); UT_SetRtnCode(&ModuleLoadRtn, 0, 0); UT_SetRtnCode(&ModuleUnloadRtn, 0, 0); UT_SetRtnCode(&ModuleInfoRtn, 0, 0); UT_SetRtnCode(&FSDecompressRtn, 0, 0); UT_SetRtnCode(&FSExtractRtn, 0, 0); UT_SetRtnCode(&SymbolLookupRtn, 0, 0); UT_SetRtnCode(&TIMECleanUpRtn, 0, 0); UT_SetRtnCode(&HeapGetInfoRtn, 0, 0); UT_SetRtnCode(&GetPoolInfoRtn, 0, 0); UT_SetRtnCode(&WriteSysLogRtn, -1, 0); UT_SetRtnCode(&GetResetTypeRtn, 0, 0); UT_SetRtnCode(&SendMsgEventIDRtn, -1, 0); UT_SetRtnCode(&OSPrintRtn, 0, -1); UT_SetRtnCode(&SetMsgIdRtn, 0, 0); UT_SetRtnCode(&OSTaskExitRtn, 0, 0); UT_SetRtnCode(&PSPRestartRtn, 0, 0); UT_SetRtnCode(&OSBinSemTimedWaitRtn, -1, 0); UT_SetRtnCode(&OSBinSemFlushRtn, -1, 0); UT_SetRtnCode(&PSPPanicRtn, 0, 0); UT_SetRtnCode(&TBLEarlyInitRtn, 0, 0); UT_SetRtnCode(&OSCloseRtn, 0, 0); UT_SetRtnCode(&PSPMemValRangeRtn, 0, 0); UT_SetRtnCode(&ES_ExitAppRtn, 0, 0); UT_SetRtnCode(&OSTimerGetInfoRtn, 0, 0); UT_ResetCDS(); }