From: Mike Taylor Date: Tue, 8 Jun 2010 14:32:33 +0000 (+0100) Subject: Correct Red Hat connection-failure checks -- addinfo is empty when errcode==TIMEOUT X-Git-Tag: CPAN_1_26~7 X-Git-Url: http://git.indexdata.com/?p=ZOOM-Perl-moved-to-github.git;a=commitdiff_plain;h=e19515ab18d8e5002b39536d9d27ed7243eb4e64 Correct Red Hat connection-failure checks -- addinfo is empty when errcode==TIMEOUT --- diff --git a/t/1-Net-Z3950-ZOOM.t b/t/1-Net-Z3950-ZOOM.t index 27c479e..1e85894 100644 --- a/t/1-Net-Z3950-ZOOM.t +++ b/t/1-Net-Z3950-ZOOM.t @@ -20,8 +20,8 @@ my $host = "no.such.host"; my $conn = Net::Z3950::ZOOM::connection_new($host, 0); $errcode = Net::Z3950::ZOOM::connection_error($conn, $errmsg, $addinfo); # For some reason, Red Hat signals this as a TIMEOUT rather than a CONNECT -ok(($errcode == Net::Z3950::ZOOM::ERROR_CONNECT || - $errcode == Net::Z3950::ZOOM::ERROR_TIMEOUT) && $addinfo eq $host, +ok(($errcode == Net::Z3950::ZOOM::ERROR_CONNECT && $addinfo eq $host) || + ($errcode == Net::Z3950::ZOOM::ERROR_TIMEOUT && $addinfo eq ""), "connection to non-existent host '$host' fails: errcode=$errcode, addinfo=$addinfo"); $host = "z3950.indexdata.com/gils"; diff --git a/t/2-ZOOM.t b/t/2-ZOOM.t index aaf867d..ada3ea4 100644 --- a/t/2-ZOOM.t +++ b/t/2-ZOOM.t @@ -19,8 +19,8 @@ my $conn; eval { $conn = new ZOOM::Connection($host, 0) }; # For some reason, Red Hat signals this as a TIMEOUT rather than a CONNECT ok($@ && $@->isa("ZOOM::Exception") && - ($@->code() == ZOOM::Error::CONNECT || - $@->code() == ZOOM::Error::TIMEOUT) && $@->addinfo() eq $host, + (($@->code() == ZOOM::Error::CONNECT && $@->addinfo() eq $host) || + ($@->code() == ZOOM::Error::TIMEOUT && $@->addinfo() eq "")), "connection to non-existent host '$host' fails: \$\@=$@"); $host = "z3950.indexdata.com/gils";