-# $Id: Fetch.pm,v 1.26 2007-02-24 01:27:20 mike Exp $
+# $Id: Fetch.pm,v 1.27 2007-03-15 11:38:14 mike Exp $
# See the "Main" test package for documentation
ref $event && $event->isa("ZOOM::Exception") ?
"failed: $event" : "found $n records (event=$event)");
if ($n == 0) {
+ $task->{rs}->destroy();
my $qindex = $udata->{queryindex}+1;
my $q = $queries[$qindex];
return ZOOM::IRSpy::Status::TEST_SKIPPED
'syntax' => $syn,
'ok' => $ok);
+ $rs->destroy() if $udata->{last};
return ($udata->{last} ?
ZOOM::IRSpy::Status::TEST_GOOD :
ZOOM::IRSpy::Status::TASK_DONE);
sub fetch_error {
- my($conn, $task, $test_args, $exception) = @_;
- my $syn = $test_args->{'syntax'};
+ my($conn, $task, $udata, $exception) = @_;
+ my $syn = $udata->{'syntax'};
$conn->log("irspy_test", "Retrieval of $syn record failed: ", $exception);
$conn->record()->store_result('record_fetch',
'syntax' => $syn,
'ok' => 0);
+ $task->{rs}->destroy() if $udata->{last};
return ZOOM::IRSpy::Status::TASK_DONE;
}
-# $Id: Named.pm,v 1.4 2007-03-08 14:51:01 mike Exp $
+# $Id: Named.pm,v 1.5 2007-03-15 11:38:53 mike Exp $
# See the "Main" test package for documentation
$conn->log('irspy_test', 'Testing for named resultset support');
$conn->irspy_search_pqf("\@attr 1=4 mineral", {},
- {'setname' => 'a', 'start' => 0, 'count' => 0},
+ {'setname' => 'a', 'start' => 0, 'count' => 0},
ZOOM::Event::ZEND, \&completed_search_a,
exception => \&error);
}
my $record = '';
my $hits = $rs->size();
- ## How should we handle the situation when there is 0 hits?
- if ($hits > 0) {
+ if ($hits == 0) {
+ ### We should try other searches as in Record::Fetch
+ $rs->destroy();
+ return ZOOM::IRSpy::Status::TEST_BAD;
+ } else {
my $rsrec = $rs->record(0);
if (!defined $rsrec) {
# I thought this was a "can't happen", but it sometimes
# does, as for example documented for
# kat.vkol.cz:9909/svk02 at ../../../../../tmp/bad-run-1
+ $rs->destroy();
eval { $conn->check() };
return error($conn, $task, $test_args, $@);
}
my $record = '';
my $error = '';
+ $task->{rs}->destroy(); # We only care about the original search
$rs->cache_reset();
- if ($test_args->{'hits_a'} > 0) {
+ if ($test_args->{'hits_a'} == 0) {
+ die "can't happen: hits_a == 0";
+ } else {
my $hits = $rs->size();
my $rsrec = $rs->record(0);
if (!defined $rsrec) {
+ $rs->destroy();
eval { $conn->check() };
return error($conn, $task, $test_args, $@);
}
update($conn, $error eq '' ? 1 : 0, $error);
+ $rs->destroy();
return ZOOM::IRSpy::Status::TASK_DONE;
}
-# $Id: Boolean.pm,v 1.4 2007-02-23 15:03:44 mike Exp $
+# $Id: Boolean.pm,v 1.5 2007-03-15 11:40:39 mike Exp $
# See the "Main" test package for documentation
sub found {
my($conn, $task, $test_args, $event) = @_;
my $operator = $test_args->{'operator'};
- my $n = $task->{rs}->size();
+ my $n = $task->{rs}->size();
+ $task->{rs}->destroy();
$conn->log("irspy_test", "search using boolean operator ", $operator,
" found $n record", $n==1 ? "" : "s");
update($conn, $operator, 1);
my($conn, $task, $test_args, $exception) = @_;
my $operator = $test_args->{'operator'};
+ $task->{rs}->destroy();
$conn->log("irspy_test", "search using boolean operator ", $operator,
" had error: ", $exception);
update($conn, $operator, 0);
-# $Id: Dan1.pm,v 1.6 2007-02-23 15:03:44 mike Exp $
+# $Id: Dan1.pm,v 1.7 2007-03-15 11:40:52 mike Exp $
# See the "Main" test package for documentation
sub found {
my($conn, $task, $test_args, $event) = @_;
my $attr = $test_args->{'attr'};
- my $n = $task->{rs}->size();
+ my $n = $task->{rs}->size();
+ $task->{rs}->destroy();
$conn->log("irspy_test", "search on access-point $attr found $n record",
$n==1 ? "" : "s");
update($conn, $attr, 1);
my($conn, $task, $test_args, $exception) = @_;
my $attr = $test_args->{'attr'};
+ $task->{rs}->destroy();
$conn->log("irspy_test", "search on access-point $attr had error: ",
$exception);
update($conn, $attr, 0);
-# $Id: Explain.pm,v 1.6 2007-03-05 12:15:11 mike Exp $
+# $Id: Explain.pm,v 1.7 2007-03-15 11:41:24 mike Exp $
# See the "Main" test package for documentation
sub found {
my($conn, $task, $test_args, $event) = @_;
my $category = $test_args->{'category'};
- my $n = $task->{rs}->size();
- my $ok = 0;
+ my $n = $task->{rs}->size();
+ $task->{rs}->destroy();
+ my $ok = ($n > 0);
$conn->log("irspy_test", "Explain category ", $category, " gave ", $n,
" hit(s).");
- if ($n > 0) {
- $ok = 1;
- }
update($conn, $category, $ok);
my($conn, $task, $test_args, $exception) = @_;
my $category = $test_args->{'category'};
+ $task->{rs}->destroy();
$conn->log("irspy_test", "Explain category lookup failed: ", $exception);
update($conn, $category, 0);