Git init
[external/curl.git] / tests / libtest / lib501.c
1 /*****************************************************************************
2  *                                  _   _ ____  _
3  *  Project                     ___| | | |  _ \| |
4  *                             / __| | | | |_) | |
5  *                            | (__| |_| |  _ <| |___
6  *                             \___|\___/|_| \_\_____|
7  *
8  */
9
10 #include "test.h"
11
12 #include "memdebug.h"
13
14 int test(char *URL)
15 {
16   CURLcode res;
17   CURL *curl;
18
19   (void)URL; /* we don't use this */
20
21   if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
22     fprintf(stderr, "curl_global_init() failed\n");
23     return TEST_ERR_MAJOR_BAD;
24   }
25
26   if ((curl = curl_easy_init()) == NULL) {
27     fprintf(stderr, "curl_easy_init() failed\n");
28     curl_global_cleanup();
29     return TEST_ERR_MAJOR_BAD;
30   }
31
32   test_setopt(curl, CURLOPT_HEADER, 1L);
33
34   res = curl_easy_perform(curl);
35
36 test_cleanup:
37
38   curl_easy_cleanup(curl);
39   curl_global_cleanup();
40
41   return (int)res;
42 }
43