mirror of
https://github.com/curl/curl.git
synced 2026-07-31 19:48:03 +03:00
tests: rename CURLMcode variables to mresult
This commit is contained in:
parent
0a26e3a660
commit
56f600ec23
255 changed files with 1771 additions and 1772 deletions
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
static CURLcode t1303_setup(struct Curl_easy **easy)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
*easy = curl_easy_init();
|
||||
|
|
@ -36,7 +36,7 @@ static CURLcode t1303_setup(struct Curl_easy **easy)
|
|||
curl_global_cleanup();
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
||||
static void t1303_stop(struct Curl_easy *easy)
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@
|
|||
|
||||
static CURLcode t1396_setup(void)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
||||
static void t1396_stop(CURL *easy)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
static CURLcode t1600_setup(CURL **easy)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
*easy = curl_easy_init();
|
||||
|
|
@ -36,7 +36,7 @@ static CURLcode t1600_setup(CURL **easy)
|
|||
curl_global_cleanup();
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
||||
static void t1600_stop(CURL *easy)
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
static CURLcode t1605_setup(CURL **easy)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
*easy = curl_easy_init();
|
||||
|
|
@ -35,7 +35,7 @@ static CURLcode t1605_setup(CURL **easy)
|
|||
curl_global_cleanup();
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
||||
static void t1605_stop(CURL *easy)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
static CURLcode t1606_setup(struct Curl_easy **easy)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
*easy = curl_easy_init();
|
||||
|
|
@ -36,7 +36,7 @@ static CURLcode t1606_setup(struct Curl_easy **easy)
|
|||
curl_global_cleanup();
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
||||
static void t1606_stop(struct Curl_easy *easy)
|
||||
|
|
@ -53,7 +53,7 @@ static int runawhile(struct Curl_easy *easy,
|
|||
{
|
||||
int counter = 1;
|
||||
struct curltime now = { 1, 0 };
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
int finaltime;
|
||||
|
||||
curl_easy_setopt(easy, CURLOPT_LOW_SPEED_LIMIT, speed_limit);
|
||||
|
|
@ -63,8 +63,8 @@ static int runawhile(struct Curl_easy *easy,
|
|||
do {
|
||||
/* fake the current transfer speed */
|
||||
easy->progress.current_speed = speed;
|
||||
res = pgrs_speedcheck(easy, &now);
|
||||
if(res)
|
||||
result = pgrs_speedcheck(easy, &now);
|
||||
if(result)
|
||||
break;
|
||||
/* step the time */
|
||||
now.tv_sec = ++counter;
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@
|
|||
|
||||
static CURLcode t1607_setup(void)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
||||
static CURLcode test_unit1607(const char *arg)
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@
|
|||
|
||||
static CURLcode t1609_setup(void)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
||||
/* CURLOPT_RESOLVE address parsing test - to test the following defect fix:
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@
|
|||
|
||||
static CURLcode t1610_setup(void)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
||||
static CURLcode test_unit1610(const char *arg)
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@
|
|||
|
||||
static CURLcode t1620_setup(void)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
||||
static void t1620_parse(const char *input,
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ static int debugf_cb(CURL *handle, curl_infotype type, char *buf, size_t size,
|
|||
|
||||
static CURLcode t1652_setup(struct Curl_easy **easy)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
*easy = curl_easy_init();
|
||||
|
|
@ -64,7 +64,7 @@ static CURLcode t1652_setup(struct Curl_easy **easy)
|
|||
}
|
||||
curl_easy_setopt(*easy, CURLOPT_DEBUGFUNCTION, debugf_cb);
|
||||
curl_easy_setopt(*easy, CURLOPT_VERBOSE, 1L);
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
||||
static void t1652_stop(struct Curl_easy *easy)
|
||||
|
|
|
|||
|
|
@ -502,7 +502,7 @@ static CURLcode test_unit1658(const char *arg)
|
|||
}
|
||||
};
|
||||
|
||||
CURLcode res = CURLE_OUT_OF_MEMORY;
|
||||
CURLcode result = CURLE_OUT_OF_MEMORY;
|
||||
CURL *easy;
|
||||
|
||||
easy = curl_easy_init();
|
||||
|
|
@ -516,10 +516,10 @@ static CURLcode test_unit1658(const char *arg)
|
|||
|
||||
curl_mprintf("test %u: %s\n", i, t[i].name);
|
||||
|
||||
res = doh_resp_decode_httpsrr(easy, t[i].dns, t[i].len, &hrr);
|
||||
result = doh_resp_decode_httpsrr(easy, t[i].dns, t[i].len, &hrr);
|
||||
|
||||
/* create an output */
|
||||
rrresults(hrr, res);
|
||||
rrresults(hrr, result);
|
||||
|
||||
/* is the output the expected? */
|
||||
if(strcmp(rrbuffer, t[i].expect)) {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ static CURLcode test_unit1661(const char *arg)
|
|||
UNITTEST_BEGIN(t1661_setup(&bufref))
|
||||
|
||||
const char *buffer = NULL;
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
/**
|
||||
* testing Curl_bufref_init.
|
||||
|
|
@ -89,8 +89,8 @@ static CURLcode test_unit1661(const char *arg)
|
|||
/**
|
||||
* testing Curl_bufref_memdup0
|
||||
*/
|
||||
res = Curl_bufref_memdup0(&bufref, "1661", 3);
|
||||
abort_unless(res == CURLE_OK, curl_easy_strerror(res));
|
||||
result = Curl_bufref_memdup0(&bufref, "1661", 3);
|
||||
abort_unless(result == CURLE_OK, curl_easy_strerror(result));
|
||||
fail_unless(freecount == 1, "Destructor not called");
|
||||
fail_unless((const char *)bufref.ptr != buffer, "Returned pointer not set");
|
||||
buffer = (const char *)Curl_bufref_ptr(&bufref);
|
||||
|
|
|
|||
|
|
@ -34,9 +34,9 @@
|
|||
|
||||
static CURLcode t1663_setup(void)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
||||
static void t1663_parse(const char *input_data,
|
||||
|
|
|
|||
|
|
@ -32,9 +32,9 @@
|
|||
|
||||
static CURLcode t1664_setup(void)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
||||
static CURLcode test_unit1664(const char *arg)
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
static CURLcode t2600_setup(CURL **easy)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
*easy = curl_easy_init();
|
||||
|
|
@ -60,7 +60,7 @@ static CURLcode t2600_setup(CURL **easy)
|
|||
}
|
||||
curl_global_trace("all");
|
||||
curl_easy_setopt(*easy, CURLOPT_VERBOSE, 1L);
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
||||
static void t2600_stop(CURL *easy)
|
||||
|
|
@ -95,7 +95,7 @@ struct ai_family_stats {
|
|||
};
|
||||
|
||||
struct test_result {
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
struct curltime started;
|
||||
struct curltime ended;
|
||||
struct ai_family_stats cf4;
|
||||
|
|
@ -188,13 +188,13 @@ static CURLcode cf_test_create(struct Curl_cfilter **pcf,
|
|||
struct cf_test_ctx *ctx = NULL;
|
||||
struct Curl_cfilter *cf = NULL;
|
||||
timediff_t created_at;
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
|
||||
(void)data;
|
||||
(void)conn;
|
||||
ctx = curlx_calloc(1, sizeof(*ctx));
|
||||
if(!ctx) {
|
||||
res = CURLE_OUT_OF_MEMORY;
|
||||
result = CURLE_OUT_OF_MEMORY;
|
||||
goto out;
|
||||
}
|
||||
ctx->idx = test_idx++;
|
||||
|
|
@ -223,19 +223,19 @@ static CURLcode cf_test_create(struct Curl_cfilter **pcf,
|
|||
ctx->stats->last_created = created_at;
|
||||
infof(data, "%04dms: cf[%s] created", (int)created_at, ctx->id);
|
||||
|
||||
res = Curl_cf_create(&cf, &cft_test, ctx);
|
||||
if(res)
|
||||
result = Curl_cf_create(&cf, &cft_test, ctx);
|
||||
if(result)
|
||||
goto out;
|
||||
|
||||
Curl_expire(data, ctx->fail_delay_ms, EXPIRE_TIMEOUT);
|
||||
|
||||
out:
|
||||
*pcf = (!res) ? cf : NULL;
|
||||
if(res) {
|
||||
*pcf = (!result) ? cf : NULL;
|
||||
if(result) {
|
||||
curlx_free(cf);
|
||||
curlx_free(ctx);
|
||||
}
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
||||
static void check_result(const struct test_case *tc, struct test_result *tr)
|
||||
|
|
@ -246,11 +246,11 @@ static void check_result(const struct test_case *tc, struct test_result *tr)
|
|||
duration_ms = curlx_timediff_ms(tr->ended, tr->started);
|
||||
curl_mfprintf(stderr, "%d: test case took %dms\n", tc->id, (int)duration_ms);
|
||||
|
||||
if(tr->res != tc->exp_res && CURLE_OPERATION_TIMEDOUT != tr->res) {
|
||||
if(tr->result != tc->exp_res && CURLE_OPERATION_TIMEDOUT != tr->result) {
|
||||
/* on CI we encounter the TIMEOUT result, since images get less CPU
|
||||
* and events are not as sharply timed. */
|
||||
curl_msprintf(msg, "%d: expected result %d but got %d",
|
||||
tc->id, tc->exp_res, tr->res);
|
||||
tc->id, tc->exp_res, tr->result);
|
||||
fail(msg);
|
||||
}
|
||||
if(tr->cf4.creations != tc->exp_cf4_creations) {
|
||||
|
|
@ -323,7 +323,7 @@ static void test_connect(CURL *easy, const struct test_case *tc)
|
|||
tr.cf4.family = "v4";
|
||||
|
||||
tr.started = curlx_now();
|
||||
tr.res = curl_easy_perform(easy);
|
||||
tr.result = curl_easy_perform(easy);
|
||||
tr.ended = curlx_now();
|
||||
|
||||
curl_easy_setopt(easy, CURLOPT_RESOLVE, NULL);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ static CURLcode test_unit2604(const char *arg)
|
|||
const char *expect; /* the returned content */
|
||||
const char *next; /* what cp points to after the call */
|
||||
const char *home;
|
||||
CURLcode res;
|
||||
CURLcode result;
|
||||
};
|
||||
|
||||
#if defined(CURL_GNUC_DIAG) || defined(__clang__)
|
||||
|
|
@ -85,14 +85,14 @@ static CURLcode test_unit2604(const char *arg)
|
|||
for(i = 0; list[i].home; i++) {
|
||||
char *path;
|
||||
const char *cp = i == 0 ? cp0 : list[i].cp;
|
||||
CURLcode res = Curl_get_pathname(&cp, &path, list[i].home);
|
||||
CURLcode result = Curl_get_pathname(&cp, &path, list[i].home);
|
||||
curl_mprintf("%u - Curl_get_pathname(\"%s\", ... \"%s\") == %u\n", i,
|
||||
list[i].cp, list[i].home, list[i].res);
|
||||
if(res != list[i].res) {
|
||||
curl_mprintf("... returned %d\n", res);
|
||||
list[i].cp, list[i].home, list[i].result);
|
||||
if(result != list[i].result) {
|
||||
curl_mprintf("... returned %d\n", result);
|
||||
unitfail++;
|
||||
}
|
||||
if(!res) {
|
||||
if(!result) {
|
||||
if(cp && strcmp(cp, list[i].next)) {
|
||||
curl_mprintf("... cp points to '%s', not '%s' as expected \n",
|
||||
cp, list[i].next);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue