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);
my $host = "no.such.host";
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 && $@->addinfo() eq $host,
- "connection to non-existent host '$host' fails: \$conn=$conn, \$\@=$@");
+ ($@->code() == ZOOM::Error::CONNECT ||
+ $@->code() == ZOOM::Error::TIMEOUT) && $@->addinfo() eq $host,
+ "connection to non-existent host '$host' fails: \$\@=$@");
$host = "z3950.indexdata.com/gils";
eval { $conn = new ZOOM::Connection($host, 0) };