summaryrefslogtreecommitdiff
path: root/t/19multi.t
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2022-07-25 08:08:15 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2022-07-25 08:08:15 +0900
commitc8f6b2b08686739e16e09d3a8addc6d141dd2728 (patch)
tree0f037734e1d3e55981cab48417ccd0ee4d0687ca /t/19multi.t
parent5f078293114df781a41e7812886b1740e78f933c (diff)
downloadperl-WWW-Curl-c8f6b2b08686739e16e09d3a8addc6d141dd2728.tar.gz
perl-WWW-Curl-c8f6b2b08686739e16e09d3a8addc6d141dd2728.tar.bz2
perl-WWW-Curl-c8f6b2b08686739e16e09d3a8addc6d141dd2728.zip
Imported Upstream version 4.15upstream/4.15
Diffstat (limited to 't/19multi.t')
-rw-r--r--t/19multi.t14
1 files changed, 12 insertions, 2 deletions
diff --git a/t/19multi.t b/t/19multi.t
index cfcf489..6f4c1cc 100644
--- a/t/19multi.t
+++ b/t/19multi.t
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use Test::More tests => 16;
+use Test::More tests => 20;
use WWW::Curl::Easy;
use WWW::Curl::Multi;
use File::Temp qw/tempfile/;
@@ -38,11 +38,13 @@ sub action_wait {
$curl->setopt( CURLOPT_URL, $url);
ok(! $curl->setopt(CURLOPT_WRITEHEADER, $header), "Setting CURLOPT_WRITEHEADER");
ok(! $curl->setopt(CURLOPT_WRITEDATA,$body), "Setting CURLOPT_WRITEDATA");
+ ok(! $curl->setopt(CURLOPT_PRIVATE,"foo"), "Setting CURLOPT_PRIVATE");
my $curl2 = new WWW::Curl::Easy;
$curl2->setopt( CURLOPT_URL, $url);
ok(! $curl2->setopt(CURLOPT_WRITEHEADER, $header2), "Setting CURLOPT_WRITEHEADER");
ok(! $curl2->setopt(CURLOPT_WRITEDATA,$body2), "Setting CURLOPT_WRITEDATA");
+ ok(! $curl2->setopt(CURLOPT_PRIVATE,42), "Setting CURLOPT_PRIVATE");
my $curlm = new WWW::Curl::Multi;
my @fds = $curlm->fdset;
@@ -63,7 +65,15 @@ sub action_wait {
$curlm->perform;
@fds = $curlm->fdset;
ok( @{$fds[0]} + @{$fds[1]} == 2, "The read or write fdset contains two fds");
- while ($curlm->perform) {
+ my $active = 2;
+ while ($active != 0) {
+ my $ret = $curlm->perform;
+ if ($ret != $active) {
+ while (my ($id,$value) = $curlm->info_read) {
+ ok($id eq "foo" || $id == 42, "The stored private value matches what we set");
+ }
+ $active = $ret;
+ }
action_wait($curlm);
}
@fds = $curlm->fdset;