test: move litest_free_test_list to inside ifndef NO_MAIN

This is now only called from one spot, so let's move it so it is
ifdef'd out.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1067>
This commit is contained in:
Peter Hutterer 2024-10-15 15:47:19 +10:00 committed by Marge Bot
parent 0cfde0f95f
commit 27fa85a884

View file

@ -889,27 +889,6 @@ static struct libinput_interface interface = {
.close_restricted = close_restricted,
};
static void
litest_free_test_list(struct list *tests)
{
struct suite *s;
list_for_each_safe(s, tests, node) {
struct test *t;
list_for_each_safe(t, &s->tests, node) {
free(t->name);
free(t->devname);
list_remove(&t->node);
free(t);
}
list_remove(&s->node);
free(s->name);
free(s);
}
}
LIBINPUT_ATTRIBUTE_PRINTF(3, 0)
static inline void
quirk_log_handler(struct libinput *unused,
@ -4813,6 +4792,27 @@ restore_tty(int tty_mode)
}
}
static void
litest_free_test_list(struct list *tests)
{
struct suite *s;
list_for_each_safe(s, tests, node) {
struct test *t;
list_for_each_safe(t, &s->tests, node) {
free(t->name);
free(t->devname);
list_remove(&t->node);
free(t);
}
list_remove(&s->node);
free(s->name);
free(s);
}
}
int
main(int argc, char **argv)
{