X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=test%2Ftest_soap1.c;fp=test%2Ftest_soap1.c;h=eb2ba11d7974f13fb85d1728724ef44343b031f6;hp=0000000000000000000000000000000000000000;hb=3107ce3a34993d2f784387f227a50343fff83bbc;hpb=ed31c923f03ec124060972f5351b8b33e07a2e13 diff --git a/test/test_soap1.c b/test/test_soap1.c new file mode 100644 index 0000000..eb2ba11 --- /dev/null +++ b/test/test_soap1.c @@ -0,0 +1,62 @@ +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2010 Index Data + * See the file LICENSE for details. + */ + +#include +#if YAZ_HAVE_XML2 +#include +#endif +#include + +void tst(void) +{ +#if YAZ_HAVE_XML2 + xmlChar *buf_out; + int len_out; + xmlDocPtr doc; + xmlNodePtr top; +#if 0 + const char *val = "jordb" "\xe6" "r"; /* makes xmlDocDumpMemory hang .. */ +#else + const char *val = "jordbaer"; /* OK */ +#endif + 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); +#endif + + +/* YAZ_HAVE_XML2 */ +#endif +} + +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 + * c-file-style: "Stroustrup" + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +