#include "ecore_wl2_suite.h"
+static Ecore_Wl2_Display *disp;
+
static Ecore_Wl2_Display *
_display_connect(void)
{
- Ecore_Wl2_Display *disp;
-
disp = ecore_wl2_display_connect(NULL);
+ ck_assert(disp != NULL);
return disp;
}
EFL_START_TEST(wl2_window_new)
{
- Ecore_Wl2_Display *disp;
Ecore_Wl2_Window *win;
- disp = _display_connect();
- ck_assert(disp != NULL);
-
win = _window_create(disp);
ck_assert(win != NULL);
}
EFL_START_TEST(wl2_window_surface_test)
{
- Ecore_Wl2_Display *disp;
Ecore_Wl2_Window *win;
struct wl_surface *surf;
int id = -1;
- disp = _display_connect();
- ck_assert(disp != NULL);
-
win = _window_create(disp);
ck_assert(win != NULL);
EFL_START_TEST(wl2_window_rotation_get)
{
- Ecore_Wl2_Display *disp;
Ecore_Wl2_Window *win;
int rot = -1;
- disp = _display_connect();
- ck_assert(disp != NULL);
-
win = _window_create(disp);
ck_assert(win != NULL);
EFL_START_TEST(wl2_window_output_find)
{
- Ecore_Wl2_Display *disp;
Ecore_Wl2_Window *win;
Ecore_Wl2_Output *out;
- disp = _display_connect();
- ck_assert(disp != NULL);
-
win = _window_create(disp);
ck_assert(win != NULL);
EFL_START_TEST(wl2_window_aux_hints_supported_get)
{
- Ecore_Wl2_Display *disp;
Ecore_Wl2_Window *win;
Eina_List *l;
- disp = _display_connect();
- ck_assert(disp != NULL);
-
win = _window_create(disp);
ck_assert(win != NULL);
EFL_START_TEST(wl2_window_display_get)
{
- Ecore_Wl2_Display *disp;
Ecore_Wl2_Window *win;
- disp = _display_connect();
- ck_assert(disp != NULL);
-
win = _window_create(disp);
ck_assert(win != NULL);
{
if (getenv("WAYLAND_DISPLAY"))
{
+ disp = _display_connect();
+
/* window tests can only run if there is an existing compositor */
tcase_add_test(tc, wl2_window_new);
tcase_add_test(tc, wl2_window_surface_test);
tcase_add_test(tc, wl2_window_output_find);
tcase_add_test(tc, wl2_window_aux_hints_supported_get);
tcase_add_test(tc, wl2_window_display_get);
+
+ ecore_wl2_display_disconnect(disp);
}
}