Skip to content

Commit

Permalink
tests: fix multiple may be used uninitialized warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bagder committed Mar 5, 2019
1 parent 1ed9e74 commit a4cc978
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions tests/libtest/lib1537.c
Expand Up @@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
Expand All @@ -30,7 +30,7 @@ int test(char *URL)
CURLcode res = CURLE_OK; CURLcode res = CURLE_OK;
char *ptr = NULL; char *ptr = NULL;
int asize; int asize;
int outlen; int outlen = 0;
char *raw; char *raw;


(void)URL; /* we don't use this */ (void)URL; /* we don't use this */
Expand Down
8 changes: 5 additions & 3 deletions tests/libtest/lib1555.c
Expand Up @@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, 2017, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
Expand Down Expand Up @@ -36,14 +36,16 @@ static int progressCallback(void *arg,
double ulnow) double ulnow)
{ {
CURLcode res = 0; CURLcode res = 0;
char buffer[256];
size_t n = 0;
(void)arg; (void)arg;
(void)dltotal; (void)dltotal;
(void)dlnow; (void)dlnow;
(void)ultotal; (void)ultotal;
(void)ulnow; (void)ulnow;
res = curl_easy_recv(curl, NULL, 0, NULL); res = curl_easy_recv(curl, buffer, 256, &n);
printf("curl_easy_recv returned %d\n", res); printf("curl_easy_recv returned %d\n", res);
res = curl_easy_send(curl, NULL, 0, NULL); res = curl_easy_send(curl, buffer, n, &n);
printf("curl_easy_send returned %d\n", res); printf("curl_easy_send returned %d\n", res);


return 1; return 1;
Expand Down
4 changes: 2 additions & 2 deletions tests/libtest/lib1900.c
Expand Up @@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 2013 - 2018, Linus Nielsen Feltzing, <linus@haxx.se> * Copyright (C) 2013 - 2019, Linus Nielsen Feltzing, <linus@haxx.se>
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
Expand Down Expand Up @@ -138,7 +138,7 @@ int test(char *URL)
CURLM *m = NULL; CURLM *m = NULL;
CURLMsg *msg; /* for picking up messages with the transfer status */ CURLMsg *msg; /* for picking up messages with the transfer status */
int msgs_left; /* how many messages are left */ int msgs_left; /* how many messages are left */
int running; int running = 0;
int handlenum = 0; int handlenum = 0;
struct timeval last_handle_add; struct timeval last_handle_add;


Expand Down
2 changes: 1 addition & 1 deletion tests/libtest/lib1905.c
Expand Up @@ -55,7 +55,7 @@ int test(char *URL)


unfinished = 1; unfinished = 1;
while(unfinished) { while(unfinished) {
int MAX; int MAX = 0;
long max_tout; long max_tout;
fd_set R, W, E; fd_set R, W, E;
struct timeval timeout; struct timeval timeout;
Expand Down
4 changes: 2 additions & 2 deletions tests/libtest/lib556.c
Expand Up @@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
Expand Down Expand Up @@ -70,7 +70,7 @@ int test(char *URL)
"GET /556 HTTP/1.2\r\n" "GET /556 HTTP/1.2\r\n"
"Host: ninja\r\n\r\n"; "Host: ninja\r\n\r\n";
#endif #endif
size_t iolen; size_t iolen = 0;


res = curl_easy_send(curl, request, strlen(request), &iolen); res = curl_easy_send(curl, request, strlen(request), &iolen);


Expand Down
4 changes: 2 additions & 2 deletions tests/unit/unit1650.c
Expand Up @@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 2018, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 2018 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
Expand Down Expand Up @@ -152,7 +152,7 @@ static struct dohresp resp[] = {


UNITTEST_START UNITTEST_START
{ {
size_t size; size_t size = 0;
unsigned char buffer[256]; unsigned char buffer[256];
size_t i; size_t i;
unsigned char *p; unsigned char *p;
Expand Down

0 comments on commit a4cc978

Please sign in to comment.