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 #214, Refactor UT_SetForceFail to UT_SetDefaultReturnValue #215

Merged
Merged
Show file tree
Hide file tree
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
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