Eio: fixed eio_model_test_monitor_add

fix filename comparison in the test for deleted file
This commit is contained in:
Larry Jr 2016-05-03 18:19:26 -03:00
parent ba10fa6636
commit 5230309b02
1 changed files with 13 additions and 5 deletions

View File

@ -35,7 +35,7 @@ _children_removed_cb(void *data EINA_UNUSED, const Eo_Event* event)
Eina_Value const* value = eina_promise_value_get(promise); Eina_Value const* value = eina_promise_value_get(promise);
char* filename = eina_value_to_string(value); char* filename = eina_value_to_string(value);
if(temp_filename && !strcmp(filename, temp_filename) == 0) if(temp_filename && strcmp(filename, temp_filename) == 0)
ecore_main_loop_quit(); ecore_main_loop_quit();
free(filename); free(filename);
} }
@ -53,7 +53,7 @@ _children_added_cb(void *data EINA_UNUSED, const Eo_Event* event)
Eina_Value const* value = eina_promise_value_get(promise); Eina_Value const* value = eina_promise_value_get(promise);
char* filename = eina_value_to_string(value); char* filename = eina_value_to_string(value);
if(temp_filename && !strcmp(temp_filename, filename)) if(temp_filename && strcmp(temp_filename, filename) == 0)
{ {
children_deleted = EINA_TRUE; children_deleted = EINA_TRUE;
efl_model_child_del(event->obj, evt->child); efl_model_child_del(event->obj, evt->child);
@ -74,6 +74,14 @@ _create_file(void *data EINA_UNUSED, void* value EINA_UNUSED)
} }
} }
static void
_create_file_error(void *data EINA_UNUSED, const Eina_Error* value EINA_UNUSED)
{
ck_abort_msg(0, "Error Promise cb called in Create file");
ecore_main_loop_quit();
}
START_TEST(eio_model_test_test_monitor_add) START_TEST(eio_model_test_test_monitor_add)
{ {
Eo *filemodel = NULL; Eo *filemodel = NULL;
@ -96,7 +104,7 @@ START_TEST(eio_model_test_test_monitor_add)
Eina_Promise* promise; Eina_Promise* promise;
efl_model_children_slice_get(filemodel, 0, 0, &promise); efl_model_children_slice_get(filemodel, 0, 0, &promise);
eina_promise_then(promise, &_create_file, NULL, NULL); eina_promise_then(promise, &_create_file, &_create_file_error, NULL);
ecore_main_loop_begin(); ecore_main_loop_begin();