[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 06/13: test_daemon: fixed to not skip if failed
From: |
gnunet |
Subject: |
[libmicrohttpd] 06/13: test_daemon: fixed to not skip if failed |
Date: |
Thu, 23 Nov 2023 11:49:09 +0100 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 9dcf06f9eb1365d641824b44a5549c120a060099
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Fri Oct 27 11:41:53 2023 +0300
test_daemon: fixed to not skip if failed
---
src/microhttpd/test_daemon.c | 31 +++++++++++++++++++------------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/src/microhttpd/test_daemon.c b/src/microhttpd/test_daemon.c
index b759bc98..00c83c63 100644
--- a/src/microhttpd/test_daemon.c
+++ b/src/microhttpd/test_daemon.c
@@ -1,6 +1,7 @@
/*
This file is part of libmicrohttpd
Copyright (C) 2007, 2017 Christian Grothoff
+ Copyright (C) 2014--2023 Evgeny Grin (Karlson2k)
libmicrohttpd is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@ -22,6 +23,7 @@
* @file test_daemon.c
* @brief Testcase for libmicrohttpd starts and stops
* @author Christian Grothoff
+ * @author Karlson2k (Evgeny Grin)
*/
#include "platform.h"
@@ -106,7 +108,7 @@ testStartStop (void)
fprintf (stderr,
"Failed to start daemon on port %u\n",
(unsigned int) 0);
- exit (77);
+ exit (3);
}
MHD_stop_daemon (d);
return 0;
@@ -133,10 +135,9 @@ testExternalRun (void)
fprintf (stderr,
"Failed to start daemon on port %u\n",
(unsigned int) 0);
- exit (77);
+ exit (3);
}
- i = 0;
- while (i < 15)
+ for (i = 0; i < 15; ++i)
{
maxfd = 0;
FD_ZERO (&rs);
@@ -147,14 +148,13 @@ testExternalRun (void)
"Failed in MHD_get_fdset().\n");
return 256;
}
- if (MHD_run (d) == MHD_NO)
+ if (MHD_NO == MHD_run (d))
{
MHD_stop_daemon (d);
fprintf (stderr,
"Failed in MHD_run().\n");
return 8;
}
- i++;
}
MHD_stop_daemon (d);
return 0;
@@ -176,8 +176,8 @@ testThread (void)
{
fprintf (stderr,
"Failed to start daemon on port %u.\n",
- (unsigned int) 1082);
- exit (77);
+ (unsigned int) 0);
+ exit (3);
}
if (MHD_run (d) != MHD_NO)
{
@@ -207,7 +207,7 @@ testMultithread (void)
fprintf (stderr,
"Failed to start daemon on port %u\n",
(unsigned int) 0);
- exit (77);
+ exit (3);
}
if (MHD_run (d) != MHD_NO)
{
@@ -225,13 +225,20 @@ main (int argc,
char *const *argv)
{
unsigned int errorCount = 0;
+ int has_threads_support;
(void) argc; (void) argv; /* Unused. Silent compiler warning. */
+ has_threads_support =
+ (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_THREADS));
errorCount += testStartError ();
- errorCount += testStartStop ();
+ if (has_threads_support)
+ errorCount += testStartStop ();
errorCount += testExternalRun ();
- errorCount += testThread ();
- errorCount += testMultithread ();
+ if (has_threads_support)
+ {
+ errorCount += testThread ();
+ errorCount += testMultithread ();
+ }
if (0 != errorCount)
fprintf (stderr,
"Error (code: %u)\n",
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (cd4d2f65 -> a19df909), gnunet, 2023/11/23
- [libmicrohttpd] 03/13: MHD_start_daemon(): moved daemon flags internal initialisation, gnunet, 2023/11/23
- [libmicrohttpd] 01/13: Added detection of more conditions to process the data without waiting, gnunet, 2023/11/23
- [libmicrohttpd] 04/13: MHD_start_daemon(): reject INTERNAL_POLLING_THREAD if threads are disabled, gnunet, 2023/11/23
- [libmicrohttpd] 02/13: MHD_quiesce_daemon(): fixed return value if already quiesced, gnunet, 2023/11/23
- [libmicrohttpd] 05/13: Moved user options counter to shorter its lifetime, gnunet, 2023/11/23
- [libmicrohttpd] 06/13: test_daemon: fixed to not skip if failed,
gnunet <=
- [libmicrohttpd] 08/13: Improved daemon shutdown handling in external polling mode, gnunet, 2023/11/23
- [libmicrohttpd] 07/13: test_digestauth2: fixed order of the initial checks, gnunet, 2023/11/23
- [libmicrohttpd] 09/13: Micro-optimisations for non-overridable FD_SETSIZE, gnunet, 2023/11/23
- [libmicrohttpd] 13/13: Officially support zero for MHD_OPTION_THREAD_POOL_SIZE, gnunet, 2023/11/23
- [libmicrohttpd] 10/13: Unified and simplified fd_set filling, gnunet, 2023/11/23
- [libmicrohttpd] 11/13: Added new daemon flag MHD_USE_NO_THREAD_SAFETY, gnunet, 2023/11/23
- [libmicrohttpd] 12/13: Tests: added use of MHD_USE_NO_THREAD_SAFETY flag, gnunet, 2023/11/23