X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=t%2F14-sorting.t;h=341ed4453095fc641eaceef7ac5f2171cbdc9c66;hb=eb9ae2e0469870dc0766688e83db55ed598cd20f;hp=d13555402505ad9ced110ad03e5e4fc2d22ca24b;hpb=24e8535c8420bfaaa519caf2e7fa3b95c6258faf;p=ZOOM-Perl-moved-to-github.git diff --git a/t/14-sorting.t b/t/14-sorting.t index d135554..341ed44 100644 --- a/t/14-sorting.t +++ b/t/14-sorting.t @@ -1,5 +1,3 @@ -# $Id: 14-sorting.t,v 1.5 2005-11-08 16:40:06 mike Exp $ - # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl 14-sorting.t' @@ -12,7 +10,7 @@ BEGIN { use_ok('Net::Z3950::ZOOM') }; my($errcode, $errmsg, $addinfo) = (undef, "dummy", "dummy"); -my $host = "indexdata.com/gils"; +my $host = "z3950.indexdata.com/gils"; my $conn = Net::Z3950::ZOOM::connection_new($host, 0); $errcode = Net::Z3950::ZOOM::connection_error($conn, $errmsg, $addinfo); ok($errcode == 0, "connection to '$host'"); @@ -33,8 +31,7 @@ my $previous = ""; # Sorts before all legitimate titles foreach my $i (1 .. $n) { my $rec = Net::Z3950::ZOOM::resultset_record($rs, $i-1); ok(defined $rec, "got record $i of $n"); - my $len = 0; - my $raw = Net::Z3950::ZOOM::record_get($rec, "raw", $len); + my $raw = Net::Z3950::ZOOM::record_get($rec, "raw"); my $marc = new_from_usmarc MARC::Record($raw); my $title = $marc->title(); ok($title ge $previous, "title '$title' ge previous '$previous'"); @@ -43,17 +40,16 @@ foreach my $i (1 .. $n) { # Now reverse the order of sorting. We never use resultset_sort(), # which is identical to sort1() except that it returns nothing. -my $status = Net::Z3950::ZOOM::resultset_sort1($rs, "dummy", "1=4>i"); +my $status = Net::Z3950::ZOOM::resultset_sort1($rs, "yaz", "1=4>i"); ok($status < 0, "malformed sort criterion rejected"); -$status = Net::Z3950::ZOOM::resultset_sort1($rs, "dummy", "1=4 >i"); +$status = Net::Z3950::ZOOM::resultset_sort1($rs, "yaz", "1=4 >i"); ok($status == 0, "sort criterion accepted"); $previous = "z"; # Sorts after all legitimate titles foreach my $i (1 .. $n) { my $rec = Net::Z3950::ZOOM::resultset_record($rs, $i-1); ok(defined $rec, "got record $i of $n"); - my $len = 0; - my $raw = Net::Z3950::ZOOM::record_get($rec, "raw", $len); + my $raw = Net::Z3950::ZOOM::record_get($rec, "raw"); my $marc = new_from_usmarc MARC::Record($raw); my $title = $marc->title(); ok($title le $previous, "title '$title' le previous '$previous'");