diff options
author | Pavel Raiskup <xraisk00@gmail.com> | 2010-05-12 15:33:22 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2010-05-12 23:17:51 +0200 |
commit | 0825cd80a62c21725fb3615f1fdd3aa6cc5f0f34 (patch) | |
tree | 6c6e3f2cfc9767031e1c2093a522d80d7f18edcb /tests/libtest/lib574.c | |
parent | 04cb15ae9dc0e863487ee55de2226cf5033311c0 (diff) | |
download | curl-0825cd80a62c21725fb3615f1fdd3aa6cc5f0f34.tar.gz |
FTP: WILDCARDMATCH/CHUNKING/FNMATCH added
Diffstat (limited to 'tests/libtest/lib574.c')
-rw-r--r-- | tests/libtest/lib574.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/tests/libtest/lib574.c b/tests/libtest/lib574.c new file mode 100644 index 000000000..69b2979a8 --- /dev/null +++ b/tests/libtest/lib574.c @@ -0,0 +1,56 @@ +/***************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + */ + +#include "test.h" + +#include "memdebug.h" + +static int new_fnmatch(const char *pattern, const char *string) +{ + (void)pattern; + (void)string; + return CURL_FNMATCHFUNC_MATCH; +} + +int test(char *URL) +{ + int res; + CURL *curl; + + if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { + fprintf(stderr, "curl_global_init() failed\n"); + return TEST_ERR_MAJOR_BAD; + } + + if ((curl = curl_easy_init()) == NULL) { + fprintf(stderr, "curl_easy_init() failed\n"); + curl_global_cleanup(); + return TEST_ERR_MAJOR_BAD; + } + + test_setopt(curl, CURLOPT_URL, URL); + test_setopt(curl, CURLOPT_WILDCARDMATCH, 1L); + test_setopt(curl, CURLOPT_FNMATCH_FUNCTION, new_fnmatch); + + res = curl_easy_perform(curl); + if(res) { + fprintf(stderr, "curl_easy_perform() failed %d\n", res); + goto test_cleanup; + } + res = curl_easy_perform(curl); + if(res) { + fprintf(stderr, "curl_easy_perform() failed %d\n", res); + goto test_cleanup; + } + +test_cleanup: + curl_easy_cleanup(curl); + curl_global_cleanup(); + return res; +} |