mirror of
https://github.com/curl/curl.git
synced 2026-04-14 23:51:42 +03:00
test: make unittest 1308 into a libtest
Test 1308 was wrongly marked a unit test when in reality it is a libtest. Closes #16891
This commit is contained in:
parent
202a333e4d
commit
1d84d683bb
7 changed files with 18 additions and 31 deletions
|
|
@ -1,7 +1,6 @@
|
|||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
unittest
|
||||
curl_formadd
|
||||
curl_formget
|
||||
FORM
|
||||
|
|
@ -12,7 +11,6 @@ FORM
|
|||
# Client-side
|
||||
<client>
|
||||
<features>
|
||||
unittest
|
||||
http
|
||||
form-api
|
||||
</features>
|
||||
|
|
@ -20,8 +18,11 @@ form-api
|
|||
none
|
||||
</server>
|
||||
<name>
|
||||
formpost unit tests
|
||||
formpost tests
|
||||
</name>
|
||||
<tool>
|
||||
lib%TESTNUMBER
|
||||
</tool>
|
||||
<command>
|
||||
%LOGDIR/test-%TESTNUMBER
|
||||
</command>
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ foreach(_target IN LISTS LIBTESTPROGS)
|
|||
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h"
|
||||
"${PROJECT_SOURCE_DIR}/src" # for "tool_binmode.h"
|
||||
"${PROJECT_SOURCE_DIR}/tests/libtest" # to be able to build generated tests
|
||||
"${PROJECT_SOURCE_DIR}/tests/unit" # for curlcheck.h
|
||||
)
|
||||
set_property(TARGET ${_target_name} APPEND PROPERTY COMPILE_DEFINITIONS "${CURL_DEBUG_MACROS}")
|
||||
if(NOT CURL_TEST_BUNDLES)
|
||||
|
|
|
|||
|
|
@ -36,7 +36,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \
|
|||
-I$(top_builddir)/lib \
|
||||
-I$(top_srcdir)/lib \
|
||||
-I$(top_srcdir)/src \
|
||||
-I$(top_srcdir)/tests/libtest
|
||||
-I$(top_srcdir)/tests/libtest \
|
||||
-I$(top_srcdir)/tests/unit
|
||||
|
||||
EXTRA_DIST = test307.pl test610.pl test613.pl test1013.pl test1022.pl \
|
||||
CMakeLists.txt mk-lib1521.pl .checksrc
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ LIBTESTPROGS = libauthretry libntlmconnect libprereq \
|
|||
lib696 \
|
||||
lib1156 \
|
||||
lib1301 \
|
||||
lib1308 \
|
||||
lib1485 \
|
||||
lib1500 lib1501 lib1502 lib1503 lib1504 lib1505 lib1506 lib1507 lib1508 \
|
||||
lib1509 lib1510 lib1511 lib1512 lib1513 lib1514 lib1515 lib1517 \
|
||||
|
|
@ -351,6 +352,9 @@ lib696_CPPFLAGS = $(AM_CPPFLAGS) -DLIB696
|
|||
lib1301_SOURCES = lib1301.c $(SUPPORTFILES) $(TESTUTIL)
|
||||
lib1301_LDADD = $(TESTUTIL_LIBS)
|
||||
|
||||
lib1308_SOURCES = lib1308.c $(SUPPORTFILES)
|
||||
lib1308_LDADD = $(TESTUTIL_LIBS)
|
||||
|
||||
lib1485_SOURCES = lib1485.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
|
||||
lib1485_LDADD = $(TESTUTIL_LIBS)
|
||||
|
||||
|
|
|
|||
|
|
@ -21,16 +21,7 @@
|
|||
* SPDX-License-Identifier: curl
|
||||
*
|
||||
***************************************************************************/
|
||||
#include "test.h"
|
||||
|
||||
#define fail_unless(expr, msg) \
|
||||
do { \
|
||||
if(!(expr)) { \
|
||||
fprintf(stderr, "%s:%d Assertion '%s' failed: %s\n", \
|
||||
__FILE__, __LINE__, #expr, msg); \
|
||||
return TEST_ERR_FAILURE; \
|
||||
} \
|
||||
} while(0)
|
||||
#include "curlcheck.h"
|
||||
|
||||
CURLcode test(char *URL)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -25,16 +25,6 @@
|
|||
|
||||
#include <curl/curl.h>
|
||||
|
||||
static CURLcode unit_setup(void)
|
||||
{
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static void unit_stop(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static size_t print_httppost_callback(void *arg, const char *buf, size_t len)
|
||||
{
|
||||
fwrite(buf, len, 1, stdout);
|
||||
|
|
@ -42,7 +32,8 @@ static size_t print_httppost_callback(void *arg, const char *buf, size_t len)
|
|||
return len;
|
||||
}
|
||||
|
||||
UNITTEST_START
|
||||
CURLcode test(char *URL)
|
||||
{
|
||||
CURLFORMcode rc;
|
||||
int res;
|
||||
struct curl_httppost *post = NULL;
|
||||
|
|
@ -90,7 +81,7 @@ UNITTEST_START
|
|||
CURL_IGNORE_DEPRECATION(
|
||||
rc = curl_formadd(&post, &last,
|
||||
CURLFORM_PTRNAME, "name of file field",
|
||||
CURLFORM_FILE, arg,
|
||||
CURLFORM_FILE, URL,
|
||||
CURLFORM_FILENAME, "custom named file",
|
||||
CURLFORM_END);
|
||||
)
|
||||
|
|
@ -105,5 +96,5 @@ UNITTEST_START
|
|||
CURL_IGNORE_DEPRECATION(
|
||||
curl_formfree(post);
|
||||
)
|
||||
|
||||
UNITTEST_STOP
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
|
@ -32,7 +32,7 @@ UNITFILES = curlcheck.h $(FIRSTFILES)
|
|||
|
||||
# These are all unit test programs
|
||||
UNITPROGS = unit1300 unit1302 unit1303 unit1304 unit1305 unit1307 \
|
||||
unit1308 unit1309 unit1323 \
|
||||
unit1309 unit1323 \
|
||||
unit1330 unit1394 unit1395 unit1396 unit1397 unit1398 \
|
||||
unit1399 \
|
||||
unit1600 unit1601 unit1602 unit1603 unit1604 unit1605 unit1606 unit1607 \
|
||||
|
|
@ -56,8 +56,6 @@ unit1305_SOURCES = unit1305.c $(UNITFILES)
|
|||
|
||||
unit1307_SOURCES = unit1307.c $(UNITFILES)
|
||||
|
||||
unit1308_SOURCES = unit1308.c $(UNITFILES)
|
||||
|
||||
unit1309_SOURCES = unit1309.c $(UNITFILES)
|
||||
|
||||
unit1323_SOURCES = unit1323.c $(UNITFILES)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue