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 #23, Add UT verification of startup sync #24

Merged
merged 1 commit into from
May 31, 2022
Merged
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
8 changes: 8 additions & 0 deletions unit-test/hs_app_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ typedef struct
uint8 call_count_CFE_EVS_SendEvent;

uint16 HS_APP_TEST_CFE_SB_RcvMsgHookCount;
uint32 UT_WaitForStartupSyncTimeout;

void UT_UpdatedDefaultHandler_CFE_SB_ReceiveBuffer(void *UserObj, UT_EntryKey_t FuncKey,
const UT_StubContext_t *Context)
Expand Down Expand Up @@ -126,6 +127,9 @@ int32 HS_APP_TEST_CFE_ES_RestoreFromCDSHook(void *UserObj, int32 StubRetcode, ui
int32 HS_APP_TEST_CFE_ES_WaitForStartupSyncHook1(void *UserObj, int32 StubRetcode, uint32 CallCount,
const UT_StubContext_t *Context)
{

UT_WaitForStartupSyncTimeout = UT_Hook_GetArgValueByName(Context, "TimeOutMilliseconds", uint32);

/* This functionality is not directly related to WaitForStartupSync, but WaitForStartupSync is in a place where
it's necessary to do this for the test case HS_AppMain_Test_Nominal */

Expand Down Expand Up @@ -176,6 +180,10 @@ void HS_AppMain_Test_NominalWaitForStartupSync(void)
/* Verify results */
UtAssert_UINT8_EQ(HS_AppData.CurrentEventMonState, HS_STATE_ENABLED);

/* This verifies HS8006 and HS8006.1 to wait for startup sync with platform defined timeout */
UtAssert_STUB_COUNT(CFE_ES_WaitForStartupSync, 1);
UtAssert_UINT32_EQ(UT_WaitForStartupSyncTimeout, HS_STARTUP_SYNC_TIMEOUT);

/* 1 event message that we don't care about in this test */
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);

Expand Down