Fix bug reported by Vincent Torri and add a test to trigger it.

SVN revision: 36041
This commit is contained in:
Cedric BAIL 2008-09-17 08:33:35 +00:00
parent fb44db2211
commit eeb52f487a
2 changed files with 19 additions and 1 deletions

View File

@ -198,7 +198,7 @@ eina_counter_stop(Eina_Counter *counter, int specimen)
clk = (Eina_Clock *) counter->clocks;
if (clk->valid == EINA_TRUE) return ;
if (!clk || clk->valid == EINA_TRUE) return ;
clk->end = tp;
clk->specimen = specimen;

View File

@ -66,9 +66,27 @@ START_TEST(eina_counter_simple)
}
END_TEST
START_TEST(eina_counter_break)
{
Eina_Counter *cnt;
eina_counter_init();
cnt = eina_counter_add("eina_test");
fail_if(!cnt);
eina_counter_stop(cnt, 10);
eina_counter_delete(cnt);
eina_counter_shutdown();
}
END_TEST
void eina_test_counter(TCase *tc)
{
tcase_add_test(tc, eina_counter_init_shutdown);
tcase_add_test(tc, eina_counter_simple);
tcase_add_test(tc, eina_counter_break);
}