From 3cef09c2c83b9829b6194056ed05eb572713e8b5 Mon Sep 17 00:00:00 2001 From: mike Date: Mon, 10 Oct 2005 17:21:12 +0000 Subject: [PATCH] Very simple initial test programme, modelled after zoomtst1.c --- t/ZOOM.t | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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); -- 1.7.10.4