X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fapi%2Ftestlib.c;h=aee77dc6b9e7c7e7ad6d30187be2adfa22dc8765;hb=5d3d666d4712604159141d991dadd3e6299565bd;hp=7b7efcaea979265166f733a2edb76d33c5e527bc;hpb=1f1106ca4cb980d93dec90480e25df75ddd59c4d;p=idzebra-moved-to-github.git diff --git a/test/api/testlib.c b/test/api/testlib.c index 7b7efca..aee77dc 100644 --- a/test/api/testlib.c +++ b/test/api/testlib.c @@ -1,4 +1,4 @@ -/* $Id: testlib.c,v 1.18 2005-05-04 10:50:09 adam Exp $ +/* $Id: testlib.c,v 1.21 2005-05-31 07:22:20 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -34,6 +34,7 @@ int log_level=0; /* not static, t*.c may use it */ void start_log(int argc, char **argv) { + int cmd_level = 0; char logname[2048]; if (!argv) return; @@ -41,9 +42,11 @@ void start_log(int argc, char **argv) return; sprintf(logname, "%s.log", argv[0]); yaz_log_init_file(logname); - log_level = yaz_log_mask_str_x(argv[0],0); - yaz_log_init_level(YLOG_DEFAULT_LEVEL | log_level); - yaz_log(log_level,"starting %s",argv[0]); + log_level = yaz_log_mask_str_x(argv[0], 0); + if (argc >= 2) + cmd_level |= yaz_log_mask_str_x(argv[1], 0); + yaz_log_init_level(YLOG_DEFAULT_LEVEL | log_level | cmd_level); + yaz_log(log_level, "starting %s", argv[0]); } /** @@ -163,13 +166,14 @@ int do_query_x(int lineno, ZebraHandle zh, const char *query, zint exphits, rc = zebra_search_RPN(zh, odr, rpn, setname, &hits); if (experror) { + int code; if (rc != ZEBRA_FAIL) { printf("Error: search returned %d (OK), but error was expected\n" "%s\n", rc, query); exit(1); } - int code = zebra_errCode(zh); + code = zebra_errCode(zh); if (code != experror) { printf("Error: search returned error code %d, but error %d was "