Skip to content

Commit

Permalink
Merge pull request #605 from skliper/fix604-utassert-addreq
Browse files Browse the repository at this point in the history
Fix #604, Add ut_assert address equal macro
  • Loading branch information
yammajamma authored Sep 24, 2020
2 parents 5380f0b + fe39b50 commit 32e4f72
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 32e4f72

Please sign in to comment.