diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index 40a43ad99..4f5a522e1 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -100,8 +100,8 @@ jobs: - name: Confirm Minimum Coverage run: | - missed_branches=76 - missed_lines=33 + missed_branches=52 + missed_lines=18 branch_nums=$(grep -A 3 "Overall coverage rate" lcov_out.txt | grep branches | grep -oP "[0-9]+[0-9]*") line_nums=$(grep -A 3 "Overall coverage rate" lcov_out.txt | grep lines | grep -oP "[0-9]+[0-9]*") diff --git a/modules/es/ut-coverage/es_UT.c b/modules/es/ut-coverage/es_UT.c index 0cbcfbce3..e5c73fcf5 100644 --- a/modules/es/ut-coverage/es_UT.c +++ b/modules/es/ut-coverage/es_UT.c @@ -38,6 +38,7 @@ */ #include "es_UT.h" #include "target_config.h" +#include "cfe_config.h" #define ES_UT_CDS_BLOCK_SIZE 16 @@ -1123,6 +1124,14 @@ static void ES_UT_ForEachObjectFail(void *UserObj, UT_EntryKey_t FuncKey, const (*callback_ptr)(id, callback_arg); } +static void ES_UT_Config_IterateAll(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context) +{ + CFE_Config_Callback_t Callback = UT_Hook_GetArgValueByName(Context, "Callback", CFE_Config_Callback_t); + + (*Callback)(NULL, CFE_CONFIGID_UNDEFINED, "Test"); + (*Callback)(NULL, CFE_CONFIGID_UNDEFINED, "MOD_SRCVER_test"); +} + void TestApps(void) { int NumBytes; @@ -3498,11 +3507,15 @@ void TestTask(void) UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoArgsCmd), UT_TPID_CFE_ES_CMD_NOOP_CC); CFE_UtAssert_PRINTF("Error sending build info event"); - /* Test CFE_ES_GenerateVersionEvents error when sending mission event */ + /* + * Test CFE_ES_GenerateVersionEvents error when sending mission event and add hook + * to cover CFE_ES_ModSrcVerCallback + */ ES_ResetUnitTest(); ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, NULL, NULL, NULL); CFE_ES_Global.ResetDataPtr->ResetVars.ResetType = 1; UT_SetDeferredRetcode(UT_KEY(CFE_EVS_SendEvent), 3, CFE_EVS_INVALID_PARAMETER); + UT_SetHandlerFunction(UT_KEY(CFE_Config_IterateAll), ES_UT_Config_IterateAll, NULL); UtAssert_VOIDCALL(CFE_ES_TaskInit()); CFE_UtAssert_PRINTF("Error sending mission version event");