tests: remove static data from viewporter
authorPekka Paalanen <pekka.paalanen@collabora.com>
Tue, 5 Nov 2019 13:40:25 +0000 (15:40 +0200)
committerDaniel Stone <daniel@fooishbar.org>
Thu, 21 Nov 2019 16:24:01 +0000 (16:24 +0000)
This caching is actually never hit. I tested by making the early return abort()
instead and all works just fine.

Remove the caching. The static variable will cause problems when we stop
fork()'ing for each test case.

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

index 95fb9b46ce5e1791ae17767899859194782f48fa..f9b19d9e10a568e04284b802d403b1d6822065d2 100644 (file)
@@ -41,10 +41,7 @@ get_viewporter(struct client *client)
 {
        struct global *g;
        struct global *global_wpr = NULL;
-       static struct wp_viewporter *wpr;
-
-       if (wpr)
-               return wpr;
+       struct wp_viewporter *wpr;
 
        wl_list_for_each(g, &client->global_list, link) {
                if (strcmp(g->interface, wp_viewporter_interface.name))