X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=ztest%2Fztest.c;h=bd4459e8dd06cf01f8348bb4a94e6fd62fc77bb7;hb=51f5ff156a2550d96b6d27fd901edaab161b32c8;hp=2574a8c763ff4a9e3409c8dbab9dad94ebececb9;hpb=4b3d1e197d75fcb2607be8d86d244f20c4180000;p=yaz-moved-to-github.git diff --git a/ztest/ztest.c b/ztest/ztest.c index 2574a8c..bd4459e 100644 --- a/ztest/ztest.c +++ b/ztest/ztest.c @@ -1,8 +1,8 @@ /* - * Copyright (c) 1995-2003, Index Data. + * Copyright (c) 1995-2004, Index Data. * See the file LICENSE for details. * - * $Id: ztest.c,v 1.58 2003-09-02 12:12:13 adam Exp $ + * $Id: ztest.c,v 1.62 2004-01-27 21:22:44 adam Exp $ */ /* @@ -34,6 +34,15 @@ int ztest_search (void *handle, bend_search_rr *rr) rr->errcode = 23; return 0; } +#if NMEM_DEBUG + /* if database is stop, stop this process.. For debugging only. */ + if (!yaz_matchstr (rr->basenames[0], "stop")) + { + nmem_print_list_l(LOG_LOG); + exit(0); + } +#endif + /* Throw Database unavailable if other than Default */ if (yaz_matchstr (rr->basenames[0], "Default")) { rr->errcode = 109; @@ -428,7 +437,7 @@ int ztest_present (void *handle, bend_present_rr *rr) int ztest_fetch(void *handle, bend_fetch_rr *r) { char *cp; - r->errstring = 0; + r->last_in_set = 0; r->basename = "Default"; r->output_format = r->request_format; @@ -602,12 +611,15 @@ int ztest_scan(void *handle, bend_scan_rr *q) static int ztest_explain(void *handle, bend_explain_rr *rr) { - rr->explain_buf = "\n" - "\t\n" - "\t\tlocalhost\n" - "\t\t210\n" - "\t\n" - "\n"; + if (rr->database && !strcmp(rr->database, "Default")) + { + rr->explain_buf = "\n" + "\t\n" + "\t\tlocalhost\n" + "\t\t210\n" + "\t\n" + "\n"; + } return 0; }