[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 08/09: test_upgrade{,_large}: simplified stdout,stderr f
From: |
gnunet |
Subject: |
[libmicrohttpd] 08/09: test_upgrade{,_large}: simplified stdout,stderr flushing |
Date: |
Sat, 15 Jan 2022 15:47:48 +0100 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 0a478564f7ca32e7e5e6e20559149067515082a6
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sat Jan 15 17:27:45 2022 +0300
test_upgrade{,_large}: simplified stdout,stderr flushing
---
src/microhttpd/test_upgrade.c | 50 ++++++++++++++++---------------------
src/microhttpd/test_upgrade_large.c | 24 ++++++++++++++++++
2 files changed, 46 insertions(+), 28 deletions(-)
diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c
index 17aeba63..68598723 100644
--- a/src/microhttpd/test_upgrade.c
+++ b/src/microhttpd/test_upgrade.c
@@ -164,6 +164,14 @@ _testErrorLog_func (const char *errDesc, const char
*funcName, int lineNum)
#endif
+static void
+fflush_allstd (void)
+{
+ fflush (stderr);
+ fflush (stdout);
+}
+
+
static int verbose = 0;
enum tls_tool
@@ -1433,8 +1441,7 @@ main (int argc,
/* try external select */
res = test_upgrade (0,
0);
- fflush (stderr);
- fflush (stdout);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1446,8 +1453,7 @@ main (int argc,
/* Try external auto */
res = test_upgrade (MHD_USE_AUTO,
0);
- fflush (stderr);
- fflush (stdout);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1459,8 +1465,7 @@ main (int argc,
#ifdef EPOLL_SUPPORT
res = test_upgrade (MHD_USE_EPOLL,
0);
- fflush (stderr);
- fflush (stdout);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1474,8 +1479,7 @@ main (int argc,
res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD
| MHD_USE_THREAD_PER_CONNECTION,
0);
- fflush (stderr);
- fflush (stdout);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1487,8 +1491,7 @@ main (int argc,
res = test_upgrade (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD
| MHD_USE_THREAD_PER_CONNECTION,
0);
- fflush (stderr);
- fflush (stdout);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1500,8 +1503,7 @@ main (int argc,
res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD
| MHD_USE_THREAD_PER_CONNECTION | MHD_USE_POLL,
0);
- fflush (stderr);
- fflush (stdout);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1514,8 +1516,7 @@ main (int argc,
/* Test different event loops, with and without thread pool */
res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD,
0);
- fflush (stderr);
- fflush (stdout);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1525,8 +1526,7 @@ main (int argc,
printf ("PASSED: Upgrade with internal select.\n");
res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD,
2);
- fflush (stderr);
- fflush (stdout);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1536,8 +1536,7 @@ main (int argc,
printf ("PASSED: Upgrade with internal select with thread pool.\n");
res = test_upgrade (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD,
0);
- fflush (stderr);
- fflush (stdout);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1547,8 +1546,7 @@ main (int argc,
printf ("PASSED: Upgrade with internal 'auto'.\n");
res = test_upgrade (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD,
2);
- fflush (stderr);
- fflush (stdout);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1559,8 +1557,7 @@ main (int argc,
#ifdef HAVE_POLL
res = test_upgrade (MHD_USE_POLL_INTERNAL_THREAD,
0);
- fflush (stderr);
- fflush (stdout);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1570,8 +1567,7 @@ main (int argc,
printf ("PASSED: Upgrade with internal poll.\n");
res = test_upgrade (MHD_USE_POLL_INTERNAL_THREAD,
2);
- fflush (stderr);
- fflush (stdout);
+ fflush_allstd ();
if (res)
fprintf (stderr,
"FAILED: Upgrade with internal poll with thread pool, return code
%d.\n",
@@ -1582,8 +1578,7 @@ main (int argc,
#ifdef EPOLL_SUPPORT
res = test_upgrade (MHD_USE_EPOLL_INTERNAL_THREAD,
0);
- fflush (stderr);
- fflush (stdout);
+ fflush_allstd ();
if (res)
fprintf (stderr,
"FAILED: Upgrade with internal epoll, return code %d.\n",
@@ -1592,8 +1587,7 @@ main (int argc,
printf ("PASSED: Upgrade with internal epoll.\n");
res = test_upgrade (MHD_USE_EPOLL_INTERNAL_THREAD,
2);
- fflush (stderr);
- fflush (stdout);
+ fflush_allstd ();
if (res)
fprintf (stderr,
"FAILED: Upgrade with internal epoll, return code %d.\n",
diff --git a/src/microhttpd/test_upgrade_large.c
b/src/microhttpd/test_upgrade_large.c
index 6588f6c0..7c1032cf 100644
--- a/src/microhttpd/test_upgrade_large.c
+++ b/src/microhttpd/test_upgrade_large.c
@@ -328,6 +328,14 @@ _testErrorLog_func (const char *errDesc, const char
*funcName, int lineNum)
#endif
+static void
+fflush_allstd (void)
+{
+ fflush (stderr);
+ fflush (stdout);
+}
+
+
static int verbose = 0;
static struct MHD_itc_ kicker = MHD_ITC_STATIC_INIT_INVALID;
@@ -1625,6 +1633,7 @@ main (int argc,
return 77;
#endif /* ! HTTPS_SUPPORT */
}
+
/* run tests */
if (verbose)
printf ("Starting HTTP \"Upgrade\" tests with %s connections.\n",
@@ -1632,6 +1641,7 @@ main (int argc,
/* try external select */
res = test_upgrade (0,
0);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1639,9 +1649,11 @@ main (int argc,
res);
else if (verbose)
printf ("PASSED: Upgrade with external select.\n");
+
/* Try external auto */
res = test_upgrade (MHD_USE_AUTO,
0);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1653,6 +1665,7 @@ main (int argc,
#ifdef EPOLL_SUPPORT
res = test_upgrade (MHD_USE_EPOLL,
0);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1666,6 +1679,7 @@ main (int argc,
res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD
| MHD_USE_THREAD_PER_CONNECTION,
0);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1677,6 +1691,7 @@ main (int argc,
res = test_upgrade (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD
| MHD_USE_THREAD_PER_CONNECTION,
0);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1688,6 +1703,7 @@ main (int argc,
res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD
| MHD_USE_THREAD_PER_CONNECTION | MHD_USE_POLL,
0);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1700,6 +1716,7 @@ main (int argc,
/* Test different event loops, with and without thread pool */
res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD,
0);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1709,6 +1726,7 @@ main (int argc,
printf ("PASSED: Upgrade with internal select.\n");
res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD,
2);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1718,6 +1736,7 @@ main (int argc,
printf ("PASSED: Upgrade with internal select with thread pool.\n");
res = test_upgrade (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD,
0);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1727,6 +1746,7 @@ main (int argc,
printf ("PASSED: Upgrade with internal 'auto'.\n");
res = test_upgrade (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD,
2);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1737,6 +1757,7 @@ main (int argc,
#ifdef HAVE_POLL
res = test_upgrade (MHD_USE_POLL_INTERNAL_THREAD,
0);
+ fflush_allstd ();
error_count += res;
if (res)
fprintf (stderr,
@@ -1746,6 +1767,7 @@ main (int argc,
printf ("PASSED: Upgrade with internal poll.\n");
res = test_upgrade (MHD_USE_POLL_INTERNAL_THREAD,
2);
+ fflush_allstd ();
if (res)
fprintf (stderr,
"FAILED: Upgrade with internal poll with thread pool, return code
%d.\n",
@@ -1756,6 +1778,7 @@ main (int argc,
#ifdef EPOLL_SUPPORT
res = test_upgrade (MHD_USE_EPOLL_INTERNAL_THREAD,
0);
+ fflush_allstd ();
if (res)
fprintf (stderr,
"FAILED: Upgrade with internal epoll, return code %d.\n",
@@ -1764,6 +1787,7 @@ main (int argc,
printf ("PASSED: Upgrade with internal epoll.\n");
res = test_upgrade (MHD_USE_EPOLL_INTERNAL_THREAD,
2);
+ fflush_allstd ();
if (res)
fprintf (stderr,
"FAILED: Upgrade with internal epoll, return code %d.\n",
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (376afc84 -> 0ea5d514), gnunet, 2022/01/15
- [libmicrohttpd] 02/09: test_upgrade: don't fail with particular sockets errors, gnunet, 2022/01/15
- [libmicrohttpd] 03/09: test_upgrade: fail if connection is closed when it shouldn't, gnunet, 2022/01/15
- [libmicrohttpd] 01/09: test_upgrade: replaced a few left abort() with meaningful descriptions, gnunet, 2022/01/15
- [libmicrohttpd] 05/09: test_upgrade: minor code refactoring, gnunet, 2022/01/15
- [libmicrohttpd] 09/09: test_upgrade{, _large}: used the same port for all checks., gnunet, 2022/01/15
- [libmicrohttpd] 06/09: test_upgrade: added missing fflush(), gnunet, 2022/01/15
- [libmicrohttpd] 04/09: test_upgrade: use 'volatile' for variable with multithread access, gnunet, 2022/01/15
- [libmicrohttpd] 07/09: test_upgrade_large: applied fixes and improvements from test_upgrade, gnunet, 2022/01/15
- [libmicrohttpd] 08/09: test_upgrade{,_large}: simplified stdout,stderr flushing,
gnunet <=