X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=ztest%2Fztest.c;h=2d7e13bb2feba0a9a8ec43edd1a3f69b7e43b596;hb=2487937ef218d16b41294bf7d1845d164e17bfe2;hp=aa911865b2e239662b3f46097e00817734e68ccf;hpb=612ac7d30003582e44d4184c830eee7f1a1a0443;p=yaz-moved-to-github.git diff --git a/ztest/ztest.c b/ztest/ztest.c index aa91186..2d7e13b 100644 --- a/ztest/ztest.c +++ b/ztest/ztest.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2013 Index Data + * Copyright (C) Index Data * See the file LICENSE for details. */ /** \file @@ -33,6 +33,7 @@ #include #include #include +#include #include "ztest.h" @@ -277,7 +278,11 @@ Z_OtherInformation *build_facet_response(ODR odr, Z_FacetList *facet_list) { attrvalues.limit = 10; yaz_facet_attr_get_z_attributes(facet_list->elements[index]->attributes, &attrvalues); - yaz_log(YLOG_LOG, "Attributes: %s %d ", attrvalues.useattr, attrvalues.limit); + yaz_log(YLOG_LOG, "Attributes: %s limit=%d start=%d sort=%d", + attrvalues.useattr ? attrvalues.useattr : "NONE", + attrvalues.limit, + attrvalues.start, + attrvalues.sortorder); if (attrvalues.errstring) yaz_log(YLOG_LOG, "Error parsing attributes: %s", attrvalues.errstring); if (attrvalues.limit > 0 && attrvalues.useattr) { @@ -931,6 +936,22 @@ int ztest_fetch(void *handle, bend_fetch_rr *r) { r->len = strlen(cp); r->record = cp; + r->schema = "info:srw/schema/1/marcxml-1.1"; + } + else + { + r->errcode = YAZ_BIB1_SYSTEM_ERROR_IN_PRESENTING_RECORDS; + r->surrogate_flag = 1; + return 0; + } + } + else if (!oid_oidcmp(oid, yaz_oid_recsyn_json)) + { + if ((cp = dummy_json_record(r->number, r->stream, esn))) + { + r->len = strlen(cp); + r->record = cp; + r->schema = "info:srw/schema/1/marcxml-1.1"; } else { @@ -1124,6 +1145,7 @@ bend_initresult *bend_init(bend_initrequest *q) q->query_charset = "ISO-8859-1"; q->records_in_same_charset = 0; + q->named_result_sets = 1; return r; } @@ -1138,6 +1160,8 @@ void bend_close(void *handle) int main(int argc, char **argv) { + yaz_enable_panic_backtrace(argv[0]); + return statserv_main(argc, argv, bend_init, bend_close); } /*