summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-04-09 13:37:00 +0200
committerStefan Schmidt <stefan@osg.samsung.com>2018-04-10 11:28:01 +0200
commitfab4c313f45e6f4cc77d584df1842c633300f059 (patch)
treef739105334277e0ccec238a09173e1b093bec882
parente02598cd4e0d040af7d35cd71a98a8710141324c (diff)
tests: move disabled efl loop timer test into efl_app_suite
Summary: ref T6815 Depends on D5895 Reviewers: stefan_schmidt Subscribers: cedric Maniphest Tasks: T6815 Differential Revision: https://phab.enlightenment.org/D5896
-rw-r--r--src/Makefile_Ecore.am1
-rw-r--r--src/tests/ecore/ecore_test_timer.c56
-rw-r--r--src/tests/ecore/efl_app_suite.c1
-rw-r--r--src/tests/ecore/efl_app_suite.h1
-rw-r--r--src/tests/ecore/efl_app_test_loop_timer.c73
5 files changed, 76 insertions, 56 deletions
diff --git a/src/Makefile_Ecore.am b/src/Makefile_Ecore.am
index 3430ce196a..1915225c59 100644
--- a/src/Makefile_Ecore.am
+++ b/src/Makefile_Ecore.am
@@ -330,6 +330,7 @@ tests_ecore_ecore_suite_DEPENDENCIES = \
330 330
331tests_ecore_efl_app_suite_SOURCES = \ 331tests_ecore_efl_app_suite_SOURCES = \
332tests/ecore/efl_app_test_loop.c \ 332tests/ecore/efl_app_test_loop.c \
333tests/ecore/efl_app_test_loop_timer.c \
333tests/ecore/efl_app_suite.c \ 334tests/ecore/efl_app_suite.c \
334tests/ecore/efl_app_suite.h 335tests/ecore/efl_app_suite.h
335 336
diff --git a/src/tests/ecore/ecore_test_timer.c b/src/tests/ecore/ecore_test_timer.c
index 93406ad103..e1ffc8f4a8 100644
--- a/src/tests/ecore/ecore_test_timer.c
+++ b/src/tests/ecore/ecore_test_timer.c
@@ -204,59 +204,6 @@ EFL_START_TEST(ecore_test_timer_inside_call)
204} 204}
205EFL_END_TEST 205EFL_END_TEST
206 206
207static Eina_Bool
208_test_time_cb(void *data)
209{
210 Eina_Bool *run = data;
211
212 *run = EINA_TRUE;
213
214 return EINA_TRUE;
215}
216
217static void
218_test_death_cb(void *data, const Efl_Event *ev EINA_UNUSED)
219{
220 Eina_Bool *die = data;
221
222 *die = EINA_TRUE;
223}
224
225static void
226_test_run_cb(void *data, const Efl_Event *ev EINA_UNUSED)
227{
228 _test_time_cb(data);
229}
230
231EFL_START_TEST(ecore_test_timer_lifecycle)
232{
233 Eina_Bool rl = EINA_FALSE, re = EINA_FALSE;
234 Eina_Bool dl = EINA_FALSE, de = EINA_FALSE;
235 Ecore_Timer *t;
236 Eo *et;
237
238 efl_object_init();
239
240 t = ecore_timer_add(1.0, _test_time_cb, &rl);
241 efl_event_callback_add((Eo*) t, EFL_EVENT_DEL, _test_death_cb, &dl);
242
243 et = efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(),
244 efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK, _test_run_cb, &re),
245 efl_event_callback_add(efl_added, EFL_EVENT_DEL, _test_death_cb, &de),
246 efl_loop_timer_interval_set(efl_added, 1.0));
247 efl_ref(et);
248
249 fail_if(re == EINA_TRUE && rl == EINA_TRUE);
250 fail_if(dl == EINA_FALSE);
251 fail_if(de == EINA_TRUE);
252
253 efl_del(et);
254 fail_if(de == EINA_FALSE);
255
256 efl_object_shutdown();
257}
258EFL_END_TEST
259
260 207
261EFL_START_TEST(ecore_test_timer_valid_callbackfunc) 208EFL_START_TEST(ecore_test_timer_valid_callbackfunc)
262{ 209{
@@ -299,9 +246,6 @@ EFL_END_TEST
299void ecore_test_timer(TCase *tc) 246void ecore_test_timer(TCase *tc)
300{ 247{
301 tcase_add_test(tc, ecore_test_timers); 248 tcase_add_test(tc, ecore_test_timers);
302/* XXX: this seems a silly test - that we del the loop object?
303 tcase_add_test(tc, ecore_test_timer_lifecycle);
304 */
305 tcase_add_test(tc, ecore_test_timer_inside_call); 249 tcase_add_test(tc, ecore_test_timer_inside_call);
306 tcase_add_test(tc, ecore_test_timer_valid_callbackfunc); 250 tcase_add_test(tc, ecore_test_timer_valid_callbackfunc);
307 tcase_add_test(tc, ecore_test_ecore_main_loop_timer); 251 tcase_add_test(tc, ecore_test_ecore_main_loop_timer);
diff --git a/src/tests/ecore/efl_app_suite.c b/src/tests/ecore/efl_app_suite.c
index 1618120f46..25854ff528 100644
--- a/src/tests/ecore/efl_app_suite.c
+++ b/src/tests/ecore/efl_app_suite.c
@@ -48,6 +48,7 @@ void efl_test_efl_app(TCase *tc)
48static const Efl_Test_Case etc[] = { 48static const Efl_Test_Case etc[] = {
49 { "App", efl_test_efl_app }, 49 { "App", efl_test_efl_app },
50 { "Loop", efl_app_test_efl_loop }, 50 { "Loop", efl_app_test_efl_loop },
51 { "Loop_Timer", efl_app_test_efl_loop_timer },
51 { NULL, NULL } 52 { NULL, NULL }
52}; 53};
53 54
diff --git a/src/tests/ecore/efl_app_suite.h b/src/tests/ecore/efl_app_suite.h
index ae273c0a76..391231dd32 100644
--- a/src/tests/ecore/efl_app_suite.h
+++ b/src/tests/ecore/efl_app_suite.h
@@ -5,5 +5,6 @@
5#include "../efl_check.h" 5#include "../efl_check.h"
6void efl_app_test_efl_app(TCase *tc); 6void efl_app_test_efl_app(TCase *tc);
7void efl_app_test_efl_loop(TCase *tc); 7void efl_app_test_efl_loop(TCase *tc);
8void efl_app_test_efl_loop_timer(TCase *tc);
8 9
9#endif /* _EFL_APP_SUITE_H */ 10#endif /* _EFL_APP_SUITE_H */
diff --git a/src/tests/ecore/efl_app_test_loop_timer.c b/src/tests/ecore/efl_app_test_loop_timer.c
new file mode 100644
index 0000000000..be1c6876c3
--- /dev/null
+++ b/src/tests/ecore/efl_app_test_loop_timer.c
@@ -0,0 +1,73 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <stdio.h>
6#include <unistd.h>
7#define EFL_NOLEGACY_API_SUPPORT
8#include <Efl_Core.h>
9#include <Efl_Net.h>
10#include "efl_app_suite.h"
11#include "../efl_check.h"
12
13/*
14static Eina_Bool
15_test_time_cb(void *data)
16{
17 Eina_Bool *run = data;
18
19 *run = EINA_TRUE;
20
21 return EINA_TRUE;
22}
23
24static void
25_test_death_cb(void *data, const Efl_Event *ev EINA_UNUSED)
26{
27 Eina_Bool *die = data;
28
29 *die = EINA_TRUE;
30}
31
32static void
33_test_run_cb(void *data, const Efl_Event *ev EINA_UNUSED)
34{
35 _test_time_cb(data);
36}
37
38EFL_START_TEST(ecore_test_timer_lifecycle)
39{
40 Eina_Bool rl = EINA_FALSE, re = EINA_FALSE;
41 Eina_Bool dl = EINA_FALSE, de = EINA_FALSE;
42 Ecore_Timer *t;
43 Eo *et;
44
45 efl_object_init();
46
47 t = ecore_timer_add(1.0, _test_time_cb, &rl);
48 efl_event_callback_add((Eo*) t, EFL_EVENT_DEL, _test_death_cb, &dl);
49
50 et = efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(),
51 efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK, _test_run_cb, &re),
52 efl_event_callback_add(efl_added, EFL_EVENT_DEL, _test_death_cb, &de),
53 efl_loop_timer_interval_set(efl_added, 1.0));
54 efl_ref(et);
55
56 fail_if(re == EINA_TRUE && rl == EINA_TRUE);
57 fail_if(dl == EINA_FALSE);
58 fail_if(de == EINA_TRUE);
59
60 efl_del(et);
61 fail_if(de == EINA_FALSE);
62
63 efl_object_shutdown();
64}
65EFL_END_TEST
66*/
67
68void efl_app_test_efl_loop_timer(TCase *tc EINA_UNUSED)
69{
70 /* XXX: this seems a silly test - that we del the loop object?
71 tcase_add_test(tc, ecore_test_timer_lifecycle);
72 */
73}