Skip to content

Commit

Permalink
Fix #228, Refactor UT_ClearForceFail to UT_ClearDefaultReturnValue
Browse files Browse the repository at this point in the history
  • Loading branch information
zanzaben committed Jan 13, 2021
1 parent 3178920 commit 4783578
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ void Test_OS_Application_Startup(void)
UT_SetDefaultReturnValue(UT_KEY(OS_API_Init), OS_ERROR);
UT_OS_Application_Startup();
UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(PCS_exit)), 1);
UT_ClearForceFail(UT_KEY(OS_API_Init));
UT_ClearDefaultReturnValue(UT_KEY(OS_API_Init));

/* failure of OS_FileSysAddFixedMap - an extra OS_printf */
UT_SetDefaultReturnValue(UT_KEY(OS_FileSysAddFixedMap), OS_ERROR);
UT_OS_Application_Startup();
UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(OS_printf)), 9);
UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(PCS_SystemMain)), 2);
UT_ClearForceFail(UT_KEY(OS_FileSysAddFixedMap));
UT_ClearDefaultReturnValue(UT_KEY(OS_FileSysAddFixedMap));

/* coverage for each of the reset types */
*PCS_SYS_REG_BLRR = PCS_SYS_REG_BLRR_PWRON;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void Test_CFE_PSP_Exception_GetSummary(void)
CFE_PSP_Exception_WriteComplete();
UT_SetDefaultReturnValue(UT_KEY(OS_TaskFindIdBySystemData), OS_ERROR);
UtAssert_INT32_EQ(CFE_PSP_Exception_GetSummary(&LogId, &TaskId, ReasonBuf, sizeof(ReasonBuf)), CFE_PSP_SUCCESS);
UT_ClearForceFail(UT_KEY(OS_TaskFindIdBySystemData));
UT_ClearDefaultReturnValue(UT_KEY(OS_TaskFindIdBySystemData));
UtAssert_NONZERO(LogId);
UtAssert_ZERO(OS_ObjectIdToInteger(TaskId));

Expand Down

0 comments on commit 4783578

Please sign in to comment.