For Libxml2 and friends, YAZ defines YAZ_HAVE_{XML2,XSLT,EXSLT) in
[yaz-moved-to-github.git] / test / tst_retrieval.c
index db10872..66c9477 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 2005-2006, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: tst_retrieval.c,v 1.4 2006-05-07 17:45:41 adam Exp $
+ * $Id: tst_retrieval.c,v 1.6 2006-07-06 10:17:55 adam Exp $
  *
  */
 #include <yaz/retrieval.h>
@@ -16,7 +16,7 @@
 #include <config.h>
 #endif
 
-#if HAVE_XSLT
+#if YAZ_HAVE_XSLT
 
 #include <libxml/parser.h>
 #include <libxml/tree.h>
@@ -168,7 +168,7 @@ static void tst_configure()
     YAZ_CHECK(conv_configure_test("<retrievalinfo>"
                                   "<retrieval" 
                                   " syntax=\"usmarc\""
-                                  " schema=\"marcxml\"" 
+                                  " name=\"marcxml\"" 
                                   " identifier=\"info:srw/schema/1/marcxml-v1.1\""
                                   ">"
                                   "<convert/>"
@@ -178,6 +178,35 @@ static void tst_configure()
 
     YAZ_CHECK(conv_configure_test("<retrievalinfo>"
                                   "<retrieval" 
+                                  " syntax=\"usmarc\""
+                                  " name=\"marcxml\""
+                                  " backendsyntax=\"usmarc\""
+                                  " backendname=\"marcxml\""
+                                  " identifier=\"info:srw/schema/1/marcxml-v1.1\""
+                                  ">"
+                                  "<convert/>"
+                                  "</retrieval>"
+                                  "</retrievalinfo>",
+                                  0, 0));
+
+    YAZ_CHECK(conv_configure_test("<retrievalinfo>"
+                                  "<retrieval" 
+                                  " syntax=\"usmarc\""
+                                  " name=\"marcxml\""
+                                  " backendsyntax=\"usmarc\""
+                                  " backendschema=\"marcxml\""
+                                  " identifier=\"info:srw/schema/1/marcxml-v1.1\""
+                                  ">"
+                                  "<convert/>"
+                                  "</retrieval>"
+                                  "</retrievalinfo>",
+                                  "Bad attribute 'backendschema'."
+                                  " Use 'backendname' instead", 
+                                  0));
+
+
+    YAZ_CHECK(conv_configure_test("<retrievalinfo>"
+                                  "<retrieval" 
                                   " syntax=\"unknown_synt\""
                                   ">"
                                   "<convert/>"
@@ -204,7 +233,7 @@ int main(int argc, char **argv)
 
     libxml2_error_to_yazlog(0 /* disable it */, "");
 
-#if HAVE_XSLT
+#if YAZ_HAVE_XSLT
     tst_configure();
 #endif
     YAZ_CHECK_TERM;