tcpip: initialize ai_connect
[yaz-moved-to-github.git] / test / test_soap1.c
1 /* This file is part of the YAZ toolkit.
2  * Copyright (C) Index Data
3  * See the file LICENSE for details.
4  */
5 #if HAVE_CONFIG_H
6 #include <config.h>
7 #endif
8
9 #include <stdlib.h>
10 #if YAZ_HAVE_XML2
11 #include <libxml/parser.h>
12 #endif
13 #include <yaz/test.h>
14
15 void tst(void)
16 {
17 #if YAZ_HAVE_XML2
18     xmlChar *buf_out;
19     int len_out;
20     xmlDocPtr doc;
21     xmlNodePtr top;
22 #if 0
23     const char *val = "jordb" "\xe6" "r"; /* makes xmlDocDumpMemory hang .. */
24 #else
25     const char *val = "jordbaer"; /* OK */
26 #endif
27     doc = xmlNewDoc(BAD_CAST "1.0");
28     YAZ_CHECK(doc);
29
30     top = xmlNewNode(0, BAD_CAST "top");
31     YAZ_CHECK(top);
32
33     xmlNewTextChild(top, 0, BAD_CAST "sub", BAD_CAST val);
34     xmlDocSetRootElement(doc, top);
35
36     xmlDocDumpMemory(doc, &buf_out, &len_out);
37 #if 0
38     printf("%*s", len_out, buf_out);
39 #endif
40
41
42 /* YAZ_HAVE_XML2 */
43 #endif
44 }
45
46 int main(int argc, char **argv)
47 {
48     YAZ_CHECK_INIT(argc, argv);
49 #if YAZ_HAVE_XML2
50     LIBXML_TEST_VERSION;
51 #endif
52     tst();
53     YAZ_CHECK_TERM;
54 }
55
56
57 /*
58  * Local variables:
59  * c-basic-offset: 4
60  * c-file-style: "Stroustrup"
61  * indent-tabs-mode: nil
62  * End:
63  * vim: shiftwidth=4 tabstop=8 expandtab
64  */
65