forked from enlightenment/efl
eio: fix manager tests.
This commit is contained in:
parent
52c63190d5
commit
8e8c50e7a1
|
@ -13,87 +13,64 @@
|
|||
# define O_BINARY 0
|
||||
#endif
|
||||
|
||||
static int test_count = 0;
|
||||
static uint64_t test_count = 0;
|
||||
static Eina_Bool direct = EINA_FALSE;
|
||||
|
||||
static int DONE_CALLED = 0xdeadbeef;
|
||||
#define DONE_CALLED 0xdeadbeef
|
||||
|
||||
static void
|
||||
_filter_direct_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
||||
_progress_cb(void *data, const Efl_Event *ev)
|
||||
{
|
||||
Eio_Filter_Direct_Data *event_info = event->info;
|
||||
char *last_slash = strrchr(event_info->info->path, '/');
|
||||
Efl_Future_Event_Progress *p = ev->info;
|
||||
Eina_Array *batch = p->progress;
|
||||
uint64_t *number_of_listed_files = data;
|
||||
|
||||
//Check if it is a hidden file
|
||||
if (last_slash != NULL && strlen(last_slash) > 1 && last_slash[1] == '.')
|
||||
event_info->filter = EINA_FALSE;
|
||||
else
|
||||
event_info->filter = EINA_TRUE;
|
||||
(*number_of_listed_files) += eina_array_count(batch);
|
||||
}
|
||||
|
||||
static void
|
||||
_main_direct_cb(void *data, const Eina_File_Direct_Info *info)
|
||||
_done_cb(void *data, const Efl_Event *ev)
|
||||
{
|
||||
int *number_of_listed_files = (int *)data;
|
||||
Efl_Future_Event_Success *success = ev->info;
|
||||
uint64_t *files_count = success->value;
|
||||
uint64_t *number_of_listed_files = data;
|
||||
|
||||
fprintf(stderr, "Processing file:%s\n", info->path);
|
||||
(*number_of_listed_files)++;
|
||||
}
|
||||
|
||||
static void
|
||||
_filter_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
||||
{
|
||||
Eio_Filter_Name_Data *event_info = event->info;
|
||||
char *last_slash = strrchr(event_info->file, '/');
|
||||
|
||||
//Check if it is a hidden file
|
||||
if (last_slash != NULL && strlen(last_slash) > 1 && last_slash[1] == '.')
|
||||
event_info->filter = EINA_FALSE;
|
||||
else
|
||||
event_info->filter = EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_main_cb(void *data, const char *file)
|
||||
{
|
||||
int *number_of_listed_files = (int *)data;
|
||||
|
||||
fprintf(stderr, "Processing file:%s\n", file);
|
||||
(*number_of_listed_files)++;
|
||||
}
|
||||
|
||||
static void
|
||||
_done_cb(void *data, void* value EINA_UNUSED)
|
||||
{
|
||||
int *number_of_listed_files = (int *)data;
|
||||
fail_if((*number_of_listed_files) != test_count);
|
||||
fail_if(*files_count != test_count);
|
||||
*number_of_listed_files = DONE_CALLED;
|
||||
ecore_main_loop_quit();
|
||||
}
|
||||
|
||||
static void
|
||||
_error_cb(void *data EINA_UNUSED, Eina_Error error)
|
||||
_error_cb(void *data EINA_UNUSED, const Efl_Event *ev)
|
||||
{
|
||||
const char *msg = eina_error_msg_get(error);
|
||||
Efl_Future_Event_Failure *failure = ev->info;
|
||||
const char *msg = eina_error_msg_get(failure->error);
|
||||
|
||||
EINA_LOG_ERR("error: %s", msg);
|
||||
ecore_main_loop_quit();
|
||||
}
|
||||
|
||||
static void
|
||||
_open_done_cb(void *data, void *file_value)
|
||||
_open_done_cb(void *data, const Efl_Event *ev)
|
||||
{
|
||||
Efl_Future_Event_Success *success = ev->info;
|
||||
Eina_Bool *opened = (Eina_Bool *)data;
|
||||
*opened = EINA_TRUE;
|
||||
Eina_File* file = eina_file_dup(file_value);
|
||||
Eina_File* file = eina_file_dup(success->value);
|
||||
eina_file_close(file);
|
||||
|
||||
*opened = EINA_TRUE;
|
||||
ecore_main_loop_quit();
|
||||
}
|
||||
|
||||
static void
|
||||
_stat_done_cb(void *data, void *value)
|
||||
_stat_done_cb(void *data, const Efl_Event *ev)
|
||||
{
|
||||
Eina_Stat const* stat = value;
|
||||
Efl_Future_Event_Success *success = ev->info;
|
||||
Eina_Stat const* stat = success->value;
|
||||
Eina_Bool *is_dir = data;
|
||||
unsigned int rights;
|
||||
|
||||
fail_if(eio_file_is_dir(stat) != *is_dir);
|
||||
fail_if(eio_file_is_lnk(stat));
|
||||
rights = stat->mode & (S_IRWXU | S_IRWXG | S_IRWXO);
|
||||
|
@ -101,50 +78,46 @@ _stat_done_cb(void *data, void *value)
|
|||
ecore_main_loop_quit();
|
||||
}
|
||||
|
||||
typedef Eina_Promise* (*Efl_Io_Manager_Test_Stat_Ls_Func)(Eo *job, const char *path);
|
||||
|
||||
static void
|
||||
_do_ls_test(Efl_Io_Manager_Test_Stat_Ls_Func ls_func,
|
||||
const Efl_Event_Description *event,
|
||||
Efl_Event_Cb filter_cb,
|
||||
Eina_Promise_Progress_Cb progress_cb,
|
||||
int expected_test_count,
|
||||
const char* test_dirname)
|
||||
_test_ls(Efl_Future *(*func)(Eo *obj, const char *path, Eina_Bool recursive),
|
||||
uint64_t expected_test_count,
|
||||
const char* test_dirname)
|
||||
{
|
||||
int main_files = 0;
|
||||
Efl_Io_Manager *job = efl_add(EFL_IO_MANAGER_CLASS, ecore_main_loop_get());
|
||||
Efl_Future *f = NULL;
|
||||
uint64_t main_files = 0;
|
||||
|
||||
Efl_Io_Manager *job = efl_add(EFL_IO_MANAGER_CLASS, NULL);
|
||||
Eina_Promise *promise = NULL;
|
||||
fail_if(!job);
|
||||
|
||||
efl_event_callback_add(job, event, filter_cb, NULL);
|
||||
promise = ls_func(job, test_dirname);
|
||||
f = func(job, test_dirname, EINA_FALSE);
|
||||
fail_if(!f);
|
||||
test_count = expected_test_count;
|
||||
eina_promise_progress_cb_add(promise, progress_cb, &main_files, NULL);
|
||||
eina_promise_then(promise, &_done_cb, &_error_cb, &main_files);
|
||||
efl_future_then(f, &_done_cb, &_error_cb, &_progress_cb, &main_files);
|
||||
|
||||
ecore_main_loop_begin();
|
||||
|
||||
fail_if(main_files != DONE_CALLED);
|
||||
main_files = 0;
|
||||
|
||||
f = func(job, test_dirname, EINA_TRUE);
|
||||
test_count = expected_test_count + 4;
|
||||
efl_future_then(f, &_done_cb, &_error_cb, &_progress_cb, &main_files);
|
||||
|
||||
ecore_main_loop_begin();
|
||||
|
||||
fail_if(main_files != DONE_CALLED);
|
||||
|
||||
efl_unref(job);
|
||||
efl_del(job);
|
||||
}
|
||||
|
||||
static void
|
||||
_do_direct_ls_test(Efl_Io_Manager_Test_Stat_Ls_Func ls_func,
|
||||
int expected_test_count,
|
||||
const char *test_dirname)
|
||||
START_TEST(efl_io_manager_test_stat)
|
||||
{
|
||||
_do_ls_test(ls_func,
|
||||
EFL_IO_MANAGER_EVENT_FILTER_DIRECT,
|
||||
(Efl_Event_Cb)&_filter_direct_cb,
|
||||
(Eina_Promise_Progress_Cb)&_main_direct_cb,
|
||||
expected_test_count,
|
||||
test_dirname);
|
||||
}
|
||||
|
||||
START_TEST(efl_io_manager_test_file_direct_stat)
|
||||
{
|
||||
Eina_Bool is_dir;
|
||||
Eina_Tmpstr *test_dirname;
|
||||
Eina_Tmpstr *nested_dirname;
|
||||
Eina_Tmpstr *nested_filename;
|
||||
Efl_Io_Manager *job;
|
||||
Efl_Future *f;
|
||||
Eina_Bool is_dir = EINA_TRUE;
|
||||
int ret;
|
||||
|
||||
ret = ecore_init();
|
||||
|
@ -156,26 +129,25 @@ START_TEST(efl_io_manager_test_file_direct_stat)
|
|||
ret = ecore_file_init();
|
||||
fail_if(ret < 1);
|
||||
|
||||
Eina_Tmpstr *test_dirname = get_eio_test_file_tmp_dir();
|
||||
Eina_Tmpstr *nested_dirname = create_test_dirs(test_dirname);
|
||||
Eina_Tmpstr *nested_filename = get_full_path(test_dirname, files[3]);
|
||||
test_dirname = get_eio_test_file_tmp_dir();
|
||||
nested_dirname = create_test_dirs(test_dirname);
|
||||
nested_filename = get_full_path(test_dirname, files[3]);
|
||||
|
||||
job = efl_add(EFL_IO_MANAGER_CLASS, ecore_main_loop_get());
|
||||
fail_if(!job);
|
||||
|
||||
Efl_Io_Manager *job = efl_add(EFL_IO_MANAGER_CLASS, NULL);
|
||||
Eina_Promise *promise = NULL;
|
||||
// Start testing
|
||||
is_dir = EINA_TRUE;
|
||||
|
||||
promise = efl_io_manager_file_direct_stat(job, nested_dirname);
|
||||
eina_promise_then(promise, &_stat_done_cb, &_error_cb, &is_dir);
|
||||
f = efl_io_manager_stat(job, nested_dirname);
|
||||
efl_future_then(f, &_stat_done_cb, &_error_cb, NULL, &is_dir);
|
||||
ecore_main_loop_begin();
|
||||
|
||||
is_dir = EINA_FALSE;
|
||||
promise = efl_io_manager_file_direct_stat(job, nested_filename);
|
||||
eina_promise_then(promise, &_stat_done_cb, &_error_cb, &is_dir);
|
||||
f = efl_io_manager_stat(job, nested_filename);
|
||||
efl_future_then(f, &_stat_done_cb, &_error_cb, NULL, &is_dir);
|
||||
ecore_main_loop_begin();
|
||||
efl_unref(job);
|
||||
|
||||
// Cleanup
|
||||
efl_del(job);
|
||||
fail_if(!ecore_file_recursive_rm(test_dirname));
|
||||
|
||||
eina_tmpstr_del(nested_dirname);
|
||||
|
@ -188,8 +160,14 @@ START_TEST(efl_io_manager_test_file_direct_stat)
|
|||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(efl_io_manager_test_ls_funcs)
|
||||
START_TEST(efl_io_manager_test_ls)
|
||||
{
|
||||
Eina_Tmpstr *test_dirname;
|
||||
Eina_Tmpstr *nested_dirname;
|
||||
Eina_Tmpstr *nested_filename;
|
||||
Efl_Io_Manager *job;
|
||||
Efl_Future *f;
|
||||
uint64_t main_files = 0;
|
||||
int ret;
|
||||
|
||||
ret = ecore_init();
|
||||
|
@ -201,28 +179,30 @@ START_TEST(efl_io_manager_test_ls_funcs)
|
|||
ret = ecore_file_init();
|
||||
fail_if(ret < 1);
|
||||
|
||||
Eina_Tmpstr *test_dirname = get_eio_test_file_tmp_dir();
|
||||
Eina_Tmpstr *nested_dirname = create_test_dirs(test_dirname);
|
||||
Eina_Tmpstr *nested_filename = get_full_path(test_dirname, files[3]);
|
||||
test_dirname = get_eio_test_file_tmp_dir();
|
||||
nested_dirname = create_test_dirs(test_dirname);
|
||||
nested_filename = get_full_path(test_dirname, files[3]);
|
||||
|
||||
// Start testing
|
||||
job = efl_add(EFL_IO_MANAGER_CLASS, ecore_main_loop_get());
|
||||
fail_if(!job);
|
||||
|
||||
_do_ls_test(&efl_io_manager_file_ls,
|
||||
EFL_IO_MANAGER_EVENT_FILTER_NAME,
|
||||
(Efl_Event_Cb)&_filter_cb,
|
||||
(Eina_Promise_Progress_Cb)&_main_cb,
|
||||
5,
|
||||
test_dirname);
|
||||
f = efl_io_manager_ls(job, test_dirname);
|
||||
test_count = 6;
|
||||
efl_future_then(f, &_done_cb, &_error_cb, &_progress_cb, &main_files);
|
||||
|
||||
_do_direct_ls_test(&efl_io_manager_file_stat_ls, 5, test_dirname);
|
||||
ecore_main_loop_begin();
|
||||
|
||||
_do_direct_ls_test(&efl_io_manager_file_direct_ls, 5, test_dirname);
|
||||
fail_if(main_files != DONE_CALLED);
|
||||
|
||||
_do_direct_ls_test(&efl_io_manager_dir_stat_ls, 8, test_dirname);
|
||||
|
||||
_do_direct_ls_test(&efl_io_manager_dir_direct_ls, 8, test_dirname);
|
||||
// No recursion for efl_io_manager_ls, should I fix that ?
|
||||
/* _test_ls(&efl_io_manager_ls, 5, test_dirname); */
|
||||
direct = EINA_TRUE;
|
||||
_test_ls(&efl_io_manager_stat_ls, 6, test_dirname);
|
||||
_test_ls(&efl_io_manager_direct_ls, 6, test_dirname);
|
||||
|
||||
// Cleanup
|
||||
efl_del(job);
|
||||
fail_if(!ecore_file_recursive_rm(test_dirname));
|
||||
|
||||
eina_tmpstr_del(nested_dirname);
|
||||
|
@ -237,7 +217,12 @@ END_TEST
|
|||
|
||||
START_TEST(efl_io_manager_test_open)
|
||||
{
|
||||
Eina_Bool opened_file;
|
||||
Eina_Tmpstr *test_dirname;
|
||||
Eina_Tmpstr *nested_dirname;
|
||||
Eina_Tmpstr *nested_filename;
|
||||
Efl_Io_Manager *job;
|
||||
Efl_Future *f;
|
||||
Eina_Bool opened_file = EINA_FALSE;
|
||||
int ret;
|
||||
|
||||
ret = ecore_init();
|
||||
|
@ -249,21 +234,20 @@ START_TEST(efl_io_manager_test_open)
|
|||
ret = eio_init();
|
||||
fail_if(ret < 1);
|
||||
|
||||
Eina_Tmpstr *test_dirname = get_eio_test_file_tmp_dir();
|
||||
Eina_Tmpstr *nested_dirname = create_test_dirs(test_dirname);
|
||||
Eina_Tmpstr *nested_filename = get_full_path(test_dirname, files[3]);
|
||||
test_dirname = get_eio_test_file_tmp_dir();
|
||||
nested_dirname = create_test_dirs(test_dirname);
|
||||
nested_filename = get_full_path(test_dirname, files[3]);
|
||||
|
||||
opened_file = EINA_FALSE;
|
||||
Efl_Io_Manager *job = efl_add(EFL_IO_MANAGER_CLASS, NULL);
|
||||
Eina_Promise *promise = NULL;
|
||||
job = efl_add(EFL_IO_MANAGER_CLASS, ecore_main_loop_get());
|
||||
|
||||
promise = efl_io_manager_file_open(job, nested_filename, EINA_FALSE);
|
||||
eina_promise_then(promise, &_open_done_cb, &_error_cb, &opened_file);
|
||||
f = efl_io_manager_open(job, nested_filename, EINA_FALSE);
|
||||
efl_future_then(f, &_open_done_cb, &_error_cb, NULL, &opened_file);
|
||||
ecore_main_loop_begin();
|
||||
efl_unref(job);
|
||||
|
||||
fail_if(!opened_file);
|
||||
|
||||
// Cleanup
|
||||
efl_del(job);
|
||||
fail_if(!ecore_file_recursive_rm(test_dirname));
|
||||
|
||||
eina_tmpstr_del(nested_dirname);
|
||||
|
@ -300,8 +284,8 @@ END_TEST
|
|||
void
|
||||
eio_test_job(TCase *tc)
|
||||
{
|
||||
tcase_add_test(tc, efl_io_manager_test_ls_funcs);
|
||||
tcase_add_test(tc, efl_io_manager_test_file_direct_stat);
|
||||
tcase_add_test(tc, efl_io_manager_test_ls);
|
||||
tcase_add_test(tc, efl_io_manager_test_stat);
|
||||
tcase_add_test(tc, efl_io_manager_test_open);
|
||||
tcase_add_test(tc, efl_io_instantiated);
|
||||
}
|
||||
|
|
|
@ -36,17 +36,10 @@ static const char *attr_data[] =
|
|||
int total_attributes = sizeof(attribute)/sizeof(attribute[0]);
|
||||
|
||||
static void
|
||||
_filter_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
||||
_main_cb(void *data, const Efl_Event *ev)
|
||||
{
|
||||
Eio_Filter_Name_Data *event_info = event->info;
|
||||
|
||||
event_info->filter = EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_main_cb(void *data, void *v)
|
||||
{
|
||||
const char* attr = v;
|
||||
Efl_Future_Event_Success *success = ev->info;
|
||||
const char* attr = success->value;
|
||||
int *num_of_attr = (int *)data;
|
||||
unsigned int i;
|
||||
|
||||
|
@ -56,11 +49,10 @@ _main_cb(void *data, void *v)
|
|||
(*num_of_attr)++;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
_done_cb(void *data, void *value EINA_UNUSED)
|
||||
_done_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||
|
||||
{
|
||||
int *num_of_attr = (int *)data;
|
||||
|
@ -71,16 +63,19 @@ _done_cb(void *data, void *value EINA_UNUSED)
|
|||
}
|
||||
|
||||
static void
|
||||
_done_get_cb(void *data EINA_UNUSED, void* v)
|
||||
_done_get_cb(void *data EINA_UNUSED, const Efl_Event *ev)
|
||||
{
|
||||
Eina_Iterator** it = (Eina_Iterator**)v;
|
||||
Efl_Future_Event_Success *success = ev->info;
|
||||
Eina_Accessor *ac = success->value;
|
||||
int i = 0;
|
||||
Eio_Xattr_Data *get_data;
|
||||
Eina_Binbuf *buf;
|
||||
|
||||
while (eina_iterator_next((*it), (void**)&get_data))
|
||||
EINA_ACCESSOR_FOREACH(ac, i, buf)
|
||||
{
|
||||
fail_if(!get_data);
|
||||
fail_if(strcmp(get_data->data, attr_data[i]) != 0);
|
||||
fail_if(!buf);
|
||||
fail_if(strcmp((const char*) eina_binbuf_string_get(buf),
|
||||
attr_data[i]) != 0);
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
|
@ -90,12 +85,15 @@ _done_get_cb(void *data EINA_UNUSED, void* v)
|
|||
}
|
||||
|
||||
static void
|
||||
_done_set_cb(void *data, void* v)
|
||||
_done_set_cb(void *data, const Efl_Event *ev)
|
||||
{
|
||||
Eina_Iterator** it = (Eina_Iterator**)v;
|
||||
Efl_Future_Event_Success *success = ev->info;
|
||||
Eina_Accessor *ac = success->value;
|
||||
int *placeholder;
|
||||
int *num_of_attr = data;
|
||||
while(eina_iterator_next((*it), (void**)&placeholder))
|
||||
int i = 0;
|
||||
|
||||
EINA_ACCESSOR_FOREACH(ac, i, placeholder)
|
||||
*num_of_attr += 1;
|
||||
|
||||
fail_if(*num_of_attr != total_attributes);
|
||||
|
@ -104,10 +102,11 @@ _done_set_cb(void *data, void* v)
|
|||
}
|
||||
|
||||
static void
|
||||
_error_cb(void *data EINA_UNUSED, Eina_Error error)
|
||||
|
||||
_error_cb(void *data EINA_UNUSED, const Efl_Event *ev)
|
||||
{
|
||||
fprintf(stderr, "Something has gone wrong:%s\n", eina_error_msg_get(error));
|
||||
Efl_Future_Event_Failure *failure = ev->info;
|
||||
|
||||
fprintf(stderr, "Something has gone wrong:%s\n", eina_error_msg_get(failure->error));
|
||||
abort();
|
||||
|
||||
ecore_main_loop_quit();
|
||||
|
@ -120,16 +119,14 @@ START_TEST(eio_test_job_xattr_set)
|
|||
int num_of_attr = 0, fd;
|
||||
unsigned int i;
|
||||
Eo *job;
|
||||
Eina_Promise *list_promise = NULL;
|
||||
Eina_Promise **attrib_promises = NULL;
|
||||
Efl_Future *ls = NULL;
|
||||
Efl_Future **futures = NULL;
|
||||
|
||||
ecore_init();
|
||||
eina_init();
|
||||
eio_init();
|
||||
|
||||
fprintf(stderr, "eio_test_job_xattr_set\n"); fflush(stderr);
|
||||
|
||||
job = efl_add(EFL_IO_MANAGER_CLASS, NULL);
|
||||
job = efl_add(EFL_IO_MANAGER_CLASS, ecore_main_loop_get());
|
||||
|
||||
test_file_path = get_full_path(XATTR_TEST_DIR, filename);
|
||||
fd = open(test_file_path,
|
||||
|
@ -137,52 +134,51 @@ START_TEST(eio_test_job_xattr_set)
|
|||
S_IRWXU | S_IRWXG | S_IRWXO);
|
||||
fail_if(fd == 0);
|
||||
|
||||
attrib_promises = (Eina_Promise**)calloc(total_attributes + 1, sizeof(Eina_Promise*));
|
||||
attrib_promises[total_attributes] = NULL;
|
||||
futures = calloc(total_attributes + 1, sizeof(Efl_Future*));
|
||||
futures[total_attributes] = NULL;
|
||||
|
||||
for (i = 0; i < sizeof(attribute) / sizeof(attribute[0]); ++i)
|
||||
{
|
||||
attrib_promises[i] = efl_io_manager_file_xattr_set
|
||||
(job, test_file_path, attribute[i],
|
||||
attr_data[i], strlen(attr_data[i]),
|
||||
EINA_XATTR_INSERT);
|
||||
Eina_Binbuf *buf;
|
||||
|
||||
buf = eina_binbuf_manage_new((const unsigned char*) attr_data[i], strlen(attr_data[i]), EINA_TRUE);
|
||||
futures[i] = efl_io_manager_xattr_set(job, test_file_path, attribute[i], buf, EINA_XATTR_INSERT);
|
||||
eina_binbuf_free(buf);
|
||||
|
||||
fail_if(num_of_attr != 0); // test asynchronous
|
||||
}
|
||||
eina_promise_then(eina_promise_all(eina_carray_iterator_new((void**)attrib_promises)),
|
||||
&_done_set_cb, _error_cb, &num_of_attr);
|
||||
efl_future_then(efl_future_iterator_all(eina_carray_iterator_new((void**) futures)),
|
||||
_done_set_cb, _error_cb, NULL, &num_of_attr);
|
||||
|
||||
ecore_main_loop_begin();
|
||||
|
||||
free(attrib_promises);
|
||||
free(futures);
|
||||
|
||||
num_of_attr = 0;
|
||||
|
||||
attrib_promises = (Eina_Promise**)calloc(total_attributes + 1, sizeof(Eina_Promise*));
|
||||
attrib_promises[total_attributes] = NULL;
|
||||
futures = calloc(total_attributes + 1, sizeof(Eina_Promise*));
|
||||
futures[total_attributes] = NULL;
|
||||
|
||||
for (i = 0; i < sizeof(attribute) / sizeof(attribute[0]); ++i)
|
||||
{
|
||||
attrib_promises[i] = efl_io_manager_file_xattr_get(job, test_file_path, attribute[i]);
|
||||
}
|
||||
{
|
||||
futures[i] = efl_io_manager_xattr_get(job, test_file_path, attribute[i]);
|
||||
}
|
||||
|
||||
eina_promise_then(eina_promise_all(eina_carray_iterator_new((void**)attrib_promises)),
|
||||
_done_get_cb, _error_cb, &num_of_attr);
|
||||
efl_future_then(efl_future_iterator_all(eina_carray_iterator_new((void**)futures)),
|
||||
_done_get_cb, _error_cb, NULL, &num_of_attr);
|
||||
|
||||
ecore_main_loop_begin();
|
||||
|
||||
num_of_attr = 0;
|
||||
|
||||
efl_event_callback_add(job, EFL_IO_MANAGER_EVENT_XATTR, _filter_cb, NULL);
|
||||
list_promise = efl_io_manager_file_xattr_list_get(job, test_file_path);
|
||||
eina_promise_progress_cb_add(list_promise, _main_cb, &num_of_attr, NULL);
|
||||
eina_promise_then(list_promise, _done_cb, _error_cb, &num_of_attr);
|
||||
efl_future_use(&ls, efl_io_manager_xattr_ls(job, test_file_path));
|
||||
efl_future_then(ls, _done_cb, _error_cb, _main_cb, &num_of_attr);
|
||||
|
||||
fail_if(num_of_attr != 0);
|
||||
|
||||
ecore_main_loop_begin();
|
||||
|
||||
free(attrib_promises);
|
||||
free(futures);
|
||||
|
||||
efl_unref(job);
|
||||
close(fd);
|
||||
|
|
Loading…
Reference in New Issue