diff options
Diffstat (limited to 'src/microhttpd/test_upgrade.c')
-rw-r--r-- | src/microhttpd/test_upgrade.c | 50 |
1 files changed, 22 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) | |||
164 | #endif | 164 | #endif |
165 | 165 | ||
166 | 166 | ||
167 | static void | ||
168 | fflush_allstd (void) | ||
169 | { | ||
170 | fflush (stderr); | ||
171 | fflush (stdout); | ||
172 | } | ||
173 | |||
174 | |||
167 | static int verbose = 0; | 175 | static int verbose = 0; |
168 | 176 | ||
169 | enum tls_tool | 177 | enum tls_tool |
@@ -1433,8 +1441,7 @@ main (int argc, | |||
1433 | /* try external select */ | 1441 | /* try external select */ |
1434 | res = test_upgrade (0, | 1442 | res = test_upgrade (0, |
1435 | 0); | 1443 | 0); |
1436 | fflush (stderr); | 1444 | fflush_allstd (); |
1437 | fflush (stdout); | ||
1438 | error_count += res; | 1445 | error_count += res; |
1439 | if (res) | 1446 | if (res) |
1440 | fprintf (stderr, | 1447 | fprintf (stderr, |
@@ -1446,8 +1453,7 @@ main (int argc, | |||
1446 | /* Try external auto */ | 1453 | /* Try external auto */ |
1447 | res = test_upgrade (MHD_USE_AUTO, | 1454 | res = test_upgrade (MHD_USE_AUTO, |
1448 | 0); | 1455 | 0); |
1449 | fflush (stderr); | 1456 | fflush_allstd (); |
1450 | fflush (stdout); | ||
1451 | error_count += res; | 1457 | error_count += res; |
1452 | if (res) | 1458 | if (res) |
1453 | fprintf (stderr, | 1459 | fprintf (stderr, |
@@ -1459,8 +1465,7 @@ main (int argc, | |||
1459 | #ifdef EPOLL_SUPPORT | 1465 | #ifdef EPOLL_SUPPORT |
1460 | res = test_upgrade (MHD_USE_EPOLL, | 1466 | res = test_upgrade (MHD_USE_EPOLL, |
1461 | 0); | 1467 | 0); |
1462 | fflush (stderr); | 1468 | fflush_allstd (); |
1463 | fflush (stdout); | ||
1464 | error_count += res; | 1469 | error_count += res; |
1465 | if (res) | 1470 | if (res) |
1466 | fprintf (stderr, | 1471 | fprintf (stderr, |
@@ -1474,8 +1479,7 @@ main (int argc, | |||
1474 | res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD | 1479 | res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD |
1475 | | MHD_USE_THREAD_PER_CONNECTION, | 1480 | | MHD_USE_THREAD_PER_CONNECTION, |
1476 | 0); | 1481 | 0); |
1477 | fflush (stderr); | 1482 | fflush_allstd (); |
1478 | fflush (stdout); | ||
1479 | error_count += res; | 1483 | error_count += res; |
1480 | if (res) | 1484 | if (res) |
1481 | fprintf (stderr, | 1485 | fprintf (stderr, |
@@ -1487,8 +1491,7 @@ main (int argc, | |||
1487 | res = test_upgrade (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD | 1491 | res = test_upgrade (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD |
1488 | | MHD_USE_THREAD_PER_CONNECTION, | 1492 | | MHD_USE_THREAD_PER_CONNECTION, |
1489 | 0); | 1493 | 0); |
1490 | fflush (stderr); | 1494 | fflush_allstd (); |
1491 | fflush (stdout); | ||
1492 | error_count += res; | 1495 | error_count += res; |
1493 | if (res) | 1496 | if (res) |
1494 | fprintf (stderr, | 1497 | fprintf (stderr, |
@@ -1500,8 +1503,7 @@ main (int argc, | |||
1500 | res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD | 1503 | res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD |
1501 | | MHD_USE_THREAD_PER_CONNECTION | MHD_USE_POLL, | 1504 | | MHD_USE_THREAD_PER_CONNECTION | MHD_USE_POLL, |
1502 | 0); | 1505 | 0); |
1503 | fflush (stderr); | 1506 | fflush_allstd (); |
1504 | fflush (stdout); | ||
1505 | error_count += res; | 1507 | error_count += res; |
1506 | if (res) | 1508 | if (res) |
1507 | fprintf (stderr, | 1509 | fprintf (stderr, |
@@ -1514,8 +1516,7 @@ main (int argc, | |||
1514 | /* Test different event loops, with and without thread pool */ | 1516 | /* Test different event loops, with and without thread pool */ |
1515 | res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD, | 1517 | res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD, |
1516 | 0); | 1518 | 0); |
1517 | fflush (stderr); | 1519 | fflush_allstd (); |
1518 | fflush (stdout); | ||
1519 | error_count += res; | 1520 | error_count += res; |
1520 | if (res) | 1521 | if (res) |
1521 | fprintf (stderr, | 1522 | fprintf (stderr, |
@@ -1525,8 +1526,7 @@ main (int argc, | |||
1525 | printf ("PASSED: Upgrade with internal select.\n"); | 1526 | printf ("PASSED: Upgrade with internal select.\n"); |
1526 | res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD, | 1527 | res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD, |
1527 | 2); | 1528 | 2); |
1528 | fflush (stderr); | 1529 | fflush_allstd (); |
1529 | fflush (stdout); | ||
1530 | error_count += res; | 1530 | error_count += res; |
1531 | if (res) | 1531 | if (res) |
1532 | fprintf (stderr, | 1532 | fprintf (stderr, |
@@ -1536,8 +1536,7 @@ main (int argc, | |||
1536 | printf ("PASSED: Upgrade with internal select with thread pool.\n"); | 1536 | printf ("PASSED: Upgrade with internal select with thread pool.\n"); |
1537 | res = test_upgrade (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD, | 1537 | res = test_upgrade (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD, |
1538 | 0); | 1538 | 0); |
1539 | fflush (stderr); | 1539 | fflush_allstd (); |
1540 | fflush (stdout); | ||
1541 | error_count += res; | 1540 | error_count += res; |
1542 | if (res) | 1541 | if (res) |
1543 | fprintf (stderr, | 1542 | fprintf (stderr, |
@@ -1547,8 +1546,7 @@ main (int argc, | |||
1547 | printf ("PASSED: Upgrade with internal 'auto'.\n"); | 1546 | printf ("PASSED: Upgrade with internal 'auto'.\n"); |
1548 | res = test_upgrade (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD, | 1547 | res = test_upgrade (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD, |
1549 | 2); | 1548 | 2); |
1550 | fflush (stderr); | 1549 | fflush_allstd (); |
1551 | fflush (stdout); | ||
1552 | error_count += res; | 1550 | error_count += res; |
1553 | if (res) | 1551 | if (res) |
1554 | fprintf (stderr, | 1552 | fprintf (stderr, |
@@ -1559,8 +1557,7 @@ main (int argc, | |||
1559 | #ifdef HAVE_POLL | 1557 | #ifdef HAVE_POLL |
1560 | res = test_upgrade (MHD_USE_POLL_INTERNAL_THREAD, | 1558 | res = test_upgrade (MHD_USE_POLL_INTERNAL_THREAD, |
1561 | 0); | 1559 | 0); |
1562 | fflush (stderr); | 1560 | fflush_allstd (); |
1563 | fflush (stdout); | ||
1564 | error_count += res; | 1561 | error_count += res; |
1565 | if (res) | 1562 | if (res) |
1566 | fprintf (stderr, | 1563 | fprintf (stderr, |
@@ -1570,8 +1567,7 @@ main (int argc, | |||
1570 | printf ("PASSED: Upgrade with internal poll.\n"); | 1567 | printf ("PASSED: Upgrade with internal poll.\n"); |
1571 | res = test_upgrade (MHD_USE_POLL_INTERNAL_THREAD, | 1568 | res = test_upgrade (MHD_USE_POLL_INTERNAL_THREAD, |
1572 | 2); | 1569 | 2); |
1573 | fflush (stderr); | 1570 | fflush_allstd (); |
1574 | fflush (stdout); | ||
1575 | if (res) | 1571 | if (res) |
1576 | fprintf (stderr, | 1572 | fprintf (stderr, |
1577 | "FAILED: Upgrade with internal poll with thread pool, return code %d.\n", | 1573 | "FAILED: Upgrade with internal poll with thread pool, return code %d.\n", |
@@ -1582,8 +1578,7 @@ main (int argc, | |||
1582 | #ifdef EPOLL_SUPPORT | 1578 | #ifdef EPOLL_SUPPORT |
1583 | res = test_upgrade (MHD_USE_EPOLL_INTERNAL_THREAD, | 1579 | res = test_upgrade (MHD_USE_EPOLL_INTERNAL_THREAD, |
1584 | 0); | 1580 | 0); |
1585 | fflush (stderr); | 1581 | fflush_allstd (); |
1586 | fflush (stdout); | ||
1587 | if (res) | 1582 | if (res) |
1588 | fprintf (stderr, | 1583 | fprintf (stderr, |
1589 | "FAILED: Upgrade with internal epoll, return code %d.\n", | 1584 | "FAILED: Upgrade with internal epoll, return code %d.\n", |
@@ -1592,8 +1587,7 @@ main (int argc, | |||
1592 | printf ("PASSED: Upgrade with internal epoll.\n"); | 1587 | printf ("PASSED: Upgrade with internal epoll.\n"); |
1593 | res = test_upgrade (MHD_USE_EPOLL_INTERNAL_THREAD, | 1588 | res = test_upgrade (MHD_USE_EPOLL_INTERNAL_THREAD, |
1594 | 2); | 1589 | 2); |
1595 | fflush (stderr); | 1590 | fflush_allstd (); |
1596 | fflush (stdout); | ||
1597 | if (res) | 1591 | if (res) |
1598 | fprintf (stderr, | 1592 | fprintf (stderr, |
1599 | "FAILED: Upgrade with internal epoll, return code %d.\n", | 1593 | "FAILED: Upgrade with internal epoll, return code %d.\n", |