r20931 - in /branches/upstream/libnet-z3950-zoom-perl/current: ./ lib/ lib/Net/Z3950/ samples/net-z3950-zoom/ samples/zoom/ t/
gregoa at users.alioth.debian.org
gregoa at users.alioth.debian.org
Thu Jun 12 13:48:14 UTC 2008
Author: gregoa
Date: Thu Jun 12 13:48:14 2008
New Revision: 20931
URL: http://svn.debian.org/wsvn/?sc=1&rev=20931
Log:
[svn-upgrade] Integrating new upstream version, libnet-z3950-zoom-perl (1.23)
Modified:
branches/upstream/libnet-z3950-zoom-perl/current/Changes
branches/upstream/libnet-z3950-zoom-perl/current/MANIFEST.SKIP
branches/upstream/libnet-z3950-zoom-perl/current/META.yml
branches/upstream/libnet-z3950-zoom-perl/current/Makefile.PL
branches/upstream/libnet-z3950-zoom-perl/current/ZOOM.xs
branches/upstream/libnet-z3950-zoom-perl/current/lib/Net/Z3950/ZOOM.pm
branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pm
branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pod
branches/upstream/libnet-z3950-zoom-perl/current/samples/net-z3950-zoom/async.pl
branches/upstream/libnet-z3950-zoom-perl/current/samples/net-z3950-zoom/zoomtst1.pl
branches/upstream/libnet-z3950-zoom-perl/current/samples/net-z3950-zoom/zoomtst3.pl
branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zoomscan.pl
branches/upstream/libnet-z3950-zoom-perl/current/t/1-Net-Z3950-ZOOM.t
branches/upstream/libnet-z3950-zoom-perl/current/t/12-query.t
branches/upstream/libnet-z3950-zoom-perl/current/t/13-resultset.t
branches/upstream/libnet-z3950-zoom-perl/current/t/14-sorting.t
branches/upstream/libnet-z3950-zoom-perl/current/t/18-charset.t
Modified: branches/upstream/libnet-z3950-zoom-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/Changes?rev=20931&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/Changes (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/Changes Thu Jun 12 13:48:14 2008
@@ -1,6 +1,28 @@
-$Id: Changes,v 1.71 2007-10-29 12:07:23 mike Exp $
+$Id: Changes,v 1.79 2008-06-09 13:53:22 mike Exp $
Revision history for Perl extension Net::Z3950::ZOOM.
+
+1.23 Mon Jun 9 14:53:15 BST 2008
+ - Net::Z3950::ZOOM::record_get() now patches around the
+ problem of naughty servers that refuse to return anything
+ for an OPAC record when there is no non-bibliographic part,
+ by falling back on requesting an XML record in such cases.
+
+1.22 Tue May 27 14:00:12 BST 2008
+ - Fix Net::Z3950::ZOOM::record_get() to use a struct datachunk
+ _when_ appropriate, e.g. for "render" not for "database" and
+ "syntax".
+ - Remove the unused $len reference parameter from record_get()
+ and $record->get(): this is now used in the underlying C
+ layer to make Perl strings of the right length, and is of no
+ value higher up the stack.
+ - Fix a bug in ZOOM::ResultSet::records(): requests including
+ the last record in the set were incorrectly declined.
+ - Better Debian packaging: use "make debian" to create new
+ "debian/output" directory containing .deb package file,
+ changes file, etc.
+ - Clear up a few warnings in ZOOM.xs
+ - Minor documentation improvements.
1.21 Mon Oct 29 12:07:25 GMT 2007
- In the "typemap" file's handling of opaquechar*, use STRLEN
@@ -258,9 +280,6 @@
To be done in future releases:
- Complete, test and document "update.pl"
- - Fix Net::Z3950::ZOOM::record_get() to use a struct datachunk
- _when_ appropriate, e.g. for "render" but probably not for
- "database" and "syntax".
- Create old-style Net::Z3950 compatibility layer.
- Fix memory leaks in callback functions for option sets.
- Fix limitation that option-set callback functions must be
Modified: branches/upstream/libnet-z3950-zoom-perl/current/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/MANIFEST.SKIP?rev=20931&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/MANIFEST.SKIP (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/MANIFEST.SKIP Thu Jun 12 13:48:14 2008
@@ -1,4 +1,4 @@
-# $Id: MANIFEST.SKIP,v 1.4 2007/07/09 13:03:00 mike Exp $
+# $Id: MANIFEST.SKIP,v 1.5 2007-11-19 12:58:55 mike Exp $
.cvsignore
CVS
@@ -6,3 +6,5 @@
lib/CVS
t/CVS
archive
+build-stamp
+install-stamp
Modified: branches/upstream/libnet-z3950-zoom-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/META.yml?rev=20931&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/META.yml (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/META.yml Thu Jun 12 13:48:14 2008
@@ -1,7 +1,7 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Net-Z3950-ZOOM
-version: 1.21
+version: 1.23
version_from: lib/Net/Z3950/ZOOM.pm
installdirs: site
requires:
Modified: branches/upstream/libnet-z3950-zoom-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/Makefile.PL?rev=20931&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/Makefile.PL (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/Makefile.PL Thu Jun 12 13:48:14 2008
@@ -1,4 +1,4 @@
-# $Id: Makefile.PL,v 1.24 2007/10/03 14:05:04 mike Exp $
+# $Id: Makefile.PL,v 1.26 2007-11-29 16:43:52 mike Exp $
# Use: perl Makefile.PL OPTIMIZE="-O0 -g -Wdeclaration-after-statement"
# or: perl Makefile.PL PREFIX=/home/mike/universe
@@ -62,3 +62,13 @@
exit 1;
}
}
+
+sub MY::postamble { "debian: debian/output
+
+debian/output:
+ dpkg-buildpackage -rfakeroot -d
+ rm -rf debian/output
+ mkdir debian/output
+ mv ../libnet-z3950-zoom-perl* debian/output
+";
+}
Modified: branches/upstream/libnet-z3950-zoom-perl/current/ZOOM.xs
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/ZOOM.xs?rev=20931&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/ZOOM.xs (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/ZOOM.xs Thu Jun 12 13:48:14 2008
@@ -1,4 +1,4 @@
-/* $Id: ZOOM.xs,v 1.49 2007-10-29 12:06:57 mike Exp $ */
+/* $Id: ZOOM.xs,v 1.51 2008-05-14 13:31:39 mike Exp $ */
#include "EXTERN.h"
#include "perl.h"
@@ -8,6 +8,7 @@
#include <yaz/diagsrw.h>
#include <yaz/xmalloc.h>
#include <yaz/log.h>
+#include <yaz/yaz-version.h>
/* Used by the *_setl() functions */
typedef char opaquechar;
@@ -320,16 +321,25 @@
diagset
# See "typemap" for discussion of the "const char *" return-type.
-#
-### but should use datachunk for in some (not all!) cases.
-const char *
-ZOOM_record_get(rec, type, len)
+const char *
+ZOOM_record_get_string(rec, type)
ZOOM_record rec
const char* type
- int &len
- OUTPUT:
- RETVAL
- len
+ INIT:
+ int len;
+ CODE:
+ RETVAL = ZOOM_record_get(rec, type, &len);
+ OUTPUT:
+ RETVAL
+
+struct datachunk
+ZOOM_record_get_binary(rec, type)
+ ZOOM_record rec
+ const char* type
+ CODE:
+ RETVAL.data = (char*) ZOOM_record_get(rec, type, &RETVAL.len);
+ OUTPUT:
+ RETVAL
void
ZOOM_record_destroy(rec)
@@ -563,7 +573,6 @@
INIT:
SV *realconns;
I32 n, i;
- int res;
ZOOM_connection *cs;
CODE:
/*printf("* in ZOOM_event(%p)\n", conns);*/
Modified: branches/upstream/libnet-z3950-zoom-perl/current/lib/Net/Z3950/ZOOM.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/lib/Net/Z3950/ZOOM.pm?rev=20931&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/lib/Net/Z3950/ZOOM.pm (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/lib/Net/Z3950/ZOOM.pm Thu Jun 12 13:48:14 2008
@@ -1,4 +1,4 @@
-# $Id: ZOOM.pm,v 1.36 2007-10-29 11:52:39 mike Exp $
+# $Id: ZOOM.pm,v 1.40 2008-06-09 13:53:00 mike Exp $
package Net::Z3950::ZOOM;
@@ -6,7 +6,7 @@
use strict;
use warnings;
-our $VERSION = '1.21';
+our $VERSION = '1.23';
require XSLoader;
XSLoader::load('Net::Z3950::ZOOM', $VERSION);
@@ -134,6 +134,43 @@
return "impossible event " . $code;
}
+
+# Switch API variant depending on $type. This works because the
+# get_string() and get_binary() functions have different returns
+# types, one of which is implemented as a NUL-terminated string and
+# the other as a pointer-and-length structure.
+#
+# Some Z39.50 servers, when asked for an OPAC-format record in the
+# case where no circulation information is available, will return a
+# USMARC record rather than an OPAC record containing only a
+# bibliographic part. This non-OPAC records is not recognised by the
+# underlying record_get() code in ZOOM-C, which ends up returning a
+# null pointer. To make life a little less painful when dealing with
+# such servers until ZOOM-C is fixed, this code recognises the
+# wrong-record-syntax case and returns the XML for the bibliographic
+# part anyway.
+#
+sub record_get {
+ my($rec, $type) = @_;
+
+ my $simpletype = $type;
+ $simpletype =~ s/;.*//;
+ if (grep { $type eq $_ } qw(database syntax schema)) {
+ return record_get_string($rec, $type);
+ } else {
+ my $val = record_get_binary($rec, $type);
+ if ($simpletype eq "opac" && !defined $val) {
+ my $newtype = $type;
+ if ($newtype !~ s/.*?;/xml;/) {
+ $newtype = "xml";
+ }
+ $val = record_get_binary($rec, $newtype);
+ }
+ return $val;
+ }
+}
+
+
=head1 SEE ALSO
The C<ZOOM> module, included in the same distribution as this one.
Modified: branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pm?rev=20931&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pm (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pm Thu Jun 12 13:48:14 2008
@@ -1,4 +1,4 @@
-# $Id: ZOOM.pm,v 1.49 2007/09/14 10:34:35 mike Exp $
+# $Id: ZOOM.pm,v 1.50 2008-05-14 13:33:31 mike Exp $
use strict;
use warnings;
@@ -898,14 +898,7 @@
my($type, $args) = @_;
$type = "$type;$args" if defined $args;
- my $len = 0;
- my $string = Net::Z3950::ZOOM::record_get($this->_rec(), $type, $len);
- # I don't think we need '$len' at all. ### Probably the Perl-to-C
- # glue code should use the value of `len' as well as the opaque
- # data-pointer returned, to ensure that the SV contains all of the
- # returned data and does not stop at the first NUL character in
- # binary data. Carefully check the ZOOM_record_get() documentation.
- return $string;
+ return Net::Z3950::ZOOM::record_get($this->_rec(), $type);
}
sub clone {
Modified: branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pod
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pod?rev=20931&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pod (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/lib/ZOOM.pod Thu Jun 12 13:48:14 2008
@@ -1,4 +1,4 @@
-# $Id: ZOOM.pod,v 1.44 2007/09/14 10:35:02 mike Exp $
+# $Id: ZOOM.pod,v 1.46 2007-12-10 21:51:40 mike Exp $
use strict;
use warnings;
@@ -545,7 +545,7 @@
The C<record()> method returns a C<ZOOM::Record> object representing
a record from result-set, whose position is indicated by the argument
passed in. This is a zero-based index, so that legitimate values
-range from zero to C<$rs->size()-1>.
+range from zero to C<$rs-E<gt>size()-1>.
The C<record_immediate()> API is identical, but it never invokes a
network operation, merely returning the record from the ResultSet's
@@ -571,7 +571,7 @@
strategy might be always to ask for blocks of a twenty records:
that's great for assembling long lists of things, but wasteful when
only one record is wanted. The problem is that the ZOOM module can't
-tell, when you call C<$rs->record()>, what your intention is.
+tell, when you call C<$rs-E<gt>record()>, what your intention is.
But you can tell it. The C<records()> method fetches a sequence of
records, all in one go. It takes three arguments: the first is the
Modified: branches/upstream/libnet-z3950-zoom-perl/current/samples/net-z3950-zoom/async.pl
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/samples/net-z3950-zoom/async.pl?rev=20931&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/samples/net-z3950-zoom/async.pl (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/samples/net-z3950-zoom/async.pl Thu Jun 12 13:48:14 2008
@@ -1,4 +1,4 @@
-# $Id: async.pl,v 1.3 2006/11/02 17:48:25 mike Exp $
+# $Id: async.pl,v 1.4 2008-05-14 13:34:00 mike Exp $
#
# See ../README for a description of this program.
# perl -I../../blib/lib -I../../blib/arch zoomtst3.pl <t1> [...] <tN> <query>
@@ -69,14 +69,13 @@
# Go through all records at target
$size = 10 if $size > 10;
for (my $pos = 0; $pos < $size; $pos++) {
- my $len = 0; # length of buffer rec
print "$tname: fetching ", $pos+1, " of $size\n";
my $tmp = Net::Z3950::ZOOM::resultset_record($r[$i], $pos);
if (!defined $tmp) {
print "$tname: can't get record ", $pos+1, "\n";
next;
}
- my $rec = Net::Z3950::ZOOM::record_get($tmp, "render", $len);
+ my $rec = Net::Z3950::ZOOM::record_get($tmp, "render");
if (!defined $rec) {
print "$tname: can't render record ", $pos+1, "\n";
next;
Modified: branches/upstream/libnet-z3950-zoom-perl/current/samples/net-z3950-zoom/zoomtst1.pl
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/samples/net-z3950-zoom/zoomtst1.pl?rev=20931&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/samples/net-z3950-zoom/zoomtst1.pl (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/samples/net-z3950-zoom/zoomtst1.pl Thu Jun 12 13:48:14 2008
@@ -1,4 +1,4 @@
-# $Id: zoomtst1.pl,v 1.3 2006/11/02 17:48:25 mike Exp $
+# $Id: zoomtst1.pl,v 1.4 2008-05-14 13:34:00 mike Exp $
#
# See ../README for a description of this program.
# perl -I../../blib/lib -I../../blib/arch zoomtst1.pl <target> <query>
@@ -37,8 +37,7 @@
for my $i (0..$n-1) {
my $rec = Net::Z3950::ZOOM::resultset_record($rs, $i);
print "=== Record ", $i+1, " of $n ===\n";
- my $dummy = 0;
- print Net::Z3950::ZOOM::record_get($rec, "render", $dummy);
+ print Net::Z3950::ZOOM::record_get($rec, "render");
}
Net::Z3950::ZOOM::resultset_destroy($rs);
Modified: branches/upstream/libnet-z3950-zoom-perl/current/samples/net-z3950-zoom/zoomtst3.pl
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/samples/net-z3950-zoom/zoomtst3.pl?rev=20931&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/samples/net-z3950-zoom/zoomtst3.pl (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/samples/net-z3950-zoom/zoomtst3.pl Thu Jun 12 13:48:14 2008
@@ -1,4 +1,4 @@
-# $Id: zoomtst3.pl,v 1.8 2006/11/02 17:48:25 mike Exp $
+# $Id: zoomtst3.pl,v 1.9 2008-05-14 13:34:00 mike Exp $
#
# See ../README for a description of this program.
# perl -I../../blib/lib -I../../blib/arch zoomtst3.pl <t1> [...] <tN> <query>
@@ -69,14 +69,13 @@
# Go through all records at target
$size = 10 if $size > 10;
for (my $pos = 0; $pos < $size; $pos++) {
- my $len = 0; # length of buffer rec
print "$tname: fetching ", $pos+1, " of $size\n";
my $tmp = Net::Z3950::ZOOM::resultset_record($r[$i], $pos);
if (!defined $tmp) {
print "$tname: can't get record ", $pos+1, "\n";
next;
}
- my $rec = Net::Z3950::ZOOM::record_get($tmp, "render", $len);
+ my $rec = Net::Z3950::ZOOM::record_get($tmp, "render");
if (!defined $rec) {
print "$tname: can't render record ", $pos+1, "\n";
next;
Modified: branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zoomscan.pl
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zoomscan.pl?rev=20931&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zoomscan.pl (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/samples/zoom/zoomscan.pl Thu Jun 12 13:48:14 2008
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
-# $Id: zoomscan.pl,v 1.4 2007/08/17 18:35:17 mike Exp $
+# $Id: zoomscan.pl,v 1.5 2008-05-14 13:27:32 mike Exp $
#
# This is the scanning counterpart to zoomscan.pl's searching
# perl -I../../blib/lib -I../../blib/arch zoomscan.pl <target> <scanQuery>
@@ -28,7 +28,7 @@
eval {
my $conn = new ZOOM::Connection($host, 0);
$conn->option(preferredRecordSyntax => "usmarc");
- ### Could use ZOOM::Query::CQL below, but that only work in SRU/W.
+ ### Could use ZOOM::Query::CQL below, but that only works in SRU/W.
my $q = $opts{q} ? new ZOOM::Query::CQL($scanQuery) :
new ZOOM::Query::PQF($scanQuery);
my $ss = $conn->scan($q);
Modified: branches/upstream/libnet-z3950-zoom-perl/current/t/1-Net-Z3950-ZOOM.t
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/t/1-Net-Z3950-ZOOM.t?rev=20931&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/t/1-Net-Z3950-ZOOM.t (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/t/1-Net-Z3950-ZOOM.t Thu Jun 12 13:48:14 2008
@@ -1,4 +1,4 @@
-# $Id: 1-Net-Z3950-ZOOM.t,v 1.16 2007/09/14 10:36:13 mike Exp $
+# $Id: 1-Net-Z3950-ZOOM.t,v 1.17 2008-05-14 13:32:55 mike Exp $
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl 1-Net-Z3950-ZOOM.t'
@@ -82,11 +82,10 @@
ok($n == 1, "found 1 record as expected");
my $rec = Net::Z3950::ZOOM::resultset_record($rs, 0);
-my $len = 0;
-my $data = Net::Z3950::ZOOM::record_get($rec, "render", $len);
+my $data = Net::Z3950::ZOOM::record_get($rec, "render");
ok($data =~ /^245 +\$a ISOTOPIC DATES OF ROCKS AND MINERALS$/m,
"rendered record has expected title");
-my $raw = Net::Z3950::ZOOM::record_get($rec, "raw", $len);
+my $raw = Net::Z3950::ZOOM::record_get($rec, "raw");
ok($raw =~ /^00966n/, "raw record contains expected header");
Net::Z3950::ZOOM::resultset_destroy($rs);
Modified: branches/upstream/libnet-z3950-zoom-perl/current/t/12-query.t
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/t/12-query.t?rev=20931&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/t/12-query.t (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/t/12-query.t Thu Jun 12 13:48:14 2008
@@ -1,4 +1,4 @@
-# $Id: 12-query.t,v 1.10 2006/11/03 09:50:58 mike Exp $
+# $Id: 12-query.t,v 1.11 2008-05-14 13:32:55 mike Exp $
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl 12-query.t'
@@ -147,8 +147,7 @@
my $rec = Net::Z3950::ZOOM::resultset_record($rs, 0);
ok(1, "got record idenfified by query");
- my $len = 0;
- my $data = Net::Z3950::ZOOM::record_get($rec, "render", $len);
+ my $data = Net::Z3950::ZOOM::record_get($rec, "render");
ok(1, "rendered record");
ok($data =~ /^035 \$a ESDD0006$/m, "record is the expected one");
Modified: branches/upstream/libnet-z3950-zoom-perl/current/t/13-resultset.t
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/t/13-resultset.t?rev=20931&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/t/13-resultset.t (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/t/13-resultset.t Thu Jun 12 13:48:14 2008
@@ -1,4 +1,4 @@
-# $Id: 13-resultset.t,v 1.9 2006/11/28 16:47:19 mike Exp $
+# $Id: 13-resultset.t,v 1.10 2008-05-14 13:32:55 mike Exp $
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl 13-resultset.t'
@@ -33,21 +33,20 @@
Net::Z3950::ZOOM::resultset_option_set($rs, preferredRecordSyntax => "usmarc");
$rec = Net::Z3950::ZOOM::resultset_record($rs, 0);
-my $len = 0;
-my $data1 = Net::Z3950::ZOOM::record_get($rec, "render", $len);
+my $data1 = Net::Z3950::ZOOM::record_get($rec, "render");
Net::Z3950::ZOOM::resultset_option_set($rs, elementSetName => "b");
-my $data2 = Net::Z3950::ZOOM::record_get($rec, "render", $len);
+my $data2 = Net::Z3950::ZOOM::record_get($rec, "render");
ok($data2 eq $data1, "record doesn't know about RS options");
# Now re-fetch record from result-set with new option
$rec = Net::Z3950::ZOOM::resultset_record($rs, 0);
-$data2 = Net::Z3950::ZOOM::record_get($rec, "render", $len);
+$data2 = Net::Z3950::ZOOM::record_get($rec, "render");
ok(length($data2) < length($data1), "re-fetched record is brief, old was full");
Net::Z3950::ZOOM::resultset_option_set($rs, preferredRecordSyntax => "xml");
$rec = Net::Z3950::ZOOM::resultset_record($rs, 0);
my $cloned = Net::Z3950::ZOOM::record_clone($rec);
ok(defined $cloned, "cloned record");
-$data2 = Net::Z3950::ZOOM::record_get($rec, "render", $len);
+$data2 = Net::Z3950::ZOOM::record_get($rec, "render");
ok($data2 =~ /<title>/i, "option for XML syntax is honoured");
# Now we test ZOOM_resultset_record_immediate(), which should only
@@ -57,7 +56,7 @@
#
$rec = Net::Z3950::ZOOM::resultset_record_immediate($rs, 0);
ok(defined $rec, "prefetched record obtained with _immediate()");
-my $data3 = Net::Z3950::ZOOM::record_get($rec, "render", $len);
+my $data3 = Net::Z3950::ZOOM::record_get($rec, "render");
ok($data3 eq $data2, "_immediate record renders as expected");
$rec = Net::Z3950::ZOOM::resultset_record_immediate($rs, 1);
ok(!defined $rec, "non-prefetched record obtained with _immediate()");
@@ -72,7 +71,7 @@
# Fetch all records at once using records()
$tmp = Net::Z3950::ZOOM::resultset_records($rs, 0, 2, 1);
ok(@$tmp == 2, "resultset_records() returned two records");
-$data3 = Net::Z3950::ZOOM::record_get($tmp->[0], "render", $len);
+$data3 = Net::Z3950::ZOOM::record_get($tmp->[0], "render");
ok($data3 eq $data2, "record returned from resultset_records() renders as expected");
$rec = Net::Z3950::ZOOM::resultset_record_immediate($rs, 1);
ok(defined $rec, "_immediate(1) ok after resultset_records()");
@@ -82,7 +81,7 @@
Net::Z3950::ZOOM::connection_destroy($conn);
ok(1, "destroyed connection");
-$data3 = Net::Z3950::ZOOM::record_get($cloned, "render", $len);
+$data3 = Net::Z3950::ZOOM::record_get($cloned, "render");
ok(1, "rendered cloned record after its result-set was destroyed");
ok($data3 eq $data2, "render of clone as expected");
Net::Z3950::ZOOM::record_destroy($cloned);
Modified: branches/upstream/libnet-z3950-zoom-perl/current/t/14-sorting.t
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/t/14-sorting.t?rev=20931&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/t/14-sorting.t (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/t/14-sorting.t Thu Jun 12 13:48:14 2008
@@ -1,4 +1,4 @@
-# $Id: 14-sorting.t,v 1.8 2006/11/02 17:48:26 mike Exp $
+# $Id: 14-sorting.t,v 1.9 2008-05-14 13:32:55 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'
@@ -33,8 +33,7 @@
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'");
@@ -52,8 +51,7 @@
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'");
Modified: branches/upstream/libnet-z3950-zoom-perl/current/t/18-charset.t
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-z3950-zoom-perl/current/t/18-charset.t?rev=20931&op=diff
==============================================================================
--- branches/upstream/libnet-z3950-zoom-perl/current/t/18-charset.t (original)
+++ branches/upstream/libnet-z3950-zoom-perl/current/t/18-charset.t Thu Jun 12 13:48:14 2008
@@ -1,4 +1,4 @@
-# $Id: 18-charset.t,v 1.1 2006/04/06 13:08:14 mike Exp $
+# $Id: 18-charset.t,v 1.2 2008-05-14 13:32:55 mike Exp $
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl 18-charset.t'
@@ -30,14 +30,13 @@
my $rec = Net::Z3950::ZOOM::resultset_record($rs, 0);
ok(defined $rec, "got first record");
-my $len = 0;
-my $xml = Net::Z3950::ZOOM::record_get($rec, "xml", $len);
+my $xml = Net::Z3950::ZOOM::record_get($rec, "xml");
ok(defined $xml, "got XML");
ok($xml =~ m(<subfield code="b">aus der .* f\350ur),
"got MARC pre-accented composed characters");
-$xml = Net::Z3950::ZOOM::record_get($rec, "xml;charset=marc-8,utf-8", $len);
+$xml = Net::Z3950::ZOOM::record_get($rec, "xml;charset=marc-8,utf-8");
ok(defined $xml, "got XML in Unicode");
ok($xml =~ m(<subfield code="b">aus der .* fuÌr),
More information about the Pkg-perl-cvs-commits
mailing list