Skip to content

Commit

Permalink
Fix nasa#1769, add call to CFE_ES_ExitChildTask
Browse files Browse the repository at this point in the history
Invoke CFE_ES_ExitChildTask from the main test task, to confirm
that the task does not actually exit.  There is no status code
but the fact that the test keeps running is evidence that the
task did not exit (which means the test passed).
  • Loading branch information
jphickey committed Aug 24, 2021
1 parent 5e41330 commit e865bec
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/cfe_testcase/src/es_task_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ void TestCreateChild(void)
CFE_ES_BAD_ARGUMENT);
UtAssert_INT32_EQ(CFE_ES_CreateChildTask(&TaskId, TaskName, TaskFunction, StackPointer, 0, Priority, Flags),
CFE_STATUS_EXTERNAL_RESOURCE_FAIL);

/*
* Invoking CFE_ES_ExitChildTask() from the context of a main task should _not_ actually exit.
* as this is a void function there is no return code to check here. The fact that the test
* continues after this call is evidence that the test passed (i.e. it did not actually end the task).
*/
UtAssert_VOIDCALL(CFE_ES_ExitChildTask());

/* If this message is printed, then the test passed. If the test fails this will not be reached. */
UtAssert_True(true, "CFE_ES_ExitChildTask() called from main task (ignored; main task did not exit)");
}

void TestChildTaskName(void)
Expand Down

0 comments on commit e865bec

Please sign in to comment.