#
# $(top_srcdir)/include is for libcurl's external include files
-AM_CPPFLAGS = -I$(top_srcdir)/include \
- -DCURL_DISABLE_DEPRECATION
+AM_CPPFLAGS = -I$(top_srcdir)/include
LIBDIR = $(top_builddir)/lib
#include <curl/curl.h>
-#ifdef __GNUC__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#endif
-
int main(void)
{
CURL *curl;
struct curl_slist *headerlist = NULL;
static const char buf[] = "Expect:";
- /* Fill in the file upload field. This makes libcurl load data from
- the given file name when curl_easy_perform() is called. */
- curl_formadd(&formpost,
- &lastptr,
- CURLFORM_COPYNAME, "sendfile",
- CURLFORM_FILE, "multi-formadd.c",
- CURLFORM_END);
-
- /* Fill in the filename field */
- curl_formadd(&formpost,
- &lastptr,
- CURLFORM_COPYNAME, "filename",
- CURLFORM_COPYCONTENTS, "multi-formadd.c",
- CURLFORM_END);
-
- /* Fill in the submit field too, even if this is rarely needed */
- curl_formadd(&formpost,
- &lastptr,
- CURLFORM_COPYNAME, "submit",
- CURLFORM_COPYCONTENTS, "send",
- CURLFORM_END);
+ CURL_IGNORE_DEPRECATION(
+ /* Fill in the file upload field. This makes libcurl load data from
+ the given file name when curl_easy_perform() is called. */
+ curl_formadd(&formpost,
+ &lastptr,
+ CURLFORM_COPYNAME, "sendfile",
+ CURLFORM_FILE, "multi-formadd.c",
+ CURLFORM_END);
+
+ /* Fill in the filename field */
+ curl_formadd(&formpost,
+ &lastptr,
+ CURLFORM_COPYNAME, "filename",
+ CURLFORM_COPYCONTENTS, "multi-formadd.c",
+ CURLFORM_END);
+
+ /* Fill in the submit field too, even if this is rarely needed */
+ curl_formadd(&formpost,
+ &lastptr,
+ CURLFORM_COPYNAME, "submit",
+ CURLFORM_COPYCONTENTS, "send",
+ CURLFORM_END);
+ )
curl = curl_easy_init();
multi_handle = curl_multi_init();
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
- curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
+ CURL_IGNORE_DEPRECATION(
+ curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
+ )
curl_multi_add_handle(multi_handle, curl);
/* always cleanup */
curl_easy_cleanup(curl);
- /* then cleanup the formpost chain */
- curl_formfree(formpost);
+ CURL_IGNORE_DEPRECATION(
+ /* then cleanup the formpost chain */
+ curl_formfree(formpost);
+ )
/* free slist */
curl_slist_free_all(headerlist);
}
return 0;
}
-
-#ifdef __GNUC__
-#pragma GCC diagnostic pop
-#endif
#include <curl/curl.h>
-#ifdef __GNUC__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#endif
-
int main(int argc, char *argv[])
{
CURL *curl;
curl_global_init(CURL_GLOBAL_ALL);
- /* Fill in the file upload field */
- curl_formadd(&formpost,
- &lastptr,
- CURLFORM_COPYNAME, "sendfile",
- CURLFORM_FILE, "postit2-formadd.c",
- CURLFORM_END);
-
- /* Fill in the filename field */
- curl_formadd(&formpost,
- &lastptr,
- CURLFORM_COPYNAME, "filename",
- CURLFORM_COPYCONTENTS, "postit2-formadd.c",
- CURLFORM_END);
-
-
- /* Fill in the submit field too, even if this is rarely needed */
- curl_formadd(&formpost,
- &lastptr,
- CURLFORM_COPYNAME, "submit",
- CURLFORM_COPYCONTENTS, "send",
- CURLFORM_END);
+ CURL_IGNORE_DEPRECATION(
+ /* Fill in the file upload field */
+ curl_formadd(&formpost,
+ &lastptr,
+ CURLFORM_COPYNAME, "sendfile",
+ CURLFORM_FILE, "postit2-formadd.c",
+ CURLFORM_END);
+
+ /* Fill in the filename field */
+ curl_formadd(&formpost,
+ &lastptr,
+ CURLFORM_COPYNAME, "filename",
+ CURLFORM_COPYCONTENTS, "postit2-formadd.c",
+ CURLFORM_END);
+
+
+ /* Fill in the submit field too, even if this is rarely needed */
+ curl_formadd(&formpost,
+ &lastptr,
+ CURLFORM_COPYNAME, "submit",
+ CURLFORM_COPYCONTENTS, "send",
+ CURLFORM_END);
+ )
curl = curl_easy_init();
/* initialize custom header list (stating that Expect: 100-continue is not
if((argc == 2) && (!strcmp(argv[1], "noexpectheader")))
/* only disable 100-continue header if explicitly requested */
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
- curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
+ CURL_IGNORE_DEPRECATION(
+ curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
+ )
/* Perform the request, res gets the return code */
res = curl_easy_perform(curl);
/* always cleanup */
curl_easy_cleanup(curl);
- /* then cleanup the formpost chain */
- curl_formfree(formpost);
+ CURL_IGNORE_DEPRECATION(
+ /* then cleanup the formpost chain */
+ curl_formfree(formpost);
+ )
+
/* free slist */
curl_slist_free_all(headerlist);
}
return 0;
}
-
-#ifdef __GNUC__
-#pragma GCC diagnostic pop
-#endif
#endif
/* Compile-time deprecation macros. */
-#if (defined(__GNUC__) && \
- ((__GNUC__ > 12) || ((__GNUC__ == 12) && (__GNUC_MINOR__ >= 1 ))) || \
- defined(__IAR_SYSTEMS_ICC__)) && \
- !defined(__INTEL_COMPILER) && \
+#if (defined(__GNUC__) && \
+ ((__GNUC__ > 12) || ((__GNUC__ == 12) && (__GNUC_MINOR__ >= 1))) || \
+ (defined(__clang__) && __clang_major__ >= 3) || \
+ defined(__IAR_SYSTEMS_ICC__)) && \
+ !defined(__INTEL_COMPILER) && \
!defined(CURL_DISABLE_DEPRECATION) && !defined(BUILDING_LIBCURL)
#define CURL_DEPRECATED(version, message) \
__attribute__((deprecated("since " # version ". " message)))
AM_CPPFLAGS = -I$(top_srcdir)/include \
-I$(top_builddir)/lib \
- -I$(top_srcdir)/lib \
- -DCURL_DISABLE_DEPRECATION
+ -I$(top_srcdir)/lib
LIBDIR = $(top_builddir)/lib
lib1543_CPPFLAGS = $(AM_CPPFLAGS) -DLIB1543
lib1545_SOURCES = lib1545.c $(SUPPORTFILES)
-lib1545_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_DISABLE_DEPRECATION
lib1550_SOURCES = lib1550.c $(SUPPORTFILES)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#ifndef CURL_DISABLE_DEPRECATION
-#define CURL_DISABLE_DEPRECATION /* Using and testing the form api */
-#endif
#include "test.h"
CURLcode test(char *URL)
easy_init(eh);
easy_setopt(eh, CURLOPT_URL, URL);
- curl_formadd(&m_formpost, &lastptr, CURLFORM_COPYNAME, "file",
- CURLFORM_FILE, "missing-file", CURLFORM_END);
- curl_easy_setopt(eh, CURLOPT_HTTPPOST, m_formpost);
+ 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);
+ )
(void)curl_easy_perform(eh);
(void)curl_easy_perform(eh);
test_cleanup:
- curl_formfree(m_formpost);
-
+ CURL_IGNORE_DEPRECATION(
+ curl_formfree(m_formpost);
+ )
curl_easy_cleanup(eh);
curl_global_cleanup();
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#define CURL_DISABLE_DEPRECATION /* Using and testing the form api */
#include "test.h"
#include "memdebug.h"
/* Fill in the file upload field */
if(oldstyle) {
- formrc = curl_formadd(&formpost,
- &lastptr,
- CURLFORM_COPYNAME, "sendfile",
- CURLFORM_STREAM, &pooh,
- CURLFORM_CONTENTSLENGTH, (long)pooh.sizeleft,
- CURLFORM_FILENAME, "postit2.c",
- CURLFORM_END);
+ 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);
+ )
}
else {
- /* 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);
+ 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);
+ )
}
if(formrc)
pooh2.readptr = data;
pooh2.sizeleft = strlen(data);
- /* Fill in the file upload field */
- formrc = curl_formadd(&formpost,
- &lastptr,
- CURLFORM_COPYNAME, "callbackdata",
- CURLFORM_STREAM, &pooh2,
- CURLFORM_CONTENTSLENGTH, (long)pooh2.sizeleft,
- CURLFORM_END);
-
+ 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);
+ )
if(formrc)
printf("curl_formadd(2) = %d\n", (int)formrc);
- /* Fill in the filename field */
- formrc = curl_formadd(&formpost,
- &lastptr,
- CURLFORM_COPYNAME, "filename",
- CURLFORM_COPYCONTENTS, "postit2.c",
- CURLFORM_END);
-
+ CURL_IGNORE_DEPRECATION(
+ /* Fill in the filename field */
+ formrc = curl_formadd(&formpost,
+ &lastptr,
+ CURLFORM_COPYNAME, "filename",
+ CURLFORM_COPYCONTENTS, "postit2.c",
+ CURLFORM_END);
+ )
if(formrc)
printf("curl_formadd(3) = %d\n", (int)formrc);
- /* Fill in a submit field too */
- formrc = curl_formadd(&formpost,
- &lastptr,
- CURLFORM_COPYNAME, "submit",
- CURLFORM_COPYCONTENTS, "send",
- CURLFORM_CONTENTTYPE, "text/plain",
- CURLFORM_END);
-
+ 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);
+ )
if(formrc)
printf("curl_formadd(4) = %d\n", (int)formrc);
- formrc = curl_formadd(&formpost, &lastptr,
- CURLFORM_COPYNAME, "somename",
- CURLFORM_BUFFER, "somefile.txt",
- CURLFORM_BUFFERPTR, "blah blah",
- CURLFORM_BUFFERLENGTH, (long)9,
- CURLFORM_END);
-
+ 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);
+ )
if(formrc)
printf("curl_formadd(5) = %d\n", (int)formrc);
curl = curl_easy_init();
if(!curl) {
fprintf(stderr, "curl_easy_init() failed\n");
- curl_formfree(formpost);
+ CURL_IGNORE_DEPRECATION(
+ curl_formfree(formpost);
+ )
curl_global_cleanup();
return TEST_ERR_MAJOR_BAD;
}
/* we want to use our own read function */
test_setopt(curl, CURLOPT_READFUNCTION, read_callback);
- /* send a multi-part formpost */
- test_setopt(curl, CURLOPT_HTTPPOST, formpost);
+ CURL_IGNORE_DEPRECATION(
+ /* send a multi-part formpost */
+ test_setopt(curl, CURLOPT_HTTPPOST, formpost);
+ )
/* get verbose debug output please */
test_setopt(curl, CURLOPT_VERBOSE, 1L);
test_cleanup:
- /* always cleanup */
- curl_easy_cleanup(curl);
+ CURL_IGNORE_DEPRECATION(
+ /* always cleanup */
+ curl_easy_cleanup(curl);
+ )
- /* now cleanup the formpost chain */
- curl_formfree(formpost);
+ CURL_IGNORE_DEPRECATION(
+ /* now cleanup the formpost chain */
+ curl_formfree(formpost);
+ )
return res;
}
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#define CURL_DISABLE_DEPRECATION /* Using and testing the form api */
#include "test.h"
#include "memdebug.h"
goto test_cleanup;
}
headers = headers2;
- formrc = curl_formadd(&formpost, &lastptr,
- CURLFORM_COPYNAME, &name,
- CURLFORM_COPYCONTENTS, &data,
- CURLFORM_CONTENTHEADER, headers,
- CURLFORM_END);
-
+ CURL_IGNORE_DEPRECATION(
+ formrc = curl_formadd(&formpost, &lastptr,
+ CURLFORM_COPYNAME, &name,
+ CURLFORM_COPYCONTENTS, &data,
+ CURLFORM_CONTENTHEADER, headers,
+ CURLFORM_END);
+ )
if(formrc) {
printf("curl_formadd(1) = %d\n", (int) formrc);
goto test_cleanup;
contentlength = (long)(strlen(data) - 1);
- /* Use a form array for the non-copy test. */
- formarray[0].option = CURLFORM_PTRCONTENTS;
- formarray[0].value = data;
- 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, name,
- CURLFORM_NAMELENGTH, strlen(name) - 1,
- CURLFORM_ARRAY, formarray,
- CURLFORM_FILENAME, "remotefile.txt",
- CURLFORM_END);
-
+ CURL_IGNORE_DEPRECATION(
+ /* Use a form array for the non-copy test. */
+ formarray[0].option = CURLFORM_PTRCONTENTS;
+ formarray[0].value = data;
+ 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, name,
+ CURLFORM_NAMELENGTH, strlen(name) - 1,
+ CURLFORM_ARRAY, formarray,
+ CURLFORM_FILENAME, "remotefile.txt",
+ CURLFORM_END);
+ )
if(formrc) {
printf("curl_formadd(2) = %d\n", (int) formrc);
goto test_cleanup;
CURLOPT_PTRNAME actually copies the name thus we do not test this here. */
data[0]++;
- /* 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);
-
+ 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);
+ )
if(formrc) {
printf("curl_formadd(3) = %d\n", (int) formrc);
goto test_cleanup;
}
- /* Check data from file content. */
- formrc = curl_formadd(&formpost,
- &lastptr,
- CURLFORM_COPYNAME, "filecontents",
- CURLFORM_FILECONTENT, libtest_arg2,
- CURLFORM_END);
-
+ CURL_IGNORE_DEPRECATION(
+ /* Check data from file content. */
+ formrc = curl_formadd(&formpost,
+ &lastptr,
+ CURLFORM_COPYNAME, "filecontents",
+ CURLFORM_FILECONTENT, libtest_arg2,
+ CURLFORM_END);
+ )
if(formrc) {
printf("curl_formadd(4) = %d\n", (int) formrc);
goto test_cleanup;
}
- /* 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);
+ 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);
+ )
/* Include length in data for external check. */
curl_msnprintf(flbuf, sizeof(flbuf), "%lu", (unsigned long) formlength);
- formrc = curl_formadd(&formpost,
- &lastptr,
- CURLFORM_COPYNAME, "formlength",
- CURLFORM_COPYCONTENTS, &flbuf,
- CURLFORM_END);
+ CURL_IGNORE_DEPRECATION(
+ formrc = curl_formadd(&formpost,
+ &lastptr,
+ CURLFORM_COPYNAME, "formlength",
+ CURLFORM_COPYCONTENTS, &flbuf,
+ CURLFORM_END);
+ )
if(formrc) {
printf("curl_formadd(5) = %d\n", (int) formrc);
goto test_cleanup;
}
- /* Check stdin (may be problematic on some platforms). */
- formrc = curl_formadd(&formpost,
- &lastptr,
- CURLFORM_COPYNAME, "standardinput",
- CURLFORM_FILE, "-",
- CURLFORM_END);
+ CURL_IGNORE_DEPRECATION(
+ /* Check stdin (may be problematic on some platforms). */
+ formrc = curl_formadd(&formpost,
+ &lastptr,
+ CURLFORM_COPYNAME, "standardinput",
+ CURLFORM_FILE, "-",
+ CURLFORM_END);
+ )
if(formrc) {
printf("curl_formadd(6) = %d\n", (int) formrc);
goto test_cleanup;
/* First set the URL that is about to receive our POST. */
test_setopt(curl, CURLOPT_URL, URL);
- /* send a multi-part formpost */
- test_setopt(curl, CURLOPT_HTTPPOST, formpost);
+ CURL_IGNORE_DEPRECATION(
+ /* send a multi-part formpost */
+ test_setopt(curl, CURLOPT_HTTPPOST, formpost);
+ )
/* get verbose debug output please */
test_setopt(curl, CURLOPT_VERBOSE, 1L);
/* always cleanup */
curl_easy_cleanup(curl);
- /* now cleanup the formpost chain */
- curl_formfree(formpost);
+ CURL_IGNORE_DEPRECATION(
+ /* now cleanup the formpost chain */
+ curl_formfree(formpost);
+ )
curl_slist_free_all(headers);
curl_global_cleanup();
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#define CURL_DISABLE_DEPRECATION /* Using and testing the form api */
#include "test.h"
#include "memdebug.h"
return TEST_ERR_MAJOR_BAD;
}
- /* Check proper name and data copying. */
- formrc = curl_formadd(&formpost, &lastptr,
- CURLFORM_COPYNAME, "hello",
- CURLFORM_COPYCONTENTS, buffer,
- CURLFORM_END);
-
+ CURL_IGNORE_DEPRECATION(
+ /* Check proper name and data copying. */
+ formrc = curl_formadd(&formpost, &lastptr,
+ CURLFORM_COPYNAME, "hello",
+ CURLFORM_COPYCONTENTS, buffer,
+ CURLFORM_END);
+ )
if(formrc)
printf("curl_formadd(1) = %d\n", (int) formrc);
curl = curl_easy_init();
if(!curl) {
fprintf(stderr, "curl_easy_init() failed\n");
- curl_formfree(formpost);
+ CURL_IGNORE_DEPRECATION(
+ curl_formfree(formpost);
+ )
curl_global_cleanup();
return TEST_ERR_MAJOR_BAD;
}
/* First set the URL that is about to receive our POST. */
test_setopt(curl, CURLOPT_URL, URL);
- /* send a multi-part formpost */
- test_setopt(curl, CURLOPT_HTTPPOST, formpost);
+ CURL_IGNORE_DEPRECATION(
+ /* send a multi-part formpost */
+ test_setopt(curl, CURLOPT_HTTPPOST, formpost);
+ )
/* get verbose debug output please */
test_setopt(curl, CURLOPT_VERBOSE, 1L);
/* always cleanup */
curl_easy_cleanup(curl);
- /* now cleanup the formpost chain */
- curl_formfree(formpost);
+ CURL_IGNORE_DEPRECATION(
+ /* now cleanup the formpost chain */
+ curl_formfree(formpost);
+ )
curl_global_cleanup();
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
-#if !defined(LIB670) && !defined(LIB671)
-#define CURL_DISABLE_DEPRECATION /* Using and testing the form api */
-#endif
-
#include "test.h"
#include <time.h>
if(res == CURLE_OK)
test_setopt(pooh.easy, CURLOPT_MIMEPOST, mime);
#else
- /* Build the form. */
- formrc = curl_formadd(&formpost, &lastptr,
- CURLFORM_COPYNAME, name,
- CURLFORM_STREAM, &pooh,
- CURLFORM_CONTENTLEN, (curl_off_t) 2,
- CURLFORM_END);
+ CURL_IGNORE_DEPRECATION(
+ /* Build the form. */
+ formrc = curl_formadd(&formpost, &lastptr,
+ CURLFORM_COPYNAME, name,
+ CURLFORM_STREAM, &pooh,
+ CURLFORM_CONTENTLEN, (curl_off_t) 2,
+ CURLFORM_END);
+ )
if(formrc) {
fprintf(stderr, "curl_formadd() = %d\n", (int) formrc);
goto test_cleanup;
/* We want to use our own read function. */
test_setopt(pooh.easy, CURLOPT_READFUNCTION, read_callback);
- /* Send a multi-part formpost. */
- test_setopt(pooh.easy, CURLOPT_HTTPPOST, formpost);
+ CURL_IGNORE_DEPRECATION(
+ /* Send a multi-part formpost. */
+ test_setopt(pooh.easy, CURLOPT_HTTPPOST, formpost);
+ )
#endif
#if defined(LIB670) || defined(LIB672)
#if defined(LIB670) || defined(LIB671)
curl_mime_free(mime);
#else
- curl_formfree(formpost);
+ CURL_IGNORE_DEPRECATION(
+ curl_formfree(formpost);
+ )
#endif
curl_global_cleanup();
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#define CURL_DISABLE_DEPRECATION /* Deprecated options are tested too */
#include "test.h"
#include "memdebug.h"
#include <limits.h>
res = CURLE_OUT_OF_MEMORY;
goto test_cleanup;
}
+
+ CURL_IGNORE_DEPRECATION(
HEADER
;
print <<FOOTER
+ )
+
curl_easy_setopt(curl, (CURLoption)1, 0);
res = CURLE_OK;
test_cleanup:
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#define CURL_DISABLE_DEPRECATION /* Testing the form api */
#include "curlcheck.h"
#include <curl/curl.h>
size_t total_size = 0;
char buffer[] = "test buffer";
- rc = curl_formadd(&post, &last, CURLFORM_COPYNAME, "name",
- CURLFORM_COPYCONTENTS, "content", CURLFORM_END);
-
+ CURL_IGNORE_DEPRECATION(
+ 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");
- rc = curl_formadd(&post, &last, CURLFORM_COPYNAME, "htmlcode",
- CURLFORM_COPYCONTENTS, "<HTML></HTML>",
- CURLFORM_CONTENTTYPE, "text/html", CURLFORM_END);
-
+ CURL_IGNORE_DEPRECATION(
+ rc = curl_formadd(&post, &last, CURLFORM_COPYNAME, "htmlcode",
+ CURLFORM_COPYCONTENTS, "<HTML></HTML>",
+ CURLFORM_CONTENTTYPE, "text/html", CURLFORM_END);
+ )
fail_unless(rc == 0, "curl_formadd returned error");
- rc = curl_formadd(&post, &last, CURLFORM_COPYNAME, "name_for_ptrcontent",
- CURLFORM_PTRCONTENTS, buffer, CURLFORM_END);
-
+ CURL_IGNORE_DEPRECATION(
+ rc = curl_formadd(&post, &last, CURLFORM_COPYNAME, "name_for_ptrcontent",
+ CURLFORM_PTRCONTENTS, buffer, CURLFORM_END);
+ )
fail_unless(rc == 0, "curl_formadd returned error");
- res = curl_formget(post, &total_size, print_httppost_callback);
-
+ CURL_IGNORE_DEPRECATION(
+ 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_formfree(post);
+ CURL_IGNORE_DEPRECATION(
+ curl_formfree(post);
+ )
/* start a new formpost with a file upload and formget */
post = last = NULL;
- rc = curl_formadd(&post, &last,
- CURLFORM_PTRNAME, "name of file field",
- CURLFORM_FILE, arg,
- CURLFORM_FILENAME, "custom named file",
- CURLFORM_END);
-
+ CURL_IGNORE_DEPRECATION(
+ rc = curl_formadd(&post, &last,
+ CURLFORM_PTRNAME, "name of file field",
+ CURLFORM_FILE, arg,
+ CURLFORM_FILENAME, "custom named file",
+ CURLFORM_END);
+ )
fail_unless(rc == 0, "curl_formadd returned error");
- res = curl_formget(post, &total_size, print_httppost_callback);
+ CURL_IGNORE_DEPRECATION(
+ 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_formfree(post);
+ CURL_IGNORE_DEPRECATION(
+ curl_formfree(post);
+ )
UNITTEST_STOP