* 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 $
*/
/*
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
#include <yaz/yaz-util.h>
#include <yaz/backend.h>
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];
}
}
}
- 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;
}
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];
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"))
{