Skip to content

Why does CFE_SB_SendMsg stub not save the passed in MsgPtr like CFE_SB_TimeStampMsg stub does? #818

@asgibson

Description

@asgibson

Describe the bug
CFE_SB_SendMsg copies from local the contents of the passed in message pointer, but CFE_SB_TimeStampMsg copies from local the value of MsgPtr.

To Reproduce
Steps to reproduce the behavior:

  1. int32 CFE_SB_SendMsg(CFE_SB_Msg_t *MsgPtr)
    {
    UT_Stub_RegisterContext(UT_KEY(CFE_SB_SendMsg), MsgPtr);
    int32 status = CFE_SUCCESS;
    /*
    * Create a context entry so a hook function
    * could do something useful with the message
    */
    status = UT_DEFAULT_IMPL(CFE_SB_SendMsg);
    if (status >= 0)
    {
    UT_Stub_CopyFromLocal(UT_KEY(CFE_SB_SendMsg), MsgPtr->Byte,
    CFE_SB_StubMsg_GetMetaData(MsgPtr)->TotalLength);
    }
    return status;
    }

  2. Compare with

    void CFE_SB_TimeStampMsg(CFE_SB_MsgPtr_t MsgPtr)
    {
    UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_TimeStampMsg), MsgPtr);
    UT_DEFAULT_IMPL(CFE_SB_TimeStampMsg);
    UT_Stub_CopyFromLocal(UT_KEY(CFE_SB_TimeStampMsg), &MsgPtr, sizeof(MsgPtr));
    }

Expected behavior
Default CFE_SB_SendMsg stub behavior should be like CFE_SB_TimeStampMsg. A hook should be required to provide extra behavior.

Code snips
See above.

System observed on:
RHEL 7.6

Additional context
N/A

Reporter Info
Alan Gibson NASA GSFC/587

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions