aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/ecore/efl_app_test_loop.c
blob: f80fd7e3d5026e8dfe4707c668c2c2751d520f15 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#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_app_suite.h"
#include "../efl_check.h"

EFL_START_TEST(efl_app_test_efl_loop_register)
{
   Efl_Object *t, *n;

   ecore_init();

   t = efl_provider_find(efl_app_get(), EFL_LOOP_CLASS);
   fail_if(!efl_isa(t, EFL_LOOP_CLASS));
   fail_if(!efl_isa(t, EFL_APP_CLASS));

   t = efl_provider_find(efl_app_get(), EFL_LOOP_TIMER_CLASS);
   fail_if(t != NULL);

   n = efl_add(EFL_LOOP_TIMER_CLASS, efl_app_get(),
               efl_loop_timer_interval_set(efl_added, 1.0));
   efl_loop_register(efl_app_get(), EFL_LOOP_TIMER_CLASS, n);

   t = efl_provider_find(efl_app_get(), EFL_LOOP_TIMER_CLASS);
   fail_if(!efl_isa(t, EFL_LOOP_TIMER_CLASS));
   fail_if(t != n);

   efl_loop_unregister(efl_app_get(), EFL_LOOP_TIMER_CLASS, n);

   t = efl_provider_find(efl_app_get(), EFL_LOOP_TIMER_CLASS);
   fail_if(t != NULL);

   ecore_shutdown();
}
EFL_END_TEST

void efl_app_test_efl_loop(TCase *tc)
{
   tcase_add_test(tc, efl_app_test_efl_loop_register);
}