summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tests/ecore_wl2/ecore_wl2_test_display.c39
-rw-r--r--src/tests/ecore_wl2/ecore_wl2_tests_helpers.h10
2 files changed, 45 insertions, 4 deletions
diff --git a/src/tests/ecore_wl2/ecore_wl2_test_display.c b/src/tests/ecore_wl2/ecore_wl2_test_display.c
index 5806d002f8..c79621ac74 100644
--- a/src/tests/ecore_wl2/ecore_wl2_test_display.c
+++ b/src/tests/ecore_wl2/ecore_wl2_test_display.c
@@ -55,11 +55,42 @@ EFL_START_TEST(wl2_display_name_get)
55} 55}
56EFL_END_TEST 56EFL_END_TEST
57 57
58EFL_START_TEST(wl2_display_connect)
59{
60 Ecore_Wl2_Display *disp;
61
62 disp = ECORE_WL2_TEST_DISPLAY_CONNECT();
63 ck_assert(disp != NULL);
64}
65EFL_END_TEST
66
67EFL_START_TEST(wl2_display_disconnect)
68{
69 Ecore_Wl2_Display *disp;
70
71 disp = ECORE_WL2_TEST_DISPLAY_CONNECT();
72 ck_assert(disp != NULL);
73
74 ecore_wl2_display_disconnect(disp);
75}
76EFL_END_TEST
77
58void 78void
59ecore_wl2_test_display(TCase *tc) 79ecore_wl2_test_display(TCase *tc)
60{ 80{
61 tcase_add_test(tc, wl2_display_create); 81 if (!getenv("WAYLAND_DISPLAY"))
62 tcase_add_test(tc, wl2_display_destroy); 82 {
63 tcase_add_test(tc, wl2_display_get); 83 /* tests here are for server-side functions */
64 tcase_add_test(tc, wl2_display_name_get); 84 tcase_add_test(tc, wl2_display_create);
85 tcase_add_test(tc, wl2_display_destroy);
86 tcase_add_test(tc, wl2_display_get);
87 tcase_add_test(tc, wl2_display_name_get);
88 }
89
90 if (getenv("WAYLAND_DISPLAY"))
91 {
92 /* tests here are for client-side functions */
93 tcase_add_test(tc, wl2_display_connect);
94 tcase_add_test(tc, wl2_display_disconnect);
95 }
65} 96}
diff --git a/src/tests/ecore_wl2/ecore_wl2_tests_helpers.h b/src/tests/ecore_wl2/ecore_wl2_tests_helpers.h
index 24175a505a..e06cea7859 100644
--- a/src/tests/ecore_wl2/ecore_wl2_tests_helpers.h
+++ b/src/tests/ecore_wl2/ecore_wl2_tests_helpers.h
@@ -4,6 +4,7 @@
4# include <Ecore_Wl2.h> 4# include <Ecore_Wl2.h>
5 5
6# define ECORE_WL2_TEST_DISPLAY_SETUP() _setup_display() 6# define ECORE_WL2_TEST_DISPLAY_SETUP() _setup_display()
7# define ECORE_WL2_TEST_DISPLAY_CONNECT() _connect_display()
7 8
8static Ecore_Wl2_Display * 9static Ecore_Wl2_Display *
9_setup_display(void) 10_setup_display(void)
@@ -14,4 +15,13 @@ _setup_display(void)
14 return disp; 15 return disp;
15} 16}
16 17
18static Ecore_Wl2_Display *
19_connect_display(void)
20{
21 Ecore_Wl2_Display *disp;
22
23 disp = ecore_wl2_display_connect(NULL);
24 return disp;
25}
26
17#endif 27#endif