Skip to content

Commit

Permalink
add unit test, remove UNSUB report, also one bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CDKnightNASA committed Jan 17, 2020
1 parent 4e32599 commit dad1a39
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
14 changes: 0 additions & 14 deletions fsw/cfe-core/src/inc/cfe_sb_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -430,20 +430,6 @@
**/
#define CFE_SB_SUBSCRIPTION_RPT_EID 22


/** \brief <tt> 'Sending Unsubscription Report Msg=0x\%x,Pipe=\%d,Stat=0x\%x' </tt>
** \event <tt> 'Sending Unsubscription Report Msg=0x\%x,Pipe=\%d,Stat=0x\%x' </tt>
**
** \par Type: DEBUG
**
** \par Cause:
**
** This debug event message is issued when SB subscription reporting is enabled,
** (which is disabled by default) and a subscription is successfully received.
**/
#define CFE_SB_UNSUBSCRIPTION_RPT_EID 24


/** \brief <tt> 'Pipe Overflow,MsgId 0x\%x,pipe \%s,stat 0x\%x,app \%s' </tt>
** \event <tt> 'Pipe Overflow,MsgId 0x\%x,pipe \%s,stat 0x\%x,app \%s' </tt>
**
Expand Down
1 change: 0 additions & 1 deletion fsw/cfe-core/src/sb/cfe_sb_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,6 @@ int32 CFE_SB_UnsubscribeFull(CFE_SB_MsgId_t MsgId,CFE_SB_PipeId_t PipeId,
uint32 PipeIdx;
uint32 TskId = 0;
bool MatchFound = false;
int32 Stat;
CFE_SB_DestinationD_t *DestPtr = NULL;
char FullName[(OS_MAX_API_NAME * 2)];

Expand Down
20 changes: 20 additions & 0 deletions fsw/cfe-core/unit-test/sb_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -6023,6 +6023,26 @@ void Test_SendMsg_SequenceCount(void)
TestStat = CFE_FAIL;
}

CFE_SB_Unsubscribe(MsgId, PipeId); /* should have no subscribers now */

CFE_SB_SendMsg(TlmPktPtr); /* increment to 3 */

CFE_SB_Subscribe(MsgId, PipeId); /* resubscribe so we can receive a msg */

CFE_SB_SendMsg(TlmPktPtr); /* increment to 4 */

CFE_SB_RcvMsg(&PtrToMsg, PipeId, CFE_SB_PEND_FOREVER);

if (CCSDS_RD_SEQ(PtrToMsg->Hdr) != 4)
{
snprintf(cMsg, UT_MAX_MESSAGE_LENGTH,
"Unexpected sequence count for send in sequence count test, "
"exp=4, act=%d",
CCSDS_RD_SEQ(PtrToMsg->Hdr));
UT_Text(cMsg);
TestStat = CFE_FAIL;
}

CFE_SB_DeletePipe(PipeId);
UT_Report(__FILE__, __LINE__,
TestStat, "Test_SendMsg_API",
Expand Down

0 comments on commit dad1a39

Please sign in to comment.