summaryrefslogtreecommitdiff
path: root/src/tests/ecore/efl_app_test_loop.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/ecore/efl_app_test_loop.c')
-rw-r--r--src/tests/ecore/efl_app_test_loop.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/tests/ecore/efl_app_test_loop.c b/src/tests/ecore/efl_app_test_loop.c
new file mode 100644
index 0000000000..c924925169
--- /dev/null
+++ b/src/tests/ecore/efl_app_test_loop.c
@@ -0,0 +1,46 @@
+#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"
+
+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);
+}