Skip to content

Commit

Permalink
Fix #106, Refactor UT_SetForceFail (#107)
Browse files Browse the repository at this point in the history
New function name is UT_SetDefaultReturnValue
  • Loading branch information
zanzaben authored and astrogeco committed Dec 1, 2020
1 parent 0d11d9e commit 473e7d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions unit-test/coveragetest/coveragetest_sample_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ void Test_SAMPLE_APP_ProcessGroundCommand(void)
* avoid dereferencing a table which does not exist. */
FcnCode = SAMPLE_APP_PROCESS_CC;
Size = sizeof(TestMsg.Process);
UT_SetForceFail(UT_KEY(CFE_TBL_GetAddress), CFE_TBL_ERR_UNREGISTERED);
UT_SetDefaultReturnValue(UT_KEY(CFE_TBL_GetAddress), CFE_TBL_ERR_UNREGISTERED);
UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false);
UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false);

Expand Down Expand Up @@ -513,7 +513,7 @@ void Test_SAMPLE_APP_ProcessCC(void)
* Configure the CFE_TBL_GetAddress function to return an error
* Exercise the error return path
*/
UT_SetForceFail(UT_KEY(CFE_TBL_GetAddress), CFE_TBL_ERR_UNREGISTERED);
UT_SetDefaultReturnValue(UT_KEY(CFE_TBL_GetAddress), CFE_TBL_ERR_UNREGISTERED);
UT_TEST_FUNCTION_RC(SAMPLE_APP_Process(&TestMsg), CFE_TBL_ERR_UNREGISTERED);
}

Expand Down Expand Up @@ -592,7 +592,7 @@ void Test_SAMPLE_APP_GetCrc(void)
* the message using a hook function, if desired.
*/

UT_SetForceFail(UT_KEY(CFE_TBL_GetInfo), CFE_TBL_ERR_INVALID_NAME);
UT_SetDefaultReturnValue(UT_KEY(CFE_TBL_GetInfo), CFE_TBL_ERR_INVALID_NAME);
SAMPLE_APP_GetCrc("UT");
UtAssert_True(UT_GetStubCount(UT_KEY(CFE_ES_WriteToSysLog)) == 1, "CFE_ES_WriteToSysLog() called");

Expand Down

0 comments on commit 473e7d4

Please sign in to comment.