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 #1408, Use LogFullFlag instead of checking LogCount #2271

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion modules/evs/fsw/src/cfe_evs_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ int32 CFE_EVS_WriteLogDataFileCmd(const CFE_EVS_WriteLogDataFileCmd_t *data)
OS_MutSemTake(CFE_EVS_Global.EVS_SharedDataMutexID);

/* Is the log full? -- Doesn't matter if wrap mode is enabled */
if (CFE_EVS_Global.EVS_LogPtr->LogCount == CFE_PLATFORM_EVS_LOG_MAX)
if (CFE_EVS_Global.EVS_LogPtr->LogFullFlag)
{
/* Start with log entry that will be overwritten next (oldest) */
LogIndex = CFE_EVS_Global.EVS_LogPtr->Next;
Expand Down
4 changes: 2 additions & 2 deletions modules/evs/ut-coverage/evs_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -1024,14 +1024,14 @@ void Test_Logging(void)
/* Test successfully writing all log entries */
UT_InitData();
UT_SetDeferredRetcode(UT_KEY(OS_MutSemCreate), 1, OS_SUCCESS);
CFE_EVS_Global.EVS_LogPtr->LogCount = CFE_PLATFORM_EVS_LOG_MAX;
CFE_EVS_Global.EVS_LogPtr->LogFullFlag = true;
CFE_UtAssert_SUCCESS(CFE_EVS_WriteLogDataFileCmd(&CmdBuf.logfilecmd));

/* Test writing a log entry with a write failure */
UT_InitData();
UT_SetDeferredRetcode(UT_KEY(OS_MutSemCreate), 1, OS_SUCCESS);
UT_SetDefaultReturnValue(UT_KEY(OS_write), OS_ERROR);
CFE_EVS_Global.EVS_LogPtr->LogCount = CFE_PLATFORM_EVS_LOG_MAX;
CFE_EVS_Global.EVS_LogPtr->LogFullFlag = true;
UtAssert_INT32_EQ(CFE_EVS_WriteLogDataFileCmd(&CmdBuf.logfilecmd), CFE_EVS_FILE_WRITE_ERROR);

/* Test successfully writing a single event log entry using a specified
Expand Down