Recognise TIMEOUT errors as well as CONNECT errors in the attempt to connect to no...
[ZOOM-Perl-moved-to-github.git] / t / 1-Net-Z3950-ZOOM.t
index 74e3990..27c479e 100644 (file)
@@ -19,8 +19,10 @@ my($errcode, $errmsg, $addinfo) = (undef, "dummy", "dummy");
 my $host = "no.such.host";
 my $conn = Net::Z3950::ZOOM::connection_new($host, 0);
 $errcode = Net::Z3950::ZOOM::connection_error($conn, $errmsg, $addinfo);
-ok($errcode == Net::Z3950::ZOOM::ERROR_CONNECT && $addinfo eq $host,
-   "connection to non-existent host '$host' fails: \$conn=$conn, errcode=$errcode, addinfo=$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,
+   "connection to non-existent host '$host' fails: errcode=$errcode, addinfo=$addinfo");
 
 $host = "z3950.indexdata.com/gils";
 $conn = Net::Z3950::ZOOM::connection_new($host, 0);