Skip to content

Commit

Permalink
Fix test on old curls (e.g., CentOS 6).
Browse files Browse the repository at this point in the history
  • Loading branch information
FGasper committed Mar 31, 2021
1 parent 305e669 commit 0a6e53f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Revision history for Perl module Net::Curl::Promiser

0.16
- Fix t/Net-Curl-Promiser-Select.t with CentOS 6’s default libcurl.

0.15 Wed 31 Mar 2021
- BUG FIX: cancel_handle() and fail_handle() now immediately release
event-loop interactions. Previously memory leak warnings happened if the
Expand Down
26 changes: 13 additions & 13 deletions t/Net-Curl-Promiser-Select.t
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,25 @@ plan tests => 2 + $ClientTest::TEST_COUNT;
while ($promiser->handles()) {
my $timeout = $promiser->get_timeout();

if ($timeout && $timeout != -1) {
($rout, $wout, $eout) = $promiser->get_vecs();
($rout, $wout, $eout) = $promiser->get_vecs();

if (!$checked_get_fds) {
if (grep { tr<\0><>c } $rout, $wout) {
$checked_get_fds++;
if (!$checked_get_fds) {
if (grep { tr<\0><>c } $rout, $wout) {
$checked_get_fds++;

my @fds = $promiser->get_fds();
my @fds = $promiser->get_fds();

ok( 0 + @fds, 'get_fds() returns something when get_vecs() does' );
ok( 0 + @fds, 'get_fds() returns something when get_vecs() does' );

is(
0 + @fds,
0 + $promiser->get_fds(),
'get_fds() in scalar',
);
}
is(
0 + @fds,
0 + $promiser->get_fds(),
'get_fds() in scalar',
);
}
}

if ($timeout && $timeout != -1) {
my $got = select $rout, $wout, $eout, $timeout;

die "select(): $!" if $got < 0;
Expand Down

0 comments on commit 0a6e53f

Please sign in to comment.