Skip to content

Commit

Permalink
Partial nasa#596, UtAssert macros for SB test
Browse files Browse the repository at this point in the history
Update SB coverage test to use preferred macros.

Adds a dedicated assert macro for checking SB MsgId values.
  • Loading branch information
jphickey committed Jun 22, 2021
1 parent 161d8da commit a563e13
Show file tree
Hide file tree
Showing 2 changed files with 172 additions and 152 deletions.
17 changes: 17 additions & 0 deletions modules/core_private/ut-stubs/inc/ut_support.h
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,23 @@ bool CFE_UtAssert_GenericSignedCompare_Impl(int32 ActualValue, CFE_UtAssert_Comp
CFE_UtAssert_GenericUnsignedCompare_Impl(off1, CFE_UtAssert_Compare_EQ, off2, __FILE__, __LINE__, \
"Offset Check: ", #off1, #off2)

/*****************************************************************************/
/**
** \brief Macro to check CFE message ID for equality
**
** \par Description
** A macro that checks two message ID values for equality.
**
** \par Assumptions, External Events, and Notes:
** The generic #UtAssert_UINT32_EQ check should not be used, as CFE_SB_MsgId_t values
** and integers may not be interchangable with strict type checking.
**
******************************************************************************/
#define CFE_UtAssert_MSGID_EQ(mid1, mid2) \
CFE_UtAssert_GenericUnsignedCompare_Impl(CFE_SB_MsgIdToValue(mid1), CFE_UtAssert_Compare_EQ, \
CFE_SB_MsgIdToValue(mid2), __FILE__, __LINE__, "MsgId Check: ", #mid1, \
#mid2)

/*****************************************************************************/
/**
** \brief Macro to check string buffers for equality
Expand Down
Loading

0 comments on commit a563e13

Please sign in to comment.