tests: remove static data from ivi-shell-app-test
authorPekka Paalanen <pekka.paalanen@collabora.com>
Tue, 5 Nov 2019 14:47:10 +0000 (16:47 +0200)
committerDaniel Stone <daniel@fooishbar.org>
Thu, 21 Nov 2019 16:24:01 +0000 (16:24 +0000)
Just one test call this only once, so the cached value will never be useful.

Stop using static data, it sets a bad example. If more tests were added, things
would start failing when forking is removed from the test harness.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
tests/ivi-shell-app-test.c

index 5bef76564d6a10c64177aae43aa951c473e00fb3..9fefb5f015a4381992819cbbf82d157ca1c8c9e7 100644 (file)
@@ -36,10 +36,7 @@ get_ivi_application(struct client *client)
 {
        struct global *g;
        struct global *global_iviapp = NULL;
-       static struct ivi_application *iviapp;
-
-       if (iviapp)
-               return iviapp;
+       struct ivi_application *iviapp;
 
        wl_list_for_each(g, &client->global_list, link) {
                if (strcmp(g->interface, "ivi_application"))