-# $Id: Boolean.pm,v 1.2 2006-10-25 11:25:36 sondberg Exp $
+# $Id: Boolean.pm,v 1.5 2007-03-15 11:40:39 mike Exp $
# See the "Main" test package for documentation
foreach my $operator (keys %pqfs) {
$conn->irspy_search_pqf($pqfs{$operator},
{'operator' => $operator}, {},
- ZOOM::Event::RECV_SEARCH, \&found,
+ ZOOM::Event::ZEND, \&found,
exception => \&error);
}
}
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");
- $conn->record()->store_result('boolean', 'operator' => $operator,
- 'ok' => 1);
+ update($conn, $operator, 1);
return ZOOM::IRSpy::Status::TASK_DONE;
}
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);
- $conn->record()->store_result('boolean', 'operator' => $operator,
- 'ok' => 0);
+ update($conn, $operator, 0);
return ZOOM::IRSpy::Status::TASK_DONE;
}
+sub update {
+ my ($conn, $operator, $ok) = @_;
+
+ $conn->record()->store_result('boolean', 'operator' => $operator,
+ 'ok' => $ok);
+}
+
+
1;