test: add test for natural scroll defaults on no-scroll devices
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 6 Feb 2017 00:48:13 +0000 (10:48 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 6 Feb 2017 00:48:13 +0000 (10:48 +1000)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test/test-pointer.c

index 2689e4e43cf2bb55e8b34a719ce05a98223c8c81..6abb7acf24cb7429756dfdf9bccedb7a90d11248 100644 (file)
@@ -657,6 +657,18 @@ START_TEST(pointer_scroll_natural_defaults)
 }
 END_TEST
 
+START_TEST(pointer_scroll_natural_defaults_noscroll)
+{
+       struct litest_device *dev = litest_current_device();
+
+       if (libinput_device_config_scroll_has_natural_scroll(dev->libinput_device))
+               return;
+
+       ck_assert_int_eq(libinput_device_config_scroll_get_natural_scroll_enabled(dev->libinput_device), 0);
+       ck_assert_int_eq(libinput_device_config_scroll_get_default_natural_scroll_enabled(dev->libinput_device), 0);
+}
+END_TEST
+
 START_TEST(pointer_scroll_natural_enable_config)
 {
        struct litest_device *dev = litest_current_device();
@@ -1852,6 +1864,7 @@ litest_setup_tests_pointer(void)
        litest_add("pointer:scroll", pointer_scroll_button_middle_emulation, LITEST_RELATIVE|LITEST_BUTTON, LITEST_ANY);
        litest_add("pointer:scroll", pointer_scroll_nowheel_defaults, LITEST_RELATIVE|LITEST_BUTTON, LITEST_WHEEL);
        litest_add("pointer:scroll", pointer_scroll_natural_defaults, LITEST_WHEEL, LITEST_TABLET);
+       litest_add("pointer:scroll", pointer_scroll_natural_defaults_noscroll, LITEST_ANY, LITEST_WHEEL);
        litest_add("pointer:scroll", pointer_scroll_natural_enable_config, LITEST_WHEEL, LITEST_TABLET);
        litest_add("pointer:scroll", pointer_scroll_natural_wheel, LITEST_WHEEL, LITEST_TABLET);
        litest_add("pointer:scroll", pointer_scroll_has_axis_invalid, LITEST_WHEEL, LITEST_TABLET);