test: Add ASSERT_EQ_ID128() and ASSERT_NE_ID128()
This commit is contained in:
@@ -429,3 +429,30 @@ static inline int run_test_table(void) {
|
||||
abort(); \
|
||||
} \
|
||||
})
|
||||
|
||||
|
||||
#define ASSERT_EQ_ID128(expr1, expr2) \
|
||||
({ \
|
||||
typeof(expr1) _expr1 = (expr1); \
|
||||
typeof(expr2) _expr2 = (expr2); \
|
||||
if (!sd_id128_equal(_expr1, _expr2)) { \
|
||||
log_error("%s:%i: Assertion failed: \"%s == %s\", but \"%s != %s\"", \
|
||||
PROJECT_FILE, __LINE__, \
|
||||
#expr1, #expr2, \
|
||||
SD_ID128_TO_STRING(_expr1), SD_ID128_TO_STRING(_expr2)); \
|
||||
abort(); \
|
||||
} \
|
||||
})
|
||||
|
||||
#define ASSERT_NE_ID128(expr1, expr2) \
|
||||
({ \
|
||||
typeof(expr1) _expr1 = (expr1); \
|
||||
typeof(expr2) _expr2 = (expr2); \
|
||||
if (sd_id128_equal(_expr1, _expr2)) { \
|
||||
log_error("%s:%i: Assertion failed: \"%s != %s\", but \"%s == %s\"", \
|
||||
PROJECT_FILE, __LINE__, \
|
||||
#expr1, #expr2, \
|
||||
SD_ID128_TO_STRING(_expr1), SD_ID128_TO_STRING(_expr2)); \
|
||||
abort(); \
|
||||
} \
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user