summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSrivardhan Hebbar <sri.hebbar@samsung.com>2014-10-21 08:34:28 -0400
committerChris Michael <cp.michael@samsung.com>2014-10-21 08:34:46 -0400
commit46d3d38e3cc59ee7ed731a26040306a9fb95472b (patch)
tree4816176b3154f0c00f4f277b64fcc328c7fb0302 /src
parent8549ee799ad9175ff011ae680def3f6787140206 (diff)
downloadefl-46d3d38e3cc59ee7ed731a26040306a9fb95472b.tar.gz
ecore_wayland: Added test case to check ecore_wl_init by passing socket name.
Summary: Added a test case for ecore_wayland to test ecore_wl_init by passing the socket name. Wayland display is created and a socket is added to the display, then this socket is passed to ecore_wl_init to connect. It should successfully connect. Then ecore_wl_shutdown is called to verify if it closes. Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com> Reviewers: devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1560
Diffstat (limited to 'src')
-rw-r--r--src/Makefile_Ecore.am6
-rw-r--r--src/tests/ecore/ecore_test_ecore_wayland.c35
2 files changed, 39 insertions, 2 deletions
diff --git a/src/Makefile_Ecore.am b/src/Makefile_Ecore.am
index 3bb894a943..43acee3599 100644
--- a/src/Makefile_Ecore.am
+++ b/src/Makefile_Ecore.am
@@ -190,7 +190,8 @@ tests_ecore_ecore_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
@ECORE_X_CFLAGS@ \
@ECORE_IMF_CFLAGS@ \
@ECORE_EVAS_CFLAGS@ \
-@ECORE_WAYLAND_CFLAGS@
+@ECORE_WAYLAND_CFLAGS@ \
+@ECORE_WAYLAND_SRV_CFLAGS@
tests_ecore_ecore_suite_LDADD = \
@CHECK_LIBS@ \
@@ -201,7 +202,8 @@ tests_ecore_ecore_suite_LDADD = \
@USE_ECORE_X_LIBS@ \
@USE_ECORE_IMF_LIBS@ \
@USE_ECORE_EVAS_LIBS@ \
-@USE_ECORE_WAYLAND_LIBS@
+@USE_ECORE_WAYLAND_LIBS@ \
+@ECORE_WAYLAND_SRV_LIBS@
tests_ecore_ecore_suite_DEPENDENCIES = \
@USE_ECORE_INTERNAL_LIBS@ \
@USE_ECORE_AUDIO_INTERNAL_LIBS@ \
diff --git a/src/tests/ecore/ecore_test_ecore_wayland.c b/src/tests/ecore/ecore_test_ecore_wayland.c
index 54aca3ffd7..bd441ca72b 100644
--- a/src/tests/ecore/ecore_test_ecore_wayland.c
+++ b/src/tests/ecore/ecore_test_ecore_wayland.c
@@ -8,9 +8,43 @@
#include <Ecore_Wayland.h>
#include "ecore_suite.h"
+#include "wayland-server.h"
#define MAX_ITER 15
+static char test_socket[] = "test1";
+
+START_TEST(ecore_test_ecore_wl_init_name)
+{
+ struct wl_display *test_display = NULL;
+ int ret = 0, i, j;
+
+ test_display = wl_display_create();
+ fprintf(stderr, "Creating display\n");
+ fail_if(test_display == NULL);
+
+ ret = wl_display_add_socket(test_display, test_socket);
+ fprintf(stderr, "Connecting socket to display\n");
+ fail_if(ret != 0);
+
+ for (i = 1; i <= MAX_ITER; i++)
+ {
+ ret = ecore_wl_init(test_socket);
+ fprintf(stderr, "Created %d ecore wayland instance.\n", i);
+ fail_if(ret != i);
+ }
+
+ for (j = MAX_ITER - 1; j >= 0; j--)
+ {
+ ret = ecore_wl_shutdown();
+ fprintf(stderr, "Deleted %d ecore wayland instance.\n", MAX_ITER - j);
+ fail_if(ret != j);
+ }
+
+ wl_display_destroy(test_display);
+}
+END_TEST
+
START_TEST(ecore_test_ecore_wl_init)
{
int ret, i, j;
@@ -34,4 +68,5 @@ END_TEST
void ecore_test_ecore_wayland(TCase *tc)
{
tcase_add_test(tc, ecore_test_ecore_wl_init);
+ tcase_add_test(tc, ecore_test_ecore_wl_init_name);
}