aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest/lib572.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-12-14 01:29:44 +0100
committerDaniel Stenberg <daniel@haxx.se>2016-12-14 01:29:44 +0100
commit1c3e8bbfedcd3822aeb1bab22fb56c5ecff4295b (patch)
treec1606588aeae4535f0faa7942fcbe50e6e340f8b /tests/libtest/lib572.c
parentb228d2952b6762b5c9b851fba0cf391e80c6761a (diff)
checksrc: warn for assignments within if() expressions
... they're already frowned upon in our source code style guide, this now enforces the rule harder.
Diffstat (limited to 'tests/libtest/lib572.c')
-rw-r--r--tests/libtest/lib572.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/libtest/lib572.c b/tests/libtest/lib572.c
index 3475e8060..47a9da535 100644
--- a/tests/libtest/lib572.c
+++ b/tests/libtest/lib572.c
@@ -55,7 +55,8 @@ int test(char *URL)
return TEST_ERR_MAJOR_BAD;
}
- if((curl = curl_easy_init()) == NULL) {
+ curl = curl_easy_init();
+ if(!curl) {
fprintf(stderr, "curl_easy_init() failed\n");
curl_global_cleanup();
return TEST_ERR_MAJOR_BAD;
@@ -69,7 +70,8 @@ int test(char *URL)
test_setopt(curl, CURLOPT_URL, URL);
/* SETUP */
- if((stream_uri = suburl(URL, request++)) == NULL) {
+ stream_uri = suburl(URL, request++);
+ if(!stream_uri) {
res = TEST_ERR_MAJOR_BAD;
goto test_cleanup;
}
@@ -83,7 +85,8 @@ int test(char *URL)
if(res)
goto test_cleanup;
- if((stream_uri = suburl(URL, request++)) == NULL) {
+ stream_uri = suburl(URL, request++);
+ if(!stream_uri) {
res = TEST_ERR_MAJOR_BAD;
goto test_cleanup;
}
@@ -117,7 +120,8 @@ int test(char *URL)
paramsf = NULL;
/* Heartbeat GET_PARAMETERS */
- if((stream_uri = suburl(URL, request++)) == NULL) {
+ stream_uri = suburl(URL, request++);
+ if(!stream_uri) {
res = TEST_ERR_MAJOR_BAD;
goto test_cleanup;
}
@@ -131,7 +135,8 @@ int test(char *URL)
/* POST GET_PARAMETERS */
- if((stream_uri = suburl(URL, request++)) == NULL) {
+ stream_uri = suburl(URL, request++);
+ if(!stream_uri) {
res = TEST_ERR_MAJOR_BAD;
goto test_cleanup;
}
@@ -149,7 +154,8 @@ int test(char *URL)
test_setopt(curl, CURLOPT_POSTFIELDS, NULL);
/* Make sure we can do a normal request now */
- if((stream_uri = suburl(URL, request++)) == NULL) {
+ stream_uri = suburl(URL, request++);
+ if(!stream_uri) {
res = TEST_ERR_MAJOR_BAD;
goto test_cleanup;
}