summaryrefslogtreecommitdiff
path: root/src/tests/ecore/ecore_test_promise.c
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-06-03 18:15:57 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-06-03 18:15:57 -0300
commite79eb53e8d20bdb4838fbb42c9e5b1ee47b7f263 (patch)
tree3b38de336ae0346543b4e5100d83da88720906f1 /src/tests/ecore/ecore_test_promise.c
parent09446ccb90c1f3180e5b2e0a52b3ce2c78c7c140 (diff)
eina: Remove Eina_Promise* parameter in promise callback
Remove not very useful parameter to eina_promise_then callbacks.
Diffstat (limited to 'src/tests/ecore/ecore_test_promise.c')
-rw-r--r--src/tests/ecore/ecore_test_promise.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/tests/ecore/ecore_test_promise.c b/src/tests/ecore/ecore_test_promise.c
index f016580..791e6fc 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, Eina_Promise* promise EINA_UNUSED) 14void promise_callback(void* data EINA_UNUSED, void* value EINA_UNUSED)
15{ 15{
16 ecore_main_loop_quit(); 16 ecore_main_loop_quit();
17} 17}
@@ -36,7 +36,7 @@ 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 error, Eina_Promise* promise EINA_UNUSED) 39void promise_error_callback(void* data EINA_UNUSED, Eina_Error error)
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();
@@ -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, Eina_Promise* promise EINA_UNUSED) 77void promise_callback2(void* data, void* value EINA_UNUSED)
78{ 78{
79 if(++(*(int*)data) == 2) 79 if(++(*(int*)data) == 2)
80 ecore_main_loop_quit(); 80 ecore_main_loop_quit();
@@ -186,22 +186,8 @@ START_TEST(ecore_test_promise_then_after_thread_finished_all)
186} 186}
187END_TEST 187END_TEST
188 188
189/* void promised_block_thread(const void* data EINA_UNUSED, Eina_Promise_Owner* promise, Ecore_Thread* thread EINA_UNUSED) */
190/* { */
191/* struct timespec v = {.tv_sec = 1, .tv_nsec = 0}, rem; */
192/* if(nanosleep(&v, &rem) == -1 && errno == EINTR) */
193/* do */
194/* { */
195/* v = rem; */
196/* } */
197/* while(nanosleep(&v, &rem) == -1 && errno == EINTR); */
198
199/* int r = 10; */
200/* eina_promise_owner_value_set(promise, &r, NULL); */
201/* } */
202
203static void 189static void
204_ecore_test_promise_normal_lifetime_cb(void* data EINA_UNUSED, void* value EINA_UNUSED, Eina_Promise* promise EINA_UNUSED) 190_ecore_test_promise_normal_lifetime_cb(void* data EINA_UNUSED, void* value EINA_UNUSED)
205{ 191{
206 ecore_main_loop_quit(); 192 ecore_main_loop_quit();
207} 193}
@@ -254,7 +240,7 @@ START_TEST(ecore_test_promise_normal_lifetime_all)
254END_TEST 240END_TEST
255 241
256static void 242static void
257_ecore_test_promise_immediate_set_lifetime_cb(void* data EINA_UNUSED, void* value EINA_UNUSED, Eina_Promise* promise EINA_UNUSED) 243_ecore_test_promise_immediate_set_lifetime_cb(void* data EINA_UNUSED, void* value EINA_UNUSED)
258{ 244{
259 ecore_main_loop_quit(); 245 ecore_main_loop_quit();
260} 246}
@@ -327,7 +313,7 @@ static void _cancel_callback(const void* data, Eina_Promise_Owner* promise EINA_
327 eina_lock_release(&v->lock); 313 eina_lock_release(&v->lock);
328} 314}
329 315
330static void _cancel_promise_callback(void* data EINA_UNUSED, Eina_Error value, Eina_Promise* promise EINA_UNUSED) 316static void _cancel_promise_callback(void* data EINA_UNUSED, Eina_Error value)
331{ 317{
332 ck_assert(value == EINA_ERROR_PROMISE_CANCEL); 318 ck_assert(value == EINA_ERROR_PROMISE_CANCEL);
333 ecore_main_loop_quit(); 319 ecore_main_loop_quit();