From fe39b5044e14609c7f586ccd24454100f7c898a4 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Wed, 23 Sep 2020 10:20:50 -0400 Subject: [PATCH] Fix #604, Add ut_assert address equal macro --- ut_assert/inc/utassert.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ut_assert/inc/utassert.h b/ut_assert/inc/utassert.h index a24f0e200..6e9d6e1b3 100644 --- a/ut_assert/inc/utassert.h +++ b/ut_assert/inc/utassert.h @@ -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.