Checklist (Please check before submitting)
Is your feature request related to a problem? Please describe.
Since two patterns are used for checking events, it can't be setup by default at startup causing every test that wants to check events to have to set up the data buffer (using either pattern A or B):
Pattern A uses UT_CF_ResetEventCapture, UT_CF_CheckEventID_Impl, UT_CF_CapturedEventIDs, example:
|
UT_CF_ResetEventCapture(UT_KEY(CFE_EVS_SendEvent)); |
|
|
|
/* Act */ |
|
UtAssert_INT32_EQ(CF_TableInit(), result); |
|
|
|
/* Assert */ |
|
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); |
|
UT_CF_AssertEventID(CF_EID_ERR_INIT_TBL_REG); |
Pattern B set's up a custom buffer:
|
uint16 events[2] = {0}; |
|
|
|
memset(&sbbuf, 0, sizeof(sbbuf)); |
|
|
|
/* Run loop once */ |
|
UT_SetDeferredRetcode(UT_KEY(CFE_ES_RunLoop), 1, true); |
|
UT_SetDefaultReturnValue(UT_KEY(CFE_ES_RunLoop), false); |
|
|
|
/* Capture events */ |
|
UT_SetDataBuffer(UT_KEY(CFE_EVS_SendEvent), events, sizeof(events), false); |
|
|
|
/* Unit under test does not use the buffer in this case */ |
|
UT_SetDataBuffer(UT_KEY(CFE_SB_ReceiveBuffer), &sbbufptr, sizeof(sbbufptr), false); |
|
|
|
UT_SetDeferredRetcode(UT_KEY(CFE_SB_ReceiveBuffer), 1, -1); |
|
|
|
/* Act */ |
|
UtAssert_VOIDCALL(CF_AppMain()); |
|
|
|
/* Assert */ |
|
UtAssert_STUB_COUNT(CFE_ES_PerfLogAdd, 4); |
|
UtAssert_STUB_COUNT(CFE_ES_RunLoop, 2); |
|
UtAssert_STUB_COUNT(CFE_ES_ExitApp, 1); |
|
|
|
/* Event from CF_Init and CF_AppMain */ |
|
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 2); |
|
UtAssert_UINT32_EQ(events[0], CF_EID_INF_INIT); |
|
UtAssert_UINT32_EQ(events[1], CF_EID_ERR_INIT_MSG_RECV); |
Describe the solution you'd like
Use a single pattern and setup automatically (like pattern A)
Describe alternatives you've considered
None
Additional context
None
Requester Info
Jacob Hageman - NASA/GSFC
Checklist (Please check before submitting)
Is your feature request related to a problem? Please describe.
Since two patterns are used for checking events, it can't be setup by default at startup causing every test that wants to check events to have to set up the data buffer (using either pattern A or B):
Pattern A uses UT_CF_ResetEventCapture, UT_CF_CheckEventID_Impl, UT_CF_CapturedEventIDs, example:
CF/unit-test/cf_app_tests.c
Lines 299 to 306 in 557c132
Pattern B set's up a custom buffer:
CF/unit-test/cf_app_tests.c
Lines 637 to 664 in 557c132
Describe the solution you'd like
Use a single pattern and setup automatically (like pattern A)
Describe alternatives you've considered
None
Additional context
None
Requester Info
Jacob Hageman - NASA/GSFC