sources: update source headers
[platform/upstream/curl.git] / tests / libtest / test.h
1 /***************************************************************************
2  *                                  _   _ ____  _
3  *  Project                     ___| | | |  _ \| |
4  *                             / __| | | | |_) | |
5  *                            | (__| |_| |  _ <| |___
6  *                             \___|\___/|_| \_\_____|
7  *
8  * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
9  *
10  * This software is licensed as described in the file COPYING, which
11  * you should have received as part of this distribution. The terms
12  * are also available at http://curl.haxx.se/docs/copyright.html.
13  *
14  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15  * copies of the Software, and permit persons to whom the Software is
16  * furnished to do so, under the terms of the COPYING file.
17  *
18  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19  * KIND, either express or implied.
20  *
21  ***************************************************************************/
22
23 /* Now include the setup.h file from libcurl's private libdir (the source
24    version, but that might include "curl_config.h" from the build dir so we
25    need both of them in the include path), so that we get good in-depth
26    knowledge about the system we're building this on */
27
28 #define CURL_NO_OLDIES
29
30 #include "setup.h"
31
32 #include <curl/curl.h>
33 #include <stdio.h>
34 #include <string.h>
35 #include <stdlib.h>
36 #include <errno.h>
37
38 #ifdef HAVE_SYS_SOCKET_H
39 #include <sys/socket.h>
40 #endif
41 #ifdef HAVE_SYS_SELECT_H
42 /* since so many tests use select(), we can just as well include it here */
43 #include <sys/select.h>
44 #endif
45 #ifdef HAVE_UNISTD_H
46 /* at least somewhat oldish FreeBSD systems need this for select() */
47 #include <unistd.h>
48 #endif
49
50 #ifdef TPF
51 #  include "select.h"
52 #endif
53
54 #define TEST_ERR_MAJOR_BAD     100
55 #define TEST_ERR_RUNS_FOREVER   99
56
57 #define test_setopt(A,B,C) \
58   if((res = curl_easy_setopt((A),(B),(C))) != CURLE_OK) goto test_cleanup
59
60 #define test_multi_setopt(A,B,C) \
61   if((res = curl_multi_setopt((A),(B),(C))) != CURLE_OK) goto test_cleanup
62
63 extern char *libtest_arg2; /* set by first.c to the argv[2] or NULL */
64 extern char *libtest_arg3; /* set by first.c to the argv[3] or NULL */
65
66 /* argc and argv as passed in to the main() function */
67 extern int test_argc;
68 extern char **test_argv;
69
70 extern int select_test(int num_fds, fd_set *rd, fd_set *wr, fd_set *exc,
71                        struct timeval *tv);
72
73 extern int test(char *URL); /* the actual test function provided by each
74                                individual libXXX.c file */
75