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 #2095, Automatic suppression of flooding events #2117

Merged
merged 5 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix #2095, Format cleanup of auto event suppression tests
  • Loading branch information
semaldona committed Jul 27, 2022
commit 270e17dba8ed5ce477563ebd98294df1f02cfe20
14 changes: 7 additions & 7 deletions modules/cfe_testcase/src/evs_send_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ void TestSendEvent(void)
int status;
int i;

if(CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST)
if (CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST)
{
/* Allow squelch credits to accumulate */
OS_TaskDelay((CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST/CFE_PLATFORM_EVS_APP_EVENTS_PER_SEC)*1000);
OS_TaskDelay((CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST / CFE_PLATFORM_EVS_APP_EVENTS_PER_SEC) * 1000);
}

UtPrintf("Testing: CFE_EVS_SendEvent");

UtAssert_INT32_EQ(CFE_EVS_SendEvent(0, CFE_EVS_EventType_INFORMATION, "OK Send"), CFE_SUCCESS);
Expand All @@ -54,18 +54,18 @@ void TestSendEvent(void)
UtAssert_INT32_EQ(CFE_EVS_SendEvent(0, CFE_EVS_EventType_CRITICAL, "OK (Critical) Send"), CFE_SUCCESS);
UtAssert_INT32_EQ(CFE_EVS_SendEvent(0, CFE_EVS_EventType_CRITICAL, NULL), CFE_EVS_INVALID_PARAMETER);
semaldona marked this conversation as resolved.
Show resolved Hide resolved

if(CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST)
if (CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST)
{
/* Allow squelch credits to accumulate */
OS_TaskDelay((CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST/CFE_PLATFORM_EVS_APP_EVENTS_PER_SEC)*1000);
OS_TaskDelay((CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST / CFE_PLATFORM_EVS_APP_EVENTS_PER_SEC) * 1000);

for(i=0; i<CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST; i++)
for (i = 0; i < CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST; i++)
UtAssert_INT32_EQ(CFE_EVS_SendEvent(0, CFE_EVS_EventType_INFORMATION, "OK Send"), CFE_SUCCESS);

status = CFE_EVS_SendEvent(0, CFE_EVS_EventType_INFORMATION, "OK Squelch");

/* Allow squelch credits to accumulate */
OS_TaskDelay((CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST/CFE_PLATFORM_EVS_APP_EVENTS_PER_SEC)*1000);
OS_TaskDelay((CFE_PLATFORM_EVS_MAX_APP_EVENT_BURST / CFE_PLATFORM_EVS_APP_EVENTS_PER_SEC) * 1000);

UtAssert_INT32_EQ(status, CFE_EVS_APP_SQUELCHED);
}
Expand Down
2 changes: 1 addition & 1 deletion modules/evs/ut-coverage/evs_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -1974,7 +1974,7 @@ void Test_Squelching(void)
AppDataPtr->SquelchedCount = 0;
AppDataPtr->SquelchTokens = -1500;
AppDataPtr->LastSquelchCreditableTime = OS_TimeAssembleFromMilliseconds(1, 0);
EVS_Retval = SendEventFuncs[j](EVENT_ID);
EVS_Retval = SendEventFuncs[j](EVENT_ID);
UtAssert_UINT32_EQ(EVS_Retval, CFE_EVS_APP_SQUELCHED);
semaldona marked this conversation as resolved.
Show resolved Hide resolved
}

Expand Down