Skip to content

Commit

Permalink
Merge pull request #464 from avan989/update_unitTest
Browse files Browse the repository at this point in the history
Fix #189, Unit test for cfe_evs_task.c
  • Loading branch information
skliper authored Jan 21, 2020
2 parents 80ecc3e + 067ffe2 commit 94f91a9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion fsw/cfe-core/unit-test/evs_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static const char *EVS_SYSLOG_MSGS[] =
"EVS:Error reading cmd pipe,RC=0x%08X\n",
"EVS:Call to CFE_ES_RegisterApp Failed:RC=0x%08X\n",
"EVS:Call to CFE_ES_GetAppID Failed:RC=0x%08X\n",
NULL, /* index 11 not used */
"EVS:Call to CFE_EVS_Register Failed:RC=0x%08X\n",
"EVS:Call to CFE_SB_CreatePipe Failed:RC=0x%08X\n",
"EVS:Subscribing to Cmds Failed:RC=0x%08X\n",
"EVS:Subscribing to HK Request Failed:RC=0x%08X\n"
Expand Down Expand Up @@ -407,6 +407,15 @@ void Test_Init(void)
"CFE_EVS_TaskInit",
"Call to CFE_ES_RegisterApp failure");

/* Test task initialization where event services fails */
UT_InitData();
UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetAppID), 2, -1); /* Set Failure in CFE_EVS_Register -> EVS_GetApp_ID */
CFE_EVS_TaskInit();
UT_Report(__FILE__, __LINE__,
UT_SyslogIsInHistory(EVS_SYSLOG_MSGS[11]),
"CFE_EVS_TaskInit",
"Call to CFE_EVS_Register failure");

/* Test task initialization where the pipe creation fails */
UT_InitData();
UT_SetDeferredRetcode(UT_KEY(CFE_SB_CreatePipe), 1, -1);
Expand Down

0 comments on commit 94f91a9

Please sign in to comment.