From: mike Date: Mon, 10 Oct 2005 17:21:12 +0000 (+0000) Subject: Very simple initial test programme, modelled after zoomtst1.c X-Git-Tag: cpan_1_22~489 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=3cef09c2c83b9829b6194056ed05eb572713e8b5;p=ZOOM-Perl-moved-to-github.git Very simple initial test programme, modelled after zoomtst1.c --- diff --git a/t/ZOOM.t b/t/ZOOM.t index dc30764..a253209 100644 --- a/t/ZOOM.t +++ b/t/ZOOM.t @@ -13,3 +13,24 @@ BEGIN { use_ok('ZOOM') }; # Insert your test code below, the Test::More module is use()ed here so read # its man page ( perldoc Test::More ) for help writing this test script. +my $host = "localhost"; +my $port = 3950; +my $errcode; +my($errmsg, $addinfo) = ("dummy", "dummy"); + +my $conn = ZOOM::ZOOM_connection_new($host, $port); +if (($errcode = ZOOM::ZOOM_connection_error($conn, $errmsg, $addinfo)) != 0) { + die("Can't connect to host '$host', port '$port': ", + "errcode='$errcode', errmsg='$errmsg', addinfo='$addinfo'"); +} + +my $query = '@attr 1=4 taylor'; +my $rs = ZOOM::ZOOM_connection_search_pqf($conn, $query); +if (($errcode = ZOOM::ZOOM_connection_error($conn, $errmsg, $addinfo)) != 0) { + die("Can't search for '$query': ", + "errcode='$errcode', errmsg='$errmsg', addinfo='$addinfo'"); +} + +print STDERR "Result count: ", ZOOM::ZOOM_resultset_size($rs), "\n"; +ZOOM::ZOOM_resultset_destroy($rs); +ZOOM::ZOOM_connection_destroy($conn);