aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2019-05-26 17:43:47 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2019-05-26 18:02:50 +0300
commitf1bf7918364c4b6dd33ebefa4814ec28dbbe08b0 (patch)
tree8f5740c5a161a383dd8f29d0d62aef998144031f
parentdc4af6f6001a35f965a088d9b20d6a26cd94254a (diff)
downloadlibmicrohttpd-f1bf7918364c4b6dd33ebefa4814ec28dbbe08b0.tar.gz
libmicrohttpd-f1bf7918364c4b6dd33ebefa4814ec28dbbe08b0.zip
curl tests: fixed detection of "11" marker on w32
-rw-r--r--src/testcurl/Makefile.am46
-rw-r--r--src/testcurl/mhd_has_in_name.h65
-rw-r--r--src/testcurl/perf_get.c6
-rw-r--r--src/testcurl/test_delete.c6
-rw-r--r--src/testcurl/test_get.c6
-rw-r--r--src/testcurl/test_get_response_cleanup.c7
-rw-r--r--src/testcurl/test_get_sendfile.c6
-rw-r--r--src/testcurl/test_iplimit.c6
-rw-r--r--src/testcurl/test_long_header.c6
-rw-r--r--src/testcurl/test_parse_cookies.c6
-rw-r--r--src/testcurl/test_post.c7
-rw-r--r--src/testcurl/test_post_loop.c8
-rw-r--r--src/testcurl/test_postform.c7
-rw-r--r--src/testcurl/test_process_arguments.c6
-rw-r--r--src/testcurl/test_process_headers.c6
-rw-r--r--src/testcurl/test_put.c6
-rw-r--r--src/testcurl/test_timeout.c6
-rw-r--r--src/testcurl/test_urlparse.c6
18 files changed, 156 insertions, 56 deletions
diff --git a/src/testcurl/Makefile.am b/src/testcurl/Makefile.am
index c8bb5cec..881615a8 100644
--- a/src/testcurl/Makefile.am
+++ b/src/testcurl/Makefile.am
@@ -109,7 +109,7 @@ test_concurrent_stop_LDADD = \
109 $(PTHREAD_LIBS) @LIBCURL@ 109 $(PTHREAD_LIBS) @LIBCURL@
110 110
111test_get_SOURCES = \ 111test_get_SOURCES = \
112 test_get.c 112 test_get.c mhd_has_in_name.h
113test_get_LDADD = \ 113test_get_LDADD = \
114 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 114 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
115 @LIBCURL@ 115 @LIBCURL@
@@ -138,7 +138,7 @@ test_callback_LDADD = \
138 138
139perf_get_SOURCES = \ 139perf_get_SOURCES = \
140 perf_get.c \ 140 perf_get.c \
141 gauger.h 141 gauger.h mhd_has_in_name.h
142perf_get_LDADD = \ 142perf_get_LDADD = \
143 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 143 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
144 @LIBCURL@ 144 @LIBCURL@
@@ -180,19 +180,19 @@ test_digestauth_with_arguments_LDADD = \
180 @LIBGCRYPT_LIBS@ @LIBCURL@ 180 @LIBGCRYPT_LIBS@ @LIBCURL@
181 181
182test_get_sendfile_SOURCES = \ 182test_get_sendfile_SOURCES = \
183 test_get_sendfile.c 183 test_get_sendfile.c mhd_has_in_name.h
184test_get_sendfile_LDADD = \ 184test_get_sendfile_LDADD = \
185 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 185 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
186 @LIBCURL@ 186 @LIBCURL@
187 187
188test_urlparse_SOURCES = \ 188test_urlparse_SOURCES = \
189 test_urlparse.c 189 test_urlparse.c mhd_has_in_name.h
190test_urlparse_LDADD = \ 190test_urlparse_LDADD = \
191 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 191 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
192 @LIBCURL@ 192 @LIBCURL@
193 193
194test_get_response_cleanup_SOURCES = \ 194test_get_response_cleanup_SOURCES = \
195 test_get_response_cleanup.c 195 test_get_response_cleanup.c mhd_has_in_name.h
196test_get_response_cleanup_LDADD = \ 196test_get_response_cleanup_LDADD = \
197 $(top_builddir)/src/microhttpd/libmicrohttpd.la 197 $(top_builddir)/src/microhttpd/libmicrohttpd.la
198 198
@@ -203,49 +203,49 @@ test_get_chunked_LDADD = \
203 @LIBCURL@ 203 @LIBCURL@
204 204
205test_post_SOURCES = \ 205test_post_SOURCES = \
206 test_post.c 206 test_post.c mhd_has_in_name.h
207test_post_LDADD = \ 207test_post_LDADD = \
208 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 208 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
209 @LIBCURL@ 209 @LIBCURL@
210 210
211test_process_headers_SOURCES = \ 211test_process_headers_SOURCES = \
212 test_process_headers.c 212 test_process_headers.c mhd_has_in_name.h
213test_process_headers_LDADD = \ 213test_process_headers_LDADD = \
214 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 214 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
215 @LIBCURL@ 215 @LIBCURL@
216 216
217test_parse_cookies_SOURCES = \ 217test_parse_cookies_SOURCES = \
218 test_parse_cookies.c 218 test_parse_cookies.c mhd_has_in_name.h
219test_parse_cookies_LDADD = \ 219test_parse_cookies_LDADD = \
220 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 220 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
221 @LIBCURL@ 221 @LIBCURL@
222 222
223test_process_arguments_SOURCES = \ 223test_process_arguments_SOURCES = \
224 test_process_arguments.c 224 test_process_arguments.c mhd_has_in_name.h
225test_process_arguments_LDADD = \ 225test_process_arguments_LDADD = \
226 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 226 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
227 @LIBCURL@ 227 @LIBCURL@
228 228
229test_postform_SOURCES = \ 229test_postform_SOURCES = \
230 test_postform.c 230 test_postform.c mhd_has_in_name.h
231test_postform_LDADD = \ 231test_postform_LDADD = \
232 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 232 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
233 @LIBGCRYPT_LIBS@ @LIBCURL@ 233 @LIBGCRYPT_LIBS@ @LIBCURL@
234 234
235test_post_loop_SOURCES = \ 235test_post_loop_SOURCES = \
236 test_post_loop.c 236 test_post_loop.c mhd_has_in_name.h
237test_post_loop_LDADD = \ 237test_post_loop_LDADD = \
238 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 238 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
239 @LIBCURL@ 239 @LIBCURL@
240 240
241test_delete_SOURCES = \ 241test_delete_SOURCES = \
242 test_delete.c 242 test_delete.c mhd_has_in_name.h
243test_delete_LDADD = \ 243test_delete_LDADD = \
244 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 244 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
245 @LIBCURL@ 245 @LIBCURL@
246 246
247test_put_SOURCES = \ 247test_put_SOURCES = \
248 test_put.c 248 test_put.c mhd_has_in_name.h
249test_put_LDADD = \ 249test_put_LDADD = \
250 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 250 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
251 @LIBCURL@ 251 @LIBCURL@
@@ -257,37 +257,37 @@ test_put_chunked_LDADD = \
257 @LIBCURL@ 257 @LIBCURL@
258 258
259test_get11_SOURCES = \ 259test_get11_SOURCES = \
260 test_get.c 260 test_get.c mhd_has_in_name.h
261test_get11_LDADD = \ 261test_get11_LDADD = \
262 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 262 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
263 @LIBCURL@ 263 @LIBCURL@
264 264
265test_get_sendfile11_SOURCES = \ 265test_get_sendfile11_SOURCES = \
266 test_get_sendfile.c 266 test_get_sendfile.c mhd_has_in_name.h
267test_get_sendfile11_LDADD = \ 267test_get_sendfile11_LDADD = \
268 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 268 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
269 @LIBCURL@ 269 @LIBCURL@
270 270
271test_post11_SOURCES = \ 271test_post11_SOURCES = \
272 test_post.c 272 test_post.c mhd_has_in_name.h
273test_post11_LDADD = \ 273test_post11_LDADD = \
274 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 274 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
275 @LIBCURL@ 275 @LIBCURL@
276 276
277test_postform11_SOURCES = \ 277test_postform11_SOURCES = \
278 test_postform.c 278 test_postform.c mhd_has_in_name.h
279test_postform11_LDADD = \ 279test_postform11_LDADD = \
280 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 280 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
281 @LIBGCRYPT_LIBS@ @LIBCURL@ 281 @LIBGCRYPT_LIBS@ @LIBCURL@
282 282
283test_post_loop11_SOURCES = \ 283test_post_loop11_SOURCES = \
284 test_post_loop.c 284 test_post_loop.c mhd_has_in_name.h
285test_post_loop11_LDADD = \ 285test_post_loop11_LDADD = \
286 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 286 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
287 @LIBCURL@ 287 @LIBCURL@
288 288
289test_put11_SOURCES = \ 289test_put11_SOURCES = \
290 test_put.c 290 test_put.c mhd_has_in_name.h
291test_put11_LDADD = \ 291test_put11_LDADD = \
292 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 292 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
293 @LIBCURL@ 293 @LIBCURL@
@@ -311,19 +311,19 @@ test_large_put_inc11_LDADD = \
311 @LIBCURL@ 311 @LIBCURL@
312 312
313test_long_header_SOURCES = \ 313test_long_header_SOURCES = \
314 test_long_header.c 314 test_long_header.c mhd_has_in_name.h
315test_long_header_LDADD = \ 315test_long_header_LDADD = \
316 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 316 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
317 @LIBCURL@ 317 @LIBCURL@
318 318
319test_long_header11_SOURCES = \ 319test_long_header11_SOURCES = \
320 test_long_header.c 320 test_long_header.c mhd_has_in_name.h
321test_long_header11_LDADD = \ 321test_long_header11_LDADD = \
322 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 322 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
323 @LIBCURL@ 323 @LIBCURL@
324 324
325test_iplimit11_SOURCES = \ 325test_iplimit11_SOURCES = \
326 test_iplimit.c 326 test_iplimit.c mhd_has_in_name.h
327test_iplimit11_LDADD = \ 327test_iplimit11_LDADD = \
328 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 328 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
329 @LIBCURL@ 329 @LIBCURL@
@@ -335,7 +335,7 @@ test_termination_LDADD = \
335 @LIBCURL@ 335 @LIBCURL@
336 336
337test_timeout_SOURCES = \ 337test_timeout_SOURCES = \
338 test_timeout.c 338 test_timeout.c mhd_has_in_name.h
339test_timeout_LDADD = \ 339test_timeout_LDADD = \
340 $(top_builddir)/src/microhttpd/libmicrohttpd.la \ 340 $(top_builddir)/src/microhttpd/libmicrohttpd.la \
341 @LIBCURL@ 341 @LIBCURL@
diff --git a/src/testcurl/mhd_has_in_name.h b/src/testcurl/mhd_has_in_name.h
new file mode 100644
index 00000000..50f32cca
--- /dev/null
+++ b/src/testcurl/mhd_has_in_name.h
@@ -0,0 +1,65 @@
1/*
2 This file is part of libmicrohttpd
3 Copyright (C) 2016-2019 Karlson2k (Evgeny Grin)
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18*/
19
20/**
21 * @file testcurl/mhd_has_in_name.h
22 * @brief Static functions and macros helpers for testsuite.
23 * @author Karlson2k (Evgeny Grin)
24 */
25
26#include <string.h>
27
28/**
29 * Check whether program name contains specific @a marker string.
30 * Only last component in pathname is checked for marker presence,
31 * all leading directories names (if any) are ignored. Directories
32 * separators are handled correctly on both non-W32 and W32
33 * platforms.
34 * @param prog_name program name, may include path
35 * @param marker marker to look for.
36 * @return zero if any parameter is NULL or empty string or
37 * @prog_name ends with slash or @marker is not found in
38 * program name, non-zero if @maker is found in program
39 * name.
40 */
41static int
42has_in_name(const char *prog_name, const char *marker)
43{
44 size_t name_pos;
45 size_t pos;
46
47 if (!prog_name || !marker || !prog_name[0] || !marker[0])
48 return 0;
49
50 pos = 0;
51 name_pos = 0;
52 while (prog_name[pos])
53 {
54 if ('/' == prog_name[pos])
55 name_pos = pos + 1;
56#if defined(_WIN32) || defined(__CYGWIN__)
57 else if ('\\' == prog_name[pos])
58 name_pos = pos + 1;
59#endif /* _WIN32 || __CYGWIN__ */
60 pos++;
61 }
62 if (name_pos == pos)
63 return 0;
64 return strstr(prog_name + name_pos, marker) != (char*)0;
65}
diff --git a/src/testcurl/perf_get.c b/src/testcurl/perf_get.c
index b5d754a8..8f82b198 100644
--- a/src/testcurl/perf_get.c
+++ b/src/testcurl/perf_get.c
@@ -44,6 +44,7 @@
44#include <string.h> 44#include <string.h>
45#include <time.h> 45#include <time.h>
46#include "gauger.h" 46#include "gauger.h"
47#include "mhd_has_in_name.h"
47 48
48#ifndef WINDOWS 49#ifndef WINDOWS
49#include <unistd.h> 50#include <unistd.h>
@@ -579,8 +580,9 @@ main (int argc, char *const *argv)
579 int port = 1130; 580 int port = 1130;
580 (void)argc; /* Unused. Silent compiler warning. */ 581 (void)argc; /* Unused. Silent compiler warning. */
581 582
582 oneone = (NULL != strrchr (argv[0], (int) '/')) ? 583 if (NULL == argv || 0 == argv[0])
583 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 584 return 99;
585 oneone = has_in_name (argv[0], "11");
584 if (oneone) 586 if (oneone)
585 port += 15; 587 port += 15;
586 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 588 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
diff --git a/src/testcurl/test_delete.c b/src/testcurl/test_delete.c
index 35f7f6a2..9b2de537 100644
--- a/src/testcurl/test_delete.c
+++ b/src/testcurl/test_delete.c
@@ -31,6 +31,7 @@
31#include <stdlib.h> 31#include <stdlib.h>
32#include <string.h> 32#include <string.h>
33#include <time.h> 33#include <time.h>
34#include "mhd_has_in_name.h"
34 35
35#ifndef WINDOWS 36#ifndef WINDOWS
36#include <unistd.h> 37#include <unistd.h>
@@ -508,8 +509,9 @@ main (int argc, char *const *argv)
508 unsigned int errorCount = 0; 509 unsigned int errorCount = 0;
509 (void)argc; /* Unused. Silent compiler warning. */ 510 (void)argc; /* Unused. Silent compiler warning. */
510 511
511 oneone = (NULL != strrchr (argv[0], (int) '/')) ? 512 if (NULL == argv || 0 == argv[0])
512 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 513 return 99;
514 oneone = has_in_name (argv[0], "11");
513 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 515 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
514 return 2; 516 return 2;
515 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS)) 517 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
diff --git a/src/testcurl/test_get.c b/src/testcurl/test_get.c
index 841c2ffd..f6a8c033 100644
--- a/src/testcurl/test_get.c
+++ b/src/testcurl/test_get.c
@@ -30,6 +30,7 @@
30#include <stdlib.h> 30#include <stdlib.h>
31#include <string.h> 31#include <string.h>
32#include <time.h> 32#include <time.h>
33#include "mhd_has_in_name.h"
33#include "mhd_sockets.h" /* only macros used */ 34#include "mhd_sockets.h" /* only macros used */
34 35
35 36
@@ -804,8 +805,9 @@ main (int argc, char *const *argv)
804 unsigned int errorCount = 0; 805 unsigned int errorCount = 0;
805 (void) argc; /* Unused. Silence compiler warning. */ 806 (void) argc; /* Unused. Silence compiler warning. */
806 807
807 oneone = (NULL != strrchr (argv[0], (int) '/')) ? 808 if (NULL == argv || 0 == argv[0])
808 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 809 return 99;
810 oneone = has_in_name (argv[0], "11");
809 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 811 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
810 return 2; 812 return 2;
811 global_port = 0; 813 global_port = 0;
diff --git a/src/testcurl/test_get_response_cleanup.c b/src/testcurl/test_get_response_cleanup.c
index 457c646f..66653a93 100644
--- a/src/testcurl/test_get_response_cleanup.c
+++ b/src/testcurl/test_get_response_cleanup.c
@@ -51,6 +51,8 @@
51#include <windows.h> 51#include <windows.h>
52#endif 52#endif
53 53
54#include "mhd_has_in_name.h"
55
54#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2 56#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
55#undef CPU_COUNT 57#undef CPU_COUNT
56#endif 58#endif
@@ -415,8 +417,9 @@ main (int argc, char *const *argv)
415 } 417 }
416#endif /* _WIN32 */ 418#endif /* _WIN32 */
417 419
418 oneone = (NULL != strrchr (argv[0], (int) '/')) ? 420 if (NULL == argv || 0 == argv[0])
419 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 421 return 99;
422 oneone = has_in_name (argv[0], "11");
420 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS)) 423 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
421 { 424 {
422 errorCount += testInternalGet (); 425 errorCount += testInternalGet ();
diff --git a/src/testcurl/test_get_sendfile.c b/src/testcurl/test_get_sendfile.c
index 3d820fc8..2c4efa82 100644
--- a/src/testcurl/test_get_sendfile.c
+++ b/src/testcurl/test_get_sendfile.c
@@ -33,6 +33,7 @@
33#include <sys/types.h> 33#include <sys/types.h>
34#include <fcntl.h> 34#include <fcntl.h>
35#include "mhd_sockets.h" 35#include "mhd_sockets.h"
36#include "mhd_has_in_name.h"
36 37
37#ifndef WINDOWS 38#ifndef WINDOWS
38#include <sys/socket.h> 39#include <sys/socket.h>
@@ -576,8 +577,9 @@ main (int argc, char *const *argv)
576 FILE *f; 577 FILE *f;
577 (void)argc; /* Unused. Silent compiler warning. */ 578 (void)argc; /* Unused. Silent compiler warning. */
578 579
579 oneone = (NULL != strrchr (argv[0], (int) '/')) ? 580 if (NULL == argv || 0 == argv[0])
580 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 581 return 99;
582 oneone = has_in_name (argv[0], "11");
581 583
582 if ( (NULL == (tmp = getenv ("TMPDIR"))) && 584 if ( (NULL == (tmp = getenv ("TMPDIR"))) &&
583 (NULL == (tmp = getenv ("TMP"))) && 585 (NULL == (tmp = getenv ("TMP"))) &&
diff --git a/src/testcurl/test_iplimit.c b/src/testcurl/test_iplimit.c
index 32f7e36a..48be99f7 100644
--- a/src/testcurl/test_iplimit.c
+++ b/src/testcurl/test_iplimit.c
@@ -32,6 +32,7 @@
32#include <stdlib.h> 32#include <stdlib.h>
33#include <string.h> 33#include <string.h>
34#include <time.h> 34#include <time.h>
35#include "mhd_has_in_name.h"
35 36
36#ifndef WINDOWS 37#ifndef WINDOWS
37#include <unistd.h> 38#include <unistd.h>
@@ -339,8 +340,9 @@ main (int argc, char *const *argv)
339 unsigned int errorCount = 0; 340 unsigned int errorCount = 0;
340 (void)argc; /* Unused. Silent compiler warning. */ 341 (void)argc; /* Unused. Silent compiler warning. */
341 342
342 oneone = (NULL != strrchr (argv[0], (int) '/')) ? 343 if (NULL == argv || 0 == argv[0])
343 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 344 return 99;
345 oneone = has_in_name (argv[0], "11");
344 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 346 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
345 return 2; 347 return 2;
346 errorCount |= testMultithreadedGet (); 348 errorCount |= testMultithreadedGet ();
diff --git a/src/testcurl/test_long_header.c b/src/testcurl/test_long_header.c
index 49b183dc..7e5dc49c 100644
--- a/src/testcurl/test_long_header.c
+++ b/src/testcurl/test_long_header.c
@@ -31,6 +31,7 @@
31#include <stdlib.h> 31#include <stdlib.h>
32#include <string.h> 32#include <string.h>
33#include <time.h> 33#include <time.h>
34#include "mhd_has_in_name.h"
34 35
35#ifndef WINDOWS 36#ifndef WINDOWS
36#include <unistd.h> 37#include <unistd.h>
@@ -282,8 +283,9 @@ main (int argc, char *const *argv)
282 unsigned int errorCount = 0; 283 unsigned int errorCount = 0;
283 (void)argc; /* Unused. Silent compiler warning. */ 284 (void)argc; /* Unused. Silent compiler warning. */
284 285
285 oneone = (NULL != strrchr (argv[0], (int) '/')) ? 286 if (NULL == argv || 0 == argv[0])
286 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 287 return 99;
288 oneone = has_in_name (argv[0], "11");
287 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 289 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
288 return 2; 290 return 2;
289 errorCount += testLongUrlGet (); 291 errorCount += testLongUrlGet ();
diff --git a/src/testcurl/test_parse_cookies.c b/src/testcurl/test_parse_cookies.c
index 3e2c181e..4ed3717f 100644
--- a/src/testcurl/test_parse_cookies.c
+++ b/src/testcurl/test_parse_cookies.c
@@ -32,6 +32,7 @@
32#include <stdlib.h> 32#include <stdlib.h>
33#include <string.h> 33#include <string.h>
34#include <time.h> 34#include <time.h>
35#include "mhd_has_in_name.h"
35 36
36#ifndef WINDOWS 37#ifndef WINDOWS
37#include <unistd.h> 38#include <unistd.h>
@@ -274,8 +275,9 @@ main (int argc, char *const *argv)
274 unsigned int errorCount = 0; 275 unsigned int errorCount = 0;
275 (void)argc; /* Unused. Silent compiler warning. */ 276 (void)argc; /* Unused. Silent compiler warning. */
276 277
277 oneone = (NULL != strrchr (argv[0], (int) '/')) ? 278 if (NULL == argv || 0 == argv[0])
278 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 279 return 99;
280 oneone = has_in_name (argv[0], "11");
279 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 281 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
280 return 2; 282 return 2;
281 errorCount += testExternalGet (); 283 errorCount += testExternalGet ();
diff --git a/src/testcurl/test_post.c b/src/testcurl/test_post.c
index cfef2c46..11de0676 100644
--- a/src/testcurl/test_post.c
+++ b/src/testcurl/test_post.c
@@ -43,6 +43,8 @@
43#include <windows.h> 43#include <windows.h>
44#endif 44#endif
45 45
46#include "mhd_has_in_name.h"
47
46#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2 48#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
47#undef CPU_COUNT 49#undef CPU_COUNT
48#endif 50#endif
@@ -770,8 +772,9 @@ main (int argc, char *const *argv)
770 unsigned int errorCount = 0; 772 unsigned int errorCount = 0;
771 (void)argc; /* Unused. Silent compiler warning. */ 773 (void)argc; /* Unused. Silent compiler warning. */
772 774
773 oneone = (NULL != strrchr (argv[0], (int) '/')) ? 775 if (NULL == argv || 0 == argv[0])
774 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 776 return 99;
777 oneone = has_in_name (argv[0], "11");
775 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 778 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
776 return 2; 779 return 2;
777 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS)) 780 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
diff --git a/src/testcurl/test_post_loop.c b/src/testcurl/test_post_loop.c
index aae297d4..6edaced1 100644
--- a/src/testcurl/test_post_loop.c
+++ b/src/testcurl/test_post_loop.c
@@ -31,7 +31,8 @@
31#include <stdlib.h> 31#include <stdlib.h>
32#include <string.h> 32#include <string.h>
33#include <time.h> 33#include <time.h>
34#include <gauger.h> 34#include "gauger.h"
35#include "mhd_has_in_name.h"
35 36
36#ifndef WINDOWS 37#ifndef WINDOWS
37#include <unistd.h> 38#include <unistd.h>
@@ -579,8 +580,9 @@ main (int argc, char *const *argv)
579 unsigned int errorCount = 0; 580 unsigned int errorCount = 0;
580 (void)argc; /* Unused. Silent compiler warning. */ 581 (void)argc; /* Unused. Silent compiler warning. */
581 582
582 oneone = (NULL != strrchr (argv[0], (int) '/')) ? 583 if (NULL == argv || 0 == argv[0])
583 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 584 return 99;
585 oneone = has_in_name (argv[0], "11");
584 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 586 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
585 return 2; 587 return 2;
586 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS)) 588 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
diff --git a/src/testcurl/test_postform.c b/src/testcurl/test_postform.c
index 746d6baa..ff39c5a4 100644
--- a/src/testcurl/test_postform.c
+++ b/src/testcurl/test_postform.c
@@ -41,6 +41,8 @@
41#include <unistd.h> 41#include <unistd.h>
42#endif 42#endif
43 43
44#include "mhd_has_in_name.h"
45
44#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2 46#if defined(CPU_COUNT) && (CPU_COUNT+0) < 2
45#undef CPU_COUNT 47#undef CPU_COUNT
46#endif 48#endif
@@ -585,8 +587,9 @@ main (int argc, char *const *argv)
585#endif 587#endif
586#endif 588#endif
587#endif /* MHD_HTTPS_REQUIRE_GRYPT */ 589#endif /* MHD_HTTPS_REQUIRE_GRYPT */
588 oneone = (NULL != strrchr (argv[0], (int) '/')) ? 590 if (NULL == argv || 0 == argv[0])
589 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 591 return 99;
592 oneone = has_in_name (argv[0], "11");
590 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 593 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
591 return 2; 594 return 2;
592 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS)) 595 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
diff --git a/src/testcurl/test_process_arguments.c b/src/testcurl/test_process_arguments.c
index 4f29574d..680e75b1 100644
--- a/src/testcurl/test_process_arguments.c
+++ b/src/testcurl/test_process_arguments.c
@@ -31,6 +31,7 @@
31#include <stdlib.h> 31#include <stdlib.h>
32#include <string.h> 32#include <string.h>
33#include <time.h> 33#include <time.h>
34#include "mhd_has_in_name.h"
34 35
35#ifndef WINDOWS 36#ifndef WINDOWS
36#include <unistd.h> 37#include <unistd.h>
@@ -274,8 +275,9 @@ main (int argc, char *const *argv)
274 unsigned int errorCount = 0; 275 unsigned int errorCount = 0;
275 (void)argc; /* Unused. Silent compiler warning. */ 276 (void)argc; /* Unused. Silent compiler warning. */
276 277
277 oneone = (NULL != strrchr (argv[0], (int) '/')) ? 278 if (NULL == argv || 0 == argv[0])
278 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 279 return 99;
280 oneone = has_in_name (argv[0], "11");
279 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 281 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
280 return 2; 282 return 2;
281 errorCount += testExternalGet (); 283 errorCount += testExternalGet ();
diff --git a/src/testcurl/test_process_headers.c b/src/testcurl/test_process_headers.c
index f9c7cd03..525ccfc8 100644
--- a/src/testcurl/test_process_headers.c
+++ b/src/testcurl/test_process_headers.c
@@ -32,6 +32,7 @@
32#include <stdlib.h> 32#include <stdlib.h>
33#include <string.h> 33#include <string.h>
34#include <time.h> 34#include <time.h>
35#include "mhd_has_in_name.h"
35 36
36#ifndef WINDOWS 37#ifndef WINDOWS
37#include <unistd.h> 38#include <unistd.h>
@@ -518,8 +519,9 @@ main (int argc, char *const *argv)
518 unsigned int errorCount = 0; 519 unsigned int errorCount = 0;
519 (void)argc; /* Unused. Silent compiler warning. */ 520 (void)argc; /* Unused. Silent compiler warning. */
520 521
521 oneone = (NULL != strrchr (argv[0], (int) '/')) ? 522 if (NULL == argv || 0 == argv[0])
522 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 523 return 99;
524 oneone = has_in_name (argv[0], "11");
523 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS)) 525 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
524 { 526 {
525 errorCount += testInternalGet (); 527 errorCount += testInternalGet ();
diff --git a/src/testcurl/test_put.c b/src/testcurl/test_put.c
index 11e99cc3..3d25016a 100644
--- a/src/testcurl/test_put.c
+++ b/src/testcurl/test_put.c
@@ -31,6 +31,7 @@
31#include <stdlib.h> 31#include <stdlib.h>
32#include <string.h> 32#include <string.h>
33#include <time.h> 33#include <time.h>
34#include "mhd_has_in_name.h"
34 35
35#ifndef WINDOWS 36#ifndef WINDOWS
36#include <unistd.h> 37#include <unistd.h>
@@ -517,8 +518,9 @@ main (int argc, char *const *argv)
517 unsigned int errorCount = 0; 518 unsigned int errorCount = 0;
518 (void)argc; /* Unused. Silent compiler warning. */ 519 (void)argc; /* Unused. Silent compiler warning. */
519 520
520 oneone = (NULL != strrchr (argv[0], (int) '/')) ? 521 if (NULL == argv || 0 == argv[0])
521 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 522 return 99;
523 oneone = has_in_name (argv[0], "11");
522 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 524 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
523 return 2; 525 return 2;
524 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS)) 526 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
diff --git a/src/testcurl/test_timeout.c b/src/testcurl/test_timeout.c
index 7621cfd1..0dfc7e65 100644
--- a/src/testcurl/test_timeout.c
+++ b/src/testcurl/test_timeout.c
@@ -31,6 +31,7 @@
31#include <stdlib.h> 31#include <stdlib.h>
32#include <string.h> 32#include <string.h>
33#include <time.h> 33#include <time.h>
34#include "mhd_has_in_name.h"
34 35
35#ifndef WINDOWS 36#ifndef WINDOWS
36#include <unistd.h> 37#include <unistd.h>
@@ -318,8 +319,9 @@ main (int argc, char *const *argv)
318 unsigned int errorCount = 0; 319 unsigned int errorCount = 0;
319 (void)argc; /* Unused. Silent compiler warning. */ 320 (void)argc; /* Unused. Silent compiler warning. */
320 321
321 oneone = (NULL != strrchr (argv[0], (int) '/')) ? 322 if (NULL == argv || 0 == argv[0])
322 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 323 return 99;
324 oneone = has_in_name (argv[0], "11");
323 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 325 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
324 return 16; 326 return 16;
325 errorCount += testWithoutTimeout (); 327 errorCount += testWithoutTimeout ();
diff --git a/src/testcurl/test_urlparse.c b/src/testcurl/test_urlparse.c
index 8675f19c..9d2d8517 100644
--- a/src/testcurl/test_urlparse.c
+++ b/src/testcurl/test_urlparse.c
@@ -31,6 +31,7 @@
31#include <stdlib.h> 31#include <stdlib.h>
32#include <string.h> 32#include <string.h>
33#include <time.h> 33#include <time.h>
34#include "mhd_has_in_name.h"
34 35
35#ifdef _WIN32 36#ifdef _WIN32
36#ifndef WIN32_LEAN_AND_MEAN 37#ifndef WIN32_LEAN_AND_MEAN
@@ -201,8 +202,9 @@ main (int argc, char *const *argv)
201 unsigned int errorCount = 0; 202 unsigned int errorCount = 0;
202 (void)argc; /* Unused. Silent compiler warning. */ 203 (void)argc; /* Unused. Silent compiler warning. */
203 204
204 oneone = (NULL != strrchr (argv[0], (int) '/')) ? 205 if (NULL == argv || 0 == argv[0])
205 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 206 return 99;
207 oneone = has_in_name (argv[0], "11");
206 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 208 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
207 return 2; 209 return 2;
208 errorCount += testInternalGet (0); 210 errorCount += testInternalGet (0);