summaryrefslogtreecommitdiff
path: root/src/tests/ecore/ecore_test_ecore.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-02-27 14:10:12 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-03-03 13:40:33 +0900
commit1c74aaa7e9c9fa1732b467aca5ee1458e3721f0a (patch)
treeaa8cfdf82e579b61cec0ca3d08d2d9cfc4eab651 /src/tests/ecore/ecore_test_ecore.c
parent6f092071ac54d10dde39889571518e4b9d17308f (diff)
Revert "cxx: Fix manual code after efl_app change."
This reverts commit 135154303bea691c6f7f9472a5dec32d9103c38d. Revert "efl: move signal events from efl.loop to efl.app" This reverts commit 3dbca39f98288580c62a43c179ac11621433ec88. Revert "efl: add test suite for efl_app" This reverts commit 3e94be5d73256a7f5c02d3a9474173226be7beff. Revert "efl: create Efl.App class, the parent of Efl.Loop" This reverts commit 28fe00b94e55575c15684959b89a614d5a579309. Go back to before efl.app because I think this should be done with superclassing here not a parent object. reasons? 1. multiple loops per single thread make no sense. so if multilpe loop objects they wont be contained in a single app object and then deleted like this. 2. the app object is not really sharable in this design so it cant be accessed from other threads 3. it makes it harder to get the main loop or app object (well 2 func calls one calling the other and more typing. it is longer to type and more work where it is not necessary, and again it can't work from other threads unless we go duplicating efl.app per thread and then what is the point of splittyign out the signal events from efl.loop then?) etc.
Diffstat (limited to 'src/tests/ecore/ecore_test_ecore.c')
-rw-r--r--src/tests/ecore/ecore_test_ecore.c67
1 files changed, 65 insertions, 2 deletions
diff --git a/src/tests/ecore/ecore_test_ecore.c b/src/tests/ecore/ecore_test_ecore.c
index f94e9055b5..492c2aa033 100644
--- a/src/tests/ecore/ecore_test_ecore.c
+++ b/src/tests/ecore/ecore_test_ecore.c
@@ -317,7 +317,7 @@ START_TEST(ecore_test_efl_loop_fd)
317 ret = pipe(comm); 317 ret = pipe(comm);
318 fail_if(ret != 0); 318 fail_if(ret != 0);
319 319
320 fd = efl_add(EFL_LOOP_FD_CLASS, efl_app_main_loop_get(efl_app_get()), 320 fd = efl_add(EFL_LOOP_FD_CLASS, efl_main_loop_get(),
321 efl_loop_fd_set(efl_added, comm[0]), 321 efl_loop_fd_set(efl_added, comm[0]),
322 efl_event_callback_add(efl_added, EFL_LOOP_FD_EVENT_READ, _eo_read_cb, &did)); 322 efl_event_callback_add(efl_added, EFL_LOOP_FD_EVENT_READ, _eo_read_cb, &did));
323 fail_if(fd == NULL); 323 fail_if(fd == NULL);
@@ -360,7 +360,7 @@ START_TEST(ecore_test_efl_loop_fd_lifecycle)
360 ret = pipe(comm); 360 ret = pipe(comm);
361 fail_if(ret != 0); 361 fail_if(ret != 0);
362 362
363 fd = efl_add(EFL_LOOP_FD_CLASS, efl_app_main_loop_get(efl_app_get()), 363 fd = efl_add(EFL_LOOP_FD_CLASS, efl_main_loop_get(),
364 efl_loop_fd_set(efl_added, comm[0]), 364 efl_loop_fd_set(efl_added, comm[0]),
365 efl_event_callback_add(efl_added, EFL_LOOP_FD_EVENT_READ, _eo_read_cb, &did), 365 efl_event_callback_add(efl_added, EFL_LOOP_FD_EVENT_READ, _eo_read_cb, &did),
366 efl_event_callback_add(efl_added, EFL_EVENT_DEL, _efl_del_cb, &dead)); 366 efl_event_callback_add(efl_added, EFL_EVENT_DEL, _efl_del_cb, &dead));
@@ -857,6 +857,67 @@ START_TEST(ecore_test_ecore_main_loop_poller_add_del)
857} 857}
858END_TEST 858END_TEST
859 859
860START_TEST(ecore_test_efl_loop_register)
861{
862 Efl_Object *t, *n;
863
864 ecore_init();
865
866 t = efl_provider_find(efl_main_loop_get(), EFL_LOOP_CLASS);
867 fail_if(!efl_isa(t, EFL_LOOP_CLASS));
868
869 t = efl_provider_find(efl_main_loop_get(), EFL_LOOP_TIMER_CLASS);
870 fail_if(t != NULL);
871
872 n = efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get());
873 fail_if(n != NULL);
874
875 n = efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(),
876 efl_loop_timer_interval_set(efl_added, 1.0));
877 efl_loop_register(efl_main_loop_get(), EFL_LOOP_TIMER_CLASS, n);
878
879 t = efl_provider_find(efl_main_loop_get(), EFL_LOOP_TIMER_CLASS);
880 fail_if(!efl_isa(t, EFL_LOOP_TIMER_CLASS));
881 fail_if(t != n);
882
883 efl_loop_unregister(efl_main_loop_get(), EFL_LOOP_TIMER_CLASS, n);
884
885 t = efl_provider_find(efl_main_loop_get(), EFL_LOOP_TIMER_CLASS);
886 fail_if(t != NULL);
887
888 ecore_shutdown();
889}
890END_TEST
891
892START_TEST(ecore_test_efl_app_version)
893{
894 const Efl_Version *ver;
895 Eo *loop;
896
897 ecore_init();
898
899 loop = efl_loop_main_get(EFL_LOOP_CLASS);
900 fail_if(!efl_isa(loop, EFL_LOOP_CLASS));
901
902 efl_build_version_set(EFL_VERSION_MAJOR, EFL_VERSION_MINOR, 0, 0, NULL, EFL_BUILD_ID);
903 ver = efl_loop_app_efl_version_get(loop);
904 fail_if(!ver);
905 fail_if(ver->major != EFL_VERSION_MAJOR);
906 fail_if(ver->minor != EFL_VERSION_MINOR);
907 fail_if(ver->micro != 0);
908 fail_if(ver->revision != 0);
909 fail_if(ver->flavor);
910 fail_if(!eina_streq(ver->build_id, EFL_BUILD_ID));
911
912 ver = efl_loop_efl_version_get(loop);
913 fail_if(!ver);
914 fail_if(ver->major != EFL_VERSION_MAJOR);
915 fail_if(ver->minor != EFL_VERSION_MINOR);
916
917 ecore_shutdown();
918}
919END_TEST
920
860void ecore_test_ecore(TCase *tc) 921void ecore_test_ecore(TCase *tc)
861{ 922{
862 tcase_add_test(tc, ecore_test_ecore_init); 923 tcase_add_test(tc, ecore_test_ecore_init);
@@ -879,4 +940,6 @@ void ecore_test_ecore(TCase *tc)
879 tcase_add_test(tc, ecore_test_ecore_main_loop_poller_add_del); 940 tcase_add_test(tc, ecore_test_ecore_main_loop_poller_add_del);
880 tcase_add_test(tc, ecore_test_efl_loop_fd); 941 tcase_add_test(tc, ecore_test_efl_loop_fd);
881 tcase_add_test(tc, ecore_test_efl_loop_fd_lifecycle); 942 tcase_add_test(tc, ecore_test_efl_loop_fd_lifecycle);
943 tcase_add_test(tc, ecore_test_efl_loop_register);
944 tcase_add_test(tc, ecore_test_efl_app_version);
882} 945}