Skip to content

Commit

Permalink
Refactoring UT_SetForceFail to UT_SetDefaultReturnValue
Browse files Browse the repository at this point in the history
  • Loading branch information
zanzaben committed Nov 23, 2020
1 parent 32f3dee commit c413f53
Show file tree
Hide file tree
Showing 10 changed files with 109 additions and 109 deletions.
112 changes: 56 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 @@ -443,7 +443,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 @@ -494,7 +494,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 @@ -504,31 +504,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 @@ -539,7 +539,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 @@ -550,23 +550,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 @@ -694,7 +694,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 @@ -1356,7 +1356,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 @@ -1374,7 +1374,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 @@ -1452,7 +1452,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 @@ -1463,8 +1463,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 @@ -1489,7 +1489,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 @@ -1541,7 +1541,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 @@ -1552,7 +1552,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 @@ -1563,7 +1563,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 @@ -1574,7 +1574,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 @@ -1587,7 +1587,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 @@ -1598,7 +1598,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 @@ -1610,7 +1610,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 @@ -1622,7 +1622,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 @@ -1634,7 +1634,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 @@ -1645,7 +1645,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_SB_MsgPtr_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 @@ -737,7 +737,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 @@ -1140,7 +1140,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 @@ -1410,7 +1410,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 @@ -1726,7 +1726,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 @@ -1736,7 +1736,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 @@ -4212,7 +4212,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 @@ -4810,7 +4810,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 @@ -4981,7 +4981,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 c413f53

Please sign in to comment.