http
</server>
<tool>
-lib%TESTNUMBER
+lib1502
</tool>
<name>
HTTP multi with CURLOPT_RESOLVE, cleanup sequence PA
http
</server>
<tool>
-lib%TESTNUMBER
+lib1502
</tool>
<name>
HTTP multi with CURLOPT_RESOLVE, cleanup sequence UB
http
</server>
<tool>
-lib%TESTNUMBER
+lib1502
</tool>
<name>
HTTP multi with CURLOPT_RESOLVE, cleanup sequence PB
lib1301 \
lib1308 \
lib1485 \
- lib1500 lib1501 lib1502 lib1503 lib1504 lib1505 lib1506 lib1507 lib1508 \
+ lib1500 lib1501 lib1502 lib1506 lib1507 lib1508 \
lib1509 lib1510 lib1511 lib1512 lib1513 lib1514 lib1515 lib1517 \
lib1518 lib1520 lib1521 lib1522 lib1523 \
lib1525 lib1526 lib1527 lib1528 lib1529 lib1530 lib1531 lib1532 lib1533 \
lib1502_SOURCES = lib1502.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1502_LDADD = $(TESTUTIL_LIBS)
-lib1502_CPPFLAGS = $(AM_CPPFLAGS) -DLIB1502
-
-lib1503_SOURCES = lib1502.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
-lib1503_LDADD = $(TESTUTIL_LIBS)
-lib1503_CPPFLAGS = $(AM_CPPFLAGS) -DLIB1503
-
-lib1504_SOURCES = lib1502.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
-lib1504_LDADD = $(TESTUTIL_LIBS)
-lib1504_CPPFLAGS = $(AM_CPPFLAGS) -DLIB1504
-
-lib1505_SOURCES = lib1502.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
-lib1505_LDADD = $(TESTUTIL_LIBS)
-lib1505_CPPFLAGS = $(AM_CPPFLAGS) -DLIB1505
lib1506_SOURCES = lib1506.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1506_LDADD = $(TESTUTIL_LIBS)
char *libtest_arg4 = NULL;
int test_argc;
char **test_argv;
+int testnum;
struct timeval tv_test_start; /* for test timing */
CURLcode result;
int basearg;
test_func_t test_func;
+ char *env;
CURL_SET_BINMODE(stdout);
URL = argv[basearg]; /* provide this to the rest */
+ env = getenv("CURL_TESTNUM");
+ if(env)
+ testnum = atoi(env);
+ else
+ testnum = 0;
+
curl_mfprintf(stderr, "URL: %s\n", URL);
result = test_func(URL);
***************************************************************************/
/*
* This source code is used for lib1502, lib1503, lib1504 and lib1505 with
- * only #ifdefs controlling the cleanup sequence.
+ * only the testnum controlling the cleanup sequence.
*
* Test case 1502 converted from bug report #3575448, identifying a memory
* leak in the CURLOPT_RESOLVE handling with the multi interface.
CURLM *multi = NULL;
int still_running;
CURLcode res = CURLE_OK;
-
char redirect[160];
/* DNS cache injection */
test_cleanup:
-#ifdef LIB1502
- /* undocumented cleanup sequence - type UA */
- curl_multi_cleanup(multi);
- curl_easy_cleanup(easy);
- curl_global_cleanup();
-#endif
-
-#ifdef LIB1503
- /* proper cleanup sequence - type PA */
- curl_multi_remove_handle(multi, easy);
- curl_multi_cleanup(multi);
- curl_easy_cleanup(easy);
- curl_global_cleanup();
-#endif
-
-#ifdef LIB1504
- /* undocumented cleanup sequence - type UB */
- curl_easy_cleanup(easy);
- curl_multi_cleanup(multi);
- curl_global_cleanup();
-#endif
-
-#ifdef LIB1505
- /* proper cleanup sequence - type PB */
- curl_multi_remove_handle(multi, easy);
- curl_easy_cleanup(easy);
- curl_multi_cleanup(multi);
- curl_global_cleanup();
-#endif
+ switch(testnum) {
+ case 1502:
+ default:
+ /* undocumented cleanup sequence - type UA */
+ curl_multi_cleanup(multi);
+ curl_easy_cleanup(easy);
+ curl_global_cleanup();
+ break;
+ case 1503:
+ /* proper cleanup sequence - type PA */
+ curl_multi_remove_handle(multi, easy);
+ curl_multi_cleanup(multi);
+ curl_easy_cleanup(easy);
+ curl_global_cleanup();
+ break;
+ case 1504:
+ /* undocumented cleanup sequence - type UB */
+ curl_easy_cleanup(easy);
+ curl_multi_cleanup(multi);
+ curl_global_cleanup();
+ break;
+ case 1505:
+ /* proper cleanup sequence - type PB */
+ curl_multi_remove_handle(multi, easy);
+ curl_easy_cleanup(easy);
+ curl_multi_cleanup(multi);
+ curl_global_cleanup();
+ break;
+ }
curl_slist_free_all(dns_cache_list);
/* argc and argv as passed in to the main() function */
extern int test_argc;
extern char **test_argv;
-
+extern int testnum;
extern struct timeval tv_test_start; /* for test timing */
extern int select_wrapper(int nfds, fd_set *rd, fd_set *wr, fd_set *exc,
# write the instructions to file
writearray("$LOGDIR/$SERVERCMD", \@ftpservercmd);
+ # provide an environment variable
+ $ENV{'CURL_TESTNUM'} = $testnum;
+
# create (possibly-empty) files before starting the test
for my $partsuffix (('', '1', '2', '3', '4')) {
my @inputfile=getpart("client", "file".$partsuffix);