Skip to content

Commit

Permalink
Merge pull request #215 from zanzaben/fix214-Rename-SetForceFail
Browse files Browse the repository at this point in the history
Fix #214, Refactor UT_SetForceFail to UT_SetDefaultReturnValue
  • Loading branch information
astrogeco authored Dec 1, 2020
2 parents dd9fd53 + 1f802ae commit 390ca52
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 @@ -76,13 +76,13 @@ void Test_OS_Application_Startup(void)
UtAssert_INT32_EQ(StartType.StartSubtype, CFE_PSP_RST_SUBTYPE_UNDEFINED_RESET);

/* failure of OS_API_Init */
UT_SetForceFail(UT_KEY(OS_API_Init), OS_ERROR);
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));

/* failure of OS_FileSysAddFixedMap - an extra OS_printf */
UT_SetForceFail(UT_KEY(OS_FileSysAddFixedMap), OS_ERROR);
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void Test_CFE_PSP_Exception_GetSummary(void)
/* Get an entry with failure to obtain task ID */
UtAssert_NOT_NULL(CFE_PSP_Exception_GetNextContextBuffer());
CFE_PSP_Exception_WriteComplete();
UT_SetForceFail(UT_KEY(OS_TaskFindIdBySystemData), OS_ERROR);
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));
UtAssert_NONZERO(LogId);
Expand Down

0 comments on commit 390ca52

Please sign in to comment.