#define ASSERT_RTX_EQ(EXPECTED, ACTUAL) \
SELFTEST_BEGIN_STMT \
- const char *desc = "ASSERT_RTX_EQ (" #EXPECTED ", " #ACTUAL ")"; \
- ::selftest::assert_rtx_eq_at (SELFTEST_LOCATION, desc, (EXPECTED), \
+ const char *desc_ = "ASSERT_RTX_EQ (" #EXPECTED ", " #ACTUAL ")"; \
+ ::selftest::assert_rtx_eq_at (SELFTEST_LOCATION, desc_, (EXPECTED), \
(ACTUAL)); \
SELFTEST_END_STMT
#define ASSERT_RTX_PTR_EQ(EXPECTED, ACTUAL) \
SELFTEST_BEGIN_STMT \
- const char *desc = "ASSERT_RTX_PTR_EQ (" #EXPECTED ", " #ACTUAL ")"; \
- ::selftest::assert_rtx_ptr_eq_at (SELFTEST_LOCATION, desc, (EXPECTED), \
+ const char *desc_ = "ASSERT_RTX_PTR_EQ (" #EXPECTED ", " #ACTUAL ")"; \
+ ::selftest::assert_rtx_ptr_eq_at (SELFTEST_LOCATION, desc_, (EXPECTED), \
(ACTUAL)); \
SELFTEST_END_STMT
#define ASSERT_TRUE_AT(LOC, EXPR) \
SELFTEST_BEGIN_STMT \
- const char *desc = "ASSERT_TRUE (" #EXPR ")"; \
- bool actual = (EXPR); \
- if (actual) \
- ::selftest::pass ((LOC), desc); \
+ const char *desc_ = "ASSERT_TRUE (" #EXPR ")"; \
+ bool actual_ = (EXPR); \
+ if (actual_) \
+ ::selftest::pass ((LOC), desc_); \
else \
- ::selftest::fail ((LOC), desc); \
+ ::selftest::fail ((LOC), desc_); \
SELFTEST_END_STMT
/* Evaluate EXPR and coerce to bool, calling
#define ASSERT_FALSE_AT(LOC, EXPR) \
SELFTEST_BEGIN_STMT \
- const char *desc = "ASSERT_FALSE (" #EXPR ")"; \
- bool actual = (EXPR); \
- if (actual) \
- ::selftest::fail ((LOC), desc); \
- else \
- ::selftest::pass ((LOC), desc); \
+ const char *desc_ = "ASSERT_FALSE (" #EXPR ")"; \
+ bool actual_ = (EXPR); \
+ if (actual_) \
+ ::selftest::fail ((LOC), desc_); \
+ else \
+ ::selftest::pass ((LOC), desc_); \
SELFTEST_END_STMT
/* Evaluate EXPECTED and ACTUAL and compare them with ==, calling
#define ASSERT_EQ_AT(LOC, EXPECTED, ACTUAL) \
SELFTEST_BEGIN_STMT \
- const char *desc = "ASSERT_EQ (" #EXPECTED ", " #ACTUAL ")"; \
+ const char *desc_ = "ASSERT_EQ (" #EXPECTED ", " #ACTUAL ")"; \
if ((EXPECTED) == (ACTUAL)) \
- ::selftest::pass ((LOC), desc); \
+ ::selftest::pass ((LOC), desc_); \
else \
- ::selftest::fail ((LOC), desc); \
+ ::selftest::fail ((LOC), desc_); \
SELFTEST_END_STMT
/* Evaluate EXPECTED and ACTUAL and compare them with !=, calling
#define ASSERT_NE(EXPECTED, ACTUAL) \
SELFTEST_BEGIN_STMT \
- const char *desc = "ASSERT_NE (" #EXPECTED ", " #ACTUAL ")"; \
+ const char *desc_ = "ASSERT_NE (" #EXPECTED ", " #ACTUAL ")"; \
if ((EXPECTED) != (ACTUAL)) \
- ::selftest::pass (SELFTEST_LOCATION, desc); \
+ ::selftest::pass (SELFTEST_LOCATION, desc_); \
else \
- ::selftest::fail (SELFTEST_LOCATION, desc); \
+ ::selftest::fail (SELFTEST_LOCATION, desc_); \
SELFTEST_END_STMT
/* Evaluate EXPECTED and ACTUAL and compare them with strcmp, calling
/* Evaluate PRED1 (VAL1), calling ::selftest::pass if it is true,
::selftest::fail if it is false. */
-#define ASSERT_PRED1(PRED1, VAL1) \
- SELFTEST_BEGIN_STMT \
- const char *desc = "ASSERT_PRED1 (" #PRED1 ", " #VAL1 ")"; \
- bool actual = (PRED1) (VAL1); \
- if (actual) \
- ::selftest::pass (SELFTEST_LOCATION, desc); \
- else \
- ::selftest::fail (SELFTEST_LOCATION, desc); \
+#define ASSERT_PRED1(PRED1, VAL1) \
+ SELFTEST_BEGIN_STMT \
+ const char *desc_ = "ASSERT_PRED1 (" #PRED1 ", " #VAL1 ")"; \
+ bool actual_ = (PRED1) (VAL1); \
+ if (actual_) \
+ ::selftest::pass (SELFTEST_LOCATION, desc_); \
+ else \
+ ::selftest::fail (SELFTEST_LOCATION, desc_); \
SELFTEST_END_STMT
#define SELFTEST_BEGIN_STMT do {