Added extra parameter setname for zebra scan functions. This allows
[idzebra-moved-to-github.git] / test / api / testlib.c
index d80ab13..8301cb6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: testlib.c,v 1.22 2005-06-14 20:02:30 adam Exp $
+/* $Id: testlib.c,v 1.24 2005-08-09 09:35:26 adam Exp $
    Copyright (C) 1995-2005
    Index Data ApS
 
@@ -22,8 +22,12 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 /** testlib - utilities for the api tests */
 
+#if HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif
+#if HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
+#endif
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
@@ -65,10 +69,14 @@ void start_log(int argc, char **argv)
  */
 ZebraService start_up(char *cfgname, int argc, char **argv)
 {
+#if HAVE_SYS_RESOURCE_H
+#if HAVE_SYS_TIME_H
     struct rlimit rlim;
     rlim.rlim_cur = 20;
     rlim.rlim_max = 20;
     setrlimit(RLIMIT_CPU, &rlim);
+#endif
+#endif
     nmem_init();
     start_log(argc, argv);
     return start_service(cfgname);
@@ -230,7 +238,8 @@ void do_scan(int lineno, ZebraHandle zh, const char *query,
     yaz_log(log_level, "======================================");
     yaz_log(log_level, "scan[%d]: pos=%d num=%d %s", lineno, pos, num, query);
 
-    res = zebra_scan_PQF(zh, odr, query, &pos, &num, &entries, &partial);
+    res = zebra_scan_PQF(zh, odr, query, &pos, &num, &entries, &partial, 
+                        0 /* setname */);
     if (res != ZEBRA_OK)
     {
        printf("Error: scan returned %d (FAIL), but no error was expected\n"