summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorChristopher Michael <cp.michael@samsung.com>2019-08-01 08:41:07 -0400
committerChristopher Michael <cp.michael@samsung.com>2019-08-01 08:41:07 -0400
commit34514ccf58c8c5ee037b3736b0d5811f902c63cf (patch)
tree215d056d47a6457e2840da780652a6ab543947ee /src/tests
parenta7971f409d691469ee7aa7530464ee0ff6b9d3c5 (diff)
tests/ecore_wl2: Add start of Ecore_Wl2_Input API tests
ref T8016
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/ecore_wl2/ecore_wl2_suite.c1
-rw-r--r--src/tests/ecore_wl2/ecore_wl2_suite.h1
-rw-r--r--src/tests/ecore_wl2/ecore_wl2_test_display.c3
-rw-r--r--src/tests/ecore_wl2/ecore_wl2_test_input.c53
-rw-r--r--src/tests/ecore_wl2/meson.build3
5 files changed, 58 insertions, 3 deletions
diff --git a/src/tests/ecore_wl2/ecore_wl2_suite.c b/src/tests/ecore_wl2/ecore_wl2_suite.c
index b4285ccd62..b6875c006d 100644
--- a/src/tests/ecore_wl2/ecore_wl2_suite.c
+++ b/src/tests/ecore_wl2/ecore_wl2_suite.c
@@ -12,6 +12,7 @@ static const Efl_Test_Case etc[] =
12 { "Ecore_Wl2", ecore_wl2_test_init }, 12 { "Ecore_Wl2", ecore_wl2_test_init },
13 { "Display", ecore_wl2_test_display }, 13 { "Display", ecore_wl2_test_display },
14 { "Window", ecore_wl2_test_window }, 14 { "Window", ecore_wl2_test_window },
15 { "Input", ecore_wl2_test_input },
15#endif 16#endif
16 { NULL, NULL } 17 { NULL, NULL }
17}; 18};
diff --git a/src/tests/ecore_wl2/ecore_wl2_suite.h b/src/tests/ecore_wl2/ecore_wl2_suite.h
index a344818814..a8edf93074 100644
--- a/src/tests/ecore_wl2/ecore_wl2_suite.h
+++ b/src/tests/ecore_wl2/ecore_wl2_suite.h
@@ -7,5 +7,6 @@
7void ecore_wl2_test_init(TCase *tc); 7void ecore_wl2_test_init(TCase *tc);
8void ecore_wl2_test_display(TCase *tc); 8void ecore_wl2_test_display(TCase *tc);
9void ecore_wl2_test_window(TCase *tc); 9void ecore_wl2_test_window(TCase *tc);
10void ecore_wl2_test_input(TCase *tc);
10 11
11#endif 12#endif
diff --git a/src/tests/ecore_wl2/ecore_wl2_test_display.c b/src/tests/ecore_wl2/ecore_wl2_test_display.c
index f988d3adc3..b499d21df3 100644
--- a/src/tests/ecore_wl2/ecore_wl2_test_display.c
+++ b/src/tests/ecore_wl2/ecore_wl2_test_display.c
@@ -174,8 +174,7 @@ ecore_wl2_test_display(TCase *tc)
174 tcase_add_test(tc, wl2_display_get); 174 tcase_add_test(tc, wl2_display_get);
175 tcase_add_test(tc, wl2_display_name_get); 175 tcase_add_test(tc, wl2_display_name_get);
176 } 176 }
177 177 else if (getenv("WAYLAND_DISPLAY"))
178 if (getenv("WAYLAND_DISPLAY"))
179 { 178 {
180 /* tests here are for client-side functions */ 179 /* tests here are for client-side functions */
181 printf("Wayland Compositor detected. Testing client-side functions\n"); 180 printf("Wayland Compositor detected. Testing client-side functions\n");
diff --git a/src/tests/ecore_wl2/ecore_wl2_test_input.c b/src/tests/ecore_wl2/ecore_wl2_test_input.c
new file mode 100644
index 0000000000..074455a394
--- /dev/null
+++ b/src/tests/ecore_wl2/ecore_wl2_test_input.c
@@ -0,0 +1,53 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <stdio.h>
6#include <unistd.h>
7#include <Eina.h>
8#include <Ecore.h>
9#include <Ecore_Wl2.h>
10
11#include "ecore_wl2_suite.h"
12
13static Ecore_Wl2_Display *
14_display_connect(void)
15{
16 Ecore_Wl2_Display *disp;
17
18 disp = ecore_wl2_display_connect(NULL);
19 return disp;
20}
21
22EFL_START_TEST(wl2_input_seat_get)
23{
24 Ecore_Wl2_Display *disp;
25 Ecore_Wl2_Input *input;
26 Eina_Iterator *itr;
27
28 disp = _display_connect();
29 ck_assert(disp != NULL);
30
31 itr = ecore_wl2_display_inputs_get(disp);
32 ck_assert(itr != NULL);
33
34 EINA_ITERATOR_FOREACH(itr, input)
35 {
36 struct wl_seat *seat;
37
38 seat = ecore_wl2_input_seat_get(input);
39 ck_assert(seat != NULL);
40 }
41
42 eina_iterator_free(itr);
43}
44EFL_END_TEST
45
46void
47ecore_wl2_test_input(TCase *tc)
48{
49 if (getenv("WAYLAND_DISPLAY"))
50 {
51 tcase_add_test(tc, wl2_input_seat_get);
52 }
53}
diff --git a/src/tests/ecore_wl2/meson.build b/src/tests/ecore_wl2/meson.build
index 54fdeeec76..eb1a13db6a 100644
--- a/src/tests/ecore_wl2/meson.build
+++ b/src/tests/ecore_wl2/meson.build
@@ -4,7 +4,8 @@ ecore_wl2_suite_src = [
4 'ecore_wl2_tests_helpers.h', 4 'ecore_wl2_tests_helpers.h',
5 'ecore_wl2_test_ecore_wl2.c', 5 'ecore_wl2_test_ecore_wl2.c',
6 'ecore_wl2_test_display.c', 6 'ecore_wl2_test_display.c',
7 'ecore_wl2_test_window.c' 7 'ecore_wl2_test_window.c',
8 'ecore_wl2_test_input.c'
8] 9]
9 10
10ecore_wl2_suite = executable('ecore_wl2_suite', 11ecore_wl2_suite = executable('ecore_wl2_suite',