summaryrefslogtreecommitdiff
path: root/src/tests/ecore/ecore_test_promise.c
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-05-25 18:14:29 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-05-25 21:32:03 -0300
commitde9be13d458f2739a536e5863aa8caddd3f7f715 (patch)
tree7e28d9dba5336f02ad148af679e7208377fae9f0 /src/tests/ecore/ecore_test_promise.c
parent0eacdc03da738bebe03ac22fe377836751877345 (diff)
eina: Add promise parameter to then calllbacks
Added promise parameter to then callbacks so callbacks can steal ownership of the value from the promise.
Diffstat (limited to 'src/tests/ecore/ecore_test_promise.c')
-rw-r--r--src/tests/ecore/ecore_test_promise.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/tests/ecore/ecore_test_promise.c b/src/tests/ecore/ecore_test_promise.c
index 5a54281..bf2a160 100644
--- a/src/tests/ecore/ecore_test_promise.c
+++ b/src/tests/ecore/ecore_test_promise.c
@@ -11,7 +11,7 @@ void promised_thread(const void* data EINA_UNUSED, Eina_Promise_Owner* promise,
11 eina_promise_owner_value_set(promise, NULL, NULL); 11 eina_promise_owner_value_set(promise, NULL, NULL);
12} 12}
13 13
14void promise_callback(void* data EINA_UNUSED, void* value EINA_UNUSED) 14void promise_callback(void* data EINA_UNUSED, void* value EINA_UNUSED, Eina_Promise* promise EINA_UNUSED)
15{ 15{
16 ecore_main_loop_quit(); 16 ecore_main_loop_quit();
17} 17}
@@ -36,9 +36,9 @@ void promise_error_thread(const void* data EINA_UNUSED, Eina_Promise_Owner* prom
36 eina_promise_owner_error_set(promise, EINA_ERROR_OUT_OF_MEMORY); 36 eina_promise_owner_error_set(promise, EINA_ERROR_OUT_OF_MEMORY);
37} 37}
38 38
39void promise_error_callback(void* data EINA_UNUSED, Eina_Error const* error) 39void promise_error_callback(void* data EINA_UNUSED, Eina_Error error, Eina_Promise* promise EINA_UNUSED)
40{ 40{
41 ck_assert(*error == EINA_ERROR_OUT_OF_MEMORY); 41 ck_assert(error == EINA_ERROR_OUT_OF_MEMORY);
42 ecore_main_loop_quit(); 42 ecore_main_loop_quit();
43} 43}
44 44
@@ -74,7 +74,7 @@ START_TEST(ecore_test_promise_all)
74} 74}
75END_TEST 75END_TEST
76 76
77void promise_callback2(void* data, void* value EINA_UNUSED) 77void promise_callback2(void* data, void* value EINA_UNUSED, Eina_Promise* promise EINA_UNUSED)
78{ 78{
79 if(++(*(int*)data) == 2) 79 if(++(*(int*)data) == 2)
80 ecore_main_loop_quit(); 80 ecore_main_loop_quit();
@@ -201,7 +201,7 @@ void promised_block_thread(const void* data EINA_UNUSED, Eina_Promise_Owner* pro
201} 201}
202 202
203static void 203static void
204_ecore_test_promise_normal_lifetime_cb(void* data EINA_UNUSED, void* value EINA_UNUSED) 204_ecore_test_promise_normal_lifetime_cb(void* data EINA_UNUSED, void* value EINA_UNUSED, Eina_Promise* promise EINA_UNUSED)
205{ 205{
206 ecore_main_loop_quit(); 206 ecore_main_loop_quit();
207} 207}
@@ -254,7 +254,7 @@ START_TEST(ecore_test_promise_normal_lifetime_all)
254END_TEST 254END_TEST
255 255
256static void 256static void
257_ecore_test_promise_immediate_set_lifetime_cb(void* data EINA_UNUSED, void* value EINA_UNUSED) 257_ecore_test_promise_immediate_set_lifetime_cb(void* data EINA_UNUSED, void* value EINA_UNUSED, Eina_Promise* promise EINA_UNUSED)
258{ 258{
259 ecore_main_loop_quit(); 259 ecore_main_loop_quit();
260} 260}
@@ -327,7 +327,7 @@ static void _cancel_callback(const void* data, Eina_Promise_Owner* promise EINA_
327 eina_lock_release(&v->lock); 327 eina_lock_release(&v->lock);
328} 328}
329 329
330static void _cancel_promise_callback(void* data EINA_UNUSED, Eina_Error const* value) 330static void _cancel_promise_callback(void* data EINA_UNUSED, Eina_Error value, Eina_Promise* promise EINA_UNUSED)
331{ 331{
332 ck_assert(!!value); 332 ck_assert(!!value);
333 ecore_main_loop_quit(); 333 ecore_main_loop_quit();