]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: several enumerated type cleanups
authorDaniel Stenberg <daniel@haxx.se>
Wed, 20 Jul 2022 23:04:39 +0000 (01:04 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 23 Jul 2022 11:39:29 +0000 (13:39 +0200)
To please icc

Closes #9179

27 files changed:
tests/libtest/lib1523.c
tests/libtest/lib1532.c
tests/libtest/lib1533.c
tests/libtest/lib1534.c
tests/libtest/lib1535.c
tests/libtest/lib1536.c
tests/libtest/lib1555.c
tests/libtest/lib1558.c
tests/libtest/lib1559.c
tests/libtest/lib1560.c
tests/libtest/lib1597.c
tests/libtest/lib530.c
tests/libtest/lib658.c
tests/libtest/lib659.c
tests/libtest/lib674.c
tests/unit/unit1302.c
tests/unit/unit1303.c
tests/unit/unit1396.c
tests/unit/unit1600.c
tests/unit/unit1605.c
tests/unit/unit1606.c
tests/unit/unit1607.c
tests/unit/unit1609.c
tests/unit/unit1610.c
tests/unit/unit1620.c
tests/unit/unit1652.c
tests/unit/unit1660.c

index 2e359a0e52bee32a28079b7461e0284858bc36e4..d63a58fe96b6fcc54f60629991a16071ee4d0cd7 100644 (file)
@@ -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);
index 8906ce74fd110ec09f420b94e406a025be3996e0..01ce4b445b4d1928445de67664fa518ffed1479a 100644 (file)
@@ -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;
 }
index ed6b1fada9e2b48e0958bb9ddd970e1e79e6a340..b36f3a2085b6498838ceabf3206ea9d6f8f29c22 100644 (file)
@@ -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");
index 53a155ce26a2ab5ac7f1c72d7de83c44bf55a749..7fc731dc98e34d8c88a4bef501aa3ce24ebad499 100644 (file)
@@ -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;
 }
index 5c2e8cae04a683cd1db4fc51135cb01b31b2a9cc..e8cf67f9cd2ac6eeadab644901e7e0725e2ec8ae 100644 (file)
@@ -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;
 }
index a9a57baadb05c7c8b20fd35384c4f05fa78d6dd4..018c6cff46abe981ada62a237908b154ad14be0e 100644 (file)
@@ -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;
 }
index 25a908650e1403c61e6e128199cc7d6a3b98f706..eb39e96e64b5b8cc2d2f5b8e9244e6c4cca72e44 100644 (file)
@@ -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;
index 7ee61c56eaf3d75b00e6fe4437fe5c4355be1d7d..8c95b060bba9b8e8d6499fec0767c24a9f97c5e0 100644 (file)
@@ -29,7 +29,7 @@
 
 int test(char *URL)
 {
-  CURLcode res = 0;
+  CURLcode res = CURLE_OK;
   CURL *curl = NULL;
   long protocol = 0;
 
index 83b1193c0379ea0d3fcb30aed663f79960113208..c941ac25201aeb631f159451b722acb9fac29eb6 100644 (file)
@@ -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;
index e5dd6889663c86ea2424eb066015052cfc7f4edd..1ec1e3cc9e8f81f4364597760671eeea1df56e10 100644 (file)
@@ -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)
index 3ac31a0c3a2ab5372fc14382fc8776ee4ddc48ee..d39fae663645b01af1d80cafb68ce2b3bd1db853 100644 (file)
@@ -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;
 
index 53816a078da0b0baf2db24302176f4a862892cc6..1ab990780e9b23bc63fc748a54040a53ce151864 100644 (file)
@@ -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)
index 50dc4fe633a544d4a17d47386d9d7de331009593..d6b9935ddae22061e067827d71f1a47a13df1d09 100644 (file)
@@ -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);
index c251b7e310c2264409b3ef5163dfe6736c708208..0b6dddff1daa5db244144eff60057520ebfa8de5 100644 (file)
@@ -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);
index f78f2c9150b8265975bf6447621178b7347cd6bf..454d5c023306e39a4ff3d073070c3ed67ad33f10 100644 (file)
@@ -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);
index 12be3c3590a0ad9b7222d590db64c31d68be09cc..afc5716626307570d6bebf28a7cc65aae4e76e47 100644 (file)
@@ -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();
index 59b4d2e4bc9161412814744b94be452c2242d677..602adc2f53a862efcbfb88938af48e4c995d91b2 100644 (file)
@@ -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();
index edf3a3e64f55a76583e28856dce31b60f96b2fd0..05b3323da007708f8c607d3c69d8f1fb6502aec3 100644 (file)
@@ -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;
index a640718dc5a3a4ff9cd3c1226b705fdb2ec0245c..544744840c4343c40757531b16d7686704f63fda 100644 (file)
@@ -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();
index cc58394a3f6e400274ff0af358a4ae7bbbaa1af9..34a3690fab7af3b0a00c5548b836f11a548bf65c 100644 (file)
@@ -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();
index 44f4c99ae437488b4e32c84ab60153d1ee6f8157..0519b7c8955f7875c7289d097ad52d39c5e30910 100644 (file)
@@ -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();
index 7b930323b65d8e6ee464ad8e6fab66d3149c91fa..7295f1883e8d357c5b97535ba5e6bf503987ab8f 100644 (file)
@@ -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);
 
index 1b041f2cc9e6daaf8547f9610c2f95e51f045e57..cab8383d092a8132ba23cf6807592be0f9af40e1 100644 (file)
@@ -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);
 
index 3be61dec1f1338dbf5a9f69224a3ab5a98afc0db..78d415c188e99c473d9d17d20c5854022f67e655 100644 (file)
@@ -27,7 +27,7 @@
 
 static CURLcode unit_setup(void)
 {
-  int res = CURLE_OK;
+  CURLcode res = CURLE_OK;
   global_init(CURL_GLOBAL_ALL);
   return res;
 }
index 572affecd0c3ec0be43632ae107c15c428bc8ac6..cd4623d6b4b93d09536bc4f516868cd21202f608 100644 (file)
@@ -30,7 +30,7 @@
 
 static CURLcode unit_setup(void)
 {
-  int res = CURLE_OK;
+  CURLcode res = CURLE_OK;
   global_init(CURL_GLOBAL_ALL);
   return res;
 }
index e77e432f9c4458ee5fdb4e09c38728cce1e695bc..761bf8c64d328a31b2dfb06858333b0d69576366 100644 (file)
@@ -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
index c7b46f5e6ed1f687cacecc10b40ea786c29edf71..4ef7faa732f92c7a384af2d5a997e68dc058d214 100644 (file)
@@ -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)