@@ -81,14 +81,16 @@ typedef enum
8181 */
8282typedef enum
8383{
84- UtAssert_Compare_NONE , /**< invalid/not used, always false */
85- UtAssert_Compare_EQ , /**< actual equals reference value */
86- UtAssert_Compare_NEQ , /**< actual does not non equal reference value */
87- UtAssert_Compare_LT , /**< actual less than reference (exclusive) */
88- UtAssert_Compare_GT , /**< actual greater than reference (exclusive) */
89- UtAssert_Compare_LTEQ , /**< actual less than or equal to reference (inclusive) */
90- UtAssert_Compare_GTEQ , /**< actual greater than reference (inclusive) */
91- UtAssert_Compare_MAX /**< placeholder, not used */
84+ UtAssert_Compare_NONE , /**< invalid/not used, always false */
85+ UtAssert_Compare_EQ , /**< actual equals reference value */
86+ UtAssert_Compare_NEQ , /**< actual does not non equal reference value */
87+ UtAssert_Compare_LT , /**< actual less than reference (exclusive) */
88+ UtAssert_Compare_GT , /**< actual greater than reference (exclusive) */
89+ UtAssert_Compare_LTEQ , /**< actual less than or equal to reference (inclusive) */
90+ UtAssert_Compare_GTEQ , /**< actual greater than reference (inclusive) */
91+ UtAssert_Compare_BITMASK_SET , /**< actual equals reference value */
92+ UtAssert_Compare_BITMASK_UNSET , /**< actual equals reference value */
93+ UtAssert_Compare_MAX /**< placeholder, not used */
9294} UtAssert_Compare_t ;
9395
9496/**
@@ -404,6 +406,24 @@ typedef struct
404406 UtAssert_GenericUnsignedCompare((uint32)(expr), UtAssert_Compare_GT, (uint32)(ref), UtAssert_Radix_DECIMAL, \
405407 __FILE__, __LINE__, "", #expr, #ref)
406408
409+ /**
410+ * \brief Macro for checking that bits in a bit field are set
411+ *
412+ * Test Passes if all the bits specified in "mask" are set in "rawval"
413+ */
414+ #define UtAssert_BITMASK_SET (rawval , mask ) \
415+ UtAssert_GenericUnsignedCompare((uint32)(rawval), UtAssert_Compare_BITMASK_SET, (uint32)(mask), \
416+ UtAssert_Radix_HEX, __FILE__, __LINE__, "", #rawval, #mask)
417+
418+ /**
419+ * \brief Macro for checking that bits in a bit field are unset
420+ *
421+ * Test Passes if none of the bits specified in "mask" are set in "rawval"
422+ */
423+ #define UtAssert_BITMASK_UNSET (rawval , mask ) \
424+ UtAssert_GenericUnsignedCompare((uint32)(rawval), UtAssert_Compare_BITMASK_UNSET, (uint32)(mask), \
425+ UtAssert_Radix_HEX, __FILE__, __LINE__, "", #rawval, #mask)
426+
407427/**
408428 * \brief Macro for logging calls to a "void" function
409429 *
0 commit comments