From 647212270fdb2030f6a1ab1f9880874f531847b2 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 20 Apr 2005 10:18:19 +0000 Subject: [PATCH] Allow do_query(_x) to accept exphits of -1, which means any number of hits but OK. --- test/api/testlib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/api/testlib.c b/test/api/testlib.c index 94554a2..ac8f9cb 100644 --- a/test/api/testlib.c +++ b/test/api/testlib.c @@ -1,4 +1,4 @@ -/* $Id: testlib.c,v 1.13 2005-04-15 10:47:49 adam Exp $ +/* $Id: testlib.c,v 1.14 2005-04-20 10:18:19 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -155,8 +155,9 @@ int do_query_x(int lineno, ZebraHandle zh, char *query, int exphits, parser = yaz_pqf_create(); rpn = yaz_pqf_parse(parser, odr, query); + yaz_pqf_destroy(parser); if (!rpn) { - printf("Error: Parse failed \n%s\n",query); + printf("Error: Parse failed \n%s\n", query); exit(1); } rc = zebra_search_RPN(zh, odr, rpn, setname, &hits); @@ -183,14 +184,13 @@ int do_query_x(int lineno, ZebraHandle zh, char *query, int exphits, printf("Error: search returned %d\n%s\n", rc, query); exit (1); } - if (hits != exphits) { + if (exphits != -1 && hits != exphits) { printf("Error: search returned " ZINT_FORMAT " hits instead of %d\n%s\n", hits, exphits, query); exit (1); } } - yaz_pqf_destroy(parser); odr_destroy (odr); return hits; } -- 1.7.10.4