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
This commit is contained in:
Mike Blumenkrantz 2018-04-09 13:37:00 +02:00 committed by Stefan Schmidt
parent e02598cd4e
commit fab4c313f4
5 changed files with 76 additions and 56 deletions

View File

@ -330,6 +330,7 @@ tests_ecore_ecore_suite_DEPENDENCIES = \
tests_ecore_efl_app_suite_SOURCES = \
tests/ecore/efl_app_test_loop.c \
tests/ecore/efl_app_test_loop_timer.c \
tests/ecore/efl_app_suite.c \
tests/ecore/efl_app_suite.h

View File

@ -204,59 +204,6 @@ EFL_START_TEST(ecore_test_timer_inside_call)
}
EFL_END_TEST
static Eina_Bool
_test_time_cb(void *data)
{
Eina_Bool *run = data;
*run = EINA_TRUE;
return EINA_TRUE;
}
static void
_test_death_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
Eina_Bool *die = data;
*die = EINA_TRUE;
}
static void
_test_run_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
_test_time_cb(data);
}
EFL_START_TEST(ecore_test_timer_lifecycle)
{
Eina_Bool rl = EINA_FALSE, re = EINA_FALSE;
Eina_Bool dl = EINA_FALSE, de = EINA_FALSE;
Ecore_Timer *t;
Eo *et;
efl_object_init();
t = ecore_timer_add(1.0, _test_time_cb, &rl);
efl_event_callback_add((Eo*) t, EFL_EVENT_DEL, _test_death_cb, &dl);
et = efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(),
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK, _test_run_cb, &re),
efl_event_callback_add(efl_added, EFL_EVENT_DEL, _test_death_cb, &de),
efl_loop_timer_interval_set(efl_added, 1.0));
efl_ref(et);
fail_if(re == EINA_TRUE && rl == EINA_TRUE);
fail_if(dl == EINA_FALSE);
fail_if(de == EINA_TRUE);
efl_del(et);
fail_if(de == EINA_FALSE);
efl_object_shutdown();
}
EFL_END_TEST
EFL_START_TEST(ecore_test_timer_valid_callbackfunc)
{
@ -299,9 +246,6 @@ EFL_END_TEST
void ecore_test_timer(TCase *tc)
{
tcase_add_test(tc, ecore_test_timers);
/* XXX: this seems a silly test - that we del the loop object?
tcase_add_test(tc, ecore_test_timer_lifecycle);
*/
tcase_add_test(tc, ecore_test_timer_inside_call);
tcase_add_test(tc, ecore_test_timer_valid_callbackfunc);
tcase_add_test(tc, ecore_test_ecore_main_loop_timer);

View File

@ -48,6 +48,7 @@ void efl_test_efl_app(TCase *tc)
static const Efl_Test_Case etc[] = {
{ "App", efl_test_efl_app },
{ "Loop", efl_app_test_efl_loop },
{ "Loop_Timer", efl_app_test_efl_loop_timer },
{ NULL, NULL }
};

View File

@ -5,5 +5,6 @@
#include "../efl_check.h"
void efl_app_test_efl_app(TCase *tc);
void efl_app_test_efl_loop(TCase *tc);
void efl_app_test_efl_loop_timer(TCase *tc);
#endif /* _EFL_APP_SUITE_H */

View File

@ -0,0 +1,73 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <unistd.h>
#define EFL_NOLEGACY_API_SUPPORT
#include <Efl_Core.h>
#include <Efl_Net.h>
#include "efl_app_suite.h"
#include "../efl_check.h"
/*
static Eina_Bool
_test_time_cb(void *data)
{
Eina_Bool *run = data;
*run = EINA_TRUE;
return EINA_TRUE;
}
static void
_test_death_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
Eina_Bool *die = data;
*die = EINA_TRUE;
}
static void
_test_run_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
_test_time_cb(data);
}
EFL_START_TEST(ecore_test_timer_lifecycle)
{
Eina_Bool rl = EINA_FALSE, re = EINA_FALSE;
Eina_Bool dl = EINA_FALSE, de = EINA_FALSE;
Ecore_Timer *t;
Eo *et;
efl_object_init();
t = ecore_timer_add(1.0, _test_time_cb, &rl);
efl_event_callback_add((Eo*) t, EFL_EVENT_DEL, _test_death_cb, &dl);
et = efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(),
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK, _test_run_cb, &re),
efl_event_callback_add(efl_added, EFL_EVENT_DEL, _test_death_cb, &de),
efl_loop_timer_interval_set(efl_added, 1.0));
efl_ref(et);
fail_if(re == EINA_TRUE && rl == EINA_TRUE);
fail_if(dl == EINA_FALSE);
fail_if(de == EINA_TRUE);
efl_del(et);
fail_if(de == EINA_FALSE);
efl_object_shutdown();
}
EFL_END_TEST
*/
void efl_app_test_efl_loop_timer(TCase *tc EINA_UNUSED)
{
/* XXX: this seems a silly test - that we del the loop object?
tcase_add_test(tc, ecore_test_timer_lifecycle);
*/
}