tests: Add file for Ecore_Wl2 display tests
authorChristopher Michael <cp.michael@samsung.com>
Mon, 15 Jul 2019 13:49:31 +0000 (09:49 -0400)
committerTaehyub Kim <taehyub.kim@samsung.com>
Wed, 17 Jul 2019 07:54:05 +0000 (16:54 +0900)
Add file which can be used to add tests for ecore_wl2 display functions

ref T8016

src/tests/ecore_wl2/ecore_wl2_suite.c
src/tests/ecore_wl2/ecore_wl2_suite.h
src/tests/ecore_wl2/ecore_wl2_test_display.c [new file with mode: 0644]
src/tests/ecore_wl2/ecore_wl2_tests_helpers.h [new file with mode: 0644]
src/tests/ecore_wl2/meson.build

index 234a581..7f7d5fd 100644 (file)
@@ -10,6 +10,7 @@ static const Efl_Test_Case etc[] =
 {
 #if HAVE_ECORE_WL2
    { "Ecore_Wl2", ecore_wl2_test_init },
+   { "Display", ecore_wl2_test_display },
 #endif
    { NULL, NULL }
 };
index b17d8a7..2ff7074 100644 (file)
@@ -5,5 +5,6 @@
 # include "../efl_check.h"
 
 void ecore_wl2_test_init(TCase *tc);
+void ecore_wl2_test_display(TCase *tc);
 
 #endif
diff --git a/src/tests/ecore_wl2/ecore_wl2_test_display.c b/src/tests/ecore_wl2/ecore_wl2_test_display.c
new file mode 100644 (file)
index 0000000..e566ab8
--- /dev/null
@@ -0,0 +1,39 @@
+#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"
+#include "ecore_wl2_tests_helpers.h"
+
+EFL_START_TEST(wl2_display_create)
+{
+   Ecore_Wl2_Display *disp;
+
+   disp = ECORE_WL2_TEST_DISPLAY_SETUP();
+   ck_assert(disp != NULL);
+}
+EFL_END_TEST
+
+EFL_START_TEST(wl2_display_destroy)
+{
+   Ecore_Wl2_Display *disp;
+
+   disp = ECORE_WL2_TEST_DISPLAY_SETUP();
+   ck_assert(disp != NULL);
+
+   ecore_wl2_display_destroy(disp);
+}
+EFL_END_TEST
+
+void
+ecore_wl2_test_display(TCase *tc)
+{
+   tcase_add_test(tc, wl2_display_create);
+   tcase_add_test(tc, wl2_display_destroy);
+}
diff --git a/src/tests/ecore_wl2/ecore_wl2_tests_helpers.h b/src/tests/ecore_wl2/ecore_wl2_tests_helpers.h
new file mode 100644 (file)
index 0000000..24175a5
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef ECORE_WL2_TEST_HELPERS_H
+# define ECORE_WL2_TEST_HELPERS_H
+
+# include <Ecore_Wl2.h>
+
+# define ECORE_WL2_TEST_DISPLAY_SETUP() _setup_display()
+
+static Ecore_Wl2_Display *
+_setup_display(void)
+{
+   Ecore_Wl2_Display *disp;
+
+   disp = ecore_wl2_display_create(NULL);
+   return disp;
+}
+
+#endif
index 11500c7..97bce4e 100644 (file)
@@ -1,7 +1,9 @@
 ecore_wl2_suite_src = [
   'ecore_wl2_suite.c',
   'ecore_wl2_suite.h',
-  'ecore_wl2_test_ecore_wl2.c'
+  'ecore_wl2_tests_helpers.h',
+  'ecore_wl2_test_ecore_wl2.c',
+  'ecore_wl2_test_display.c'
 ]
 
 ecore_wl2_suite = executable('ecore_wl2_suite',