mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-28 06:10:06 +01:00
test: allow passing func/line up from litest_abort_msg()
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1169>
This commit is contained in:
parent
90dafb33b4
commit
b43abaeacb
2 changed files with 10 additions and 6 deletions
|
|
@ -208,7 +208,7 @@ litest_fail_condition(const char *file,
|
|||
litest_log("%s\n", buf);
|
||||
}
|
||||
|
||||
litest_log("in %s() (%s:%d)\n", func, file, line);
|
||||
litest_log("in %s() (%s:%d)\n", func, file ? file : "???", line);
|
||||
litest_backtrace(func);
|
||||
litest_runner_abort();
|
||||
}
|
||||
|
|
@ -3487,8 +3487,9 @@ _litest_wait_for_event_of_type(struct libinput *li,
|
|||
uint64_t now;
|
||||
now_in_us(&now);
|
||||
if (now > expiry) {
|
||||
litest_abort_msg("Waited >%dms for events, but no events are pending",
|
||||
timeout);
|
||||
_litest_abort_msg(NULL, lineno, func,
|
||||
"Waited >%dms for events, but no events are pending",
|
||||
timeout);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -162,11 +162,14 @@ litest_fail_comparison_str(const char *file,
|
|||
#cond, __VA_ARGS__); \
|
||||
} while(0)
|
||||
|
||||
#define litest_abort_msg(...) {\
|
||||
litest_fail_condition(__FILE__, __LINE__, __func__, \
|
||||
#define _litest_abort_msg(file_, line_, func_, ...) do {\
|
||||
litest_fail_condition(file_, line_, func_, \
|
||||
"aborting", __VA_ARGS__); \
|
||||
abort(); \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
#define litest_abort_msg(...) \
|
||||
_litest_abort_msg(__FILE__, __LINE__, __func__, __VA_ARGS__)
|
||||
|
||||
#define litest_assert_notnull(cond) \
|
||||
do { \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue