Skip to content

Commit

Permalink
tests: several enumerated type cleanups
Browse files Browse the repository at this point in the history
To please icc
  • Loading branch information
bagder committed Jul 22, 2022
1 parent bde2ca8 commit d7e9e92
Show file tree
Hide file tree
Showing 27 changed files with 47 additions and 47 deletions.
2 changes: 1 addition & 1 deletion tests/libtest/lib1523.c
Expand Up @@ -77,7 +77,7 @@ int test(char *URL)
if(ret != CURLE_OPERATION_TIMEDOUT)
fprintf(stderr, "error %d: %s\n", ret, buffer);
else
ret = 0;
ret = CURLE_OK;

printf("End: %d\n", time(NULL));
curl_easy_cleanup(hnd);
Expand Down
4 changes: 2 additions & 2 deletions tests/libtest/lib1532.c
Expand Up @@ -31,7 +31,7 @@ int test(char *URL)
{
CURL *curl;
long httpcode;
int res = CURLE_OK;
CURLcode res = CURLE_OK;

global_init(CURL_GLOBAL_ALL);

Expand Down Expand Up @@ -78,5 +78,5 @@ int test(char *URL)
test_cleanup:
curl_easy_cleanup(curl);
curl_global_cleanup();
return res;
return (int)res;
}
2 changes: 1 addition & 1 deletion tests/libtest/lib1533.c
Expand Up @@ -131,7 +131,7 @@ int test(char *URL)
{
struct cb_data data;
CURL *curl = NULL;
CURLcode res = CURLE_FAILED_INIT;
int res = TEST_ERR_FAILURE;

if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
fprintf(stderr, "curl_global_init() failed\n");
Expand Down
4 changes: 2 additions & 2 deletions tests/libtest/lib1534.c
Expand Up @@ -31,7 +31,7 @@ int test(char *URL)
{
CURL *curl, *dupe = NULL;
long filetime;
int res = CURLE_OK;
CURLcode res = CURLE_OK;

global_init(CURL_GLOBAL_ALL);

Expand Down Expand Up @@ -127,5 +127,5 @@ int test(char *URL)
curl_easy_cleanup(curl);
curl_easy_cleanup(dupe);
curl_global_cleanup();
return res;
return (int)res;
}
4 changes: 2 additions & 2 deletions tests/libtest/lib1535.c
Expand Up @@ -31,7 +31,7 @@ int test(char *URL)
{
CURL *curl, *dupe = NULL;
long protocol;
int res = CURLE_OK;
CURLcode res = CURLE_OK;

global_init(CURL_GLOBAL_ALL);

Expand Down Expand Up @@ -126,5 +126,5 @@ int test(char *URL)
curl_easy_cleanup(curl);
curl_easy_cleanup(dupe);
curl_global_cleanup();
return res;
return (int)res;
}
4 changes: 2 additions & 2 deletions tests/libtest/lib1536.c
Expand Up @@ -31,7 +31,7 @@ int test(char *URL)
{
CURL *curl, *dupe = NULL;
char *scheme;
int res = CURLE_OK;
CURLcode res = CURLE_OK;

global_init(CURL_GLOBAL_ALL);

Expand Down Expand Up @@ -127,5 +127,5 @@ int test(char *URL)
curl_easy_cleanup(curl);
curl_easy_cleanup(dupe);
curl_global_cleanup();
return res;
return (int)res;
}
2 changes: 1 addition & 1 deletion tests/libtest/lib1555.c
Expand Up @@ -37,7 +37,7 @@ static int progressCallback(void *arg,
double ultotal,
double ulnow)
{
CURLcode res = 0;
CURLcode res = CURLE_OK;
char buffer[256];
size_t n = 0;
(void)arg;
Expand Down
2 changes: 1 addition & 1 deletion tests/libtest/lib1558.c
Expand Up @@ -29,7 +29,7 @@

int test(char *URL)
{
CURLcode res = 0;
CURLcode res = CURLE_OK;
CURL *curl = NULL;
long protocol = 0;

Expand Down
2 changes: 1 addition & 1 deletion tests/libtest/lib1559.c
Expand Up @@ -30,7 +30,7 @@
#define EXCESSIVE 10*1000*1000
int test(char *URL)
{
CURLcode res = 0;
CURLcode res = CURLE_OK;
CURL *curl = NULL;
char *longurl = malloc(EXCESSIVE);
CURLU *u;
Expand Down
26 changes: 13 additions & 13 deletions tests/libtest/lib1560.c
Expand Up @@ -60,7 +60,7 @@ static int checkparts(CURLU *u, const char *in, const char *wanted,
{CURLUPART_PATH, "path"},
{CURLUPART_QUERY, "query"},
{CURLUPART_FRAGMENT, "fragment"},
{0, NULL}
{CURLUPART_URL, NULL}
};
memset(buf, 0, sizeof(buf));

Expand Down Expand Up @@ -558,7 +558,7 @@ static const struct urltestcase get_url_list[] = {
{"custom-scheme://host?expected=test-still-good",
"custom-scheme://host/?expected=test-still-good",
CURLU_NON_SUPPORT_SCHEME | CURLU_NO_AUTHORITY, 0, CURLUE_OK},
{NULL, NULL, 0, 0, 0}
{NULL, NULL, 0, 0, CURLUE_OK}
};

static int checkurl(const char *url, const char *out)
Expand Down Expand Up @@ -722,7 +722,7 @@ static const struct setcase set_parts_list[] = {
CURLU_NON_SUPPORT_SCHEME, CURLU_NON_SUPPORT_SCHEME | CURLU_NO_AUTHORITY,
CURLUE_OK, CURLUE_OK},

{NULL, NULL, NULL, 0, 0, 0, 0}
{NULL, NULL, NULL, 0, 0, CURLUE_OK, CURLUE_OK}
};

static CURLUPart part2id(char *part)
Expand Down Expand Up @@ -800,32 +800,32 @@ static const struct redircase set_url_list[] = {
{"http://example.org/static/favicon/wikipedia.ico",
"//fake.example.com/licenses/by-sa/3.0/",
"http://fake.example.com/licenses/by-sa/3.0/",
0, 0, 0},
0, 0, CURLUE_OK},
{"https://example.org/static/favicon/wikipedia.ico",
"//fake.example.com/licenses/by-sa/3.0/",
"https://fake.example.com/licenses/by-sa/3.0/",
0, 0, 0},
0, 0, CURLUE_OK},
{"file://localhost/path?query#frag",
"foo#another",
"file:///foo#another",
0, 0, 0},
0, 0, CURLUE_OK},
{"http://example.com/path?query#frag",
"https://two.example.com/bradnew",
"https://two.example.com/bradnew",
0, 0, 0},
0, 0, CURLUE_OK},
{"http://example.com/path?query#frag",
"../../newpage#foo",
"http://example.com/newpage#foo",
0, 0, 0},
0, 0, CURLUE_OK},
{"http://user:foo@example.com/path?query#frag",
"../../newpage",
"http://user:foo@example.com/newpage",
0, 0, 0},
0, 0, CURLUE_OK},
{"http://user:foo@example.com/path?query#frag",
"../newpage",
"http://user:foo@example.com/newpage",
0, 0, 0},
{NULL, NULL, NULL, 0, 0, 0}
0, 0, CURLUE_OK},
{NULL, NULL, NULL, 0, 0, CURLUE_OK}
};

static int set_url(void)
Expand Down Expand Up @@ -1012,7 +1012,7 @@ static const struct querycase append_list[] = {
0, 0, CURLUE_OK},
{"HTTP://test/?size=2#f", "name=joe", "http://test/?size=2&name=joe#f",
0, 0, CURLUE_OK},
{NULL, NULL, NULL, 0, 0, 0}
{NULL, NULL, NULL, 0, 0, CURLUE_OK}
};

static int append(void)
Expand Down Expand Up @@ -1253,7 +1253,7 @@ static const struct clearurlcase clear_url_list[] ={
{CURLUPART_PATH, "/hello", "/", CURLUE_OK},
{CURLUPART_QUERY, "a=b", NULL, CURLUE_NO_QUERY},
{CURLUPART_FRAGMENT, "anchor", NULL, CURLUE_NO_FRAGMENT},
{0, NULL, NULL, CURLUE_OK},
{CURLUPART_URL, NULL, NULL, CURLUE_OK},
};

static int clear_url(void)
Expand Down
2 changes: 1 addition & 1 deletion tests/libtest/lib1597.c
Expand Up @@ -58,7 +58,7 @@ int test(char *URL)
"POP3,POP3S,RTMP,RTMPE,RTMPS,RTMPT,RTMPTE,RTMPTS,RTSP,SCP,SFTP,SMB,"
"SMBS,SMTP,SMTPS,TELNET,TFTP", CURLE_OK},
{"all", CURLE_OK},
{NULL, FALSE},
{NULL, CURLE_OK},
};
(void)URL;

Expand Down
4 changes: 2 additions & 2 deletions tests/libtest/lib530.c
Expand Up @@ -249,15 +249,15 @@ static int checkFdSet(CURLM *curl,
int evBitmask, const char *name)
{
int i;
CURLMcode result = CURLM_OK;
int result = 0;
for(i = 0; i < sockets->count; ++i) {
if(FD_ISSET(sockets->sockets[i], fdset)) {
result = socket_action(curl, sockets->sockets[i], evBitmask, name);
if(result)
break;
}
}
return (int)result;
return result;
}

static int testone(char *URL, int timercb, int socketcb)
Expand Down
4 changes: 2 additions & 2 deletions tests/libtest/lib658.c
Expand Up @@ -34,9 +34,9 @@
int test(char *URL)
{
CURL *handle = NULL;
CURLcode res = 0;
CURLcode res = CURLE_OK;
CURLU *urlp = NULL;
CURLUcode uc = 0;
CURLUcode uc = CURLUE_OK;

global_init(CURL_GLOBAL_ALL);
easy_init(handle);
Expand Down
2 changes: 1 addition & 1 deletion tests/libtest/lib659.c
Expand Up @@ -34,7 +34,7 @@
int test(char *URL)
{
CURL *handle = NULL;
CURLcode res = 0;
CURLcode res = CURLE_OK;
CURLU *urlp = NULL;

global_init(CURL_GLOBAL_ALL);
Expand Down
4 changes: 2 additions & 2 deletions tests/libtest/lib674.c
Expand Up @@ -35,9 +35,9 @@ int test(char *URL)
{
CURL *handle = NULL;
CURL *handle2;
CURLcode res = 0;
CURLcode res = CURLE_OK;
CURLU *urlp = NULL;
CURLUcode uc = 0;
CURLUcode uc = CURLUE_OK;

global_init(CURL_GLOBAL_ALL);
easy_init(handle);
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/unit1302.c
Expand Up @@ -32,7 +32,7 @@ static struct Curl_easy *data;

static CURLcode unit_setup(void)
{
int res = CURLE_OK;
CURLcode res = CURLE_OK;

global_init(CURL_GLOBAL_ALL);
data = curl_easy_init();
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/unit1303.c
Expand Up @@ -31,7 +31,7 @@ static struct Curl_easy *data;

static CURLcode unit_setup(void)
{
int res = CURLE_OK;
CURLcode res = CURLE_OK;

global_init(CURL_GLOBAL_ALL);
data = curl_easy_init();
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/unit1396.c
Expand Up @@ -27,7 +27,7 @@ static CURL *hnd;

static CURLcode unit_setup(void)
{
int res = CURLE_OK;
CURLcode res = CURLE_OK;

global_init(CURL_GLOBAL_ALL);
return res;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/unit1600.c
Expand Up @@ -30,7 +30,7 @@ static CURL *easy;

static CURLcode unit_setup(void)
{
int res = CURLE_OK;
CURLcode res = CURLE_OK;

global_init(CURL_GLOBAL_ALL);
easy = curl_easy_init();
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/unit1605.c
Expand Up @@ -29,7 +29,7 @@ static CURL *easy;

static CURLcode unit_setup(void)
{
int res = CURLE_OK;
CURLcode res = CURLE_OK;

global_init(CURL_GLOBAL_ALL);
easy = curl_easy_init();
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/unit1606.c
Expand Up @@ -30,7 +30,7 @@ static CURL *easy;

static CURLcode unit_setup(void)
{
int res = CURLE_OK;
CURLcode res = CURLE_OK;

global_init(CURL_GLOBAL_ALL);
easy = curl_easy_init();
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/unit1607.c
Expand Up @@ -36,7 +36,7 @@ static void unit_stop(void)

static CURLcode unit_setup(void)
{
int res = CURLE_OK;
CURLcode res = CURLE_OK;

global_init(CURL_GLOBAL_ALL);

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/unit1609.c
Expand Up @@ -36,7 +36,7 @@ static void unit_stop(void)

static CURLcode unit_setup(void)
{
int res = CURLE_OK;
CURLcode res = CURLE_OK;

global_init(CURL_GLOBAL_ALL);

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/unit1610.c
Expand Up @@ -27,7 +27,7 @@

static CURLcode unit_setup(void)
{
int res = CURLE_OK;
CURLcode res = CURLE_OK;
global_init(CURL_GLOBAL_ALL);
return res;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/unit1620.c
Expand Up @@ -30,7 +30,7 @@

static CURLcode unit_setup(void)
{
int res = CURLE_OK;
CURLcode res = CURLE_OK;
global_init(CURL_GLOBAL_ALL);
return res;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/unit1652.c
Expand Up @@ -61,7 +61,7 @@ debugf_cb(CURL *handle, curl_infotype type, char *buf, size_t size,
static CURLcode
unit_setup(void)
{
int res = 0;
CURLcode res = CURLE_OK;

global_init(CURL_GLOBAL_ALL);
data = curl_easy_init();
Expand All @@ -71,7 +71,7 @@ unit_setup(void)
}
curl_easy_setopt(data, CURLOPT_DEBUGFUNCTION, debugf_cb);
curl_easy_setopt(data, CURLOPT_VERBOSE, 1L);
return CURLE_OK;
return res;
}

static void
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/unit1660.c
Expand Up @@ -103,7 +103,7 @@ static const struct testit headers[] = {

/* make this live for 7 seconds */
{ "expire.example", NULL, "max-age=\"7\"\r\n", CURLE_OK },
{ NULL, NULL, NULL, 0 }
{ NULL, NULL, NULL, CURLE_OK }
};

static void showsts(struct stsentry *e, const char *chost)
Expand Down

0 comments on commit d7e9e92

Please sign in to comment.