Skip to content

Commit

Permalink
Fixes nasa#274, NumOfChildTasks not decremented
Browse files Browse the repository at this point in the history
Fixes nasa#274, NumOfChildTasks not decremented

Fixes nasa#274, NumOfChildTasks not decremented
  • Loading branch information
dmknutsen committed Jan 30, 2020
1 parent ba69ce9 commit de3bf37
Showing 1 changed file with 12 additions and 27 deletions.
39 changes: 12 additions & 27 deletions fsw/cfe-core/unit-test/es_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -4306,8 +4306,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;
Expand All @@ -4318,6 +4318,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;

Expand Down Expand Up @@ -4795,33 +4797,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;
}
Expand Down

0 comments on commit de3bf37

Please sign in to comment.