From cc908b68a97561a75761e7f2394c293b6c95adab Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 8 Jul 2019 09:47:31 +1000 Subject: [PATCH] test: fix two coverity warnings Alleged division by zero and use of an uninitialized variable. Both cannot happen the way we call the tests, so let's just abort to make coverity happy. Signed-off-by: Peter Hutterer --- test/test-pointer.c | 1 + test/test-tablet.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/test/test-pointer.c b/test/test-pointer.c index 25cef853..6561489a 100644 --- a/test/test-pointer.c +++ b/test/test-pointer.c @@ -68,6 +68,7 @@ test_relative_event(struct litest_device *dev, double dx, double dy) prop = udev_device_get_property_value(ud, "MOUSE_DPI"); if (prop) { dpi = parse_mouse_dpi_property(prop); + ck_assert_int_ne(dpi, 0); dx *= 1000.0/dpi; dy *= 1000.0/dpi; diff --git a/test/test-tablet.c b/test/test-tablet.c index 5f652613..79319039 100644 --- a/test/test-tablet.c +++ b/test/test-tablet.c @@ -111,6 +111,8 @@ START_TEST(button_seat_count) case BTN_0: dev2 = litest_add_device(li, LITEST_DELL_CANVAS_TOTEM); break; + default: + ck_abort(); } litest_tablet_proximity_in(dev, 10, 10, axes);