summaryrefslogtreecommitdiff
path: root/src/tests/ecore_con
diff options
context:
space:
mode:
authorStefan Schmidt <stefan@osg.samsung.com>2016-08-02 09:31:10 +0200
committerStefan Schmidt <stefan@osg.samsung.com>2016-08-02 09:31:10 +0200
commitaad5b8b83e6542522b1a21972168fca1c2293c1d (patch)
tree4ff05127f33dca0dc3aba81a88c3afd2c12b42d9 /src/tests/ecore_con
parenta467bb30caabd2fb712a41e4fcfb57fdb8326096 (diff)
tests: ecore_con: make sure info is initialized
One test does init info before passing it to _url_compl_cb while two others are not. Also test if inof is NULL in callback here to avoid crashes. tests/ecore_con/ecore_con_test_ecore_con_url.c:194:4: warning: 'info' may be used uninitialized in this function [-Wmaybe-uninitialized] ecore_event_handler_add(ECORE_CON_EVENT_URL_COMPLETE,
Diffstat (limited to 'src/tests/ecore_con')
-rw-r--r--src/tests/ecore_con/ecore_con_test_ecore_con_url.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tests/ecore_con/ecore_con_test_ecore_con_url.c b/src/tests/ecore_con/ecore_con_test_ecore_con_url.c
index 0c1a602..1b73218 100644
--- a/src/tests/ecore_con/ecore_con_test_ecore_con_url.c
+++ b/src/tests/ecore_con/ecore_con_test_ecore_con_url.c
@@ -39,7 +39,7 @@ _url_compl_cb(void *data, int type EINA_UNUSED, void *event_info)
39 printf("Total downloaded bytes = %d\n", 39 printf("Total downloaded bytes = %d\n",
40 ecore_con_url_received_bytes_get(ev->url_con)); 40 ecore_con_url_received_bytes_get(ev->url_con));
41 41
42 if (info->_tmpfd) 42 if (info && info->_tmpfd)
43 { 43 {
44 status = ecore_con_url_status_code_get(ev->url_con); 44 status = ecore_con_url_status_code_get(ev->url_con);
45 fail_if(status != 220); 45 fail_if(status != 220);
@@ -167,7 +167,7 @@ error_user:
167START_TEST(ecore_con_test_ecore_con_url_ftp_upload) 167START_TEST(ecore_con_test_ecore_con_url_ftp_upload)
168{ 168{
169 Ecore_Con_Url *ec_url; 169 Ecore_Con_Url *ec_url;
170 url_test *info; 170 url_test *info = NULL;
171 int ret; 171 int ret;
172 char link[] = ECORE_CON_FTP_TEST_URL; 172 char link[] = ECORE_CON_FTP_TEST_URL;
173 char url[4096], *username, *password, *file = NULL, *dir = NULL; 173 char url[4096], *username, *password, *file = NULL, *dir = NULL;
@@ -205,7 +205,7 @@ END_TEST
205START_TEST(ecore_con_test_ecore_con_url_post) 205START_TEST(ecore_con_test_ecore_con_url_post)
206{ 206{
207 Ecore_Con_Url *ec_url; 207 Ecore_Con_Url *ec_url;
208 url_test *info; 208 url_test *info = NULL;
209 int ret; 209 int ret;
210 char link[] = ECORE_CON_HTTP_TEST_URL; 210 char link[] = ECORE_CON_HTTP_TEST_URL;
211 char url_data[] = "test"; 211 char url_data[] = "test";