apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r390330 - /apr/apr/branches/pollcb-dev/test/testpoll.c
Date Fri, 31 Mar 2006 05:27:01 GMT
Author: pquerna
Date: Thu Mar 30 21:26:50 2006
New Revision: 390330

URL: http://svn.apache.org/viewcvs?rev=390330&view=rev
Log:
Add a new timeout testcase, which makes sure that with no sockets inside the pollset, we should
trigger a timeout.

Modified:
    apr/apr/branches/pollcb-dev/test/testpoll.c

Modified: apr/apr/branches/pollcb-dev/test/testpoll.c
URL: http://svn.apache.org/viewcvs/apr/apr/branches/pollcb-dev/test/testpoll.c?rev=390330&r1=390329&r2=390330&view=diff
==============================================================================
--- apr/apr/branches/pollcb-dev/test/testpoll.c (original)
+++ apr/apr/branches/pollcb-dev/test/testpoll.c Thu Mar 30 21:26:50 2006
@@ -599,6 +599,18 @@
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 }
 
+static void timeout_pollcb(abts_case *tc, void *data)
+{
+    apr_status_t rv;
+    pollcb_baton_t pcb;
+    pcb.count = 0;
+    pcb.tc = tc;
+
+    rv = apr_pollcb_poll(pollcb, 1, trigger_pollcb_cb, &pcb);    
+    ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv));
+    ABTS_INT_EQUAL(tc, 0, pcb.count);
+}
+
 abts_suite *testpoll(abts_suite *suite)
 {
     suite = ADD_SUITE(suite)
@@ -636,6 +648,7 @@
     abts_run_test(suite, create_all_sockets, NULL);
     abts_run_test(suite, setup_pollcb, NULL);
     abts_run_test(suite, trigger_pollcb, NULL);
+    abts_run_test(suite, timeout_pollcb, NULL);
     abts_run_test(suite, close_all_sockets, NULL);
 
     return suite;



Mime
View raw message