-/* read zebra.cfg from env var srcdir if it exists; otherwise current dir */
-static ZebraService start_service()
-{
- char cfg[256];
- char *srcdir = getenv("srcdir");
- sprintf(cfg, "%.200s%szebra.cfg", srcdir ? srcdir : "", srcdir ? "/" : "");
- return zebra_start(cfg, 0, 0);
-}
-
-static void expect(ZebraHandle zh, const char *pqf, int hits_expect,
- int *exit_code)
-{
- int hits;
- if (zebra_search_PQF (zh, pqf, "set1", &hits) != 0)
- {
- yaz_log(LOG_FATAL, "Search %s: failed", pqf);
- *exit_code = 1;
- }
- else if (hits != hits_expect)
- {
- yaz_log(LOG_FATAL, "Search %s: Expected %d, got %d", pqf,
- hits_expect, hits);
- *exit_code = 2;
- }
-}
-
-int main(int argc, char **argv)
-{
- int i, hits = -1;
- int exit_code = 0;
- ZebraService zs;
- ZebraHandle zh;
- const char *myrec[] = {