summaryrefslogtreecommitdiff
path: root/src/tests/ecore/ecore_test_promise.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-08-18 13:36:05 -0300
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-08-18 13:36:05 -0300
commite56811ed4db61ac2ac14d28a7a8fac83f41c43b8 (patch)
tree6e012e00ea5460aec644bb31e6fc16a2c5c9973e /src/tests/ecore/ecore_test_promise.c
parent8a74f3807127391fb4c6517a69eae17414aca396 (diff)
eina_error: allow errno.h codes.
we have some duplication of errors between Eina_Error and errno.h, however we should use Eina_Error to extend the traditional errno.h system. then change eina_error_msg_register() and eina_error_msg_static_register() to return a magic bit to state the number was registered, and on other functions test this bit in order to operate on registered values, otherwise fallback to errno.h, such as strerror(). It also deprecates 2 clear duplicated errors: - EINA_ERROR_OUT_OF_MEMORY -> ENOMEM - EINA_ERROR_TIMEOUT -> ETIMEDOUT There are two details when using strerror(): - old behavior did not return strings for non-error, such as "Success" or "Unknown error ${N}" - thread-safety issues: since we must be thread safe, then use strerror_r() and eina_stringshare_add() that value, keeping a hash of cached values
Diffstat (limited to '')
-rw-r--r--src/tests/ecore/ecore_test_promise.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tests/ecore/ecore_test_promise.c b/src/tests/ecore/ecore_test_promise.c
index 3c7d8ebd8c..50df5083b3 100644
--- a/src/tests/ecore/ecore_test_promise.c
+++ b/src/tests/ecore/ecore_test_promise.c
@@ -33,12 +33,12 @@ END_TEST
33 33
34void promise_error_thread(const void* data EINA_UNUSED, Eina_Promise_Owner* promise, Ecore_Thread* thread EINA_UNUSED) 34void promise_error_thread(const void* data EINA_UNUSED, Eina_Promise_Owner* promise, Ecore_Thread* thread EINA_UNUSED)
35{ 35{
36 eina_promise_owner_error_set(promise, EINA_ERROR_OUT_OF_MEMORY); 36 eina_promise_owner_error_set(promise, ENOMEM);
37} 37}
38 38
39void promise_error_callback(void* data EINA_UNUSED, Eina_Error error) 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 == ENOMEM);
42 ecore_main_loop_quit(); 42 ecore_main_loop_quit();
43} 43}
44 44