1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-11-25 14:06:08 -05:00

test.h: update to upstream 368c467

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2022-07-17 15:39:50 +01:00
parent cb0b846dbe
commit e757a6461d
No known key found for this signature in database
GPG key ID: D3A4405BE6CC17F4

View file

@ -78,6 +78,18 @@ struct test_file_metadata __attribute__((weak)) * test_file_head;
} \
} while (0)
#define TEST_STRNEQUAL(a, b, len) \
do { \
if (strncmp(a, b, len) != 0) { \
const char *part2 = " != " #b; \
size_t len2 = len + strlen(part2) + 3; \
char *buf = malloc(len2); \
snprintf(buf, len2, "\"%.*s\"%s", len, a, part2); \
SET_FAILURE(buf, true); \
return; \
} \
} while (0)
#define TEST_CASE(_name) \
static void __test_h_##_name(struct test_case_metadata *, \
struct test_file_metadata *); \
@ -191,5 +203,9 @@ static inline void __attribute__((constructor(102))) run_tests(void) {
#define TEST_STREQUAL(a, b) \
(void)(a); \
(void)(b)
#define TEST_STRNEQUAL(a, b, len) \
(void)(a); \
(void)(b); \
(void)(len)
#endif