diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-04-19 10:46:11 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-04-22 09:10:17 +0200 |
commit | 063d3f3b96e40b3bf770d04d90612064b9a53c49 (patch) | |
tree | df0a46b661da2352d190a24e4c829ac6052c2a14 /tests/libtest | |
parent | 19ea52da4df3c3ebc399ae25e705c7a8b5d45d95 (diff) | |
download | curl-063d3f3b96e40b3bf770d04d90612064b9a53c49.tar.gz |
tidy-up: make conditional checks more consistent
... remove '== NULL' and '!= 0'
Closes #6912
Diffstat (limited to 'tests/libtest')
-rw-r--r-- | tests/libtest/lib1511.c | 4 | ||||
-rw-r--r-- | tests/libtest/lib1532.c | 4 | ||||
-rw-r--r-- | tests/libtest/lib1533.c | 4 | ||||
-rw-r--r-- | tests/libtest/lib1535.c | 8 | ||||
-rw-r--r-- | tests/libtest/lib1536.c | 6 | ||||
-rw-r--r-- | tests/libtest/lib510.c | 4 | ||||
-rw-r--r-- | tests/libtest/lib518.c | 4 | ||||
-rw-r--r-- | tests/libtest/lib537.c | 4 | ||||
-rw-r--r-- | tests/libtest/lib539.c | 6 | ||||
-rw-r--r-- | tests/libtest/lib556.c | 4 | ||||
-rw-r--r-- | tests/libtest/lib568.c | 4 | ||||
-rw-r--r-- | tests/libtest/lib569.c | 4 | ||||
-rw-r--r-- | tests/libtest/lib571.c | 4 | ||||
-rw-r--r-- | tests/libtest/lib572.c | 4 | ||||
-rw-r--r-- | tests/libtest/lib579.c | 4 | ||||
-rw-r--r-- | tests/libtest/lib661.c | 4 |
16 files changed, 36 insertions, 36 deletions
diff --git a/tests/libtest/lib1511.c b/tests/libtest/lib1511.c index a813f8968..82cb62974 100644 --- a/tests/libtest/lib1511.c +++ b/tests/libtest/lib1511.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -58,7 +58,7 @@ int test(char *URL) goto test_cleanup; curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &unmet); - if(unmet != 0L) { + if(unmet) { res = TEST_ERR_FAILURE; /* not correct */ goto test_cleanup; } diff --git a/tests/libtest/lib1532.c b/tests/libtest/lib1532.c index c937d2b23..395732122 100644 --- a/tests/libtest/lib1532.c +++ b/tests/libtest/lib1532.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -66,7 +66,7 @@ int test(char *URL) __FILE__, __LINE__, res, curl_easy_strerror(res)); goto test_cleanup; } - if(httpcode != 0) { + if(httpcode) { fprintf(stderr, "%s:%d curl_easy_reset failed to zero the response code\n" "possible regression of github bug 1017\n", __FILE__, __LINE__); res = CURLE_HTTP_RETURNED_ERROR; diff --git a/tests/libtest/lib1533.c b/tests/libtest/lib1533.c index e7bd0abc5..7d978b154 100644 --- a/tests/libtest/lib1533.c +++ b/tests/libtest/lib1533.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -137,7 +137,7 @@ int test(char *URL) } curl = curl_easy_init(); - if(curl == NULL) { + if(!curl) { fprintf(stderr, "curl_easy_init() failed\n"); curl_global_cleanup(); return TEST_ERR_MAJOR_BAD; diff --git a/tests/libtest/lib1535.c b/tests/libtest/lib1535.c index eb0fa361b..2a64242eb 100644 --- a/tests/libtest/lib1535.c +++ b/tests/libtest/lib1535.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -44,7 +44,7 @@ int test(char *URL) __FILE__, __LINE__, res, curl_easy_strerror(res)); goto test_cleanup; } - if(protocol != 0) { + if(protocol) { fprintf(stderr, "%s:%d protocol init failed; expected 0 but is %ld\n", __FILE__, __LINE__, protocol); res = CURLE_FAILED_INIT; @@ -94,7 +94,7 @@ int test(char *URL) __FILE__, __LINE__, res, curl_easy_strerror(res)); goto test_cleanup; } - if(protocol != 0) { + if(protocol) { fprintf(stderr, "%s:%d protocol init failed; expected 0 but is %ld\n", __FILE__, __LINE__, protocol); res = CURLE_FAILED_INIT; @@ -113,7 +113,7 @@ int test(char *URL) __FILE__, __LINE__, res, curl_easy_strerror(res)); goto test_cleanup; } - if(protocol != 0) { + if(protocol) { fprintf(stderr, "%s:%d protocol init failed; expected 0 but is %ld\n", __FILE__, __LINE__, protocol); res = CURLE_FAILED_INIT; diff --git a/tests/libtest/lib1536.c b/tests/libtest/lib1536.c index 2396ed9a9..b047c9d76 100644 --- a/tests/libtest/lib1536.c +++ b/tests/libtest/lib1536.c @@ -69,7 +69,7 @@ int test(char *URL) __FILE__, __LINE__, res, curl_easy_strerror(res)); goto test_cleanup; } - if(scheme == NULL || memcmp(scheme, "HTTP", 5) != 0) { + if(!scheme || memcmp(scheme, "HTTP", 5) != 0) { fprintf(stderr, "%s:%d scheme of http resource is incorrect; " "expected 'HTTP' but is %s\n", __FILE__, __LINE__, @@ -95,7 +95,7 @@ int test(char *URL) __FILE__, __LINE__, res, curl_easy_strerror(res)); goto test_cleanup; } - if(scheme != 0) { + if(scheme) { fprintf(stderr, "%s:%d scheme init failed; expected NULL\n", __FILE__, __LINE__); res = CURLE_FAILED_INIT; @@ -114,7 +114,7 @@ int test(char *URL) __FILE__, __LINE__, res, curl_easy_strerror(res)); goto test_cleanup; } - if(scheme != 0) { + if(scheme) { fprintf(stderr, "%s:%d scheme init failed; expected NULL\n", __FILE__, __LINE__); res = CURLE_FAILED_INIT; diff --git a/tests/libtest/lib510.c b/tests/libtest/lib510.c index 21919b101..b3dd0ab84 100644 --- a/tests/libtest/lib510.c +++ b/tests/libtest/lib510.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -80,7 +80,7 @@ int test(char *URL) } slist = curl_slist_append(slist, "Transfer-Encoding: chunked"); - if(slist == NULL) { + if(!slist) { fprintf(stderr, "curl_slist_append() failed\n"); curl_easy_cleanup(curl); curl_global_cleanup(); diff --git a/tests/libtest/lib518.c b/tests/libtest/lib518.c index 697aa8892..71b7dc2be 100644 --- a/tests/libtest/lib518.c +++ b/tests/libtest/lib518.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -83,7 +83,7 @@ static int fopen_works(void) } for(i = 0; i < 3; i++) { fpa[i] = fopen(DEV_NULL, FOPEN_READTEXT); - if(fpa[i] == NULL) { + if(!fpa[i]) { store_errmsg("fopen failed", errno); fprintf(stderr, "%s\n", msgbuff); ret = 0; diff --git a/tests/libtest/lib537.c b/tests/libtest/lib537.c index a590786cb..730278521 100644 --- a/tests/libtest/lib537.c +++ b/tests/libtest/lib537.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -84,7 +84,7 @@ static int fopen_works(void) } for(i = 0; i < 3; i++) { fpa[i] = fopen(DEV_NULL, FOPEN_READTEXT); - if(fpa[i] == NULL) { + if(!fpa[i]) { store_errmsg("fopen failed", errno); fprintf(stderr, "%s\n", msgbuff); ret = 0; diff --git a/tests/libtest/lib539.c b/tests/libtest/lib539.c index cd65e587e..0b2e97f4e 100644 --- a/tests/libtest/lib539.c +++ b/tests/libtest/lib539.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -60,14 +60,14 @@ int test(char *URL) * call to freedirs). */ newURL = aprintf("%s./", URL); - if(newURL == NULL) { + if(!newURL) { curl_easy_cleanup(curl); curl_global_cleanup(); return TEST_ERR_MAJOR_BAD; } slist = curl_slist_append(NULL, "SYST"); - if(slist == NULL) { + if(!slist) { free(newURL); curl_easy_cleanup(curl); curl_global_cleanup(); diff --git a/tests/libtest/lib556.c b/tests/libtest/lib556.c index 85988e226..3a9a7955c 100644 --- a/tests/libtest/lib556.c +++ b/tests/libtest/lib556.c @@ -92,10 +92,10 @@ int test(char *URL) break; } - } while((res == CURLE_OK && iolen != 0) || (res == CURLE_AGAIN)); + } while((res == CURLE_OK && iolen) || (res == CURLE_AGAIN)); } - if(iolen != 0) + if(iolen) res = (CURLcode)TEST_ERR_FAILURE; } diff --git a/tests/libtest/lib568.c b/tests/libtest/lib568.c index e74babed6..59e9dec24 100644 --- a/tests/libtest/lib568.c +++ b/tests/libtest/lib568.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -81,7 +81,7 @@ int test(char *URL) close(sdp); sdpf = fopen("log/file568.txt", "rb"); - if(sdpf == NULL) { + if(!sdpf) { fprintf(stderr, "can't open log/file568.txt\n"); res = TEST_ERR_MAJOR_BAD; goto test_cleanup; diff --git a/tests/libtest/lib569.c b/tests/libtest/lib569.c index 1fcfe9d50..e5605d3eb 100644 --- a/tests/libtest/lib569.c +++ b/tests/libtest/lib569.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -41,7 +41,7 @@ int test(char *URL) int i; FILE *idfile = fopen(libtest_arg2, "wb"); - if(idfile == NULL) { + if(!idfile) { fprintf(stderr, "couldn't open the Session ID File\n"); return TEST_ERR_MAJOR_BAD; } diff --git a/tests/libtest/lib571.c b/tests/libtest/lib571.c index 91c3e7d3d..ec9dce9fa 100644 --- a/tests/libtest/lib571.c +++ b/tests/libtest/lib571.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -106,7 +106,7 @@ int test(char *URL) int request = 1; FILE *protofile = fopen(libtest_arg2, "wb"); - if(protofile == NULL) { + if(!protofile) { fprintf(stderr, "Couldn't open the protocol dump file\n"); return TEST_ERR_MAJOR_BAD; } diff --git a/tests/libtest/lib572.c b/tests/libtest/lib572.c index dc7047848..a9cf34133 100644 --- a/tests/libtest/lib572.c +++ b/tests/libtest/lib572.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -100,7 +100,7 @@ int test(char *URL) close(params); paramsf = fopen("log/file572.txt", "rb"); - if(paramsf == NULL) { + if(!paramsf) { fprintf(stderr, "can't open log/file572.txt\n"); res = TEST_ERR_MAJOR_BAD; goto test_cleanup; diff --git a/tests/libtest/lib579.c b/tests/libtest/lib579.c index d06138d85..46894fa9a 100644 --- a/tests/libtest/lib579.c +++ b/tests/libtest/lib579.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -104,7 +104,7 @@ int test(char *URL) } slist = curl_slist_append(slist, "Transfer-Encoding: chunked"); - if(slist == NULL) { + if(!slist) { fprintf(stderr, "curl_slist_append() failed\n"); curl_easy_cleanup(curl); curl_global_cleanup(); diff --git a/tests/libtest/lib661.c b/tests/libtest/lib661.c index 16eaa0c11..7d2b69c0c 100644 --- a/tests/libtest/lib661.c +++ b/tests/libtest/lib661.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -97,7 +97,7 @@ int test(char *URL) } slist = curl_slist_append(NULL, "SYST"); - if(slist == NULL) { + if(!slist) { fprintf(stderr, "curl_slist_append() failed\n"); res = TEST_ERR_MAJOR_BAD; goto test_cleanup; |