Skip to content

Commit

Permalink
Merge pull request #713 from jphickey/fix-603-add-evs-stub-args
Browse files Browse the repository at this point in the history
Fix #603, Full context info for EVS event stubs
  • Loading branch information
astrogeco authored Jun 2, 2020
2 parents 086bf1b + 234da0a commit 0e3a00a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
6 changes: 5 additions & 1 deletion fsw/cfe-core/ut-stubs/ut_es_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,13 @@ int32 CFE_ES_RegisterChildTask(void)
int32 CFE_ES_WriteToSysLog(const char *pSpecString, ...)
{
int32 status;
va_list va;

UT_Stub_RegisterContext(UT_KEY(CFE_ES_WriteToSysLog), pSpecString); // allow this input to be used by hook functions

status = UT_DEFAULT_IMPL(CFE_ES_WriteToSysLog);
va_start(va,pSpecString);
status = UT_DEFAULT_IMPL_VARARGS(CFE_ES_WriteToSysLog, va);
va_end(va);

if (status >= 0)
{
Expand Down
21 changes: 18 additions & 3 deletions fsw/cfe-core/ut-stubs/ut_evs_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,14 @@ int32 CFE_EVS_SendEvent(uint16 EventID,
...)
{
int32 status;
va_list va;

UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), &EventID);
UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), &EventType);
UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), Spec);
status = UT_DEFAULT_IMPL(CFE_EVS_SendEvent);
va_start(va, Spec);
status = UT_DEFAULT_IMPL_VARARGS(CFE_EVS_SendEvent, va);
va_end(va);

if (status >= 0)
{
Expand Down Expand Up @@ -145,9 +148,15 @@ int32 CFE_EVS_SendTimedEvent(CFE_TIME_SysTime_t Time,
...)
{
int32 status;
va_list va;

UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), &EventID);
status = UT_DEFAULT_IMPL(CFE_EVS_SendEvent);
UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), &EventType);
UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), &Time);
UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), Spec);
va_start(va, Spec);
status = UT_DefaultStubImplWithArgs(__func__, UT_KEY(CFE_EVS_SendTimedEvent), CFE_SUCCESS, va);
va_end(va);

if (status >= 0)
{
Expand Down Expand Up @@ -218,9 +227,15 @@ int32 CFE_EVS_SendEventWithAppID(uint16 EventID,
...)
{
int32 status;
va_list va;

UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), &EventID);
status = UT_DEFAULT_IMPL(CFE_EVS_SendEventWithAppID);
UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), &EventType);
UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), &AppID);
UT_Stub_RegisterContext(UT_KEY(CFE_EVS_SendEvent), Spec);
va_start(va, Spec);
status = UT_DefaultStubImplWithArgs(__func__, UT_KEY(CFE_EVS_SendEventWithAppID), CFE_SUCCESS, va);
va_end(va);

if (status >= 0)
{
Expand Down

0 comments on commit 0e3a00a

Please sign in to comment.