X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Ftst_record_conv.c;h=fbd218a7f8c601d5ab03d4c8f5692dcca302fd9d;hb=d305f63028800611fd05a3bfc54db24e2634d7ad;hp=8d143431ec705ef76f2a5341561ca0d8ca8ad0fe;hpb=c55803155b03efbc55974dd5d6655f8f688e2098;p=yaz-moved-to-github.git diff --git a/test/tst_record_conv.c b/test/tst_record_conv.c index 8d14343..fbd218a 100644 --- a/test/tst_record_conv.c +++ b/test/tst_record_conv.c @@ -2,7 +2,7 @@ * 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.6 2006-05-07 14:48:25 adam Exp $ * */ #include @@ -91,13 +91,14 @@ int conv_configure_test(const char *xmlstring, const char *expect_error, } 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; } @@ -142,7 +143,8 @@ static int conv_convert_test(yaz_record_conv_t p, 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) @@ -218,6 +220,7 @@ static void tst_convert() "", 0, &p)); YAZ_CHECK(conv_convert_test(p, marcxml_rec, iso2709_rec)); + yaz_record_conv_destroy(p); YAZ_CHECK(conv_configure_test("" "", 0, &p)); YAZ_CHECK(conv_convert_test(p, iso2709_rec, marcxml_rec)); + yaz_record_conv_destroy(p); YAZ_CHECK(conv_configure_test("" @@ -249,7 +253,7 @@ static void tst_convert() "", 0, &p)); YAZ_CHECK(conv_convert_test(p, marcxml_rec, marcxml_rec)); - + yaz_record_conv_destroy(p); YAZ_CHECK(conv_configure_test("" @@ -268,6 +272,7 @@ static void tst_convert() "", 0, &p)); YAZ_CHECK(conv_convert_test(p, marcxml_rec, marcxml_rec)); + yaz_record_conv_destroy(p); } #endif @@ -275,7 +280,7 @@ static void tst_convert() int main(int argc, char **argv) { YAZ_CHECK_INIT(argc, argv); -#if HAVE_XML2 +#if HAVE_XSLT tst_configure(); tst_convert(); #endif