You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by jo...@apache.org on 2007/02/21 14:35:44 UTC
svn commit: r510006 - /apr/apr/trunk/test/testpoll.c
Author: jorton
Date: Wed Feb 21 05:35:43 2007
New Revision: 510006
URL: http://svn.apache.org/viewvc?view=rev&rev=510006
Log:
* test/testpoll.c (setup_pollcb, trigger_pollcb, timeout_pollcb,
timeout_pollin_pollcb): Skip tests if pollcb interface is ENOTIMPL.
Modified:
apr/apr/trunk/test/testpoll.c
Modified: apr/apr/trunk/test/testpoll.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testpoll.c?view=diff&rev=510006&r1=510005&r2=510006
==============================================================================
--- apr/apr/trunk/test/testpoll.c (original)
+++ apr/apr/trunk/test/testpoll.c Wed Feb 21 05:35:43 2007
@@ -553,11 +553,20 @@
(hot_files[1].client_data == (void *)1)));
}
+#define POLLCB_PREREQ do { if (pollcb == NULL) \
+ABTS_NOT_IMPL(tc, "pollcb interface not supported"); return; } while (0)
+
static void setup_pollcb(abts_case *tc, void *data)
{
apr_status_t rv;
rv = apr_pollcb_create(&pollcb, LARGE_NUM_SOCKETS, p, 0);
- ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+ if (rv == APR_ENOTIMPL) {
+ pollcb = NULL;
+ ABTS_NOT_IMPL(tc, "pollcb interface not supported");
+ }
+ else {
+ ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+ }
}
typedef struct pollcb_baton_t {
@@ -580,6 +589,8 @@
apr_pollfd_t socket_pollfd;
pollcb_baton_t pcb;
+ POLLCB_PREREQ;
+
ABTS_PTR_NOTNULL(tc, s[0]);
socket_pollfd.desc_type = APR_POLL_SOCKET;
socket_pollfd.reqevents = APR_POLLIN;
@@ -603,6 +614,9 @@
{
apr_status_t rv;
pollcb_baton_t pcb;
+
+ POLLCB_PREREQ;
+
pcb.count = 0;
pcb.tc = tc;
@@ -616,6 +630,8 @@
apr_status_t rv;
pollcb_baton_t pcb;
apr_pollfd_t socket_pollfd;
+
+ POLLCB_PREREQ;
recv_msg(s, 0, p, tc);
Re: svn commit: r510006 - /apr/apr/trunk/test/testpoll.c
Posted by Joe Orton <jo...@redhat.com>.
On Wed, Feb 21, 2007 at 06:38:52PM -0800, Ryan Phillips wrote:
> The following #define returns in every instance even if pollcb is
> different than NULL. Was this meant to be this way?
Oops, no.
> I have included a small patch...
Thanks Ryan; tweaked to still return in the NULL case, and applied
:)
joe
Re: svn commit: r510006 - /apr/apr/trunk/test/testpoll.c
Posted by Ryan Phillips <ry...@trolocsis.com>.
The following #define returns in every instance even if pollcb is
different than NULL. Was this meant to be this way?
I have included a small patch...
-Ryan
jorton@apache.org said:
> Author: jorton
> Date: Wed Feb 21 05:35:43 2007
> New Revision: 510006
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=510006
> Log:
> * test/testpoll.c (setup_pollcb, trigger_pollcb, timeout_pollcb,
> timeout_pollin_pollcb): Skip tests if pollcb interface is ENOTIMPL.
>
> Modified:
> apr/apr/trunk/test/testpoll.c
>
> Modified: apr/apr/trunk/test/testpoll.c
> URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testpoll.c?view=diff&rev=510006&r1=510005&r2=510006
> ==============================================================================
> --- apr/apr/trunk/test/testpoll.c (original)
> +++ apr/apr/trunk/test/testpoll.c Wed Feb 21 05:35:43 2007
> @@ -553,11 +553,20 @@
> (hot_files[1].client_data == (void *)1)));
> }
>
> +#define POLLCB_PREREQ do { if (pollcb == NULL) \
> +ABTS_NOT_IMPL(tc, "pollcb interface not supported"); return; } while (0)
> +