projects
/
idzebra-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
edcd2c2
)
Allow do_query(_x) to accept exphits of -1, which means any number
author
Adam Dickmeiss
<adam@indexdata.dk>
Wed, 20 Apr 2005 10:18:19 +0000
(10:18 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Wed, 20 Apr 2005 10:18:19 +0000
(10:18 +0000)
of hits but OK.
test/api/testlib.c
patch
|
blob
|
history
diff --git
a/test/api/testlib.c
b/test/api/testlib.c
index
94554a2
..
ac8f9cb
100644
(file)
--- 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
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);
parser = yaz_pqf_create();
rpn = yaz_pqf_parse(parser, odr, query);
+ yaz_pqf_destroy(parser);
if (!rpn) {
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);
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);
}
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);
}
}
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;
}
odr_destroy (odr);
return hits;
}