summaryrefslogtreecommitdiff
path: root/src/tests/eio
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-05-07 09:55:55 -0700
committerCedric BAIL <cedric@osg.samsung.com>2018-05-07 09:55:55 -0700
commit790b17673f7eeb5c8af6bf7d6d49fd0921eebd34 (patch)
treef5fad0e39101d3d7cfcd49431fd03185e2c8b4d6 /src/tests/eio
parentb8cf656bd38c19b48814788afebdd3432180e4fa (diff)
eio: delay tests until we have started listing some files.
Diffstat (limited to 'src/tests/eio')
-rw-r--r--src/tests/eio/eio_model_test_file.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/tests/eio/eio_model_test_file.c b/src/tests/eio/eio_model_test_file.c
index 812cc84cee..59318f8484 100644
--- a/src/tests/eio/eio_model_test_file.c
+++ b/src/tests/eio/eio_model_test_file.c
@@ -80,9 +80,25 @@ listing(void *data,
80{ 80{
81 Eina_Future *future; 81 Eina_Future *future;
82 Efl_Model *filemodel = data; 82 Efl_Model *filemodel = data;
83 83 static unsigned int it = 0;
84 future = efl_model_children_slice_get(filemodel, 0, efl_model_children_count_get(filemodel)); 84
85 future = eina_future_then(future, &promise_then_accessor, NULL); 85 if (it++ >= 3)
86 {
87 fprintf(stderr, "Failed to list any files after 3 attemps.\n");
88 ecore_main_loop_quit();
89 return eina_value_error_init(ECANCELED);
90 }
91
92 if (efl_model_children_count_get(filemodel) == 0)
93 {
94 future = efl_loop_job(efl_provider_find(filemodel, EFL_LOOP_CLASS));
95 future = eina_future_then(future, listing, filemodel);
96 }
97 else
98 {
99 future = efl_model_children_slice_get(filemodel, 0, efl_model_children_count_get(filemodel));
100 future = eina_future_then(future, &promise_then_accessor, NULL);
101 }
86 102
87 return eina_future_as_value(future); 103 return eina_future_as_value(future);
88} 104}