ecore_wayland: Created test suit for ecore_wayland.
authorSrivardhan Hebbar <sri.hebbar@samsung.com>
Mon, 29 Sep 2014 13:20:04 +0000 (09:20 -0400)
committerChris Michael <cp.michael@samsung.com>
Mon, 29 Sep 2014 13:20:05 +0000 (09:20 -0400)
Summary:
Created test suit for ecore_wayland and added test case for ecore_wl_init and ecore_wl_shutdown.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1498

src/Makefile_Ecore.am
src/tests/ecore/ecore_suite.c
src/tests/ecore/ecore_suite.h
src/tests/ecore/ecore_test_ecore_wayland.c [new file with mode: 0644]

index 09a292a..fe62dfd 100644 (file)
@@ -215,7 +215,8 @@ tests_ecore_ecore_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
 @ECORE_FILE_CFLAGS@ \
 @ECORE_X_CFLAGS@ \
 @ECORE_IMF_CFLAGS@ \
-@ECORE_EVAS_CFLAGS@
+@ECORE_EVAS_CFLAGS@ \
+@ECORE_WAYLAND_CFLAGS@
 
 tests_ecore_ecore_suite_LDADD = \
 @CHECK_LIBS@ \
@@ -225,7 +226,8 @@ tests_ecore_ecore_suite_LDADD = \
 @USE_ECORE_FILE_LIBS@ \
 @USE_ECORE_X_LIBS@ \
 @USE_ECORE_IMF_LIBS@ \
-@USE_ECORE_EVAS_LIBS@
+@USE_ECORE_EVAS_LIBS@ \
+@USE_ECORE_WAYLAND_LIBS@
 tests_ecore_ecore_suite_DEPENDENCIES = \
 @USE_ECORE_INTERNAL_LIBS@ \
 @USE_ECORE_AUDIO_INTERNAL_LIBS@ \
@@ -233,12 +235,17 @@ tests_ecore_ecore_suite_DEPENDENCIES = \
 @USE_ECORE_FILE_INTERNAL_LIBS@ \
 @USE_ECORE_X_INTERNAL_LIBS@ \
 @USE_ECORE_IMF_INTERNAL_LIBS@ \
-@USE_ECORE_EVAS_INTERNAL_LIBS@
+@USE_ECORE_EVAS_INTERNAL_LIBS@ \
+@USE_ECORE_WAYLAND_INTERNAL_LIBS@
 
 if HAVE_ECORE_AUDIO
 tests_ecore_ecore_suite_SOURCES += tests/ecore/ecore_test_ecore_audio.c
 endif
 
+if HAVE_ECORE_WAYLAND
+tests_ecore_ecore_suite_SOURCES += tests/ecore/ecore_test_ecore_wayland.c
+endif
+
 endif
 
 EXTRA_DIST += \
index 5cee498..63d6596 100644 (file)
@@ -30,6 +30,9 @@ static const Ecore_Test_Case etc[] = {
   { "Ecore_Evas", ecore_test_ecore_evas },
   { "Ecore_Animators", ecore_test_animator },
   { "Ecore_Test_Ccore_Thread_Eina_Thread_Queue", ecore_test_ecore_thread_eina_thread_queue },
+#if HAVE_ECORE_WAYLAND
+  { "Ecore_Wayland", ecore_test_ecore_wayland },
+#endif
   { NULL, NULL }
 };
 
index 307ad0e..1487fb4 100644 (file)
@@ -13,5 +13,6 @@ void ecore_test_timer(TCase *tc);
 void ecore_test_ecore_evas(TCase *tc);
 void ecore_test_animator(TCase *tc);
 void ecore_test_ecore_thread_eina_thread_queue(TCase *tc);
+void ecore_test_ecore_wayland(TCase *tc);
 
 #endif /* _ECORE_SUITE_H */
diff --git a/src/tests/ecore/ecore_test_ecore_wayland.c b/src/tests/ecore/ecore_test_ecore_wayland.c
new file mode 100644 (file)
index 0000000..54aca3f
--- /dev/null
@@ -0,0 +1,37 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <unistd.h>
+
+#include <Ecore_Wayland.h>
+
+#include "ecore_suite.h"
+
+#define MAX_ITER 15
+
+START_TEST(ecore_test_ecore_wl_init)
+{
+   int ret, i, j;
+
+   for (i = 1; i <= MAX_ITER; i++)
+     {
+        ret = ecore_wl_init(NULL);
+        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);
+     }
+}
+END_TEST
+
+void ecore_test_ecore_wayland(TCase *tc)
+{
+   tcase_add_test(tc, ecore_test_ecore_wl_init);
+}