Update copyright year + FSF address
[idzebra-moved-to-github.git] / test / api / testlib.c
index fe1ecc1..2a7f4e7 100644 (file)
@@ -1,5 +1,5 @@
-/* $Id: testlib.c,v 1.30 2006-03-31 15:58:05 adam Exp $
-   Copyright (C) 1995-2005
+/* $Id: testlib.c,v 1.35 2006-08-14 10:40:22 adam Exp $
+   Copyright (C) 1995-2006
    Index Data ApS
 
 This file is part of the Zebra server.
@@ -15,9 +15,9 @@ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for more details.
 
 You should have received a copy of the GNU General Public License
-along with Zebra; see the file LICENSE.zebra.  If not, write to the
-Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
 */
 
 /** testlib - utilities for the api tests */
@@ -51,10 +51,14 @@ void tl_start_log(int argc, char **argv)
     if (!argv[0])
         return;
     sprintf(logname, "%s.log", argv[0]);
+#if HAVE_UNISTD_H
+    unlink(logname);
+#endif
     yaz_log_init_file(logname);
-    log_level = yaz_log_mask_str_x(argv[0], 0);
     if (argc >= 2)
-       cmd_level |= yaz_log_mask_str_x(argv[1], 0);
+       log_level = yaz_log_mask_str_x(argv[1], 0);
+    if (argc >= 3)
+       yaz_log_time_format(argv[2]);
     yaz_log_init_level(YLOG_DEFAULT_LEVEL | log_level | cmd_level);
     yaz_log(log_level, "starting %s", argv[0]);
 }
@@ -72,8 +76,8 @@ ZebraService tl_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;
+    rlim.rlim_cur = 60;
+    rlim.rlim_max = 60;
     setrlimit(RLIMIT_CPU, &rlim);
 #endif
 #endif
@@ -172,6 +176,8 @@ int tl_query_x(ZebraHandle zh, const char *query, zint exphits, int experror)
     yaz_pqf_destroy(parser);
     if (!rpn)
     {
+        yaz_log(log_level, "could not parse pqf query %s\n", query);
+        printf("could not parse pqf query %s\n", query);
        odr_destroy(odr);
        return 0;
     }
@@ -455,3 +461,11 @@ void tl_check_filter(ZebraService zs, const char *name)
 
 
 
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+