summaryrefslogtreecommitdiff
path: root/src/tests
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/tests
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/tests')
-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
3 files changed, 39 insertions, 0 deletions
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}