From dev-return-15400-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Tue Jan 31 04:46:44 2006 Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 67624 invoked from network); 31 Jan 2006 04:46:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 31 Jan 2006 04:46:44 -0000 Received: (qmail 50997 invoked by uid 500); 31 Jan 2006 04:46:42 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 50960 invoked by uid 500); 31 Jan 2006 04:46:42 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 50949 invoked by uid 99); 31 Jan 2006 04:46:42 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jan 2006 20:46:42 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UPPERCASE_25_50 X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [216.193.197.90] (HELO gs3.inmotionhosting.com) (216.193.197.90) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jan 2006 20:46:41 -0800 Received: from c66-235-49-126.sea2.cablespeed.com ([66.235.49.126]:64992 helo=[192.168.1.103]) by gs3.inmotionhosting.com with esmtpsa (TLSv1:RC4-SHA:128) (Exim 4.52) id 1F3nPP-0001V9-9z for dev@apr.apache.org; Mon, 30 Jan 2006 20:46:27 -0800 Mime-Version: 1.0 (Apple Message framework v746.2) Content-Transfer-Encoding: 7bit Message-Id: <42EAF182-825B-4C89-BAD9-6F27DD493CF6@apache.org> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: dev@apr.apache.org From: Brian Pane Subject: [PATCH] testpoll fix Date: Mon, 30 Jan 2006 20:47:42 -0800 X-Mailer: Apple Mail (2.746.2) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gs3.inmotionhosting.com X-AntiAbuse: Original Domain - apr.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - apache.org X-Source: X-Source-Args: X-Source-Dir: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This patch should allow the APR testpoll test to work with pollset implementations where readability and writability events on the same descriptor can end up in two separate pollfd_t objects, such as kqueue. The only pollset implementations for which I have test environments, though, are select and epoll. Can someone with *BSD please try this patch and let me know if testpoll passes with the kqueue impl? Thanks, Brian Index: test/testpoll.c =================================================================== --- test/testpoll.c (revision 373696) +++ test/testpoll.c (working copy) @@ -309,11 +309,20 @@ rv = apr_pollset_poll(pollset, 0, &lrv, &descs); ABTS_INT_EQUAL(tc, 0, APR_STATUS_IS_TIMEUP(rv)); - ABTS_INT_EQUAL(tc, 1, lrv); - ABTS_PTR_EQUAL(tc, s[0], descs[0].desc.s); - ABTS_INT_EQUAL(tc, APR_POLLIN | APR_POLLOUT, descs[0].rtnevents); - ABTS_PTR_EQUAL(tc, s[0], descs[0].client_data); - + ABTS_TRUE(tc, ((lrv == 1) || (lrv == 2))); + if (lrv == 1) { + ABTS_PTR_EQUAL(tc, s[0], descs[0].desc.s); + ABTS_INT_EQUAL(tc, APR_POLLIN | APR_POLLOUT, descs [0].rtnevents); + ABTS_PTR_EQUAL(tc, s[0], descs[0].client_data); + } + else { + ABTS_PTR_EQUAL(tc, s[0], descs[0].desc.s); + ABTS_PTR_EQUAL(tc, s[0], descs[1].desc.s); + ABTS_INT_EQUAL(tc, APR_POLLIN | APR_POLLOUT, + descs[0].rtnevents | descs[1].rtnevents); + ABTS_PTR_EQUAL(tc, s[0], descs[0].client_data); + ABTS_PTR_EQUAL(tc, s[0], descs[1].client_data); + } recv_msg(s, 0, p, tc); rv = apr_pollset_poll(pollset, 0, &lrv, &descs);