diff options
author | Christopher Michael <cp.michael@samsung.com> | 2019-08-14 11:03:04 -0400 |
---|---|---|
committer | Christopher Michael <cp.michael@samsung.com> | 2019-08-14 11:03:04 -0400 |
commit | e533bef2bf56ca2d61f56b473e72f75240384bdd (patch) | |
tree | d5a06ba9a5ad0be1fc7760ae91abd4eb18116920 | |
parent | 51a644d96650d08f8ffa8e633277d60e9536f08f (diff) | |
download | efl-e533bef2bf56ca2d61f56b473e72f75240384bdd.tar.gz |
tests/ecore_wl2: Add start of ecore_wl2_surface tests
ref T8016
-rw-r--r-- | src/tests/ecore_wl2/ecore_wl2_test_surface.c | 56 |
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 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <stdio.h> +#include <unistd.h> +#include <Eina.h> +#include <Ecore.h> +#include <Ecore_Wl2.h> + +#include "ecore_wl2_suite.h" + +static Ecore_Wl2_Display * +_display_connect(void) +{ + Ecore_Wl2_Display *disp; + + disp = ecore_wl2_display_connect(NULL); + return disp; +} + +static Ecore_Wl2_Window * +_window_create(Ecore_Wl2_Display *disp) +{ + Ecore_Wl2_Window *win; + + win = ecore_wl2_window_new(disp, NULL, 100, 100, 500, 500); + return win; +} + +EFL_START_TEST(wl2_surface_create) +{ + Ecore_Wl2_Display *disp; + Ecore_Wl2_Window *win; + Ecore_Wl2_Surface *surf; + + disp = _display_connect(); + ck_assert(disp != NULL); + + win = _window_create(disp); + ck_assert(win != NULL); + + surf = ecore_wl2_surface_create(win, EINA_FALSE); + ck_assert(surf != NULL); +} +EFL_END_TEST + +void +ecore_wl2_test_surface(TCase *tc) +{ + if (getenv("WAYLAND_DISPLAY")) + { + /* surface tests can only run if there is an existing compositor */ + tcase_add_test(tc, wl2_surface_create); + } +} |