summaryrefslogtreecommitdiff
path: root/src/tests/ecore/ecore_test_ecore_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/ecore/ecore_test_ecore_file.c')
-rw-r--r--src/tests/ecore/ecore_test_ecore_file.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/tests/ecore/ecore_test_ecore_file.c b/src/tests/ecore/ecore_test_ecore_file.c
index fe0e73f..3b6fcff 100644
--- a/src/tests/ecore/ecore_test_ecore_file.c
+++ b/src/tests/ecore/ecore_test_ecore_file.c
@@ -104,9 +104,13 @@ completion_cb(void *data EINA_UNUSED, const char *file EINA_UNUSED, int status)
104} 104}
105 105
106void 106void
107err_completion_cb(void *data EINA_UNUSED, const char *file EINA_UNUSED, int status) 107err_completion_cb(void *data, const char *file EINA_UNUSED, int status)
108{ 108{
109 if (data)
110 *((int*) data) = status;
109 fail_if(status != 1); 111 fail_if(status != 1);
112 // NOP if called from outside main loop. Keep it here if abort fails and
113 // we get called from there.
110 ecore_main_loop_quit(); 114 ecore_main_loop_quit();
111} 115}
112 116
@@ -521,12 +525,15 @@ EFL_START_TEST(ecore_test_ecore_file_download)
521 progress_cb, NULL, &job); 525 progress_cb, NULL, &job);
522 fail_if(res != EINA_FALSE); 526 fail_if(res != EINA_FALSE);
523 527
528 int status = 0;
524 res = ecore_file_download(download_url, dest_name, err_completion_cb, 529 res = ecore_file_download(download_url, dest_name, err_completion_cb,
525 progress_cb, NULL, &job); 530 progress_cb, &status, &job);
526 fail_if(res != EINA_TRUE); 531 fail_if(res != EINA_TRUE);
527 fail_if(!job); 532 fail_if(!job);
528 ecore_file_download_abort(job); 533 ecore_file_download_abort(job);
529 ecore_main_loop_begin(); 534 fail_if(status != 1);
535 if (!status)
536 ecore_main_loop_begin();
530 if (timeout_reached) goto end; 537 if (timeout_reached) goto end;
531 res = ecore_file_remove(dest_name); 538 res = ecore_file_remove(dest_name);
532 fail_if(res != EINA_TRUE); 539 fail_if(res != EINA_TRUE);