From: Daniel Stenberg Date: Fri, 16 May 2025 15:09:49 +0000 (+0200) Subject: libtests: define CURL_DISABLE_DEPRECATION first X-Git-Tag: curl-8_14_0~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0013bbdfb8c865bab1602050f8b2bd3a00c0448a;p=thirdparty%2Fcurl.git libtests: define CURL_DISABLE_DEPRECATION first Instead of using the kludgey ignore macros inline. They make setting break-points in a debugger and single-stepping code impossible. Closes #17373 --- diff --git a/tests/libtest/first.h b/tests/libtest/first.h index 1e4ae5fc37..acf00a3a89 100644 --- a/tests/libtest/first.h +++ b/tests/libtest/first.h @@ -23,6 +23,7 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ +#define CURL_DISABLE_DEPRECATION 1 #include "curl_setup.h" #include diff --git a/tests/libtest/lib1308.c b/tests/libtest/lib1308.c index b3b0c61214..0c70f3d6bc 100644 --- a/tests/libtest/lib1308.c +++ b/tests/libtest/lib1308.c @@ -41,60 +41,46 @@ CURLcode test(char *URL) size_t total_size = 0; char buffer[] = "test buffer"; - CURL_IGNORE_DEPRECATION( - rc = curl_formadd(&post, &last, CURLFORM_COPYNAME, "name", + rc = curl_formadd(&post, &last, CURLFORM_COPYNAME, "name", CURLFORM_COPYCONTENTS, "content", CURLFORM_END); - ) fail_unless(rc == 0, "curl_formadd returned error"); /* after the first curl_formadd when there's a single entry, both pointers should point to the same struct */ fail_unless(post == last, "post and last weren't the same"); - CURL_IGNORE_DEPRECATION( - rc = curl_formadd(&post, &last, CURLFORM_COPYNAME, "htmlcode", - CURLFORM_COPYCONTENTS, "", - CURLFORM_CONTENTTYPE, "text/html", CURLFORM_END); - ) + rc = curl_formadd(&post, &last, CURLFORM_COPYNAME, "htmlcode", + CURLFORM_COPYCONTENTS, "", + CURLFORM_CONTENTTYPE, "text/html", CURLFORM_END); fail_unless(rc == 0, "curl_formadd returned error"); - CURL_IGNORE_DEPRECATION( - rc = curl_formadd(&post, &last, CURLFORM_COPYNAME, "name_for_ptrcontent", - CURLFORM_PTRCONTENTS, buffer, CURLFORM_END); - ) + rc = curl_formadd(&post, &last, CURLFORM_COPYNAME, "name_for_ptrcontent", + CURLFORM_PTRCONTENTS, buffer, CURLFORM_END); fail_unless(rc == 0, "curl_formadd returned error"); - CURL_IGNORE_DEPRECATION( - res = curl_formget(post, &total_size, print_httppost_callback); - ) + res = curl_formget(post, &total_size, print_httppost_callback); fail_unless(res == 0, "curl_formget returned error"); fail_unless(total_size == 518, "curl_formget got wrong size back"); - CURL_IGNORE_DEPRECATION( - curl_formfree(post); - ) + curl_formfree(post); /* start a new formpost with a file upload and formget */ post = last = NULL; - CURL_IGNORE_DEPRECATION( - rc = curl_formadd(&post, &last, - CURLFORM_PTRNAME, "name of file field", - CURLFORM_FILE, URL, - CURLFORM_FILENAME, "custom named file", - CURLFORM_END); - ) + rc = curl_formadd(&post, &last, + CURLFORM_PTRNAME, "name of file field", + CURLFORM_FILE, URL, + CURLFORM_FILENAME, "custom named file", + CURLFORM_END); fail_unless(rc == 0, "curl_formadd returned error"); - CURL_IGNORE_DEPRECATION( - res = curl_formget(post, &total_size, print_httppost_callback); - ) + 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_IGNORE_DEPRECATION( - curl_formfree(post); - ) + curl_formfree(post); + return CURLE_OK; } diff --git a/tests/libtest/lib1512.c b/tests/libtest/lib1512.c index 710d71517c..02b2e8cac5 100644 --- a/tests/libtest/lib1512.c +++ b/tests/libtest/lib1512.c @@ -71,9 +71,7 @@ CURLcode test(char *URL) /* include headers */ easy_setopt(curl[i], CURLOPT_HEADER, 1L); - CURL_IGNORE_DEPRECATION( - easy_setopt(curl[i], CURLOPT_DNS_USE_GLOBAL_CACHE, 1L); - ) + easy_setopt(curl[i], CURLOPT_DNS_USE_GLOBAL_CACHE, 1L); } /* make the first one populate the GLOBAL cache */ diff --git a/tests/libtest/lib1513.c b/tests/libtest/lib1513.c index 433f6f1aec..9da57d967d 100644 --- a/tests/libtest/lib1513.c +++ b/tests/libtest/lib1513.c @@ -59,10 +59,8 @@ CURLcode test(char *URL) easy_setopt(curl, CURLOPT_URL, URL); easy_setopt(curl, CURLOPT_TIMEOUT, (long)7); easy_setopt(curl, CURLOPT_NOSIGNAL, (long)1); - CURL_IGNORE_DEPRECATION( - easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progressKiller); - easy_setopt(curl, CURLOPT_PROGRESSDATA, NULL); - ) + easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progressKiller); + easy_setopt(curl, CURLOPT_PROGRESSDATA, NULL); easy_setopt(curl, CURLOPT_NOPROGRESS, (long)0); res = curl_easy_perform(curl); diff --git a/tests/libtest/lib1535.c b/tests/libtest/lib1535.c index 71d7466d58..f999427fd6 100644 --- a/tests/libtest/lib1535.c +++ b/tests/libtest/lib1535.c @@ -40,9 +40,8 @@ CURLcode test(char *URL) /* Test that protocol is properly initialized on curl_easy_init. */ - CURL_IGNORE_DEPRECATION( - res = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol); - ) + res = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol); + if(res) { curl_mfprintf(stderr, "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", @@ -70,9 +69,8 @@ CURLcode test(char *URL) /* Test that a protocol is properly set after receiving an HTTP resource. */ - CURL_IGNORE_DEPRECATION( - res = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol); - ) + res = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol); + if(res) { curl_mfprintf(stderr, "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", @@ -99,9 +97,8 @@ CURLcode test(char *URL) goto test_cleanup; } - CURL_IGNORE_DEPRECATION( - res = curl_easy_getinfo(dupe, CURLINFO_PROTOCOL, &protocol); - ) + res = curl_easy_getinfo(dupe, CURLINFO_PROTOCOL, &protocol); + if(res) { curl_mfprintf(stderr, "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", @@ -122,9 +119,8 @@ CURLcode test(char *URL) curl_easy_reset(curl); - CURL_IGNORE_DEPRECATION( - res = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol); - ) + res = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol); + if(res) { curl_mfprintf(stderr, "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", diff --git a/tests/libtest/lib1545.c b/tests/libtest/lib1545.c index a1891375b3..d2709987e7 100644 --- a/tests/libtest/lib1545.c +++ b/tests/libtest/lib1545.c @@ -35,20 +35,16 @@ CURLcode test(char *URL) easy_init(eh); easy_setopt(eh, CURLOPT_URL, URL); - CURL_IGNORE_DEPRECATION( - curl_formadd(&m_formpost, &lastptr, CURLFORM_COPYNAME, "file", - CURLFORM_FILE, "missing-file", CURLFORM_END); - curl_easy_setopt(eh, CURLOPT_HTTPPOST, m_formpost); - ) + curl_formadd(&m_formpost, &lastptr, CURLFORM_COPYNAME, "file", + CURLFORM_FILE, "missing-file", CURLFORM_END); + curl_easy_setopt(eh, CURLOPT_HTTPPOST, m_formpost); (void)curl_easy_perform(eh); (void)curl_easy_perform(eh); test_cleanup: - CURL_IGNORE_DEPRECATION( - curl_formfree(m_formpost); - ) + curl_formfree(m_formpost); curl_easy_cleanup(eh); curl_global_cleanup(); diff --git a/tests/libtest/lib1555.c b/tests/libtest/lib1555.c index 9f2d0bc8db..eda2328a33 100644 --- a/tests/libtest/lib1555.c +++ b/tests/libtest/lib1555.c @@ -64,10 +64,8 @@ CURLcode test(char *URL) easy_setopt(curl, CURLOPT_URL, URL); easy_setopt(curl, CURLOPT_TIMEOUT, (long)7); easy_setopt(curl, CURLOPT_NOSIGNAL, (long)1); - CURL_IGNORE_DEPRECATION( - easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progressCallback); - easy_setopt(curl, CURLOPT_PROGRESSDATA, NULL); - ) + easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progressCallback); + easy_setopt(curl, CURLOPT_PROGRESSDATA, NULL); easy_setopt(curl, CURLOPT_NOPROGRESS, (long)0); res = curl_easy_perform(curl); diff --git a/tests/libtest/lib1558.c b/tests/libtest/lib1558.c index 2f54d2cf8c..9bb18caf8e 100644 --- a/tests/libtest/lib1558.c +++ b/tests/libtest/lib1558.c @@ -44,9 +44,7 @@ CURLcode test(char *URL) goto test_cleanup; } - CURL_IGNORE_DEPRECATION( - res = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol); - ) + res = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol); if(res) { curl_mfprintf(stderr, "curl_easy_getinfo() returned %d (%s)\n", res, curl_easy_strerror(res)); diff --git a/tests/libtest/lib1911.c b/tests/libtest/lib1911.c index bbd9c8e0a4..6dd4dcb1b0 100644 --- a/tests/libtest/lib1911.c +++ b/tests/libtest/lib1911.c @@ -61,18 +61,16 @@ CURLcode test(char *URL) /* * Whitelist string options that are safe for abuse */ - CURL_IGNORE_DEPRECATION( - switch(o->id) { - case CURLOPT_PROXY_TLSAUTH_TYPE: - case CURLOPT_TLSAUTH_TYPE: - case CURLOPT_RANDOM_FILE: - case CURLOPT_EGDSOCKET: - continue; - default: - /* check this */ - break; - } - ) + switch(o->id) { + case CURLOPT_PROXY_TLSAUTH_TYPE: + case CURLOPT_TLSAUTH_TYPE: + case CURLOPT_RANDOM_FILE: + case CURLOPT_EGDSOCKET: + continue; + default: + /* check this */ + break; + } /* This is a string. Make sure that passing in a string longer CURL_MAX_INPUT_LENGTH returns an error */ diff --git a/tests/libtest/lib1912.c b/tests/libtest/lib1912.c index 26ad6e5af5..7aa2bb9ade 100644 --- a/tests/libtest/lib1912.c +++ b/tests/libtest/lib1912.c @@ -40,44 +40,42 @@ CURLcode test(char *URL) for(o = curl_easy_option_next(NULL); o; o = curl_easy_option_next(o)) { - CURL_IGNORE_DEPRECATION( - /* Test for mismatch OR missing typecheck macros */ - if(curlcheck_long_option(o->id) != - (o->type == CURLOT_LONG || o->type == CURLOT_VALUES)) { - print_err(o->name, "CURLOT_LONG or CURLOT_VALUES"); - error++; - } - if(curlcheck_off_t_option(o->id) != (o->type == CURLOT_OFF_T)) { - print_err(o->name, "CURLOT_OFF_T"); - error++; - } - if(curlcheck_string_option(o->id) != (o->type == CURLOT_STRING)) { - print_err(o->name, "CURLOT_STRING"); - error++; - } - if(curlcheck_slist_option(o->id) != (o->type == CURLOT_SLIST)) { - print_err(o->name, "CURLOT_SLIST"); - error++; - } - if(curlcheck_cb_data_option(o->id) != (o->type == CURLOT_CBPTR)) { - print_err(o->name, "CURLOT_CBPTR"); - error++; - } - /* From here: only test that the type matches if macro is known */ - if(curlcheck_write_cb_option(o->id) && (o->type != CURLOT_FUNCTION)) { - print_err(o->name, "CURLOT_FUNCTION"); - error++; - } - if(curlcheck_conv_cb_option(o->id) && (o->type != CURLOT_FUNCTION)) { - print_err(o->name, "CURLOT_FUNCTION"); - error++; - } - if(curlcheck_postfields_option(o->id) && (o->type != CURLOT_OBJECT)) { - print_err(o->name, "CURLOT_OBJECT"); - error++; - } - /* Todo: no gcc typecheck for CURLOPTTYPE_BLOB types? */ - ) + /* Test for mismatch OR missing typecheck macros */ + if(curlcheck_long_option(o->id) != + (o->type == CURLOT_LONG || o->type == CURLOT_VALUES)) { + print_err(o->name, "CURLOT_LONG or CURLOT_VALUES"); + error++; + } + if(curlcheck_off_t_option(o->id) != (o->type == CURLOT_OFF_T)) { + print_err(o->name, "CURLOT_OFF_T"); + error++; + } + if(curlcheck_string_option(o->id) != (o->type == CURLOT_STRING)) { + print_err(o->name, "CURLOT_STRING"); + error++; + } + if(curlcheck_slist_option(o->id) != (o->type == CURLOT_SLIST)) { + print_err(o->name, "CURLOT_SLIST"); + error++; + } + if(curlcheck_cb_data_option(o->id) != (o->type == CURLOT_CBPTR)) { + print_err(o->name, "CURLOT_CBPTR"); + error++; + } + /* From here: only test that the type matches if macro is known */ + if(curlcheck_write_cb_option(o->id) && (o->type != CURLOT_FUNCTION)) { + print_err(o->name, "CURLOT_FUNCTION"); + error++; + } + if(curlcheck_conv_cb_option(o->id) && (o->type != CURLOT_FUNCTION)) { + print_err(o->name, "CURLOT_FUNCTION"); + error++; + } + if(curlcheck_postfields_option(o->id) && (o->type != CURLOT_OBJECT)) { + print_err(o->name, "CURLOT_OBJECT"); + error++; + } + /* Todo: no gcc typecheck for CURLOPTTYPE_BLOB types? */ } #endif (void)URL; diff --git a/tests/libtest/lib516.c b/tests/libtest/lib516.c index d9954b9208..60eb4e4c70 100644 --- a/tests/libtest/lib516.c +++ b/tests/libtest/lib516.c @@ -44,9 +44,7 @@ CURLcode test(char *URL) /* First set the URL that is about to receive our POST. */ test_setopt(curl, CURLOPT_URL, URL); - CURL_IGNORE_DEPRECATION( - test_setopt(curl, CURLOPT_HTTPPOST, NULL); - ) + test_setopt(curl, CURLOPT_HTTPPOST, NULL); test_setopt(curl, CURLOPT_VERBOSE, 1L); /* show verbose for debug */ test_setopt(curl, CURLOPT_HEADER, 1L); /* include header */ diff --git a/tests/libtest/lib547.c b/tests/libtest/lib547.c index 645f087d90..ce64ae41da 100644 --- a/tests/libtest/lib547.c +++ b/tests/libtest/lib547.c @@ -100,10 +100,9 @@ CURLcode test(char *URL) test_setopt(curl, CURLOPT_POSTFIELDS, UPLOADTHIS); #else /* 547 style, which means reading the POST data from a callback */ - CURL_IGNORE_DEPRECATION( - test_setopt(curl, CURLOPT_IOCTLFUNCTION, ioctlcallback); - test_setopt(curl, CURLOPT_IOCTLDATA, &counter); - ) + test_setopt(curl, CURLOPT_IOCTLFUNCTION, ioctlcallback); + test_setopt(curl, CURLOPT_IOCTLDATA, &counter); + test_setopt(curl, CURLOPT_READFUNCTION, readcallback); test_setopt(curl, CURLOPT_READDATA, &counter); /* We CANNOT do the POST fine without setting the size (or choose diff --git a/tests/libtest/lib552.c b/tests/libtest/lib552.c index d923724f34..f4fde2ff83 100644 --- a/tests/libtest/lib552.c +++ b/tests/libtest/lib552.c @@ -199,9 +199,7 @@ CURLcode test(char *URL) test_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback); /* Ioctl function */ - CURL_IGNORE_DEPRECATION( - test_setopt(curl, CURLOPT_IOCTLFUNCTION, ioctl_callback); - ) + test_setopt(curl, CURLOPT_IOCTLFUNCTION, ioctl_callback); test_setopt(curl, CURLOPT_PROXY, libtest_arg2); diff --git a/tests/libtest/lib554.c b/tests/libtest/lib554.c index e526631e71..94e6ad7936 100644 --- a/tests/libtest/lib554.c +++ b/tests/libtest/lib554.c @@ -75,27 +75,23 @@ static CURLcode test_once(char *URL, bool oldstyle) /* Fill in the file upload field */ if(oldstyle) { - CURL_IGNORE_DEPRECATION( - formrc = curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "sendfile", - CURLFORM_STREAM, &pooh, - CURLFORM_CONTENTSLENGTH, (long)pooh.sizeleft, - CURLFORM_FILENAME, "postit2.c", - CURLFORM_END); - ) + formrc = curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "sendfile", + CURLFORM_STREAM, &pooh, + CURLFORM_CONTENTSLENGTH, (long)pooh.sizeleft, + CURLFORM_FILENAME, "postit2.c", + CURLFORM_END); } else { - CURL_IGNORE_DEPRECATION( - /* new style */ - formrc = curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "sendfile alternative", - CURLFORM_STREAM, &pooh, - CURLFORM_CONTENTLEN, (curl_off_t)pooh.sizeleft, - CURLFORM_FILENAME, "file name 2", - CURLFORM_END); - ) + /* new style */ + formrc = curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "sendfile alternative", + CURLFORM_STREAM, &pooh, + CURLFORM_CONTENTLEN, (curl_off_t)pooh.sizeleft, + CURLFORM_FILENAME, "file name 2", + CURLFORM_END); } if(formrc) @@ -107,58 +103,51 @@ static CURLcode test_once(char *URL, bool oldstyle) pooh2.readptr = testdata; pooh2.sizeleft = strlen(testdata); - CURL_IGNORE_DEPRECATION( - /* Fill in the file upload field */ - formrc = curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "callbackdata", - CURLFORM_STREAM, &pooh2, - CURLFORM_CONTENTSLENGTH, (long)pooh2.sizeleft, - CURLFORM_END); - ) + /* Fill in the file upload field */ + formrc = curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "callbackdata", + CURLFORM_STREAM, &pooh2, + CURLFORM_CONTENTSLENGTH, (long)pooh2.sizeleft, + CURLFORM_END); + if(formrc) curl_mprintf("curl_formadd(2) = %d\n", (int)formrc); - CURL_IGNORE_DEPRECATION( - /* Fill in the filename field */ - formrc = curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "filename", - CURLFORM_COPYCONTENTS, "postit2.c", - CURLFORM_END); - ) + /* Fill in the filename field */ + formrc = curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "filename", + CURLFORM_COPYCONTENTS, "postit2.c", + CURLFORM_END); if(formrc) curl_mprintf("curl_formadd(3) = %d\n", (int)formrc); - CURL_IGNORE_DEPRECATION( - /* Fill in a submit field too */ - formrc = curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "submit", - CURLFORM_COPYCONTENTS, "send", - CURLFORM_CONTENTTYPE, "text/plain", - CURLFORM_END); - ) + /* Fill in a submit field too */ + formrc = curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "submit", + CURLFORM_COPYCONTENTS, "send", + CURLFORM_CONTENTTYPE, "text/plain", + CURLFORM_END); + if(formrc) curl_mprintf("curl_formadd(4) = %d\n", (int)formrc); - CURL_IGNORE_DEPRECATION( - formrc = curl_formadd(&formpost, &lastptr, - CURLFORM_COPYNAME, "somename", - CURLFORM_BUFFER, "somefile.txt", - CURLFORM_BUFFERPTR, "blah blah", - CURLFORM_BUFFERLENGTH, (long)9, - CURLFORM_END); - ) + formrc = curl_formadd(&formpost, &lastptr, + CURLFORM_COPYNAME, "somename", + CURLFORM_BUFFER, "somefile.txt", + CURLFORM_BUFFERPTR, "blah blah", + CURLFORM_BUFFERLENGTH, (long)9, + CURLFORM_END); + if(formrc) curl_mprintf("curl_formadd(5) = %d\n", (int)formrc); curl = curl_easy_init(); if(!curl) { curl_mfprintf(stderr, "curl_easy_init() failed\n"); - CURL_IGNORE_DEPRECATION( - curl_formfree(formpost); - ) + curl_formfree(formpost); curl_global_cleanup(); return TEST_ERR_MAJOR_BAD; } @@ -175,10 +164,8 @@ static CURLcode test_once(char *URL, bool oldstyle) /* we want to use our own read function */ test_setopt(curl, CURLOPT_READFUNCTION, read_callback); - CURL_IGNORE_DEPRECATION( - /* send a multi-part formpost */ - test_setopt(curl, CURLOPT_HTTPPOST, formpost); - ) + /* send a multi-part formpost */ + test_setopt(curl, CURLOPT_HTTPPOST, formpost); /* get verbose debug output please */ test_setopt(curl, CURLOPT_VERBOSE, 1L); @@ -191,15 +178,11 @@ static CURLcode test_once(char *URL, bool oldstyle) test_cleanup: - CURL_IGNORE_DEPRECATION( - /* always cleanup */ - curl_easy_cleanup(curl); - ) + /* always cleanup */ + curl_easy_cleanup(curl); - CURL_IGNORE_DEPRECATION( - /* now cleanup the formpost chain */ - curl_formfree(formpost); - ) + /* now cleanup the formpost chain */ + curl_formfree(formpost); return res; } diff --git a/tests/libtest/lib555.c b/tests/libtest/lib555.c index 3fc5f13016..a63fc21784 100644 --- a/tests/libtest/lib555.c +++ b/tests/libtest/lib555.c @@ -95,10 +95,9 @@ CURLcode test(char *URL) easy_setopt(curl, CURLOPT_HEADER, 1L); /* read the POST data from a callback */ - CURL_IGNORE_DEPRECATION( - easy_setopt(curl, CURLOPT_IOCTLFUNCTION, ioctlcallback); - easy_setopt(curl, CURLOPT_IOCTLDATA, &counter); - ) + easy_setopt(curl, CURLOPT_IOCTLFUNCTION, ioctlcallback); + easy_setopt(curl, CURLOPT_IOCTLDATA, &counter); + easy_setopt(curl, CURLOPT_READFUNCTION, readcallback); easy_setopt(curl, CURLOPT_READDATA, &counter); /* We CANNOT do the POST fine without setting the size (or choose diff --git a/tests/libtest/lib566.c b/tests/libtest/lib566.c index 358e133a22..3ed609f67f 100644 --- a/tests/libtest/lib566.c +++ b/tests/libtest/lib566.c @@ -51,10 +51,9 @@ CURLcode test(char *URL) if(!res) { FILE *moo; - CURL_IGNORE_DEPRECATION( - res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, - &content_length); - ) + res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, + &content_length); + moo = fopen(libtest_arg2, "wb"); if(moo) { curl_mfprintf(moo, "CL %.0f\n", content_length); diff --git a/tests/libtest/lib578.c b/tests/libtest/lib578.c index 0f4a04bcaa..33b807afb0 100644 --- a/tests/libtest/lib578.c +++ b/tests/libtest/lib578.c @@ -78,10 +78,8 @@ CURLcode test(char *URL) test_setopt(curl, CURLOPT_POSTFIELDS, testdata); /* we want to use our own progress function */ - CURL_IGNORE_DEPRECATION( - test_setopt(curl, CURLOPT_NOPROGRESS, 0L); - test_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback); - ) + test_setopt(curl, CURLOPT_NOPROGRESS, 0L); + test_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback); /* get verbose debug output please */ test_setopt(curl, CURLOPT_VERBOSE, 1L); diff --git a/tests/libtest/lib579.c b/tests/libtest/lib579.c index c9bde3eb70..8bc9e2a7cd 100644 --- a/tests/libtest/lib579.c +++ b/tests/libtest/lib579.c @@ -155,9 +155,7 @@ CURLcode test(char *URL) /* we want to use our own progress function */ test_setopt(curl, CURLOPT_NOPROGRESS, 0L); - CURL_IGNORE_DEPRECATION( - test_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback); - ) + test_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback); /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); diff --git a/tests/libtest/lib599.c b/tests/libtest/lib599.c index 11fe8fe980..d9ee121daf 100644 --- a/tests/libtest/lib599.c +++ b/tests/libtest/lib599.c @@ -64,9 +64,7 @@ CURLcode test(char *URL) /* we want to use our own progress function */ test_setopt(curl, CURLOPT_NOPROGRESS, 0L); - CURL_IGNORE_DEPRECATION( - test_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback); - ) + test_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback); /* get verbose debug output please */ test_setopt(curl, CURLOPT_VERBOSE, 1L); @@ -82,10 +80,8 @@ CURLcode test(char *URL) if(!res) { FILE *moo; - CURL_IGNORE_DEPRECATION( - res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, + res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &content_length); - ) moo = fopen(libtest_arg2, "wb"); if(moo) { curl_mfprintf(moo, "CL %.0f\n", content_length); diff --git a/tests/libtest/lib650.c b/tests/libtest/lib650.c index c9fae96009..59f5ba925e 100644 --- a/tests/libtest/lib650.c +++ b/tests/libtest/lib650.c @@ -25,6 +25,7 @@ #include "memdebug.h" + static char testdata[] = "this is what we post to the silly web server"; @@ -79,13 +80,11 @@ CURLcode test(char *URL) goto test_cleanup; } headers = headers2; - CURL_IGNORE_DEPRECATION( - formrc = curl_formadd(&formpost, &lastptr, - CURLFORM_COPYNAME, &testname, - CURLFORM_COPYCONTENTS, &testdata, - CURLFORM_CONTENTHEADER, headers, - CURLFORM_END); - ) + formrc = curl_formadd(&formpost, &lastptr, + CURLFORM_COPYNAME, &testname, + CURLFORM_COPYCONTENTS, &testdata, + CURLFORM_CONTENTHEADER, headers, + CURLFORM_END); if(formrc) { curl_mprintf("curl_formadd(1) = %d\n", (int) formrc); goto test_cleanup; @@ -93,22 +92,21 @@ CURLcode test(char *URL) contentlength = (long)(strlen(testdata) - 1); - CURL_IGNORE_DEPRECATION( - /* Use a form array for the non-copy test. */ - formarray[0].option = CURLFORM_PTRCONTENTS; - formarray[0].value = testdata; - formarray[1].option = CURLFORM_CONTENTSLENGTH; - formarray[1].value = (char *)(size_t)contentlength; - formarray[2].option = CURLFORM_END; - formarray[2].value = NULL; - formrc = curl_formadd(&formpost, - &lastptr, - CURLFORM_PTRNAME, testname, - CURLFORM_NAMELENGTH, strlen(testname) - 1, - CURLFORM_ARRAY, formarray, - CURLFORM_FILENAME, "remotefile.txt", - CURLFORM_END); - ) + /* Use a form array for the non-copy test. */ + formarray[0].option = CURLFORM_PTRCONTENTS; + formarray[0].value = testdata; + formarray[1].option = CURLFORM_CONTENTSLENGTH; + formarray[1].value = (char *)(size_t)contentlength; + formarray[2].option = CURLFORM_END; + formarray[2].value = NULL; + formrc = curl_formadd(&formpost, + &lastptr, + CURLFORM_PTRNAME, testname, + CURLFORM_NAMELENGTH, strlen(testname) - 1, + CURLFORM_ARRAY, formarray, + CURLFORM_FILENAME, "remotefile.txt", + CURLFORM_END); + if(formrc) { curl_mprintf("curl_formadd(2) = %d\n", (int) formrc); goto test_cleanup; @@ -119,65 +117,59 @@ CURLcode test(char *URL) CURLOPT_PTRNAME actually copies the name thus we do not test this here. */ testdata[0]++; - CURL_IGNORE_DEPRECATION( - /* Check multi-files and content type propagation. */ - formrc = curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "multifile", - CURLFORM_FILE, libtest_arg2, /* Set in first.c. */ - CURLFORM_FILE, libtest_arg2, - CURLFORM_CONTENTTYPE, "text/whatever", - CURLFORM_FILE, libtest_arg2, - CURLFORM_END); - ) + /* Check multi-files and content type propagation. */ + formrc = curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "multifile", + CURLFORM_FILE, libtest_arg2, /* Set in first.c. */ + CURLFORM_FILE, libtest_arg2, + CURLFORM_CONTENTTYPE, "text/whatever", + CURLFORM_FILE, libtest_arg2, + CURLFORM_END); + if(formrc) { curl_mprintf("curl_formadd(3) = %d\n", (int) formrc); goto test_cleanup; } - CURL_IGNORE_DEPRECATION( - /* Check data from file content. */ - formrc = curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "filecontents", - CURLFORM_FILECONTENT, libtest_arg2, - CURLFORM_END); - ) + /* Check data from file content. */ + formrc = curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "filecontents", + CURLFORM_FILECONTENT, libtest_arg2, + CURLFORM_END); if(formrc) { curl_mprintf("curl_formadd(4) = %d\n", (int) formrc); goto test_cleanup; } - CURL_IGNORE_DEPRECATION( - /* Measure the current form length. - * This is done before including stdin data because we want to reuse it - * and stdin cannot be rewound. - */ - curl_formget(formpost, (void *) &formlength, count_chars); - ) + /* Measure the current form length. + * This is done before including stdin data because we want to reuse it + * and stdin cannot be rewound. + */ + curl_formget(formpost, (void *) &formlength, count_chars); /* Include length in data for external check. */ curl_msnprintf(flbuf, sizeof(flbuf), "%lu", (unsigned long) formlength); - CURL_IGNORE_DEPRECATION( - formrc = curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "formlength", - CURLFORM_COPYCONTENTS, &flbuf, - CURLFORM_END); - ) + + formrc = curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "formlength", + CURLFORM_COPYCONTENTS, &flbuf, + CURLFORM_END); + if(formrc) { curl_mprintf("curl_formadd(5) = %d\n", (int) formrc); goto test_cleanup; } - CURL_IGNORE_DEPRECATION( - /* Check stdin (may be problematic on some platforms). */ - formrc = curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "standardinput", - CURLFORM_FILE, "-", - CURLFORM_END); - ) + /* Check stdin (may be problematic on some platforms). */ + formrc = curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "standardinput", + CURLFORM_FILE, "-", + CURLFORM_END); + if(formrc) { curl_mprintf("curl_formadd(6) = %d\n", (int) formrc); goto test_cleanup; @@ -192,10 +184,8 @@ CURLcode test(char *URL) /* First set the URL that is about to receive our POST. */ test_setopt(curl, CURLOPT_URL, URL); - CURL_IGNORE_DEPRECATION( - /* send a multi-part formpost */ - test_setopt(curl, CURLOPT_HTTPPOST, formpost); - ) + /* send a multi-part formpost */ + test_setopt(curl, CURLOPT_HTTPPOST, formpost); /* get verbose debug output please */ test_setopt(curl, CURLOPT_VERBOSE, 1L); @@ -214,10 +204,8 @@ test_cleanup: /* always cleanup */ curl_easy_cleanup(curl); - CURL_IGNORE_DEPRECATION( - /* now cleanup the formpost chain */ - curl_formfree(formpost); - ) + /* now cleanup the formpost chain */ + curl_formfree(formpost); curl_slist_free_all(headers); curl_global_cleanup(); diff --git a/tests/libtest/lib651.c b/tests/libtest/lib651.c index c62823e7d0..856ccd123d 100644 --- a/tests/libtest/lib651.c +++ b/tests/libtest/lib651.c @@ -49,13 +49,11 @@ CURLcode test(char *URL) return TEST_ERR_MAJOR_BAD; } - CURL_IGNORE_DEPRECATION( - /* Check proper name and data copying. */ - formrc = curl_formadd(&formpost, &lastptr, - CURLFORM_COPYNAME, "hello", - CURLFORM_COPYCONTENTS, testbuf, - CURLFORM_END); - ) + /* Check proper name and data copying. */ + formrc = curl_formadd(&formpost, &lastptr, + CURLFORM_COPYNAME, "hello", + CURLFORM_COPYCONTENTS, testbuf, + CURLFORM_END); if(formrc) curl_mprintf("curl_formadd(1) = %d\n", (int) formrc); @@ -63,9 +61,7 @@ CURLcode test(char *URL) curl = curl_easy_init(); if(!curl) { curl_mfprintf(stderr, "curl_easy_init() failed\n"); - CURL_IGNORE_DEPRECATION( - curl_formfree(formpost); - ) + curl_formfree(formpost); curl_global_cleanup(); return TEST_ERR_MAJOR_BAD; } @@ -73,10 +69,8 @@ CURLcode test(char *URL) /* First set the URL that is about to receive our POST. */ test_setopt(curl, CURLOPT_URL, URL); - CURL_IGNORE_DEPRECATION( - /* send a multi-part formpost */ - test_setopt(curl, CURLOPT_HTTPPOST, formpost); - ) + /* send a multi-part formpost */ + test_setopt(curl, CURLOPT_HTTPPOST, formpost); /* get verbose debug output please */ test_setopt(curl, CURLOPT_VERBOSE, 1L); @@ -92,10 +86,8 @@ test_cleanup: /* always cleanup */ curl_easy_cleanup(curl); - CURL_IGNORE_DEPRECATION( - /* now cleanup the formpost chain */ - curl_formfree(formpost); - ) + /* now cleanup the formpost chain */ + curl_formfree(formpost); curl_global_cleanup(); diff --git a/tests/libtest/lib670.c b/tests/libtest/lib670.c index 6198b90692..2b54eac2d2 100644 --- a/tests/libtest/lib670.c +++ b/tests/libtest/lib670.c @@ -154,14 +154,12 @@ CURLcode test(char *URL) if(res == CURLE_OK) test_setopt(pooh.easy, CURLOPT_MIMEPOST, mime); #else - CURL_IGNORE_DEPRECATION( - /* Build the form. */ - formrc = curl_formadd(&formpost, &lastptr, - CURLFORM_COPYNAME, testname, - CURLFORM_STREAM, &pooh, - CURLFORM_CONTENTLEN, (curl_off_t) 2, - CURLFORM_END); - ) + /* Build the form. */ + formrc = curl_formadd(&formpost, &lastptr, + CURLFORM_COPYNAME, testname, + CURLFORM_STREAM, &pooh, + CURLFORM_CONTENTLEN, (curl_off_t) 2, + CURLFORM_END); if(formrc) { curl_mfprintf(stderr, "curl_formadd() = %d\n", (int) formrc); goto test_cleanup; @@ -170,10 +168,8 @@ CURLcode test(char *URL) /* We want to use our own read function. */ test_setopt(pooh.easy, CURLOPT_READFUNCTION, read_callback); - CURL_IGNORE_DEPRECATION( - /* Send a multi-part formpost. */ - test_setopt(pooh.easy, CURLOPT_HTTPPOST, formpost); - ) + /* Send a multi-part formpost. */ + test_setopt(pooh.easy, CURLOPT_HTTPPOST, formpost); #endif #if defined(LIB670) || defined(LIB672) @@ -252,9 +248,7 @@ test_cleanup: #if defined(LIB670) || defined(LIB671) curl_mime_free(mime); #else - CURL_IGNORE_DEPRECATION( - curl_formfree(formpost); - ) + curl_formfree(formpost); #endif curl_global_cleanup(); diff --git a/tests/libtest/libntlmconnect.c b/tests/libtest/libntlmconnect.c index 61fedc41ed..054f250ee8 100644 --- a/tests/libtest/libntlmconnect.c +++ b/tests/libtest/libntlmconnect.c @@ -50,9 +50,8 @@ static size_t callback(char *ptr, size_t size, size_t nmemb, void *data) ntlm_counter[idx] += (int)(size * nmemb); /* Get socket being used for this easy handle, otherwise CURL_SOCKET_BAD */ - CURL_IGNORE_DEPRECATION( - code = curl_easy_getinfo(ntlm_easy[idx], CURLINFO_LASTSOCKET, &longdata); - ) + code = curl_easy_getinfo(ntlm_easy[idx], CURLINFO_LASTSOCKET, &longdata); + if(CURLE_OK != code) { curl_mfprintf(stderr, "%s:%d curl_easy_getinfo() failed, " "with code %d (%s)\n", diff --git a/tests/libtest/mk-lib1521.pl b/tests/libtest/mk-lib1521.pl index 9abceae6b3..64dc15e6d8 100755 --- a/tests/libtest/mk-lib1521.pl +++ b/tests/libtest/mk-lib1521.pl @@ -361,7 +361,6 @@ CURLcode test(char *URL) goto test_cleanup; } - CURL_IGNORE_DEPRECATION( HEADER ; @@ -597,7 +596,7 @@ MOO print $fh <