summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Michael <cp.michael@samsung.com>2019-08-14 11:03:04 -0400
committerChristopher Michael <cp.michael@samsung.com>2019-08-14 11:03:04 -0400
commite533bef2bf56ca2d61f56b473e72f75240384bdd (patch)
treed5a06ba9a5ad0be1fc7760ae91abd4eb18116920
parent51a644d96650d08f8ffa8e633277d60e9536f08f (diff)
tests/ecore_wl2: Add start of ecore_wl2_surface tests
ref T8016
-rw-r--r--src/tests/ecore_wl2/ecore_wl2_test_surface.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/tests/ecore_wl2/ecore_wl2_test_surface.c b/src/tests/ecore_wl2/ecore_wl2_test_surface.c
new file mode 100644
index 0000000000..f4252e1664
--- /dev/null
+++ b/src/tests/ecore_wl2/ecore_wl2_test_surface.c
@@ -0,0 +1,56 @@
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
22static Ecore_Wl2_Window *
23_window_create(Ecore_Wl2_Display *disp)
24{
25 Ecore_Wl2_Window *win;
26
27 win = ecore_wl2_window_new(disp, NULL, 100, 100, 500, 500);
28 return win;
29}
30
31EFL_START_TEST(wl2_surface_create)
32{
33 Ecore_Wl2_Display *disp;
34 Ecore_Wl2_Window *win;
35 Ecore_Wl2_Surface *surf;
36
37 disp = _display_connect();
38 ck_assert(disp != NULL);
39
40 win = _window_create(disp);
41 ck_assert(win != NULL);
42
43 surf = ecore_wl2_surface_create(win, EINA_FALSE);
44 ck_assert(surf != NULL);
45}
46EFL_END_TEST
47
48void
49ecore_wl2_test_surface(TCase *tc)
50{
51 if (getenv("WAYLAND_DISPLAY"))
52 {
53 /* surface tests can only run if there is an existing compositor */
54 tcase_add_test(tc, wl2_surface_create);
55 }
56}