summaryrefslogtreecommitdiff
path: root/test/testpoll.c
diff options
context:
space:
mode:
authorMladen Turk <mturk@apache.org>2008-04-13 08:31:03 +0000
committerMladen Turk <mturk@apache.org>2008-04-13 08:31:03 +0000
commitfc18a5fd06cc94fdf12e6136d67480e500c166fa (patch)
tree4002c9a170be10f9dd02301511de408a02d26f27 /test/testpoll.c
parent8744772ba11042a1d24ac5d1899062d2c209bdbf (diff)
downloadapr-fc18a5fd06cc94fdf12e6136d67480e500c166fa.tar.gz
Introduce apr_pollset_wakeup()
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@647540 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testpoll.c')
-rw-r--r--test/testpoll.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/testpoll.c b/test/testpoll.c
index e7792c2f1..a0f56a149 100644
--- a/test/testpoll.c
+++ b/test/testpoll.c
@@ -659,6 +659,22 @@ static void timeout_pollin_pollcb(abts_case *tc, void *data)
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
}
+static void test_wakeup(abts_case *tc, void *data)
+{
+ apr_status_t rv;
+ int i, lrv;
+ const apr_pollfd_t *descs = NULL;
+
+ for (i = 0; i < 1000; i++) {
+ rv = apr_pollset_wakeup(pollset);
+ ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+ }
+ rv = apr_pollset_poll(pollset, 0, &lrv, &descs);
+ ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EINTR(rv));
+ ABTS_INT_EQUAL(tc, 0, lrv);
+ ABTS_PTR_EQUAL(tc, NULL, descs);
+}
+
abts_suite *testpoll(abts_suite *suite)
{
suite = ADD_SUITE(suite)
@@ -688,6 +704,7 @@ abts_suite *testpoll(abts_suite *suite)
abts_run_test(suite, clear_middle_pollset, NULL);
abts_run_test(suite, send_last_pollset, NULL);
abts_run_test(suite, clear_last_pollset, NULL);
+ abts_run_test(suite, test_wakeup, NULL);
abts_run_test(suite, pollset_remove, NULL);