summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/eio/eio_main.c11
-rw-r--r--src/tests/eio/eio_test_manager.c21
2 files changed, 30 insertions, 2 deletions
diff --git a/src/lib/eio/eio_main.c b/src/lib/eio/eio_main.c
index f10f519672..de050f2a2f 100644
--- a/src/lib/eio/eio_main.c
+++ b/src/lib/eio/eio_main.c
@@ -56,6 +56,7 @@ static Eina_Spinlock memory_pool_lock;
56static Eina_Lock memory_pool_mutex; 56static Eina_Lock memory_pool_mutex;
57static Eina_Condition memory_pool_cond; 57static Eina_Condition memory_pool_cond;
58static Eina_Bool memory_pool_suspended = 1; 58static Eina_Bool memory_pool_suspended = 1;
59static Efl_Io_Manager *io_manager = NULL;
59 60
60static void * 61static void *
61_eio_pool_malloc(Eio_Alloc_Pool *pool) 62_eio_pool_malloc(Eio_Alloc_Pool *pool)
@@ -317,9 +318,12 @@ eio_init(void)
317 318
318 efreet_mime_init(); 319 efreet_mime_init();
319 320
321 io_manager = eo_add(EFL_IO_MANAGER_CLASS, ecore_main_loop_get());
322 efl_loop_register(ecore_main_loop_get(), EFL_IO_MANAGER_CLASS, io_manager);
323
320 eina_log_timing(_eio_log_dom_global, 324 eina_log_timing(_eio_log_dom_global,
321 EINA_LOG_STATE_STOP, 325 EINA_LOG_STATE_STOP,
322 EINA_LOG_STATE_INIT); 326 EINA_LOG_STATE_INIT);
323 327
324 return _eio_init_count; 328 return _eio_init_count;
325 329
@@ -353,6 +357,9 @@ eio_shutdown(void)
353 EINA_LOG_STATE_START, 357 EINA_LOG_STATE_START,
354 EINA_LOG_STATE_SHUTDOWN); 358 EINA_LOG_STATE_SHUTDOWN);
355 359
360 eo_del(io_manager);
361 io_manager = NULL;
362
356 EINA_LIST_FOREACH(tracked_thread, l, f) 363 EINA_LIST_FOREACH(tracked_thread, l, f)
357 ecore_thread_cancel(f->thread); 364 ecore_thread_cancel(f->thread);
358 365
diff --git a/src/tests/eio/eio_test_manager.c b/src/tests/eio/eio_test_manager.c
index 80ac58db3b..7bd0015dab 100644
--- a/src/tests/eio/eio_test_manager.c
+++ b/src/tests/eio/eio_test_manager.c
@@ -277,10 +277,31 @@ START_TEST(efl_io_manager_test_open)
277} 277}
278END_TEST 278END_TEST
279 279
280START_TEST(efl_io_instantiated)
281{
282 Efl_Io_Manager *manager;
283
284 ecore_init();
285
286 fail_if(eo_provider_find(ecore_main_loop_get(), EFL_IO_MANAGER_CLASS) != NULL);
287
288 eio_init();
289
290 manager = eo_provider_find(ecore_main_loop_get(), EFL_IO_MANAGER_CLASS);
291 fail_if(manager == NULL);
292 fail_if(!eo_isa(manager, EFL_IO_MANAGER_CLASS));
293
294 eio_shutdown();
295
296 ecore_shutdown();
297}
298END_TEST
299
280void 300void
281eio_test_job(TCase *tc) 301eio_test_job(TCase *tc)
282{ 302{
283 tcase_add_test(tc, efl_io_manager_test_ls_funcs); 303 tcase_add_test(tc, efl_io_manager_test_ls_funcs);
284 tcase_add_test(tc, efl_io_manager_test_file_direct_stat); 304 tcase_add_test(tc, efl_io_manager_test_file_direct_stat);
285 tcase_add_test(tc, efl_io_manager_test_open); 305 tcase_add_test(tc, efl_io_manager_test_open);
306 tcase_add_test(tc, efl_io_instantiated);
286} 307}