You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In ut_sb_stubs.c description comment for CFE_SB_RcvMsg incorrectly states that first call returns CFE_SUCCESS, while additional calls return -1. It appears that it will always return CFE_SUCCESS.
To Reproduce
Steps to reproduce the behavior:
Write a test where CFE_SB_RcvMsg is called at least twice.
Check result on first call == CFE_SUCCESS, will pass
Check result on second call == -1, will fail (result is CFE_SUCCESS instead)
additional calls have same result as 3 above.
Expected behavior
Rewrite comment to show that result returned is always CFE_SUCCESS, unless the commented behavior is what is desired, then fix code to accomplish that.
Code snips
/*****************************************************************************/
/**
** \brief CFE_SB_RcvMsg stub function
**
** \par Description
** This function is used to mimic the response of the cFE SB function
** CFE_SB_RcvMsg. By default it will return the TIMEOUT error response,
** unless the test setup sequence has indicated otherwise.
**
** \par Assumptions, External Events, and Notes:
** None
**
** \returns
** Returns CFE_SUCCESS on the first call, then -1 on the second.
**
******************************************************************************/
int32 CFE_SB_RcvMsg(CFE_SB_MsgPtr_t *BufPtr,
CFE_SB_PipeId_t PipeId,
int32 TimeOut)
{
int32 status;
static union
{
CFE_SB_Msg_t Msg;
uint8 Ext[CFE_MISSION_SB_MAX_SB_MSG_SIZE];
} Buffer;
status = UT_DEFAULT_IMPL(CFE_SB_RcvMsg);
if (status >= 0)
{
if (UT_Stub_CopyToLocal(UT_KEY(CFE_SB_RcvMsg), (uint8*)BufPtr, sizeof(*BufPtr)) < sizeof(*BufPtr))
{
memset(&Buffer, 0, sizeof(Buffer));
*BufPtr = &Buffer.Msg;
}
}
return status;
}
System observed on:
Hardware: PC
OS: RHEL Workstation 7.6 (Maipo), Linux 3.10.0-1062.1.2.el7.x86_64
Versions cFE 6.7
Additional context
Add any other context about the problem here.
Reporter Info
Alan Gibson, NASA, GSFC-0587
The text was updated successfully, but these errors were encountered:
Describe the bug
In ut_sb_stubs.c description comment for CFE_SB_RcvMsg incorrectly states that first call returns CFE_SUCCESS, while additional calls return -1. It appears that it will always return CFE_SUCCESS.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Rewrite comment to show that result returned is always CFE_SUCCESS, unless the commented behavior is what is desired, then fix code to accomplish that.
Code snips
System observed on:
Additional context
Add any other context about the problem here.
Reporter Info
Alan Gibson, NASA, GSFC-0587
The text was updated successfully, but these errors were encountered: