tests: rename more CURLcode variables to result

For consistency.

Also:
- one remaining in `src/tool_writeout.c`.
- replace casting an `int` to `CURLcode`.
- lib758: rename `CURLMcode` `result` to `mresult`.
- move literals to the right side of if expressions.

Follow-up to d0dc6e2ec0 #20426
Follow-up to 56f600ec23

Closes #20432
This commit is contained in:
Viktor Szakats 2026-01-25 18:12:40 +01:00
parent 26c39d8df1
commit 2da1bbca96
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
33 changed files with 307 additions and 303 deletions

View file

@ -42,7 +42,7 @@ static CURLcode test_lib3026(const char *URL)
CURLcode results[NUM_THREADS];
HANDLE thread_handles[NUM_THREADS];
unsigned tid_count = NUM_THREADS, i;
CURLcode test_failure = CURLE_OK;
CURLcode result = CURLE_OK;
curl_version_info_data *ver;
(void)URL;
@ -63,7 +63,7 @@ static CURLcode test_lib3026(const char *URL)
"GetLastError 0x%08lx\n",
__FILE__, __LINE__, GetLastError());
tid_count = i;
test_failure = TEST_ERR_MAJOR_BAD;
result = TEST_ERR_MAJOR_BAD;
goto cleanup;
}
thread_handles[i] = th;
@ -77,11 +77,11 @@ cleanup:
curl_mfprintf(stderr, "%s:%d thread[%u]: curl_global_init() failed,"
"with code %d (%s)\n", __FILE__, __LINE__,
i, results[i], curl_easy_strerror(results[i]));
test_failure = TEST_ERR_MAJOR_BAD;
result = TEST_ERR_MAJOR_BAD;
}
}
return test_failure;
return result;
}
#elif defined(HAVE_PTHREAD_H)
@ -103,7 +103,7 @@ static CURLcode test_lib3026(const char *URL)
CURLcode results[NUM_THREADS];
pthread_t tids[NUM_THREADS];
unsigned tid_count = NUM_THREADS, i;
CURLcode test_failure = CURLE_OK;
CURLcode result = CURLE_OK;
curl_version_info_data *ver;
(void)URL;
@ -123,7 +123,7 @@ static CURLcode test_lib3026(const char *URL)
curl_mfprintf(stderr, "%s:%d Could not create thread, errno %d\n",
__FILE__, __LINE__, res);
tid_count = i;
test_failure = TEST_ERR_MAJOR_BAD;
result = TEST_ERR_MAJOR_BAD;
goto cleanup;
}
}
@ -135,11 +135,11 @@ cleanup:
curl_mfprintf(stderr, "%s:%d thread[%u]: curl_global_init() failed,"
"with code %d (%s)\n", __FILE__, __LINE__,
i, results[i], curl_easy_strerror(results[i]));
test_failure = TEST_ERR_MAJOR_BAD;
result = TEST_ERR_MAJOR_BAD;
}
}
return test_failure;
return result;
}
#else /* without pthread or Windows, this test does not work */