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

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

Closed
asgibson opened this issue Aug 18, 2020 · 0 comments · Fixed by #834 or #849
Closed

Comments

@asgibson
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant