X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=ztest%2Fztest.c;h=c5f7432ddbd2ffb177dd21805a4a8173d32de6f6;hp=a6b71d270069ea5ace3f99586ac7310d66c13f4f;hb=1e8eb130ff83dedfb7382ca3e38651add9894662;hpb=fb6d99a0c7e07d9cc4a315c447deaf6564a85505 diff --git a/ztest/ztest.c b/ztest/ztest.c index a6b71d2..c5f7432 100644 --- a/ztest/ztest.c +++ b/ztest/ztest.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: ztest.c,v 1.75 2005-06-25 15:46:09 adam Exp $ + * $Id: ztest.c,v 1.78 2006-03-13 12:14:00 adam Exp $ */ /* @@ -12,6 +12,9 @@ #include #include #include +#if HAVE_UNISTD_H +#include +#endif #include #include @@ -45,8 +48,17 @@ int ztest_search(void *handle, bend_search_rr *rr) exit(0); } #endif - /* Throw Database unavailable if other than Default */ - if (yaz_matchstr (rr->basenames[0], "Default")) + /* Throw Database unavailable if other than Default or Slow */ + if (!yaz_matchstr (rr->basenames[0], "Default")) + ; /* Default is OK in our test */ + else if(!yaz_matchstr (rr->basenames[0], "Slow")) + { +#if HAVE_UNISTD_H + sleep(3); +#endif + ; + } + else { rr->errcode = 109; rr->errstring = rr->basenames[0]; @@ -398,16 +410,6 @@ int ztest_esrequest (void *handle, bend_esrequest_rr *rr) } } } - else if (rr->esr->taskSpecificParameters->which == Z_External_update0) - { - yaz_log(log_level, "Received DB Update (version 0)"); - } - else - { - yaz_log (YLOG_WARN, "Unknown Extended Service(%d)", - rr->esr->taskSpecificParameters->which); - - } return 0; } @@ -536,7 +538,17 @@ int ztest_scan(void *handle, bend_scan_rr *q) int term_position_req = q->term_position; int num_entries_req = q->num_entries; - if (yaz_matchstr (q->basenames[0], "Default")) + /* Throw Database unavailable if other than Default or Slow */ + if (!yaz_matchstr (q->basenames[0], "Default")) + ; /* Default is OK in our test */ + else if(!yaz_matchstr (q->basenames[0], "Slow")) + { +#if HAVE_UNISTD_H + sleep(3); +#endif + ; + } + else { q->errcode = 109; q->errstring = q->basenames[0]; @@ -637,7 +649,7 @@ int ztest_scan(void *handle, bend_scan_rr *q) return 0; } -static int ztest_explain(void *handle, bend_explain_rr *rr) +int ztest_explain(void *handle, bend_explain_rr *rr) { if (rr->database && !strcmp(rr->database, "Default")) {