From ff90d7019cf7970078a899001bef953495fbef46 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 24 Aug 2021 16:22:07 -0400 Subject: [PATCH] Fix #1769, add call to CFE_ES_ExitChildTask 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). --- modules/cfe_testcase/src/es_task_test.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/cfe_testcase/src/es_task_test.c b/modules/cfe_testcase/src/es_task_test.c index bd9f64bf4..016e5bd5f 100644 --- a/modules/cfe_testcase/src/es_task_test.c +++ b/modules/cfe_testcase/src/es_task_test.c @@ -175,6 +175,16 @@ void TestExitChild(void) CFE_SUCCESS); OS_TaskDelay(500); UtAssert_INT32_EQ(ExpectedCount, 1); + + /* + * 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 ESTaskTestSetup(void)