summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSrivardhan Hebbar <sri.hebbar@samsung.com>2014-10-29 08:39:56 -0400
committerChris Michael <cp.michael@samsung.com>2014-10-29 08:39:56 -0400
commit2119e34d85bf9c01d7b689e0ef1c8a0d219c897d (patch)
tree219e382a146373a22019411b49dc3430d505b71f /src
parentbe5b00cfd1d011b688ae313ae24688227854fb23 (diff)
ecore_input: Added test suite for ecore_input.
Summary: Added test suite for ecore_input with one test case. Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com> Reviewers: devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1602
Diffstat (limited to 'src')
-rw-r--r--src/Makefile_Ecore.am9
-rw-r--r--src/tests/ecore/ecore_suite.c1
-rw-r--r--src/tests/ecore/ecore_suite.h1
-rw-r--r--src/tests/ecore/ecore_test_ecore_input.c37
4 files changed, 45 insertions, 3 deletions
diff --git a/src/Makefile_Ecore.am b/src/Makefile_Ecore.am
index 9eac67b5bb..b562d0b817 100644
--- a/src/Makefile_Ecore.am
+++ b/src/Makefile_Ecore.am
@@ -177,6 +177,7 @@ tests/ecore/ecore_test_timer.c \
177tests/ecore/ecore_test_ecore_evas.c \ 177tests/ecore/ecore_test_ecore_evas.c \
178tests/ecore/ecore_test_animator.c \ 178tests/ecore/ecore_test_animator.c \
179tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c \ 179tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c \
180tests/ecore/ecore_test_ecore_input.c \
180tests/ecore/ecore_suite.h 181tests/ecore/ecore_suite.h
181 182
182tests_ecore_ecore_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ 183tests_ecore_ecore_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
@@ -193,7 +194,8 @@ tests_ecore_ecore_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
193@ECORE_WAYLAND_CFLAGS@ \ 194@ECORE_WAYLAND_CFLAGS@ \
194@ECORE_WAYLAND_SRV_CFLAGS@ \ 195@ECORE_WAYLAND_SRV_CFLAGS@ \
195@ECORE_DRM_CFLAGS@ \ 196@ECORE_DRM_CFLAGS@ \
196@ECORE_FB_CFLAGS@ 197@ECORE_FB_CFLAGS@ \
198@ECORE_INPUT_CFLAGS@
197 199
198tests_ecore_ecore_suite_LDADD = \ 200tests_ecore_ecore_suite_LDADD = \
199@CHECK_LIBS@ \ 201@CHECK_LIBS@ \
@@ -207,8 +209,8 @@ tests_ecore_ecore_suite_LDADD = \
207@USE_ECORE_WAYLAND_LIBS@ \ 209@USE_ECORE_WAYLAND_LIBS@ \
208@USE_ECORE_FB_LIBS@ \ 210@USE_ECORE_FB_LIBS@ \
209@ECORE_WAYLAND_SRV_LIBS@ \ 211@ECORE_WAYLAND_SRV_LIBS@ \
210@ECORE_DRM_LIBS@ 212@ECORE_DRM_LIBS@ \
211 213@USE_ECORE_INPUT_LIBS@
212tests_ecore_ecore_suite_DEPENDENCIES = \ 214tests_ecore_ecore_suite_DEPENDENCIES = \
213@USE_ECORE_INTERNAL_LIBS@ \ 215@USE_ECORE_INTERNAL_LIBS@ \
214@USE_ECORE_AUDIO_INTERNAL_LIBS@ \ 216@USE_ECORE_AUDIO_INTERNAL_LIBS@ \
@@ -220,6 +222,7 @@ tests_ecore_ecore_suite_DEPENDENCIES = \
220@USE_ECORE_WAYLAND_INTERNAL_LIBS@ \ 222@USE_ECORE_WAYLAND_INTERNAL_LIBS@ \
221@USE_ECORE_DRM_INTERNAL_LIBS@ \ 223@USE_ECORE_DRM_INTERNAL_LIBS@ \
222@USE_ECORE_FB_INTERNAL_LIBS@ 224@USE_ECORE_FB_INTERNAL_LIBS@
225@USE_ECORE_INPUT_INTERNAL_LIBS@
223 226
224if HAVE_ECORE_AUDIO 227if HAVE_ECORE_AUDIO
225tests_ecore_ecore_suite_SOURCES += tests/ecore/ecore_test_ecore_audio.c 228tests_ecore_ecore_suite_SOURCES += tests/ecore/ecore_test_ecore_audio.c
diff --git a/src/tests/ecore/ecore_suite.c b/src/tests/ecore/ecore_suite.c
index 2079ebfef1..44a3e62f46 100644
--- a/src/tests/ecore/ecore_suite.c
+++ b/src/tests/ecore/ecore_suite.c
@@ -39,6 +39,7 @@ static const Ecore_Test_Case etc[] = {
39#if HAVE_ECORE_FB 39#if HAVE_ECORE_FB
40 { "Ecore_Fb", ecore_test_ecore_fb }, 40 { "Ecore_Fb", ecore_test_ecore_fb },
41#endif 41#endif
42 { "Ecore_Input", ecore_test_ecore_input },
42 { NULL, NULL } 43 { NULL, NULL }
43}; 44};
44 45
diff --git a/src/tests/ecore/ecore_suite.h b/src/tests/ecore/ecore_suite.h
index 8d8ebcb243..803f8f7150 100644
--- a/src/tests/ecore/ecore_suite.h
+++ b/src/tests/ecore/ecore_suite.h
@@ -16,5 +16,6 @@ void ecore_test_ecore_thread_eina_thread_queue(TCase *tc);
16void ecore_test_ecore_wayland(TCase *tc); 16void ecore_test_ecore_wayland(TCase *tc);
17void ecore_test_ecore_drm(TCase *tc); 17void ecore_test_ecore_drm(TCase *tc);
18void ecore_test_ecore_fb(TCase *tc); 18void ecore_test_ecore_fb(TCase *tc);
19void ecore_test_ecore_input(TCase *tc);
19 20
20#endif /* _ECORE_SUITE_H */ 21#endif /* _ECORE_SUITE_H */
diff --git a/src/tests/ecore/ecore_test_ecore_input.c b/src/tests/ecore/ecore_test_ecore_input.c
new file mode 100644
index 0000000000..ccb0c92405
--- /dev/null
+++ b/src/tests/ecore/ecore_test_ecore_input.c
@@ -0,0 +1,37 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <stdio.h>
6#include <unistd.h>
7
8#include <Ecore_Input.h>
9
10#include "ecore_suite.h"
11
12#define MAX_ITER 10
13
14START_TEST(ecore_test_ecore_input_init)
15{
16 int ret, i, j;
17
18 for (i = 1; i <= MAX_ITER; i++)
19 {
20 ret = ecore_event_init();
21 fprintf(stderr, "Created %d ecore input instance.\n", i);
22 fail_if(ret != i);
23 }
24
25 for (j = MAX_ITER - 1; j >= 0; j--)
26 {
27 ret = ecore_event_shutdown();
28 fprintf(stderr, "Deleted %d ecore input instance.\n", MAX_ITER - j);
29 fail_if(ret != j);
30 }
31}
32END_TEST
33
34void ecore_test_ecore_input(TCase *tc)
35{
36 tcase_add_test(tc, ecore_test_ecore_input_init);
37}