Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #189, Unit test for cfe_evs_task.c #464

Merged
merged 1 commit into from
Jan 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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