libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 6092a01a4892a04544e9b668698f14f975042074
parent 611597070cb24a18e740f776a65a5a04b208ad81
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Thu,  7 May 2015 17:04:37 +0000

tests: replace '#ifdefs' with 'MHD_is_feature_supported()'

Diffstat:
Msrc/testcurl/perf_get.c | 20+++++++++++---------
Msrc/testcurl/test_get.c | 30++++++++++++++++--------------
Msrc/testcurl/test_quiesce.c | 20+++++++++++---------
Msrc/testcurl/test_start_stop.c | 20+++++++++++---------
4 files changed, 49 insertions(+), 41 deletions(-)

diff --git a/src/testcurl/perf_get.c b/src/testcurl/perf_get.c @@ -513,15 +513,17 @@ main (int argc, char *const *argv) errorCount += testInternalGet (port++, 0); errorCount += testMultithreadedGet (port++, 0); errorCount += testMultithreadedPoolGet (port++, 0); -#ifndef WINDOWS - errorCount += testInternalGet (port++, MHD_USE_POLL); - errorCount += testMultithreadedGet (port++, MHD_USE_POLL); - errorCount += testMultithreadedPoolGet (port++, MHD_USE_POLL); -#endif -#if EPOLL_SUPPORT - errorCount += testInternalGet (port++, MHD_USE_EPOLL_LINUX_ONLY); - errorCount += testMultithreadedPoolGet (port++, MHD_USE_EPOLL_LINUX_ONLY); -#endif + if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_POLL)) + { + errorCount += testInternalGet(port++, MHD_USE_POLL); + errorCount += testMultithreadedGet(port++, MHD_USE_POLL); + errorCount += testMultithreadedPoolGet(port++, MHD_USE_POLL); + } + if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_EPOLL)) + { + errorCount += testInternalGet(port++, MHD_USE_EPOLL_LINUX_ONLY); + errorCount += testMultithreadedPoolGet(port++, MHD_USE_EPOLL_LINUX_ONLY); + } MHD_destroy_response (response); if (errorCount != 0) fprintf (stderr, "Error (code: %u)\n", errorCount); diff --git a/src/testcurl/test_get.c b/src/testcurl/test_get.c @@ -617,20 +617,22 @@ main (int argc, char *const *argv) errorCount += testStopRace (0); errorCount += testExternalGet (); errorCount += testEmptyGet (0); -#ifndef WINDOWS - errorCount += testInternalGet (MHD_USE_POLL); - errorCount += testMultithreadedGet (MHD_USE_POLL); - errorCount += testMultithreadedPoolGet (MHD_USE_POLL); - errorCount += testUnknownPortGet (MHD_USE_POLL); - errorCount += testStopRace (MHD_USE_POLL); - errorCount += testEmptyGet (MHD_USE_POLL); -#endif -#if EPOLL_SUPPORT - errorCount += testInternalGet (MHD_USE_EPOLL_LINUX_ONLY); - errorCount += testMultithreadedPoolGet (MHD_USE_EPOLL_LINUX_ONLY); - errorCount += testUnknownPortGet (MHD_USE_EPOLL_LINUX_ONLY); - errorCount += testEmptyGet (MHD_USE_EPOLL_LINUX_ONLY); -#endif + if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_POLL)) + { + errorCount += testInternalGet(MHD_USE_POLL); + errorCount += testMultithreadedGet(MHD_USE_POLL); + errorCount += testMultithreadedPoolGet(MHD_USE_POLL); + errorCount += testUnknownPortGet(MHD_USE_POLL); + errorCount += testStopRace(MHD_USE_POLL); + errorCount += testEmptyGet(MHD_USE_POLL); + } + if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_EPOLL)) + { + errorCount += testInternalGet(MHD_USE_EPOLL_LINUX_ONLY); + errorCount += testMultithreadedPoolGet(MHD_USE_EPOLL_LINUX_ONLY); + errorCount += testUnknownPortGet(MHD_USE_EPOLL_LINUX_ONLY); + errorCount += testEmptyGet(MHD_USE_EPOLL_LINUX_ONLY); + } if (errorCount != 0) fprintf (stderr, "Error (code: %u)\n", errorCount); curl_global_cleanup (); diff --git a/src/testcurl/test_quiesce.c b/src/testcurl/test_quiesce.c @@ -439,15 +439,17 @@ main (int argc, char *const *argv) errorCount += testGet (MHD_USE_THREAD_PER_CONNECTION, 0, 0); errorCount += testGet (MHD_USE_SELECT_INTERNALLY, CPU_COUNT, 0); errorCount += testExternalGet (); -#ifndef WINDOWS - errorCount += testGet (MHD_USE_SELECT_INTERNALLY, 0, MHD_USE_POLL); - errorCount += testGet (MHD_USE_THREAD_PER_CONNECTION, 0, MHD_USE_POLL); - errorCount += testGet (MHD_USE_SELECT_INTERNALLY, CPU_COUNT, MHD_USE_POLL); -#endif -#if EPOLL_SUPPORT - errorCount += testGet (MHD_USE_SELECT_INTERNALLY, 0, MHD_USE_EPOLL_LINUX_ONLY); - errorCount += testGet (MHD_USE_SELECT_INTERNALLY, CPU_COUNT, MHD_USE_EPOLL_LINUX_ONLY); -#endif + if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_POLL)) + { + errorCount += testGet(MHD_USE_SELECT_INTERNALLY, 0, MHD_USE_POLL); + errorCount += testGet (MHD_USE_THREAD_PER_CONNECTION, 0, MHD_USE_POLL); + errorCount += testGet (MHD_USE_SELECT_INTERNALLY, CPU_COUNT, MHD_USE_POLL); + } + if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_EPOLL)) + { + errorCount += testGet (MHD_USE_SELECT_INTERNALLY, 0, MHD_USE_EPOLL_LINUX_ONLY); + errorCount += testGet (MHD_USE_SELECT_INTERNALLY, CPU_COUNT, MHD_USE_EPOLL_LINUX_ONLY); + } if (errorCount != 0) fprintf (stderr, "Error (code: %u)\n", errorCount); curl_global_cleanup (); diff --git a/src/testcurl/test_start_stop.c b/src/testcurl/test_start_stop.c @@ -112,15 +112,17 @@ main (int argc, char *const *argv) errorCount += testMultithreadedGet (0); errorCount += testMultithreadedPoolGet (0); errorCount += testExternalGet (); -#ifndef WINDOWS - errorCount += testInternalGet (MHD_USE_POLL); - errorCount += testMultithreadedGet (MHD_USE_POLL); - errorCount += testMultithreadedPoolGet (MHD_USE_POLL); -#endif -#if EPOLL_SUPPORT - errorCount += testInternalGet (MHD_USE_EPOLL_LINUX_ONLY); - errorCount += testMultithreadedPoolGet (MHD_USE_EPOLL_LINUX_ONLY); -#endif + if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_POLL)) + { + errorCount += testInternalGet(MHD_USE_POLL); + errorCount += testMultithreadedGet(MHD_USE_POLL); + errorCount += testMultithreadedPoolGet(MHD_USE_POLL); + } + if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_EPOLL)) + { + errorCount += testInternalGet(MHD_USE_EPOLL_LINUX_ONLY); + errorCount += testMultithreadedPoolGet(MHD_USE_EPOLL_LINUX_ONLY); + } if (errorCount != 0) fprintf (stderr, "Error (code: %u)\n", errorCount); return errorCount != 0; /* 0 == pass */