From: Daniel Stenberg Date: Wed, 20 Jul 2022 23:04:39 +0000 (+0200) Subject: tests: several enumerated type cleanups X-Git-Tag: curl-7_85_0~126 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fa89fa893cb8d10b0e4c6c77f88f9bf5d9d4411;p=thirdparty%2Fcurl.git tests: several enumerated type cleanups To please icc Closes #9179 --- diff --git a/tests/libtest/lib1523.c b/tests/libtest/lib1523.c index 2e359a0e52..d63a58fe96 100644 --- a/tests/libtest/lib1523.c +++ b/tests/libtest/lib1523.c @@ -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); diff --git a/tests/libtest/lib1532.c b/tests/libtest/lib1532.c index 8906ce74fd..01ce4b445b 100644 --- a/tests/libtest/lib1532.c +++ b/tests/libtest/lib1532.c @@ -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); @@ -78,5 +78,5 @@ int test(char *URL) test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return res; + return (int)res; } diff --git a/tests/libtest/lib1533.c b/tests/libtest/lib1533.c index ed6b1fada9..b36f3a2085 100644 --- a/tests/libtest/lib1533.c +++ b/tests/libtest/lib1533.c @@ -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"); diff --git a/tests/libtest/lib1534.c b/tests/libtest/lib1534.c index 53a155ce26..7fc731dc98 100644 --- a/tests/libtest/lib1534.c +++ b/tests/libtest/lib1534.c @@ -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); @@ -127,5 +127,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_easy_cleanup(dupe); curl_global_cleanup(); - return res; + return (int)res; } diff --git a/tests/libtest/lib1535.c b/tests/libtest/lib1535.c index 5c2e8cae04..e8cf67f9cd 100644 --- a/tests/libtest/lib1535.c +++ b/tests/libtest/lib1535.c @@ -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); @@ -126,5 +126,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_easy_cleanup(dupe); curl_global_cleanup(); - return res; + return (int)res; } diff --git a/tests/libtest/lib1536.c b/tests/libtest/lib1536.c index a9a57baadb..018c6cff46 100644 --- a/tests/libtest/lib1536.c +++ b/tests/libtest/lib1536.c @@ -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); @@ -127,5 +127,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_easy_cleanup(dupe); curl_global_cleanup(); - return res; + return (int)res; } diff --git a/tests/libtest/lib1555.c b/tests/libtest/lib1555.c index 25a908650e..eb39e96e64 100644 --- a/tests/libtest/lib1555.c +++ b/tests/libtest/lib1555.c @@ -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; diff --git a/tests/libtest/lib1558.c b/tests/libtest/lib1558.c index 7ee61c56ea..8c95b060bb 100644 --- a/tests/libtest/lib1558.c +++ b/tests/libtest/lib1558.c @@ -29,7 +29,7 @@ int test(char *URL) { - CURLcode res = 0; + CURLcode res = CURLE_OK; CURL *curl = NULL; long protocol = 0; diff --git a/tests/libtest/lib1559.c b/tests/libtest/lib1559.c index 83b1193c03..c941ac2520 100644 --- a/tests/libtest/lib1559.c +++ b/tests/libtest/lib1559.c @@ -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; diff --git a/tests/libtest/lib1560.c b/tests/libtest/lib1560.c index e5dd688966..1ec1e3cc9e 100644 --- a/tests/libtest/lib1560.c +++ b/tests/libtest/lib1560.c @@ -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)); @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) diff --git a/tests/libtest/lib1597.c b/tests/libtest/lib1597.c index 3ac31a0c3a..d39fae6636 100644 --- a/tests/libtest/lib1597.c +++ b/tests/libtest/lib1597.c @@ -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; diff --git a/tests/libtest/lib530.c b/tests/libtest/lib530.c index 53816a078d..1ab990780e 100644 --- a/tests/libtest/lib530.c +++ b/tests/libtest/lib530.c @@ -249,7 +249,7 @@ 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); @@ -257,7 +257,7 @@ static int checkFdSet(CURLM *curl, break; } } - return (int)result; + return result; } static int testone(char *URL, int timercb, int socketcb) diff --git a/tests/libtest/lib658.c b/tests/libtest/lib658.c index 50dc4fe633..d6b9935dda 100644 --- a/tests/libtest/lib658.c +++ b/tests/libtest/lib658.c @@ -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); diff --git a/tests/libtest/lib659.c b/tests/libtest/lib659.c index c251b7e310..0b6dddff1d 100644 --- a/tests/libtest/lib659.c +++ b/tests/libtest/lib659.c @@ -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); diff --git a/tests/libtest/lib674.c b/tests/libtest/lib674.c index f78f2c9150..454d5c0233 100644 --- a/tests/libtest/lib674.c +++ b/tests/libtest/lib674.c @@ -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); diff --git a/tests/unit/unit1302.c b/tests/unit/unit1302.c index 12be3c3590..afc5716626 100644 --- a/tests/unit/unit1302.c +++ b/tests/unit/unit1302.c @@ -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(); diff --git a/tests/unit/unit1303.c b/tests/unit/unit1303.c index 59b4d2e4bc..602adc2f53 100644 --- a/tests/unit/unit1303.c +++ b/tests/unit/unit1303.c @@ -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(); diff --git a/tests/unit/unit1396.c b/tests/unit/unit1396.c index edf3a3e64f..05b3323da0 100644 --- a/tests/unit/unit1396.c +++ b/tests/unit/unit1396.c @@ -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; diff --git a/tests/unit/unit1600.c b/tests/unit/unit1600.c index a640718dc5..544744840c 100644 --- a/tests/unit/unit1600.c +++ b/tests/unit/unit1600.c @@ -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(); diff --git a/tests/unit/unit1605.c b/tests/unit/unit1605.c index cc58394a3f..34a3690fab 100644 --- a/tests/unit/unit1605.c +++ b/tests/unit/unit1605.c @@ -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(); diff --git a/tests/unit/unit1606.c b/tests/unit/unit1606.c index 44f4c99ae4..0519b7c895 100644 --- a/tests/unit/unit1606.c +++ b/tests/unit/unit1606.c @@ -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(); diff --git a/tests/unit/unit1607.c b/tests/unit/unit1607.c index 7b930323b6..7295f1883e 100644 --- a/tests/unit/unit1607.c +++ b/tests/unit/unit1607.c @@ -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); diff --git a/tests/unit/unit1609.c b/tests/unit/unit1609.c index 1b041f2cc9..cab8383d09 100644 --- a/tests/unit/unit1609.c +++ b/tests/unit/unit1609.c @@ -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); diff --git a/tests/unit/unit1610.c b/tests/unit/unit1610.c index 3be61dec1f..78d415c188 100644 --- a/tests/unit/unit1610.c +++ b/tests/unit/unit1610.c @@ -27,7 +27,7 @@ static CURLcode unit_setup(void) { - int res = CURLE_OK; + CURLcode res = CURLE_OK; global_init(CURL_GLOBAL_ALL); return res; } diff --git a/tests/unit/unit1620.c b/tests/unit/unit1620.c index 572affecd0..cd4623d6b4 100644 --- a/tests/unit/unit1620.c +++ b/tests/unit/unit1620.c @@ -30,7 +30,7 @@ static CURLcode unit_setup(void) { - int res = CURLE_OK; + CURLcode res = CURLE_OK; global_init(CURL_GLOBAL_ALL); return res; } diff --git a/tests/unit/unit1652.c b/tests/unit/unit1652.c index e77e432f9c..761bf8c64d 100644 --- a/tests/unit/unit1652.c +++ b/tests/unit/unit1652.c @@ -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(); @@ -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 diff --git a/tests/unit/unit1660.c b/tests/unit/unit1660.c index c7b46f5e6e..4ef7faa732 100644 --- a/tests/unit/unit1660.c +++ b/tests/unit/unit1660.c @@ -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)