eina: Make cancelled promises use EINA_ERROR_PROMISE_CANCELLED error code
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>
Thu, 26 May 2016 16:34:04 +0000 (13:34 -0300)
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>
Thu, 26 May 2016 16:35:07 +0000 (13:35 -0300)
src/lib/eina/eina_promise.c
src/tests/ecore/ecore_test_promise.c

index d7b538e..2b3f154 100644 (file)
@@ -396,6 +396,7 @@ _eina_promise_cancel(_Eina_Promise_Default* promise)
         owner->promise.is_cancelled = EINA_TRUE;
         owner->promise.has_finished = EINA_TRUE;
         owner->promise.has_errored = EINA_TRUE;
+        owner->promise.error = EINA_ERROR_PROMISE_CANCEL;
         _eina_promise_cancel_calls(owner, EINA_TRUE);
      }
 }
index bf2a160..decd5c9 100644 (file)
@@ -329,7 +329,7 @@ static void _cancel_callback(const void* data, Eina_Promise_Owner* promise EINA_
 
 static void _cancel_promise_callback(void* data EINA_UNUSED, Eina_Error value, Eina_Promise* promise EINA_UNUSED)
 {
-  ck_assert(!!value);
+  ck_assert(value == EINA_ERROR_PROMISE_CANCEL);
   ecore_main_loop_quit();
 }