X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Ftst_retrieval.c;h=f49c2c2b7c2cb20573d56826ec5e8209d7b79320;hb=2edee0444eb7d2aba3528a6ae6523c2d1dd92a18;hp=aecb773808a8e8931678a97e1c3ae73e538d88ec;hpb=0de95154d8512ee46d6b706fe019f8d1ffc18827;p=yaz-moved-to-github.git diff --git a/test/tst_retrieval.c b/test/tst_retrieval.c index aecb773..f49c2c2 100644 --- a/test/tst_retrieval.c +++ b/test/tst_retrieval.c @@ -1,20 +1,22 @@ /* - * Copyright (C) 2005-2006, Index Data ApS + * Copyright (C) 2005-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: tst_retrieval.c,v 1.2 2006-05-05 18:37:08 adam Exp $ + * $Id: tst_retrieval.c,v 1.9 2007-01-03 08:42:16 adam Exp $ * */ #include #include #include #include +#include +#include #if HAVE_CONFIG_H #include #endif -#if HAVE_XSLT +#if YAZ_HAVE_XSLT #include #include @@ -102,49 +104,171 @@ int conv_configure_test(const char *xmlstring, const char *expect_error, return ret; } -static void tst_configure() +static void tst_configure(void) { YAZ_CHECK(conv_configure_test("", - "Missing 'retrievalinfo' element", 0)); + "Expected element ", 0)); YAZ_CHECK(conv_configure_test("", 0, 0)); YAZ_CHECK(conv_configure_test("", - "Bad element 'bad'." - " Expected 'retrieval'", 0)); + "Element :" + " expected element , got ", + 0)); + + YAZ_CHECK(conv_configure_test("" + "", + "Missing 'syntax' attribute", 0)); + + + YAZ_CHECK(conv_configure_test("" + "" + "" + "", + "Element : expected attributes " + "'syntax', identifier' or 'name', got " + "'unknown'", 0)); + + YAZ_CHECK(conv_configure_test("" + "" + "" + "", + "Element : unknown attribute " + "value syntax='unknown_synt'", 0)); YAZ_CHECK(conv_configure_test("" - "" - "" + "" + "", + 0, 0)); + + YAZ_CHECK(conv_configure_test("" + "" + "", + 0, 0)); + + + YAZ_CHECK(conv_configure_test("" + "" + "", + 0, 0)); + + + + YAZ_CHECK(conv_configure_test("" + "" + "" + "" + "", + "Element : expected zero or one element " + ", got ", 0)); + + YAZ_CHECK(conv_configure_test("" + "" + " " + "" + "", + "Element : expected attributes 'syntax' or 'name," + " got 'schema'", 0)); + + YAZ_CHECK(conv_configure_test("" + "" + " " + "" + "", + 0, 0)); + + YAZ_CHECK(conv_configure_test("" + "" + " " + "" + "", + "Element : " + "attribute 'syntax' has invalid value " + "'unknown'", 0)); + + + YAZ_CHECK(conv_configure_test("" + "" + " " + "" + "", + "Element : expected attributes " + "'syntax' or 'name, got 'unknown'", 0)); + + + YAZ_CHECK(conv_configure_test("" + "" + "" "" "" - "" + "" "" "", - 0, 0)); + "Element : Unsupported character" + " set mapping defined by attribute values", 0)); YAZ_CHECK(conv_configure_test("" - "" - "" + "" + "" "" "" - "" + "" "" - "" - "" + "", + "Element : Unsupported" + " input format defined by attribute value", 0)); + + YAZ_CHECK(conv_configure_test("" + "" + "" "" "" - "" + "" "" "", 0, 0)); + + YAZ_CHECK(conv_configure_test( + "" + "" + "" + "" + "" + " " + " " + " " + "" + "" + " " + " " + " " + "" + "" + " " + " " + " " + " " + "" + "", + 0, 0)); + } #endif @@ -163,7 +318,10 @@ static void tst_configure() int main(int argc, char **argv) { YAZ_CHECK_INIT(argc, argv); -#if HAVE_XSLT + + libxml2_error_to_yazlog(0 /* disable it */, ""); + +#if YAZ_HAVE_XSLT tst_configure(); #endif YAZ_CHECK_TERM;