1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-15 14:05:03 -05:00

undo using internal *printf() clones for test #530

This commit is contained in:
Yang Tse 2008-01-21 05:35:08 +00:00
parent a4eddf0d0d
commit 3caeb0a91f
2 changed files with 10 additions and 8 deletions

View File

@ -30,7 +30,6 @@ AUTOMAKE_OPTIONS = foreign nostdinc
# setup.h file # setup.h file
INCLUDES = -I$(top_srcdir)/include/curl \ INCLUDES = -I$(top_srcdir)/include/curl \
-I$(top_srcdir)/include \
-I$(top_builddir)/lib \ -I$(top_builddir)/lib \
-I$(top_srcdir)/lib -I$(top_srcdir)/lib
@ -40,7 +39,6 @@ EXTRA_DIST = test75.pl test307.pl test610.pl test613.pl test1013.pl
# files used only in some libcurl test programs # files used only in some libcurl test programs
TESTUTIL = testutil.c testutil.h TESTUTIL = testutil.c testutil.h
MPRINTF = $(top_srcdir)/lib/mprintf.c $(top_srcdir)/lib/mprintf.h
# these files are used in every single test program below # these files are used in every single test program below
SUPPORTFILES = first.c test.h SUPPORTFILES = first.c test.h
@ -116,7 +114,7 @@ lib527_CFLAGS = -DLIB527
lib529_SOURCES = lib525.c $(SUPPORTFILES) $(TESTUTIL) lib529_SOURCES = lib525.c $(SUPPORTFILES) $(TESTUTIL)
lib529_CFLAGS = -DLIB529 lib529_CFLAGS = -DLIB529
lib530_SOURCES = lib530.c $(SUPPORTFILES) $(TESTUTIL) $(MPRINTF) lib530_SOURCES = lib530.c $(SUPPORTFILES) $(TESTUTIL)
lib530_CFLAGS = -DLIB530 lib530_CFLAGS = -DLIB530
lib532_SOURCES = lib526.c $(SUPPORTFILES) $(TESTUTIL) lib532_SOURCES = lib526.c $(SUPPORTFILES) $(TESTUTIL)

View File

@ -10,11 +10,15 @@
#include "test.h" #include "test.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h> #include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h> #include <sys/stat.h>
#endif
#define ENABLE_CURLX_PRINTF #ifdef HAVE_STRING_H
#include "curlx.h" #include <string.h>
#endif
#include "testutil.h" #include "testutil.h"
@ -35,7 +39,7 @@ int test(char *URL)
struct timeval mp_start; struct timeval mp_start;
char ml_timedout = FALSE; char ml_timedout = FALSE;
char mp_timedout = FALSE; char mp_timedout = FALSE;
char target_url[80]; char target_url[256];
if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
fprintf(stderr, "curl_global_init() failed\n"); fprintf(stderr, "curl_global_init() failed\n");
@ -62,7 +66,7 @@ int test(char *URL)
curl_global_cleanup(); curl_global_cleanup();
return TEST_ERR_MAJOR_BAD + i; return TEST_ERR_MAJOR_BAD + i;
} }
snprintf(target_url, sizeof(target_url), "%s%04i", URL, i + 1); sprintf(target_url, "%s%04i", URL, i + 1);
target_url[sizeof(target_url) - 1] = '\0'; target_url[sizeof(target_url) - 1] = '\0';
curl_easy_setopt(curl[i], CURLOPT_URL, target_url); curl_easy_setopt(curl[i], CURLOPT_URL, target_url);