X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Ftstsoap1.c;h=11ad0888728522e4061b3665959bd2d9108b0838;hb=e6f45fddb3d4267340ad320dbedfbf5cb68c4d21;hp=a7488403194f3c0756185978f39c20067d68f1a6;hpb=ec00e8cfc23cb7d04a9b13730607d6c094446f36;p=yaz-moved-to-github.git diff --git a/test/tstsoap1.c b/test/tstsoap1.c index a748840..11ad088 100644 --- a/test/tstsoap1.c +++ b/test/tstsoap1.c @@ -1,42 +1,63 @@ /* - * Copyright (C) 1995-2005, Index Data ApS + * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: tstsoap1.c,v 1.2 2005-05-08 07:33:12 adam Exp $ + * $Id: tstsoap1.c,v 1.9 2007-01-03 08:42:16 adam Exp $ */ #include -#if HAVE_XML2 +#if YAZ_HAVE_XML2 #include #endif +#include -int main(int argc, char **argv) +void tst(void) { -#if HAVE_XML2 - LIBXML_TEST_VERSION; - - if (argc <= 1) - { - xmlChar *buf_out; - int len_out; - xmlDocPtr doc = xmlNewDoc("1.0"); +#if YAZ_HAVE_XML2 + xmlChar *buf_out; + int len_out; + xmlDocPtr doc; + xmlNodePtr top; #if 0 - const char *val = "jordbær"; /* makes xmlDocDumpMemory hang .. */ + const char *val = "jordbær"; /* makes xmlDocDumpMemory hang .. */ #else - const char *val = "jordbaer"; /* OK */ + const char *val = "jordbaer"; /* OK */ #endif - xmlNodePtr top = xmlNewNode(0, "top"); - - xmlNewTextChild(top, 0, "sub", val); - xmlDocSetRootElement(doc, top); - - xmlDocDumpMemory(doc, &buf_out, &len_out); + doc = xmlNewDoc(BAD_CAST "1.0"); + YAZ_CHECK(doc); + + top = xmlNewNode(0, BAD_CAST "top"); + YAZ_CHECK(top); + + xmlNewTextChild(top, 0, BAD_CAST "sub", BAD_CAST val); + xmlDocSetRootElement(doc, top); + + xmlDocDumpMemory(doc, &buf_out, &len_out); #if 0 - printf("%*s", len_out, buf_out); + printf("%*s", len_out, buf_out); #endif - } + + +/* YAZ_HAVE_XML2 */ #endif - return 0; } +int main(int argc, char **argv) +{ + YAZ_CHECK_INIT(argc, argv); +#if YAZ_HAVE_XML2 + LIBXML_TEST_VERSION; +#endif + tst(); + YAZ_CHECK_TERM; +} + + +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */