tidy-up: drop redundant == NULL syntax

Where missed by checksrc.

Closes #21935
This commit is contained in:
Viktor Szakats 2026-06-09 14:18:02 +02:00
parent 59213abfb2
commit 014be82a66
No known key found for this signature in database
19 changed files with 39 additions and 41 deletions

View file

@ -55,8 +55,8 @@ For the actual C file, here's a simple example:
/* here you start doing things and checking that the results are good */
fail_unless( size == 0 , "initial size should be zero" );
fail_if( head == NULL , "head should not be initiated to NULL" );
fail_unless(size == 0, "initial size should be zero");
fail_if(!head, "head should not be initiated to NULL");
/* you end the test code like this: */
@ -87,8 +87,8 @@ Here's an example using optional initialization and cleanup:
/* here you start doing things and checking that the results are good */
fail_unless( size == 0 , "initial size should be zero" );
fail_if( head == NULL , "head should not be initiated to NULL" );
fail_unless(size == 0, "initial size should be zero");
fail_if(!head, "head should not be initiated to NULL");
/* you end the test code like this: */

View file

@ -67,9 +67,9 @@ static CURLcode test_unit1300(const char *arg)
fail_unless(Curl_llist_count(&llist) == 0,
"list initial size should be zero");
fail_unless(Curl_llist_head(&llist) == NULL,
fail_unless(!Curl_llist_head(&llist),
"list head should initiate to NULL");
fail_unless(llist_tail(&llist) == NULL,
fail_unless(!llist_tail(&llist),
"list tail should initiate to NULL");
/**
@ -152,7 +152,7 @@ static CURLcode test_unit1300(const char *arg)
fail_unless(Curl_llist_head(&llist) == element_next,
"llist new head not modified properly");
abort_unless(Curl_llist_head(&llist), "llist.head is NULL");
fail_unless(llist_node_prev(Curl_llist_head(&llist)) == NULL,
fail_unless(!llist_node_prev(Curl_llist_head(&llist)),
"new head previous not set to null");
/**
@ -208,9 +208,9 @@ static CURLcode test_unit1300(const char *arg)
to_remove = Curl_llist_head(&llist);
Curl_node_remove(to_remove);
fail_unless(Curl_llist_head(&llist) == NULL,
fail_unless(!Curl_llist_head(&llist),
"llist head is not NULL while the llist is empty");
fail_unless(llist_tail(&llist) == NULL,
fail_unless(!llist_tail(&llist),
"llist tail is not NULL while the llist is empty");
/**

View file

@ -71,7 +71,7 @@ static CURLcode test_unit1304(const char *arg)
Curl_netrc_init(&store);
res = Curl_netrc_scan(data, &store, "test.example.com", NULL, arg, &cr_out);
fail_unless(res == NETRC_NO_MATCH, "expected no match");
fail_unless(cr_out == NULL, "creds did not return NULL!");
fail_unless(!cr_out, "creds did not return NULL!");
Curl_netrc_cleanup(&store);
/*

View file

@ -97,7 +97,7 @@ static CURLcode test_unit1309(const char *arg)
}
}
fail_unless(root == NULL, "tree not empty after removing all nodes");
fail_unless(!root, "tree not empty after removing all nodes");
/* rebuild tree */
for(i = 0; i < NUM_NODES; i++) {
@ -127,7 +127,7 @@ static CURLcode test_unit1309(const char *arg)
}
}
fail_unless(root == NULL, "tree not empty when it should be");
fail_unless(!root, "tree not empty when it should be");
UNITTEST_END_SIMPLE
}

View file

@ -53,10 +53,10 @@ static CURLcode test_unit1605(const char *arg)
char *esc;
esc = curl_easy_escape(easy, "", -1);
fail_unless(esc == NULL, "negative string length cannot work");
fail_unless(!esc, "negative string length cannot work");
esc = curl_easy_unescape(easy, "%41%41%41%41", -1, &len);
fail_unless(esc == NULL, "negative string length cannot work");
fail_unless(!esc, "negative string length cannot work");
UNITTEST_END(t1605_stop(easy))
}

View file

@ -127,7 +127,7 @@ static CURLcode test_unit1620(const char *arg)
Curl_freeset(empty);
for(i = (enum dupstring)0; i < STRING_LAST; i++) {
fail_unless(empty->set.str[i] == NULL, "Curl_free() did not set to NULL");
fail_unless(!empty->set.str[i], "Curl_free() did not set to NULL");
}
result = Curl_close(&dupe);

View file

@ -99,9 +99,9 @@ static void check_bufq(size_t pool_spares,
fail_unless(q.chunk_size == chunk_size, "chunk_size init wrong");
fail_unless(q.max_chunks == max_chunks, "max_chunks init wrong");
fail_unless(q.head == NULL, "init: head not NULL");
fail_unless(q.tail == NULL, "init: tail not NULL");
fail_unless(q.spare == NULL, "init: spare not NULL");
fail_unless(!q.head, "init: head not NULL");
fail_unless(!q.tail, "init: tail not NULL");
fail_unless(!q.spare, "init: spare not NULL");
fail_unless(Curl_bufq_len(&q) == 0, "init: bufq length != 0");
result = Curl_bufq_write(&q, test_data, wsize, &n2);