X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Ftstsoap2.c;h=8884920396789fdf0b59c31bedbe17429f475c4b;hb=62cdf9134790da1c26687d687b90528e477c07d5;hp=1b952b78059bf1136c4624df9825129b2ba29f95;hpb=fb6d99a0c7e07d9cc4a315c447deaf6564a85505;p=yaz-moved-to-github.git diff --git a/test/tstsoap2.c b/test/tstsoap2.c index 1b952b7..8884920 100644 --- a/test/tstsoap2.c +++ b/test/tstsoap2.c @@ -2,16 +2,17 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: tstsoap2.c,v 1.2 2005-06-25 15:46:07 adam Exp $ + * $Id: tstsoap2.c,v 1.4 2006-02-01 19:53:00 adam Exp $ */ #include -#if HAVE_XML2 -#include - +#include #include #include +#if HAVE_XML2 +#include + static void tst_srw(void) { const char *charset = 0; @@ -26,6 +27,9 @@ static void tst_srw(void) Z_SRW_PDU *sr = yaz_srw_get(o, Z_SRW_searchRetrieve_request); Z_SOAP *p = odr_malloc(o, sizeof(*p)); + YAZ_CHECK(o); + YAZ_CHECK(sr); + YAZ_CHECK(p); #if 0 sr->u.request->query.cql = "jordbær"; #else @@ -41,24 +45,18 @@ static void tst_srw(void) ret = z_soap_codec_enc(o, &p, &content_buf, &content_len, h, charset); odr_destroy(o); - if (ret) - { - printf("z_soap_codec_enc failed\n"); - exit(1); - } + YAZ_CHECK(ret == 0); /* codec failed ? */ } #endif int main(int argc, char **argv) { + YAZ_CHECK_INIT(argc, argv); #if HAVE_XML2 - LIBXML_TEST_VERSION - if (argc <= 1) - { - tst_srw(); - } + LIBXML_TEST_VERSION; + tst_srw(); #endif - return 0; + YAZ_CHECK_TERM; } /* * Local variables: