units: tidy up begin/end blocks

- use `UNITTEST_BEGIN_SIMPLE`/`UNITTEST_END_SIMPLE` where missing.
- drop redundant `(void)arg;` where using `UNITTEST_BEGIN*`.
- unit1636: drop redundant block after `UNITTEST_BEGIN*`.
- unit1609: fix typo in comment.
- unit1627: merge to `if`s.

Closes #21715
This commit is contained in:
Viktor Szakats 2026-05-21 04:21:33 +02:00
parent a076f821e1
commit bb5500a752
No known key found for this signature in database
8 changed files with 56 additions and 61 deletions

View file

@ -28,6 +28,8 @@
static CURLcode test_unit1627(const char *arg)
{
UNITTEST_BEGIN_SIMPLE
size_t i, j;
/* existing schemes in different cases */
static const char *okay[] = {
@ -65,8 +67,6 @@ static CURLcode test_unit1627(const char *arg)
"GhJk", "LzXc", "VbNm"
};
(void)arg;
for(i = 0; i < CURL_ARRAYSIZE(okay); i++) {
char buffer[32];
const struct Curl_scheme *get = Curl_get_scheme(okay[i]);
@ -96,10 +96,9 @@ static CURLcode test_unit1627(const char *arg)
curl_mprintf("%zu invokes\n", i + j);
if(i != CURL_ARRAYSIZE(okay))
return CURLE_FAILED_INIT;
if(j != CURL_ARRAYSIZE(notokay))
if(i != CURL_ARRAYSIZE(okay) ||
j != CURL_ARRAYSIZE(notokay))
return CURLE_FAILED_INIT;
return CURLE_OK;
UNITTEST_END_SIMPLE
}