1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2010 Index Data
3 * See the file LICENSE for details.
10 #include <yaz/xml_include.h>
13 static void tst_xml_include(void)
15 const char *srcdir = getenv("srcdir");
18 const char *xml_in = "<x><include src=\"tst_xml_inc*.xml\"/></x>";
23 doc = xmlParseMemory(xml_in, strlen(xml_in));
27 node = xmlDocGetRootElement(doc);
32 "<?xml version=\"1.0\"?>\n"
33 "<x><!-- begin include src=\"tst_xml_inc*.xml\" -->"
35 "<!-- end include src=\"tst_xml_inc*.xml\" --></x>\n";
39 int ret = yaz_xml_include_simple(node, srcdir);
41 xmlDocDumpMemory(doc, &xml_out, &len_out);
42 YAZ_CHECK(xml_out && len_out > 0);
43 if (xml_out && len_out > 0)
45 YAZ_CHECK(strlen(expect) == len_out);
46 if (strlen(expect) == len_out)
48 YAZ_CHECK(memcmp(expect, xml_out, len_out) == 0);
52 fwrite(xml_out, 1, len_out, stdout);
62 int main (int argc, char **argv)
64 YAZ_CHECK_INIT(argc, argv);
73 * c-file-style: "Stroustrup"
74 * indent-tabs-mode: nil
76 * vim: shiftwidth=4 tabstop=8 expandtab