* Copyright (C) 2005-2006, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: tst_record_conv.c,v 1.3 2006-05-04 18:22:59 adam Exp $
+ * $Id: tst_record_conv.c,v 1.7 2006-05-07 17:45:41 adam Exp $
*
*/
#include <yaz/record_conv.h>
#include <yaz/test.h>
#include <yaz/wrbuf.h>
#include <string.h>
+#include <yaz/log.h>
+#include <yaz/libxml2_error.h>
#if HAVE_CONFIG_H
#include <config.h>
}
else
{
- if (pt)
- *pt = p;
- else
- yaz_record_conv_destroy(p);
ret = 1;
}
}
+ if (pt)
+ *pt = p;
+ else
+ yaz_record_conv_destroy(p);
+
wrbuf_free(w, 1);
return ret;
}
"</convert>",
"Attribute 'inputformat' required", 0));
YAZ_CHECK(conv_configure_test("<convert>"
+ "<xslt/>"
+ "</convert>",
+ "Missing attribute 'stylesheet'", 0));
+ YAZ_CHECK(conv_configure_test("<convert>"
"<xslt stylesheet=\"tst_record_conv.xsl\"/>"
"<marc"
" inputcharset=\"utf-8\""
else
{
WRBUF output_record = wrbuf_alloc();
- int r = yaz_record_conv_record(p, input_record, output_record);
+ int r = yaz_record_conv_record(p, input_record, strlen(input_record),
+ output_record);
if (r)
{
if (output_expect_record)
"</convert>",
0, &p));
YAZ_CHECK(conv_convert_test(p, marcxml_rec, iso2709_rec));
+ yaz_record_conv_destroy(p);
YAZ_CHECK(conv_configure_test("<convert>"
"<marc"
"</convert>",
0, &p));
YAZ_CHECK(conv_convert_test(p, iso2709_rec, marcxml_rec));
+ yaz_record_conv_destroy(p);
YAZ_CHECK(conv_configure_test("<convert>"
"</convert>",
0, &p));
YAZ_CHECK(conv_convert_test(p, marcxml_rec, marcxml_rec));
-
+ yaz_record_conv_destroy(p);
YAZ_CHECK(conv_configure_test("<convert>"
"</convert>",
0, &p));
YAZ_CHECK(conv_convert_test(p, marcxml_rec, marcxml_rec));
+ yaz_record_conv_destroy(p);
}
#endif
int main(int argc, char **argv)
{
YAZ_CHECK_INIT(argc, argv);
-#if HAVE_XML2
+ libxml2_error_to_yazlog(0 /* disable log */, 0);
+#if HAVE_XSLT
tst_configure();
tst_convert();
#endif