mirror of
https://github.com/curl/curl.git
synced 2026-08-25 08:53:36 +03:00
tests: make the unit test result type CURLcode
Before this patch, the result code was a mixture of `int` and `CURLcode`. Also adjust casts and fix a couple of minor issues found along the way. Cherry-picked from #13489 Closes #13600
This commit is contained in:
parent
dad03dc593
commit
25cbc2f79a
221 changed files with 619 additions and 616 deletions
|
|
@ -44,7 +44,8 @@ static size_t print_httppost_callback(void *arg, const char *buf, size_t len)
|
|||
}
|
||||
|
||||
UNITTEST_START
|
||||
int rc;
|
||||
CURLFORMcode rc;
|
||||
int res;
|
||||
struct curl_httppost *post = NULL;
|
||||
struct curl_httppost *last = NULL;
|
||||
size_t total_size = 0;
|
||||
|
|
@ -70,9 +71,9 @@ UNITTEST_START
|
|||
|
||||
fail_unless(rc == 0, "curl_formadd returned error");
|
||||
|
||||
rc = curl_formget(post, &total_size, print_httppost_callback);
|
||||
res = curl_formget(post, &total_size, print_httppost_callback);
|
||||
|
||||
fail_unless(rc == 0, "curl_formget returned error");
|
||||
fail_unless(res == 0, "curl_formget returned error");
|
||||
|
||||
fail_unless(total_size == 518, "curl_formget got wrong size back");
|
||||
|
||||
|
|
@ -89,8 +90,8 @@ UNITTEST_START
|
|||
|
||||
fail_unless(rc == 0, "curl_formadd returned error");
|
||||
|
||||
rc = curl_formget(post, &total_size, print_httppost_callback);
|
||||
fail_unless(rc == 0, "curl_formget returned error");
|
||||
res = curl_formget(post, &total_size, print_httppost_callback);
|
||||
fail_unless(res == 0, "curl_formget returned error");
|
||||
fail_unless(total_size == 899, "curl_formget got wrong size back");
|
||||
|
||||
curl_formfree(post);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue