summaryrefslogtreecommitdiff
path: root/src/tests/ecore/ecore_test_promise.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-10-19 13:40:49 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-10-19 13:40:49 -0700
commitb5f2b695b76726b73d1705b77d656abf22563e4a (patch)
tree85472ee136800807d39984b6dd19fa4a7b6860bb /src/tests/ecore/ecore_test_promise.c
parentfb1feee480270c3e0e556774fc4ee613c82c7dba (diff)
ecore: test recursive case on efl_future.
Diffstat (limited to 'src/tests/ecore/ecore_test_promise.c')
-rw-r--r--src/tests/ecore/ecore_test_promise.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/tests/ecore/ecore_test_promise.c b/src/tests/ecore/ecore_test_promise.c
index 81ce2c2..ffd2300 100644
--- a/src/tests/ecore/ecore_test_promise.c
+++ b/src/tests/ecore/ecore_test_promise.c
@@ -1125,6 +1125,33 @@ START_TEST(efl_test_future_link)
1125} 1125}
1126END_TEST 1126END_TEST
1127 1127
1128static Efl_Future *recursive_future = NULL;
1129
1130static void
1131_then_cleanup(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
1132{
1133 efl_future_cancel(recursive_future);
1134}
1135
1136START_TEST(efl_test_recursive_mess)
1137{
1138 Efl_Promise *p;
1139 Future_Ok done = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
1140
1141 ecore_init();
1142
1143 p = efl_add(EFL_PROMISE_CLASS, ecore_main_loop_get());
1144 efl_future_use(&recursive_future, efl_promise_future_get(p));
1145 efl_future_then(recursive_future, _then_cleanup, _cancel, NULL, &done);
1146
1147 efl_promise_value_set(p, &value[0], NULL);
1148
1149 efl_del(p);
1150
1151 ecore_shutdown();
1152}
1153END_TEST
1154
1128void ecore_test_ecore_promise(TCase *tc) 1155void ecore_test_ecore_promise(TCase *tc)
1129{ 1156{
1130 tcase_add_test(tc, ecore_test_promise); 1157 tcase_add_test(tc, ecore_test_promise);
@@ -1155,4 +1182,5 @@ void ecore_test_ecore_promise(TCase *tc)
1155 tcase_add_test(tc, efl_test_promise_all); 1182 tcase_add_test(tc, efl_test_promise_all);
1156 tcase_add_test(tc, efl_test_promise_race); 1183 tcase_add_test(tc, efl_test_promise_race);
1157 tcase_add_test(tc, efl_test_future_link); 1184 tcase_add_test(tc, efl_test_future_link);
1185 tcase_add_test(tc, efl_test_recursive_mess);
1158} 1186}