Skip to content

Commit

Permalink
Fixes nasa#274, NumOfChildTasks not decremented
Browse files Browse the repository at this point in the history
  • Loading branch information
dmknutsen committed Jan 30, 2020
1 parent de3bf37 commit b8ff70f
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions fsw/cfe-core/unit-test/es_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -4318,9 +4318,6 @@ 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;

#ifdef UT_VERBOSE
Expand Down Expand Up @@ -4802,18 +4799,21 @@ void TestAPI(void)
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);

if( DeleteChildResult == CFE_SUCCESS && CFE_ES_Global.RegisteredTasks == 15
&& AppInfo.NumOfChildTasks == 0 )
{
DeleteChildTestResult = CFE_SUCCESS;
}
UT_Report(__FILE__, __LINE__,
DeleteChildTestResult == CFE_SUCCESS,
Return = CFE_ES_GetAppInfo(&AppInfo,CFE_ES_Global.TaskTable[1].AppId);
UtAssert_True(Return == CFE_SUCCESS,
"CFE_ES_GetAppInfo() return=%x", (unsigned int)Return);
UtAssert_True(AppInfo.NumOfChildTasks == 1,
"AppInfo.NumOfChildTaskss == %u", (unsigned int)AppInfo.NumOfChildTasks);
Return = CFE_ES_DeleteChildTask(CFE_ES_Global.TaskTable[1].TaskId);
UtAssert_True(Return == CFE_SUCCESS,
"DeleteChildResult() return=%x", (unsigned int)Return);
Return = CFE_ES_GetAppInfo(&AppInfo,CFE_ES_Global.TaskTable[1].AppId);
UtAssert_True(Return == CFE_SUCCESS,
"CFE_ES_GetAppInfo() return=%x", (unsigned int)Return);
UT_Report(__FILE__, __LINE__,
AppInfo.NumOfChildTasks == 0,
"CFE_ES_DeleteChildTask",
"Delete child task successful");
"NumOfChildTasks = 0 - Delete child task successful");

/* Test deleting a child task with an OS task delete failure */
ES_ResetUnitTest();
Expand Down

0 comments on commit b8ff70f

Please sign in to comment.