X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=test%2Fapi%2Ftestlib.c;h=ac8f9cb0e9ee692d7e6db6137d48976f4b8338fe;hb=77f01f9b79fd08a6841cf6fdf0a8802cbcdefe5b;hp=94554a2788d7e3691419a9e8afbc902db2e5c9db;hpb=49d0ee122a9f86ec2967b577dcc297c501785edd;p=idzebra-moved-to-github.git 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; }