diff --git a/test/keyboard.c b/test/keyboard.c index 4563ce6f..cb7ad522 100644 --- a/test/keyboard.c +++ b/test/keyboard.c @@ -36,7 +36,7 @@ START_TEST(keyboard_seat_key_count) struct libinput_event *ev; struct libinput_event_keyboard *kev; int i; - int seat_key_count; + int seat_key_count = 0; int expected_key_button_count = 0; char device_name[255]; diff --git a/test/litest.c b/test/litest.c index b220b2fe..16d92399 100644 --- a/test/litest.c +++ b/test/litest.c @@ -184,6 +184,7 @@ litest_add_tcase_for_device(struct suite *suite, } t = zalloc(sizeof(*t)); + assert(t != NULL); t->name = strdup(test_name); t->tc = tcase_create(test_name); list_insert(&suite->tests, &t->node); @@ -215,6 +216,7 @@ litest_add_tcase_no_device(struct suite *suite, void *func) } t = zalloc(sizeof(*t)); + assert(t != NULL); t->name = strdup(test_name); t->tc = tcase_create(test_name); list_insert(&suite->tests, &t->node); @@ -270,6 +272,7 @@ get_suite(const char *name) } s = zalloc(sizeof(*s)); + assert(s != NULL); s->name = strdup(name); s->suite = suite_create(s->name); @@ -808,7 +811,8 @@ litest_touch_down(struct litest_device *d, unsigned int slot, { struct input_event *ev; - assert(++d->ntouches_down > 0); + assert(d->ntouches_down >= 0); + d->ntouches_down++; send_btntool(d); @@ -836,7 +840,8 @@ litest_touch_up(struct litest_device *d, unsigned int slot) { .type = -1, .code = -1 } }; - assert(--d->ntouches_down >= 0); + assert(d->ntouches_down > 0); + d->ntouches_down--; send_btntool(d); diff --git a/test/pointer.c b/test/pointer.c index 2e52a206..24ea7266 100644 --- a/test/pointer.c +++ b/test/pointer.c @@ -470,7 +470,7 @@ START_TEST(pointer_seat_button_count) struct libinput_event *ev; struct libinput_event_pointer *tev; int i; - int seat_button_count; + int seat_button_count = 0; int expected_seat_button_count = 0; char device_name[255];