2011-03-10 05:48:02 -05:00
|
|
|
/***************************************************************************
|
2006-10-25 05:20:44 -04:00
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2011-03-10 05:48:02 -05:00
|
|
|
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
|
|
|
*
|
|
|
|
* This software is licensed as described in the file COPYING, which
|
|
|
|
* you should have received as part of this distribution. The terms
|
|
|
|
* are also available at http://curl.haxx.se/docs/copyright.html.
|
|
|
|
*
|
|
|
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
* copies of the Software, and permit persons to whom the Software is
|
|
|
|
* furnished to do so, under the terms of the COPYING file.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
2006-10-25 05:20:44 -04:00
|
|
|
|
2004-01-13 02:35:28 -05:00
|
|
|
/* Now include the setup.h file from libcurl's private libdir (the source
|
2009-07-14 09:25:14 -04:00
|
|
|
version, but that might include "curl_config.h" from the build dir so we
|
|
|
|
need both of them in the include path), so that we get good in-depth
|
|
|
|
knowledge about the system we're building this on */
|
2007-02-21 21:51:54 -05:00
|
|
|
|
2010-02-02 07:39:10 -05:00
|
|
|
#define CURL_NO_OLDIES
|
|
|
|
|
2004-01-13 02:35:28 -05:00
|
|
|
#include "setup.h"
|
2003-03-12 03:54:11 -05:00
|
|
|
|
2008-07-15 01:46:49 -04:00
|
|
|
#include <curl/curl.h>
|
2003-04-15 09:32:26 -04:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
2004-05-14 04:40:33 -04:00
|
|
|
#include <stdlib.h>
|
2003-04-15 09:32:26 -04:00
|
|
|
|
2004-03-03 05:09:16 -05:00
|
|
|
#ifdef HAVE_SYS_SOCKET_H
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_SYS_SELECT_H
|
|
|
|
/* since so many tests use select(), we can just as well include it here */
|
|
|
|
#include <sys/select.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
/* at least somewhat oldish FreeBSD systems need this for select() */
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
|
|
|
|
2009-05-01 08:39:40 -04:00
|
|
|
#ifdef TPF
|
|
|
|
# include "select.h"
|
|
|
|
#endif
|
|
|
|
|
2006-10-25 01:59:46 -04:00
|
|
|
#define TEST_ERR_MAJOR_BAD 100
|
|
|
|
#define TEST_ERR_RUNS_FOREVER 99
|
|
|
|
|
2010-02-05 13:07:19 -05:00
|
|
|
#define test_setopt(A,B,C) \
|
|
|
|
if((res = curl_easy_setopt((A),(B),(C))) != CURLE_OK) goto test_cleanup
|
|
|
|
|
2011-03-07 18:19:49 -05:00
|
|
|
#define test_multi_setopt(A,B,C) \
|
|
|
|
if((res = curl_multi_setopt((A),(B),(C))) != CURLE_OK) goto test_cleanup
|
|
|
|
|
2007-10-02 12:05:28 -04:00
|
|
|
extern char *libtest_arg2; /* set by first.c to the argv[2] or NULL */
|
|
|
|
extern char *libtest_arg3; /* set by first.c to the argv[3] or NULL */
|
2006-09-10 15:01:04 -04:00
|
|
|
|
2007-07-15 16:59:43 -04:00
|
|
|
/* argc and argv as passed in to the main() function */
|
|
|
|
extern int test_argc;
|
|
|
|
extern char **test_argv;
|
|
|
|
|
2008-09-18 12:21:09 -04:00
|
|
|
extern int select_test(int num_fds, fd_set *rd, fd_set *wr, fd_set *exc,
|
|
|
|
struct timeval *tv);
|
|
|
|
|
|
|
|
extern int test(char *URL); /* the actual test function provided by each
|
|
|
|
individual libXXX.c file */
|
2006-09-10 15:01:04 -04:00
|
|
|
|
2011-05-25 14:22:46 -04:00
|
|
|
#ifdef UNITTESTS
|
|
|
|
extern int unitfail;
|
|
|
|
#endif
|