Skip to content

Commit

Permalink
Fix nasa#604, Add ut_assert address equal macro
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed Sep 23, 2020
1 parent 4f7e201 commit fe39b50
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ut_assert/inc/utassert.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,17 @@ typedef struct
#define UtAssert_Type(Type,Expression,...) \
UtAssertEx(Expression, UTASSERT_CASETYPE_##Type, __FILE__, __LINE__, __VA_ARGS__)

/**
* \brief Compare addresses for equality with an auto-generated description message
*/
#define UtAssert_ADDRESS_EQ(actual,expect) do \
{ \
void *exp = (void*)(expect); \
void *act = (void*)(actual); \
UtAssert_True(act == exp, "%s (%p) == %s (%p)", \
#actual, act, #expect, exp); \
} while(0) \

/**
* \brief Compare two values for equality with an auto-generated description message
* Values will be compared in an "int32" type context.
Expand Down

0 comments on commit fe39b50

Please sign in to comment.