1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

test: Add __FILE__ and __LINE__ to T_ASSERT macro

This commit is contained in:
Marian Csontos 2022-06-08 18:02:08 +02:00
parent a30013ff4f
commit 64ba9e4eca

View File

@ -37,7 +37,7 @@ bool register_test(struct test_suite *ts,
void test_fail(const char *fmt, ...)
__attribute__((noreturn, format (printf, 1, 2)));
#define T_ASSERT(e) do {if (!(e)) {test_fail("assertion failed: '%s'", # e);} } while(0)
#define T_ASSERT(e) do {if (!(e)) {test_fail("assertion failed: '%s' at %s:%d", # e, __FILE__, __LINE__);} } while(0)
#define T_ASSERT_EQUAL(x, y) T_ASSERT((x) == (y))
#define T_ASSERT_NOT_EQUAL(x, y) T_ASSERT((x) != (y))