mirror of
https://github.com/curl/curl.git
synced 2026-07-26 03:47:17 +03:00
tests: provide FTP directory contents in the test file
Instead of providing a fixed single synthetic response in the test server itself. To allow us to better use *different* directory listings in different test cases. In this change, most listings remain the same as before. The wildcard match tests still use synthetic responses but we should fix that as well. Updated numerous test cases to use this. Closes #14295
This commit is contained in:
parent
ae0b08ae6e
commit
14f630ecf6
42 changed files with 103 additions and 213 deletions
|
|
@ -55,18 +55,11 @@ CURLcode test(char *URL)
|
|||
|
||||
/*
|
||||
* Change the FTP_FILEMETHOD option to use full paths rather than a CWD
|
||||
* command. Alter the URL's path a bit, appending a "./". Use an innocuous
|
||||
* QUOTE command, after which curl will CWD to ftp_conn->entrypath and then
|
||||
* (on the next call to ftp_statemach_act) find a non-zero ftpconn->dirdepth
|
||||
* even though no directories are stored in the ftpconn->dirs array (after a
|
||||
* call to freedirs).
|
||||
* command. Use an innocuous QUOTE command, after which curl will CWD to
|
||||
* ftp_conn->entrypath and then (on the next call to ftp_statemach_act)
|
||||
* find a non-zero ftpconn->dirdepth even though no directories are stored
|
||||
* in the ftpconn->dirs array (after a call to freedirs).
|
||||
*/
|
||||
newURL = aprintf("%s./", URL);
|
||||
if(!newURL) {
|
||||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
slist = curl_slist_append(NULL, "SYST");
|
||||
if(!slist) {
|
||||
|
|
@ -76,7 +69,7 @@ CURLcode test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
test_setopt(curl, CURLOPT_URL, newURL);
|
||||
test_setopt(curl, CURLOPT_URL, libtest_arg2);
|
||||
test_setopt(curl, CURLOPT_FTP_FILEMETHOD, (long) CURLFTPMETHOD_NOCWD);
|
||||
test_setopt(curl, CURLOPT_QUOTE, slist);
|
||||
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ static int new_fnmatch(void *ptr,
|
|||
const char *pattern, const char *string)
|
||||
{
|
||||
(void)ptr;
|
||||
(void)pattern;
|
||||
(void)string;
|
||||
fprintf(stderr, "lib574: match string '%s' against pattern '%s'\n",
|
||||
string, pattern);
|
||||
return CURL_FNMATCHFUNC_MATCH;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue