X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Ftst_retrieval.c;h=f49c2c2b7c2cb20573d56826ec5e8209d7b79320;hb=2edee0444eb7d2aba3528a6ae6523c2d1dd92a18;hp=66c94775a93963a394e84fe74bfcff44a4e6183b;hpb=fc6d778b923000b5c6ad8e108b0b184178a9d33f;p=yaz-moved-to-github.git diff --git a/test/tst_retrieval.c b/test/tst_retrieval.c index 66c9477..f49c2c2 100644 --- a/test/tst_retrieval.c +++ b/test/tst_retrieval.c @@ -1,8 +1,8 @@ /* - * 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.6 2006-07-06 10:17:55 adam Exp $ + * $Id: tst_retrieval.c,v 1.9 2007-01-03 08:42:16 adam Exp $ * */ #include @@ -104,63 +104,56 @@ 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("" - "\n" - " " - "" - "" - "" - "" + "" "" "", - 0, 0)); + "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)); @@ -170,58 +163,153 @@ static void tst_configure() " syntax=\"usmarc\"" " name=\"marcxml\"" " identifier=\"info:srw/schema/1/marcxml-v1.1\"" - ">" - "" - "" + "/>" "", 0, 0)); + + YAZ_CHECK(conv_configure_test("" "" + " name=\"marcxml\">" "" + "" + "", + "Element : expected zero or one element " + ", got ", 0)); + + YAZ_CHECK(conv_configure_test("" + "" + " " "" "", - 0, 0)); + "Element : expected attributes 'syntax' or 'name," + " got 'schema'", 0)); YAZ_CHECK(conv_configure_test("" "" + " " + "" + "", + 0, 0)); + + YAZ_CHECK(conv_configure_test("" + "" - "" + " name=\"marcxml\">" + " " "" "", - "Bad attribute 'backendschema'." - " Use 'backendname' instead", - 0)); + "Element : " + "attribute 'syntax' has invalid value " + "'unknown'", 0)); YAZ_CHECK(conv_configure_test("" "" - "" + " syntax=\"usmarc\"" + " identifier=\"info:srw/schema/1/marcxml-v1.1\"" + " name=\"marcxml\">" + " " "" "", - "Bad syntax 'unknown_synt'", 0)); + "Element : expected attributes " + "'syntax' or 'name, got 'unknown'", 0)); + YAZ_CHECK(conv_configure_test("" - "" - "" + "" + "" + "" + "" + "" "" "", - "Bad backendsyntax 'unknown_synt'", 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)); }