blob: 9e79cb41e2ade21baa66c43a3761c2f74d51373d [file] [log] [blame]
9487f7f2011-08-03 07:05:30 -07001/*****************************************************************************
2 * _ _ ____ _
3 * Project ___| | | | _ \| |
4 * / __| | | | |_) | |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
7 *
8 */
9
10#include "test.h"
11
12#include "memdebug.h"
13
14int test(char *URL)
15{
16 CURLcode res;
17 CURL *curl;
18
19 if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
20 fprintf(stderr, "curl_global_init() failed\n");
21 return TEST_ERR_MAJOR_BAD;
22 }
23
24 if ((curl = curl_easy_init()) == NULL) {
25 fprintf(stderr, "curl_easy_init() failed\n");
26 curl_global_cleanup();
27 return TEST_ERR_MAJOR_BAD;
28 }
29
30 test_setopt(curl, CURLOPT_URL, URL);
31 test_setopt(curl, CURLOPT_PORT, strtol(libtest_arg2, NULL, 10));
32 test_setopt(curl, CURLOPT_USERPWD, "xxx:yyy");
33 test_setopt(curl, CURLOPT_VERBOSE, 1L);
34
35 res = curl_easy_perform(curl);
36
37test_cleanup:
38
39 curl_easy_cleanup(curl);
40 curl_global_cleanup();
41
42 return (int)res;
43}
44