Skip to content

Commit

Permalink
Merge pull request #86 from thnkslprpt/fix-85-change-EVS_Register-fai…
Browse files Browse the repository at this point in the history
…lure-to-WriteToSysLog

Fix #85, Change EVS_Register failure from SendEvent to WriteToSysLog
  • Loading branch information
dzbaker authored Apr 6, 2023
2 parents 98dd996 + 7d91157 commit 0add473
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
3 changes: 1 addition & 2 deletions fsw/src/ds_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@ int32 DS_AppInitialize(void)

if (Result != CFE_SUCCESS)
{
CFE_EVS_SendEvent(DS_INIT_ERR_EID, CFE_EVS_EventType_ERROR, "Unable to register for EVS services, err = 0x%08X",
(unsigned int)Result);
CFE_ES_WriteToSysLog("DS App: Error registering for Event Services, RC = 0x%08X\n", (unsigned int)Result);
}

/*
Expand Down
14 changes: 5 additions & 9 deletions unit-test/ds_app_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ void DS_AppMain_Test_AppInitializeError(void)
DS_AppMain();

/* Verify results */
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 2);
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventID, DS_EXIT_ERR_EID);
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventType, CFE_EVS_EventType_CRITICAL);
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_EXIT_ERR_EID);
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_CRITICAL);
UtAssert_STUB_COUNT(CFE_ES_ExitApp, 1);
UtAssert_STUB_COUNT(CFE_ES_WriteToSysLog, 1);
UtAssert_STUB_COUNT(CFE_ES_WriteToSysLog, 2);
}

void DS_AppMain_Test_SBError(void)
Expand Down Expand Up @@ -178,11 +178,7 @@ void DS_AppInitialize_Test_EVSRegisterError(void)
UtAssert_BOOL_FALSE(OS_ObjectIdDefined(DS_AppData.FileStatus[DS_DEST_FILE_CNT / 2].FileHandle));
UtAssert_BOOL_FALSE(OS_ObjectIdDefined(DS_AppData.FileStatus[DS_DEST_FILE_CNT - 1].FileHandle));

/* Note: not verifying that rest of DS_AppData is set to 0, because some elements of DS_AppData
* are modified by subfunctions, which we're not testing here */
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, DS_INIT_ERR_EID);
UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR);
UtAssert_STUB_COUNT(CFE_ES_WriteToSysLog, 1);
}

void DS_AppInitialize_Test_SBCreatePipeError(void)
Expand Down

0 comments on commit 0add473

Please sign in to comment.