summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Michael <cp.michael@samsung.com>2019-07-22 10:05:27 -0400
committerChristopher Michael <cp.michael@samsung.com>2019-07-22 10:05:27 -0400
commit1b20f789dc05a331353d7bcf024827df6b554e23 (patch)
tree590f64ab7c1d3d7f2990a0ab678f9650b3feca8a
parenta526285db4dd281148a8d4ffd347bbc2dec881e3 (diff)
Revert "tests/ecore_wl2: Reduce calls to ecore_wl2_display_connect"
Reverting this as it causes tests to stall (essentially 'meson test ecore_wl2-suite' just hangs) when run inside a compositor. This reverts commit a526285db4dd281148a8d4ffd347bbc2dec881e3.
-rw-r--r--src/tests/ecore_wl2/ecore_wl2_test_window.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/src/tests/ecore_wl2/ecore_wl2_test_window.c b/src/tests/ecore_wl2/ecore_wl2_test_window.c
index 88c4f7b652..3f5e98cd50 100644
--- a/src/tests/ecore_wl2/ecore_wl2_test_window.c
+++ b/src/tests/ecore_wl2/ecore_wl2_test_window.c
@@ -10,13 +10,12 @@
10 10
11#include "ecore_wl2_suite.h" 11#include "ecore_wl2_suite.h"
12 12
13static Ecore_Wl2_Display *disp;
14
15static Ecore_Wl2_Display * 13static Ecore_Wl2_Display *
16_display_connect(void) 14_display_connect(void)
17{ 15{
16 Ecore_Wl2_Display *disp;
17
18 disp = ecore_wl2_display_connect(NULL); 18 disp = ecore_wl2_display_connect(NULL);
19 ck_assert(disp != NULL);
20 return disp; 19 return disp;
21} 20}
22 21
@@ -31,8 +30,12 @@ _window_create(Ecore_Wl2_Display *disp)
31 30
32EFL_START_TEST(wl2_window_new) 31EFL_START_TEST(wl2_window_new)
33{ 32{
33 Ecore_Wl2_Display *disp;
34 Ecore_Wl2_Window *win; 34 Ecore_Wl2_Window *win;
35 35
36 disp = _display_connect();
37 ck_assert(disp != NULL);
38
36 win = _window_create(disp); 39 win = _window_create(disp);
37 ck_assert(win != NULL); 40 ck_assert(win != NULL);
38} 41}
@@ -40,10 +43,14 @@ EFL_END_TEST
40 43
41EFL_START_TEST(wl2_window_surface_test) 44EFL_START_TEST(wl2_window_surface_test)
42{ 45{
46 Ecore_Wl2_Display *disp;
43 Ecore_Wl2_Window *win; 47 Ecore_Wl2_Window *win;
44 struct wl_surface *surf; 48 struct wl_surface *surf;
45 int id = -1; 49 int id = -1;
46 50
51 disp = _display_connect();
52 ck_assert(disp != NULL);
53
47 win = _window_create(disp); 54 win = _window_create(disp);
48 ck_assert(win != NULL); 55 ck_assert(win != NULL);
49 56
@@ -59,9 +66,13 @@ EFL_END_TEST
59 66
60EFL_START_TEST(wl2_window_rotation_get) 67EFL_START_TEST(wl2_window_rotation_get)
61{ 68{
69 Ecore_Wl2_Display *disp;
62 Ecore_Wl2_Window *win; 70 Ecore_Wl2_Window *win;
63 int rot = -1; 71 int rot = -1;
64 72
73 disp = _display_connect();
74 ck_assert(disp != NULL);
75
65 win = _window_create(disp); 76 win = _window_create(disp);
66 ck_assert(win != NULL); 77 ck_assert(win != NULL);
67 78
@@ -72,9 +83,13 @@ EFL_END_TEST
72 83
73EFL_START_TEST(wl2_window_output_find) 84EFL_START_TEST(wl2_window_output_find)
74{ 85{
86 Ecore_Wl2_Display *disp;
75 Ecore_Wl2_Window *win; 87 Ecore_Wl2_Window *win;
76 Ecore_Wl2_Output *out; 88 Ecore_Wl2_Output *out;
77 89
90 disp = _display_connect();
91 ck_assert(disp != NULL);
92
78 win = _window_create(disp); 93 win = _window_create(disp);
79 ck_assert(win != NULL); 94 ck_assert(win != NULL);
80 95
@@ -85,9 +100,13 @@ EFL_END_TEST
85 100
86EFL_START_TEST(wl2_window_aux_hints_supported_get) 101EFL_START_TEST(wl2_window_aux_hints_supported_get)
87{ 102{
103 Ecore_Wl2_Display *disp;
88 Ecore_Wl2_Window *win; 104 Ecore_Wl2_Window *win;
89 Eina_List *l; 105 Eina_List *l;
90 106
107 disp = _display_connect();
108 ck_assert(disp != NULL);
109
91 win = _window_create(disp); 110 win = _window_create(disp);
92 ck_assert(win != NULL); 111 ck_assert(win != NULL);
93 112
@@ -98,8 +117,12 @@ EFL_END_TEST
98 117
99EFL_START_TEST(wl2_window_display_get) 118EFL_START_TEST(wl2_window_display_get)
100{ 119{
120 Ecore_Wl2_Display *disp;
101 Ecore_Wl2_Window *win; 121 Ecore_Wl2_Window *win;
102 122
123 disp = _display_connect();
124 ck_assert(disp != NULL);
125
103 win = _window_create(disp); 126 win = _window_create(disp);
104 ck_assert(win != NULL); 127 ck_assert(win != NULL);
105 128
@@ -112,8 +135,6 @@ ecore_wl2_test_window(TCase *tc)
112{ 135{
113 if (getenv("WAYLAND_DISPLAY")) 136 if (getenv("WAYLAND_DISPLAY"))
114 { 137 {
115 disp = _display_connect();
116
117 /* window tests can only run if there is an existing compositor */ 138 /* window tests can only run if there is an existing compositor */
118 tcase_add_test(tc, wl2_window_new); 139 tcase_add_test(tc, wl2_window_new);
119 tcase_add_test(tc, wl2_window_surface_test); 140 tcase_add_test(tc, wl2_window_surface_test);
@@ -121,7 +142,5 @@ ecore_wl2_test_window(TCase *tc)
121 tcase_add_test(tc, wl2_window_output_find); 142 tcase_add_test(tc, wl2_window_output_find);
122 tcase_add_test(tc, wl2_window_aux_hints_supported_get); 143 tcase_add_test(tc, wl2_window_aux_hints_supported_get);
123 tcase_add_test(tc, wl2_window_display_get); 144 tcase_add_test(tc, wl2_window_display_get);
124
125 ecore_wl2_display_disconnect(disp);
126 } 145 }
127} 146}