From e38cab5629e6643d9e1621a697e8ccc8d7822727 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 24 Feb 2012 14:46:02 +0100 Subject: [PATCH] retrieval: only one section allowed --- src/retrieval.c | 8 ++++++++ test/test_retrieval.c | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/retrieval.c b/src/retrieval.c index f82f8c7..65c1098 100644 --- a/src/retrieval.c +++ b/src/retrieval.c @@ -180,6 +180,14 @@ static int conf_retrieval(yaz_retrieval_t p, const xmlNode *ptr) else { + if (el->record_conv) + { + wrbuf_printf(p->wr_error, "Element : " + "only one allowed"); + yaz_record_conv_destroy(el->record_conv); + return -1; + } + /* parsing attributees */ struct _xmlAttr *attr; for (attr = ptr->properties; attr; attr = attr->next){ diff --git a/test/test_retrieval.c b/test/test_retrieval.c index 2b971df..a374159 100644 --- a/test/test_retrieval.c +++ b/test/test_retrieval.c @@ -262,6 +262,25 @@ static void tst_configure(void) "Element : Unsupported" " input format defined by attribute value", 0)); + + YAZ_CHECK(conv_configure_test("" + "" + "" + "" + "" + "" + "" + "" + "", + "Element : " + "only one allowed", 0)); + + YAZ_CHECK(conv_configure_test("" "" "" -- 1.7.10.4