mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 13:50:15 +01:00
test: remove duplicate empty lines from the test/ directory
We've had a CI job for checking this since but it omitted the test
directory.
Fixes: bb6ff0ec00 ("gitlab CI: add a job to check for whitespace issues")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1154>
This commit is contained in:
parent
84e814561c
commit
58315eb9d4
18 changed files with 2 additions and 37 deletions
|
|
@ -213,7 +213,7 @@ check-whitespace:
|
|||
- sed -i 's/ \t//' $(git ls-files)
|
||||
- git diff --exit-code || (echo "ERROR - Tab after space in patchset, please fix" && false)
|
||||
# search for duplicated empty lines
|
||||
- sed -i '/^$/N;/^\n$/D' $(git ls-files src/*.{h,c} tools/*.{h,c} udev/*.c)
|
||||
- sed -i '/^$/N;/^\n$/D' $(git ls-files src/*.{h,c} tools/*.{h,c} udev/*.c test/*.c)
|
||||
- git diff --exit-code || (echo "ERROR - Duplicated empty lines, please fix" && false)
|
||||
|
||||
#
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ check-whitespace:
|
|||
- sed -i 's/ \t//' $(git ls-files)
|
||||
- git diff --exit-code || (echo "ERROR - Tab after space in patchset, please fix" && false)
|
||||
# search for duplicated empty lines
|
||||
- sed -i '/^$/N;/^\n$/D' $(git ls-files src/*.{h,c} tools/*.{h,c} udev/*.c)
|
||||
- sed -i '/^$/N;/^\n$/D' $(git ls-files src/*.{h,c} tools/*.{h,c} udev/*.c test/*.c)
|
||||
- git diff --exit-code || (echo "ERROR - Duplicated empty lines, please fix" && false)
|
||||
|
||||
#
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ static struct input_event move[] = {
|
|||
{ .type = -1, .code = -1 },
|
||||
};
|
||||
|
||||
|
||||
static int
|
||||
get_axis_default(struct litest_device *d, unsigned int evcode, int32_t *value)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ static struct input_event move[] = {
|
|||
{ .type = -1, .code = -1 },
|
||||
};
|
||||
|
||||
|
||||
static int
|
||||
get_axis_default(struct litest_device *d, unsigned int evcode, int32_t *value)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -110,7 +110,6 @@ struct litest_runner {
|
|||
} global;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* A global variable that the tests can use
|
||||
* to write log data to. Defaults to stdout
|
||||
|
|
@ -680,7 +679,6 @@ _litest_test_param_fetch(const struct litest_test_parameters *params, ...)
|
|||
va_end(args);
|
||||
}
|
||||
|
||||
|
||||
struct litest_test_parameters *
|
||||
litest_test_parameters_new(void)
|
||||
{
|
||||
|
|
@ -1031,7 +1029,6 @@ litest_runner_run_tests(struct litest_runner *runner)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
runner->times.end = time(NULL);
|
||||
ltime = localtime(&runner->times.end);
|
||||
strftime(timestamp, sizeof(timestamp), "%FT%H:%M", ltime);
|
||||
|
|
|
|||
|
|
@ -96,7 +96,6 @@ struct param_filter {
|
|||
};
|
||||
struct param_filter filter_params[8]; /* name=NULL terminated */
|
||||
|
||||
|
||||
static struct quirks_context *quirks_context;
|
||||
|
||||
struct created_file {
|
||||
|
|
@ -353,7 +352,6 @@ litest_parameter_add_bool(struct litest_parameter *p, bool b)
|
|||
list_append(&p->values, &pv->link);
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
litest_parameter_add_u32(struct litest_parameter *p, uint32_t u)
|
||||
{
|
||||
|
|
@ -374,7 +372,6 @@ litest_parameter_add_i32(struct litest_parameter *p, int32_t i)
|
|||
list_append(&p->values, &pv->link);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
litest_parameter_add_double(struct litest_parameter *p, double d)
|
||||
{
|
||||
|
|
@ -639,7 +636,6 @@ _litest_dispatch(struct libinput *li,
|
|||
int rc = libinput_dispatch(li);
|
||||
enum libinput_event_type type = libinput_next_event_type(li);
|
||||
|
||||
|
||||
const char *evtype = type == LIBINPUT_EVENT_NONE ? "NONE" : litest_event_type_str(type);
|
||||
_litest_checkpoint(func, line,
|
||||
"└──────────────────── /dispatch %3d ────────────────────┘ pending %s",
|
||||
|
|
@ -1175,7 +1171,6 @@ _litest_add_ranged(const char *name,
|
|||
litest_add_tcase(name, funcname, func, required, excluded, range, NULL);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_litest_add_parametrized(const char *name,
|
||||
const char *funcname,
|
||||
|
|
@ -1282,7 +1277,6 @@ _litest_add_parametrized_for_device(const char *filename,
|
|||
litest_abort_msg("Invalid test device type");
|
||||
}
|
||||
|
||||
|
||||
LIBINPUT_ATTRIBUTE_PRINTF(3, 0)
|
||||
static void
|
||||
litest_log_handler(struct libinput *libinput,
|
||||
|
|
@ -1681,7 +1675,6 @@ restore_tty(int tty_mode)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
static inline enum litest_runner_result
|
||||
litest_run(struct list *suites)
|
||||
{
|
||||
|
|
@ -1703,7 +1696,6 @@ litest_run(struct list *suites)
|
|||
enum quirks_setup_mode mode;
|
||||
litest_init_udev_rules(&created_files_list);
|
||||
|
||||
|
||||
mode = use_system_rules_quirks ?
|
||||
QUIRKS_SETUP_ONLY_DEVICE :
|
||||
QUIRKS_SETUP_FULL;
|
||||
|
|
@ -2137,7 +2129,6 @@ litest_destroy_context(struct libinput *li)
|
|||
struct path *p;
|
||||
struct litest_context *ctx;
|
||||
|
||||
|
||||
ctx = libinput_get_user_data(li);
|
||||
litest_assert_ptr_notnull(ctx);
|
||||
libinput_unref(li);
|
||||
|
|
@ -2286,7 +2277,6 @@ udev_setup_monitor(void)
|
|||
udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "input",
|
||||
NULL);
|
||||
|
||||
|
||||
/* remove O_NONBLOCK */
|
||||
rc = fcntl(udev_monitor_get_fd(udev_monitor), F_SETFL, 0);
|
||||
litest_assert_errno_success(rc);
|
||||
|
|
@ -3503,7 +3493,6 @@ litest_drain_events(struct libinput *li)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_litest_drain_events_of_type(struct libinput *li, ...)
|
||||
{
|
||||
|
|
@ -4277,7 +4266,6 @@ litest_assert_tablet_button_event(struct libinput *li, unsigned int button,
|
|||
libinput_event_destroy(event);
|
||||
}
|
||||
|
||||
|
||||
struct libinput_event_tablet_tool *
|
||||
litest_is_proximity_event(struct libinput_event *event,
|
||||
enum libinput_tablet_tool_proximity_state state)
|
||||
|
|
|
|||
|
|
@ -2344,7 +2344,6 @@ TEST_COLLECTION(gestures)
|
|||
litest_add_parametrized(gestures_3fg_drag_lock_resume_1fg_tap, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH, params);
|
||||
}
|
||||
|
||||
|
||||
/* Timing-sensitive test, valgrind is too slow */
|
||||
if (!RUNNING_ON_VALGRIND)
|
||||
litest_add(gestures_swipe_3fg_unaccel, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ simple_log_handler(struct libinput *libinput,
|
|||
litest_assert_notnull(format);
|
||||
}
|
||||
|
||||
|
||||
static int open_restricted(const char *path, int flags, void *data)
|
||||
{
|
||||
int fd;
|
||||
|
|
|
|||
|
|
@ -220,7 +220,6 @@ START_TEST(path_create_pathmax_file)
|
|||
}
|
||||
END_TEST
|
||||
|
||||
|
||||
START_TEST(path_create_destroy)
|
||||
{
|
||||
struct libinput *li;
|
||||
|
|
|
|||
|
|
@ -1686,7 +1686,6 @@ START_TEST(pointer_scroll_button_lock_config)
|
|||
state = libinput_device_config_scroll_get_button_lock(dev->libinput_device);
|
||||
litest_assert_enum_eq(state, LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED);
|
||||
|
||||
|
||||
status = libinput_device_config_scroll_set_button_lock(dev->libinput_device,
|
||||
LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_ENABLED);
|
||||
litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
|
||||
|
|
|
|||
|
|
@ -181,7 +181,6 @@ lid_switch_is_reliable(struct litest_device *dev)
|
|||
is_reliable = streq(prop, "reliable");
|
||||
}
|
||||
|
||||
|
||||
return is_reliable;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4438,7 +4438,6 @@ START_TEST(tablet_pressure_offset_set)
|
|||
litest_dispatch(li);
|
||||
assert_pressure(li, LIBINPUT_EVENT_TABLET_TOOL_AXIS, 0.015);
|
||||
|
||||
|
||||
/* Make sure we can reach the upper range too */
|
||||
litest_axis_set_value(axes, ABS_PRESSURE, 100);
|
||||
litest_tablet_motion(dev, 70, 70, axes);
|
||||
|
|
@ -5591,7 +5590,6 @@ START_TEST(relative_delta)
|
|||
litest_assert(dy > 0.0);
|
||||
libinput_event_destroy(event);
|
||||
|
||||
|
||||
/* flush the motion history */
|
||||
for (int i = 0; i < 5; i ++)
|
||||
litest_tablet_motion(dev, 5, 20 - i, axes);
|
||||
|
|
@ -6629,7 +6627,6 @@ START_TEST(tablet_rotation_left_handed_while_in_prox)
|
|||
libinput_device_config_left_handed_set(tablet->libinput_device,
|
||||
tablet_from);
|
||||
|
||||
|
||||
litest_checkpoint("Moving into proximity");
|
||||
tx = 60;
|
||||
ty = 60;
|
||||
|
|
|
|||
|
|
@ -289,7 +289,6 @@ START_TEST(totem_rotation)
|
|||
for (int i = 1; i < 30; i++) {
|
||||
struct libinput_event_tablet_tool *t;
|
||||
|
||||
|
||||
litest_axis_set_value(axes, ABS_MT_ORIENTATION, 50 + i);
|
||||
litest_tablet_motion(dev, 50, 50, axes);
|
||||
litest_dispatch(li);
|
||||
|
|
@ -313,7 +312,6 @@ START_TEST(totem_rotation)
|
|||
for (int i = 1; i < 30; i++) {
|
||||
struct libinput_event_tablet_tool *t;
|
||||
|
||||
|
||||
litest_axis_set_value(axes, ABS_MT_ORIENTATION, 50 - i);
|
||||
litest_tablet_motion(dev, 50, 50, axes);
|
||||
litest_dispatch(li);
|
||||
|
|
|
|||
|
|
@ -1148,7 +1148,6 @@ START_TEST(touchpad_clickfinger_click_drag)
|
|||
|
||||
litest_touch_up(dev, 0);
|
||||
|
||||
|
||||
litest_dispatch(li);
|
||||
litest_assert_empty_queue(li);
|
||||
}
|
||||
|
|
@ -2233,7 +2232,6 @@ START_TEST(touchpad_non_clickpad_detection)
|
|||
litest_assert(methods & LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS);
|
||||
litest_assert(methods & LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER);
|
||||
|
||||
|
||||
libinput_path_remove_device(device);
|
||||
libevdev_uinput_destroy(uinput);
|
||||
litest_destroy_context(li);
|
||||
|
|
|
|||
|
|
@ -2141,7 +2141,6 @@ START_TEST(touchpad_tap_n_drag_3fg_swipe)
|
|||
break;
|
||||
}
|
||||
|
||||
|
||||
litest_touch_down(dev, 0, 30, 50);
|
||||
litest_touch_down(dev, 1, 50, 50);
|
||||
litest_touch_down(dev, 2, 80, 50);
|
||||
|
|
|
|||
|
|
@ -2272,7 +2272,6 @@ START_TEST(touchpad_palm_clickfinger_pressure_2fg)
|
|||
}
|
||||
END_TEST
|
||||
|
||||
|
||||
static inline bool
|
||||
touchpad_has_touch_size(struct litest_device *dev)
|
||||
{
|
||||
|
|
@ -3730,7 +3729,6 @@ START_TEST(touchpad_fingers_down_before_init)
|
|||
}
|
||||
END_TEST
|
||||
|
||||
|
||||
/* This just tests that we don't completely screw up in one specific case.
|
||||
* The test likely needs to be removed if it starts failing in the future.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -328,7 +328,6 @@ disable_dwtp(struct litest_device *dev)
|
|||
litest_assert_enum_eq(status, expected);
|
||||
}
|
||||
|
||||
|
||||
START_TEST(trackpoint_palmdetect)
|
||||
{
|
||||
struct litest_device *trackpoint = litest_current_device();
|
||||
|
|
|
|||
|
|
@ -1315,7 +1315,6 @@ START_TEST(kvsplit_double_test)
|
|||
litest_assert_double_eq(t->results[i].b, result[i].value);
|
||||
}
|
||||
|
||||
|
||||
free(result);
|
||||
t++;
|
||||
}
|
||||
|
|
@ -1680,7 +1679,6 @@ START_TEST(absinfo_normalize_value_test)
|
|||
litest_assert_double_eq(absinfo_normalize_value(&abs, 50), 1.0);
|
||||
litest_assert_double_eq(absinfo_normalize_value(&abs, 51), 1.0);
|
||||
|
||||
|
||||
abs.minimum = -50;
|
||||
abs.maximum = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue