mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-10 15:10:14 +01:00
test: add litest_assert_not_reached()
Simpler than a specific litest_abort_msg() everywhere Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1204>
This commit is contained in:
parent
e91e1c3111
commit
14c4667980
3 changed files with 6 additions and 3 deletions
|
|
@ -162,6 +162,9 @@ litest_fail_comparison_str(const char *file,
|
|||
#cond, __VA_ARGS__); \
|
||||
} while(0)
|
||||
|
||||
#define litest_assert_not_reached() \
|
||||
litest_abort_msg("Triggered unreachable code\n")
|
||||
|
||||
#define _litest_abort_msg(file_, line_, func_, ...) do {\
|
||||
litest_fail_condition(file_, line_, func_, \
|
||||
"aborting", __VA_ARGS__); \
|
||||
|
|
|
|||
|
|
@ -1650,7 +1650,7 @@ START_TEST(gestures_hold_once_tap_n_drag)
|
|||
button = BTN_MIDDLE;
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
litest_assert_not_reached();
|
||||
}
|
||||
|
||||
switch (nfingers) {
|
||||
|
|
|
|||
|
|
@ -680,7 +680,7 @@ START_TEST(tip_up_motion_one_axis)
|
|||
start_y = 15;
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
litest_assert_not_reached();
|
||||
}
|
||||
|
||||
/* generate enough events to fill the history and move alonge the
|
||||
|
|
@ -3953,7 +3953,7 @@ get_tool_xy(struct libinput *li, double *x, double *y)
|
|||
tev = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
litest_assert_not_reached();
|
||||
}
|
||||
|
||||
*x = libinput_event_tablet_tool_get_x_transformed(tev, 100);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue