diff options
Diffstat (limited to 'src/microhttpd/test_upgrade_large.c')
-rw-r--r-- | src/microhttpd/test_upgrade_large.c | 24 |
1 files changed, 24 insertions, 0 deletions
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) | |||
328 | #endif | 328 | #endif |
329 | 329 | ||
330 | 330 | ||
331 | static void | ||
332 | fflush_allstd (void) | ||
333 | { | ||
334 | fflush (stderr); | ||
335 | fflush (stdout); | ||
336 | } | ||
337 | |||
338 | |||
331 | static int verbose = 0; | 339 | static int verbose = 0; |
332 | 340 | ||
333 | static struct MHD_itc_ kicker = MHD_ITC_STATIC_INIT_INVALID; | 341 | static struct MHD_itc_ kicker = MHD_ITC_STATIC_INIT_INVALID; |
@@ -1625,6 +1633,7 @@ main (int argc, | |||
1625 | return 77; | 1633 | return 77; |
1626 | #endif /* ! HTTPS_SUPPORT */ | 1634 | #endif /* ! HTTPS_SUPPORT */ |
1627 | } | 1635 | } |
1636 | |||
1628 | /* run tests */ | 1637 | /* run tests */ |
1629 | if (verbose) | 1638 | if (verbose) |
1630 | printf ("Starting HTTP \"Upgrade\" tests with %s connections.\n", | 1639 | printf ("Starting HTTP \"Upgrade\" tests with %s connections.\n", |
@@ -1632,6 +1641,7 @@ main (int argc, | |||
1632 | /* try external select */ | 1641 | /* try external select */ |
1633 | res = test_upgrade (0, | 1642 | res = test_upgrade (0, |
1634 | 0); | 1643 | 0); |
1644 | fflush_allstd (); | ||
1635 | error_count += res; | 1645 | error_count += res; |
1636 | if (res) | 1646 | if (res) |
1637 | fprintf (stderr, | 1647 | fprintf (stderr, |
@@ -1639,9 +1649,11 @@ main (int argc, | |||
1639 | res); | 1649 | res); |
1640 | else if (verbose) | 1650 | else if (verbose) |
1641 | printf ("PASSED: Upgrade with external select.\n"); | 1651 | printf ("PASSED: Upgrade with external select.\n"); |
1652 | |||
1642 | /* Try external auto */ | 1653 | /* Try external auto */ |
1643 | res = test_upgrade (MHD_USE_AUTO, | 1654 | res = test_upgrade (MHD_USE_AUTO, |
1644 | 0); | 1655 | 0); |
1656 | fflush_allstd (); | ||
1645 | error_count += res; | 1657 | error_count += res; |
1646 | if (res) | 1658 | if (res) |
1647 | fprintf (stderr, | 1659 | fprintf (stderr, |
@@ -1653,6 +1665,7 @@ main (int argc, | |||
1653 | #ifdef EPOLL_SUPPORT | 1665 | #ifdef EPOLL_SUPPORT |
1654 | res = test_upgrade (MHD_USE_EPOLL, | 1666 | res = test_upgrade (MHD_USE_EPOLL, |
1655 | 0); | 1667 | 0); |
1668 | fflush_allstd (); | ||
1656 | error_count += res; | 1669 | error_count += res; |
1657 | if (res) | 1670 | if (res) |
1658 | fprintf (stderr, | 1671 | fprintf (stderr, |
@@ -1666,6 +1679,7 @@ main (int argc, | |||
1666 | res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD | 1679 | res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD |
1667 | | MHD_USE_THREAD_PER_CONNECTION, | 1680 | | MHD_USE_THREAD_PER_CONNECTION, |
1668 | 0); | 1681 | 0); |
1682 | fflush_allstd (); | ||
1669 | error_count += res; | 1683 | error_count += res; |
1670 | if (res) | 1684 | if (res) |
1671 | fprintf (stderr, | 1685 | fprintf (stderr, |
@@ -1677,6 +1691,7 @@ main (int argc, | |||
1677 | res = test_upgrade (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD | 1691 | res = test_upgrade (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD |
1678 | | MHD_USE_THREAD_PER_CONNECTION, | 1692 | | MHD_USE_THREAD_PER_CONNECTION, |
1679 | 0); | 1693 | 0); |
1694 | fflush_allstd (); | ||
1680 | error_count += res; | 1695 | error_count += res; |
1681 | if (res) | 1696 | if (res) |
1682 | fprintf (stderr, | 1697 | fprintf (stderr, |
@@ -1688,6 +1703,7 @@ main (int argc, | |||
1688 | res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD | 1703 | res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD |
1689 | | MHD_USE_THREAD_PER_CONNECTION | MHD_USE_POLL, | 1704 | | MHD_USE_THREAD_PER_CONNECTION | MHD_USE_POLL, |
1690 | 0); | 1705 | 0); |
1706 | fflush_allstd (); | ||
1691 | error_count += res; | 1707 | error_count += res; |
1692 | if (res) | 1708 | if (res) |
1693 | fprintf (stderr, | 1709 | fprintf (stderr, |
@@ -1700,6 +1716,7 @@ main (int argc, | |||
1700 | /* Test different event loops, with and without thread pool */ | 1716 | /* Test different event loops, with and without thread pool */ |
1701 | res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD, | 1717 | res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD, |
1702 | 0); | 1718 | 0); |
1719 | fflush_allstd (); | ||
1703 | error_count += res; | 1720 | error_count += res; |
1704 | if (res) | 1721 | if (res) |
1705 | fprintf (stderr, | 1722 | fprintf (stderr, |
@@ -1709,6 +1726,7 @@ main (int argc, | |||
1709 | printf ("PASSED: Upgrade with internal select.\n"); | 1726 | printf ("PASSED: Upgrade with internal select.\n"); |
1710 | res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD, | 1727 | res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD, |
1711 | 2); | 1728 | 2); |
1729 | fflush_allstd (); | ||
1712 | error_count += res; | 1730 | error_count += res; |
1713 | if (res) | 1731 | if (res) |
1714 | fprintf (stderr, | 1732 | fprintf (stderr, |
@@ -1718,6 +1736,7 @@ main (int argc, | |||
1718 | printf ("PASSED: Upgrade with internal select with thread pool.\n"); | 1736 | printf ("PASSED: Upgrade with internal select with thread pool.\n"); |
1719 | res = test_upgrade (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD, | 1737 | res = test_upgrade (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD, |
1720 | 0); | 1738 | 0); |
1739 | fflush_allstd (); | ||
1721 | error_count += res; | 1740 | error_count += res; |
1722 | if (res) | 1741 | if (res) |
1723 | fprintf (stderr, | 1742 | fprintf (stderr, |
@@ -1727,6 +1746,7 @@ main (int argc, | |||
1727 | printf ("PASSED: Upgrade with internal 'auto'.\n"); | 1746 | printf ("PASSED: Upgrade with internal 'auto'.\n"); |
1728 | res = test_upgrade (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD, | 1747 | res = test_upgrade (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD, |
1729 | 2); | 1748 | 2); |
1749 | fflush_allstd (); | ||
1730 | error_count += res; | 1750 | error_count += res; |
1731 | if (res) | 1751 | if (res) |
1732 | fprintf (stderr, | 1752 | fprintf (stderr, |
@@ -1737,6 +1757,7 @@ main (int argc, | |||
1737 | #ifdef HAVE_POLL | 1757 | #ifdef HAVE_POLL |
1738 | res = test_upgrade (MHD_USE_POLL_INTERNAL_THREAD, | 1758 | res = test_upgrade (MHD_USE_POLL_INTERNAL_THREAD, |
1739 | 0); | 1759 | 0); |
1760 | fflush_allstd (); | ||
1740 | error_count += res; | 1761 | error_count += res; |
1741 | if (res) | 1762 | if (res) |
1742 | fprintf (stderr, | 1763 | fprintf (stderr, |
@@ -1746,6 +1767,7 @@ main (int argc, | |||
1746 | printf ("PASSED: Upgrade with internal poll.\n"); | 1767 | printf ("PASSED: Upgrade with internal poll.\n"); |
1747 | res = test_upgrade (MHD_USE_POLL_INTERNAL_THREAD, | 1768 | res = test_upgrade (MHD_USE_POLL_INTERNAL_THREAD, |
1748 | 2); | 1769 | 2); |
1770 | fflush_allstd (); | ||
1749 | if (res) | 1771 | if (res) |
1750 | fprintf (stderr, | 1772 | fprintf (stderr, |
1751 | "FAILED: Upgrade with internal poll with thread pool, return code %d.\n", | 1773 | "FAILED: Upgrade with internal poll with thread pool, return code %d.\n", |
@@ -1756,6 +1778,7 @@ main (int argc, | |||
1756 | #ifdef EPOLL_SUPPORT | 1778 | #ifdef EPOLL_SUPPORT |
1757 | res = test_upgrade (MHD_USE_EPOLL_INTERNAL_THREAD, | 1779 | res = test_upgrade (MHD_USE_EPOLL_INTERNAL_THREAD, |
1758 | 0); | 1780 | 0); |
1781 | fflush_allstd (); | ||
1759 | if (res) | 1782 | if (res) |
1760 | fprintf (stderr, | 1783 | fprintf (stderr, |
1761 | "FAILED: Upgrade with internal epoll, return code %d.\n", | 1784 | "FAILED: Upgrade with internal epoll, return code %d.\n", |
@@ -1764,6 +1787,7 @@ main (int argc, | |||
1764 | printf ("PASSED: Upgrade with internal epoll.\n"); | 1787 | printf ("PASSED: Upgrade with internal epoll.\n"); |
1765 | res = test_upgrade (MHD_USE_EPOLL_INTERNAL_THREAD, | 1788 | res = test_upgrade (MHD_USE_EPOLL_INTERNAL_THREAD, |
1766 | 2); | 1789 | 2); |
1790 | fflush_allstd (); | ||
1767 | if (res) | 1791 | if (res) |
1768 | fprintf (stderr, | 1792 | fprintf (stderr, |
1769 | "FAILED: Upgrade with internal epoll, return code %d.\n", | 1793 | "FAILED: Upgrade with internal epoll, return code %d.\n", |