about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-06-26 07:58:15 +0000
committerEric Wong <e@80x24.org>2019-06-26 07:58:15 +0000
commit7d7e5013e3d2e56c48735698e39890e8f67b6b56 (patch)
tree4ead243f0c08ce31bf8da9ada8bcda05ad63bc22 /t
parent84d8920b92686e975929aebe845b6d4ea0a9ef0d (diff)
downloadpublic-inbox-7d7e5013e3d2e56c48735698e39890e8f67b6b56.tar.gz
On Linux systems with epoll support, we don't want to be
clobbering defined subs in the t/ds-poll.t test; so use
OO ->method dispatch instead and require users to explicitly
import subs via EXPORT_OK.
Diffstat (limited to 't')
-rw-r--r--t/ds-poll.t20
1 files changed, 10 insertions, 10 deletions
diff --git a/t/ds-poll.t b/t/ds-poll.t
index a397ee06..c9dcdd22 100644
--- a/t/ds-poll.t
+++ b/t/ds-poll.t
@@ -14,31 +14,31 @@ my $p = $cls->new;
 my ($r, $w, $x, $y);
 pipe($r, $w) or die;
 pipe($x, $y) or die;
-is(epoll_ctl($p, EPOLL_CTL_ADD, fileno($r), EPOLLIN), 0, 'add EPOLLIN');
+is($p->epoll_ctl(EPOLL_CTL_ADD, fileno($r), EPOLLIN), 0, 'add EPOLLIN');
 my $events = [];
-my $n = epoll_wait($p, 9, 0, $events);
+my $n = $p->epoll_wait(9, 0, $events);
 is_deeply($events, [], 'no events set');
 is($n, 0, 'nothing ready, yet');
-is(epoll_ctl($p, EPOLL_CTL_ADD, fileno($w), EPOLLOUT|EPOLLONESHOT), 0,
+is($p->epoll_ctl(EPOLL_CTL_ADD, fileno($w), EPOLLOUT|EPOLLONESHOT), 0,
         'add EPOLLOUT|EPOLLONESHOT');
-$n = epoll_wait($p, 9, -1, $events);
+$n = $p->epoll_wait(9, -1, $events);
 is($n, 1, 'got POLLOUT event');
 is($events->[0]->[0], fileno($w), '$w ready');
 
-$n = epoll_wait($p, 9, 0, $events);
+$n = $p->epoll_wait(9, 0, $events);
 is($n, 0, 'nothing ready after oneshot');
 is_deeply($events, [], 'no events set after oneshot');
 
 syswrite($w, '1') == 1 or die;
 for my $t (0..1) {
-        $n = epoll_wait($p, 9, $t, $events);
+        $n = $p->epoll_wait(9, $t, $events);
         is($events->[0]->[0], fileno($r), "level-trigger POLLIN ready #$t");
         is($n, 1, "only event ready #$t");
 }
 syswrite($y, '1') == 1 or die;
-is(epoll_ctl($p, EPOLL_CTL_ADD, fileno($x), EPOLLIN|EPOLLONESHOT), 0,
+is($p->epoll_ctl(EPOLL_CTL_ADD, fileno($x), EPOLLIN|EPOLLONESHOT), 0,
         'EPOLLIN|EPOLLONESHOT add');
-is(epoll_wait($p, 9, -1, $events), 2, 'epoll_wait has 2 ready');
+is($p->epoll_wait(9, -1, $events), 2, 'epoll_wait has 2 ready');
 my @fds = sort(map { $_->[0] } @$events);
 my @exp = sort((fileno($r), fileno($x)));
 is_deeply(\@fds, \@exp, 'got both ready FDs');
@@ -50,8 +50,8 @@ SKIP: {
         if ($cls ne 'PublicInbox::DSPoll') {
                 skip "$cls doesn't handle EPOLL_CTL_DEL", 2;
         }
-        is(epoll_ctl($p, EPOLL_CTL_DEL, fileno($r), 0), 0, 'EPOLL_CTL_DEL OK');
-        $n = epoll_wait($p, 9, 0, $events);
+        is($p->epoll_ctl(EPOLL_CTL_DEL, fileno($r), 0), 0, 'EPOLL_CTL_DEL OK');
+        $n = $p->epoll_wait(9, 0, $events);
         is($n, 0, 'nothing ready after EPOLL_CTL_DEL');
 };