X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=ztest%2Fztest.c;h=cc7736d5862bab96fc0e65048387fa81410cd73b;hp=32b8857eea3d6ca2eb5ca7a97880d5bb5231a817;hb=d7e028ba0de38f6060f53cf75ca7246c402eb34f;hpb=2edd9764942ec2d62cabcb4190a69921c60af293 diff --git a/ztest/ztest.c b/ztest/ztest.c index 32b8857..cc7736d 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" @@ -278,7 +279,7 @@ Z_OtherInformation *build_facet_response(ODR odr, Z_FacetList *facet_list) { yaz_facet_attr_get_z_attributes(facet_list->elements[index]->attributes, &attrvalues); yaz_log(YLOG_LOG, "Attributes: %s limit=%d start=%d sort=%d", - attrvalues.useattr, + attrvalues.useattr ? attrvalues.useattr : "NONE", attrvalues.limit, attrvalues.start, attrvalues.sortorder); @@ -935,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 { @@ -1142,6 +1159,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); } /*