forked from enlightenment/efl
tests/ecore: remove tolerance threshold from ecore_timer_reset test case
unit tests should test one thing only: testing timer accuracy and the effectiveness of resetting a timer in the same test leads to timing issues, so remove the timing component from the test ref T6878 Differential Revision: https://phab.enlightenment.org/D6653
This commit is contained in:
parent
bc248fdcf2
commit
774ac32f69
|
@ -173,7 +173,6 @@ EFL_END_TEST
|
||||||
typedef struct _Test_Inside_Call
|
typedef struct _Test_Inside_Call
|
||||||
{
|
{
|
||||||
Ecore_Timer *t;
|
Ecore_Timer *t;
|
||||||
double start;
|
|
||||||
int it;
|
int it;
|
||||||
} Test_Inside_Call;
|
} Test_Inside_Call;
|
||||||
|
|
||||||
|
@ -182,9 +181,7 @@ _timeri_cb(void *data)
|
||||||
{
|
{
|
||||||
Test_Inside_Call *c = data;
|
Test_Inside_Call *c = data;
|
||||||
|
|
||||||
fail_if(fabs((ecore_time_get() - c->start) - 0.011) > 0.01);
|
|
||||||
ecore_timer_reset(c->t);
|
ecore_timer_reset(c->t);
|
||||||
c->start = ecore_time_get();
|
|
||||||
|
|
||||||
c->it--;
|
c->it--;
|
||||||
|
|
||||||
|
@ -194,14 +191,21 @@ _timeri_cb(void *data)
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Eina_Bool
|
||||||
|
timeout_timer_cb()
|
||||||
|
{
|
||||||
|
ck_abort();
|
||||||
|
return EINA_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
EFL_START_TEST(ecore_test_timer_inside_call)
|
EFL_START_TEST(ecore_test_timer_inside_call)
|
||||||
{
|
{
|
||||||
Test_Inside_Call *c;
|
Test_Inside_Call *c;
|
||||||
|
|
||||||
c = malloc(sizeof(Test_Inside_Call));
|
c = malloc(sizeof(Test_Inside_Call));
|
||||||
c->start = ecore_time_get();
|
|
||||||
c->it = 5;
|
c->it = 5;
|
||||||
c->t = ecore_timer_add(0.01, _timeri_cb, c);
|
c->t = ecore_timer_add(0.01, _timeri_cb, c);
|
||||||
|
ecore_timer_add(1.0, timeout_timer_cb, NULL);
|
||||||
|
|
||||||
fail_if(!c->t, "Error add timer\n");
|
fail_if(!c->t, "Error add timer\n");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue