diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 24d89b91..b07155af 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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) # diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template index 607d36e4..9e7b09ca 100644 --- a/.gitlab-ci/ci.template +++ b/.gitlab-ci/ci.template @@ -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) # diff --git a/test/litest-device-generic-pressurepad.c b/test/litest-device-generic-pressurepad.c index 298b3280..a7cd5f3a 100644 --- a/test/litest-device-generic-pressurepad.c +++ b/test/litest-device-generic-pressurepad.c @@ -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) { diff --git a/test/litest-device-synaptics-pressurepad.c b/test/litest-device-synaptics-pressurepad.c index bd214a27..1c2eee49 100644 --- a/test/litest-device-synaptics-pressurepad.c +++ b/test/litest-device-synaptics-pressurepad.c @@ -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) { diff --git a/test/litest-runner.c b/test/litest-runner.c index df928c0a..2931bb76 100644 --- a/test/litest-runner.c +++ b/test/litest-runner.c @@ -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); diff --git a/test/litest.c b/test/litest.c index 072b7f9b..4c4a9f5c 100644 --- a/test/litest.c +++ b/test/litest.c @@ -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) diff --git a/test/test-gestures.c b/test/test-gestures.c index 79be3d91..c4f3f497 100644 --- a/test/test-gestures.c +++ b/test/test-gestures.c @@ -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); diff --git a/test/test-log.c b/test/test-log.c index 1f0720eb..99f6f466 100644 --- a/test/test-log.c +++ b/test/test-log.c @@ -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; diff --git a/test/test-path.c b/test/test-path.c index d050514a..3041f829 100644 --- a/test/test-path.c +++ b/test/test-path.c @@ -220,7 +220,6 @@ START_TEST(path_create_pathmax_file) } END_TEST - START_TEST(path_create_destroy) { struct libinput *li; diff --git a/test/test-pointer.c b/test/test-pointer.c index a063b0e0..d74633eb 100644 --- a/test/test-pointer.c +++ b/test/test-pointer.c @@ -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); diff --git a/test/test-switch.c b/test/test-switch.c index 328a2692..73c4cdad 100644 --- a/test/test-switch.c +++ b/test/test-switch.c @@ -181,7 +181,6 @@ lid_switch_is_reliable(struct litest_device *dev) is_reliable = streq(prop, "reliable"); } - return is_reliable; } diff --git a/test/test-tablet.c b/test/test-tablet.c index e32d277f..21ba098a 100644 --- a/test/test-tablet.c +++ b/test/test-tablet.c @@ -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; diff --git a/test/test-totem.c b/test/test-totem.c index 63355953..0aba225c 100644 --- a/test/test-totem.c +++ b/test/test-totem.c @@ -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); diff --git a/test/test-touchpad-buttons.c b/test/test-touchpad-buttons.c index b40b26c8..14e9cd9a 100644 --- a/test/test-touchpad-buttons.c +++ b/test/test-touchpad-buttons.c @@ -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); diff --git a/test/test-touchpad-tap.c b/test/test-touchpad-tap.c index cc75eb4e..a3a3535e 100644 --- a/test/test-touchpad-tap.c +++ b/test/test-touchpad-tap.c @@ -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); diff --git a/test/test-touchpad.c b/test/test-touchpad.c index f88ed03f..07342271 100644 --- a/test/test-touchpad.c +++ b/test/test-touchpad.c @@ -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. * diff --git a/test/test-trackpoint.c b/test/test-trackpoint.c index ab9c057d..75fc7ec4 100644 --- a/test/test-trackpoint.c +++ b/test/test-trackpoint.c @@ -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(); diff --git a/test/test-utils.c b/test/test-utils.c index ff2f17cf..eeed7dd1 100644 --- a/test/test-utils.c +++ b/test/test-utils.c @@ -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;