summaryrefslogtreecommitdiff
path: root/src/tests/eio
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-06-16 15:13:22 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-06-22 13:19:13 -0700
commit10aadafcfd01d972a50fb9e1e6b3d3c28924feb0 (patch)
treeca3375665c23b8ba1c683c8c97695a37336f3f69 /src/tests/eio
parentae207a5be683c3f89087552a11fc7bd91128d71e (diff)
eio: rename eio_job to efl_io_manager.
There is still a lot of work to do in this API to make it efficient and stable. Will try to get at it before 1.18 release.
Diffstat (limited to 'src/tests/eio')
-rw-r--r--src/tests/eio/eio_test_manager.c (renamed from src/tests/eio/eio_test_job.c)47
-rw-r--r--src/tests/eio/eio_test_manager_xattr.c (renamed from src/tests/eio/eio_test_job_xattr.c)10
2 files changed, 28 insertions, 29 deletions
diff --git a/src/tests/eio/eio_test_job.c b/src/tests/eio/eio_test_manager.c
index 0a532ebf7d..80ac58db3b 100644
--- a/src/tests/eio/eio_test_job.c
+++ b/src/tests/eio/eio_test_manager.c
@@ -101,10 +101,10 @@ _stat_done_cb(void *data, void *value)
101 ecore_main_loop_quit(); 101 ecore_main_loop_quit();
102} 102}
103 103
104typedef Eina_Promise* (*Eio_Job_Test_Stat_Ls_Func)(Eo *job, const char *path); 104typedef Eina_Promise* (*Efl_Io_Manager_Test_Stat_Ls_Func)(Eo *job, const char *path);
105 105
106static void 106static void
107_do_ls_test(Eio_Job_Test_Stat_Ls_Func ls_func, 107_do_ls_test(Efl_Io_Manager_Test_Stat_Ls_Func ls_func,
108 const Eo_Event_Description *event, 108 const Eo_Event_Description *event,
109 Eo_Event_Cb filter_cb, 109 Eo_Event_Cb filter_cb,
110 Eina_Promise_Progress_Cb progress_cb, 110 Eina_Promise_Progress_Cb progress_cb,
@@ -113,7 +113,7 @@ _do_ls_test(Eio_Job_Test_Stat_Ls_Func ls_func,
113{ 113{
114 int main_files = 0; 114 int main_files = 0;
115 115
116 Eio_Job *job = eo_add(EIO_JOB_CLASS, NULL); 116 Efl_Io_Manager *job = eo_add(EFL_IO_MANAGER_CLASS, NULL);
117 Eina_Promise *promise = NULL; 117 Eina_Promise *promise = NULL;
118 118
119 eo_event_callback_add(job, event, filter_cb, NULL); 119 eo_event_callback_add(job, event, filter_cb, NULL);
@@ -130,19 +130,19 @@ _do_ls_test(Eio_Job_Test_Stat_Ls_Func ls_func,
130} 130}
131 131
132static void 132static void
133_do_direct_ls_test(Eio_Job_Test_Stat_Ls_Func ls_func, 133_do_direct_ls_test(Efl_Io_Manager_Test_Stat_Ls_Func ls_func,
134 int expected_test_count, 134 int expected_test_count,
135 const char *test_dirname) 135 const char *test_dirname)
136{ 136{
137 _do_ls_test(ls_func, 137 _do_ls_test(ls_func,
138 EIO_JOB_EVENT_FILTER_DIRECT, 138 EFL_IO_MANAGER_EVENT_FILTER_DIRECT,
139 (Eo_Event_Cb)&_filter_direct_cb, 139 (Eo_Event_Cb)&_filter_direct_cb,
140 (Eina_Promise_Progress_Cb)&_main_direct_cb, 140 (Eina_Promise_Progress_Cb)&_main_direct_cb,
141 expected_test_count, 141 expected_test_count,
142 test_dirname); 142 test_dirname);
143} 143}
144 144
145START_TEST(eio_job_test_file_direct_stat) 145START_TEST(efl_io_manager_test_file_direct_stat)
146{ 146{
147 Eina_Bool is_dir; 147 Eina_Bool is_dir;
148 int ret; 148 int ret;
@@ -160,17 +160,17 @@ START_TEST(eio_job_test_file_direct_stat)
160 Eina_Tmpstr *nested_dirname = create_test_dirs(test_dirname); 160 Eina_Tmpstr *nested_dirname = create_test_dirs(test_dirname);
161 Eina_Tmpstr *nested_filename = get_full_path(test_dirname, files[3]); 161 Eina_Tmpstr *nested_filename = get_full_path(test_dirname, files[3]);
162 162
163 Eio_Job *job = eo_add(EIO_JOB_CLASS, NULL); 163 Efl_Io_Manager *job = eo_add(EFL_IO_MANAGER_CLASS, NULL);
164 Eina_Promise *promise = NULL; 164 Eina_Promise *promise = NULL;
165 // Start testing 165 // Start testing
166 is_dir = EINA_TRUE; 166 is_dir = EINA_TRUE;
167 167
168 promise = eio_job_file_direct_stat(job, nested_dirname); 168 promise = efl_io_manager_file_direct_stat(job, nested_dirname);
169 eina_promise_then(promise, &_stat_done_cb, &_error_cb, &is_dir); 169 eina_promise_then(promise, &_stat_done_cb, &_error_cb, &is_dir);
170 ecore_main_loop_begin(); 170 ecore_main_loop_begin();
171 171
172 is_dir = EINA_FALSE; 172 is_dir = EINA_FALSE;
173 promise = eio_job_file_direct_stat(job, nested_filename); 173 promise = efl_io_manager_file_direct_stat(job, nested_filename);
174 eina_promise_then(promise, &_stat_done_cb, &_error_cb, &is_dir); 174 eina_promise_then(promise, &_stat_done_cb, &_error_cb, &is_dir);
175 ecore_main_loop_begin(); 175 ecore_main_loop_begin();
176 eo_unref(job); 176 eo_unref(job);
@@ -188,7 +188,7 @@ START_TEST(eio_job_test_file_direct_stat)
188} 188}
189END_TEST 189END_TEST
190 190
191START_TEST(eio_job_test_ls_funcs) 191START_TEST(efl_io_manager_test_ls_funcs)
192{ 192{
193 int ret; 193 int ret;
194 194
@@ -207,20 +207,20 @@ START_TEST(eio_job_test_ls_funcs)
207 207
208 // Start testing 208 // Start testing
209 209
210 _do_ls_test(&eio_job_file_ls, 210 _do_ls_test(&efl_io_manager_file_ls,
211 EIO_JOB_EVENT_FILTER_NAME, 211 EFL_IO_MANAGER_EVENT_FILTER_NAME,
212 (Eo_Event_Cb)&_filter_cb, 212 (Eo_Event_Cb)&_filter_cb,
213 (Eina_Promise_Progress_Cb)&_main_cb, 213 (Eina_Promise_Progress_Cb)&_main_cb,
214 5, 214 5,
215 test_dirname); 215 test_dirname);
216 216
217 _do_direct_ls_test(&eio_job_file_stat_ls, 5, test_dirname); 217 _do_direct_ls_test(&efl_io_manager_file_stat_ls, 5, test_dirname);
218 218
219 _do_direct_ls_test(&eio_job_file_direct_ls, 5, test_dirname); 219 _do_direct_ls_test(&efl_io_manager_file_direct_ls, 5, test_dirname);
220 220
221 _do_direct_ls_test(&eio_job_dir_stat_ls, 8, test_dirname); 221 _do_direct_ls_test(&efl_io_manager_dir_stat_ls, 8, test_dirname);
222 222
223 _do_direct_ls_test(&eio_job_dir_direct_ls, 8, test_dirname); 223 _do_direct_ls_test(&efl_io_manager_dir_direct_ls, 8, test_dirname);
224 224
225 // Cleanup 225 // Cleanup
226 fail_if(!ecore_file_recursive_rm(test_dirname)); 226 fail_if(!ecore_file_recursive_rm(test_dirname));
@@ -235,7 +235,7 @@ START_TEST(eio_job_test_ls_funcs)
235} 235}
236END_TEST 236END_TEST
237 237
238START_TEST(eio_job_test_open) 238START_TEST(efl_io_manager_test_open)
239{ 239{
240 Eina_Bool opened_file; 240 Eina_Bool opened_file;
241 int ret; 241 int ret;
@@ -254,10 +254,10 @@ START_TEST(eio_job_test_open)
254 Eina_Tmpstr *nested_filename = get_full_path(test_dirname, files[3]); 254 Eina_Tmpstr *nested_filename = get_full_path(test_dirname, files[3]);
255 255
256 opened_file = EINA_FALSE; 256 opened_file = EINA_FALSE;
257 Eio_Job *job = eo_add(EIO_JOB_CLASS, NULL); 257 Efl_Io_Manager *job = eo_add(EFL_IO_MANAGER_CLASS, NULL);
258 Eina_Promise *promise = NULL; 258 Eina_Promise *promise = NULL;
259 259
260 promise = eio_job_file_open(job, nested_filename, EINA_FALSE); 260 promise = efl_io_manager_file_open(job, nested_filename, EINA_FALSE);
261 eina_promise_then(promise, &_open_done_cb, &_error_cb, &opened_file); 261 eina_promise_then(promise, &_open_done_cb, &_error_cb, &opened_file);
262 ecore_main_loop_begin(); 262 ecore_main_loop_begin();
263 eo_unref(job); 263 eo_unref(job);
@@ -268,7 +268,7 @@ START_TEST(eio_job_test_open)
268 268
269 eina_tmpstr_del(nested_dirname); 269 eina_tmpstr_del(nested_dirname);
270 eina_tmpstr_del(test_dirname); 270 eina_tmpstr_del(test_dirname);
271 271
272 eio_shutdown(); 272 eio_shutdown();
273 eina_tmpstr_del(nested_filename); 273 eina_tmpstr_del(nested_filename);
274 ecore_file_shutdown(); 274 ecore_file_shutdown();
@@ -280,8 +280,7 @@ END_TEST
280void 280void
281eio_test_job(TCase *tc) 281eio_test_job(TCase *tc)
282{ 282{
283 tcase_add_test(tc, eio_job_test_ls_funcs); 283 tcase_add_test(tc, efl_io_manager_test_ls_funcs);
284 tcase_add_test(tc, eio_job_test_file_direct_stat); 284 tcase_add_test(tc, efl_io_manager_test_file_direct_stat);
285 tcase_add_test(tc, eio_job_test_open); 285 tcase_add_test(tc, efl_io_manager_test_open);
286} 286}
287
diff --git a/src/tests/eio/eio_test_job_xattr.c b/src/tests/eio/eio_test_manager_xattr.c
index 52a988a38a..94f5b49425 100644
--- a/src/tests/eio/eio_test_job_xattr.c
+++ b/src/tests/eio/eio_test_manager_xattr.c
@@ -129,7 +129,7 @@ START_TEST(eio_test_job_xattr_set)
129 129
130 fprintf(stderr, "eio_test_job_xattr_set\n"); fflush(stderr); 130 fprintf(stderr, "eio_test_job_xattr_set\n"); fflush(stderr);
131 131
132 job = eo_add(EIO_JOB_CLASS, NULL); 132 job = eo_add(EFL_IO_MANAGER_CLASS, NULL);
133 133
134 test_file_path = get_full_path(XATTR_TEST_DIR, filename); 134 test_file_path = get_full_path(XATTR_TEST_DIR, filename);
135 fd = open(test_file_path, 135 fd = open(test_file_path,
@@ -142,7 +142,7 @@ START_TEST(eio_test_job_xattr_set)
142 142
143 for (i = 0; i < sizeof(attribute) / sizeof(attribute[0]); ++i) 143 for (i = 0; i < sizeof(attribute) / sizeof(attribute[0]); ++i)
144 { 144 {
145 attrib_promises[i] = eio_job_file_xattr_set 145 attrib_promises[i] = efl_io_manager_file_xattr_set
146 (job, test_file_path, attribute[i], 146 (job, test_file_path, attribute[i],
147 attr_data[i], strlen(attr_data[i]), 147 attr_data[i], strlen(attr_data[i]),
148 EINA_XATTR_INSERT); 148 EINA_XATTR_INSERT);
@@ -163,7 +163,7 @@ START_TEST(eio_test_job_xattr_set)
163 163
164 for (i = 0; i < sizeof(attribute) / sizeof(attribute[0]); ++i) 164 for (i = 0; i < sizeof(attribute) / sizeof(attribute[0]); ++i)
165 { 165 {
166 attrib_promises[i] = eio_job_file_xattr_get(job, test_file_path, attribute[i]); 166 attrib_promises[i] = efl_io_manager_file_xattr_get(job, test_file_path, attribute[i]);
167 } 167 }
168 168
169 eina_promise_then(eina_promise_all(eina_carray_iterator_new((void**)attrib_promises)), 169 eina_promise_then(eina_promise_all(eina_carray_iterator_new((void**)attrib_promises)),
@@ -173,8 +173,8 @@ START_TEST(eio_test_job_xattr_set)
173 173
174 num_of_attr = 0; 174 num_of_attr = 0;
175 175
176 eo_event_callback_add(job, EIO_JOB_EVENT_XATTR, _filter_cb, NULL); 176 eo_event_callback_add(job, EFL_IO_MANAGER_EVENT_XATTR, _filter_cb, NULL);
177 list_promise = eio_job_file_xattr_list_get(job, test_file_path); 177 list_promise = efl_io_manager_file_xattr_list_get(job, test_file_path);
178 eina_promise_progress_cb_add(list_promise, _main_cb, &num_of_attr, NULL); 178 eina_promise_progress_cb_add(list_promise, _main_cb, &num_of_attr, NULL);
179 eina_promise_then(list_promise, _done_cb, _error_cb, &num_of_attr); 179 eina_promise_then(list_promise, _done_cb, _error_cb, &num_of_attr);
180 180