diff --git a/fsw/cfe-core/unit-test/es_UT.c b/fsw/cfe-core/unit-test/es_UT.c index d1754ee62..a6c14dfa2 100644 --- a/fsw/cfe-core/unit-test/es_UT.c +++ b/fsw/cfe-core/unit-test/es_UT.c @@ -39,6 +39,7 @@ ** Includes */ #include "es_UT.h" +#include extern CFE_ES_PerfData_t *Perf; extern CFE_ES_Global_t CFE_ES_Global; @@ -4306,8 +4307,8 @@ void TestAPI(void) char CDSName[CFE_MISSION_ES_CDS_MAX_NAME_LENGTH + 2]; int i; uint32 ExceptionContext = 0; - int32 Return; - uint8 Data[12]; + int32 Return; + uint8 Data[12]; uint32 ResetType; uint32 *ResetTypePtr; uint32 AppId; @@ -4318,6 +4319,8 @@ void TestAPI(void) uint32 CounterCount; CFE_ES_CDSHandle_t CDSHandle; CFE_ES_TaskInfo_t TaskInfo; + int32 DeleteChildResult; + int32 DeleteChildTestResult = 0xFFFFFFFF; CFE_ES_AppInfo_t AppInfo; @@ -4795,33 +4798,16 @@ void TestAPI(void) /* Test successfully deleting a child task */ ES_ResetUnitTest(); CFE_ES_Global.TaskTable[1].RecordUsed = true; - CFE_ES_Global.TaskTable[1].AppId = 15; - - CFE_ES_Global.TaskTable[16].RecordUsed = true; - CFE_ES_Global.TaskTable[16].AppId = 15; - CFE_ES_Global.TaskTable[17].RecordUsed = true; - CFE_ES_Global.TaskTable[17].AppId = 15; - CFE_ES_Global.TaskTable[17].TaskId = 25; - CFE_ES_Global.TaskTable[18].RecordUsed = true; - CFE_ES_Global.TaskTable[18].AppId = 15; - CFE_ES_Global.AppTable[15].AppState = CFE_ES_AppState_RUNNING; - CFE_ES_Global.AppTable[15].TaskInfo.MainTaskId = 25; - - OS_TaskCreate(&CFE_ES_Global.TaskTable[16].TaskId, NULL, NULL, NULL, - 0, 0, 0); - + CFE_ES_Global.TaskTable[1].AppId = 0; + CFE_ES_Global.AppTable[0].AppState = CFE_ES_AppState_RUNNING; + CFE_ES_Global.AppTable[0].TaskInfo.MainTaskId = 15; + OS_TaskCreate(&CFE_ES_Global.TaskTable[1].TaskId, NULL, NULL, NULL, + 0, 0, 0); + DeleteChildResult = CFE_ES_DeleteChildTask(CFE_ES_Global.TaskTable[1].TaskId); CFE_ES_GetAppInfo(&AppInfo,CFE_ES_Global.TaskTable[1].AppId); - uint32 NumORegTasksTemp = CFE_ES_Global.RegisteredTasks; - uint32 NumOChildTastTemp1 = AppInfo.NumOfChildTasks; - - int32 DeleteChildResult = CFE_ES_DeleteChildTask(CFE_ES_Global.TaskTable[1].TaskId); - int32 DeleteChildTestResult = 0xFFFFFFFF; - - CFE_ES_GetAppInfo(&AppInfo,CFE_ES_Global.TaskTable[1].AppId); - uint32 NumOChildTastTemp2 = AppInfo.NumOfChildTasks; - if( DeleteChildResult == CFE_SUCCESS && CFE_ES_Global.RegisteredTasks == NumORegTasksTemp - 1 - && NumOChildTastTemp2 == NumOChildTastTemp1 - 1 ) + if( DeleteChildResult == CFE_SUCCESS && CFE_ES_Global.RegisteredTasks == 15 + && AppInfo.NumOfChildTasks == 0 ) { DeleteChildTestResult = CFE_SUCCESS; }