X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy%2FTest%2FSearch%2FBoolean.pm;h=29bc211f35cfe01fbeb7b59e57e3d486fb6cc942;hb=e61887a109576fa0e066547c0ce033631a290f8f;hp=5a60d2367acd36fbb553c8e584586a1c09150412;hpb=db634ebd19149e35eecfb04f48ca3e9559d3b1b0;p=irspy-moved-to-github.git diff --git a/lib/ZOOM/IRSpy/Test/Search/Boolean.pm b/lib/ZOOM/IRSpy/Test/Search/Boolean.pm index 5a60d23..29bc211 100644 --- a/lib/ZOOM/IRSpy/Test/Search/Boolean.pm +++ b/lib/ZOOM/IRSpy/Test/Search/Boolean.pm @@ -1,4 +1,3 @@ -# $Id: Boolean.pm,v 1.2 2006-10-25 11:25:36 sondberg Exp $ # See the "Main" test package for documentation @@ -25,7 +24,7 @@ sub start { foreach my $operator (keys %pqfs) { $conn->irspy_search_pqf($pqfs{$operator}, {'operator' => $operator}, {}, - ZOOM::Event::RECV_SEARCH, \&found, + ZOOM::Event::ZEND, \&found, exception => \&error); } } @@ -34,12 +33,12 @@ sub start { 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; } @@ -49,12 +48,20 @@ sub error { 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;