Skip to content

Commit

Permalink
Fix nasa#1006, Refactor UT_SetForceFail to UT_SetDefaultReturnValue (n…
Browse files Browse the repository at this point in the history
…asa#1007)

Co-authored-by: Gerardo E. Cruz-Ortiz <59618057+astrogeco@users.noreply.github.com>
  • Loading branch information
zanzaben and astrogeco authored Dec 1, 2020
1 parent e198d3c commit fe3427f
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 109 deletions.
115 changes: 59 additions & 56 deletions fsw/cfe-core/unit-test/es_UT.c

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions fsw/cfe-core/unit-test/evs_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ void Test_Init(void)

/* Test task initialization where getting the application ID fails */
UT_InitData();
UT_SetForceFail(UT_KEY(CFE_ES_GetAppID), -1);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_GetAppID), -1);
CFE_EVS_TaskInit();
UT_Report(__FILE__, __LINE__,
UT_SyslogIsInHistory(EVS_SYSLOG_MSGS[10]),
Expand Down Expand Up @@ -516,7 +516,7 @@ void Test_IllegalAppID(void)

/* Set test up with illegal application ID */
UT_InitData();
UT_SetForceFail(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID);

/* Test registering an event using an illegal application ID */
UT_Report(__FILE__, __LINE__,
Expand All @@ -526,31 +526,31 @@ void Test_IllegalAppID(void)

/* Test unregistering an event using an illegal application ID */
UT_InitData();
UT_SetForceFail(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID);
UT_Report(__FILE__, __LINE__,
CFE_EVS_Unregister() == CFE_EVS_APP_ILLEGAL_APP_ID,
"CFE_EVS_Unregister",
"Illegal app ID");

/* Test sending an event using an illegal application ID */
UT_InitData();
UT_SetForceFail(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID);
UT_Report(__FILE__, __LINE__,
CFE_EVS_SendEvent(0, 0, "NULL") == CFE_EVS_APP_ILLEGAL_APP_ID,
"CFE_EVS_SendEvent",
"Illegal app ID");

/* Test sending an event using an illegal application ID */
UT_InitData();
UT_SetForceFail(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID);
UT_Report(__FILE__, __LINE__,
EVS_SendEvent(0, 0, "NULL") == CFE_SUCCESS,
"EVS_SendEvent",
"Illegal app ID");

/* Test sending a timed event using an illegal application ID */
UT_InitData();
UT_SetForceFail(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID);
UT_Report(__FILE__, __LINE__,
CFE_EVS_SendTimedEvent(time,
0,
Expand All @@ -561,7 +561,7 @@ void Test_IllegalAppID(void)

/* Test sending an event with app ID using an illegal application ID */
UT_InitData();
UT_SetForceFail(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID);
UT_Report(__FILE__, __LINE__,
CFE_EVS_SendEventWithAppID(0,
0,
Expand All @@ -572,23 +572,23 @@ void Test_IllegalAppID(void)

/* Test resetting a filter using an illegal application ID */
UT_InitData();
UT_SetForceFail(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID);
UT_Report(__FILE__, __LINE__,
CFE_EVS_ResetFilter(0) == CFE_EVS_APP_ILLEGAL_APP_ID,
"CFE_EVS_ResetFilter",
"Illegal app ID");

/* Test resetting all filters using an illegal application ID */
UT_InitData();
UT_SetForceFail(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID);
UT_Report(__FILE__, __LINE__,
CFE_EVS_ResetAllFilters() == CFE_EVS_APP_ILLEGAL_APP_ID,
"CFE_EVS_ResetAllFilters",
"Illegal app ID");

/* Test application cleanup using an illegal application ID */
UT_InitData();
UT_SetForceFail(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_AppID_ToIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID);
UT_Report(__FILE__, __LINE__,
CFE_EVS_CleanUpApp(CFE_ES_RESOURCEID_UNDEFINED) ==
CFE_EVS_APP_ILLEGAL_APP_ID,
Expand Down Expand Up @@ -716,7 +716,7 @@ void Test_FilterRegistration(void)

/* Test filter unregistration with failed ES_putPool */
UT_InitData();
UT_SetForceFail(UT_KEY(CFE_ES_PutPoolBuf), -1);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_PutPoolBuf), -1);
UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetAppID), 1, -1);
UT_Report(__FILE__, __LINE__,
CFE_EVS_Unregister() < 0, "CFE_EVS_Unregister",
Expand Down Expand Up @@ -1376,7 +1376,7 @@ void Test_Logging(void)
/* Test writing a log entry with a create failure */
UT_InitData();
UT_SetDeferredRetcode(UT_KEY(OS_MutSemCreate), 1, OS_SUCCESS);
UT_SetForceFail(UT_KEY(OS_OpenCreate), OS_ERROR);
UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR);
UT_Report(__FILE__, __LINE__,
CFE_EVS_WriteLogDataFileCmd(&CmdBuf.logfilecmd) != CFE_SUCCESS,
"CFE_EVS_WriteLogDataFileCmd",
Expand All @@ -1394,7 +1394,7 @@ void Test_Logging(void)
/* Test writing a log entry with a write failure */
UT_InitData();
UT_SetDeferredRetcode(UT_KEY(OS_MutSemCreate), 1, OS_SUCCESS);
UT_SetForceFail(UT_KEY(OS_write), OS_ERROR);
UT_SetDefaultReturnValue(UT_KEY(OS_write), OS_ERROR);
CFE_EVS_GlobalData.EVS_LogPtr->LogCount = CFE_PLATFORM_EVS_LOG_MAX;
UT_Report(__FILE__, __LINE__,
CFE_EVS_WriteLogDataFileCmd(&CmdBuf.logfilecmd) != CFE_SUCCESS,
Expand Down Expand Up @@ -1472,7 +1472,7 @@ void Test_WriteApp(void)
UT_InitData();
strncpy((char *) CmdBuf.AppDataCmd.Payload.AppDataFilename, "ut_cfe_evs",
sizeof(CmdBuf.AppDataCmd.Payload.AppDataFilename));
UT_SetForceFail(UT_KEY(OS_OpenCreate), OS_ERROR);
UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR);
UT_EVS_DoDispatchCheckEvents(&CmdBuf.AppDataCmd, sizeof(CmdBuf.AppDataCmd),
UT_TPID_CFE_EVS_CMD_WRITE_APP_DATA_FILE_CC,
&UT_EVS_EventBuf);
Expand All @@ -1483,8 +1483,8 @@ void Test_WriteApp(void)

/* Test writing application data with a write/close failure */
UT_InitData();
UT_SetForceFail(UT_KEY(OS_write), OS_ERROR);
UT_SetForceFail(UT_KEY(OS_close), OS_ERROR);
UT_SetDefaultReturnValue(UT_KEY(OS_write), OS_ERROR);
UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_ERROR);
UT_EVS_DoDispatchCheckEvents(&CmdBuf.AppDataCmd, sizeof(CmdBuf.AppDataCmd),
UT_TPID_CFE_EVS_CMD_WRITE_APP_DATA_FILE_CC,
&UT_EVS_EventBuf);
Expand All @@ -1509,7 +1509,7 @@ void Test_WriteApp(void)
UT_InitData();
strncpy((char *) CmdBuf.AppDataCmd.Payload.AppDataFilename, "AppDataFileName",
sizeof(CmdBuf.AppDataCmd.Payload.AppDataFilename));
UT_SetForceFail(UT_KEY(OS_OpenCreate), OS_ERROR);
UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR);
UT_EVS_DoDispatchCheckEvents(&CmdBuf.AppDataCmd, sizeof(CmdBuf.AppDataCmd),
UT_TPID_CFE_EVS_CMD_WRITE_APP_DATA_FILE_CC,
&UT_EVS_EventBuf);
Expand Down Expand Up @@ -1561,7 +1561,7 @@ void Test_BadAppCmd(void)
sizeof(appcmdcmd.Payload.AppName));

/* Test disabling application event types with an unknown application ID */
UT_SetForceFail(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND);
UT_EVS_DoDispatchCheckEvents(&appbitcmd, sizeof(appbitcmd),
UT_TPID_CFE_EVS_CMD_DISABLE_APP_EVENT_TYPE_CC,
&UT_EVS_EventBuf);
Expand All @@ -1572,7 +1572,7 @@ void Test_BadAppCmd(void)

/* Test enabling application event types with an unknown application ID */
UT_InitData();
UT_SetForceFail(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND);
UT_EVS_DoDispatchCheckEvents(&appbitcmd, sizeof(appbitcmd),
UT_TPID_CFE_EVS_CMD_ENABLE_APP_EVENT_TYPE_CC,
&UT_EVS_EventBuf);
Expand All @@ -1583,7 +1583,7 @@ void Test_BadAppCmd(void)

/* Test disabling application events with an unknown application ID */
UT_InitData();
UT_SetForceFail(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND);
UT_EVS_DoDispatchCheckEvents(&appnamecmd, sizeof(appnamecmd),
UT_TPID_CFE_EVS_CMD_DISABLE_APP_EVENTS_CC,
&UT_EVS_EventBuf);
Expand All @@ -1594,7 +1594,7 @@ void Test_BadAppCmd(void)

/* Test enabling application events with an unknown application ID */
UT_InitData();
UT_SetForceFail(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND);
UT_EVS_DoDispatchCheckEvents(&appnamecmd, sizeof(appnamecmd),
UT_TPID_CFE_EVS_CMD_ENABLE_APP_EVENTS_CC,
&UT_EVS_EventBuf);
Expand All @@ -1607,7 +1607,7 @@ void Test_BadAppCmd(void)
* application ID
*/
UT_InitData();
UT_SetForceFail(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND);
UT_EVS_DoDispatchCheckEvents(&appnamecmd, sizeof(appnamecmd),
UT_TPID_CFE_EVS_CMD_RESET_APP_COUNTER_CC,
&UT_EVS_EventBuf);
Expand All @@ -1618,7 +1618,7 @@ void Test_BadAppCmd(void)

/* Test modifying event filters with an unknown application ID */
UT_InitData();
UT_SetForceFail(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND);
UT_EVS_DoDispatchCheckEvents(&appmaskcmd, sizeof(appmaskcmd),
UT_TPID_CFE_EVS_CMD_ADD_EVENT_FILTER_CC,
&UT_EVS_EventBuf);
Expand All @@ -1630,7 +1630,7 @@ void Test_BadAppCmd(void)

/* Test deleting event filters with an unknown application ID */
UT_InitData();
UT_SetForceFail(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND);
UT_EVS_DoDispatchCheckEvents(&appcmdcmd, sizeof(appcmdcmd),
UT_TPID_CFE_EVS_CMD_DELETE_EVENT_FILTER_CC,
&UT_EVS_EventBuf);
Expand All @@ -1642,7 +1642,7 @@ void Test_BadAppCmd(void)

/* Test setting the event filter mask with an unknown application ID */
UT_InitData();
UT_SetForceFail(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND);
UT_EVS_DoDispatchCheckEvents(&appmaskcmd, sizeof(appmaskcmd),
UT_TPID_CFE_EVS_CMD_SET_FILTER_CC,
&UT_EVS_EventBuf);
Expand All @@ -1654,7 +1654,7 @@ void Test_BadAppCmd(void)

/* Test resetting the filter with an unknown application ID */
UT_InitData();
UT_SetForceFail(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND);
UT_EVS_DoDispatchCheckEvents(&appcmdcmd, sizeof(appcmdcmd),
UT_TPID_CFE_EVS_CMD_RESET_FILTER_CC,
&UT_EVS_EventBuf);
Expand All @@ -1665,7 +1665,7 @@ void Test_BadAppCmd(void)

/* Test resetting all filters with an unknown application ID */
UT_InitData();
UT_SetForceFail(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_GetAppIDByName), CFE_ES_ERR_NAME_NOT_FOUND);
UT_EVS_DoDispatchCheckEvents(&appnamecmd, sizeof(appnamecmd),
UT_TPID_CFE_EVS_CMD_RESET_ALL_FILTERS_CC,
&UT_EVS_EventBuf);
Expand Down
12 changes: 6 additions & 6 deletions fsw/cfe-core/unit-test/fs_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void Test_CFE_FS_ReadHeader(void)

/* Test reading the header with a lseek failure */
UT_InitData();
UT_SetForceFail(UT_KEY(OS_lseek), OS_ERROR);
UT_SetDefaultReturnValue(UT_KEY(OS_lseek), OS_ERROR);
UT_Report(__FILE__, __LINE__,
CFE_FS_ReadHeader(&Hdr, FileDes) == OS_ERROR,
"CFE_FS_ReadHeader",
Expand All @@ -104,7 +104,7 @@ void Test_CFE_FS_ReadHeader(void)
/* Test successfully reading the header */
UT_InitData();
UT_SetDeferredRetcode(UT_KEY(OS_lseek), 1, OS_SUCCESS);
UT_SetForceFail(UT_KEY(OS_read), OS_ERROR);
UT_SetDefaultReturnValue(UT_KEY(OS_read), OS_ERROR);
UT_Report(__FILE__, __LINE__,
CFE_FS_ReadHeader(&Hdr, FileDes) != sizeof(CFE_FS_Header_t),
"CFE_FS_ReadHeader",
Expand All @@ -123,7 +123,7 @@ void Test_CFE_FS_WriteHeader(void)

/* Test writing the header with a lseek failure */
UT_InitData();
UT_SetForceFail(UT_KEY(OS_lseek), OS_ERROR);
UT_SetDefaultReturnValue(UT_KEY(OS_lseek), OS_ERROR);
UT_Report(__FILE__, __LINE__,
CFE_FS_WriteHeader(FileDes, &Hdr) == OS_ERROR,
"CFE_FS_WriteHeader",
Expand Down Expand Up @@ -151,15 +151,15 @@ void Test_CFE_FS_SetTimestamp(void)

/* Test setting the time stamp with a lseek failure */
UT_InitData();
UT_SetForceFail(UT_KEY(OS_lseek), OS_ERROR);
UT_SetDefaultReturnValue(UT_KEY(OS_lseek), OS_ERROR);
UT_Report(__FILE__, __LINE__,
CFE_FS_SetTimestamp(FileDes, NewTimestamp) == OS_ERROR,
"CFE_FS_SetTimestamp",
"Failed to lseek time fields");

/* Test setting the time stamp with a seconds write failure */
UT_InitData();
UT_SetForceFail(UT_KEY(OS_write), OS_ERROR);
UT_SetDefaultReturnValue(UT_KEY(OS_write), OS_ERROR);
UT_Report(__FILE__, __LINE__,
CFE_FS_SetTimestamp(FileDes, NewTimestamp) != OS_SUCCESS,
"CFE_FS_SetTimestamp",
Expand Down Expand Up @@ -313,7 +313,7 @@ void Test_CFE_FS_Private(void)

/* Test FS initialization with a mutex creation failure */
UT_InitData();
UT_SetForceFail(UT_KEY(OS_MutSemCreate), OS_ERROR);
UT_SetDefaultReturnValue(UT_KEY(OS_MutSemCreate), OS_ERROR);
UT_Report(__FILE__, __LINE__,
CFE_FS_EarlyInit() == -1,
"CFE_FS_EarlyInit",
Expand Down
6 changes: 3 additions & 3 deletions fsw/cfe-core/unit-test/sb_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ void Test_SB_Cmds_RoutingInfoCreateFail(void)
CFE_SB.CmdPipePktPtr = (CFE_MSG_Message_t *) &WriteFileCmd;

/* Make function CFE_SB_SendRtgInfo return CFE_SB_FILE_IO_ERR */
UT_SetForceFail(UT_KEY(OS_OpenCreate), OS_ERROR);
UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR);

CFE_SB_ProcessCmdPipePkt();

Expand Down Expand Up @@ -686,7 +686,7 @@ void Test_SB_Cmds_PipeInfoSpec(void)
*/
void Test_SB_Cmds_PipeInfoCreateFail(void)
{
UT_SetForceFail(UT_KEY(OS_OpenCreate), OS_ERROR);
UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR);
ASSERT_EQ(CFE_SB_SendPipeInfo("PipeTstFile"), CFE_SB_FILE_IO_ERR);

EVTCNT(1);
Expand Down Expand Up @@ -821,7 +821,7 @@ void Test_SB_Cmds_MapInfoSpec(void)
*/
void Test_SB_Cmds_MapInfoCreateFail(void)
{
UT_SetForceFail(UT_KEY(OS_OpenCreate), OS_ERROR);
UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR);
ASSERT_EQ(CFE_SB_SendMapInfo("MapTstFile"), CFE_SB_FILE_IO_ERR);

EVTCNT(1);
Expand Down
16 changes: 8 additions & 8 deletions fsw/cfe-core/unit-test/tbl_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ void Test_CFE_TBL_DumpToFile(void)

/* Test with an error creating the dump file */
UT_InitData();
UT_SetForceFail(UT_KEY(OS_OpenCreate), OS_ERROR);
UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR);
UT_Report(__FILE__, __LINE__,
CFE_TBL_DumpToFile("filename" ,"tablename" ,"dumpaddress",
TblSizeInBytes) == CFE_TBL_INC_ERR_CTR,
Expand Down Expand Up @@ -1154,7 +1154,7 @@ void Test_CFE_TBL_DumpRegCmd(void)
UT_InitData();
strncpy((char *)DumpRegCmd.Payload.DumpFilename, "",
sizeof(DumpRegCmd.Payload.DumpFilename));
UT_SetForceFail(UT_KEY(OS_OpenCreate), OS_ERROR);
UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR);
UT_Report(__FILE__, __LINE__,
CFE_TBL_DumpRegistryCmd(&DumpRegCmd) ==
CFE_TBL_INC_ERR_CTR,
Expand Down Expand Up @@ -1424,7 +1424,7 @@ void Test_CFE_TBL_LoadCmd(void)
UT_InitData();
strncpy((char *)LoadCmd.Payload.LoadFilename, "LoadFileName",
sizeof(LoadCmd.Payload.LoadFilename));
UT_SetForceFail(UT_KEY(OS_OpenCreate), OS_ERROR);
UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR);
UT_Report(__FILE__, __LINE__,
CFE_TBL_LoadCmd(&LoadCmd) ==
CFE_TBL_INC_ERR_CTR,
Expand Down Expand Up @@ -1705,7 +1705,7 @@ void Test_CFE_TBL_HousekeepingCmd(void)
UT_InitData();
CFE_TBL_TaskData.DumpControlBlocks[0].State = CFE_TBL_DUMP_PERFORMED;
CFE_TBL_TaskData.HkTlmTblRegIndex = CFE_TBL_NOT_FOUND + 1;
UT_SetForceFail(UT_KEY(OS_OpenCreate), OS_ERROR);
UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR);
UT_Report(__FILE__, __LINE__,
CFE_TBL_HousekeepingCmd(NULL) == CFE_TBL_DONT_INC_CTR,
"CFE_TBL_HousekeepingCmd",
Expand All @@ -1715,7 +1715,7 @@ void Test_CFE_TBL_HousekeepingCmd(void)
UT_InitData();
CFE_TBL_TaskData.HkTlmTblRegIndex = CFE_TBL_NOT_FOUND;
CFE_TBL_TaskData.DumpControlBlocks[0].State = CFE_TBL_DUMP_PERFORMED;
UT_SetForceFail(UT_KEY(OS_OpenCreate), OS_ERROR);
UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR);
UT_Report(__FILE__, __LINE__,
CFE_TBL_HousekeepingCmd(NULL) == CFE_TBL_DONT_INC_CTR,
"CFE_TBL_HousekeepingCmd",
Expand Down Expand Up @@ -4119,7 +4119,7 @@ void Test_CFE_TBL_Internal(void)

UT_SetReadBuffer(&TblFileHeader, sizeof(TblFileHeader));
UT_SetReadHeader(&StdFileHeader, sizeof(StdFileHeader));
UT_SetForceFail(UT_KEY(OS_OpenCreate), OS_ERROR);
UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR);
RtnCode = CFE_TBL_LoadFromFile("UT", WorkingBufferPtr, RegRecPtr, Filename);
EventsCorrect = (UT_EventIsInHistory(CFE_TBL_FILE_ACCESS_ERR_EID) == true &&
UT_GetNumEventsSent() == 1);
Expand Down Expand Up @@ -4633,7 +4633,7 @@ void Test_CFE_TBL_Internal(void)
/* Test successful application cleanup */
UT_InitData();
UT_SetAppID(UT_TBL_APPID_1);
UT_SetForceFail(UT_KEY(CFE_ES_PutPoolBuf), -1);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_PutPoolBuf), -1);
AccessDescPtr = &CFE_TBL_TaskData.Handles[App1TblHandle1];
RegRecPtr = &CFE_TBL_TaskData.Registry[AccessDescPtr->RegIndex];
CFE_TBL_TaskData.DumpControlBlocks[3].State = CFE_TBL_DUMP_PENDING;
Expand Down Expand Up @@ -4797,7 +4797,7 @@ void Test_CFE_TBL_Internal(void)
*/
UT_InitData();
UT_SetAppID(UT_TBL_APPID_1);
UT_SetForceFail(UT_KEY(CFE_ES_PutPoolBuf), -1);
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_PutPoolBuf), -1);
CFE_TBL_TaskData.Handles[0].AppId = UT_TBL_APPID_1;
AccessDescPtr = &CFE_TBL_TaskData.Handles[App1TblHandle2];
RegRecPtr = &CFE_TBL_TaskData.Registry[AccessDescPtr->RegIndex];
Expand Down
Loading

0 comments on commit fe3427f

Please sign in to comment.