blob: 79bc2c0b1c7fd83ed2691395378c42eb19233189 [file] [log] [blame]
Daniel Veillardd93f6252004-11-02 15:53:51 +00001/*
2 * testapi.c: libxml2 API tester program.
3 *
4 * Automatically generated by gentest.py from libxml2-api.xml
5 *
6 * See Copyright for the status of this software.
7 *
8 * daniel@veillard.com
9 */
10
11#include <stdio.h>
Daniel Veillardce244ad2004-11-05 10:03:46 +000012#include <string.h>
Daniel Veillardd93f6252004-11-02 15:53:51 +000013#include <libxml/xmlerror.h>
Daniel Veillard3d97e662004-11-04 10:49:00 +000014#include <libxml/relaxng.h>
Daniel Veillardd93f6252004-11-02 15:53:51 +000015
16static int testlibxml2(void);
Daniel Veillardce244ad2004-11-05 10:03:46 +000017static int test_module(const char *module);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018
19static int generic_errors = 0;
20static int call_tests = 0;
Daniel Veillard3d97e662004-11-04 10:49:00 +000021static int function_tests = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022
Daniel Veillard5ea30d72004-11-08 11:54:28 +000023static xmlChar chartab[1024];
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000024static int inttab[1024];
25static unsigned long longtab[1024];
Daniel Veillardce244ad2004-11-05 10:03:46 +000026
27static xmlDocPtr api_doc = NULL;
Daniel Veillard27f20102004-11-05 11:50:11 +000028static xmlDtdPtr api_dtd = NULL;
Daniel Veillardce244ad2004-11-05 10:03:46 +000029static xmlNodePtr api_root = NULL;
30static xmlAttrPtr api_attr = NULL;
Daniel Veillard27f20102004-11-05 11:50:11 +000031static xmlNsPtr api_ns = NULL;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032
Daniel Veillardd93f6252004-11-02 15:53:51 +000033static void
34structured_errors(void *userData ATTRIBUTE_UNUSED,
35 xmlErrorPtr error ATTRIBUTE_UNUSED) {
36 generic_errors++;
37}
38
Daniel Veillardce244ad2004-11-05 10:03:46 +000039static void
40free_api_doc(void) {
41 xmlFreeDoc(api_doc);
42 api_doc = NULL;
Daniel Veillard27f20102004-11-05 11:50:11 +000043 api_dtd = NULL;
Daniel Veillardce244ad2004-11-05 10:03:46 +000044 api_root = NULL;
45 api_attr = NULL;
Daniel Veillard27f20102004-11-05 11:50:11 +000046 api_ns = NULL;
Daniel Veillardce244ad2004-11-05 10:03:46 +000047}
48
49static xmlDocPtr
50get_api_doc(void) {
51 if (api_doc == NULL) {
Daniel Veillard27f20102004-11-05 11:50:11 +000052 api_doc = xmlReadMemory("<!DOCTYPE root [<!ELEMENT root EMPTY>]><root xmlns:h='http://example.com/' h:foo='bar'/>", 88, "root_test", NULL, 0);
Daniel Veillardce244ad2004-11-05 10:03:46 +000053 api_root = NULL;
54 api_attr = NULL;
55 }
56 return(api_doc);
57}
58
Daniel Veillard27f20102004-11-05 11:50:11 +000059static xmlDtdPtr
60get_api_dtd(void) {
61 if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) {
62 get_api_doc();
63 if ((api_doc != NULL) && (api_doc->children != NULL) &&
64 (api_doc->children->type == XML_DTD_NODE))
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000065 api_dtd = (xmlDtdPtr) api_doc->children;
Daniel Veillard27f20102004-11-05 11:50:11 +000066 }
67 return(api_dtd);
68}
69
Daniel Veillardce244ad2004-11-05 10:03:46 +000070static xmlNodePtr
71get_api_root(void) {
72 if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
73 get_api_doc();
74 if ((api_doc != NULL) && (api_doc->children != NULL) &&
Daniel Veillard27f20102004-11-05 11:50:11 +000075 (api_doc->children->next != NULL) &&
76 (api_doc->children->next->type == XML_ELEMENT_NODE))
77 api_root = api_doc->children->next;
Daniel Veillardce244ad2004-11-05 10:03:46 +000078 }
79 return(api_root);
80}
81
Daniel Veillard27f20102004-11-05 11:50:11 +000082static xmlNsPtr
83get_api_ns(void) {
84 get_api_root();
85 if (api_root != NULL)
86 api_ns = api_root->nsDef;
87 return(api_ns);
88}
89
Daniel Veillardce244ad2004-11-05 10:03:46 +000090static xmlAttrPtr
91get_api_attr(void) {
Daniel Veillardc8311492004-11-08 16:51:13 +000092#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
Daniel Veillardce244ad2004-11-05 10:03:46 +000093 static int nr = 0;
94 xmlChar name[20];
Daniel Veillardc8311492004-11-08 16:51:13 +000095#endif
Daniel Veillardce244ad2004-11-05 10:03:46 +000096
97 if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
98 get_api_root();
99 }
100 if (api_root == NULL)
101 return(NULL);
102 if (api_root->properties != NULL) {
103 api_attr = api_root->properties;
104 return(api_root->properties);
105 }
Daniel Veillardc8311492004-11-08 16:51:13 +0000106 api_attr = NULL;
107#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
Daniel Veillardce244ad2004-11-05 10:03:46 +0000108 snprintf((char *) name, 20, "foo%d", nr++);
109 api_attr = xmlSetProp(api_root, name, (const xmlChar *) "bar");
Daniel Veillardc8311492004-11-08 16:51:13 +0000110#endif
Daniel Veillardce244ad2004-11-05 10:03:46 +0000111 return(api_attr);
112}
113
114int main(int argc, char **argv) {
Daniel Veillardd93f6252004-11-02 15:53:51 +0000115 int ret;
116 int blocks, mem;
117
Daniel Veillard5ea30d72004-11-08 11:54:28 +0000118 memset(chartab, 0, sizeof(chartab));
Daniel Veillardc8311492004-11-08 16:51:13 +0000119 strncpy((char *) chartab, " chartab\n", 20);
Daniel Veillard5ea30d72004-11-08 11:54:28 +0000120 memset(inttab, 0, sizeof(inttab));
121 memset(longtab, 0, sizeof(longtab));
122
Daniel Veillarda03e3652004-11-02 18:45:30 +0000123 xmlInitParser();
Daniel Veillard3d97e662004-11-04 10:49:00 +0000124#ifdef LIBXML_SCHEMAS_ENABLED
Daniel Veillarddd6d3002004-11-03 14:20:29 +0000125 xmlRelaxNGInitTypes();
Daniel Veillard3d97e662004-11-04 10:49:00 +0000126#endif
Daniel Veillarda03e3652004-11-02 18:45:30 +0000127
Daniel Veillardd93f6252004-11-02 15:53:51 +0000128 LIBXML_TEST_VERSION
129
130 xmlSetStructuredErrorFunc(NULL, structured_errors);
131
Daniel Veillardce244ad2004-11-05 10:03:46 +0000132 if (argc == 2)
133 ret = test_module(argv[1]);
134 else
135 ret = testlibxml2();
Daniel Veillardd93f6252004-11-02 15:53:51 +0000136
137 xmlCleanupParser();
138 blocks = xmlMemBlocks();
139 mem = xmlMemUsed();
140 if ((blocks != 0) || (mem != 0)) {
141 printf("testapi leaked %d bytes in %d blocks\n", mem, blocks);
142 }
143 xmlMemoryDump();
144
145 return (ret != 0);
146}
147
148#include <libxml/HTMLparser.h>
149#include <libxml/HTMLtree.h>
Daniel Veillardd93f6252004-11-02 15:53:51 +0000150#include <libxml/catalog.h>
151#include <libxml/chvalid.h>
152#include <libxml/dict.h>
153#include <libxml/encoding.h>
154#include <libxml/entities.h>
155#include <libxml/hash.h>
156#include <libxml/list.h>
157#include <libxml/nanoftp.h>
158#include <libxml/nanohttp.h>
159#include <libxml/parser.h>
Daniel Veillard2a4fb5a2004-11-08 14:02:18 +0000160#include <libxml/parserInternals.h>
Daniel Veillardd93f6252004-11-02 15:53:51 +0000161#include <libxml/pattern.h>
162#include <libxml/relaxng.h>
163#include <libxml/schemasInternals.h>
164#include <libxml/tree.h>
165#include <libxml/uri.h>
166#include <libxml/valid.h>
167#include <libxml/xinclude.h>
168#include <libxml/xmlIO.h>
Daniel Veillardd93f6252004-11-02 15:53:51 +0000169#include <libxml/xmlerror.h>
Daniel Veillardd93f6252004-11-02 15:53:51 +0000170#include <libxml/xmlreader.h>
Daniel Veillardd93f6252004-11-02 15:53:51 +0000171#include <libxml/xmlsave.h>
172#include <libxml/xmlschemas.h>
173#include <libxml/xmlschemastypes.h>
174#include <libxml/xmlstring.h>
175#include <libxml/xmlwriter.h>
176#include <libxml/xpath.h>
177#include <libxml/xpointer.h>
Daniel Veillardd93f6252004-11-02 15:53:51 +0000178
Daniel Veillard1ba06bb2004-11-04 12:32:18 +0000179#define gen_nb_void_ptr 2
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +0000180
Daniel Veillard3d97e662004-11-04 10:49:00 +0000181static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +0000182 return(NULL);
183}
Daniel Veillard3d97e662004-11-04 10:49:00 +0000184static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +0000185}
186
Daniel Veillardce244ad2004-11-05 10:03:46 +0000187#if 0
Daniel Veillard1ba06bb2004-11-04 12:32:18 +0000188#define gen_nb_const_void_ptr 2
189
190static const void *gen_const_void_ptr(int no, int nr ATTRIBUTE_UNUSED) {
191 if (no == 0) return((const void *) "immutable string");
192 return(NULL);
193}
194static void des_const_void_ptr(int no ATTRIBUTE_UNUSED, const void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
195}
Daniel Veillardce244ad2004-11-05 10:03:46 +0000196#endif
Daniel Veillard1ba06bb2004-11-04 12:32:18 +0000197
Daniel Veillard8a32fe42004-11-02 22:10:16 +0000198#define gen_nb_userdata 3
199
Daniel Veillard3d97e662004-11-04 10:49:00 +0000200static void *gen_userdata(int no, int nr ATTRIBUTE_UNUSED) {
Daniel Veillard8a32fe42004-11-02 22:10:16 +0000201 if (no == 0) return((void *) &call_tests);
202 if (no == 1) return((void *) -1);
203 return(NULL);
204}
Daniel Veillard3d97e662004-11-04 10:49:00 +0000205static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
Daniel Veillard8a32fe42004-11-02 22:10:16 +0000206}
207
208
Daniel Veillardd93f6252004-11-02 15:53:51 +0000209#define gen_nb_int 4
210
Daniel Veillard3d97e662004-11-04 10:49:00 +0000211static int gen_int(int no, int nr ATTRIBUTE_UNUSED) {
212 if (no == 0) return(0);
213 if (no == 1) return(1);
Daniel Veillardc2c894f2004-11-07 12:17:35 +0000214 if (no == 2) return(-1);
215 if (no == 3) return(122);
Daniel Veillard3d97e662004-11-04 10:49:00 +0000216 return(-1);
217}
218
219static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
220}
221
Daniel Veillard6128c012004-11-08 17:16:15 +0000222#define gen_nb_parseroptions 5
223
224static int gen_parseroptions(int no, int nr ATTRIBUTE_UNUSED) {
225 if (no == 0) return(XML_PARSE_NOBLANKS | XML_PARSE_RECOVER);
226 if (no == 1) return(XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_DTDVALID | XML_PARSE_NOCDATA);
227 if (no == 2) return(XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE | XML_PARSE_NSCLEAN);
228 if (no == 3) return(XML_PARSE_XINCLUDE | XML_PARSE_NODICT);
229 return(XML_PARSE_SAX1);
230}
231
232static void des_parseroptions(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
233}
234
Daniel Veillardce244ad2004-11-05 10:03:46 +0000235#if 0
Daniel Veillard1ba06bb2004-11-04 12:32:18 +0000236#define gen_nb_long 4
237
238static long gen_long(int no, int nr ATTRIBUTE_UNUSED) {
239 if (no == 0) return(0);
240 if (no == 1) return(1);
Daniel Veillardc2c894f2004-11-07 12:17:35 +0000241 if (no == 2) return(-1);
242 if (no == 3) return(122);
Daniel Veillard1ba06bb2004-11-04 12:32:18 +0000243 return(-1);
244}
245
246static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
247}
Daniel Veillardce244ad2004-11-05 10:03:46 +0000248#endif
Daniel Veillard1ba06bb2004-11-04 12:32:18 +0000249
Daniel Veillard3d97e662004-11-04 10:49:00 +0000250#define gen_nb_unsigned_int 3
251
252static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd93f6252004-11-02 15:53:51 +0000253 if (no == 0) return(0);
254 if (no == 1) return(1);
255 if (no == 2) return(122);
256 return(-1);
257}
258
Daniel Veillard3d97e662004-11-04 10:49:00 +0000259static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd93f6252004-11-02 15:53:51 +0000260}
261
Daniel Veillard3d95c732004-11-06 22:25:14 +0000262#define gen_nb_unsigned_long 4
Daniel Veillard1ba06bb2004-11-04 12:32:18 +0000263
264static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) {
265 if (no == 0) return(0);
266 if (no == 1) return(1);
267 if (no == 2) return(122);
268 return(-1);
269}
270
271static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
272}
273
Daniel Veillard3d95c732004-11-06 22:25:14 +0000274#define gen_nb_double 4
275
276static double gen_double(int no, int nr ATTRIBUTE_UNUSED) {
277 if (no == 0) return(0);
278 if (no == 1) return(-1.1);
Daniel Veillardc8311492004-11-08 16:51:13 +0000279#if defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XPATH_ENABLED)
Daniel Veillard3d95c732004-11-06 22:25:14 +0000280 if (no == 2) return(xmlXPathNAN);
Daniel Veillardc8311492004-11-08 16:51:13 +0000281#endif
Daniel Veillard3d95c732004-11-06 22:25:14 +0000282 return(-1);
283}
284
285static void des_double(int no ATTRIBUTE_UNUSED, double val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
286}
287
Daniel Veillard1ba06bb2004-11-04 12:32:18 +0000288#define gen_nb_unsigned_long_ptr 2
289
290static unsigned long *gen_unsigned_long_ptr(int no, int nr) {
291 if (no == 0) return(&longtab[nr]);
292 return(NULL);
293}
294
295static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
296}
297
298#define gen_nb_int_ptr 2
299
300static int *gen_int_ptr(int no, int nr) {
301 if (no == 0) return(&inttab[nr]);
302 return(NULL);
303}
304
305static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
306}
307
Daniel Veillardd93f6252004-11-02 15:53:51 +0000308#define gen_nb_const_char_ptr 4
309
Daniel Veillardce682bc2004-11-05 17:22:25 +0000310static char *gen_const_char_ptr(int no, int nr ATTRIBUTE_UNUSED) {
311 if (no == 0) return((char *) "foo");
312 if (no == 1) return((char *) "<foo/>");
313 if (no == 2) return((char *) "test/ent2");
Daniel Veillardd93f6252004-11-02 15:53:51 +0000314 return(NULL);
315}
Daniel Veillard3d97e662004-11-04 10:49:00 +0000316static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd93f6252004-11-02 15:53:51 +0000317}
318
Daniel Veillard8a32fe42004-11-02 22:10:16 +0000319#define gen_nb_xmlChar_ptr 2
320
Daniel Veillard3d97e662004-11-04 10:49:00 +0000321static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd005b9e2004-11-03 17:07:05 +0000322 if (no == 0) return(&chartab[0]);
Daniel Veillard8a32fe42004-11-02 22:10:16 +0000323 return(NULL);
324}
Daniel Veillard3d97e662004-11-04 10:49:00 +0000325static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
Daniel Veillard8a32fe42004-11-02 22:10:16 +0000326}
327
Daniel Veillard1ba06bb2004-11-04 12:32:18 +0000328#define gen_nb_FILE_ptr 2
329
330static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) {
331 if (no == 0) return(fopen("test.out", "a+"));
332 return(NULL);
333}
334static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
335 if (val != NULL) fclose(val);
336}
337
Daniel Veillarda82b1822004-11-08 16:24:57 +0000338#define gen_nb_debug_FILE_ptr 2
339static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
340 return(fopen("test.out", "a+"));
341}
342static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
343 if (val != NULL) fclose(val);
344}
345
Daniel Veillardd93f6252004-11-02 15:53:51 +0000346#define gen_nb_const_xmlChar_ptr 5
347
Daniel Veillardce682bc2004-11-05 17:22:25 +0000348static xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
349 if (no == 0) return((xmlChar *) "foo");
350 if (no == 1) return((xmlChar *) "<foo/>");
351 if (no == 2) return((xmlChar *) "nøne");
352 if (no == 3) return((xmlChar *) " 2ab ");
Daniel Veillardd93f6252004-11-02 15:53:51 +0000353 return(NULL);
354}
Daniel Veillard3d97e662004-11-04 10:49:00 +0000355static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd93f6252004-11-02 15:53:51 +0000356}
357
358#define gen_nb_filepath 8
359
Daniel Veillard3d97e662004-11-04 10:49:00 +0000360static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd93f6252004-11-02 15:53:51 +0000361 if (no == 0) return("missing.xml");
362 if (no == 1) return("<foo/>");
363 if (no == 2) return("test/ent2");
364 if (no == 3) return("test/valid/REC-xml-19980210.xml");
Daniel Veillard1ba06bb2004-11-04 12:32:18 +0000365 if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd");
Daniel Veillardd93f6252004-11-02 15:53:51 +0000366 if (no == 5) return("http://missing.example.org/");
367 if (no == 6) return("http://missing. example.org/");
368 return(NULL);
369}
Daniel Veillard3d97e662004-11-04 10:49:00 +0000370static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd93f6252004-11-02 15:53:51 +0000371}
372
Daniel Veillard27f20102004-11-05 11:50:11 +0000373#define gen_nb_eaten_name 2
374
375static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) {
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +0000376 if (no == 0) return(xmlStrdup(BAD_CAST "eaten"));
Daniel Veillard27f20102004-11-05 11:50:11 +0000377 return(NULL);
378}
379static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
380}
381
Daniel Veillardd93f6252004-11-02 15:53:51 +0000382#define gen_nb_fileoutput 6
383
Daniel Veillard3d97e662004-11-04 10:49:00 +0000384static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd93f6252004-11-02 15:53:51 +0000385 if (no == 0) return("/missing.xml");
386 if (no == 1) return("<foo/>");
387 if (no == 2) return("ftp://missing.example.org/foo");
388 if (no == 3) return("http://missing.example.org/");
389 if (no == 4) return("http://missing. example.org/");
390 return(NULL);
391}
Daniel Veillard3d97e662004-11-04 10:49:00 +0000392static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd93f6252004-11-02 15:53:51 +0000393}
394
395#define gen_nb_xmlParserCtxtPtr 2
Daniel Veillard3d97e662004-11-04 10:49:00 +0000396static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd93f6252004-11-02 15:53:51 +0000397 if (no == 0) return(xmlNewParserCtxt());
398 return(NULL);
399}
Daniel Veillard3d97e662004-11-04 10:49:00 +0000400static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd93f6252004-11-02 15:53:51 +0000401 if (val != NULL)
402 xmlFreeParserCtxt(val);
403}
404
Daniel Veillard34099b42004-11-04 17:34:35 +0000405#define gen_nb_xmlSAXHandlerPtr 2
406static xmlSAXHandlerPtr gen_xmlSAXHandlerPtr(int no, int nr ATTRIBUTE_UNUSED) {
407 if (no == 0) return((xmlSAXHandlerPtr) &xmlDefaultSAXHandler);
408 return(NULL);
409}
410static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
411}
412
Daniel Veillardc0be74b2004-11-03 19:16:55 +0000413#define gen_nb_xmlValidCtxtPtr 2
Daniel Veillard3d97e662004-11-04 10:49:00 +0000414static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardc0be74b2004-11-03 19:16:55 +0000415 if (no == 0) return(xmlNewValidCtxt());
416 return(NULL);
417}
Daniel Veillard3d97e662004-11-04 10:49:00 +0000418static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardc0be74b2004-11-03 19:16:55 +0000419 if (val != NULL)
420 xmlFreeValidCtxt(val);
421}
422
Daniel Veillard34099b42004-11-04 17:34:35 +0000423#define gen_nb_xmlParserInputBufferPtr 8
424
425static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
426 if (no == 0) return(xmlParserInputBufferCreateFilename("missing.xml", XML_CHAR_ENCODING_NONE));
427 if (no == 1) return(xmlParserInputBufferCreateFilename("<foo/>", XML_CHAR_ENCODING_NONE));
428 if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE));
429 if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE));
430 if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE));
431 if (no == 5) return(xmlParserInputBufferCreateFilename("http://missing.example.org/", XML_CHAR_ENCODING_NONE));
432 if (no == 6) return(xmlParserInputBufferCreateFilename("http://missing. example.org/", XML_CHAR_ENCODING_NONE));
433 return(NULL);
434}
435static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
436 xmlFreeParserInputBuffer(val);
437}
438
Daniel Veillardd93f6252004-11-02 15:53:51 +0000439#define gen_nb_xmlDocPtr 3
Daniel Veillard3d97e662004-11-04 10:49:00 +0000440static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd93f6252004-11-02 15:53:51 +0000441 if (no == 0) return(xmlNewDoc(BAD_CAST "1.0"));
442 if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0));
443 return(NULL);
444}
Daniel Veillard3d97e662004-11-04 10:49:00 +0000445static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardce244ad2004-11-05 10:03:46 +0000446 if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
Daniel Veillardd93f6252004-11-02 15:53:51 +0000447 xmlFreeDoc(val);
448}
449
Daniel Veillardce244ad2004-11-05 10:03:46 +0000450#define gen_nb_xmlAttrPtr 2
451static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) {
452 if (no == 0) return(get_api_attr());
453 return(NULL);
454}
455static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
456 if (no == 0) free_api_doc();
457}
458
Daniel Veillard1ba06bb2004-11-04 12:32:18 +0000459#define gen_nb_xmlDictPtr 2
460static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) {
461 if (no == 0) return(xmlDictCreate());
462 return(NULL);
463}
464static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) {
465 if (val != NULL)
466 xmlDictFree(val);
467}
468
Daniel Veillardce244ad2004-11-05 10:03:46 +0000469#define gen_nb_xmlNodePtr 3
Daniel Veillard3d97e662004-11-04 10:49:00 +0000470static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd93f6252004-11-02 15:53:51 +0000471 if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
Daniel Veillardce244ad2004-11-05 10:03:46 +0000472 if (no == 1) return(get_api_root());
Daniel Veillardd93f6252004-11-02 15:53:51 +0000473 return(NULL);
Daniel Veillardce244ad2004-11-05 10:03:46 +0000474/* if (no == 2) return((xmlNodePtr) get_api_doc()); */
Daniel Veillardd93f6252004-11-02 15:53:51 +0000475}
Daniel Veillard27f20102004-11-05 11:50:11 +0000476static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardce244ad2004-11-05 10:03:46 +0000477 if (no == 1) free_api_doc();
478 else if (val != NULL) {
Daniel Veillardd93f6252004-11-02 15:53:51 +0000479 xmlUnlinkNode(val);
480 xmlFreeNode(val);
481 }
482}
483
Daniel Veillard27f20102004-11-05 11:50:11 +0000484#define gen_nb_xmlDtdPtr 3
485static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) {
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +0000486 if (no == 0)
487 return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar"));
Daniel Veillard27f20102004-11-05 11:50:11 +0000488 if (no == 1) return(get_api_dtd());
489 return(NULL);
490}
491static void des_xmlDtdPtr(int no, xmlDtdPtr val, int nr ATTRIBUTE_UNUSED) {
492 if (no == 1) free_api_doc();
493 else if (val != NULL) {
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +0000494 xmlUnlinkNode((xmlNodePtr) val);
495 xmlFreeNode((xmlNodePtr) val);
Daniel Veillard27f20102004-11-05 11:50:11 +0000496 }
497}
498
499#define gen_nb_xmlNsPtr 2
500static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) {
501 if (no == 0) return(get_api_ns());
502 return(NULL);
503}
504static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
505 if (no == 0) free_api_doc();
506}
507
Daniel Veillardd93f6252004-11-02 15:53:51 +0000508#define gen_nb_xmlNodePtr_in 3
Daniel Veillard3d97e662004-11-04 10:49:00 +0000509static xmlNodePtr gen_xmlNodePtr_in(int no, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd93f6252004-11-02 15:53:51 +0000510 if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
511 if (no == 0) return(xmlNewText(BAD_CAST "text"));
512 return(NULL);
513}
Daniel Veillard3d97e662004-11-04 10:49:00 +0000514static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd93f6252004-11-02 15:53:51 +0000515}
516
Daniel Veillardc8311492004-11-08 16:51:13 +0000517#ifdef LIBXML_WRITER_ENABLED
Daniel Veillarde43cc572004-11-03 11:50:29 +0000518#define gen_nb_xmlTextWriterPtr 2
Daniel Veillard3d97e662004-11-04 10:49:00 +0000519static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) {
Daniel Veillarde43cc572004-11-03 11:50:29 +0000520 if (no == 0) return(xmlNewTextWriterFilename("test.out", 0));
521 return(NULL);
522}
Daniel Veillard3d97e662004-11-04 10:49:00 +0000523static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) {
Daniel Veillarde43cc572004-11-03 11:50:29 +0000524 if (val != NULL) xmlFreeTextWriter(val);
525}
Daniel Veillardc8311492004-11-08 16:51:13 +0000526#endif
Daniel Veillarde43cc572004-11-03 11:50:29 +0000527
Daniel Veillardc8311492004-11-08 16:51:13 +0000528#ifdef LIBXML_READER_ENABLED
Daniel Veillarddd6d3002004-11-03 14:20:29 +0000529#define gen_nb_xmlTextReaderPtr 4
Daniel Veillard3d97e662004-11-04 10:49:00 +0000530static xmlTextReaderPtr gen_xmlTextReaderPtr(int no, int nr ATTRIBUTE_UNUSED) {
Daniel Veillarddd6d3002004-11-03 14:20:29 +0000531 if (no == 0) return(xmlNewTextReaderFilename("test/ent2"));
532 if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml"));
533 if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd"));
534 return(NULL);
535}
Daniel Veillard3d97e662004-11-04 10:49:00 +0000536static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) {
Daniel Veillarddd6d3002004-11-03 14:20:29 +0000537 if (val != NULL) xmlFreeTextReader(val);
538}
Daniel Veillardc8311492004-11-08 16:51:13 +0000539#endif
Daniel Veillarddd6d3002004-11-03 14:20:29 +0000540
Daniel Veillard34099b42004-11-04 17:34:35 +0000541#define gen_nb_xmlBufferPtr 3
Daniel Veillard3d97e662004-11-04 10:49:00 +0000542static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd005b9e2004-11-03 17:07:05 +0000543 if (no == 0) return(xmlBufferCreate());
Daniel Veillardce244ad2004-11-05 10:03:46 +0000544 if (no == 1) return(xmlBufferCreateStatic((void *)"a static buffer", 13));
Daniel Veillardd005b9e2004-11-03 17:07:05 +0000545 return(NULL);
546}
Daniel Veillard3d97e662004-11-04 10:49:00 +0000547static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd005b9e2004-11-03 17:07:05 +0000548 if (val != NULL) {
549 xmlBufferFree(val);
550 }
551}
552
553#define gen_nb_xmlListPtr 2
Daniel Veillard3d97e662004-11-04 10:49:00 +0000554static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd005b9e2004-11-03 17:07:05 +0000555 if (no == 0) return(xmlListCreate(NULL, NULL));
556 return(NULL);
557}
Daniel Veillard3d97e662004-11-04 10:49:00 +0000558static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd005b9e2004-11-03 17:07:05 +0000559 if (val != NULL) {
560 xmlListDelete(val);
561 }
562}
563
564#define gen_nb_xmlHashTablePtr 2
Daniel Veillard3d97e662004-11-04 10:49:00 +0000565static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd005b9e2004-11-03 17:07:05 +0000566 if (no == 0) return(xmlHashCreate(10));
567 return(NULL);
568}
Daniel Veillard3d97e662004-11-04 10:49:00 +0000569static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd005b9e2004-11-03 17:07:05 +0000570 if (val != NULL) {
571 xmlHashFree(val, NULL);
572 }
573}
574
575#include <libxml/xpathInternals.h>
576
Daniel Veillardc8311492004-11-08 16:51:13 +0000577#ifdef LIBXML_XPATH_ENABLED
Daniel Veillardd005b9e2004-11-03 17:07:05 +0000578#define gen_nb_xmlXPathObjectPtr 5
Daniel Veillard3d97e662004-11-04 10:49:00 +0000579static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd005b9e2004-11-03 17:07:05 +0000580 if (no == 0) return(xmlXPathNewString(BAD_CAST "string object"));
581 if (no == 1) return(xmlXPathNewFloat(1.1));
582 if (no == 2) return(xmlXPathNewBoolean(1));
583 if (no == 3) return(xmlXPathNewNodeSet(NULL));
584 return(NULL);
585}
Daniel Veillard3d97e662004-11-04 10:49:00 +0000586static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) {
Daniel Veillardd005b9e2004-11-03 17:07:05 +0000587 if (val != NULL) {
588 xmlXPathFreeObject(val);
589 }
590}
Daniel Veillardc8311492004-11-08 16:51:13 +0000591#endif
Daniel Veillardd005b9e2004-11-03 17:07:05 +0000592
Daniel Veillardc8311492004-11-08 16:51:13 +0000593#ifdef LIBXML_OUTPUT_ENABLED
Daniel Veillard3d97e662004-11-04 10:49:00 +0000594#define gen_nb_xmlOutputBufferPtr 2
595static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
596 if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0));
597 return(NULL);
598}
599static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
600 if (val != NULL) {
601 xmlOutputBufferClose(val);
602 }
603}
Daniel Veillardc8311492004-11-08 16:51:13 +0000604#endif
Daniel Veillard3d97e662004-11-04 10:49:00 +0000605
Daniel Veillardc8311492004-11-08 16:51:13 +0000606#ifdef LIBXML_FTP_ENABLED
Daniel Veillard27f20102004-11-05 11:50:11 +0000607#define gen_nb_xmlNanoFTPCtxtPtr 4
608static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
609 if (no == 0) return(xmlNanoFTPNewCtxt("ftp://example.com/"));
610 if (no == 1) return(xmlNanoFTPNewCtxt("http://example.com/"));
611 if (no == 2) return(xmlNanoFTPNewCtxt("foo"));
612 return(NULL);
613}
614static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
615 if (val != NULL) {
616 xmlNanoFTPFreeCtxt(val);
617 }
618}
Daniel Veillardc8311492004-11-08 16:51:13 +0000619#endif
Daniel Veillard27f20102004-11-05 11:50:11 +0000620
Daniel Veillardc8311492004-11-08 16:51:13 +0000621#ifdef LIBXML_HTTP_ENABLED
Daniel Veillard27f20102004-11-05 11:50:11 +0000622#define gen_nb_xmlNanoHTTPCtxtPtr 1
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +0000623static void *gen_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
Daniel Veillard27f20102004-11-05 11:50:11 +0000624 return(NULL);
625}
626static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
627}
Daniel Veillardc8311492004-11-08 16:51:13 +0000628#endif
Daniel Veillard27f20102004-11-05 11:50:11 +0000629
Daniel Veillard3d97e662004-11-04 10:49:00 +0000630#define gen_nb_xmlCharEncoding 4
631static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) {
632 if (no == 0) return(XML_CHAR_ENCODING_UTF8);
633 if (no == 1) return(XML_CHAR_ENCODING_NONE);
634 if (no == 0) return(XML_CHAR_ENCODING_8859_1);
635 return(XML_CHAR_ENCODING_ERROR);
636}
637static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
638}
639
Daniel Veillard42595322004-11-08 10:52:06 +0000640#define gen_nb_xmlHashDeallocator 2
641static void
642test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) {
643}
644
645static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) {
646 if (no == 0) return(test_xmlHashDeallocator);
647 return(NULL);
648}
649static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
650}
651
Daniel Veillardd93f6252004-11-02 15:53:51 +0000652
653static void desret_int(int val ATTRIBUTE_UNUSED) {
654}
Daniel Veillard1ba06bb2004-11-04 12:32:18 +0000655static void desret_long(long val ATTRIBUTE_UNUSED) {
656}
657static void desret_double(double val ATTRIBUTE_UNUSED) {
658}
Daniel Veillard3d97e662004-11-04 10:49:00 +0000659static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) {
660}
Daniel Veillardce244ad2004-11-05 10:03:46 +0000661#if 0
Daniel Veillard1ba06bb2004-11-04 12:32:18 +0000662static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) {
663}
Daniel Veillardce244ad2004-11-05 10:03:46 +0000664#endif
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +0000665static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
666}
Daniel Veillardd93f6252004-11-02 15:53:51 +0000667static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
668}
Daniel Veillardd005b9e2004-11-03 17:07:05 +0000669static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
670}
Daniel Veillard8a32fe42004-11-02 22:10:16 +0000671static void desret_xmlChar_ptr(xmlChar *val) {
672 if (val != NULL)
673 xmlFree(val);
674}
Daniel Veillardd93f6252004-11-02 15:53:51 +0000675static void desret_xmlDocPtr(xmlDocPtr val) {
Daniel Veillardce244ad2004-11-05 10:03:46 +0000676 if (val != api_doc)
677 xmlFreeDoc(val);
Daniel Veillardd93f6252004-11-02 15:53:51 +0000678}
Daniel Veillard1ba06bb2004-11-04 12:32:18 +0000679static void desret_xmlDictPtr(xmlDictPtr val) {
680 xmlDictFree(val);
681}
Daniel Veillardc8311492004-11-08 16:51:13 +0000682#ifdef LIBXML_OUTPUT_ENABLED
Daniel Veillard3d95c732004-11-06 22:25:14 +0000683static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) {
684 xmlOutputBufferClose(val);
685}
Daniel Veillardc8311492004-11-08 16:51:13 +0000686#endif
687#ifdef LIBXML_READER_ENABLED
Daniel Veillard1ba06bb2004-11-04 12:32:18 +0000688static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
689 xmlFreeTextReader(val);
690}
Daniel Veillardc8311492004-11-08 16:51:13 +0000691#endif
Daniel Veillardd93f6252004-11-02 15:53:51 +0000692static void desret_xmlNodePtr(xmlNodePtr val) {
Daniel Veillardce244ad2004-11-05 10:03:46 +0000693 if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) {
694 xmlUnlinkNode(val);
695 xmlFreeNode(val);
696 }
Daniel Veillardd93f6252004-11-02 15:53:51 +0000697}
Daniel Veillard57b25162004-11-06 14:50:18 +0000698static void desret_xmlAttrPtr(xmlAttrPtr val) {
699 if (val != NULL) {
700 xmlUnlinkNode((xmlNodePtr) val);
701 xmlFreeNode((xmlNodePtr) val);
702 }
703}
Daniel Veillardd5cc0f72004-11-06 19:24:28 +0000704static void desret_xmlEntityPtr(xmlEntityPtr val) {
705 if (val != NULL) {
706 xmlUnlinkNode((xmlNodePtr) val);
707 xmlFreeNode((xmlNodePtr) val);
708 }
709}
Daniel Veillard42595322004-11-08 10:52:06 +0000710static void desret_xmlElementPtr(xmlElementPtr val) {
711 if (val != NULL) {
712 xmlUnlinkNode((xmlNodePtr) val);
713 }
714}
715static void desret_xmlAttributePtr(xmlAttributePtr val) {
716 if (val != NULL) {
717 xmlUnlinkNode((xmlNodePtr) val);
718 }
719}
Daniel Veillardd5cc0f72004-11-06 19:24:28 +0000720static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) {
721}
Daniel Veillard34099b42004-11-04 17:34:35 +0000722static void desret_xmlDtdPtr(xmlDtdPtr val) {
723 desret_xmlNodePtr((xmlNodePtr)val);
724}
Daniel Veillardc8311492004-11-08 16:51:13 +0000725#ifdef LIBXML_XPATH_ENABLED
Daniel Veillard3d97e662004-11-04 10:49:00 +0000726static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
Daniel Veillard1ba06bb2004-11-04 12:32:18 +0000727 xmlXPathFreeObject(val);
Daniel Veillard3d97e662004-11-04 10:49:00 +0000728}
Daniel Veillardc8311492004-11-08 16:51:13 +0000729#endif
Daniel Veillard34099b42004-11-04 17:34:35 +0000730static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
731 xmlFreeParserCtxt(val);
732}
733
Daniel Veillardd5cc0f72004-11-06 19:24:28 +0000734static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) {
735 xmlFreeParserInputBuffer(val);
736}
Daniel Veillard42595322004-11-08 10:52:06 +0000737static void desret_xmlParserInputPtr(xmlParserInputPtr val) {
738 xmlFreeInputStream(val);
739}
Daniel Veillardc8311492004-11-08 16:51:13 +0000740#ifdef LIBXML_WRITER_ENABLED
Daniel Veillardd5cc0f72004-11-06 19:24:28 +0000741static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) {
742 xmlFreeTextWriter(val);
743}
Daniel Veillardc8311492004-11-08 16:51:13 +0000744#endif
Daniel Veillard3d95c732004-11-06 22:25:14 +0000745static void desret_xmlBufferPtr(xmlBufferPtr val) {
746 xmlBufferFree(val);
747}
Daniel Veillardc8311492004-11-08 16:51:13 +0000748#ifdef LIBXML_SCHEMAS_ENABLED
Daniel Veillard42595322004-11-08 10:52:06 +0000749static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) {
750 xmlSchemaFreeParserCtxt(val);
751}
752static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) {
753}
754static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) {
755 xmlRelaxNGFreeParserCtxt(val);
756}
Daniel Veillardc8311492004-11-08 16:51:13 +0000757#endif
758#ifdef LIBXML_HTML_ENABLED
Daniel Veillard42595322004-11-08 10:52:06 +0000759static void desret_const_htmlEntityDesc_ptr(const htmlEntityDescPtr val ATTRIBUTE_UNUSED) {
760}
Daniel Veillardc8311492004-11-08 16:51:13 +0000761#endif
Daniel Veillardd5cc0f72004-11-06 19:24:28 +0000762
763/************************************************************************
764 * *
765 * WARNING: end of the manually maintained part of the test code *
766 * do not remove or alter the CUT HERE line *
767 * *
768 ************************************************************************/
769
Daniel Veillard34099b42004-11-04 17:34:35 +0000770/* CUT HERE: everything below that line is generated */
Daniel Veillard57b25162004-11-06 14:50:18 +0000771#define gen_nb_htmlParserOption 4
772static htmlParserOption gen_htmlParserOption(int no, int nr ATTRIBUTE_UNUSED) {
773 if (no == 1) return(HTML_PARSE_NOBLANKS);
774 if (no == 2) return(HTML_PARSE_NOERROR);
775 if (no == 3) return(HTML_PARSE_NONET);
776 if (no == 4) return(HTML_PARSE_NOWARNING);
777 return(0);
778}
779static void des_htmlParserOption(int no ATTRIBUTE_UNUSED, htmlParserOption val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
780}
781static void desret_htmlParserOption(htmlParserOption val ATTRIBUTE_UNUSED) {
782}
783
784#define gen_nb_htmlStatus 4
785static htmlStatus gen_htmlStatus(int no, int nr ATTRIBUTE_UNUSED) {
786 if (no == 1) return(HTML_DEPRECATED);
787 if (no == 2) return(HTML_INVALID);
788 if (no == 3) return(HTML_NA);
789 if (no == 4) return(HTML_REQUIRED);
790 return(0);
791}
792static void des_htmlStatus(int no ATTRIBUTE_UNUSED, htmlStatus val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
793}
794static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
795}
796
797#define gen_nb_xlinkActuate 3
798static xlinkActuate gen_xlinkActuate(int no, int nr ATTRIBUTE_UNUSED) {
799 if (no == 1) return(XLINK_ACTUATE_AUTO);
800 if (no == 2) return(XLINK_ACTUATE_NONE);
801 if (no == 3) return(XLINK_ACTUATE_ONREQUEST);
802 return(0);
803}
804static void des_xlinkActuate(int no ATTRIBUTE_UNUSED, xlinkActuate val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
805}
806static void desret_xlinkActuate(xlinkActuate val ATTRIBUTE_UNUSED) {
807}
808
809#define gen_nb_xlinkShow 4
810static xlinkShow gen_xlinkShow(int no, int nr ATTRIBUTE_UNUSED) {
811 if (no == 1) return(XLINK_SHOW_EMBED);
812 if (no == 2) return(XLINK_SHOW_NEW);
813 if (no == 3) return(XLINK_SHOW_NONE);
814 if (no == 4) return(XLINK_SHOW_REPLACE);
815 return(0);
816}
817static void des_xlinkShow(int no ATTRIBUTE_UNUSED, xlinkShow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
818}
819static void desret_xlinkShow(xlinkShow val ATTRIBUTE_UNUSED) {
820}
821
822#define gen_nb_xlinkType 4
823static xlinkType gen_xlinkType(int no, int nr ATTRIBUTE_UNUSED) {
824 if (no == 1) return(XLINK_TYPE_EXTENDED);
825 if (no == 2) return(XLINK_TYPE_EXTENDED_SET);
826 if (no == 3) return(XLINK_TYPE_NONE);
827 if (no == 4) return(XLINK_TYPE_SIMPLE);
828 return(0);
829}
830static void des_xlinkType(int no ATTRIBUTE_UNUSED, xlinkType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
831}
832static void desret_xlinkType(xlinkType val ATTRIBUTE_UNUSED) {
833}
834
835#define gen_nb_xmlAttributeDefault 4
836static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) {
837 if (no == 1) return(XML_ATTRIBUTE_FIXED);
838 if (no == 2) return(XML_ATTRIBUTE_IMPLIED);
839 if (no == 3) return(XML_ATTRIBUTE_NONE);
840 if (no == 4) return(XML_ATTRIBUTE_REQUIRED);
841 return(0);
842}
843static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
844}
845static void desret_xmlAttributeDefault(xmlAttributeDefault val ATTRIBUTE_UNUSED) {
846}
847
848#define gen_nb_xmlAttributeType 4
849static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
850 if (no == 1) return(XML_ATTRIBUTE_CDATA);
851 if (no == 2) return(XML_ATTRIBUTE_ENTITIES);
852 if (no == 3) return(XML_ATTRIBUTE_ENTITY);
853 if (no == 4) return(XML_ATTRIBUTE_ENUMERATION);
854 return(0);
855}
856static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
857}
858static void desret_xmlAttributeType(xmlAttributeType val ATTRIBUTE_UNUSED) {
859}
860
861#define gen_nb_xmlBufferAllocationScheme 3
862static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
863 if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT);
864 if (no == 2) return(XML_BUFFER_ALLOC_EXACT);
865 if (no == 3) return(XML_BUFFER_ALLOC_IMMUTABLE);
866 return(0);
867}
868static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
869}
870static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
871}
872
873#define gen_nb_xmlCatalogAllow 4
874static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
875 if (no == 1) return(XML_CATA_ALLOW_ALL);
876 if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
877 if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
878 if (no == 4) return(XML_CATA_ALLOW_NONE);
879 return(0);
880}
881static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
882}
883static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
884}
885
886#define gen_nb_xmlCatalogPrefer 3
887static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
888 if (no == 1) return(XML_CATA_PREFER_NONE);
889 if (no == 2) return(XML_CATA_PREFER_PUBLIC);
890 if (no == 3) return(XML_CATA_PREFER_SYSTEM);
891 return(0);
892}
893static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
894}
895static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
896}
897
898#define gen_nb_xmlElementContentOccur 4
899static xmlElementContentOccur gen_xmlElementContentOccur(int no, int nr ATTRIBUTE_UNUSED) {
900 if (no == 1) return(XML_ELEMENT_CONTENT_MULT);
901 if (no == 2) return(XML_ELEMENT_CONTENT_ONCE);
902 if (no == 3) return(XML_ELEMENT_CONTENT_OPT);
903 if (no == 4) return(XML_ELEMENT_CONTENT_PLUS);
904 return(0);
905}
906static void des_xmlElementContentOccur(int no ATTRIBUTE_UNUSED, xmlElementContentOccur val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
907}
908static void desret_xmlElementContentOccur(xmlElementContentOccur val ATTRIBUTE_UNUSED) {
909}
910
911#define gen_nb_xmlElementContentType 4
912static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
913 if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
914 if (no == 2) return(XML_ELEMENT_CONTENT_OR);
915 if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
916 if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
917 return(0);
918}
919static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
920}
921static void desret_xmlElementContentType(xmlElementContentType val ATTRIBUTE_UNUSED) {
922}
923
924#define gen_nb_xmlElementType 4
925static xmlElementType gen_xmlElementType(int no, int nr ATTRIBUTE_UNUSED) {
926 if (no == 1) return(XML_ATTRIBUTE_DECL);
927 if (no == 2) return(XML_ATTRIBUTE_NODE);
928 if (no == 3) return(XML_CDATA_SECTION_NODE);
929 if (no == 4) return(XML_COMMENT_NODE);
930 return(0);
931}
932static void des_xmlElementType(int no ATTRIBUTE_UNUSED, xmlElementType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
933}
934static void desret_xmlElementType(xmlElementType val ATTRIBUTE_UNUSED) {
935}
936
937#define gen_nb_xmlElementTypeVal 4
938static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
939 if (no == 1) return(XML_ELEMENT_TYPE_ANY);
940 if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
941 if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
942 if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
943 return(0);
944}
945static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
946}
947static void desret_xmlElementTypeVal(xmlElementTypeVal val ATTRIBUTE_UNUSED) {
948}
949
950#define gen_nb_xmlEntityType 4
951static xmlEntityType gen_xmlEntityType(int no, int nr ATTRIBUTE_UNUSED) {
952 if (no == 1) return(XML_EXTERNAL_GENERAL_PARSED_ENTITY);
953 if (no == 2) return(XML_EXTERNAL_GENERAL_UNPARSED_ENTITY);
954 if (no == 3) return(XML_EXTERNAL_PARAMETER_ENTITY);
955 if (no == 4) return(XML_INTERNAL_GENERAL_ENTITY);
956 return(0);
957}
958static void des_xmlEntityType(int no ATTRIBUTE_UNUSED, xmlEntityType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
959}
960static void desret_xmlEntityType(xmlEntityType val ATTRIBUTE_UNUSED) {
961}
962
963#define gen_nb_xmlErrorDomain 4
964static xmlErrorDomain gen_xmlErrorDomain(int no, int nr ATTRIBUTE_UNUSED) {
965 if (no == 1) return(XML_FROM_C14N);
966 if (no == 2) return(XML_FROM_CATALOG);
967 if (no == 3) return(XML_FROM_CHECK);
968 if (no == 4) return(XML_FROM_DATATYPE);
969 return(0);
970}
971static void des_xmlErrorDomain(int no ATTRIBUTE_UNUSED, xmlErrorDomain val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
972}
973static void desret_xmlErrorDomain(xmlErrorDomain val ATTRIBUTE_UNUSED) {
974}
975
976#define gen_nb_xmlErrorLevel 4
977static xmlErrorLevel gen_xmlErrorLevel(int no, int nr ATTRIBUTE_UNUSED) {
978 if (no == 1) return(XML_ERR_ERROR);
979 if (no == 2) return(XML_ERR_FATAL);
980 if (no == 3) return(XML_ERR_NONE);
981 if (no == 4) return(XML_ERR_WARNING);
982 return(0);
983}
984static void des_xmlErrorLevel(int no ATTRIBUTE_UNUSED, xmlErrorLevel val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
985}
986static void desret_xmlErrorLevel(xmlErrorLevel val ATTRIBUTE_UNUSED) {
987}
988
989#define gen_nb_xmlParserErrors 4
990static xmlParserErrors gen_xmlParserErrors(int no, int nr ATTRIBUTE_UNUSED) {
991 if (no == 1) return(XML_C14N_CREATE_CTXT);
992 if (no == 2) return(XML_C14N_CREATE_STACK);
993 if (no == 3) return(XML_C14N_INVALID_NODE);
994 if (no == 4) return(XML_C14N_REQUIRES_UTF8);
995 return(0);
996}
997static void des_xmlParserErrors(int no ATTRIBUTE_UNUSED, xmlParserErrors val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
998}
999static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
1000}
1001
1002#define gen_nb_xmlParserInputState 4
1003static xmlParserInputState gen_xmlParserInputState(int no, int nr ATTRIBUTE_UNUSED) {
1004 if (no == 1) return(XML_PARSER_ATTRIBUTE_VALUE);
1005 if (no == 2) return(XML_PARSER_CDATA_SECTION);
1006 if (no == 3) return(XML_PARSER_COMMENT);
1007 if (no == 4) return(XML_PARSER_CONTENT);
1008 return(0);
1009}
1010static void des_xmlParserInputState(int no ATTRIBUTE_UNUSED, xmlParserInputState val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1011}
1012static void desret_xmlParserInputState(xmlParserInputState val ATTRIBUTE_UNUSED) {
1013}
1014
1015#define gen_nb_xmlParserMode 4
1016static xmlParserMode gen_xmlParserMode(int no, int nr ATTRIBUTE_UNUSED) {
1017 if (no == 1) return(XML_PARSE_DOM);
1018 if (no == 2) return(XML_PARSE_PUSH_DOM);
1019 if (no == 3) return(XML_PARSE_PUSH_SAX);
1020 if (no == 4) return(XML_PARSE_READER);
1021 return(0);
1022}
1023static void des_xmlParserMode(int no ATTRIBUTE_UNUSED, xmlParserMode val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1024}
1025static void desret_xmlParserMode(xmlParserMode val ATTRIBUTE_UNUSED) {
1026}
1027
1028#define gen_nb_xmlParserOption 4
1029static xmlParserOption gen_xmlParserOption(int no, int nr ATTRIBUTE_UNUSED) {
1030 if (no == 1) return(XML_PARSE_DTDATTR);
1031 if (no == 2) return(XML_PARSE_DTDLOAD);
1032 if (no == 3) return(XML_PARSE_DTDVALID);
1033 if (no == 4) return(XML_PARSE_NOBLANKS);
1034 return(0);
1035}
1036static void des_xmlParserOption(int no ATTRIBUTE_UNUSED, xmlParserOption val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1037}
1038static void desret_xmlParserOption(xmlParserOption val ATTRIBUTE_UNUSED) {
1039}
1040
1041#define gen_nb_xmlParserProperties 4
1042static xmlParserProperties gen_xmlParserProperties(int no, int nr ATTRIBUTE_UNUSED) {
1043 if (no == 1) return(XML_PARSER_DEFAULTATTRS);
1044 if (no == 2) return(XML_PARSER_LOADDTD);
1045 if (no == 3) return(XML_PARSER_SUBST_ENTITIES);
1046 if (no == 4) return(XML_PARSER_VALIDATE);
1047 return(0);
1048}
1049static void des_xmlParserProperties(int no ATTRIBUTE_UNUSED, xmlParserProperties val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1050}
1051static void desret_xmlParserProperties(xmlParserProperties val ATTRIBUTE_UNUSED) {
1052}
1053
1054#define gen_nb_xmlParserSeverities 4
1055static xmlParserSeverities gen_xmlParserSeverities(int no, int nr ATTRIBUTE_UNUSED) {
1056 if (no == 1) return(XML_PARSER_SEVERITY_ERROR);
1057 if (no == 2) return(XML_PARSER_SEVERITY_VALIDITY_ERROR);
1058 if (no == 3) return(XML_PARSER_SEVERITY_VALIDITY_WARNING);
1059 if (no == 4) return(XML_PARSER_SEVERITY_WARNING);
1060 return(0);
1061}
1062static void des_xmlParserSeverities(int no ATTRIBUTE_UNUSED, xmlParserSeverities val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1063}
1064static void desret_xmlParserSeverities(xmlParserSeverities val ATTRIBUTE_UNUSED) {
1065}
1066
1067#define gen_nb_xmlReaderTypes 4
1068static xmlReaderTypes gen_xmlReaderTypes(int no, int nr ATTRIBUTE_UNUSED) {
1069 if (no == 1) return(XML_READER_TYPE_ATTRIBUTE);
1070 if (no == 2) return(XML_READER_TYPE_CDATA);
1071 if (no == 3) return(XML_READER_TYPE_COMMENT);
1072 if (no == 4) return(XML_READER_TYPE_DOCUMENT);
1073 return(0);
1074}
1075static void des_xmlReaderTypes(int no ATTRIBUTE_UNUSED, xmlReaderTypes val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1076}
1077static void desret_xmlReaderTypes(xmlReaderTypes val ATTRIBUTE_UNUSED) {
1078}
1079
1080#define gen_nb_xmlRelaxNGParserFlag 3
1081static xmlRelaxNGParserFlag gen_xmlRelaxNGParserFlag(int no, int nr ATTRIBUTE_UNUSED) {
1082 if (no == 1) return(XML_RELAXNGP_CRNG);
1083 if (no == 2) return(XML_RELAXNGP_FREE_DOC);
1084 if (no == 3) return(XML_RELAXNGP_NONE);
1085 return(0);
1086}
1087static void des_xmlRelaxNGParserFlag(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserFlag val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1088}
1089static void desret_xmlRelaxNGParserFlag(xmlRelaxNGParserFlag val ATTRIBUTE_UNUSED) {
1090}
1091
1092#define gen_nb_xmlRelaxNGValidErr 4
1093static xmlRelaxNGValidErr gen_xmlRelaxNGValidErr(int no, int nr ATTRIBUTE_UNUSED) {
1094 if (no == 1) return(XML_RELAXNG_ERR_ATTREXTRANS);
1095 if (no == 2) return(XML_RELAXNG_ERR_ATTRNAME);
1096 if (no == 3) return(XML_RELAXNG_ERR_ATTRNONS);
1097 if (no == 4) return(XML_RELAXNG_ERR_ATTRVALID);
1098 return(0);
1099}
1100static void des_xmlRelaxNGValidErr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidErr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1101}
1102static void desret_xmlRelaxNGValidErr(xmlRelaxNGValidErr val ATTRIBUTE_UNUSED) {
1103}
1104
1105#define gen_nb_xmlSchemaContentType 4
1106static xmlSchemaContentType gen_xmlSchemaContentType(int no, int nr ATTRIBUTE_UNUSED) {
1107 if (no == 1) return(XML_SCHEMA_CONTENT_ANY);
1108 if (no == 2) return(XML_SCHEMA_CONTENT_BASIC);
1109 if (no == 3) return(XML_SCHEMA_CONTENT_ELEMENTS);
1110 if (no == 4) return(XML_SCHEMA_CONTENT_EMPTY);
1111 return(0);
1112}
1113static void des_xmlSchemaContentType(int no ATTRIBUTE_UNUSED, xmlSchemaContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1114}
1115static void desret_xmlSchemaContentType(xmlSchemaContentType val ATTRIBUTE_UNUSED) {
1116}
1117
1118#define gen_nb_xmlSchemaTypeType 4
1119static xmlSchemaTypeType gen_xmlSchemaTypeType(int no, int nr ATTRIBUTE_UNUSED) {
1120 if (no == 1) return(XML_SCHEMA_FACET_ENUMERATION);
1121 if (no == 2) return(XML_SCHEMA_FACET_FRACTIONDIGITS);
1122 if (no == 3) return(XML_SCHEMA_FACET_LENGTH);
1123 if (no == 4) return(XML_SCHEMA_FACET_MAXEXCLUSIVE);
1124 return(0);
1125}
1126static void des_xmlSchemaTypeType(int no ATTRIBUTE_UNUSED, xmlSchemaTypeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1127}
1128static void desret_xmlSchemaTypeType(xmlSchemaTypeType val ATTRIBUTE_UNUSED) {
1129}
1130
1131#define gen_nb_xmlSchemaValType 4
1132static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
1133 if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
1134 if (no == 2) return(XML_SCHEMAS_ANYTYPE);
1135 if (no == 3) return(XML_SCHEMAS_ANYURI);
1136 if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
1137 return(0);
1138}
1139static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1140}
1141static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
1142}
1143
1144#define gen_nb_xmlSchemaValidError 4
1145static xmlSchemaValidError gen_xmlSchemaValidError(int no, int nr ATTRIBUTE_UNUSED) {
1146 if (no == 1) return(XML_SCHEMAS_ERR_);
1147 if (no == 2) return(XML_SCHEMAS_ERR_ATTRINVALID);
1148 if (no == 3) return(XML_SCHEMAS_ERR_ATTRUNKNOWN);
1149 if (no == 4) return(XML_SCHEMAS_ERR_CONSTRUCT);
1150 return(0);
1151}
1152static void des_xmlSchemaValidError(int no ATTRIBUTE_UNUSED, xmlSchemaValidError val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1153}
1154static void desret_xmlSchemaValidError(xmlSchemaValidError val ATTRIBUTE_UNUSED) {
1155}
1156
1157#define gen_nb_xmlSchemaValidOption 1
1158static xmlSchemaValidOption gen_xmlSchemaValidOption(int no, int nr ATTRIBUTE_UNUSED) {
1159 if (no == 1) return(XML_SCHEMA_VAL_VC_I_CREATE);
1160 return(0);
1161}
1162static void des_xmlSchemaValidOption(int no ATTRIBUTE_UNUSED, xmlSchemaValidOption val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1163}
1164static void desret_xmlSchemaValidOption(xmlSchemaValidOption val ATTRIBUTE_UNUSED) {
1165}
1166
1167#define gen_nb_xmlTextReaderMode 4
1168static xmlTextReaderMode gen_xmlTextReaderMode(int no, int nr ATTRIBUTE_UNUSED) {
1169 if (no == 1) return(XML_TEXTREADER_MODE_CLOSED);
1170 if (no == 2) return(XML_TEXTREADER_MODE_EOF);
1171 if (no == 3) return(XML_TEXTREADER_MODE_ERROR);
1172 if (no == 4) return(XML_TEXTREADER_MODE_INITIAL);
1173 return(0);
1174}
1175static void des_xmlTextReaderMode(int no ATTRIBUTE_UNUSED, xmlTextReaderMode val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1176}
1177static void desret_xmlTextReaderMode(xmlTextReaderMode val ATTRIBUTE_UNUSED) {
1178}
1179
1180#define gen_nb_xmlXPathError 4
1181static xmlXPathError gen_xmlXPathError(int no, int nr ATTRIBUTE_UNUSED) {
1182 if (no == 1) return(XPATH_ENCODING_ERROR);
1183 if (no == 2) return(XPATH_EXPRESSION_OK);
1184 if (no == 3) return(XPATH_EXPR_ERROR);
1185 if (no == 4) return(XPATH_INVALID_ARITY);
1186 return(0);
1187}
1188static void des_xmlXPathError(int no ATTRIBUTE_UNUSED, xmlXPathError val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1189}
1190static void desret_xmlXPathError(xmlXPathError val ATTRIBUTE_UNUSED) {
1191}
1192
1193#define gen_nb_xmlXPathObjectType 4
1194static xmlXPathObjectType gen_xmlXPathObjectType(int no, int nr ATTRIBUTE_UNUSED) {
1195 if (no == 1) return(XPATH_BOOLEAN);
1196 if (no == 2) return(XPATH_LOCATIONSET);
1197 if (no == 3) return(XPATH_NODESET);
1198 if (no == 4) return(XPATH_NUMBER);
1199 return(0);
1200}
1201static void des_xmlXPathObjectType(int no ATTRIBUTE_UNUSED, xmlXPathObjectType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1202}
1203static void desret_xmlXPathObjectType(xmlXPathObjectType val ATTRIBUTE_UNUSED) {
1204}
1205
Daniel Veillard34099b42004-11-04 17:34:35 +00001206#include <libxml/HTMLparser.h>
1207#include <libxml/HTMLtree.h>
Daniel Veillard2a4fb5a2004-11-08 14:02:18 +00001208#include <libxml/SAX2.h>
Daniel Veillarda82b1822004-11-08 16:24:57 +00001209#include <libxml/c14n.h>
Daniel Veillard34099b42004-11-04 17:34:35 +00001210#include <libxml/catalog.h>
1211#include <libxml/chvalid.h>
Daniel Veillarda82b1822004-11-08 16:24:57 +00001212#include <libxml/debugXML.h>
Daniel Veillard34099b42004-11-04 17:34:35 +00001213#include <libxml/dict.h>
1214#include <libxml/encoding.h>
1215#include <libxml/entities.h>
1216#include <libxml/hash.h>
1217#include <libxml/list.h>
1218#include <libxml/nanoftp.h>
1219#include <libxml/nanohttp.h>
1220#include <libxml/parser.h>
Daniel Veillard2a4fb5a2004-11-08 14:02:18 +00001221#include <libxml/parserInternals.h>
Daniel Veillard34099b42004-11-04 17:34:35 +00001222#include <libxml/pattern.h>
1223#include <libxml/relaxng.h>
1224#include <libxml/schemasInternals.h>
1225#include <libxml/tree.h>
1226#include <libxml/uri.h>
1227#include <libxml/valid.h>
1228#include <libxml/xinclude.h>
1229#include <libxml/xmlIO.h>
Daniel Veillarda82b1822004-11-08 16:24:57 +00001230#include <libxml/xmlautomata.h>
Daniel Veillard34099b42004-11-04 17:34:35 +00001231#include <libxml/xmlerror.h>
1232#include <libxml/xmlreader.h>
Daniel Veillarda82b1822004-11-08 16:24:57 +00001233#include <libxml/xmlregexp.h>
Daniel Veillard34099b42004-11-04 17:34:35 +00001234#include <libxml/xmlsave.h>
1235#include <libxml/xmlschemas.h>
1236#include <libxml/xmlschemastypes.h>
1237#include <libxml/xmlstring.h>
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +00001238#include <libxml/xmlunicode.h>
Daniel Veillard34099b42004-11-04 17:34:35 +00001239#include <libxml/xmlwriter.h>
1240#include <libxml/xpath.h>
Daniel Veillarda82b1822004-11-08 16:24:57 +00001241#include <libxml/xpathInternals.h>
Daniel Veillard34099b42004-11-04 17:34:35 +00001242#include <libxml/xpointer.h>
1243static int test_HTMLparser(void);
1244static int test_HTMLtree(void);
Daniel Veillard2a4fb5a2004-11-08 14:02:18 +00001245static int test_SAX2(void);
Daniel Veillarda82b1822004-11-08 16:24:57 +00001246static int test_c14n(void);
Daniel Veillard34099b42004-11-04 17:34:35 +00001247static int test_catalog(void);
1248static int test_chvalid(void);
Daniel Veillarda82b1822004-11-08 16:24:57 +00001249static int test_debugXML(void);
Daniel Veillard34099b42004-11-04 17:34:35 +00001250static int test_dict(void);
1251static int test_encoding(void);
1252static int test_entities(void);
1253static int test_hash(void);
1254static int test_list(void);
1255static int test_nanoftp(void);
1256static int test_nanohttp(void);
1257static int test_parser(void);
Daniel Veillard2a4fb5a2004-11-08 14:02:18 +00001258static int test_parserInternals(void);
Daniel Veillard34099b42004-11-04 17:34:35 +00001259static int test_pattern(void);
1260static int test_relaxng(void);
1261static int test_schemasInternals(void);
1262static int test_tree(void);
1263static int test_uri(void);
1264static int test_valid(void);
1265static int test_xinclude(void);
1266static int test_xmlIO(void);
Daniel Veillarda82b1822004-11-08 16:24:57 +00001267static int test_xmlautomata(void);
Daniel Veillard34099b42004-11-04 17:34:35 +00001268static int test_xmlerror(void);
1269static int test_xmlreader(void);
Daniel Veillarda82b1822004-11-08 16:24:57 +00001270static int test_xmlregexp(void);
Daniel Veillard34099b42004-11-04 17:34:35 +00001271static int test_xmlsave(void);
1272static int test_xmlschemas(void);
1273static int test_xmlschemastypes(void);
1274static int test_xmlstring(void);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +00001275static int test_xmlunicode(void);
Daniel Veillard34099b42004-11-04 17:34:35 +00001276static int test_xmlwriter(void);
1277static int test_xpath(void);
Daniel Veillarda82b1822004-11-08 16:24:57 +00001278static int test_xpathInternals(void);
Daniel Veillard34099b42004-11-04 17:34:35 +00001279static int test_xpointer(void);
Daniel Veillardd93f6252004-11-02 15:53:51 +00001280
1281/**
1282 * testlibxml2:
1283 *
1284 * Main entry point of the tester for the full libxml2 module,
1285 * it calls all the tester entry point for each module.
1286 *
1287 * Returns the number of error found
1288 */
1289static int
1290testlibxml2(void)
1291{
Daniel Veillard42595322004-11-08 10:52:06 +00001292 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001293
Daniel Veillard42595322004-11-08 10:52:06 +00001294 test_ret += test_HTMLparser();
1295 test_ret += test_HTMLtree();
Daniel Veillard2a4fb5a2004-11-08 14:02:18 +00001296 test_ret += test_SAX2();
Daniel Veillarda82b1822004-11-08 16:24:57 +00001297 test_ret += test_c14n();
Daniel Veillard42595322004-11-08 10:52:06 +00001298 test_ret += test_catalog();
1299 test_ret += test_chvalid();
Daniel Veillarda82b1822004-11-08 16:24:57 +00001300 test_ret += test_debugXML();
Daniel Veillard42595322004-11-08 10:52:06 +00001301 test_ret += test_dict();
1302 test_ret += test_encoding();
1303 test_ret += test_entities();
1304 test_ret += test_hash();
1305 test_ret += test_list();
1306 test_ret += test_nanoftp();
1307 test_ret += test_nanohttp();
1308 test_ret += test_parser();
Daniel Veillard2a4fb5a2004-11-08 14:02:18 +00001309 test_ret += test_parserInternals();
Daniel Veillard42595322004-11-08 10:52:06 +00001310 test_ret += test_pattern();
1311 test_ret += test_relaxng();
1312 test_ret += test_schemasInternals();
1313 test_ret += test_tree();
1314 test_ret += test_uri();
1315 test_ret += test_valid();
1316 test_ret += test_xinclude();
1317 test_ret += test_xmlIO();
Daniel Veillarda82b1822004-11-08 16:24:57 +00001318 test_ret += test_xmlautomata();
Daniel Veillard42595322004-11-08 10:52:06 +00001319 test_ret += test_xmlerror();
1320 test_ret += test_xmlreader();
Daniel Veillarda82b1822004-11-08 16:24:57 +00001321 test_ret += test_xmlregexp();
Daniel Veillard42595322004-11-08 10:52:06 +00001322 test_ret += test_xmlsave();
1323 test_ret += test_xmlschemas();
1324 test_ret += test_xmlschemastypes();
1325 test_ret += test_xmlstring();
1326 test_ret += test_xmlunicode();
1327 test_ret += test_xmlwriter();
1328 test_ret += test_xpath();
Daniel Veillarda82b1822004-11-08 16:24:57 +00001329 test_ret += test_xpathInternals();
Daniel Veillard42595322004-11-08 10:52:06 +00001330 test_ret += test_xpointer();
Daniel Veillardd93f6252004-11-02 15:53:51 +00001331
Daniel Veillard3d97e662004-11-04 10:49:00 +00001332 printf("Total: %d functions, %d tests, %d errors\n",
Daniel Veillard42595322004-11-08 10:52:06 +00001333 function_tests, call_tests, test_ret);
1334 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00001335}
1336
1337
Daniel Veillardce682bc2004-11-05 17:22:25 +00001338#define gen_nb_unsigned_char_ptr 1
1339static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1340 return(NULL);
1341}
1342static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1343}
1344
1345#define gen_nb_const_unsigned_char_ptr 1
1346static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1347 return(NULL);
1348}
1349static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1350}
1351
Daniel Veillardd93f6252004-11-02 15:53:51 +00001352static int
1353test_UTF8ToHtml(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00001354 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001355
Daniel Veillardce682bc2004-11-05 17:22:25 +00001356#ifdef LIBXML_HTML_ENABLED
1357 int mem_base;
1358 int ret_val;
1359 unsigned char * out; /* a pointer to an array of bytes to store the result */
1360 int n_out;
1361 int * outlen; /* the length of @out */
1362 int n_outlen;
1363 unsigned char * in; /* a pointer to an array of UTF-8 chars */
1364 int n_in;
1365 int * inlen; /* the length of @in */
1366 int n_inlen;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001367
Daniel Veillardce682bc2004-11-05 17:22:25 +00001368 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1369 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1370 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1371 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1372 mem_base = xmlMemBlocks();
1373 out = gen_unsigned_char_ptr(n_out, 0);
1374 outlen = gen_int_ptr(n_outlen, 1);
1375 in = gen_const_unsigned_char_ptr(n_in, 2);
1376 inlen = gen_int_ptr(n_inlen, 3);
1377
1378 ret_val = UTF8ToHtml(out, outlen, in, inlen);
1379 desret_int(ret_val);
1380 call_tests++;
1381 des_unsigned_char_ptr(n_out, out, 0);
1382 des_int_ptr(n_outlen, outlen, 1);
1383 des_const_unsigned_char_ptr(n_in, in, 2);
1384 des_int_ptr(n_inlen, inlen, 3);
1385 xmlResetLastError();
1386 if (mem_base != xmlMemBlocks()) {
1387 printf("Leak of %d blocks found in UTF8ToHtml",
1388 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00001389 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00001390 printf(" %d", n_out);
1391 printf(" %d", n_outlen);
1392 printf(" %d", n_in);
1393 printf(" %d", n_inlen);
1394 printf("\n");
1395 }
1396 }
1397 }
1398 }
1399 }
1400#endif
1401
1402 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00001403 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00001404}
1405
1406
Daniel Veillardce682bc2004-11-05 17:22:25 +00001407#define gen_nb_const_htmlElemDesc_ptr 1
1408static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1409 return(NULL);
1410}
1411static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1412}
1413
Daniel Veillardd93f6252004-11-02 15:53:51 +00001414static int
1415test_htmlAttrAllowed(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00001416 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001417
Daniel Veillard57b25162004-11-06 14:50:18 +00001418#ifdef LIBXML_HTML_ENABLED
1419 int mem_base;
1420 htmlStatus ret_val;
1421 htmlElemDesc * elt; /* HTML element */
1422 int n_elt;
1423 xmlChar * attr; /* HTML attribute */
1424 int n_attr;
1425 int legacy; /* whether to allow deprecated attributes */
1426 int n_legacy;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001427
Daniel Veillard57b25162004-11-06 14:50:18 +00001428 for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1429 for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
1430 for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
1431 mem_base = xmlMemBlocks();
1432 elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
1433 attr = gen_const_xmlChar_ptr(n_attr, 1);
1434 legacy = gen_int(n_legacy, 2);
1435
1436 ret_val = htmlAttrAllowed(elt, attr, legacy);
1437 desret_htmlStatus(ret_val);
1438 call_tests++;
1439 des_const_htmlElemDesc_ptr(n_elt, elt, 0);
1440 des_const_xmlChar_ptr(n_attr, attr, 1);
1441 des_int(n_legacy, legacy, 2);
1442 xmlResetLastError();
1443 if (mem_base != xmlMemBlocks()) {
1444 printf("Leak of %d blocks found in htmlAttrAllowed",
1445 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00001446 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +00001447 printf(" %d", n_elt);
1448 printf(" %d", n_attr);
1449 printf(" %d", n_legacy);
1450 printf("\n");
1451 }
1452 }
1453 }
1454 }
1455#endif
1456
1457 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00001458 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00001459}
1460
1461
1462static int
1463test_htmlAutoCloseTag(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00001464 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001465
Daniel Veillarda03e3652004-11-02 18:45:30 +00001466#ifdef LIBXML_HTML_ENABLED
1467 int mem_base;
1468 int ret_val;
1469 htmlDocPtr doc; /* the HTML document */
1470 int n_doc;
Daniel Veillardce682bc2004-11-05 17:22:25 +00001471 xmlChar * name; /* The tag name */
Daniel Veillarda03e3652004-11-02 18:45:30 +00001472 int n_name;
1473 htmlNodePtr elem; /* the HTML element */
1474 int n_elem;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001475
Daniel Veillarda03e3652004-11-02 18:45:30 +00001476 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
1477 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1478 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
1479 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00001480 doc = gen_xmlDocPtr(n_doc, 0);
1481 name = gen_const_xmlChar_ptr(n_name, 1);
1482 elem = gen_xmlNodePtr(n_elem, 2);
Daniel Veillarda03e3652004-11-02 18:45:30 +00001483
1484 ret_val = htmlAutoCloseTag(doc, name, elem);
1485 desret_int(ret_val);
1486 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00001487 des_xmlDocPtr(n_doc, doc, 0);
1488 des_const_xmlChar_ptr(n_name, name, 1);
1489 des_xmlNodePtr(n_elem, elem, 2);
Daniel Veillarda03e3652004-11-02 18:45:30 +00001490 xmlResetLastError();
1491 if (mem_base != xmlMemBlocks()) {
1492 printf("Leak of %d blocks found in htmlAutoCloseTag",
1493 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00001494 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00001495 printf(" %d", n_doc);
1496 printf(" %d", n_name);
1497 printf(" %d", n_elem);
1498 printf("\n");
1499 }
1500 }
1501 }
1502 }
1503#endif
1504
Daniel Veillard3d97e662004-11-04 10:49:00 +00001505 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00001506 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00001507}
1508
1509
1510static int
1511test_htmlCreateMemoryParserCtxt(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00001512 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001513
Daniel Veillard34099b42004-11-04 17:34:35 +00001514#ifdef LIBXML_HTML_ENABLED
1515 int mem_base;
1516 htmlParserCtxtPtr ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +00001517 char * buffer; /* a pointer to a char array */
Daniel Veillard34099b42004-11-04 17:34:35 +00001518 int n_buffer;
1519 int size; /* the size of the array */
1520 int n_size;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001521
Daniel Veillard34099b42004-11-04 17:34:35 +00001522 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1523 for (n_size = 0;n_size < gen_nb_int;n_size++) {
1524 mem_base = xmlMemBlocks();
1525 buffer = gen_const_char_ptr(n_buffer, 0);
1526 size = gen_int(n_size, 1);
1527
1528 ret_val = htmlCreateMemoryParserCtxt(buffer, size);
1529 desret_xmlParserCtxtPtr(ret_val);
1530 call_tests++;
1531 des_const_char_ptr(n_buffer, buffer, 0);
1532 des_int(n_size, size, 1);
1533 xmlResetLastError();
1534 if (mem_base != xmlMemBlocks()) {
1535 printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1536 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00001537 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +00001538 printf(" %d", n_buffer);
1539 printf(" %d", n_size);
1540 printf("\n");
1541 }
1542 }
1543 }
1544#endif
1545
1546 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00001547 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00001548}
1549
1550
Daniel Veillardce682bc2004-11-05 17:22:25 +00001551#define gen_nb_htmlSAXHandlerPtr 1
1552static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1553 return(NULL);
1554}
1555static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1556}
1557
Daniel Veillardd93f6252004-11-02 15:53:51 +00001558static int
1559test_htmlCreatePushParserCtxt(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00001560 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001561
Daniel Veillardce682bc2004-11-05 17:22:25 +00001562#ifdef LIBXML_HTML_ENABLED
1563#ifdef LIBXML_PUSH_ENABLED
1564 int mem_base;
1565 htmlParserCtxtPtr ret_val;
1566 htmlSAXHandlerPtr sax; /* a SAX handler */
1567 int n_sax;
1568 void * user_data; /* The user data returned on SAX callbacks */
1569 int n_user_data;
1570 char * chunk; /* a pointer to an array of chars */
1571 int n_chunk;
1572 int size; /* number of chars in the array */
1573 int n_size;
1574 const char * filename; /* an optional file name or URI */
1575 int n_filename;
1576 xmlCharEncoding enc; /* an optional encoding */
1577 int n_enc;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001578
Daniel Veillardce682bc2004-11-05 17:22:25 +00001579 for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1580 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1581 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1582 for (n_size = 0;n_size < gen_nb_int;n_size++) {
Daniel Veillard42595322004-11-08 10:52:06 +00001583 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
Daniel Veillardce682bc2004-11-05 17:22:25 +00001584 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1585 mem_base = xmlMemBlocks();
1586 sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1587 user_data = gen_userdata(n_user_data, 1);
1588 chunk = gen_const_char_ptr(n_chunk, 2);
1589 size = gen_int(n_size, 3);
Daniel Veillard42595322004-11-08 10:52:06 +00001590 filename = gen_fileoutput(n_filename, 4);
Daniel Veillardce682bc2004-11-05 17:22:25 +00001591 enc = gen_xmlCharEncoding(n_enc, 5);
1592
1593 ret_val = htmlCreatePushParserCtxt(sax, user_data, chunk, size, filename, enc);
1594 desret_xmlParserCtxtPtr(ret_val);
1595 call_tests++;
1596 des_htmlSAXHandlerPtr(n_sax, sax, 0);
1597 des_userdata(n_user_data, user_data, 1);
1598 des_const_char_ptr(n_chunk, chunk, 2);
1599 des_int(n_size, size, 3);
Daniel Veillard42595322004-11-08 10:52:06 +00001600 des_fileoutput(n_filename, filename, 4);
Daniel Veillardce682bc2004-11-05 17:22:25 +00001601 des_xmlCharEncoding(n_enc, enc, 5);
1602 xmlResetLastError();
1603 if (mem_base != xmlMemBlocks()) {
1604 printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1605 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00001606 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00001607 printf(" %d", n_sax);
1608 printf(" %d", n_user_data);
1609 printf(" %d", n_chunk);
1610 printf(" %d", n_size);
1611 printf(" %d", n_filename);
1612 printf(" %d", n_enc);
1613 printf("\n");
1614 }
1615 }
1616 }
1617 }
1618 }
1619 }
1620 }
1621#endif
1622#endif
1623
1624 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00001625 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00001626}
1627
1628
1629static int
1630test_htmlCtxtReadDoc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00001631 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001632
Daniel Veillarda03e3652004-11-02 18:45:30 +00001633#ifdef LIBXML_HTML_ENABLED
1634 int mem_base;
1635 htmlDocPtr ret_val;
1636 htmlParserCtxtPtr ctxt; /* an HTML parser context */
1637 int n_ctxt;
Daniel Veillardce682bc2004-11-05 17:22:25 +00001638 xmlChar * cur; /* a pointer to a zero terminated string */
Daniel Veillarda03e3652004-11-02 18:45:30 +00001639 int n_cur;
1640 const char * URL; /* the base URL to use for the document */
1641 int n_URL;
Daniel Veillardce682bc2004-11-05 17:22:25 +00001642 char * encoding; /* the document encoding, or NULL */
Daniel Veillarda03e3652004-11-02 18:45:30 +00001643 int n_encoding;
1644 int options; /* a combination of htmlParserOption(s) */
1645 int n_options;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001646
Daniel Veillarda03e3652004-11-02 18:45:30 +00001647 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
1648 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1649 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1650 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1651 for (n_options = 0;n_options < gen_nb_int;n_options++) {
1652 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00001653 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
1654 cur = gen_const_xmlChar_ptr(n_cur, 1);
1655 URL = gen_filepath(n_URL, 2);
1656 encoding = gen_const_char_ptr(n_encoding, 3);
1657 options = gen_int(n_options, 4);
Daniel Veillardd93f6252004-11-02 15:53:51 +00001658
Daniel Veillarda03e3652004-11-02 18:45:30 +00001659 ret_val = htmlCtxtReadDoc(ctxt, cur, URL, encoding, options);
1660 desret_xmlDocPtr(ret_val);
1661 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00001662 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
1663 des_const_xmlChar_ptr(n_cur, cur, 1);
1664 des_filepath(n_URL, URL, 2);
1665 des_const_char_ptr(n_encoding, encoding, 3);
1666 des_int(n_options, options, 4);
Daniel Veillarda03e3652004-11-02 18:45:30 +00001667 xmlResetLastError();
1668 if (mem_base != xmlMemBlocks()) {
1669 printf("Leak of %d blocks found in htmlCtxtReadDoc",
1670 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00001671 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00001672 printf(" %d", n_ctxt);
1673 printf(" %d", n_cur);
1674 printf(" %d", n_URL);
1675 printf(" %d", n_encoding);
1676 printf(" %d", n_options);
1677 printf("\n");
1678 }
1679 }
1680 }
1681 }
1682 }
1683 }
1684#endif
Daniel Veillardd93f6252004-11-02 15:53:51 +00001685
Daniel Veillard3d97e662004-11-04 10:49:00 +00001686 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00001687 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00001688}
1689
1690
1691static int
1692test_htmlCtxtReadFile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00001693 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001694
Daniel Veillarda03e3652004-11-02 18:45:30 +00001695#ifdef LIBXML_HTML_ENABLED
1696 int mem_base;
1697 htmlDocPtr ret_val;
1698 htmlParserCtxtPtr ctxt; /* an HTML parser context */
1699 int n_ctxt;
1700 const char * filename; /* a file or URL */
1701 int n_filename;
Daniel Veillardce682bc2004-11-05 17:22:25 +00001702 char * encoding; /* the document encoding, or NULL */
Daniel Veillarda03e3652004-11-02 18:45:30 +00001703 int n_encoding;
1704 int options; /* a combination of htmlParserOption(s) */
1705 int n_options;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001706
Daniel Veillarda03e3652004-11-02 18:45:30 +00001707 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
1708 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1709 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1710 for (n_options = 0;n_options < gen_nb_int;n_options++) {
1711 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00001712 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
1713 filename = gen_filepath(n_filename, 1);
1714 encoding = gen_const_char_ptr(n_encoding, 2);
1715 options = gen_int(n_options, 3);
Daniel Veillarda03e3652004-11-02 18:45:30 +00001716
1717 ret_val = htmlCtxtReadFile(ctxt, filename, encoding, options);
1718 desret_xmlDocPtr(ret_val);
1719 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00001720 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
1721 des_filepath(n_filename, filename, 1);
1722 des_const_char_ptr(n_encoding, encoding, 2);
1723 des_int(n_options, options, 3);
Daniel Veillarda03e3652004-11-02 18:45:30 +00001724 xmlResetLastError();
1725 if (mem_base != xmlMemBlocks()) {
1726 printf("Leak of %d blocks found in htmlCtxtReadFile",
1727 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00001728 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00001729 printf(" %d", n_ctxt);
1730 printf(" %d", n_filename);
1731 printf(" %d", n_encoding);
1732 printf(" %d", n_options);
1733 printf("\n");
1734 }
1735 }
1736 }
1737 }
1738 }
1739#endif
1740
Daniel Veillard3d97e662004-11-04 10:49:00 +00001741 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00001742 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00001743}
1744
1745
1746static int
Daniel Veillardd93f6252004-11-02 15:53:51 +00001747test_htmlCtxtReadMemory(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00001748 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001749
Daniel Veillarda03e3652004-11-02 18:45:30 +00001750#ifdef LIBXML_HTML_ENABLED
1751 int mem_base;
1752 htmlDocPtr ret_val;
1753 htmlParserCtxtPtr ctxt; /* an HTML parser context */
1754 int n_ctxt;
Daniel Veillardce682bc2004-11-05 17:22:25 +00001755 char * buffer; /* a pointer to a char array */
Daniel Veillarda03e3652004-11-02 18:45:30 +00001756 int n_buffer;
1757 int size; /* the size of the array */
1758 int n_size;
1759 const char * URL; /* the base URL to use for the document */
1760 int n_URL;
Daniel Veillardce682bc2004-11-05 17:22:25 +00001761 char * encoding; /* the document encoding, or NULL */
Daniel Veillarda03e3652004-11-02 18:45:30 +00001762 int n_encoding;
1763 int options; /* a combination of htmlParserOption(s) */
1764 int n_options;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001765
Daniel Veillarda03e3652004-11-02 18:45:30 +00001766 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
1767 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1768 for (n_size = 0;n_size < gen_nb_int;n_size++) {
1769 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1770 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1771 for (n_options = 0;n_options < gen_nb_int;n_options++) {
1772 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00001773 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
1774 buffer = gen_const_char_ptr(n_buffer, 1);
1775 size = gen_int(n_size, 2);
1776 URL = gen_filepath(n_URL, 3);
1777 encoding = gen_const_char_ptr(n_encoding, 4);
1778 options = gen_int(n_options, 5);
Daniel Veillarda03e3652004-11-02 18:45:30 +00001779
1780 ret_val = htmlCtxtReadMemory(ctxt, buffer, size, URL, encoding, options);
1781 desret_xmlDocPtr(ret_val);
1782 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00001783 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
1784 des_const_char_ptr(n_buffer, buffer, 1);
1785 des_int(n_size, size, 2);
1786 des_filepath(n_URL, URL, 3);
1787 des_const_char_ptr(n_encoding, encoding, 4);
1788 des_int(n_options, options, 5);
Daniel Veillarda03e3652004-11-02 18:45:30 +00001789 xmlResetLastError();
1790 if (mem_base != xmlMemBlocks()) {
1791 printf("Leak of %d blocks found in htmlCtxtReadMemory",
1792 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00001793 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00001794 printf(" %d", n_ctxt);
1795 printf(" %d", n_buffer);
1796 printf(" %d", n_size);
1797 printf(" %d", n_URL);
1798 printf(" %d", n_encoding);
1799 printf(" %d", n_options);
1800 printf("\n");
1801 }
1802 }
1803 }
1804 }
1805 }
1806 }
1807 }
1808#endif
1809
Daniel Veillard3d97e662004-11-04 10:49:00 +00001810 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00001811 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00001812}
1813
1814
1815static int
1816test_htmlCtxtReset(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00001817 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001818
Daniel Veillarda03e3652004-11-02 18:45:30 +00001819#ifdef LIBXML_HTML_ENABLED
1820 int mem_base;
1821 htmlParserCtxtPtr ctxt; /* an HTML parser context */
1822 int n_ctxt;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001823
Daniel Veillarda03e3652004-11-02 18:45:30 +00001824 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
1825 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00001826 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
Daniel Veillarda03e3652004-11-02 18:45:30 +00001827
1828 htmlCtxtReset(ctxt);
1829 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00001830 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
Daniel Veillarda03e3652004-11-02 18:45:30 +00001831 xmlResetLastError();
1832 if (mem_base != xmlMemBlocks()) {
1833 printf("Leak of %d blocks found in htmlCtxtReset",
1834 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00001835 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00001836 printf(" %d", n_ctxt);
1837 printf("\n");
1838 }
1839 }
1840#endif
1841
Daniel Veillard3d97e662004-11-04 10:49:00 +00001842 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00001843 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00001844}
1845
1846
1847static int
1848test_htmlCtxtUseOptions(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00001849 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001850
Daniel Veillarda03e3652004-11-02 18:45:30 +00001851#ifdef LIBXML_HTML_ENABLED
1852 int mem_base;
1853 int ret_val;
1854 htmlParserCtxtPtr ctxt; /* an HTML parser context */
1855 int n_ctxt;
1856 int options; /* a combination of htmlParserOption(s) */
1857 int n_options;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001858
Daniel Veillarda03e3652004-11-02 18:45:30 +00001859 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
1860 for (n_options = 0;n_options < gen_nb_int;n_options++) {
1861 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00001862 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
1863 options = gen_int(n_options, 1);
Daniel Veillarda03e3652004-11-02 18:45:30 +00001864
1865 ret_val = htmlCtxtUseOptions(ctxt, options);
1866 desret_int(ret_val);
1867 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00001868 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
1869 des_int(n_options, options, 1);
Daniel Veillarda03e3652004-11-02 18:45:30 +00001870 xmlResetLastError();
1871 if (mem_base != xmlMemBlocks()) {
1872 printf("Leak of %d blocks found in htmlCtxtUseOptions",
1873 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00001874 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00001875 printf(" %d", n_ctxt);
1876 printf(" %d", n_options);
1877 printf("\n");
1878 }
1879 }
1880 }
1881#endif
1882
Daniel Veillard3d97e662004-11-04 10:49:00 +00001883 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00001884 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00001885}
1886
1887
1888static int
1889test_htmlElementAllowedHere(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00001890 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001891
Daniel Veillardce682bc2004-11-05 17:22:25 +00001892#ifdef LIBXML_HTML_ENABLED
1893 int mem_base;
1894 int ret_val;
1895 htmlElemDesc * parent; /* HTML parent element */
1896 int n_parent;
1897 xmlChar * elt; /* HTML element */
1898 int n_elt;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001899
Daniel Veillardce682bc2004-11-05 17:22:25 +00001900 for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1901 for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1902 mem_base = xmlMemBlocks();
1903 parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1904 elt = gen_const_xmlChar_ptr(n_elt, 1);
1905
1906 ret_val = htmlElementAllowedHere(parent, elt);
1907 desret_int(ret_val);
1908 call_tests++;
1909 des_const_htmlElemDesc_ptr(n_parent, parent, 0);
1910 des_const_xmlChar_ptr(n_elt, elt, 1);
1911 xmlResetLastError();
1912 if (mem_base != xmlMemBlocks()) {
1913 printf("Leak of %d blocks found in htmlElementAllowedHere",
1914 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00001915 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00001916 printf(" %d", n_parent);
1917 printf(" %d", n_elt);
1918 printf("\n");
1919 }
1920 }
1921 }
1922#endif
1923
1924 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00001925 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00001926}
1927
1928
1929static int
1930test_htmlElementStatusHere(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00001931 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001932
Daniel Veillard57b25162004-11-06 14:50:18 +00001933#ifdef LIBXML_HTML_ENABLED
1934 int mem_base;
1935 htmlStatus ret_val;
1936 htmlElemDesc * parent; /* HTML parent element */
1937 int n_parent;
1938 htmlElemDesc * elt; /* HTML element */
1939 int n_elt;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001940
Daniel Veillard57b25162004-11-06 14:50:18 +00001941 for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1942 for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1943 mem_base = xmlMemBlocks();
1944 parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1945 elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1946
1947 ret_val = htmlElementStatusHere(parent, elt);
1948 desret_htmlStatus(ret_val);
1949 call_tests++;
1950 des_const_htmlElemDesc_ptr(n_parent, parent, 0);
1951 des_const_htmlElemDesc_ptr(n_elt, elt, 1);
1952 xmlResetLastError();
1953 if (mem_base != xmlMemBlocks()) {
1954 printf("Leak of %d blocks found in htmlElementStatusHere",
1955 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00001956 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +00001957 printf(" %d", n_parent);
1958 printf(" %d", n_elt);
1959 printf("\n");
1960 }
1961 }
1962 }
1963#endif
1964
1965 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00001966 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00001967}
1968
1969
1970static int
1971test_htmlEncodeEntities(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00001972 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001973
Daniel Veillardce682bc2004-11-05 17:22:25 +00001974#ifdef LIBXML_HTML_ENABLED
1975 int mem_base;
1976 int ret_val;
1977 unsigned char * out; /* a pointer to an array of bytes to store the result */
1978 int n_out;
1979 int * outlen; /* the length of @out */
1980 int n_outlen;
1981 unsigned char * in; /* a pointer to an array of UTF-8 chars */
1982 int n_in;
1983 int * inlen; /* the length of @in */
1984 int n_inlen;
1985 int quoteChar; /* the quote character to escape (' or ") or zero. */
1986 int n_quoteChar;
Daniel Veillardd93f6252004-11-02 15:53:51 +00001987
Daniel Veillardce682bc2004-11-05 17:22:25 +00001988 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1989 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1990 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1991 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1992 for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1993 mem_base = xmlMemBlocks();
1994 out = gen_unsigned_char_ptr(n_out, 0);
1995 outlen = gen_int_ptr(n_outlen, 1);
1996 in = gen_const_unsigned_char_ptr(n_in, 2);
1997 inlen = gen_int_ptr(n_inlen, 3);
1998 quoteChar = gen_int(n_quoteChar, 4);
1999
2000 ret_val = htmlEncodeEntities(out, outlen, in, inlen, quoteChar);
2001 desret_int(ret_val);
2002 call_tests++;
2003 des_unsigned_char_ptr(n_out, out, 0);
2004 des_int_ptr(n_outlen, outlen, 1);
2005 des_const_unsigned_char_ptr(n_in, in, 2);
2006 des_int_ptr(n_inlen, inlen, 3);
2007 des_int(n_quoteChar, quoteChar, 4);
2008 xmlResetLastError();
2009 if (mem_base != xmlMemBlocks()) {
2010 printf("Leak of %d blocks found in htmlEncodeEntities",
2011 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00002012 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00002013 printf(" %d", n_out);
2014 printf(" %d", n_outlen);
2015 printf(" %d", n_in);
2016 printf(" %d", n_inlen);
2017 printf(" %d", n_quoteChar);
2018 printf("\n");
2019 }
2020 }
2021 }
2022 }
2023 }
2024 }
2025#endif
2026
2027 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00002028 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002029}
2030
2031
2032static int
2033test_htmlEntityLookup(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002034 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002035
Daniel Veillard42595322004-11-08 10:52:06 +00002036#ifdef LIBXML_HTML_ENABLED
2037 int mem_base;
2038 const htmlEntityDesc * ret_val;
2039 xmlChar * name; /* the entity name */
2040 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002041
Daniel Veillard42595322004-11-08 10:52:06 +00002042 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2043 mem_base = xmlMemBlocks();
2044 name = gen_const_xmlChar_ptr(n_name, 0);
2045
2046 ret_val = htmlEntityLookup(name);
2047 desret_const_htmlEntityDesc_ptr(ret_val);
2048 call_tests++;
2049 des_const_xmlChar_ptr(n_name, name, 0);
2050 xmlResetLastError();
2051 if (mem_base != xmlMemBlocks()) {
2052 printf("Leak of %d blocks found in htmlEntityLookup",
2053 xmlMemBlocks() - mem_base);
2054 test_ret++;
2055 printf(" %d", n_name);
2056 printf("\n");
2057 }
2058 }
2059#endif
2060
2061 function_tests++;
2062 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002063}
2064
2065
2066static int
2067test_htmlEntityValueLookup(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002068 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002069
Daniel Veillard42595322004-11-08 10:52:06 +00002070#ifdef LIBXML_HTML_ENABLED
2071 int mem_base;
2072 const htmlEntityDesc * ret_val;
2073 unsigned int value; /* the entity's unicode value */
2074 int n_value;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002075
Daniel Veillard42595322004-11-08 10:52:06 +00002076 for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
2077 mem_base = xmlMemBlocks();
2078 value = gen_unsigned_int(n_value, 0);
2079
2080 ret_val = htmlEntityValueLookup(value);
2081 desret_const_htmlEntityDesc_ptr(ret_val);
2082 call_tests++;
2083 des_unsigned_int(n_value, value, 0);
2084 xmlResetLastError();
2085 if (mem_base != xmlMemBlocks()) {
2086 printf("Leak of %d blocks found in htmlEntityValueLookup",
2087 xmlMemBlocks() - mem_base);
2088 test_ret++;
2089 printf(" %d", n_value);
2090 printf("\n");
2091 }
2092 }
2093#endif
2094
2095 function_tests++;
2096 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002097}
2098
2099
2100static int
2101test_htmlHandleOmittedElem(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002102 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002103
2104#ifdef LIBXML_HTML_ENABLED
2105 int mem_base;
2106 int ret_val;
2107 int val; /* int 0 or 1 */
2108 int n_val;
2109
2110 for (n_val = 0;n_val < gen_nb_int;n_val++) {
2111 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00002112 val = gen_int(n_val, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002113
2114 ret_val = htmlHandleOmittedElem(val);
2115 desret_int(ret_val);
2116 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00002117 des_int(n_val, val, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002118 xmlResetLastError();
2119 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +00002120 printf("Leak of %d blocks found in htmlHandleOmittedElem",
Daniel Veillardd93f6252004-11-02 15:53:51 +00002121 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00002122 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00002123 printf(" %d", n_val);
2124 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +00002125 }
2126 }
2127#endif
2128
Daniel Veillard3d97e662004-11-04 10:49:00 +00002129 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00002130 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002131}
2132
2133
2134static int
2135test_htmlIsAutoClosed(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002136 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002137
Daniel Veillarda03e3652004-11-02 18:45:30 +00002138#ifdef LIBXML_HTML_ENABLED
2139 int mem_base;
2140 int ret_val;
2141 htmlDocPtr doc; /* the HTML document */
2142 int n_doc;
2143 htmlNodePtr elem; /* the HTML element */
2144 int n_elem;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002145
Daniel Veillarda03e3652004-11-02 18:45:30 +00002146 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
2147 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
2148 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00002149 doc = gen_xmlDocPtr(n_doc, 0);
2150 elem = gen_xmlNodePtr(n_elem, 1);
Daniel Veillarda03e3652004-11-02 18:45:30 +00002151
2152 ret_val = htmlIsAutoClosed(doc, elem);
2153 desret_int(ret_val);
2154 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00002155 des_xmlDocPtr(n_doc, doc, 0);
2156 des_xmlNodePtr(n_elem, elem, 1);
Daniel Veillarda03e3652004-11-02 18:45:30 +00002157 xmlResetLastError();
2158 if (mem_base != xmlMemBlocks()) {
2159 printf("Leak of %d blocks found in htmlIsAutoClosed",
2160 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00002161 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00002162 printf(" %d", n_doc);
2163 printf(" %d", n_elem);
2164 printf("\n");
2165 }
2166 }
2167 }
2168#endif
2169
Daniel Veillard3d97e662004-11-04 10:49:00 +00002170 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00002171 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002172}
2173
2174
2175static int
2176test_htmlIsScriptAttribute(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002177 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002178
2179#ifdef LIBXML_HTML_ENABLED
2180 int mem_base;
2181 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +00002182 xmlChar * name; /* an attribute name */
Daniel Veillardd93f6252004-11-02 15:53:51 +00002183 int n_name;
2184
2185 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2186 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00002187 name = gen_const_xmlChar_ptr(n_name, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002188
2189 ret_val = htmlIsScriptAttribute(name);
2190 desret_int(ret_val);
2191 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00002192 des_const_xmlChar_ptr(n_name, name, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002193 xmlResetLastError();
2194 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +00002195 printf("Leak of %d blocks found in htmlIsScriptAttribute",
Daniel Veillardd93f6252004-11-02 15:53:51 +00002196 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00002197 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00002198 printf(" %d", n_name);
2199 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +00002200 }
2201 }
2202#endif
2203
Daniel Veillard3d97e662004-11-04 10:49:00 +00002204 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00002205 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002206}
2207
2208
Daniel Veillardce682bc2004-11-05 17:22:25 +00002209#define gen_nb_const_xmlNodePtr 1
2210static htmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2211 return(NULL);
2212}
2213static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2214}
2215
Daniel Veillardd93f6252004-11-02 15:53:51 +00002216static int
2217test_htmlNodeStatus(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002218 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002219
Daniel Veillard57b25162004-11-06 14:50:18 +00002220#ifdef LIBXML_HTML_ENABLED
2221 int mem_base;
2222 htmlStatus ret_val;
2223 htmlNodePtr node; /* an htmlNodePtr in a tree */
2224 int n_node;
2225 int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2226 int n_legacy;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002227
Daniel Veillard57b25162004-11-06 14:50:18 +00002228 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
2229 for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2230 mem_base = xmlMemBlocks();
2231 node = gen_const_xmlNodePtr(n_node, 0);
2232 legacy = gen_int(n_legacy, 1);
2233
2234 ret_val = htmlNodeStatus(node, legacy);
2235 desret_htmlStatus(ret_val);
2236 call_tests++;
2237 des_const_xmlNodePtr(n_node, node, 0);
2238 des_int(n_legacy, legacy, 1);
2239 xmlResetLastError();
2240 if (mem_base != xmlMemBlocks()) {
2241 printf("Leak of %d blocks found in htmlNodeStatus",
2242 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00002243 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +00002244 printf(" %d", n_node);
2245 printf(" %d", n_legacy);
2246 printf("\n");
2247 }
2248 }
2249 }
2250#endif
2251
2252 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00002253 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002254}
2255
2256
2257static int
2258test_htmlParseCharRef(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002259 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002260
Daniel Veillarda03e3652004-11-02 18:45:30 +00002261#ifdef LIBXML_HTML_ENABLED
2262 int mem_base;
2263 int ret_val;
2264 htmlParserCtxtPtr ctxt; /* an HTML parser context */
2265 int n_ctxt;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002266
Daniel Veillarda03e3652004-11-02 18:45:30 +00002267 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
2268 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00002269 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
Daniel Veillarda03e3652004-11-02 18:45:30 +00002270
2271 ret_val = htmlParseCharRef(ctxt);
2272 desret_int(ret_val);
2273 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00002274 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
Daniel Veillarda03e3652004-11-02 18:45:30 +00002275 xmlResetLastError();
2276 if (mem_base != xmlMemBlocks()) {
2277 printf("Leak of %d blocks found in htmlParseCharRef",
2278 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00002279 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00002280 printf(" %d", n_ctxt);
2281 printf("\n");
2282 }
2283 }
2284#endif
2285
Daniel Veillard3d97e662004-11-04 10:49:00 +00002286 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00002287 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002288}
2289
2290
2291static int
2292test_htmlParseChunk(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002293 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002294
Daniel Veillarda03e3652004-11-02 18:45:30 +00002295#ifdef LIBXML_HTML_ENABLED
2296#ifdef LIBXML_PUSH_ENABLED
2297 int mem_base;
2298 int ret_val;
2299 htmlParserCtxtPtr ctxt; /* an HTML parser context */
2300 int n_ctxt;
Daniel Veillardce682bc2004-11-05 17:22:25 +00002301 char * chunk; /* an char array */
Daniel Veillarda03e3652004-11-02 18:45:30 +00002302 int n_chunk;
2303 int size; /* the size in byte of the chunk */
2304 int n_size;
2305 int terminate; /* last chunk indicator */
2306 int n_terminate;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002307
Daniel Veillarda03e3652004-11-02 18:45:30 +00002308 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
2309 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2310 for (n_size = 0;n_size < gen_nb_int;n_size++) {
2311 for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2312 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00002313 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
2314 chunk = gen_const_char_ptr(n_chunk, 1);
2315 size = gen_int(n_size, 2);
2316 terminate = gen_int(n_terminate, 3);
Daniel Veillarda03e3652004-11-02 18:45:30 +00002317
2318 ret_val = htmlParseChunk(ctxt, chunk, size, terminate);
2319 desret_int(ret_val);
2320 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00002321 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
2322 des_const_char_ptr(n_chunk, chunk, 1);
2323 des_int(n_size, size, 2);
2324 des_int(n_terminate, terminate, 3);
Daniel Veillarda03e3652004-11-02 18:45:30 +00002325 xmlResetLastError();
2326 if (mem_base != xmlMemBlocks()) {
2327 printf("Leak of %d blocks found in htmlParseChunk",
2328 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00002329 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00002330 printf(" %d", n_ctxt);
2331 printf(" %d", n_chunk);
2332 printf(" %d", n_size);
2333 printf(" %d", n_terminate);
2334 printf("\n");
2335 }
2336 }
2337 }
2338 }
2339 }
2340#endif
2341#endif
2342
Daniel Veillard3d97e662004-11-04 10:49:00 +00002343 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00002344 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002345}
2346
2347
2348static int
2349test_htmlParseDoc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002350 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002351
Daniel Veillard8a32fe42004-11-02 22:10:16 +00002352#ifdef LIBXML_HTML_ENABLED
2353 int mem_base;
2354 htmlDocPtr ret_val;
2355 xmlChar * cur; /* a pointer to an array of xmlChar */
2356 int n_cur;
Daniel Veillardce682bc2004-11-05 17:22:25 +00002357 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
Daniel Veillard8a32fe42004-11-02 22:10:16 +00002358 int n_encoding;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002359
Daniel Veillard8a32fe42004-11-02 22:10:16 +00002360 for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2361 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2362 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00002363 cur = gen_xmlChar_ptr(n_cur, 0);
2364 encoding = gen_const_char_ptr(n_encoding, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +00002365
2366 ret_val = htmlParseDoc(cur, encoding);
2367 desret_xmlDocPtr(ret_val);
2368 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00002369 des_xmlChar_ptr(n_cur, cur, 0);
2370 des_const_char_ptr(n_encoding, encoding, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +00002371 xmlResetLastError();
2372 if (mem_base != xmlMemBlocks()) {
2373 printf("Leak of %d blocks found in htmlParseDoc",
2374 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00002375 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +00002376 printf(" %d", n_cur);
2377 printf(" %d", n_encoding);
2378 printf("\n");
2379 }
2380 }
2381 }
2382#endif
2383
Daniel Veillard3d97e662004-11-04 10:49:00 +00002384 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00002385 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002386}
2387
2388
2389static int
2390test_htmlParseDocument(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002391 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002392
Daniel Veillarda03e3652004-11-02 18:45:30 +00002393#ifdef LIBXML_HTML_ENABLED
2394 int mem_base;
2395 int ret_val;
2396 htmlParserCtxtPtr ctxt; /* an HTML parser context */
2397 int n_ctxt;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002398
Daniel Veillarda03e3652004-11-02 18:45:30 +00002399 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
2400 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00002401 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
Daniel Veillarda03e3652004-11-02 18:45:30 +00002402
2403 ret_val = htmlParseDocument(ctxt);
2404 desret_int(ret_val);
2405 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00002406 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
Daniel Veillarda03e3652004-11-02 18:45:30 +00002407 xmlResetLastError();
2408 if (mem_base != xmlMemBlocks()) {
2409 printf("Leak of %d blocks found in htmlParseDocument",
2410 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00002411 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00002412 printf(" %d", n_ctxt);
2413 printf("\n");
2414 }
2415 }
2416#endif
2417
Daniel Veillard3d97e662004-11-04 10:49:00 +00002418 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00002419 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002420}
2421
2422
2423static int
2424test_htmlParseElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002425 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002426
Daniel Veillarda03e3652004-11-02 18:45:30 +00002427#ifdef LIBXML_HTML_ENABLED
2428 int mem_base;
2429 htmlParserCtxtPtr ctxt; /* an HTML parser context */
2430 int n_ctxt;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002431
Daniel Veillarda03e3652004-11-02 18:45:30 +00002432 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
2433 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00002434 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
Daniel Veillarda03e3652004-11-02 18:45:30 +00002435
2436 htmlParseElement(ctxt);
2437 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00002438 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
Daniel Veillarda03e3652004-11-02 18:45:30 +00002439 xmlResetLastError();
2440 if (mem_base != xmlMemBlocks()) {
2441 printf("Leak of %d blocks found in htmlParseElement",
2442 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00002443 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00002444 printf(" %d", n_ctxt);
2445 printf("\n");
2446 }
2447 }
2448#endif
2449
Daniel Veillard3d97e662004-11-04 10:49:00 +00002450 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00002451 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002452}
2453
2454
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00002455#define gen_nb_const_xmlChar_ptr_ptr 1
2456static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2457 return(NULL);
2458}
2459static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2460}
2461
Daniel Veillardd93f6252004-11-02 15:53:51 +00002462static int
2463test_htmlParseEntityRef(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002464 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002465
Daniel Veillard42595322004-11-08 10:52:06 +00002466#ifdef LIBXML_HTML_ENABLED
2467 int mem_base;
2468 const htmlEntityDesc * ret_val;
2469 htmlParserCtxtPtr ctxt; /* an HTML parser context */
2470 int n_ctxt;
2471 xmlChar ** str; /* location to store the entity name */
2472 int n_str;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002473
Daniel Veillard42595322004-11-08 10:52:06 +00002474 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
2475 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2476 mem_base = xmlMemBlocks();
2477 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
2478 str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2479
2480 ret_val = htmlParseEntityRef(ctxt, str);
2481 desret_const_htmlEntityDesc_ptr(ret_val);
2482 call_tests++;
2483 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
2484 des_const_xmlChar_ptr_ptr(n_str, str, 1);
2485 xmlResetLastError();
2486 if (mem_base != xmlMemBlocks()) {
2487 printf("Leak of %d blocks found in htmlParseEntityRef",
2488 xmlMemBlocks() - mem_base);
2489 test_ret++;
2490 printf(" %d", n_ctxt);
2491 printf(" %d", n_str);
2492 printf("\n");
2493 }
2494 }
2495 }
2496#endif
2497
2498 function_tests++;
2499 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002500}
2501
2502
2503static int
2504test_htmlParseFile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002505 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002506
Daniel Veillarda03e3652004-11-02 18:45:30 +00002507#ifdef LIBXML_HTML_ENABLED
2508 htmlDocPtr ret_val;
2509 const char * filename; /* the filename */
2510 int n_filename;
Daniel Veillardce682bc2004-11-05 17:22:25 +00002511 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
Daniel Veillarda03e3652004-11-02 18:45:30 +00002512 int n_encoding;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002513
Daniel Veillarda03e3652004-11-02 18:45:30 +00002514 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2515 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
Daniel Veillard3d97e662004-11-04 10:49:00 +00002516 filename = gen_filepath(n_filename, 0);
2517 encoding = gen_const_char_ptr(n_encoding, 1);
Daniel Veillarda03e3652004-11-02 18:45:30 +00002518
2519 ret_val = htmlParseFile(filename, encoding);
2520 desret_xmlDocPtr(ret_val);
2521 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00002522 des_filepath(n_filename, filename, 0);
2523 des_const_char_ptr(n_encoding, encoding, 1);
Daniel Veillarda03e3652004-11-02 18:45:30 +00002524 xmlResetLastError();
2525 }
2526 }
2527#endif
2528
Daniel Veillard3d97e662004-11-04 10:49:00 +00002529 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00002530 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002531}
2532
2533
2534static int
2535test_htmlReadDoc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002536 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002537
Daniel Veillarda03e3652004-11-02 18:45:30 +00002538#ifdef LIBXML_HTML_ENABLED
2539 int mem_base;
2540 htmlDocPtr ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +00002541 xmlChar * cur; /* a pointer to a zero terminated string */
Daniel Veillarda03e3652004-11-02 18:45:30 +00002542 int n_cur;
2543 const char * URL; /* the base URL to use for the document */
2544 int n_URL;
Daniel Veillardce682bc2004-11-05 17:22:25 +00002545 char * encoding; /* the document encoding, or NULL */
Daniel Veillarda03e3652004-11-02 18:45:30 +00002546 int n_encoding;
2547 int options; /* a combination of htmlParserOption(s) */
2548 int n_options;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002549
Daniel Veillarda03e3652004-11-02 18:45:30 +00002550 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2551 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2552 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2553 for (n_options = 0;n_options < gen_nb_int;n_options++) {
2554 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00002555 cur = gen_const_xmlChar_ptr(n_cur, 0);
2556 URL = gen_filepath(n_URL, 1);
2557 encoding = gen_const_char_ptr(n_encoding, 2);
2558 options = gen_int(n_options, 3);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002559
Daniel Veillarda03e3652004-11-02 18:45:30 +00002560 ret_val = htmlReadDoc(cur, URL, encoding, options);
2561 desret_xmlDocPtr(ret_val);
2562 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00002563 des_const_xmlChar_ptr(n_cur, cur, 0);
2564 des_filepath(n_URL, URL, 1);
2565 des_const_char_ptr(n_encoding, encoding, 2);
2566 des_int(n_options, options, 3);
Daniel Veillarda03e3652004-11-02 18:45:30 +00002567 xmlResetLastError();
2568 if (mem_base != xmlMemBlocks()) {
2569 printf("Leak of %d blocks found in htmlReadDoc",
2570 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00002571 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00002572 printf(" %d", n_cur);
2573 printf(" %d", n_URL);
2574 printf(" %d", n_encoding);
2575 printf(" %d", n_options);
2576 printf("\n");
2577 }
2578 }
2579 }
2580 }
2581 }
2582#endif
Daniel Veillardd93f6252004-11-02 15:53:51 +00002583
Daniel Veillard3d97e662004-11-04 10:49:00 +00002584 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00002585 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002586}
2587
2588
2589static int
2590test_htmlReadFile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002591 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002592
Daniel Veillarda03e3652004-11-02 18:45:30 +00002593#ifdef LIBXML_HTML_ENABLED
2594 int mem_base;
2595 htmlDocPtr ret_val;
2596 const char * filename; /* a file or URL */
2597 int n_filename;
Daniel Veillardce682bc2004-11-05 17:22:25 +00002598 char * encoding; /* the document encoding, or NULL */
Daniel Veillarda03e3652004-11-02 18:45:30 +00002599 int n_encoding;
2600 int options; /* a combination of htmlParserOption(s) */
2601 int n_options;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002602
Daniel Veillarda03e3652004-11-02 18:45:30 +00002603 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2604 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2605 for (n_options = 0;n_options < gen_nb_int;n_options++) {
2606 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00002607 filename = gen_filepath(n_filename, 0);
2608 encoding = gen_const_char_ptr(n_encoding, 1);
2609 options = gen_int(n_options, 2);
Daniel Veillarda03e3652004-11-02 18:45:30 +00002610
2611 ret_val = htmlReadFile(filename, encoding, options);
2612 desret_xmlDocPtr(ret_val);
2613 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00002614 des_filepath(n_filename, filename, 0);
2615 des_const_char_ptr(n_encoding, encoding, 1);
2616 des_int(n_options, options, 2);
Daniel Veillarda03e3652004-11-02 18:45:30 +00002617 xmlResetLastError();
2618 if (mem_base != xmlMemBlocks()) {
2619 printf("Leak of %d blocks found in htmlReadFile",
2620 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00002621 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00002622 printf(" %d", n_filename);
2623 printf(" %d", n_encoding);
2624 printf(" %d", n_options);
2625 printf("\n");
2626 }
2627 }
2628 }
2629 }
2630#endif
2631
Daniel Veillard3d97e662004-11-04 10:49:00 +00002632 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00002633 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002634}
2635
2636
2637static int
Daniel Veillardd93f6252004-11-02 15:53:51 +00002638test_htmlReadMemory(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002639 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002640
Daniel Veillarda03e3652004-11-02 18:45:30 +00002641#ifdef LIBXML_HTML_ENABLED
2642 int mem_base;
2643 htmlDocPtr ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +00002644 char * buffer; /* a pointer to a char array */
Daniel Veillarda03e3652004-11-02 18:45:30 +00002645 int n_buffer;
2646 int size; /* the size of the array */
2647 int n_size;
2648 const char * URL; /* the base URL to use for the document */
2649 int n_URL;
Daniel Veillardce682bc2004-11-05 17:22:25 +00002650 char * encoding; /* the document encoding, or NULL */
Daniel Veillarda03e3652004-11-02 18:45:30 +00002651 int n_encoding;
2652 int options; /* a combination of htmlParserOption(s) */
2653 int n_options;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002654
Daniel Veillarda03e3652004-11-02 18:45:30 +00002655 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2656 for (n_size = 0;n_size < gen_nb_int;n_size++) {
2657 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2658 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2659 for (n_options = 0;n_options < gen_nb_int;n_options++) {
2660 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00002661 buffer = gen_const_char_ptr(n_buffer, 0);
2662 size = gen_int(n_size, 1);
2663 URL = gen_filepath(n_URL, 2);
2664 encoding = gen_const_char_ptr(n_encoding, 3);
2665 options = gen_int(n_options, 4);
Daniel Veillarda03e3652004-11-02 18:45:30 +00002666
2667 ret_val = htmlReadMemory(buffer, size, URL, encoding, options);
2668 desret_xmlDocPtr(ret_val);
2669 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00002670 des_const_char_ptr(n_buffer, buffer, 0);
2671 des_int(n_size, size, 1);
2672 des_filepath(n_URL, URL, 2);
2673 des_const_char_ptr(n_encoding, encoding, 3);
2674 des_int(n_options, options, 4);
Daniel Veillarda03e3652004-11-02 18:45:30 +00002675 xmlResetLastError();
2676 if (mem_base != xmlMemBlocks()) {
2677 printf("Leak of %d blocks found in htmlReadMemory",
2678 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00002679 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00002680 printf(" %d", n_buffer);
2681 printf(" %d", n_size);
2682 printf(" %d", n_URL);
2683 printf(" %d", n_encoding);
2684 printf(" %d", n_options);
2685 printf("\n");
2686 }
2687 }
2688 }
2689 }
2690 }
2691 }
2692#endif
2693
Daniel Veillard3d97e662004-11-04 10:49:00 +00002694 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00002695 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002696}
2697
2698
2699static int
2700test_htmlSAXParseDoc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002701 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002702
Daniel Veillardce682bc2004-11-05 17:22:25 +00002703#ifdef LIBXML_HTML_ENABLED
2704 int mem_base;
2705 htmlDocPtr ret_val;
2706 xmlChar * cur; /* a pointer to an array of xmlChar */
2707 int n_cur;
2708 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2709 int n_encoding;
2710 htmlSAXHandlerPtr sax; /* the SAX handler block */
2711 int n_sax;
2712 void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2713 int n_userData;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002714
Daniel Veillardce682bc2004-11-05 17:22:25 +00002715 for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2716 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2717 for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2718 for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2719 mem_base = xmlMemBlocks();
2720 cur = gen_xmlChar_ptr(n_cur, 0);
2721 encoding = gen_const_char_ptr(n_encoding, 1);
2722 sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2723 userData = gen_userdata(n_userData, 3);
2724
2725 ret_val = htmlSAXParseDoc(cur, encoding, sax, userData);
2726 desret_xmlDocPtr(ret_val);
2727 call_tests++;
2728 des_xmlChar_ptr(n_cur, cur, 0);
2729 des_const_char_ptr(n_encoding, encoding, 1);
2730 des_htmlSAXHandlerPtr(n_sax, sax, 2);
2731 des_userdata(n_userData, userData, 3);
2732 xmlResetLastError();
2733 if (mem_base != xmlMemBlocks()) {
2734 printf("Leak of %d blocks found in htmlSAXParseDoc",
2735 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00002736 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00002737 printf(" %d", n_cur);
2738 printf(" %d", n_encoding);
2739 printf(" %d", n_sax);
2740 printf(" %d", n_userData);
2741 printf("\n");
2742 }
2743 }
2744 }
2745 }
2746 }
2747#endif
2748
2749 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00002750 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002751}
2752
2753
2754static int
2755test_htmlSAXParseFile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002756 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002757
Daniel Veillardce682bc2004-11-05 17:22:25 +00002758#ifdef LIBXML_HTML_ENABLED
2759 int mem_base;
2760 htmlDocPtr ret_val;
2761 const char * filename; /* the filename */
2762 int n_filename;
2763 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2764 int n_encoding;
2765 htmlSAXHandlerPtr sax; /* the SAX handler block */
2766 int n_sax;
2767 void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2768 int n_userData;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002769
Daniel Veillardce682bc2004-11-05 17:22:25 +00002770 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2771 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2772 for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2773 for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2774 mem_base = xmlMemBlocks();
2775 filename = gen_filepath(n_filename, 0);
2776 encoding = gen_const_char_ptr(n_encoding, 1);
2777 sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2778 userData = gen_userdata(n_userData, 3);
2779
2780 ret_val = htmlSAXParseFile(filename, encoding, sax, userData);
2781 desret_xmlDocPtr(ret_val);
2782 call_tests++;
2783 des_filepath(n_filename, filename, 0);
2784 des_const_char_ptr(n_encoding, encoding, 1);
2785 des_htmlSAXHandlerPtr(n_sax, sax, 2);
2786 des_userdata(n_userData, userData, 3);
2787 xmlResetLastError();
2788 if (mem_base != xmlMemBlocks()) {
2789 printf("Leak of %d blocks found in htmlSAXParseFile",
2790 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00002791 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00002792 printf(" %d", n_filename);
2793 printf(" %d", n_encoding);
2794 printf(" %d", n_sax);
2795 printf(" %d", n_userData);
2796 printf("\n");
2797 }
2798 }
2799 }
2800 }
2801 }
2802#endif
2803
2804 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00002805 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002806}
2807
2808
2809static int
2810test_htmlTagLookup(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002811 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002812
2813
2814 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +00002815 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002816}
2817
2818static int
2819test_HTMLparser(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002820 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002821
Daniel Veillard42595322004-11-08 10:52:06 +00002822 printf("Testing HTMLparser : 31 of 37 functions ...\n");
2823 test_ret += test_UTF8ToHtml();
2824 test_ret += test_htmlAttrAllowed();
2825 test_ret += test_htmlAutoCloseTag();
2826 test_ret += test_htmlCreateMemoryParserCtxt();
2827 test_ret += test_htmlCreatePushParserCtxt();
2828 test_ret += test_htmlCtxtReadDoc();
2829 test_ret += test_htmlCtxtReadFile();
2830 test_ret += test_htmlCtxtReadMemory();
2831 test_ret += test_htmlCtxtReset();
2832 test_ret += test_htmlCtxtUseOptions();
2833 test_ret += test_htmlElementAllowedHere();
2834 test_ret += test_htmlElementStatusHere();
2835 test_ret += test_htmlEncodeEntities();
2836 test_ret += test_htmlEntityLookup();
2837 test_ret += test_htmlEntityValueLookup();
2838 test_ret += test_htmlHandleOmittedElem();
2839 test_ret += test_htmlIsAutoClosed();
2840 test_ret += test_htmlIsScriptAttribute();
2841 test_ret += test_htmlNodeStatus();
2842 test_ret += test_htmlParseCharRef();
2843 test_ret += test_htmlParseChunk();
2844 test_ret += test_htmlParseDoc();
2845 test_ret += test_htmlParseDocument();
2846 test_ret += test_htmlParseElement();
2847 test_ret += test_htmlParseEntityRef();
2848 test_ret += test_htmlParseFile();
2849 test_ret += test_htmlReadDoc();
2850 test_ret += test_htmlReadFile();
2851 test_ret += test_htmlReadMemory();
2852 test_ret += test_htmlSAXParseDoc();
2853 test_ret += test_htmlSAXParseFile();
2854 test_ret += test_htmlTagLookup();
Daniel Veillardd93f6252004-11-02 15:53:51 +00002855
Daniel Veillard42595322004-11-08 10:52:06 +00002856 if (test_ret != 0)
2857 printf("Module HTMLparser: %d errors\n", test_ret);
2858 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002859}
2860
2861static int
2862test_htmlDocContentDumpFormatOutput(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002863 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002864
Daniel Veillard3d97e662004-11-04 10:49:00 +00002865#ifdef LIBXML_HTML_ENABLED
2866#ifdef LIBXML_OUTPUT_ENABLED
2867 int mem_base;
2868 xmlOutputBufferPtr buf; /* the HTML buffer output */
2869 int n_buf;
2870 xmlDocPtr cur; /* the document */
2871 int n_cur;
Daniel Veillardce682bc2004-11-05 17:22:25 +00002872 char * encoding; /* the encoding string */
Daniel Veillard3d97e662004-11-04 10:49:00 +00002873 int n_encoding;
2874 int format; /* should formatting spaces been added */
2875 int n_format;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002876
Daniel Veillard3d97e662004-11-04 10:49:00 +00002877 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2878 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2879 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2880 for (n_format = 0;n_format < gen_nb_int;n_format++) {
2881 mem_base = xmlMemBlocks();
2882 buf = gen_xmlOutputBufferPtr(n_buf, 0);
2883 cur = gen_xmlDocPtr(n_cur, 1);
2884 encoding = gen_const_char_ptr(n_encoding, 2);
2885 format = gen_int(n_format, 3);
2886
2887 htmlDocContentDumpFormatOutput(buf, cur, encoding, format);
2888 call_tests++;
2889 des_xmlOutputBufferPtr(n_buf, buf, 0);
2890 des_xmlDocPtr(n_cur, cur, 1);
2891 des_const_char_ptr(n_encoding, encoding, 2);
2892 des_int(n_format, format, 3);
2893 xmlResetLastError();
2894 if (mem_base != xmlMemBlocks()) {
2895 printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2896 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00002897 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00002898 printf(" %d", n_buf);
2899 printf(" %d", n_cur);
2900 printf(" %d", n_encoding);
2901 printf(" %d", n_format);
2902 printf("\n");
2903 }
2904 }
2905 }
2906 }
2907 }
2908#endif
2909#endif
2910
2911 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00002912 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002913}
2914
2915
2916static int
2917test_htmlDocContentDumpOutput(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002918 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002919
Daniel Veillard3d97e662004-11-04 10:49:00 +00002920#ifdef LIBXML_HTML_ENABLED
2921#ifdef LIBXML_OUTPUT_ENABLED
2922 int mem_base;
2923 xmlOutputBufferPtr buf; /* the HTML buffer output */
2924 int n_buf;
2925 xmlDocPtr cur; /* the document */
2926 int n_cur;
Daniel Veillardce682bc2004-11-05 17:22:25 +00002927 char * encoding; /* the encoding string */
Daniel Veillard3d97e662004-11-04 10:49:00 +00002928 int n_encoding;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002929
Daniel Veillard3d97e662004-11-04 10:49:00 +00002930 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2931 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2932 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2933 mem_base = xmlMemBlocks();
2934 buf = gen_xmlOutputBufferPtr(n_buf, 0);
2935 cur = gen_xmlDocPtr(n_cur, 1);
2936 encoding = gen_const_char_ptr(n_encoding, 2);
2937
2938 htmlDocContentDumpOutput(buf, cur, encoding);
2939 call_tests++;
2940 des_xmlOutputBufferPtr(n_buf, buf, 0);
2941 des_xmlDocPtr(n_cur, cur, 1);
2942 des_const_char_ptr(n_encoding, encoding, 2);
2943 xmlResetLastError();
2944 if (mem_base != xmlMemBlocks()) {
2945 printf("Leak of %d blocks found in htmlDocContentDumpOutput",
2946 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00002947 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00002948 printf(" %d", n_buf);
2949 printf(" %d", n_cur);
2950 printf(" %d", n_encoding);
2951 printf("\n");
2952 }
2953 }
2954 }
2955 }
2956#endif
2957#endif
2958
2959 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00002960 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00002961}
2962
2963
2964static int
2965test_htmlDocDump(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00002966 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002967
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00002968#ifdef LIBXML_HTML_ENABLED
2969#ifdef LIBXML_OUTPUT_ENABLED
2970 int mem_base;
2971 int ret_val;
2972 FILE * f; /* the FILE* */
2973 int n_f;
2974 xmlDocPtr cur; /* the document */
2975 int n_cur;
Daniel Veillardd93f6252004-11-02 15:53:51 +00002976
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00002977 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
2978 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2979 mem_base = xmlMemBlocks();
2980 f = gen_FILE_ptr(n_f, 0);
2981 cur = gen_xmlDocPtr(n_cur, 1);
2982
2983 ret_val = htmlDocDump(f, cur);
2984 desret_int(ret_val);
2985 call_tests++;
2986 des_FILE_ptr(n_f, f, 0);
2987 des_xmlDocPtr(n_cur, cur, 1);
2988 xmlResetLastError();
2989 if (mem_base != xmlMemBlocks()) {
2990 printf("Leak of %d blocks found in htmlDocDump",
2991 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00002992 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00002993 printf(" %d", n_f);
2994 printf(" %d", n_cur);
2995 printf("\n");
2996 }
2997 }
2998 }
2999#endif
3000#endif
3001
3002 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00003003 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003004}
3005
3006
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00003007#define gen_nb_xmlChar_ptr_ptr 1
3008static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3009 return(NULL);
3010}
3011static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3012}
3013
Daniel Veillardd93f6252004-11-02 15:53:51 +00003014static int
3015test_htmlDocDumpMemory(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00003016 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003017
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00003018#ifdef LIBXML_HTML_ENABLED
3019#ifdef LIBXML_OUTPUT_ENABLED
3020 int mem_base;
3021 xmlDocPtr cur; /* the document */
3022 int n_cur;
3023 xmlChar ** mem; /* OUT: the memory pointer */
3024 int n_mem;
3025 int * size; /* OUT: the memory length */
3026 int n_size;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003027
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00003028 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3029 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
3030 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
3031 mem_base = xmlMemBlocks();
3032 cur = gen_xmlDocPtr(n_cur, 0);
3033 mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3034 size = gen_int_ptr(n_size, 2);
3035
3036 htmlDocDumpMemory(cur, mem, size);
3037 call_tests++;
3038 des_xmlDocPtr(n_cur, cur, 0);
3039 des_xmlChar_ptr_ptr(n_mem, mem, 1);
3040 des_int_ptr(n_size, size, 2);
3041 xmlResetLastError();
3042 if (mem_base != xmlMemBlocks()) {
3043 printf("Leak of %d blocks found in htmlDocDumpMemory",
3044 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00003045 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00003046 printf(" %d", n_cur);
3047 printf(" %d", n_mem);
3048 printf(" %d", n_size);
3049 printf("\n");
3050 }
3051 }
3052 }
3053 }
3054#endif
3055#endif
3056
3057 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00003058 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003059}
3060
3061
3062static int
3063test_htmlGetMetaEncoding(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00003064 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003065
Daniel Veillardd005b9e2004-11-03 17:07:05 +00003066#ifdef LIBXML_HTML_ENABLED
3067 int mem_base;
3068 const xmlChar * ret_val;
3069 htmlDocPtr doc; /* the document */
3070 int n_doc;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003071
Daniel Veillardd005b9e2004-11-03 17:07:05 +00003072 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3073 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00003074 doc = gen_xmlDocPtr(n_doc, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +00003075
3076 ret_val = htmlGetMetaEncoding(doc);
3077 desret_const_xmlChar_ptr(ret_val);
3078 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00003079 des_xmlDocPtr(n_doc, doc, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +00003080 xmlResetLastError();
3081 if (mem_base != xmlMemBlocks()) {
3082 printf("Leak of %d blocks found in htmlGetMetaEncoding",
3083 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00003084 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +00003085 printf(" %d", n_doc);
3086 printf("\n");
3087 }
3088 }
3089#endif
3090
Daniel Veillard3d97e662004-11-04 10:49:00 +00003091 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00003092 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003093}
3094
3095
3096static int
3097test_htmlIsBooleanAttr(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00003098 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003099
3100#ifdef LIBXML_HTML_ENABLED
3101 int mem_base;
3102 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +00003103 xmlChar * name; /* the name of the attribute to check */
Daniel Veillardd93f6252004-11-02 15:53:51 +00003104 int n_name;
3105
3106 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3107 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00003108 name = gen_const_xmlChar_ptr(n_name, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003109
3110 ret_val = htmlIsBooleanAttr(name);
3111 desret_int(ret_val);
3112 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00003113 des_const_xmlChar_ptr(n_name, name, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003114 xmlResetLastError();
3115 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +00003116 printf("Leak of %d blocks found in htmlIsBooleanAttr",
Daniel Veillardd93f6252004-11-02 15:53:51 +00003117 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00003118 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00003119 printf(" %d", n_name);
3120 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +00003121 }
3122 }
3123#endif
3124
Daniel Veillard3d97e662004-11-04 10:49:00 +00003125 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00003126 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003127}
3128
3129
3130static int
3131test_htmlNewDoc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00003132 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003133
Daniel Veillarda03e3652004-11-02 18:45:30 +00003134#ifdef LIBXML_HTML_ENABLED
3135 int mem_base;
3136 htmlDocPtr ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +00003137 xmlChar * URI; /* URI for the dtd, or NULL */
Daniel Veillarda03e3652004-11-02 18:45:30 +00003138 int n_URI;
Daniel Veillardce682bc2004-11-05 17:22:25 +00003139 xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
Daniel Veillarda03e3652004-11-02 18:45:30 +00003140 int n_ExternalID;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003141
Daniel Veillarda03e3652004-11-02 18:45:30 +00003142 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3143 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3144 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00003145 URI = gen_const_xmlChar_ptr(n_URI, 0);
3146 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
Daniel Veillarda03e3652004-11-02 18:45:30 +00003147
3148 ret_val = htmlNewDoc(URI, ExternalID);
3149 desret_xmlDocPtr(ret_val);
3150 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00003151 des_const_xmlChar_ptr(n_URI, URI, 0);
3152 des_const_xmlChar_ptr(n_ExternalID, ExternalID, 1);
Daniel Veillarda03e3652004-11-02 18:45:30 +00003153 xmlResetLastError();
3154 if (mem_base != xmlMemBlocks()) {
3155 printf("Leak of %d blocks found in htmlNewDoc",
3156 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00003157 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00003158 printf(" %d", n_URI);
3159 printf(" %d", n_ExternalID);
3160 printf("\n");
3161 }
3162 }
3163 }
3164#endif
3165
Daniel Veillard3d97e662004-11-04 10:49:00 +00003166 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00003167 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003168}
3169
3170
3171static int
3172test_htmlNewDocNoDtD(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00003173 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003174
Daniel Veillarda03e3652004-11-02 18:45:30 +00003175#ifdef LIBXML_HTML_ENABLED
3176 int mem_base;
3177 htmlDocPtr ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +00003178 xmlChar * URI; /* URI for the dtd, or NULL */
Daniel Veillarda03e3652004-11-02 18:45:30 +00003179 int n_URI;
Daniel Veillardce682bc2004-11-05 17:22:25 +00003180 xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
Daniel Veillarda03e3652004-11-02 18:45:30 +00003181 int n_ExternalID;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003182
Daniel Veillarda03e3652004-11-02 18:45:30 +00003183 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3184 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3185 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00003186 URI = gen_const_xmlChar_ptr(n_URI, 0);
3187 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
Daniel Veillarda03e3652004-11-02 18:45:30 +00003188
3189 ret_val = htmlNewDocNoDtD(URI, ExternalID);
3190 desret_xmlDocPtr(ret_val);
3191 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00003192 des_const_xmlChar_ptr(n_URI, URI, 0);
3193 des_const_xmlChar_ptr(n_ExternalID, ExternalID, 1);
Daniel Veillarda03e3652004-11-02 18:45:30 +00003194 xmlResetLastError();
3195 if (mem_base != xmlMemBlocks()) {
3196 printf("Leak of %d blocks found in htmlNewDocNoDtD",
3197 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00003198 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00003199 printf(" %d", n_URI);
3200 printf(" %d", n_ExternalID);
3201 printf("\n");
3202 }
3203 }
3204 }
3205#endif
3206
Daniel Veillard3d97e662004-11-04 10:49:00 +00003207 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00003208 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003209}
3210
3211
3212static int
3213test_htmlNodeDump(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00003214 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003215
Daniel Veillardd005b9e2004-11-03 17:07:05 +00003216#ifdef LIBXML_HTML_ENABLED
3217#ifdef LIBXML_OUTPUT_ENABLED
3218 int mem_base;
3219 int ret_val;
3220 xmlBufferPtr buf; /* the HTML buffer output */
3221 int n_buf;
3222 xmlDocPtr doc; /* the document */
3223 int n_doc;
3224 xmlNodePtr cur; /* the current node */
3225 int n_cur;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003226
Daniel Veillardd005b9e2004-11-03 17:07:05 +00003227 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3228 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3229 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3230 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00003231 buf = gen_xmlBufferPtr(n_buf, 0);
3232 doc = gen_xmlDocPtr(n_doc, 1);
3233 cur = gen_xmlNodePtr(n_cur, 2);
Daniel Veillardd005b9e2004-11-03 17:07:05 +00003234
3235 ret_val = htmlNodeDump(buf, doc, cur);
3236 desret_int(ret_val);
3237 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00003238 des_xmlBufferPtr(n_buf, buf, 0);
3239 des_xmlDocPtr(n_doc, doc, 1);
3240 des_xmlNodePtr(n_cur, cur, 2);
Daniel Veillardd005b9e2004-11-03 17:07:05 +00003241 xmlResetLastError();
3242 if (mem_base != xmlMemBlocks()) {
3243 printf("Leak of %d blocks found in htmlNodeDump",
3244 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00003245 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +00003246 printf(" %d", n_buf);
3247 printf(" %d", n_doc);
3248 printf(" %d", n_cur);
3249 printf("\n");
3250 }
3251 }
3252 }
3253 }
3254#endif
3255#endif
3256
Daniel Veillard3d97e662004-11-04 10:49:00 +00003257 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00003258 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003259}
3260
3261
3262static int
3263test_htmlNodeDumpFile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00003264 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003265
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00003266#ifdef LIBXML_HTML_ENABLED
3267#ifdef LIBXML_OUTPUT_ENABLED
3268 int mem_base;
3269 FILE * out; /* the FILE pointer */
3270 int n_out;
3271 xmlDocPtr doc; /* the document */
3272 int n_doc;
3273 xmlNodePtr cur; /* the current node */
3274 int n_cur;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003275
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00003276 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3277 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3278 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3279 mem_base = xmlMemBlocks();
3280 out = gen_FILE_ptr(n_out, 0);
3281 doc = gen_xmlDocPtr(n_doc, 1);
3282 cur = gen_xmlNodePtr(n_cur, 2);
3283
3284 htmlNodeDumpFile(out, doc, cur);
3285 call_tests++;
3286 des_FILE_ptr(n_out, out, 0);
3287 des_xmlDocPtr(n_doc, doc, 1);
3288 des_xmlNodePtr(n_cur, cur, 2);
3289 xmlResetLastError();
3290 if (mem_base != xmlMemBlocks()) {
3291 printf("Leak of %d blocks found in htmlNodeDumpFile",
3292 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00003293 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00003294 printf(" %d", n_out);
3295 printf(" %d", n_doc);
3296 printf(" %d", n_cur);
3297 printf("\n");
3298 }
3299 }
3300 }
3301 }
3302#endif
3303#endif
3304
3305 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00003306 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003307}
3308
3309
3310static int
3311test_htmlNodeDumpFileFormat(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00003312 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003313
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00003314#ifdef LIBXML_HTML_ENABLED
3315#ifdef LIBXML_OUTPUT_ENABLED
3316 int mem_base;
3317 int ret_val;
3318 FILE * out; /* the FILE pointer */
3319 int n_out;
3320 xmlDocPtr doc; /* the document */
3321 int n_doc;
3322 xmlNodePtr cur; /* the current node */
3323 int n_cur;
Daniel Veillardce682bc2004-11-05 17:22:25 +00003324 char * encoding; /* the document encoding */
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00003325 int n_encoding;
3326 int format; /* should formatting spaces been added */
3327 int n_format;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003328
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00003329 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3330 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3331 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3332 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3333 for (n_format = 0;n_format < gen_nb_int;n_format++) {
3334 mem_base = xmlMemBlocks();
3335 out = gen_FILE_ptr(n_out, 0);
3336 doc = gen_xmlDocPtr(n_doc, 1);
3337 cur = gen_xmlNodePtr(n_cur, 2);
3338 encoding = gen_const_char_ptr(n_encoding, 3);
3339 format = gen_int(n_format, 4);
3340
3341 ret_val = htmlNodeDumpFileFormat(out, doc, cur, encoding, format);
3342 desret_int(ret_val);
3343 call_tests++;
3344 des_FILE_ptr(n_out, out, 0);
3345 des_xmlDocPtr(n_doc, doc, 1);
3346 des_xmlNodePtr(n_cur, cur, 2);
3347 des_const_char_ptr(n_encoding, encoding, 3);
3348 des_int(n_format, format, 4);
3349 xmlResetLastError();
3350 if (mem_base != xmlMemBlocks()) {
3351 printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3352 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00003353 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00003354 printf(" %d", n_out);
3355 printf(" %d", n_doc);
3356 printf(" %d", n_cur);
3357 printf(" %d", n_encoding);
3358 printf(" %d", n_format);
3359 printf("\n");
3360 }
3361 }
3362 }
3363 }
3364 }
3365 }
3366#endif
3367#endif
3368
3369 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00003370 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003371}
3372
3373
3374static int
3375test_htmlNodeDumpFormatOutput(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00003376 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003377
Daniel Veillard3d97e662004-11-04 10:49:00 +00003378#ifdef LIBXML_HTML_ENABLED
3379#ifdef LIBXML_OUTPUT_ENABLED
3380 int mem_base;
3381 xmlOutputBufferPtr buf; /* the HTML buffer output */
3382 int n_buf;
3383 xmlDocPtr doc; /* the document */
3384 int n_doc;
3385 xmlNodePtr cur; /* the current node */
3386 int n_cur;
Daniel Veillardce682bc2004-11-05 17:22:25 +00003387 char * encoding; /* the encoding string */
Daniel Veillard3d97e662004-11-04 10:49:00 +00003388 int n_encoding;
3389 int format; /* should formatting spaces been added */
3390 int n_format;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003391
Daniel Veillard3d97e662004-11-04 10:49:00 +00003392 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3393 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3394 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3395 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3396 for (n_format = 0;n_format < gen_nb_int;n_format++) {
3397 mem_base = xmlMemBlocks();
3398 buf = gen_xmlOutputBufferPtr(n_buf, 0);
3399 doc = gen_xmlDocPtr(n_doc, 1);
3400 cur = gen_xmlNodePtr(n_cur, 2);
3401 encoding = gen_const_char_ptr(n_encoding, 3);
3402 format = gen_int(n_format, 4);
3403
3404 htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);
3405 call_tests++;
3406 des_xmlOutputBufferPtr(n_buf, buf, 0);
3407 des_xmlDocPtr(n_doc, doc, 1);
3408 des_xmlNodePtr(n_cur, cur, 2);
3409 des_const_char_ptr(n_encoding, encoding, 3);
3410 des_int(n_format, format, 4);
3411 xmlResetLastError();
3412 if (mem_base != xmlMemBlocks()) {
3413 printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3414 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00003415 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00003416 printf(" %d", n_buf);
3417 printf(" %d", n_doc);
3418 printf(" %d", n_cur);
3419 printf(" %d", n_encoding);
3420 printf(" %d", n_format);
3421 printf("\n");
3422 }
3423 }
3424 }
3425 }
3426 }
3427 }
3428#endif
3429#endif
3430
3431 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00003432 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003433}
3434
3435
3436static int
3437test_htmlNodeDumpOutput(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00003438 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003439
Daniel Veillard3d97e662004-11-04 10:49:00 +00003440#ifdef LIBXML_HTML_ENABLED
3441#ifdef LIBXML_OUTPUT_ENABLED
3442 int mem_base;
3443 xmlOutputBufferPtr buf; /* the HTML buffer output */
3444 int n_buf;
3445 xmlDocPtr doc; /* the document */
3446 int n_doc;
3447 xmlNodePtr cur; /* the current node */
3448 int n_cur;
Daniel Veillardce682bc2004-11-05 17:22:25 +00003449 char * encoding; /* the encoding string */
Daniel Veillard3d97e662004-11-04 10:49:00 +00003450 int n_encoding;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003451
Daniel Veillard3d97e662004-11-04 10:49:00 +00003452 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3453 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3454 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3455 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3456 mem_base = xmlMemBlocks();
3457 buf = gen_xmlOutputBufferPtr(n_buf, 0);
3458 doc = gen_xmlDocPtr(n_doc, 1);
3459 cur = gen_xmlNodePtr(n_cur, 2);
3460 encoding = gen_const_char_ptr(n_encoding, 3);
3461
3462 htmlNodeDumpOutput(buf, doc, cur, encoding);
3463 call_tests++;
3464 des_xmlOutputBufferPtr(n_buf, buf, 0);
3465 des_xmlDocPtr(n_doc, doc, 1);
3466 des_xmlNodePtr(n_cur, cur, 2);
3467 des_const_char_ptr(n_encoding, encoding, 3);
3468 xmlResetLastError();
3469 if (mem_base != xmlMemBlocks()) {
3470 printf("Leak of %d blocks found in htmlNodeDumpOutput",
3471 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00003472 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00003473 printf(" %d", n_buf);
3474 printf(" %d", n_doc);
3475 printf(" %d", n_cur);
3476 printf(" %d", n_encoding);
3477 printf("\n");
3478 }
3479 }
3480 }
3481 }
3482 }
3483#endif
3484#endif
3485
3486 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00003487 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003488}
3489
3490
3491static int
3492test_htmlSaveFile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00003493 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003494
3495#ifdef LIBXML_HTML_ENABLED
3496#ifdef LIBXML_OUTPUT_ENABLED
3497 int mem_base;
3498 int ret_val;
3499 const char * filename; /* the filename (or URL) */
3500 int n_filename;
3501 xmlDocPtr cur; /* the document */
3502 int n_cur;
3503
3504 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3505 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3506 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00003507 filename = gen_fileoutput(n_filename, 0);
3508 cur = gen_xmlDocPtr(n_cur, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003509
3510 ret_val = htmlSaveFile(filename, cur);
3511 desret_int(ret_val);
3512 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00003513 des_fileoutput(n_filename, filename, 0);
3514 des_xmlDocPtr(n_cur, cur, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003515 xmlResetLastError();
3516 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +00003517 printf("Leak of %d blocks found in htmlSaveFile",
Daniel Veillardd93f6252004-11-02 15:53:51 +00003518 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00003519 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00003520 printf(" %d", n_filename);
3521 printf(" %d", n_cur);
3522 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +00003523 }
3524 }
3525 }
3526#endif
3527#endif
3528
Daniel Veillard3d97e662004-11-04 10:49:00 +00003529 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00003530 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003531}
3532
3533
3534static int
3535test_htmlSaveFileEnc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00003536 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003537
3538#ifdef LIBXML_HTML_ENABLED
3539#ifdef LIBXML_OUTPUT_ENABLED
3540 int mem_base;
3541 int ret_val;
3542 const char * filename; /* the filename */
3543 int n_filename;
3544 xmlDocPtr cur; /* the document */
3545 int n_cur;
Daniel Veillardce682bc2004-11-05 17:22:25 +00003546 char * encoding; /* the document encoding */
Daniel Veillardd93f6252004-11-02 15:53:51 +00003547 int n_encoding;
3548
3549 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3550 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3551 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3552 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00003553 filename = gen_fileoutput(n_filename, 0);
3554 cur = gen_xmlDocPtr(n_cur, 1);
3555 encoding = gen_const_char_ptr(n_encoding, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003556
3557 ret_val = htmlSaveFileEnc(filename, cur, encoding);
3558 desret_int(ret_val);
3559 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00003560 des_fileoutput(n_filename, filename, 0);
3561 des_xmlDocPtr(n_cur, cur, 1);
3562 des_const_char_ptr(n_encoding, encoding, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003563 xmlResetLastError();
3564 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +00003565 printf("Leak of %d blocks found in htmlSaveFileEnc",
Daniel Veillardd93f6252004-11-02 15:53:51 +00003566 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00003567 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00003568 printf(" %d", n_filename);
3569 printf(" %d", n_cur);
3570 printf(" %d", n_encoding);
3571 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +00003572 }
3573 }
3574 }
3575 }
3576#endif
3577#endif
3578
Daniel Veillard3d97e662004-11-04 10:49:00 +00003579 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00003580 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003581}
3582
3583
3584static int
3585test_htmlSaveFileFormat(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00003586 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003587
3588#ifdef LIBXML_HTML_ENABLED
3589#ifdef LIBXML_OUTPUT_ENABLED
3590 int mem_base;
3591 int ret_val;
3592 const char * filename; /* the filename */
3593 int n_filename;
3594 xmlDocPtr cur; /* the document */
3595 int n_cur;
Daniel Veillardce682bc2004-11-05 17:22:25 +00003596 char * encoding; /* the document encoding */
Daniel Veillardd93f6252004-11-02 15:53:51 +00003597 int n_encoding;
3598 int format; /* should formatting spaces been added */
3599 int n_format;
3600
3601 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3602 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3603 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3604 for (n_format = 0;n_format < gen_nb_int;n_format++) {
3605 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00003606 filename = gen_fileoutput(n_filename, 0);
3607 cur = gen_xmlDocPtr(n_cur, 1);
3608 encoding = gen_const_char_ptr(n_encoding, 2);
3609 format = gen_int(n_format, 3);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003610
3611 ret_val = htmlSaveFileFormat(filename, cur, encoding, format);
3612 desret_int(ret_val);
3613 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00003614 des_fileoutput(n_filename, filename, 0);
3615 des_xmlDocPtr(n_cur, cur, 1);
3616 des_const_char_ptr(n_encoding, encoding, 2);
3617 des_int(n_format, format, 3);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003618 xmlResetLastError();
3619 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +00003620 printf("Leak of %d blocks found in htmlSaveFileFormat",
Daniel Veillardd93f6252004-11-02 15:53:51 +00003621 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00003622 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00003623 printf(" %d", n_filename);
3624 printf(" %d", n_cur);
3625 printf(" %d", n_encoding);
3626 printf(" %d", n_format);
3627 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +00003628 }
3629 }
3630 }
3631 }
3632 }
3633#endif
3634#endif
3635
Daniel Veillard3d97e662004-11-04 10:49:00 +00003636 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00003637 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003638}
3639
3640
3641static int
3642test_htmlSetMetaEncoding(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00003643 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003644
Daniel Veillarda03e3652004-11-02 18:45:30 +00003645#ifdef LIBXML_HTML_ENABLED
3646 int mem_base;
3647 int ret_val;
3648 htmlDocPtr doc; /* the document */
3649 int n_doc;
Daniel Veillardce682bc2004-11-05 17:22:25 +00003650 xmlChar * encoding; /* the encoding string */
Daniel Veillarda03e3652004-11-02 18:45:30 +00003651 int n_encoding;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003652
Daniel Veillarda03e3652004-11-02 18:45:30 +00003653 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3654 for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3655 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00003656 doc = gen_xmlDocPtr(n_doc, 0);
3657 encoding = gen_const_xmlChar_ptr(n_encoding, 1);
Daniel Veillarda03e3652004-11-02 18:45:30 +00003658
3659 ret_val = htmlSetMetaEncoding(doc, encoding);
3660 desret_int(ret_val);
3661 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00003662 des_xmlDocPtr(n_doc, doc, 0);
3663 des_const_xmlChar_ptr(n_encoding, encoding, 1);
Daniel Veillarda03e3652004-11-02 18:45:30 +00003664 xmlResetLastError();
3665 if (mem_base != xmlMemBlocks()) {
3666 printf("Leak of %d blocks found in htmlSetMetaEncoding",
3667 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00003668 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00003669 printf(" %d", n_doc);
3670 printf(" %d", n_encoding);
3671 printf("\n");
3672 }
3673 }
3674 }
3675#endif
3676
Daniel Veillard3d97e662004-11-04 10:49:00 +00003677 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00003678 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003679}
3680
3681static int
3682test_HTMLtree(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00003683 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00003684
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00003685 printf("Testing HTMLtree : 17 of 17 functions ...\n");
Daniel Veillard42595322004-11-08 10:52:06 +00003686 test_ret += test_htmlDocContentDumpFormatOutput();
3687 test_ret += test_htmlDocContentDumpOutput();
3688 test_ret += test_htmlDocDump();
3689 test_ret += test_htmlDocDumpMemory();
3690 test_ret += test_htmlGetMetaEncoding();
3691 test_ret += test_htmlIsBooleanAttr();
3692 test_ret += test_htmlNewDoc();
3693 test_ret += test_htmlNewDocNoDtD();
3694 test_ret += test_htmlNodeDump();
3695 test_ret += test_htmlNodeDumpFile();
3696 test_ret += test_htmlNodeDumpFileFormat();
3697 test_ret += test_htmlNodeDumpFormatOutput();
3698 test_ret += test_htmlNodeDumpOutput();
3699 test_ret += test_htmlSaveFile();
3700 test_ret += test_htmlSaveFileEnc();
3701 test_ret += test_htmlSaveFileFormat();
3702 test_ret += test_htmlSetMetaEncoding();
Daniel Veillardd93f6252004-11-02 15:53:51 +00003703
Daniel Veillard42595322004-11-08 10:52:06 +00003704 if (test_ret != 0)
3705 printf("Module HTMLtree: %d errors\n", test_ret);
3706 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00003707}
3708
Daniel Veillard2a4fb5a2004-11-08 14:02:18 +00003709static int
3710test_docbDefaultSAXHandlerInit(void) {
3711 int test_ret = 0;
3712
3713 int mem_base;
3714
3715 mem_base = xmlMemBlocks();
3716
3717 docbDefaultSAXHandlerInit();
3718 call_tests++;
3719 xmlResetLastError();
3720 if (mem_base != xmlMemBlocks()) {
3721 printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3722 xmlMemBlocks() - mem_base);
3723 test_ret++;
3724 printf("\n");
3725 }
3726
3727 function_tests++;
3728 return(test_ret);
3729}
3730
3731
3732static int
3733test_htmlDefaultSAXHandlerInit(void) {
3734 int test_ret = 0;
3735
3736 int mem_base;
3737
3738 mem_base = xmlMemBlocks();
3739
3740 htmlDefaultSAXHandlerInit();
3741 call_tests++;
3742 xmlResetLastError();
3743 if (mem_base != xmlMemBlocks()) {
3744 printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3745 xmlMemBlocks() - mem_base);
3746 test_ret++;
3747 printf("\n");
3748 }
3749
3750 function_tests++;
3751 return(test_ret);
3752}
3753
3754
3755static int
3756test_xmlDefaultSAXHandlerInit(void) {
3757 int test_ret = 0;
3758
3759 int mem_base;
3760
3761 mem_base = xmlMemBlocks();
3762
3763 xmlDefaultSAXHandlerInit();
3764 call_tests++;
3765 xmlResetLastError();
3766 if (mem_base != xmlMemBlocks()) {
3767 printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3768 xmlMemBlocks() - mem_base);
3769 test_ret++;
3770 printf("\n");
3771 }
3772
3773 function_tests++;
3774 return(test_ret);
3775}
3776
3777
3778#define gen_nb_xmlEnumerationPtr 1
3779static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3780 return(NULL);
3781}
3782static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3783}
3784
3785static int
3786test_xmlSAX2AttributeDecl(void) {
3787 int test_ret = 0;
3788
3789 int mem_base;
3790 void * ctx; /* the user data (XML parser context) */
3791 int n_ctx;
3792 xmlChar * elem; /* the name of the element */
3793 int n_elem;
3794 xmlChar * fullname; /* the attribute name */
3795 int n_fullname;
3796 int type; /* the attribute type */
3797 int n_type;
3798 int def; /* the type of default value */
3799 int n_def;
3800 xmlChar * defaultValue; /* the attribute default value */
3801 int n_defaultValue;
3802 xmlEnumerationPtr tree; /* the tree of enumerated value set */
3803 int n_tree;
3804
3805 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3806 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3807 for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3808 for (n_type = 0;n_type < gen_nb_int;n_type++) {
3809 for (n_def = 0;n_def < gen_nb_int;n_def++) {
3810 for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3811 for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3812 mem_base = xmlMemBlocks();
3813 ctx = gen_void_ptr(n_ctx, 0);
3814 elem = gen_const_xmlChar_ptr(n_elem, 1);
3815 fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3816 type = gen_int(n_type, 3);
3817 def = gen_int(n_def, 4);
3818 defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3819 tree = gen_xmlEnumerationPtr(n_tree, 6);
3820
3821 xmlSAX2AttributeDecl(ctx, elem, fullname, type, def, defaultValue, tree);
3822 call_tests++;
3823 des_void_ptr(n_ctx, ctx, 0);
3824 des_const_xmlChar_ptr(n_elem, elem, 1);
3825 des_const_xmlChar_ptr(n_fullname, fullname, 2);
3826 des_int(n_type, type, 3);
3827 des_int(n_def, def, 4);
3828 des_const_xmlChar_ptr(n_defaultValue, defaultValue, 5);
3829 des_xmlEnumerationPtr(n_tree, tree, 6);
3830 xmlResetLastError();
3831 if (mem_base != xmlMemBlocks()) {
3832 printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3833 xmlMemBlocks() - mem_base);
3834 test_ret++;
3835 printf(" %d", n_ctx);
3836 printf(" %d", n_elem);
3837 printf(" %d", n_fullname);
3838 printf(" %d", n_type);
3839 printf(" %d", n_def);
3840 printf(" %d", n_defaultValue);
3841 printf(" %d", n_tree);
3842 printf("\n");
3843 }
3844 }
3845 }
3846 }
3847 }
3848 }
3849 }
3850 }
3851
3852 function_tests++;
3853 return(test_ret);
3854}
3855
3856
3857static int
3858test_xmlSAX2CDataBlock(void) {
3859 int test_ret = 0;
3860
3861 int mem_base;
3862 void * ctx; /* the user data (XML parser context) */
3863 int n_ctx;
3864 xmlChar * value; /* The pcdata content */
3865 int n_value;
3866 int len; /* the block length */
3867 int n_len;
3868
3869 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3870 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3871 for (n_len = 0;n_len < gen_nb_int;n_len++) {
3872 mem_base = xmlMemBlocks();
3873 ctx = gen_void_ptr(n_ctx, 0);
3874 value = gen_const_xmlChar_ptr(n_value, 1);
3875 len = gen_int(n_len, 2);
3876
3877 xmlSAX2CDataBlock(ctx, value, len);
3878 call_tests++;
3879 des_void_ptr(n_ctx, ctx, 0);
3880 des_const_xmlChar_ptr(n_value, value, 1);
3881 des_int(n_len, len, 2);
3882 xmlResetLastError();
3883 if (mem_base != xmlMemBlocks()) {
3884 printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3885 xmlMemBlocks() - mem_base);
3886 test_ret++;
3887 printf(" %d", n_ctx);
3888 printf(" %d", n_value);
3889 printf(" %d", n_len);
3890 printf("\n");
3891 }
3892 }
3893 }
3894 }
3895
3896 function_tests++;
3897 return(test_ret);
3898}
3899
3900
3901static int
3902test_xmlSAX2Characters(void) {
3903 int test_ret = 0;
3904
3905 int mem_base;
3906 void * ctx; /* the user data (XML parser context) */
3907 int n_ctx;
3908 xmlChar * ch; /* a xmlChar string */
3909 int n_ch;
3910 int len; /* the number of xmlChar */
3911 int n_len;
3912
3913 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3914 for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3915 for (n_len = 0;n_len < gen_nb_int;n_len++) {
3916 mem_base = xmlMemBlocks();
3917 ctx = gen_void_ptr(n_ctx, 0);
3918 ch = gen_const_xmlChar_ptr(n_ch, 1);
3919 len = gen_int(n_len, 2);
3920
3921 xmlSAX2Characters(ctx, ch, len);
3922 call_tests++;
3923 des_void_ptr(n_ctx, ctx, 0);
3924 des_const_xmlChar_ptr(n_ch, ch, 1);
3925 des_int(n_len, len, 2);
3926 xmlResetLastError();
3927 if (mem_base != xmlMemBlocks()) {
3928 printf("Leak of %d blocks found in xmlSAX2Characters",
3929 xmlMemBlocks() - mem_base);
3930 test_ret++;
3931 printf(" %d", n_ctx);
3932 printf(" %d", n_ch);
3933 printf(" %d", n_len);
3934 printf("\n");
3935 }
3936 }
3937 }
3938 }
3939
3940 function_tests++;
3941 return(test_ret);
3942}
3943
3944
3945static int
3946test_xmlSAX2Comment(void) {
3947 int test_ret = 0;
3948
3949 int mem_base;
3950 void * ctx; /* the user data (XML parser context) */
3951 int n_ctx;
3952 xmlChar * value; /* the xmlSAX2Comment content */
3953 int n_value;
3954
3955 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3956 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3957 mem_base = xmlMemBlocks();
3958 ctx = gen_void_ptr(n_ctx, 0);
3959 value = gen_const_xmlChar_ptr(n_value, 1);
3960
3961 xmlSAX2Comment(ctx, value);
3962 call_tests++;
3963 des_void_ptr(n_ctx, ctx, 0);
3964 des_const_xmlChar_ptr(n_value, value, 1);
3965 xmlResetLastError();
3966 if (mem_base != xmlMemBlocks()) {
3967 printf("Leak of %d blocks found in xmlSAX2Comment",
3968 xmlMemBlocks() - mem_base);
3969 test_ret++;
3970 printf(" %d", n_ctx);
3971 printf(" %d", n_value);
3972 printf("\n");
3973 }
3974 }
3975 }
3976
3977 function_tests++;
3978 return(test_ret);
3979}
3980
3981
3982#define gen_nb_xmlElementContentPtr 1
3983static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3984 return(NULL);
3985}
3986static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3987}
3988
3989static int
3990test_xmlSAX2ElementDecl(void) {
3991 int test_ret = 0;
3992
3993 int mem_base;
3994 void * ctx; /* the user data (XML parser context) */
3995 int n_ctx;
3996 xmlChar * name; /* the element name */
3997 int n_name;
3998 int type; /* the element type */
3999 int n_type;
4000 xmlElementContentPtr content; /* the element value tree */
4001 int n_content;
4002
4003 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4004 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4005 for (n_type = 0;n_type < gen_nb_int;n_type++) {
4006 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
4007 mem_base = xmlMemBlocks();
4008 ctx = gen_void_ptr(n_ctx, 0);
4009 name = gen_const_xmlChar_ptr(n_name, 1);
4010 type = gen_int(n_type, 2);
4011 content = gen_xmlElementContentPtr(n_content, 3);
4012
4013 xmlSAX2ElementDecl(ctx, name, type, content);
4014 call_tests++;
4015 des_void_ptr(n_ctx, ctx, 0);
4016 des_const_xmlChar_ptr(n_name, name, 1);
4017 des_int(n_type, type, 2);
4018 des_xmlElementContentPtr(n_content, content, 3);
4019 xmlResetLastError();
4020 if (mem_base != xmlMemBlocks()) {
4021 printf("Leak of %d blocks found in xmlSAX2ElementDecl",
4022 xmlMemBlocks() - mem_base);
4023 test_ret++;
4024 printf(" %d", n_ctx);
4025 printf(" %d", n_name);
4026 printf(" %d", n_type);
4027 printf(" %d", n_content);
4028 printf("\n");
4029 }
4030 }
4031 }
4032 }
4033 }
4034
4035 function_tests++;
4036 return(test_ret);
4037}
4038
4039
4040static int
4041test_xmlSAX2EndDocument(void) {
4042 int test_ret = 0;
4043
4044 int mem_base;
4045 void * ctx; /* the user data (XML parser context) */
4046 int n_ctx;
4047
4048 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4049 mem_base = xmlMemBlocks();
4050 ctx = gen_void_ptr(n_ctx, 0);
4051
4052 xmlSAX2EndDocument(ctx);
4053 call_tests++;
4054 des_void_ptr(n_ctx, ctx, 0);
4055 xmlResetLastError();
4056 if (mem_base != xmlMemBlocks()) {
4057 printf("Leak of %d blocks found in xmlSAX2EndDocument",
4058 xmlMemBlocks() - mem_base);
4059 test_ret++;
4060 printf(" %d", n_ctx);
4061 printf("\n");
4062 }
4063 }
4064
4065 function_tests++;
4066 return(test_ret);
4067}
4068
4069
4070static int
4071test_xmlSAX2EndElement(void) {
4072 int test_ret = 0;
4073
4074 int mem_base;
4075 void * ctx; /* the user data (XML parser context) */
4076 int n_ctx;
4077 xmlChar * name; /* The element name */
4078 int n_name;
4079
4080 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4081 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4082 mem_base = xmlMemBlocks();
4083 ctx = gen_void_ptr(n_ctx, 0);
4084 name = gen_const_xmlChar_ptr(n_name, 1);
4085
4086 xmlSAX2EndElement(ctx, name);
4087 call_tests++;
4088 des_void_ptr(n_ctx, ctx, 0);
4089 des_const_xmlChar_ptr(n_name, name, 1);
4090 xmlResetLastError();
4091 if (mem_base != xmlMemBlocks()) {
4092 printf("Leak of %d blocks found in xmlSAX2EndElement",
4093 xmlMemBlocks() - mem_base);
4094 test_ret++;
4095 printf(" %d", n_ctx);
4096 printf(" %d", n_name);
4097 printf("\n");
4098 }
4099 }
4100 }
4101
4102 function_tests++;
4103 return(test_ret);
4104}
4105
4106
4107static int
4108test_xmlSAX2EndElementNs(void) {
4109 int test_ret = 0;
4110
4111 int mem_base;
4112 void * ctx; /* the user data (XML parser context) */
4113 int n_ctx;
4114 xmlChar * localname; /* the local name of the element */
4115 int n_localname;
4116 xmlChar * prefix; /* the element namespace prefix if available */
4117 int n_prefix;
4118 xmlChar * URI; /* the element namespace name if available */
4119 int n_URI;
4120
4121 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4122 for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4123 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4124 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4125 mem_base = xmlMemBlocks();
4126 ctx = gen_void_ptr(n_ctx, 0);
4127 localname = gen_const_xmlChar_ptr(n_localname, 1);
4128 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4129 URI = gen_const_xmlChar_ptr(n_URI, 3);
4130
4131 xmlSAX2EndElementNs(ctx, localname, prefix, URI);
4132 call_tests++;
4133 des_void_ptr(n_ctx, ctx, 0);
4134 des_const_xmlChar_ptr(n_localname, localname, 1);
4135 des_const_xmlChar_ptr(n_prefix, prefix, 2);
4136 des_const_xmlChar_ptr(n_URI, URI, 3);
4137 xmlResetLastError();
4138 if (mem_base != xmlMemBlocks()) {
4139 printf("Leak of %d blocks found in xmlSAX2EndElementNs",
4140 xmlMemBlocks() - mem_base);
4141 test_ret++;
4142 printf(" %d", n_ctx);
4143 printf(" %d", n_localname);
4144 printf(" %d", n_prefix);
4145 printf(" %d", n_URI);
4146 printf("\n");
4147 }
4148 }
4149 }
4150 }
4151 }
4152
4153 function_tests++;
4154 return(test_ret);
4155}
4156
4157
4158static int
4159test_xmlSAX2EntityDecl(void) {
4160 int test_ret = 0;
4161
4162 int mem_base;
4163 void * ctx; /* the user data (XML parser context) */
4164 int n_ctx;
4165 xmlChar * name; /* the entity name */
4166 int n_name;
4167 int type; /* the entity type */
4168 int n_type;
4169 xmlChar * publicId; /* The public ID of the entity */
4170 int n_publicId;
4171 xmlChar * systemId; /* The system ID of the entity */
4172 int n_systemId;
4173 xmlChar * content; /* the entity value (without processing). */
4174 int n_content;
4175
4176 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4177 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4178 for (n_type = 0;n_type < gen_nb_int;n_type++) {
4179 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4180 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4181 for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4182 mem_base = xmlMemBlocks();
4183 ctx = gen_void_ptr(n_ctx, 0);
4184 name = gen_const_xmlChar_ptr(n_name, 1);
4185 type = gen_int(n_type, 2);
4186 publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4187 systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4188 content = gen_xmlChar_ptr(n_content, 5);
4189
4190 xmlSAX2EntityDecl(ctx, name, type, publicId, systemId, content);
4191 call_tests++;
4192 des_void_ptr(n_ctx, ctx, 0);
4193 des_const_xmlChar_ptr(n_name, name, 1);
4194 des_int(n_type, type, 2);
4195 des_const_xmlChar_ptr(n_publicId, publicId, 3);
4196 des_const_xmlChar_ptr(n_systemId, systemId, 4);
4197 des_xmlChar_ptr(n_content, content, 5);
4198 xmlResetLastError();
4199 if (mem_base != xmlMemBlocks()) {
4200 printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4201 xmlMemBlocks() - mem_base);
4202 test_ret++;
4203 printf(" %d", n_ctx);
4204 printf(" %d", n_name);
4205 printf(" %d", n_type);
4206 printf(" %d", n_publicId);
4207 printf(" %d", n_systemId);
4208 printf(" %d", n_content);
4209 printf("\n");
4210 }
4211 }
4212 }
4213 }
4214 }
4215 }
4216 }
4217
4218 function_tests++;
4219 return(test_ret);
4220}
4221
4222
4223static int
4224test_xmlSAX2ExternalSubset(void) {
4225 int test_ret = 0;
4226
4227 int mem_base;
4228 void * ctx; /* the user data (XML parser context) */
4229 int n_ctx;
4230 xmlChar * name; /* the root element name */
4231 int n_name;
4232 xmlChar * ExternalID; /* the external ID */
4233 int n_ExternalID;
4234 xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4235 int n_SystemID;
4236
4237 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4238 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4239 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4240 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4241 mem_base = xmlMemBlocks();
4242 ctx = gen_void_ptr(n_ctx, 0);
4243 name = gen_const_xmlChar_ptr(n_name, 1);
4244 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4245 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4246
4247 xmlSAX2ExternalSubset(ctx, name, ExternalID, SystemID);
4248 call_tests++;
4249 des_void_ptr(n_ctx, ctx, 0);
4250 des_const_xmlChar_ptr(n_name, name, 1);
4251 des_const_xmlChar_ptr(n_ExternalID, ExternalID, 2);
4252 des_const_xmlChar_ptr(n_SystemID, SystemID, 3);
4253 xmlResetLastError();
4254 if (mem_base != xmlMemBlocks()) {
4255 printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4256 xmlMemBlocks() - mem_base);
4257 test_ret++;
4258 printf(" %d", n_ctx);
4259 printf(" %d", n_name);
4260 printf(" %d", n_ExternalID);
4261 printf(" %d", n_SystemID);
4262 printf("\n");
4263 }
4264 }
4265 }
4266 }
4267 }
4268
4269 function_tests++;
4270 return(test_ret);
4271}
4272
4273
4274static int
4275test_xmlSAX2GetColumnNumber(void) {
4276 int test_ret = 0;
4277
4278 int mem_base;
4279 int ret_val;
4280 void * ctx; /* the user data (XML parser context) */
4281 int n_ctx;
4282
4283 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4284 mem_base = xmlMemBlocks();
4285 ctx = gen_void_ptr(n_ctx, 0);
4286
4287 ret_val = xmlSAX2GetColumnNumber(ctx);
4288 desret_int(ret_val);
4289 call_tests++;
4290 des_void_ptr(n_ctx, ctx, 0);
4291 xmlResetLastError();
4292 if (mem_base != xmlMemBlocks()) {
4293 printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4294 xmlMemBlocks() - mem_base);
4295 test_ret++;
4296 printf(" %d", n_ctx);
4297 printf("\n");
4298 }
4299 }
4300
4301 function_tests++;
4302 return(test_ret);
4303}
4304
4305
4306static int
4307test_xmlSAX2GetEntity(void) {
4308 int test_ret = 0;
4309
4310 int mem_base;
4311 xmlEntityPtr ret_val;
4312 void * ctx; /* the user data (XML parser context) */
4313 int n_ctx;
4314 xmlChar * name; /* The entity name */
4315 int n_name;
4316
4317 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4318 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4319 mem_base = xmlMemBlocks();
4320 ctx = gen_void_ptr(n_ctx, 0);
4321 name = gen_const_xmlChar_ptr(n_name, 1);
4322
4323 ret_val = xmlSAX2GetEntity(ctx, name);
4324 desret_xmlEntityPtr(ret_val);
4325 call_tests++;
4326 des_void_ptr(n_ctx, ctx, 0);
4327 des_const_xmlChar_ptr(n_name, name, 1);
4328 xmlResetLastError();
4329 if (mem_base != xmlMemBlocks()) {
4330 printf("Leak of %d blocks found in xmlSAX2GetEntity",
4331 xmlMemBlocks() - mem_base);
4332 test_ret++;
4333 printf(" %d", n_ctx);
4334 printf(" %d", n_name);
4335 printf("\n");
4336 }
4337 }
4338 }
4339
4340 function_tests++;
4341 return(test_ret);
4342}
4343
4344
4345static int
4346test_xmlSAX2GetLineNumber(void) {
4347 int test_ret = 0;
4348
4349 int mem_base;
4350 int ret_val;
4351 void * ctx; /* the user data (XML parser context) */
4352 int n_ctx;
4353
4354 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4355 mem_base = xmlMemBlocks();
4356 ctx = gen_void_ptr(n_ctx, 0);
4357
4358 ret_val = xmlSAX2GetLineNumber(ctx);
4359 desret_int(ret_val);
4360 call_tests++;
4361 des_void_ptr(n_ctx, ctx, 0);
4362 xmlResetLastError();
4363 if (mem_base != xmlMemBlocks()) {
4364 printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4365 xmlMemBlocks() - mem_base);
4366 test_ret++;
4367 printf(" %d", n_ctx);
4368 printf("\n");
4369 }
4370 }
4371
4372 function_tests++;
4373 return(test_ret);
4374}
4375
4376
4377static int
4378test_xmlSAX2GetParameterEntity(void) {
4379 int test_ret = 0;
4380
4381 int mem_base;
4382 xmlEntityPtr ret_val;
4383 void * ctx; /* the user data (XML parser context) */
4384 int n_ctx;
4385 xmlChar * name; /* The entity name */
4386 int n_name;
4387
4388 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4389 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4390 mem_base = xmlMemBlocks();
4391 ctx = gen_void_ptr(n_ctx, 0);
4392 name = gen_const_xmlChar_ptr(n_name, 1);
4393
4394 ret_val = xmlSAX2GetParameterEntity(ctx, name);
4395 desret_xmlEntityPtr(ret_val);
4396 call_tests++;
4397 des_void_ptr(n_ctx, ctx, 0);
4398 des_const_xmlChar_ptr(n_name, name, 1);
4399 xmlResetLastError();
4400 if (mem_base != xmlMemBlocks()) {
4401 printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4402 xmlMemBlocks() - mem_base);
4403 test_ret++;
4404 printf(" %d", n_ctx);
4405 printf(" %d", n_name);
4406 printf("\n");
4407 }
4408 }
4409 }
4410
4411 function_tests++;
4412 return(test_ret);
4413}
4414
4415
4416static int
4417test_xmlSAX2GetPublicId(void) {
4418 int test_ret = 0;
4419
4420 int mem_base;
4421 const xmlChar * ret_val;
4422 void * ctx; /* the user data (XML parser context) */
4423 int n_ctx;
4424
4425 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4426 mem_base = xmlMemBlocks();
4427 ctx = gen_void_ptr(n_ctx, 0);
4428
4429 ret_val = xmlSAX2GetPublicId(ctx);
4430 desret_const_xmlChar_ptr(ret_val);
4431 call_tests++;
4432 des_void_ptr(n_ctx, ctx, 0);
4433 xmlResetLastError();
4434 if (mem_base != xmlMemBlocks()) {
4435 printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4436 xmlMemBlocks() - mem_base);
4437 test_ret++;
4438 printf(" %d", n_ctx);
4439 printf("\n");
4440 }
4441 }
4442
4443 function_tests++;
4444 return(test_ret);
4445}
4446
4447
4448static int
4449test_xmlSAX2GetSystemId(void) {
4450 int test_ret = 0;
4451
4452 int mem_base;
4453 const xmlChar * ret_val;
4454 void * ctx; /* the user data (XML parser context) */
4455 int n_ctx;
4456
4457 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4458 mem_base = xmlMemBlocks();
4459 ctx = gen_void_ptr(n_ctx, 0);
4460
4461 ret_val = xmlSAX2GetSystemId(ctx);
4462 desret_const_xmlChar_ptr(ret_val);
4463 call_tests++;
4464 des_void_ptr(n_ctx, ctx, 0);
4465 xmlResetLastError();
4466 if (mem_base != xmlMemBlocks()) {
4467 printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4468 xmlMemBlocks() - mem_base);
4469 test_ret++;
4470 printf(" %d", n_ctx);
4471 printf("\n");
4472 }
4473 }
4474
4475 function_tests++;
4476 return(test_ret);
4477}
4478
4479
4480static int
4481test_xmlSAX2HasExternalSubset(void) {
4482 int test_ret = 0;
4483
4484 int mem_base;
4485 int ret_val;
4486 void * ctx; /* the user data (XML parser context) */
4487 int n_ctx;
4488
4489 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4490 mem_base = xmlMemBlocks();
4491 ctx = gen_void_ptr(n_ctx, 0);
4492
4493 ret_val = xmlSAX2HasExternalSubset(ctx);
4494 desret_int(ret_val);
4495 call_tests++;
4496 des_void_ptr(n_ctx, ctx, 0);
4497 xmlResetLastError();
4498 if (mem_base != xmlMemBlocks()) {
4499 printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4500 xmlMemBlocks() - mem_base);
4501 test_ret++;
4502 printf(" %d", n_ctx);
4503 printf("\n");
4504 }
4505 }
4506
4507 function_tests++;
4508 return(test_ret);
4509}
4510
4511
4512static int
4513test_xmlSAX2HasInternalSubset(void) {
4514 int test_ret = 0;
4515
4516 int mem_base;
4517 int ret_val;
4518 void * ctx; /* the user data (XML parser context) */
4519 int n_ctx;
4520
4521 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4522 mem_base = xmlMemBlocks();
4523 ctx = gen_void_ptr(n_ctx, 0);
4524
4525 ret_val = xmlSAX2HasInternalSubset(ctx);
4526 desret_int(ret_val);
4527 call_tests++;
4528 des_void_ptr(n_ctx, ctx, 0);
4529 xmlResetLastError();
4530 if (mem_base != xmlMemBlocks()) {
4531 printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4532 xmlMemBlocks() - mem_base);
4533 test_ret++;
4534 printf(" %d", n_ctx);
4535 printf("\n");
4536 }
4537 }
4538
4539 function_tests++;
4540 return(test_ret);
4541}
4542
4543
4544static int
4545test_xmlSAX2IgnorableWhitespace(void) {
4546 int test_ret = 0;
4547
4548 int mem_base;
4549 void * ctx; /* the user data (XML parser context) */
4550 int n_ctx;
4551 xmlChar * ch; /* a xmlChar string */
4552 int n_ch;
4553 int len; /* the number of xmlChar */
4554 int n_len;
4555
4556 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4557 for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4558 for (n_len = 0;n_len < gen_nb_int;n_len++) {
4559 mem_base = xmlMemBlocks();
4560 ctx = gen_void_ptr(n_ctx, 0);
4561 ch = gen_const_xmlChar_ptr(n_ch, 1);
4562 len = gen_int(n_len, 2);
4563
4564 xmlSAX2IgnorableWhitespace(ctx, ch, len);
4565 call_tests++;
4566 des_void_ptr(n_ctx, ctx, 0);
4567 des_const_xmlChar_ptr(n_ch, ch, 1);
4568 des_int(n_len, len, 2);
4569 xmlResetLastError();
4570 if (mem_base != xmlMemBlocks()) {
4571 printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4572 xmlMemBlocks() - mem_base);
4573 test_ret++;
4574 printf(" %d", n_ctx);
4575 printf(" %d", n_ch);
4576 printf(" %d", n_len);
4577 printf("\n");
4578 }
4579 }
4580 }
4581 }
4582
4583 function_tests++;
4584 return(test_ret);
4585}
4586
4587
4588#define gen_nb_xmlSAXHandler_ptr 1
4589static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4590 return(NULL);
4591}
4592static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4593}
4594
4595static int
4596test_xmlSAX2InitDefaultSAXHandler(void) {
4597 int test_ret = 0;
4598
4599 int mem_base;
4600 xmlSAXHandler * hdlr; /* the SAX handler */
4601 int n_hdlr;
4602 int warning; /* flag if non-zero sets the handler warning procedure */
4603 int n_warning;
4604
4605 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4606 for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4607 mem_base = xmlMemBlocks();
4608 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4609 warning = gen_int(n_warning, 1);
4610
4611 xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4612 call_tests++;
4613 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4614 des_int(n_warning, warning, 1);
4615 xmlResetLastError();
4616 if (mem_base != xmlMemBlocks()) {
4617 printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4618 xmlMemBlocks() - mem_base);
4619 test_ret++;
4620 printf(" %d", n_hdlr);
4621 printf(" %d", n_warning);
4622 printf("\n");
4623 }
4624 }
4625 }
4626
4627 function_tests++;
4628 return(test_ret);
4629}
4630
4631
4632static int
4633test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4634 int test_ret = 0;
4635
4636#ifdef LIBXML_DOCB_ENABLED
4637 int mem_base;
4638 xmlSAXHandler * hdlr; /* the SAX handler */
4639 int n_hdlr;
4640
4641 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4642 mem_base = xmlMemBlocks();
4643 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4644
4645 xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4646 call_tests++;
4647 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4648 xmlResetLastError();
4649 if (mem_base != xmlMemBlocks()) {
4650 printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
4651 xmlMemBlocks() - mem_base);
4652 test_ret++;
4653 printf(" %d", n_hdlr);
4654 printf("\n");
4655 }
4656 }
4657#endif
4658
4659 function_tests++;
4660 return(test_ret);
4661}
4662
4663
4664static int
4665test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4666 int test_ret = 0;
4667
4668#ifdef LIBXML_HTML_ENABLED
4669 int mem_base;
4670 xmlSAXHandler * hdlr; /* the SAX handler */
4671 int n_hdlr;
4672
4673 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4674 mem_base = xmlMemBlocks();
4675 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4676
4677 xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4678 call_tests++;
4679 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4680 xmlResetLastError();
4681 if (mem_base != xmlMemBlocks()) {
4682 printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4683 xmlMemBlocks() - mem_base);
4684 test_ret++;
4685 printf(" %d", n_hdlr);
4686 printf("\n");
4687 }
4688 }
4689#endif
4690
4691 function_tests++;
4692 return(test_ret);
4693}
4694
4695
4696static int
4697test_xmlSAX2InternalSubset(void) {
4698 int test_ret = 0;
4699
4700 int mem_base;
4701 void * ctx; /* the user data (XML parser context) */
4702 int n_ctx;
4703 xmlChar * name; /* the root element name */
4704 int n_name;
4705 xmlChar * ExternalID; /* the external ID */
4706 int n_ExternalID;
4707 xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4708 int n_SystemID;
4709
4710 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4711 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4712 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4713 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4714 mem_base = xmlMemBlocks();
4715 ctx = gen_void_ptr(n_ctx, 0);
4716 name = gen_const_xmlChar_ptr(n_name, 1);
4717 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4718 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4719
4720 xmlSAX2InternalSubset(ctx, name, ExternalID, SystemID);
4721 call_tests++;
4722 des_void_ptr(n_ctx, ctx, 0);
4723 des_const_xmlChar_ptr(n_name, name, 1);
4724 des_const_xmlChar_ptr(n_ExternalID, ExternalID, 2);
4725 des_const_xmlChar_ptr(n_SystemID, SystemID, 3);
4726 xmlResetLastError();
4727 if (mem_base != xmlMemBlocks()) {
4728 printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4729 xmlMemBlocks() - mem_base);
4730 test_ret++;
4731 printf(" %d", n_ctx);
4732 printf(" %d", n_name);
4733 printf(" %d", n_ExternalID);
4734 printf(" %d", n_SystemID);
4735 printf("\n");
4736 }
4737 }
4738 }
4739 }
4740 }
4741
4742 function_tests++;
4743 return(test_ret);
4744}
4745
4746
4747static int
4748test_xmlSAX2IsStandalone(void) {
4749 int test_ret = 0;
4750
4751 int mem_base;
4752 int ret_val;
4753 void * ctx; /* the user data (XML parser context) */
4754 int n_ctx;
4755
4756 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4757 mem_base = xmlMemBlocks();
4758 ctx = gen_void_ptr(n_ctx, 0);
4759
4760 ret_val = xmlSAX2IsStandalone(ctx);
4761 desret_int(ret_val);
4762 call_tests++;
4763 des_void_ptr(n_ctx, ctx, 0);
4764 xmlResetLastError();
4765 if (mem_base != xmlMemBlocks()) {
4766 printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4767 xmlMemBlocks() - mem_base);
4768 test_ret++;
4769 printf(" %d", n_ctx);
4770 printf("\n");
4771 }
4772 }
4773
4774 function_tests++;
4775 return(test_ret);
4776}
4777
4778
4779static int
4780test_xmlSAX2NotationDecl(void) {
4781 int test_ret = 0;
4782
4783 int mem_base;
4784 void * ctx; /* the user data (XML parser context) */
4785 int n_ctx;
4786 xmlChar * name; /* The name of the notation */
4787 int n_name;
4788 xmlChar * publicId; /* The public ID of the entity */
4789 int n_publicId;
4790 xmlChar * systemId; /* The system ID of the entity */
4791 int n_systemId;
4792
4793 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4794 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4795 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4796 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4797 mem_base = xmlMemBlocks();
4798 ctx = gen_void_ptr(n_ctx, 0);
4799 name = gen_const_xmlChar_ptr(n_name, 1);
4800 publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4801 systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4802
4803 xmlSAX2NotationDecl(ctx, name, publicId, systemId);
4804 call_tests++;
4805 des_void_ptr(n_ctx, ctx, 0);
4806 des_const_xmlChar_ptr(n_name, name, 1);
4807 des_const_xmlChar_ptr(n_publicId, publicId, 2);
4808 des_const_xmlChar_ptr(n_systemId, systemId, 3);
4809 xmlResetLastError();
4810 if (mem_base != xmlMemBlocks()) {
4811 printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4812 xmlMemBlocks() - mem_base);
4813 test_ret++;
4814 printf(" %d", n_ctx);
4815 printf(" %d", n_name);
4816 printf(" %d", n_publicId);
4817 printf(" %d", n_systemId);
4818 printf("\n");
4819 }
4820 }
4821 }
4822 }
4823 }
4824
4825 function_tests++;
4826 return(test_ret);
4827}
4828
4829
4830static int
4831test_xmlSAX2ProcessingInstruction(void) {
4832 int test_ret = 0;
4833
4834 int mem_base;
4835 void * ctx; /* the user data (XML parser context) */
4836 int n_ctx;
4837 xmlChar * target; /* the target name */
4838 int n_target;
4839 xmlChar * data; /* the PI data's */
4840 int n_data;
4841
4842 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4843 for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4844 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4845 mem_base = xmlMemBlocks();
4846 ctx = gen_void_ptr(n_ctx, 0);
4847 target = gen_const_xmlChar_ptr(n_target, 1);
4848 data = gen_const_xmlChar_ptr(n_data, 2);
4849
4850 xmlSAX2ProcessingInstruction(ctx, target, data);
4851 call_tests++;
4852 des_void_ptr(n_ctx, ctx, 0);
4853 des_const_xmlChar_ptr(n_target, target, 1);
4854 des_const_xmlChar_ptr(n_data, data, 2);
4855 xmlResetLastError();
4856 if (mem_base != xmlMemBlocks()) {
4857 printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4858 xmlMemBlocks() - mem_base);
4859 test_ret++;
4860 printf(" %d", n_ctx);
4861 printf(" %d", n_target);
4862 printf(" %d", n_data);
4863 printf("\n");
4864 }
4865 }
4866 }
4867 }
4868
4869 function_tests++;
4870 return(test_ret);
4871}
4872
4873
4874static int
4875test_xmlSAX2Reference(void) {
4876 int test_ret = 0;
4877
4878 int mem_base;
4879 void * ctx; /* the user data (XML parser context) */
4880 int n_ctx;
4881 xmlChar * name; /* The entity name */
4882 int n_name;
4883
4884 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4885 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4886 mem_base = xmlMemBlocks();
4887 ctx = gen_void_ptr(n_ctx, 0);
4888 name = gen_const_xmlChar_ptr(n_name, 1);
4889
4890 xmlSAX2Reference(ctx, name);
4891 call_tests++;
4892 des_void_ptr(n_ctx, ctx, 0);
4893 des_const_xmlChar_ptr(n_name, name, 1);
4894 xmlResetLastError();
4895 if (mem_base != xmlMemBlocks()) {
4896 printf("Leak of %d blocks found in xmlSAX2Reference",
4897 xmlMemBlocks() - mem_base);
4898 test_ret++;
4899 printf(" %d", n_ctx);
4900 printf(" %d", n_name);
4901 printf("\n");
4902 }
4903 }
4904 }
4905
4906 function_tests++;
4907 return(test_ret);
4908}
4909
4910
4911static int
4912test_xmlSAX2ResolveEntity(void) {
4913 int test_ret = 0;
4914
4915 int mem_base;
4916 xmlParserInputPtr ret_val;
4917 void * ctx; /* the user data (XML parser context) */
4918 int n_ctx;
4919 xmlChar * publicId; /* The public ID of the entity */
4920 int n_publicId;
4921 xmlChar * systemId; /* The system ID of the entity */
4922 int n_systemId;
4923
4924 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4925 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4926 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4927 mem_base = xmlMemBlocks();
4928 ctx = gen_void_ptr(n_ctx, 0);
4929 publicId = gen_const_xmlChar_ptr(n_publicId, 1);
4930 systemId = gen_const_xmlChar_ptr(n_systemId, 2);
4931
4932 ret_val = xmlSAX2ResolveEntity(ctx, publicId, systemId);
4933 desret_xmlParserInputPtr(ret_val);
4934 call_tests++;
4935 des_void_ptr(n_ctx, ctx, 0);
4936 des_const_xmlChar_ptr(n_publicId, publicId, 1);
4937 des_const_xmlChar_ptr(n_systemId, systemId, 2);
4938 xmlResetLastError();
4939 if (mem_base != xmlMemBlocks()) {
4940 printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
4941 xmlMemBlocks() - mem_base);
4942 test_ret++;
4943 printf(" %d", n_ctx);
4944 printf(" %d", n_publicId);
4945 printf(" %d", n_systemId);
4946 printf("\n");
4947 }
4948 }
4949 }
4950 }
4951
4952 function_tests++;
4953 return(test_ret);
4954}
4955
4956
4957#define gen_nb_xmlSAXLocatorPtr 1
4958static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4959 return(NULL);
4960}
4961static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4962}
4963
4964static int
4965test_xmlSAX2SetDocumentLocator(void) {
4966 int test_ret = 0;
4967
4968 int mem_base;
4969 void * ctx; /* the user data (XML parser context) */
4970 int n_ctx;
4971 xmlSAXLocatorPtr loc; /* A SAX Locator */
4972 int n_loc;
4973
4974 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4975 for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
4976 mem_base = xmlMemBlocks();
4977 ctx = gen_void_ptr(n_ctx, 0);
4978 loc = gen_xmlSAXLocatorPtr(n_loc, 1);
4979
4980 xmlSAX2SetDocumentLocator(ctx, loc);
4981 call_tests++;
4982 des_void_ptr(n_ctx, ctx, 0);
4983 des_xmlSAXLocatorPtr(n_loc, loc, 1);
4984 xmlResetLastError();
4985 if (mem_base != xmlMemBlocks()) {
4986 printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
4987 xmlMemBlocks() - mem_base);
4988 test_ret++;
4989 printf(" %d", n_ctx);
4990 printf(" %d", n_loc);
4991 printf("\n");
4992 }
4993 }
4994 }
4995
4996 function_tests++;
4997 return(test_ret);
4998}
4999
5000
5001static int
5002test_xmlSAX2StartDocument(void) {
5003 int test_ret = 0;
5004
5005 int mem_base;
5006 void * ctx; /* the user data (XML parser context) */
5007 int n_ctx;
5008
5009 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5010 mem_base = xmlMemBlocks();
5011 ctx = gen_void_ptr(n_ctx, 0);
5012
5013 xmlSAX2StartDocument(ctx);
5014 call_tests++;
5015 des_void_ptr(n_ctx, ctx, 0);
5016 xmlResetLastError();
5017 if (mem_base != xmlMemBlocks()) {
5018 printf("Leak of %d blocks found in xmlSAX2StartDocument",
5019 xmlMemBlocks() - mem_base);
5020 test_ret++;
5021 printf(" %d", n_ctx);
5022 printf("\n");
5023 }
5024 }
5025
5026 function_tests++;
5027 return(test_ret);
5028}
5029
5030
5031static int
5032test_xmlSAX2StartElement(void) {
5033 int test_ret = 0;
5034
5035 int mem_base;
5036 void * ctx; /* the user data (XML parser context) */
5037 int n_ctx;
5038 xmlChar * fullname; /* The element name, including namespace prefix */
5039 int n_fullname;
5040 xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
5041 int n_atts;
5042
5043 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5044 for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
5045 for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
5046 mem_base = xmlMemBlocks();
5047 ctx = gen_void_ptr(n_ctx, 0);
5048 fullname = gen_const_xmlChar_ptr(n_fullname, 1);
5049 atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
5050
5051 xmlSAX2StartElement(ctx, fullname, atts);
5052 call_tests++;
5053 des_void_ptr(n_ctx, ctx, 0);
5054 des_const_xmlChar_ptr(n_fullname, fullname, 1);
5055 des_const_xmlChar_ptr_ptr(n_atts, atts, 2);
5056 xmlResetLastError();
5057 if (mem_base != xmlMemBlocks()) {
5058 printf("Leak of %d blocks found in xmlSAX2StartElement",
5059 xmlMemBlocks() - mem_base);
5060 test_ret++;
5061 printf(" %d", n_ctx);
5062 printf(" %d", n_fullname);
5063 printf(" %d", n_atts);
5064 printf("\n");
5065 }
5066 }
5067 }
5068 }
5069
5070 function_tests++;
5071 return(test_ret);
5072}
5073
5074
5075static int
5076test_xmlSAX2StartElementNs(void) {
5077 int test_ret = 0;
5078
5079 int mem_base;
5080 void * ctx; /* the user data (XML parser context) */
5081 int n_ctx;
5082 xmlChar * localname; /* the local name of the element */
5083 int n_localname;
5084 xmlChar * prefix; /* the element namespace prefix if available */
5085 int n_prefix;
5086 xmlChar * URI; /* the element namespace name if available */
5087 int n_URI;
5088 int nb_namespaces; /* number of namespace definitions on that node */
5089 int n_nb_namespaces;
5090 xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
5091 int n_namespaces;
5092 int nb_attributes; /* the number of attributes on that node */
5093 int n_nb_attributes;
5094 int nb_defaulted; /* the number of defaulted attributes. */
5095 int n_nb_defaulted;
5096 xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
5097 int n_attributes;
5098
5099 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5100 for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
5101 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
5102 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5103 for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
5104 for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
5105 for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
5106 for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
5107 for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
5108 mem_base = xmlMemBlocks();
5109 ctx = gen_void_ptr(n_ctx, 0);
5110 localname = gen_const_xmlChar_ptr(n_localname, 1);
5111 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
5112 URI = gen_const_xmlChar_ptr(n_URI, 3);
5113 nb_namespaces = gen_int(n_nb_namespaces, 4);
5114 namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
5115 nb_attributes = gen_int(n_nb_attributes, 6);
5116 nb_defaulted = gen_int(n_nb_defaulted, 7);
5117 attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
5118
5119 xmlSAX2StartElementNs(ctx, localname, prefix, URI, nb_namespaces, namespaces, nb_attributes, nb_defaulted, attributes);
5120 call_tests++;
5121 des_void_ptr(n_ctx, ctx, 0);
5122 des_const_xmlChar_ptr(n_localname, localname, 1);
5123 des_const_xmlChar_ptr(n_prefix, prefix, 2);
5124 des_const_xmlChar_ptr(n_URI, URI, 3);
5125 des_int(n_nb_namespaces, nb_namespaces, 4);
5126 des_const_xmlChar_ptr_ptr(n_namespaces, namespaces, 5);
5127 des_int(n_nb_attributes, nb_attributes, 6);
5128 des_int(n_nb_defaulted, nb_defaulted, 7);
5129 des_const_xmlChar_ptr_ptr(n_attributes, attributes, 8);
5130 xmlResetLastError();
5131 if (mem_base != xmlMemBlocks()) {
5132 printf("Leak of %d blocks found in xmlSAX2StartElementNs",
5133 xmlMemBlocks() - mem_base);
5134 test_ret++;
5135 printf(" %d", n_ctx);
5136 printf(" %d", n_localname);
5137 printf(" %d", n_prefix);
5138 printf(" %d", n_URI);
5139 printf(" %d", n_nb_namespaces);
5140 printf(" %d", n_namespaces);
5141 printf(" %d", n_nb_attributes);
5142 printf(" %d", n_nb_defaulted);
5143 printf(" %d", n_attributes);
5144 printf("\n");
5145 }
5146 }
5147 }
5148 }
5149 }
5150 }
5151 }
5152 }
5153 }
5154 }
5155
5156 function_tests++;
5157 return(test_ret);
5158}
5159
5160
5161static int
5162test_xmlSAX2UnparsedEntityDecl(void) {
5163 int test_ret = 0;
5164
5165 int mem_base;
5166 void * ctx; /* the user data (XML parser context) */
5167 int n_ctx;
5168 xmlChar * name; /* The name of the entity */
5169 int n_name;
5170 xmlChar * publicId; /* The public ID of the entity */
5171 int n_publicId;
5172 xmlChar * systemId; /* The system ID of the entity */
5173 int n_systemId;
5174 xmlChar * notationName; /* the name of the notation */
5175 int n_notationName;
5176
5177 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5178 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5179 for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5180 for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5181 for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5182 mem_base = xmlMemBlocks();
5183 ctx = gen_void_ptr(n_ctx, 0);
5184 name = gen_const_xmlChar_ptr(n_name, 1);
5185 publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5186 systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5187 notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5188
5189 xmlSAX2UnparsedEntityDecl(ctx, name, publicId, systemId, notationName);
5190 call_tests++;
5191 des_void_ptr(n_ctx, ctx, 0);
5192 des_const_xmlChar_ptr(n_name, name, 1);
5193 des_const_xmlChar_ptr(n_publicId, publicId, 2);
5194 des_const_xmlChar_ptr(n_systemId, systemId, 3);
5195 des_const_xmlChar_ptr(n_notationName, notationName, 4);
5196 xmlResetLastError();
5197 if (mem_base != xmlMemBlocks()) {
5198 printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5199 xmlMemBlocks() - mem_base);
5200 test_ret++;
5201 printf(" %d", n_ctx);
5202 printf(" %d", n_name);
5203 printf(" %d", n_publicId);
5204 printf(" %d", n_systemId);
5205 printf(" %d", n_notationName);
5206 printf("\n");
5207 }
5208 }
5209 }
5210 }
5211 }
5212 }
5213
5214 function_tests++;
5215 return(test_ret);
5216}
5217
5218
5219static int
5220test_xmlSAXDefaultVersion(void) {
5221 int test_ret = 0;
5222
5223 int mem_base;
5224 int ret_val;
5225 int version; /* the version, 1 or 2 */
5226 int n_version;
5227
5228 for (n_version = 0;n_version < gen_nb_int;n_version++) {
5229 mem_base = xmlMemBlocks();
5230 version = gen_int(n_version, 0);
5231
5232 ret_val = xmlSAXDefaultVersion(version);
5233 desret_int(ret_val);
5234 call_tests++;
5235 des_int(n_version, version, 0);
5236 xmlResetLastError();
5237 if (mem_base != xmlMemBlocks()) {
5238 printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5239 xmlMemBlocks() - mem_base);
5240 test_ret++;
5241 printf(" %d", n_version);
5242 printf("\n");
5243 }
5244 }
5245
5246 function_tests++;
5247 return(test_ret);
5248}
5249
5250
5251static int
5252test_xmlSAXVersion(void) {
5253 int test_ret = 0;
5254
5255 int mem_base;
5256 int ret_val;
5257 xmlSAXHandler * hdlr; /* the SAX handler */
5258 int n_hdlr;
5259 int version; /* the version, 1 or 2 */
5260 int n_version;
5261
5262 for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5263 for (n_version = 0;n_version < gen_nb_int;n_version++) {
5264 mem_base = xmlMemBlocks();
5265 hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5266 version = gen_int(n_version, 1);
5267
5268 ret_val = xmlSAXVersion(hdlr, version);
5269 desret_int(ret_val);
5270 call_tests++;
5271 des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5272 des_int(n_version, version, 1);
5273 xmlResetLastError();
5274 if (mem_base != xmlMemBlocks()) {
5275 printf("Leak of %d blocks found in xmlSAXVersion",
5276 xmlMemBlocks() - mem_base);
5277 test_ret++;
5278 printf(" %d", n_hdlr);
5279 printf(" %d", n_version);
5280 printf("\n");
5281 }
5282 }
5283 }
5284
5285 function_tests++;
5286 return(test_ret);
5287}
5288
5289static int
5290test_SAX2(void) {
5291 int test_ret = 0;
5292
5293 printf("Testing SAX2 : 38 of 38 functions ...\n");
5294 test_ret += test_docbDefaultSAXHandlerInit();
5295 test_ret += test_htmlDefaultSAXHandlerInit();
5296 test_ret += test_xmlDefaultSAXHandlerInit();
5297 test_ret += test_xmlSAX2AttributeDecl();
5298 test_ret += test_xmlSAX2CDataBlock();
5299 test_ret += test_xmlSAX2Characters();
5300 test_ret += test_xmlSAX2Comment();
5301 test_ret += test_xmlSAX2ElementDecl();
5302 test_ret += test_xmlSAX2EndDocument();
5303 test_ret += test_xmlSAX2EndElement();
5304 test_ret += test_xmlSAX2EndElementNs();
5305 test_ret += test_xmlSAX2EntityDecl();
5306 test_ret += test_xmlSAX2ExternalSubset();
5307 test_ret += test_xmlSAX2GetColumnNumber();
5308 test_ret += test_xmlSAX2GetEntity();
5309 test_ret += test_xmlSAX2GetLineNumber();
5310 test_ret += test_xmlSAX2GetParameterEntity();
5311 test_ret += test_xmlSAX2GetPublicId();
5312 test_ret += test_xmlSAX2GetSystemId();
5313 test_ret += test_xmlSAX2HasExternalSubset();
5314 test_ret += test_xmlSAX2HasInternalSubset();
5315 test_ret += test_xmlSAX2IgnorableWhitespace();
5316 test_ret += test_xmlSAX2InitDefaultSAXHandler();
5317 test_ret += test_xmlSAX2InitDocbDefaultSAXHandler();
5318 test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
5319 test_ret += test_xmlSAX2InternalSubset();
5320 test_ret += test_xmlSAX2IsStandalone();
5321 test_ret += test_xmlSAX2NotationDecl();
5322 test_ret += test_xmlSAX2ProcessingInstruction();
5323 test_ret += test_xmlSAX2Reference();
5324 test_ret += test_xmlSAX2ResolveEntity();
5325 test_ret += test_xmlSAX2SetDocumentLocator();
5326 test_ret += test_xmlSAX2StartDocument();
5327 test_ret += test_xmlSAX2StartElement();
5328 test_ret += test_xmlSAX2StartElementNs();
5329 test_ret += test_xmlSAX2UnparsedEntityDecl();
5330 test_ret += test_xmlSAXDefaultVersion();
5331 test_ret += test_xmlSAXVersion();
5332
5333 if (test_ret != 0)
5334 printf("Module SAX2: %d errors\n", test_ret);
5335 return(test_ret);
5336}
5337
Daniel Veillarda82b1822004-11-08 16:24:57 +00005338#define gen_nb_xmlNodeSetPtr 1
5339static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5340 return(NULL);
5341}
5342static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5343}
5344
5345static int
5346test_xmlC14NDocDumpMemory(void) {
5347 int test_ret = 0;
5348
5349#ifdef LIBXML_C14N_ENABLED
5350#ifdef LIBXML_OUTPUT_ENABLED
5351 int mem_base;
5352 int ret_val;
5353 xmlDocPtr doc; /* the XML document for canonization */
5354 int n_doc;
5355 xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5356 int n_nodes;
5357 int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5358 int n_exclusive;
5359 xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
5360 int n_inclusive_ns_prefixes;
5361 int with_comments; /* include comments in the result (!=0) or not (==0) */
5362 int n_with_comments;
5363 xmlChar ** doc_txt_ptr; /* the memory pointer for allocated canonical XML text; the caller of this functions is responsible for calling xmlFree() to free allocated memory */
5364 int n_doc_txt_ptr;
5365
5366 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5367 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5368 for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5369 for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5370 for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5371 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5372 mem_base = xmlMemBlocks();
5373 doc = gen_xmlDocPtr(n_doc, 0);
5374 nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5375 exclusive = gen_int(n_exclusive, 2);
5376 inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5377 with_comments = gen_int(n_with_comments, 4);
5378 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5379
5380 ret_val = xmlC14NDocDumpMemory(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5381 desret_int(ret_val);
5382 call_tests++;
5383 des_xmlDocPtr(n_doc, doc, 0);
5384 des_xmlNodeSetPtr(n_nodes, nodes, 1);
5385 des_int(n_exclusive, exclusive, 2);
5386 des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5387 des_int(n_with_comments, with_comments, 4);
5388 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5389 xmlResetLastError();
5390 if (mem_base != xmlMemBlocks()) {
5391 printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5392 xmlMemBlocks() - mem_base);
5393 test_ret++;
5394 printf(" %d", n_doc);
5395 printf(" %d", n_nodes);
5396 printf(" %d", n_exclusive);
5397 printf(" %d", n_inclusive_ns_prefixes);
5398 printf(" %d", n_with_comments);
5399 printf(" %d", n_doc_txt_ptr);
5400 printf("\n");
5401 }
5402 }
5403 }
5404 }
5405 }
5406 }
5407 }
5408#endif
5409#endif
5410
5411 function_tests++;
5412 return(test_ret);
5413}
5414
5415
5416static int
5417test_xmlC14NDocSave(void) {
5418 int test_ret = 0;
5419
5420#ifdef LIBXML_C14N_ENABLED
5421#ifdef LIBXML_OUTPUT_ENABLED
5422 int mem_base;
5423 int ret_val;
5424 xmlDocPtr doc; /* the XML document for canonization */
5425 int n_doc;
5426 xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5427 int n_nodes;
5428 int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5429 int n_exclusive;
5430 xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
5431 int n_inclusive_ns_prefixes;
5432 int with_comments; /* include comments in the result (!=0) or not (==0) */
5433 int n_with_comments;
5434 const char * filename; /* the filename to store canonical XML image */
5435 int n_filename;
5436 int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5437 int n_compression;
5438
5439 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5440 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5441 for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5442 for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5443 for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5444 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5445 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5446 mem_base = xmlMemBlocks();
5447 doc = gen_xmlDocPtr(n_doc, 0);
5448 nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5449 exclusive = gen_int(n_exclusive, 2);
5450 inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5451 with_comments = gen_int(n_with_comments, 4);
5452 filename = gen_fileoutput(n_filename, 5);
5453 compression = gen_int(n_compression, 6);
5454
5455 ret_val = xmlC14NDocSave(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, filename, compression);
5456 desret_int(ret_val);
5457 call_tests++;
5458 des_xmlDocPtr(n_doc, doc, 0);
5459 des_xmlNodeSetPtr(n_nodes, nodes, 1);
5460 des_int(n_exclusive, exclusive, 2);
5461 des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5462 des_int(n_with_comments, with_comments, 4);
5463 des_fileoutput(n_filename, filename, 5);
5464 des_int(n_compression, compression, 6);
5465 xmlResetLastError();
5466 if (mem_base != xmlMemBlocks()) {
5467 printf("Leak of %d blocks found in xmlC14NDocSave",
5468 xmlMemBlocks() - mem_base);
5469 test_ret++;
5470 printf(" %d", n_doc);
5471 printf(" %d", n_nodes);
5472 printf(" %d", n_exclusive);
5473 printf(" %d", n_inclusive_ns_prefixes);
5474 printf(" %d", n_with_comments);
5475 printf(" %d", n_filename);
5476 printf(" %d", n_compression);
5477 printf("\n");
5478 }
5479 }
5480 }
5481 }
5482 }
5483 }
5484 }
5485 }
5486#endif
5487#endif
5488
5489 function_tests++;
5490 return(test_ret);
5491}
5492
5493
5494static int
5495test_xmlC14NDocSaveTo(void) {
5496 int test_ret = 0;
5497
5498#ifdef LIBXML_C14N_ENABLED
5499#ifdef LIBXML_OUTPUT_ENABLED
5500 int mem_base;
5501 int ret_val;
5502 xmlDocPtr doc; /* the XML document for canonization */
5503 int n_doc;
5504 xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5505 int n_nodes;
5506 int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5507 int n_exclusive;
5508 xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
5509 int n_inclusive_ns_prefixes;
5510 int with_comments; /* include comments in the result (!=0) or not (==0) */
5511 int n_with_comments;
5512 xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5513 int n_buf;
5514
5515 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5516 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5517 for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5518 for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5519 for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5520 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5521 mem_base = xmlMemBlocks();
5522 doc = gen_xmlDocPtr(n_doc, 0);
5523 nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5524 exclusive = gen_int(n_exclusive, 2);
5525 inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5526 with_comments = gen_int(n_with_comments, 4);
5527 buf = gen_xmlOutputBufferPtr(n_buf, 5);
5528
5529 ret_val = xmlC14NDocSaveTo(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, buf);
5530 desret_int(ret_val);
5531 call_tests++;
5532 des_xmlDocPtr(n_doc, doc, 0);
5533 des_xmlNodeSetPtr(n_nodes, nodes, 1);
5534 des_int(n_exclusive, exclusive, 2);
5535 des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5536 des_int(n_with_comments, with_comments, 4);
5537 des_xmlOutputBufferPtr(n_buf, buf, 5);
5538 xmlResetLastError();
5539 if (mem_base != xmlMemBlocks()) {
5540 printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5541 xmlMemBlocks() - mem_base);
5542 test_ret++;
5543 printf(" %d", n_doc);
5544 printf(" %d", n_nodes);
5545 printf(" %d", n_exclusive);
5546 printf(" %d", n_inclusive_ns_prefixes);
5547 printf(" %d", n_with_comments);
5548 printf(" %d", n_buf);
5549 printf("\n");
5550 }
5551 }
5552 }
5553 }
5554 }
5555 }
5556 }
5557#endif
5558#endif
5559
5560 function_tests++;
5561 return(test_ret);
5562}
5563
5564
5565static int
5566test_xmlC14NExecute(void) {
5567 int test_ret = 0;
5568
5569
5570 /* missing type support */
5571 return(test_ret);
5572}
5573
5574static int
5575test_c14n(void) {
5576 int test_ret = 0;
5577
5578 printf("Testing c14n : 3 of 4 functions ...\n");
5579 test_ret += test_xmlC14NDocDumpMemory();
5580 test_ret += test_xmlC14NDocSave();
5581 test_ret += test_xmlC14NDocSaveTo();
5582 test_ret += test_xmlC14NExecute();
5583
5584 if (test_ret != 0)
5585 printf("Module c14n: %d errors\n", test_ret);
5586 return(test_ret);
5587}
5588
Daniel Veillardce682bc2004-11-05 17:22:25 +00005589#define gen_nb_xmlCatalogPtr 1
5590static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5591 return(NULL);
5592}
5593static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5594}
5595
Daniel Veillardd93f6252004-11-02 15:53:51 +00005596static int
Daniel Veillardd93f6252004-11-02 15:53:51 +00005597test_xmlACatalogAdd(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00005598 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00005599
Daniel Veillardce682bc2004-11-05 17:22:25 +00005600#ifdef LIBXML_CATALOG_ENABLED
5601 int mem_base;
5602 int ret_val;
5603 xmlCatalogPtr catal; /* a Catalog */
5604 int n_catal;
5605 xmlChar * type; /* the type of record to add to the catalog */
5606 int n_type;
5607 xmlChar * orig; /* the system, public or prefix to match */
5608 int n_orig;
5609 xmlChar * replace; /* the replacement value for the match */
5610 int n_replace;
Daniel Veillardd93f6252004-11-02 15:53:51 +00005611
Daniel Veillardce682bc2004-11-05 17:22:25 +00005612 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5613 for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5614 for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5615 for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5616 mem_base = xmlMemBlocks();
5617 catal = gen_xmlCatalogPtr(n_catal, 0);
5618 type = gen_const_xmlChar_ptr(n_type, 1);
5619 orig = gen_const_xmlChar_ptr(n_orig, 2);
5620 replace = gen_const_xmlChar_ptr(n_replace, 3);
5621
5622 ret_val = xmlACatalogAdd(catal, type, orig, replace);
5623 desret_int(ret_val);
5624 call_tests++;
5625 des_xmlCatalogPtr(n_catal, catal, 0);
5626 des_const_xmlChar_ptr(n_type, type, 1);
5627 des_const_xmlChar_ptr(n_orig, orig, 2);
5628 des_const_xmlChar_ptr(n_replace, replace, 3);
5629 xmlResetLastError();
5630 if (mem_base != xmlMemBlocks()) {
5631 printf("Leak of %d blocks found in xmlACatalogAdd",
5632 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00005633 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00005634 printf(" %d", n_catal);
5635 printf(" %d", n_type);
5636 printf(" %d", n_orig);
5637 printf(" %d", n_replace);
5638 printf("\n");
5639 }
5640 }
5641 }
5642 }
5643 }
5644#endif
5645
5646 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00005647 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00005648}
5649
5650
5651static int
5652test_xmlACatalogDump(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00005653 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00005654
Daniel Veillardce682bc2004-11-05 17:22:25 +00005655#ifdef LIBXML_CATALOG_ENABLED
5656#ifdef LIBXML_OUTPUT_ENABLED
5657 int mem_base;
5658 xmlCatalogPtr catal; /* a Catalog */
5659 int n_catal;
5660 FILE * out; /* the file. */
5661 int n_out;
Daniel Veillardd93f6252004-11-02 15:53:51 +00005662
Daniel Veillardce682bc2004-11-05 17:22:25 +00005663 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5664 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5665 mem_base = xmlMemBlocks();
5666 catal = gen_xmlCatalogPtr(n_catal, 0);
5667 out = gen_FILE_ptr(n_out, 1);
5668
5669 xmlACatalogDump(catal, out);
5670 call_tests++;
5671 des_xmlCatalogPtr(n_catal, catal, 0);
5672 des_FILE_ptr(n_out, out, 1);
5673 xmlResetLastError();
5674 if (mem_base != xmlMemBlocks()) {
5675 printf("Leak of %d blocks found in xmlACatalogDump",
5676 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00005677 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00005678 printf(" %d", n_catal);
5679 printf(" %d", n_out);
5680 printf("\n");
5681 }
5682 }
5683 }
5684#endif
5685#endif
5686
5687 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00005688 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00005689}
5690
5691
5692static int
5693test_xmlACatalogRemove(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00005694 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00005695
Daniel Veillardce682bc2004-11-05 17:22:25 +00005696#ifdef LIBXML_CATALOG_ENABLED
5697 int mem_base;
5698 int ret_val;
5699 xmlCatalogPtr catal; /* a Catalog */
5700 int n_catal;
5701 xmlChar * value; /* the value to remove */
5702 int n_value;
Daniel Veillardd93f6252004-11-02 15:53:51 +00005703
Daniel Veillardce682bc2004-11-05 17:22:25 +00005704 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5705 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5706 mem_base = xmlMemBlocks();
5707 catal = gen_xmlCatalogPtr(n_catal, 0);
5708 value = gen_const_xmlChar_ptr(n_value, 1);
5709
5710 ret_val = xmlACatalogRemove(catal, value);
5711 desret_int(ret_val);
5712 call_tests++;
5713 des_xmlCatalogPtr(n_catal, catal, 0);
5714 des_const_xmlChar_ptr(n_value, value, 1);
5715 xmlResetLastError();
5716 if (mem_base != xmlMemBlocks()) {
5717 printf("Leak of %d blocks found in xmlACatalogRemove",
5718 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00005719 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00005720 printf(" %d", n_catal);
5721 printf(" %d", n_value);
5722 printf("\n");
5723 }
5724 }
5725 }
5726#endif
5727
5728 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00005729 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00005730}
5731
5732
5733static int
5734test_xmlACatalogResolve(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00005735 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00005736
Daniel Veillardce682bc2004-11-05 17:22:25 +00005737#ifdef LIBXML_CATALOG_ENABLED
5738 int mem_base;
5739 xmlChar * ret_val;
5740 xmlCatalogPtr catal; /* a Catalog */
5741 int n_catal;
5742 xmlChar * pubID; /* the public ID string */
5743 int n_pubID;
5744 xmlChar * sysID; /* the system ID string */
5745 int n_sysID;
Daniel Veillardd93f6252004-11-02 15:53:51 +00005746
Daniel Veillardce682bc2004-11-05 17:22:25 +00005747 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5748 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5749 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5750 mem_base = xmlMemBlocks();
5751 catal = gen_xmlCatalogPtr(n_catal, 0);
5752 pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5753 sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5754
5755 ret_val = xmlACatalogResolve(catal, pubID, sysID);
5756 desret_xmlChar_ptr(ret_val);
5757 call_tests++;
5758 des_xmlCatalogPtr(n_catal, catal, 0);
5759 des_const_xmlChar_ptr(n_pubID, pubID, 1);
5760 des_const_xmlChar_ptr(n_sysID, sysID, 2);
5761 xmlResetLastError();
5762 if (mem_base != xmlMemBlocks()) {
5763 printf("Leak of %d blocks found in xmlACatalogResolve",
5764 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00005765 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00005766 printf(" %d", n_catal);
5767 printf(" %d", n_pubID);
5768 printf(" %d", n_sysID);
5769 printf("\n");
5770 }
5771 }
5772 }
5773 }
5774#endif
5775
5776 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00005777 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00005778}
5779
5780
5781static int
5782test_xmlACatalogResolvePublic(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00005783 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00005784
Daniel Veillardce682bc2004-11-05 17:22:25 +00005785#ifdef LIBXML_CATALOG_ENABLED
5786 int mem_base;
5787 xmlChar * ret_val;
5788 xmlCatalogPtr catal; /* a Catalog */
5789 int n_catal;
5790 xmlChar * pubID; /* the public ID string */
5791 int n_pubID;
Daniel Veillardd93f6252004-11-02 15:53:51 +00005792
Daniel Veillardce682bc2004-11-05 17:22:25 +00005793 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5794 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5795 mem_base = xmlMemBlocks();
5796 catal = gen_xmlCatalogPtr(n_catal, 0);
5797 pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5798
5799 ret_val = xmlACatalogResolvePublic(catal, pubID);
5800 desret_xmlChar_ptr(ret_val);
5801 call_tests++;
5802 des_xmlCatalogPtr(n_catal, catal, 0);
5803 des_const_xmlChar_ptr(n_pubID, pubID, 1);
5804 xmlResetLastError();
5805 if (mem_base != xmlMemBlocks()) {
5806 printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5807 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00005808 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00005809 printf(" %d", n_catal);
5810 printf(" %d", n_pubID);
5811 printf("\n");
5812 }
5813 }
5814 }
5815#endif
5816
5817 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00005818 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00005819}
5820
5821
5822static int
5823test_xmlACatalogResolveSystem(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00005824 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00005825
Daniel Veillardce682bc2004-11-05 17:22:25 +00005826#ifdef LIBXML_CATALOG_ENABLED
5827 int mem_base;
5828 xmlChar * ret_val;
5829 xmlCatalogPtr catal; /* a Catalog */
5830 int n_catal;
5831 xmlChar * sysID; /* the system ID string */
5832 int n_sysID;
Daniel Veillardd93f6252004-11-02 15:53:51 +00005833
Daniel Veillardce682bc2004-11-05 17:22:25 +00005834 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5835 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5836 mem_base = xmlMemBlocks();
5837 catal = gen_xmlCatalogPtr(n_catal, 0);
5838 sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5839
5840 ret_val = xmlACatalogResolveSystem(catal, sysID);
5841 desret_xmlChar_ptr(ret_val);
5842 call_tests++;
5843 des_xmlCatalogPtr(n_catal, catal, 0);
5844 des_const_xmlChar_ptr(n_sysID, sysID, 1);
5845 xmlResetLastError();
5846 if (mem_base != xmlMemBlocks()) {
5847 printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5848 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00005849 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00005850 printf(" %d", n_catal);
5851 printf(" %d", n_sysID);
5852 printf("\n");
5853 }
5854 }
5855 }
5856#endif
5857
5858 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00005859 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00005860}
5861
5862
5863static int
5864test_xmlACatalogResolveURI(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00005865 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00005866
Daniel Veillardce682bc2004-11-05 17:22:25 +00005867#ifdef LIBXML_CATALOG_ENABLED
5868 int mem_base;
5869 xmlChar * ret_val;
5870 xmlCatalogPtr catal; /* a Catalog */
5871 int n_catal;
5872 xmlChar * URI; /* the URI */
5873 int n_URI;
Daniel Veillardd93f6252004-11-02 15:53:51 +00005874
Daniel Veillardce682bc2004-11-05 17:22:25 +00005875 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5876 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5877 mem_base = xmlMemBlocks();
5878 catal = gen_xmlCatalogPtr(n_catal, 0);
5879 URI = gen_const_xmlChar_ptr(n_URI, 1);
5880
5881 ret_val = xmlACatalogResolveURI(catal, URI);
5882 desret_xmlChar_ptr(ret_val);
5883 call_tests++;
5884 des_xmlCatalogPtr(n_catal, catal, 0);
5885 des_const_xmlChar_ptr(n_URI, URI, 1);
5886 xmlResetLastError();
5887 if (mem_base != xmlMemBlocks()) {
5888 printf("Leak of %d blocks found in xmlACatalogResolveURI",
5889 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00005890 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00005891 printf(" %d", n_catal);
5892 printf(" %d", n_URI);
5893 printf("\n");
5894 }
5895 }
5896 }
5897#endif
5898
5899 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00005900 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00005901}
5902
5903
5904static int
5905test_xmlCatalogAdd(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00005906 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00005907
5908#ifdef LIBXML_CATALOG_ENABLED
5909 int mem_base;
5910 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +00005911 xmlChar * type; /* the type of record to add to the catalog */
Daniel Veillardd93f6252004-11-02 15:53:51 +00005912 int n_type;
Daniel Veillardce682bc2004-11-05 17:22:25 +00005913 xmlChar * orig; /* the system, public or prefix to match */
Daniel Veillardd93f6252004-11-02 15:53:51 +00005914 int n_orig;
Daniel Veillardce682bc2004-11-05 17:22:25 +00005915 xmlChar * replace; /* the replacement value for the match */
Daniel Veillardd93f6252004-11-02 15:53:51 +00005916 int n_replace;
5917
5918 for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5919 for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5920 for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5921 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00005922 type = gen_const_xmlChar_ptr(n_type, 0);
5923 orig = gen_const_xmlChar_ptr(n_orig, 1);
5924 replace = gen_const_xmlChar_ptr(n_replace, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +00005925
5926 ret_val = xmlCatalogAdd(type, orig, replace);
5927 desret_int(ret_val);
5928 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00005929 des_const_xmlChar_ptr(n_type, type, 0);
5930 des_const_xmlChar_ptr(n_orig, orig, 1);
5931 des_const_xmlChar_ptr(n_replace, replace, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +00005932 xmlResetLastError();
5933 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +00005934 printf("Leak of %d blocks found in xmlCatalogAdd",
Daniel Veillardd93f6252004-11-02 15:53:51 +00005935 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00005936 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00005937 printf(" %d", n_type);
5938 printf(" %d", n_orig);
5939 printf(" %d", n_replace);
5940 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +00005941 }
5942 }
5943 }
5944 }
5945#endif
5946
Daniel Veillard3d97e662004-11-04 10:49:00 +00005947 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00005948 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00005949}
5950
5951
5952static int
Daniel Veillardd93f6252004-11-02 15:53:51 +00005953test_xmlCatalogCleanup(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00005954 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00005955
5956#ifdef LIBXML_CATALOG_ENABLED
Daniel Veillardd93f6252004-11-02 15:53:51 +00005957
Daniel Veillardd93f6252004-11-02 15:53:51 +00005958
5959 xmlCatalogCleanup();
5960 call_tests++;
5961 xmlResetLastError();
Daniel Veillardd93f6252004-11-02 15:53:51 +00005962#endif
5963
Daniel Veillard3d97e662004-11-04 10:49:00 +00005964 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00005965 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00005966}
5967
5968
5969static int
5970test_xmlCatalogConvert(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00005971 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00005972
5973#ifdef LIBXML_CATALOG_ENABLED
5974 int ret_val;
5975
5976
5977 ret_val = xmlCatalogConvert();
5978 desret_int(ret_val);
5979 call_tests++;
5980 xmlResetLastError();
5981#endif
5982
Daniel Veillard3d97e662004-11-04 10:49:00 +00005983 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00005984 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00005985}
5986
5987
5988static int
5989test_xmlCatalogDump(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00005990 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00005991
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00005992#ifdef LIBXML_CATALOG_ENABLED
5993#ifdef LIBXML_OUTPUT_ENABLED
5994 int mem_base;
5995 FILE * out; /* the file. */
5996 int n_out;
Daniel Veillardd93f6252004-11-02 15:53:51 +00005997
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00005998 for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5999 mem_base = xmlMemBlocks();
6000 out = gen_FILE_ptr(n_out, 0);
6001
6002 xmlCatalogDump(out);
6003 call_tests++;
6004 des_FILE_ptr(n_out, out, 0);
6005 xmlResetLastError();
6006 if (mem_base != xmlMemBlocks()) {
6007 printf("Leak of %d blocks found in xmlCatalogDump",
6008 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006009 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00006010 printf(" %d", n_out);
6011 printf("\n");
6012 }
6013 }
6014#endif
6015#endif
6016
6017 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006018 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006019}
6020
6021
6022static int
6023test_xmlCatalogGetDefaults(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006024 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006025
Daniel Veillard57b25162004-11-06 14:50:18 +00006026#ifdef LIBXML_CATALOG_ENABLED
6027 int mem_base;
6028 xmlCatalogAllow ret_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006029
Daniel Veillard57b25162004-11-06 14:50:18 +00006030 mem_base = xmlMemBlocks();
6031
6032 ret_val = xmlCatalogGetDefaults();
6033 desret_xmlCatalogAllow(ret_val);
6034 call_tests++;
6035 xmlResetLastError();
6036 if (mem_base != xmlMemBlocks()) {
6037 printf("Leak of %d blocks found in xmlCatalogGetDefaults",
6038 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006039 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +00006040 printf("\n");
6041 }
6042#endif
6043
6044 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006045 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006046}
6047
6048
6049static int
Daniel Veillardd93f6252004-11-02 15:53:51 +00006050test_xmlCatalogIsEmpty(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006051 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006052
Daniel Veillardce682bc2004-11-05 17:22:25 +00006053#ifdef LIBXML_CATALOG_ENABLED
6054 int mem_base;
6055 int ret_val;
6056 xmlCatalogPtr catal; /* should this create an SGML catalog */
6057 int n_catal;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006058
Daniel Veillardce682bc2004-11-05 17:22:25 +00006059 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6060 mem_base = xmlMemBlocks();
6061 catal = gen_xmlCatalogPtr(n_catal, 0);
6062
6063 ret_val = xmlCatalogIsEmpty(catal);
6064 desret_int(ret_val);
6065 call_tests++;
6066 des_xmlCatalogPtr(n_catal, catal, 0);
6067 xmlResetLastError();
6068 if (mem_base != xmlMemBlocks()) {
6069 printf("Leak of %d blocks found in xmlCatalogIsEmpty",
6070 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006071 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00006072 printf(" %d", n_catal);
6073 printf("\n");
6074 }
6075 }
6076#endif
6077
6078 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006079 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006080}
6081
6082
6083static int
6084test_xmlCatalogLocalResolve(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006085 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006086
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00006087#ifdef LIBXML_CATALOG_ENABLED
6088 int mem_base;
6089 xmlChar * ret_val;
6090 void * catalogs; /* a document's list of catalogs */
6091 int n_catalogs;
Daniel Veillardce682bc2004-11-05 17:22:25 +00006092 xmlChar * pubID; /* the public ID string */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00006093 int n_pubID;
Daniel Veillardce682bc2004-11-05 17:22:25 +00006094 xmlChar * sysID; /* the system ID string */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00006095 int n_sysID;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006096
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00006097 for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6098 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6099 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6100 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00006101 catalogs = gen_void_ptr(n_catalogs, 0);
6102 pubID = gen_const_xmlChar_ptr(n_pubID, 1);
6103 sysID = gen_const_xmlChar_ptr(n_sysID, 2);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00006104
6105 ret_val = xmlCatalogLocalResolve(catalogs, pubID, sysID);
6106 desret_xmlChar_ptr(ret_val);
6107 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00006108 des_void_ptr(n_catalogs, catalogs, 0);
6109 des_const_xmlChar_ptr(n_pubID, pubID, 1);
6110 des_const_xmlChar_ptr(n_sysID, sysID, 2);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00006111 xmlResetLastError();
6112 if (mem_base != xmlMemBlocks()) {
6113 printf("Leak of %d blocks found in xmlCatalogLocalResolve",
6114 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006115 test_ret++;
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00006116 printf(" %d", n_catalogs);
6117 printf(" %d", n_pubID);
6118 printf(" %d", n_sysID);
6119 printf("\n");
6120 }
6121 }
6122 }
6123 }
6124#endif
6125
Daniel Veillard3d97e662004-11-04 10:49:00 +00006126 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006127 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006128}
6129
6130
6131static int
6132test_xmlCatalogLocalResolveURI(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006133 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006134
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00006135#ifdef LIBXML_CATALOG_ENABLED
6136 int mem_base;
6137 xmlChar * ret_val;
6138 void * catalogs; /* a document's list of catalogs */
6139 int n_catalogs;
Daniel Veillardce682bc2004-11-05 17:22:25 +00006140 xmlChar * URI; /* the URI */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00006141 int n_URI;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006142
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00006143 for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6144 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6145 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00006146 catalogs = gen_void_ptr(n_catalogs, 0);
6147 URI = gen_const_xmlChar_ptr(n_URI, 1);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00006148
6149 ret_val = xmlCatalogLocalResolveURI(catalogs, URI);
6150 desret_xmlChar_ptr(ret_val);
6151 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00006152 des_void_ptr(n_catalogs, catalogs, 0);
6153 des_const_xmlChar_ptr(n_URI, URI, 1);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00006154 xmlResetLastError();
6155 if (mem_base != xmlMemBlocks()) {
6156 printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
6157 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006158 test_ret++;
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00006159 printf(" %d", n_catalogs);
6160 printf(" %d", n_URI);
6161 printf("\n");
6162 }
6163 }
6164 }
6165#endif
6166
Daniel Veillard3d97e662004-11-04 10:49:00 +00006167 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006168 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006169}
6170
6171
6172static int
6173test_xmlCatalogRemove(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006174 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006175
6176#ifdef LIBXML_CATALOG_ENABLED
6177 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +00006178 xmlChar * value; /* the value to remove */
Daniel Veillardd93f6252004-11-02 15:53:51 +00006179 int n_value;
6180
6181 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
Daniel Veillard3d97e662004-11-04 10:49:00 +00006182 value = gen_const_xmlChar_ptr(n_value, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006183
6184 ret_val = xmlCatalogRemove(value);
6185 desret_int(ret_val);
6186 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00006187 des_const_xmlChar_ptr(n_value, value, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006188 xmlResetLastError();
6189 }
6190#endif
6191
Daniel Veillard3d97e662004-11-04 10:49:00 +00006192 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006193 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006194}
6195
6196
6197static int
6198test_xmlCatalogResolve(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006199 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006200
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006201#ifdef LIBXML_CATALOG_ENABLED
6202 int mem_base;
6203 xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +00006204 xmlChar * pubID; /* the public ID string */
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006205 int n_pubID;
Daniel Veillardce682bc2004-11-05 17:22:25 +00006206 xmlChar * sysID; /* the system ID string */
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006207 int n_sysID;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006208
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006209 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6210 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6211 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00006212 pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6213 sysID = gen_const_xmlChar_ptr(n_sysID, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006214
6215 ret_val = xmlCatalogResolve(pubID, sysID);
6216 desret_xmlChar_ptr(ret_val);
6217 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00006218 des_const_xmlChar_ptr(n_pubID, pubID, 0);
6219 des_const_xmlChar_ptr(n_sysID, sysID, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006220 xmlResetLastError();
6221 if (mem_base != xmlMemBlocks()) {
6222 printf("Leak of %d blocks found in xmlCatalogResolve",
6223 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006224 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006225 printf(" %d", n_pubID);
6226 printf(" %d", n_sysID);
6227 printf("\n");
6228 }
6229 }
6230 }
6231#endif
6232
Daniel Veillard3d97e662004-11-04 10:49:00 +00006233 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006234 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006235}
6236
6237
6238static int
6239test_xmlCatalogResolvePublic(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006240 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006241
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006242#ifdef LIBXML_CATALOG_ENABLED
6243 int mem_base;
6244 xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +00006245 xmlChar * pubID; /* the public ID string */
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006246 int n_pubID;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006247
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006248 for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6249 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00006250 pubID = gen_const_xmlChar_ptr(n_pubID, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006251
6252 ret_val = xmlCatalogResolvePublic(pubID);
6253 desret_xmlChar_ptr(ret_val);
6254 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00006255 des_const_xmlChar_ptr(n_pubID, pubID, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006256 xmlResetLastError();
6257 if (mem_base != xmlMemBlocks()) {
6258 printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6259 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006260 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006261 printf(" %d", n_pubID);
6262 printf("\n");
6263 }
6264 }
6265#endif
6266
Daniel Veillard3d97e662004-11-04 10:49:00 +00006267 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006268 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006269}
6270
6271
6272static int
6273test_xmlCatalogResolveSystem(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006274 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006275
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006276#ifdef LIBXML_CATALOG_ENABLED
6277 int mem_base;
6278 xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +00006279 xmlChar * sysID; /* the system ID string */
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006280 int n_sysID;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006281
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006282 for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6283 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00006284 sysID = gen_const_xmlChar_ptr(n_sysID, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006285
6286 ret_val = xmlCatalogResolveSystem(sysID);
6287 desret_xmlChar_ptr(ret_val);
6288 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00006289 des_const_xmlChar_ptr(n_sysID, sysID, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006290 xmlResetLastError();
6291 if (mem_base != xmlMemBlocks()) {
6292 printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6293 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006294 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006295 printf(" %d", n_sysID);
6296 printf("\n");
6297 }
6298 }
6299#endif
6300
Daniel Veillard3d97e662004-11-04 10:49:00 +00006301 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006302 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006303}
6304
6305
6306static int
6307test_xmlCatalogResolveURI(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006308 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006309
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006310#ifdef LIBXML_CATALOG_ENABLED
6311 int mem_base;
6312 xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +00006313 xmlChar * URI; /* the URI */
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006314 int n_URI;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006315
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006316 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6317 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00006318 URI = gen_const_xmlChar_ptr(n_URI, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006319
6320 ret_val = xmlCatalogResolveURI(URI);
6321 desret_xmlChar_ptr(ret_val);
6322 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00006323 des_const_xmlChar_ptr(n_URI, URI, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006324 xmlResetLastError();
6325 if (mem_base != xmlMemBlocks()) {
6326 printf("Leak of %d blocks found in xmlCatalogResolveURI",
6327 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006328 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +00006329 printf(" %d", n_URI);
6330 printf("\n");
6331 }
6332 }
6333#endif
6334
Daniel Veillard3d97e662004-11-04 10:49:00 +00006335 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006336 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006337}
6338
6339
6340static int
Daniel Veillardd93f6252004-11-02 15:53:51 +00006341test_xmlCatalogSetDefaultPrefer(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006342 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006343
Daniel Veillard57b25162004-11-06 14:50:18 +00006344#ifdef LIBXML_CATALOG_ENABLED
6345 int mem_base;
6346 xmlCatalogPrefer ret_val;
6347 xmlCatalogPrefer prefer; /* the default preference for delegation */
6348 int n_prefer;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006349
Daniel Veillard57b25162004-11-06 14:50:18 +00006350 for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6351 mem_base = xmlMemBlocks();
6352 prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6353
6354 ret_val = xmlCatalogSetDefaultPrefer(prefer);
6355 desret_xmlCatalogPrefer(ret_val);
6356 call_tests++;
6357 des_xmlCatalogPrefer(n_prefer, prefer, 0);
6358 xmlResetLastError();
6359 if (mem_base != xmlMemBlocks()) {
6360 printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6361 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006362 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +00006363 printf(" %d", n_prefer);
6364 printf("\n");
6365 }
6366 }
6367#endif
6368
6369 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006370 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006371}
6372
6373
6374static int
6375test_xmlCatalogSetDefaults(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006376 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006377
Daniel Veillard57b25162004-11-06 14:50:18 +00006378#ifdef LIBXML_CATALOG_ENABLED
6379 int mem_base;
6380 xmlCatalogAllow allow; /* what catalogs should be accepted */
6381 int n_allow;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006382
Daniel Veillard57b25162004-11-06 14:50:18 +00006383 for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6384 mem_base = xmlMemBlocks();
6385 allow = gen_xmlCatalogAllow(n_allow, 0);
6386
6387 xmlCatalogSetDefaults(allow);
6388 call_tests++;
6389 des_xmlCatalogAllow(n_allow, allow, 0);
6390 xmlResetLastError();
6391 if (mem_base != xmlMemBlocks()) {
6392 printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6393 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006394 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +00006395 printf(" %d", n_allow);
6396 printf("\n");
6397 }
6398 }
6399#endif
6400
6401 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006402 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006403}
6404
6405
6406static int
6407test_xmlConvertSGMLCatalog(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006408 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006409
Daniel Veillardce682bc2004-11-05 17:22:25 +00006410#ifdef LIBXML_CATALOG_ENABLED
6411 int mem_base;
6412 int ret_val;
6413 xmlCatalogPtr catal; /* the catalog */
6414 int n_catal;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006415
Daniel Veillardce682bc2004-11-05 17:22:25 +00006416 for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6417 mem_base = xmlMemBlocks();
6418 catal = gen_xmlCatalogPtr(n_catal, 0);
6419
6420 ret_val = xmlConvertSGMLCatalog(catal);
6421 desret_int(ret_val);
6422 call_tests++;
6423 des_xmlCatalogPtr(n_catal, catal, 0);
6424 xmlResetLastError();
6425 if (mem_base != xmlMemBlocks()) {
6426 printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6427 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006428 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00006429 printf(" %d", n_catal);
6430 printf("\n");
6431 }
6432 }
6433#endif
6434
6435 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006436 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006437}
6438
6439
6440static int
6441test_xmlInitializeCatalog(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006442 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006443
6444#ifdef LIBXML_CATALOG_ENABLED
6445 int mem_base;
6446
6447 mem_base = xmlMemBlocks();
6448
6449 xmlInitializeCatalog();
6450 call_tests++;
6451 xmlResetLastError();
6452 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +00006453 printf("Leak of %d blocks found in xmlInitializeCatalog",
Daniel Veillardd93f6252004-11-02 15:53:51 +00006454 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006455 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00006456 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +00006457 }
6458#endif
6459
Daniel Veillard3d97e662004-11-04 10:49:00 +00006460 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006461 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006462}
6463
6464
6465static int
6466test_xmlLoadACatalog(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006467 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006468
6469
6470 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +00006471 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006472}
6473
6474
6475static int
6476test_xmlLoadCatalog(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006477 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006478
6479#ifdef LIBXML_CATALOG_ENABLED
6480 int ret_val;
6481 const char * filename; /* a file path */
6482 int n_filename;
6483
6484 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
Daniel Veillard3d97e662004-11-04 10:49:00 +00006485 filename = gen_filepath(n_filename, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006486
6487 ret_val = xmlLoadCatalog(filename);
6488 desret_int(ret_val);
6489 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00006490 des_filepath(n_filename, filename, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006491 xmlResetLastError();
6492 }
6493#endif
6494
Daniel Veillard3d97e662004-11-04 10:49:00 +00006495 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006496 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006497}
6498
6499
6500static int
6501test_xmlLoadCatalogs(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006502 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006503
6504#ifdef LIBXML_CATALOG_ENABLED
Daniel Veillardce682bc2004-11-05 17:22:25 +00006505 char * pathss; /* a list of directories separated by a colon or a space. */
Daniel Veillardd93f6252004-11-02 15:53:51 +00006506 int n_pathss;
6507
6508 for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
Daniel Veillard3d97e662004-11-04 10:49:00 +00006509 pathss = gen_const_char_ptr(n_pathss, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006510
6511 xmlLoadCatalogs(pathss);
6512 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00006513 des_const_char_ptr(n_pathss, pathss, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006514 xmlResetLastError();
6515 }
6516#endif
6517
Daniel Veillard3d97e662004-11-04 10:49:00 +00006518 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006519 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006520}
6521
6522
6523static int
6524test_xmlLoadSGMLSuperCatalog(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006525 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006526
6527
6528 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +00006529 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006530}
6531
6532
6533static int
6534test_xmlNewCatalog(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006535 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006536
6537
6538 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +00006539 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006540}
6541
6542
6543static int
6544test_xmlParseCatalogFile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006545 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006546
6547#ifdef LIBXML_CATALOG_ENABLED
6548 int mem_base;
6549 xmlDocPtr ret_val;
6550 const char * filename; /* the filename */
6551 int n_filename;
6552
6553 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6554 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00006555 filename = gen_filepath(n_filename, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006556
6557 ret_val = xmlParseCatalogFile(filename);
6558 desret_xmlDocPtr(ret_val);
6559 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00006560 des_filepath(n_filename, filename, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006561 xmlResetLastError();
6562 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +00006563 printf("Leak of %d blocks found in xmlParseCatalogFile",
Daniel Veillardd93f6252004-11-02 15:53:51 +00006564 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006565 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00006566 printf(" %d", n_filename);
6567 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +00006568 }
6569 }
6570#endif
6571
Daniel Veillard3d97e662004-11-04 10:49:00 +00006572 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006573 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006574}
6575
6576static int
6577test_catalog(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006578 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006579
Daniel Veillardc2c894f2004-11-07 12:17:35 +00006580 printf("Testing catalog : 27 of 36 functions ...\n");
Daniel Veillard42595322004-11-08 10:52:06 +00006581 test_ret += test_xmlACatalogAdd();
6582 test_ret += test_xmlACatalogDump();
6583 test_ret += test_xmlACatalogRemove();
6584 test_ret += test_xmlACatalogResolve();
6585 test_ret += test_xmlACatalogResolvePublic();
6586 test_ret += test_xmlACatalogResolveSystem();
6587 test_ret += test_xmlACatalogResolveURI();
6588 test_ret += test_xmlCatalogAdd();
6589 test_ret += test_xmlCatalogCleanup();
6590 test_ret += test_xmlCatalogConvert();
6591 test_ret += test_xmlCatalogDump();
6592 test_ret += test_xmlCatalogGetDefaults();
6593 test_ret += test_xmlCatalogIsEmpty();
6594 test_ret += test_xmlCatalogLocalResolve();
6595 test_ret += test_xmlCatalogLocalResolveURI();
6596 test_ret += test_xmlCatalogRemove();
6597 test_ret += test_xmlCatalogResolve();
6598 test_ret += test_xmlCatalogResolvePublic();
6599 test_ret += test_xmlCatalogResolveSystem();
6600 test_ret += test_xmlCatalogResolveURI();
6601 test_ret += test_xmlCatalogSetDefaultPrefer();
6602 test_ret += test_xmlCatalogSetDefaults();
6603 test_ret += test_xmlConvertSGMLCatalog();
6604 test_ret += test_xmlInitializeCatalog();
6605 test_ret += test_xmlLoadACatalog();
6606 test_ret += test_xmlLoadCatalog();
6607 test_ret += test_xmlLoadCatalogs();
6608 test_ret += test_xmlLoadSGMLSuperCatalog();
6609 test_ret += test_xmlNewCatalog();
6610 test_ret += test_xmlParseCatalogFile();
Daniel Veillardd93f6252004-11-02 15:53:51 +00006611
Daniel Veillard42595322004-11-08 10:52:06 +00006612 if (test_ret != 0)
6613 printf("Module catalog: %d errors\n", test_ret);
6614 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006615}
6616
Daniel Veillardce682bc2004-11-05 17:22:25 +00006617#define gen_nb_const_xmlChRangeGroupPtr 1
6618static xmlChRangeGroupPtr gen_const_xmlChRangeGroupPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6619 return(NULL);
6620}
6621static void des_const_xmlChRangeGroupPtr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroupPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6622}
6623
Daniel Veillardd93f6252004-11-02 15:53:51 +00006624static int
6625test_xmlCharInRange(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006626 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006627
Daniel Veillardce682bc2004-11-05 17:22:25 +00006628 int mem_base;
6629 int ret_val;
6630 unsigned int val; /* character to be validated */
6631 int n_val;
6632 xmlChRangeGroupPtr rptr; /* pointer to range to be used to validate */
6633 int n_rptr;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006634
Daniel Veillardce682bc2004-11-05 17:22:25 +00006635 for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6636 for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroupPtr;n_rptr++) {
6637 mem_base = xmlMemBlocks();
6638 val = gen_unsigned_int(n_val, 0);
6639 rptr = gen_const_xmlChRangeGroupPtr(n_rptr, 1);
6640
6641 ret_val = xmlCharInRange(val, rptr);
6642 desret_int(ret_val);
6643 call_tests++;
6644 des_unsigned_int(n_val, val, 0);
6645 des_const_xmlChRangeGroupPtr(n_rptr, rptr, 1);
6646 xmlResetLastError();
6647 if (mem_base != xmlMemBlocks()) {
6648 printf("Leak of %d blocks found in xmlCharInRange",
6649 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006650 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00006651 printf(" %d", n_val);
6652 printf(" %d", n_rptr);
6653 printf("\n");
6654 }
6655 }
6656 }
6657
6658 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006659 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006660}
6661
6662
6663static int
6664test_xmlIsBaseChar(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006665 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006666
Daniel Veillard3d97e662004-11-04 10:49:00 +00006667 int mem_base;
6668 int ret_val;
6669 unsigned int ch; /* character to validate */
6670 int n_ch;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006671
Daniel Veillard3d97e662004-11-04 10:49:00 +00006672 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6673 mem_base = xmlMemBlocks();
6674 ch = gen_unsigned_int(n_ch, 0);
6675
6676 ret_val = xmlIsBaseChar(ch);
6677 desret_int(ret_val);
6678 call_tests++;
6679 des_unsigned_int(n_ch, ch, 0);
6680 xmlResetLastError();
6681 if (mem_base != xmlMemBlocks()) {
6682 printf("Leak of %d blocks found in xmlIsBaseChar",
6683 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006684 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00006685 printf(" %d", n_ch);
6686 printf("\n");
6687 }
6688 }
6689
6690 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006691 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006692}
6693
6694
6695static int
6696test_xmlIsBlank(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006697 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006698
Daniel Veillard3d97e662004-11-04 10:49:00 +00006699 int mem_base;
6700 int ret_val;
6701 unsigned int ch; /* character to validate */
6702 int n_ch;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006703
Daniel Veillard3d97e662004-11-04 10:49:00 +00006704 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6705 mem_base = xmlMemBlocks();
6706 ch = gen_unsigned_int(n_ch, 0);
6707
6708 ret_val = xmlIsBlank(ch);
6709 desret_int(ret_val);
6710 call_tests++;
6711 des_unsigned_int(n_ch, ch, 0);
6712 xmlResetLastError();
6713 if (mem_base != xmlMemBlocks()) {
6714 printf("Leak of %d blocks found in xmlIsBlank",
6715 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006716 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00006717 printf(" %d", n_ch);
6718 printf("\n");
6719 }
6720 }
6721
6722 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006723 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006724}
6725
6726
6727static int
6728test_xmlIsChar(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006729 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006730
Daniel Veillard3d97e662004-11-04 10:49:00 +00006731 int mem_base;
6732 int ret_val;
6733 unsigned int ch; /* character to validate */
6734 int n_ch;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006735
Daniel Veillard3d97e662004-11-04 10:49:00 +00006736 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6737 mem_base = xmlMemBlocks();
6738 ch = gen_unsigned_int(n_ch, 0);
6739
6740 ret_val = xmlIsChar(ch);
6741 desret_int(ret_val);
6742 call_tests++;
6743 des_unsigned_int(n_ch, ch, 0);
6744 xmlResetLastError();
6745 if (mem_base != xmlMemBlocks()) {
6746 printf("Leak of %d blocks found in xmlIsChar",
6747 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006748 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00006749 printf(" %d", n_ch);
6750 printf("\n");
6751 }
6752 }
6753
6754 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006755 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006756}
6757
6758
6759static int
6760test_xmlIsCombining(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006761 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006762
Daniel Veillard3d97e662004-11-04 10:49:00 +00006763 int mem_base;
6764 int ret_val;
6765 unsigned int ch; /* character to validate */
6766 int n_ch;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006767
Daniel Veillard3d97e662004-11-04 10:49:00 +00006768 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6769 mem_base = xmlMemBlocks();
6770 ch = gen_unsigned_int(n_ch, 0);
6771
6772 ret_val = xmlIsCombining(ch);
6773 desret_int(ret_val);
6774 call_tests++;
6775 des_unsigned_int(n_ch, ch, 0);
6776 xmlResetLastError();
6777 if (mem_base != xmlMemBlocks()) {
6778 printf("Leak of %d blocks found in xmlIsCombining",
6779 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006780 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00006781 printf(" %d", n_ch);
6782 printf("\n");
6783 }
6784 }
6785
6786 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006787 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006788}
6789
6790
6791static int
6792test_xmlIsDigit(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006793 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006794
Daniel Veillard3d97e662004-11-04 10:49:00 +00006795 int mem_base;
6796 int ret_val;
6797 unsigned int ch; /* character to validate */
6798 int n_ch;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006799
Daniel Veillard3d97e662004-11-04 10:49:00 +00006800 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6801 mem_base = xmlMemBlocks();
6802 ch = gen_unsigned_int(n_ch, 0);
6803
6804 ret_val = xmlIsDigit(ch);
6805 desret_int(ret_val);
6806 call_tests++;
6807 des_unsigned_int(n_ch, ch, 0);
6808 xmlResetLastError();
6809 if (mem_base != xmlMemBlocks()) {
6810 printf("Leak of %d blocks found in xmlIsDigit",
6811 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006812 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00006813 printf(" %d", n_ch);
6814 printf("\n");
6815 }
6816 }
6817
6818 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006819 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006820}
6821
6822
6823static int
6824test_xmlIsExtender(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006825 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006826
Daniel Veillard3d97e662004-11-04 10:49:00 +00006827 int mem_base;
6828 int ret_val;
6829 unsigned int ch; /* character to validate */
6830 int n_ch;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006831
Daniel Veillard3d97e662004-11-04 10:49:00 +00006832 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6833 mem_base = xmlMemBlocks();
6834 ch = gen_unsigned_int(n_ch, 0);
6835
6836 ret_val = xmlIsExtender(ch);
6837 desret_int(ret_val);
6838 call_tests++;
6839 des_unsigned_int(n_ch, ch, 0);
6840 xmlResetLastError();
6841 if (mem_base != xmlMemBlocks()) {
6842 printf("Leak of %d blocks found in xmlIsExtender",
6843 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006844 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00006845 printf(" %d", n_ch);
6846 printf("\n");
6847 }
6848 }
6849
6850 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006851 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006852}
6853
6854
6855static int
6856test_xmlIsIdeographic(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006857 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006858
Daniel Veillard3d97e662004-11-04 10:49:00 +00006859 int mem_base;
6860 int ret_val;
6861 unsigned int ch; /* character to validate */
6862 int n_ch;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006863
Daniel Veillard3d97e662004-11-04 10:49:00 +00006864 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6865 mem_base = xmlMemBlocks();
6866 ch = gen_unsigned_int(n_ch, 0);
6867
6868 ret_val = xmlIsIdeographic(ch);
6869 desret_int(ret_val);
6870 call_tests++;
6871 des_unsigned_int(n_ch, ch, 0);
6872 xmlResetLastError();
6873 if (mem_base != xmlMemBlocks()) {
6874 printf("Leak of %d blocks found in xmlIsIdeographic",
6875 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006876 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00006877 printf(" %d", n_ch);
6878 printf("\n");
6879 }
6880 }
6881
6882 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006883 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006884}
6885
6886
6887static int
6888test_xmlIsPubidChar(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006889 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006890
Daniel Veillard3d97e662004-11-04 10:49:00 +00006891 int mem_base;
6892 int ret_val;
6893 unsigned int ch; /* character to validate */
6894 int n_ch;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006895
Daniel Veillard3d97e662004-11-04 10:49:00 +00006896 for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6897 mem_base = xmlMemBlocks();
6898 ch = gen_unsigned_int(n_ch, 0);
6899
6900 ret_val = xmlIsPubidChar(ch);
6901 desret_int(ret_val);
6902 call_tests++;
6903 des_unsigned_int(n_ch, ch, 0);
6904 xmlResetLastError();
6905 if (mem_base != xmlMemBlocks()) {
6906 printf("Leak of %d blocks found in xmlIsPubidChar",
6907 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00006908 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00006909 printf(" %d", n_ch);
6910 printf("\n");
6911 }
6912 }
6913
6914 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00006915 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006916}
6917
6918static int
6919test_chvalid(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00006920 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00006921
Daniel Veillardce682bc2004-11-05 17:22:25 +00006922 printf("Testing chvalid : 9 of 9 functions ...\n");
Daniel Veillard42595322004-11-08 10:52:06 +00006923 test_ret += test_xmlCharInRange();
6924 test_ret += test_xmlIsBaseChar();
6925 test_ret += test_xmlIsBlank();
6926 test_ret += test_xmlIsChar();
6927 test_ret += test_xmlIsCombining();
6928 test_ret += test_xmlIsDigit();
6929 test_ret += test_xmlIsExtender();
6930 test_ret += test_xmlIsIdeographic();
6931 test_ret += test_xmlIsPubidChar();
Daniel Veillardd93f6252004-11-02 15:53:51 +00006932
Daniel Veillard42595322004-11-08 10:52:06 +00006933 if (test_ret != 0)
6934 printf("Module chvalid: %d errors\n", test_ret);
6935 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00006936}
6937
6938static int
Daniel Veillarda82b1822004-11-08 16:24:57 +00006939test_xmlBoolToText(void) {
6940 int test_ret = 0;
6941
6942#ifdef LIBXML_DEBUG_ENABLED
6943 int mem_base;
6944 const char * ret_val;
6945 int boolval; /* a bool to turn into text */
6946 int n_boolval;
6947
6948 for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
6949 mem_base = xmlMemBlocks();
6950 boolval = gen_int(n_boolval, 0);
6951
6952 ret_val = xmlBoolToText(boolval);
6953 desret_const_char_ptr(ret_val);
6954 call_tests++;
6955 des_int(n_boolval, boolval, 0);
6956 xmlResetLastError();
6957 if (mem_base != xmlMemBlocks()) {
6958 printf("Leak of %d blocks found in xmlBoolToText",
6959 xmlMemBlocks() - mem_base);
6960 test_ret++;
6961 printf(" %d", n_boolval);
6962 printf("\n");
6963 }
6964 }
6965#endif
6966
6967 function_tests++;
6968 return(test_ret);
6969}
6970
6971
6972static int
6973test_xmlDebugCheckDocument(void) {
6974 int test_ret = 0;
6975
6976#ifdef LIBXML_DEBUG_ENABLED
6977 int mem_base;
6978 int ret_val;
6979 FILE * output; /* the FILE * for the output */
6980 int n_output;
6981 xmlDocPtr doc; /* the document */
6982 int n_doc;
6983
6984 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6985 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6986 mem_base = xmlMemBlocks();
6987 output = gen_debug_FILE_ptr(n_output, 0);
6988 doc = gen_xmlDocPtr(n_doc, 1);
6989
6990 ret_val = xmlDebugCheckDocument(output, doc);
6991 desret_int(ret_val);
6992 call_tests++;
6993 des_debug_FILE_ptr(n_output, output, 0);
6994 des_xmlDocPtr(n_doc, doc, 1);
6995 xmlResetLastError();
6996 if (mem_base != xmlMemBlocks()) {
6997 printf("Leak of %d blocks found in xmlDebugCheckDocument",
6998 xmlMemBlocks() - mem_base);
6999 test_ret++;
7000 printf(" %d", n_output);
7001 printf(" %d", n_doc);
7002 printf("\n");
7003 }
7004 }
7005 }
7006#endif
7007
7008 function_tests++;
7009 return(test_ret);
7010}
7011
7012
7013static int
7014test_xmlDebugDumpAttr(void) {
7015 int test_ret = 0;
7016
7017#ifdef LIBXML_DEBUG_ENABLED
7018 int mem_base;
7019 FILE * output; /* the FILE * for the output */
7020 int n_output;
7021 xmlAttrPtr attr; /* the attribute */
7022 int n_attr;
7023 int depth; /* the indentation level. */
7024 int n_depth;
7025
7026 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7027 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7028 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7029 mem_base = xmlMemBlocks();
7030 output = gen_debug_FILE_ptr(n_output, 0);
7031 attr = gen_xmlAttrPtr(n_attr, 1);
7032 depth = gen_int(n_depth, 2);
7033
7034 xmlDebugDumpAttr(output, attr, depth);
7035 call_tests++;
7036 des_debug_FILE_ptr(n_output, output, 0);
7037 des_xmlAttrPtr(n_attr, attr, 1);
7038 des_int(n_depth, depth, 2);
7039 xmlResetLastError();
7040 if (mem_base != xmlMemBlocks()) {
7041 printf("Leak of %d blocks found in xmlDebugDumpAttr",
7042 xmlMemBlocks() - mem_base);
7043 test_ret++;
7044 printf(" %d", n_output);
7045 printf(" %d", n_attr);
7046 printf(" %d", n_depth);
7047 printf("\n");
7048 }
7049 }
7050 }
7051 }
7052#endif
7053
7054 function_tests++;
7055 return(test_ret);
7056}
7057
7058
7059static int
7060test_xmlDebugDumpAttrList(void) {
7061 int test_ret = 0;
7062
7063#ifdef LIBXML_DEBUG_ENABLED
7064 int mem_base;
7065 FILE * output; /* the FILE * for the output */
7066 int n_output;
7067 xmlAttrPtr attr; /* the attribute list */
7068 int n_attr;
7069 int depth; /* the indentation level. */
7070 int n_depth;
7071
7072 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7073 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7074 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7075 mem_base = xmlMemBlocks();
7076 output = gen_debug_FILE_ptr(n_output, 0);
7077 attr = gen_xmlAttrPtr(n_attr, 1);
7078 depth = gen_int(n_depth, 2);
7079
7080 xmlDebugDumpAttrList(output, attr, depth);
7081 call_tests++;
7082 des_debug_FILE_ptr(n_output, output, 0);
7083 des_xmlAttrPtr(n_attr, attr, 1);
7084 des_int(n_depth, depth, 2);
7085 xmlResetLastError();
7086 if (mem_base != xmlMemBlocks()) {
7087 printf("Leak of %d blocks found in xmlDebugDumpAttrList",
7088 xmlMemBlocks() - mem_base);
7089 test_ret++;
7090 printf(" %d", n_output);
7091 printf(" %d", n_attr);
7092 printf(" %d", n_depth);
7093 printf("\n");
7094 }
7095 }
7096 }
7097 }
7098#endif
7099
7100 function_tests++;
7101 return(test_ret);
7102}
7103
7104
7105static int
7106test_xmlDebugDumpDTD(void) {
7107 int test_ret = 0;
7108
7109#ifdef LIBXML_DEBUG_ENABLED
7110 int mem_base;
7111 FILE * output; /* the FILE * for the output */
7112 int n_output;
7113 xmlDtdPtr dtd; /* the DTD */
7114 int n_dtd;
7115
7116 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7117 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
7118 mem_base = xmlMemBlocks();
7119 output = gen_debug_FILE_ptr(n_output, 0);
7120 dtd = gen_xmlDtdPtr(n_dtd, 1);
7121
7122 xmlDebugDumpDTD(output, dtd);
7123 call_tests++;
7124 des_debug_FILE_ptr(n_output, output, 0);
7125 des_xmlDtdPtr(n_dtd, dtd, 1);
7126 xmlResetLastError();
7127 if (mem_base != xmlMemBlocks()) {
7128 printf("Leak of %d blocks found in xmlDebugDumpDTD",
7129 xmlMemBlocks() - mem_base);
7130 test_ret++;
7131 printf(" %d", n_output);
7132 printf(" %d", n_dtd);
7133 printf("\n");
7134 }
7135 }
7136 }
7137#endif
7138
7139 function_tests++;
7140 return(test_ret);
7141}
7142
7143
7144static int
7145test_xmlDebugDumpDocument(void) {
7146 int test_ret = 0;
7147
7148#ifdef LIBXML_DEBUG_ENABLED
7149 int mem_base;
7150 FILE * output; /* the FILE * for the output */
7151 int n_output;
7152 xmlDocPtr doc; /* the document */
7153 int n_doc;
7154
7155 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7156 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7157 mem_base = xmlMemBlocks();
7158 output = gen_debug_FILE_ptr(n_output, 0);
7159 doc = gen_xmlDocPtr(n_doc, 1);
7160
7161 xmlDebugDumpDocument(output, doc);
7162 call_tests++;
7163 des_debug_FILE_ptr(n_output, output, 0);
7164 des_xmlDocPtr(n_doc, doc, 1);
7165 xmlResetLastError();
7166 if (mem_base != xmlMemBlocks()) {
7167 printf("Leak of %d blocks found in xmlDebugDumpDocument",
7168 xmlMemBlocks() - mem_base);
7169 test_ret++;
7170 printf(" %d", n_output);
7171 printf(" %d", n_doc);
7172 printf("\n");
7173 }
7174 }
7175 }
7176#endif
7177
7178 function_tests++;
7179 return(test_ret);
7180}
7181
7182
7183static int
7184test_xmlDebugDumpDocumentHead(void) {
7185 int test_ret = 0;
7186
7187#ifdef LIBXML_DEBUG_ENABLED
7188 int mem_base;
7189 FILE * output; /* the FILE * for the output */
7190 int n_output;
7191 xmlDocPtr doc; /* the document */
7192 int n_doc;
7193
7194 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7195 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7196 mem_base = xmlMemBlocks();
7197 output = gen_debug_FILE_ptr(n_output, 0);
7198 doc = gen_xmlDocPtr(n_doc, 1);
7199
7200 xmlDebugDumpDocumentHead(output, doc);
7201 call_tests++;
7202 des_debug_FILE_ptr(n_output, output, 0);
7203 des_xmlDocPtr(n_doc, doc, 1);
7204 xmlResetLastError();
7205 if (mem_base != xmlMemBlocks()) {
7206 printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7207 xmlMemBlocks() - mem_base);
7208 test_ret++;
7209 printf(" %d", n_output);
7210 printf(" %d", n_doc);
7211 printf("\n");
7212 }
7213 }
7214 }
7215#endif
7216
7217 function_tests++;
7218 return(test_ret);
7219}
7220
7221
7222static int
7223test_xmlDebugDumpEntities(void) {
7224 int test_ret = 0;
7225
7226#ifdef LIBXML_DEBUG_ENABLED
7227 int mem_base;
7228 FILE * output; /* the FILE * for the output */
7229 int n_output;
7230 xmlDocPtr doc; /* the document */
7231 int n_doc;
7232
7233 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7234 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7235 mem_base = xmlMemBlocks();
7236 output = gen_debug_FILE_ptr(n_output, 0);
7237 doc = gen_xmlDocPtr(n_doc, 1);
7238
7239 xmlDebugDumpEntities(output, doc);
7240 call_tests++;
7241 des_debug_FILE_ptr(n_output, output, 0);
7242 des_xmlDocPtr(n_doc, doc, 1);
7243 xmlResetLastError();
7244 if (mem_base != xmlMemBlocks()) {
7245 printf("Leak of %d blocks found in xmlDebugDumpEntities",
7246 xmlMemBlocks() - mem_base);
7247 test_ret++;
7248 printf(" %d", n_output);
7249 printf(" %d", n_doc);
7250 printf("\n");
7251 }
7252 }
7253 }
7254#endif
7255
7256 function_tests++;
7257 return(test_ret);
7258}
7259
7260
7261static int
7262test_xmlDebugDumpNode(void) {
7263 int test_ret = 0;
7264
7265#ifdef LIBXML_DEBUG_ENABLED
7266 int mem_base;
7267 FILE * output; /* the FILE * for the output */
7268 int n_output;
7269 xmlNodePtr node; /* the node */
7270 int n_node;
7271 int depth; /* the indentation level. */
7272 int n_depth;
7273
7274 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7275 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7276 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7277 mem_base = xmlMemBlocks();
7278 output = gen_debug_FILE_ptr(n_output, 0);
7279 node = gen_xmlNodePtr(n_node, 1);
7280 depth = gen_int(n_depth, 2);
7281
7282 xmlDebugDumpNode(output, node, depth);
7283 call_tests++;
7284 des_debug_FILE_ptr(n_output, output, 0);
7285 des_xmlNodePtr(n_node, node, 1);
7286 des_int(n_depth, depth, 2);
7287 xmlResetLastError();
7288 if (mem_base != xmlMemBlocks()) {
7289 printf("Leak of %d blocks found in xmlDebugDumpNode",
7290 xmlMemBlocks() - mem_base);
7291 test_ret++;
7292 printf(" %d", n_output);
7293 printf(" %d", n_node);
7294 printf(" %d", n_depth);
7295 printf("\n");
7296 }
7297 }
7298 }
7299 }
7300#endif
7301
7302 function_tests++;
7303 return(test_ret);
7304}
7305
7306
7307static int
7308test_xmlDebugDumpNodeList(void) {
7309 int test_ret = 0;
7310
7311#ifdef LIBXML_DEBUG_ENABLED
7312 int mem_base;
7313 FILE * output; /* the FILE * for the output */
7314 int n_output;
7315 xmlNodePtr node; /* the node list */
7316 int n_node;
7317 int depth; /* the indentation level. */
7318 int n_depth;
7319
7320 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7321 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7322 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7323 mem_base = xmlMemBlocks();
7324 output = gen_debug_FILE_ptr(n_output, 0);
7325 node = gen_xmlNodePtr(n_node, 1);
7326 depth = gen_int(n_depth, 2);
7327
7328 xmlDebugDumpNodeList(output, node, depth);
7329 call_tests++;
7330 des_debug_FILE_ptr(n_output, output, 0);
7331 des_xmlNodePtr(n_node, node, 1);
7332 des_int(n_depth, depth, 2);
7333 xmlResetLastError();
7334 if (mem_base != xmlMemBlocks()) {
7335 printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7336 xmlMemBlocks() - mem_base);
7337 test_ret++;
7338 printf(" %d", n_output);
7339 printf(" %d", n_node);
7340 printf(" %d", n_depth);
7341 printf("\n");
7342 }
7343 }
7344 }
7345 }
7346#endif
7347
7348 function_tests++;
7349 return(test_ret);
7350}
7351
7352
7353static int
7354test_xmlDebugDumpOneNode(void) {
7355 int test_ret = 0;
7356
7357#ifdef LIBXML_DEBUG_ENABLED
7358 int mem_base;
7359 FILE * output; /* the FILE * for the output */
7360 int n_output;
7361 xmlNodePtr node; /* the node */
7362 int n_node;
7363 int depth; /* the indentation level. */
7364 int n_depth;
7365
7366 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7367 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7368 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7369 mem_base = xmlMemBlocks();
7370 output = gen_debug_FILE_ptr(n_output, 0);
7371 node = gen_xmlNodePtr(n_node, 1);
7372 depth = gen_int(n_depth, 2);
7373
7374 xmlDebugDumpOneNode(output, node, depth);
7375 call_tests++;
7376 des_debug_FILE_ptr(n_output, output, 0);
7377 des_xmlNodePtr(n_node, node, 1);
7378 des_int(n_depth, depth, 2);
7379 xmlResetLastError();
7380 if (mem_base != xmlMemBlocks()) {
7381 printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7382 xmlMemBlocks() - mem_base);
7383 test_ret++;
7384 printf(" %d", n_output);
7385 printf(" %d", n_node);
7386 printf(" %d", n_depth);
7387 printf("\n");
7388 }
7389 }
7390 }
7391 }
7392#endif
7393
7394 function_tests++;
7395 return(test_ret);
7396}
7397
7398
7399static int
7400test_xmlDebugDumpString(void) {
7401 int test_ret = 0;
7402
7403#ifdef LIBXML_DEBUG_ENABLED
7404 int mem_base;
7405 FILE * output; /* the FILE * for the output */
7406 int n_output;
7407 xmlChar * str; /* the string */
7408 int n_str;
7409
7410 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7411 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7412 mem_base = xmlMemBlocks();
7413 output = gen_debug_FILE_ptr(n_output, 0);
7414 str = gen_const_xmlChar_ptr(n_str, 1);
7415
7416 xmlDebugDumpString(output, str);
7417 call_tests++;
7418 des_debug_FILE_ptr(n_output, output, 0);
7419 des_const_xmlChar_ptr(n_str, str, 1);
7420 xmlResetLastError();
7421 if (mem_base != xmlMemBlocks()) {
7422 printf("Leak of %d blocks found in xmlDebugDumpString",
7423 xmlMemBlocks() - mem_base);
7424 test_ret++;
7425 printf(" %d", n_output);
7426 printf(" %d", n_str);
7427 printf("\n");
7428 }
7429 }
7430 }
7431#endif
7432
7433 function_tests++;
7434 return(test_ret);
7435}
7436
7437
7438static int
7439test_xmlLsCountNode(void) {
7440 int test_ret = 0;
7441
7442#ifdef LIBXML_DEBUG_ENABLED
7443 int mem_base;
7444 int ret_val;
7445 xmlNodePtr node; /* the node to count */
7446 int n_node;
7447
7448 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7449 mem_base = xmlMemBlocks();
7450 node = gen_xmlNodePtr(n_node, 0);
7451
7452 ret_val = xmlLsCountNode(node);
7453 desret_int(ret_val);
7454 call_tests++;
7455 des_xmlNodePtr(n_node, node, 0);
7456 xmlResetLastError();
7457 if (mem_base != xmlMemBlocks()) {
7458 printf("Leak of %d blocks found in xmlLsCountNode",
7459 xmlMemBlocks() - mem_base);
7460 test_ret++;
7461 printf(" %d", n_node);
7462 printf("\n");
7463 }
7464 }
7465#endif
7466
7467 function_tests++;
7468 return(test_ret);
7469}
7470
7471
7472static int
7473test_xmlLsOneNode(void) {
7474 int test_ret = 0;
7475
7476#ifdef LIBXML_DEBUG_ENABLED
7477 int mem_base;
7478 FILE * output; /* the FILE * for the output */
7479 int n_output;
7480 xmlNodePtr node; /* the node to dump */
7481 int n_node;
7482
7483 for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7484 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7485 mem_base = xmlMemBlocks();
7486 output = gen_debug_FILE_ptr(n_output, 0);
7487 node = gen_xmlNodePtr(n_node, 1);
7488
7489 xmlLsOneNode(output, node);
7490 call_tests++;
7491 des_debug_FILE_ptr(n_output, output, 0);
7492 des_xmlNodePtr(n_node, node, 1);
7493 xmlResetLastError();
7494 if (mem_base != xmlMemBlocks()) {
7495 printf("Leak of %d blocks found in xmlLsOneNode",
7496 xmlMemBlocks() - mem_base);
7497 test_ret++;
7498 printf(" %d", n_output);
7499 printf(" %d", n_node);
7500 printf("\n");
7501 }
7502 }
7503 }
7504#endif
7505
7506 function_tests++;
7507 return(test_ret);
7508}
7509
7510
7511#define gen_nb_char_ptr 1
7512static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7513 return(NULL);
7514}
7515static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7516}
7517
7518static int
7519test_xmlShell(void) {
7520 int test_ret = 0;
7521
7522
7523 /* missing type support */
7524 return(test_ret);
7525}
7526
7527
7528#define gen_nb_xmlShellCtxtPtr 1
7529static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7530 return(NULL);
7531}
7532static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7533}
7534
7535static int
7536test_xmlShellBase(void) {
7537 int test_ret = 0;
7538
7539#ifdef LIBXML_DEBUG_ENABLED
7540 int mem_base;
7541 int ret_val;
7542 xmlShellCtxtPtr ctxt; /* the shell context */
7543 int n_ctxt;
7544 char * arg; /* unused */
7545 int n_arg;
7546 xmlNodePtr node; /* a node */
7547 int n_node;
7548 xmlNodePtr node2; /* unused */
7549 int n_node2;
7550
7551 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7552 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7553 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7554 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7555 mem_base = xmlMemBlocks();
7556 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7557 arg = gen_char_ptr(n_arg, 1);
7558 node = gen_xmlNodePtr(n_node, 2);
7559 node2 = gen_xmlNodePtr(n_node2, 3);
7560
7561 ret_val = xmlShellBase(ctxt, arg, node, node2);
7562 desret_int(ret_val);
7563 call_tests++;
7564 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7565 des_char_ptr(n_arg, arg, 1);
7566 des_xmlNodePtr(n_node, node, 2);
7567 des_xmlNodePtr(n_node2, node2, 3);
7568 xmlResetLastError();
7569 if (mem_base != xmlMemBlocks()) {
7570 printf("Leak of %d blocks found in xmlShellBase",
7571 xmlMemBlocks() - mem_base);
7572 test_ret++;
7573 printf(" %d", n_ctxt);
7574 printf(" %d", n_arg);
7575 printf(" %d", n_node);
7576 printf(" %d", n_node2);
7577 printf("\n");
7578 }
7579 }
7580 }
7581 }
7582 }
7583#endif
7584
7585 function_tests++;
7586 return(test_ret);
7587}
7588
7589
7590static int
7591test_xmlShellCat(void) {
7592 int test_ret = 0;
7593
7594#ifdef LIBXML_DEBUG_ENABLED
7595 int mem_base;
7596 int ret_val;
7597 xmlShellCtxtPtr ctxt; /* the shell context */
7598 int n_ctxt;
7599 char * arg; /* unused */
7600 int n_arg;
7601 xmlNodePtr node; /* a node */
7602 int n_node;
7603 xmlNodePtr node2; /* unused */
7604 int n_node2;
7605
7606 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7607 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7608 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7609 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7610 mem_base = xmlMemBlocks();
7611 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7612 arg = gen_char_ptr(n_arg, 1);
7613 node = gen_xmlNodePtr(n_node, 2);
7614 node2 = gen_xmlNodePtr(n_node2, 3);
7615
7616 ret_val = xmlShellCat(ctxt, arg, node, node2);
7617 desret_int(ret_val);
7618 call_tests++;
7619 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7620 des_char_ptr(n_arg, arg, 1);
7621 des_xmlNodePtr(n_node, node, 2);
7622 des_xmlNodePtr(n_node2, node2, 3);
7623 xmlResetLastError();
7624 if (mem_base != xmlMemBlocks()) {
7625 printf("Leak of %d blocks found in xmlShellCat",
7626 xmlMemBlocks() - mem_base);
7627 test_ret++;
7628 printf(" %d", n_ctxt);
7629 printf(" %d", n_arg);
7630 printf(" %d", n_node);
7631 printf(" %d", n_node2);
7632 printf("\n");
7633 }
7634 }
7635 }
7636 }
7637 }
7638#endif
7639
7640 function_tests++;
7641 return(test_ret);
7642}
7643
7644
7645static int
7646test_xmlShellDir(void) {
7647 int test_ret = 0;
7648
7649#ifdef LIBXML_DEBUG_ENABLED
7650 int mem_base;
7651 int ret_val;
7652 xmlShellCtxtPtr ctxt; /* the shell context */
7653 int n_ctxt;
7654 char * arg; /* unused */
7655 int n_arg;
7656 xmlNodePtr node; /* a node */
7657 int n_node;
7658 xmlNodePtr node2; /* unused */
7659 int n_node2;
7660
7661 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7662 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7663 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7664 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7665 mem_base = xmlMemBlocks();
7666 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7667 arg = gen_char_ptr(n_arg, 1);
7668 node = gen_xmlNodePtr(n_node, 2);
7669 node2 = gen_xmlNodePtr(n_node2, 3);
7670
7671 ret_val = xmlShellDir(ctxt, arg, node, node2);
7672 desret_int(ret_val);
7673 call_tests++;
7674 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7675 des_char_ptr(n_arg, arg, 1);
7676 des_xmlNodePtr(n_node, node, 2);
7677 des_xmlNodePtr(n_node2, node2, 3);
7678 xmlResetLastError();
7679 if (mem_base != xmlMemBlocks()) {
7680 printf("Leak of %d blocks found in xmlShellDir",
7681 xmlMemBlocks() - mem_base);
7682 test_ret++;
7683 printf(" %d", n_ctxt);
7684 printf(" %d", n_arg);
7685 printf(" %d", n_node);
7686 printf(" %d", n_node2);
7687 printf("\n");
7688 }
7689 }
7690 }
7691 }
7692 }
7693#endif
7694
7695 function_tests++;
7696 return(test_ret);
7697}
7698
7699
7700static int
7701test_xmlShellDu(void) {
7702 int test_ret = 0;
7703
7704#ifdef LIBXML_DEBUG_ENABLED
7705 int mem_base;
7706 int ret_val;
7707 xmlShellCtxtPtr ctxt; /* the shell context */
7708 int n_ctxt;
7709 char * arg; /* unused */
7710 int n_arg;
7711 xmlNodePtr tree; /* a node defining a subtree */
7712 int n_tree;
7713 xmlNodePtr node2; /* unused */
7714 int n_node2;
7715
7716 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7717 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7718 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
7719 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7720 mem_base = xmlMemBlocks();
7721 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7722 arg = gen_char_ptr(n_arg, 1);
7723 tree = gen_xmlNodePtr(n_tree, 2);
7724 node2 = gen_xmlNodePtr(n_node2, 3);
7725
7726 ret_val = xmlShellDu(ctxt, arg, tree, node2);
7727 desret_int(ret_val);
7728 call_tests++;
7729 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7730 des_char_ptr(n_arg, arg, 1);
7731 des_xmlNodePtr(n_tree, tree, 2);
7732 des_xmlNodePtr(n_node2, node2, 3);
7733 xmlResetLastError();
7734 if (mem_base != xmlMemBlocks()) {
7735 printf("Leak of %d blocks found in xmlShellDu",
7736 xmlMemBlocks() - mem_base);
7737 test_ret++;
7738 printf(" %d", n_ctxt);
7739 printf(" %d", n_arg);
7740 printf(" %d", n_tree);
7741 printf(" %d", n_node2);
7742 printf("\n");
7743 }
7744 }
7745 }
7746 }
7747 }
7748#endif
7749
7750 function_tests++;
7751 return(test_ret);
7752}
7753
7754
7755static int
7756test_xmlShellList(void) {
7757 int test_ret = 0;
7758
7759#ifdef LIBXML_DEBUG_ENABLED
7760 int mem_base;
7761 int ret_val;
7762 xmlShellCtxtPtr ctxt; /* the shell context */
7763 int n_ctxt;
7764 char * arg; /* unused */
7765 int n_arg;
7766 xmlNodePtr node; /* a node */
7767 int n_node;
7768 xmlNodePtr node2; /* unused */
7769 int n_node2;
7770
7771 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7772 for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7773 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7774 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7775 mem_base = xmlMemBlocks();
7776 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7777 arg = gen_char_ptr(n_arg, 1);
7778 node = gen_xmlNodePtr(n_node, 2);
7779 node2 = gen_xmlNodePtr(n_node2, 3);
7780
7781 ret_val = xmlShellList(ctxt, arg, node, node2);
7782 desret_int(ret_val);
7783 call_tests++;
7784 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7785 des_char_ptr(n_arg, arg, 1);
7786 des_xmlNodePtr(n_node, node, 2);
7787 des_xmlNodePtr(n_node2, node2, 3);
7788 xmlResetLastError();
7789 if (mem_base != xmlMemBlocks()) {
7790 printf("Leak of %d blocks found in xmlShellList",
7791 xmlMemBlocks() - mem_base);
7792 test_ret++;
7793 printf(" %d", n_ctxt);
7794 printf(" %d", n_arg);
7795 printf(" %d", n_node);
7796 printf(" %d", n_node2);
7797 printf("\n");
7798 }
7799 }
7800 }
7801 }
7802 }
7803#endif
7804
7805 function_tests++;
7806 return(test_ret);
7807}
7808
7809
7810static int
7811test_xmlShellLoad(void) {
7812 int test_ret = 0;
7813
7814#ifdef LIBXML_DEBUG_ENABLED
7815 int mem_base;
7816 int ret_val;
7817 xmlShellCtxtPtr ctxt; /* the shell context */
7818 int n_ctxt;
7819 char * filename; /* the file name */
7820 int n_filename;
7821 xmlNodePtr node; /* unused */
7822 int n_node;
7823 xmlNodePtr node2; /* unused */
7824 int n_node2;
7825
7826 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7827 for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7828 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7829 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7830 mem_base = xmlMemBlocks();
7831 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7832 filename = gen_char_ptr(n_filename, 1);
7833 node = gen_xmlNodePtr(n_node, 2);
7834 node2 = gen_xmlNodePtr(n_node2, 3);
7835
7836 ret_val = xmlShellLoad(ctxt, filename, node, node2);
7837 desret_int(ret_val);
7838 call_tests++;
7839 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7840 des_char_ptr(n_filename, filename, 1);
7841 des_xmlNodePtr(n_node, node, 2);
7842 des_xmlNodePtr(n_node2, node2, 3);
7843 xmlResetLastError();
7844 if (mem_base != xmlMemBlocks()) {
7845 printf("Leak of %d blocks found in xmlShellLoad",
7846 xmlMemBlocks() - mem_base);
7847 test_ret++;
7848 printf(" %d", n_ctxt);
7849 printf(" %d", n_filename);
7850 printf(" %d", n_node);
7851 printf(" %d", n_node2);
7852 printf("\n");
7853 }
7854 }
7855 }
7856 }
7857 }
7858#endif
7859
7860 function_tests++;
7861 return(test_ret);
7862}
7863
7864
7865static int
7866test_xmlShellPrintXPathResult(void) {
7867 int test_ret = 0;
7868
7869#ifdef LIBXML_DEBUG_ENABLED
7870 int mem_base;
7871 xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7872 int n_list;
7873
7874 for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7875 mem_base = xmlMemBlocks();
7876 list = gen_xmlXPathObjectPtr(n_list, 0);
7877
7878 xmlShellPrintXPathResult(list);
7879 call_tests++;
7880 des_xmlXPathObjectPtr(n_list, list, 0);
7881 xmlResetLastError();
7882 if (mem_base != xmlMemBlocks()) {
7883 printf("Leak of %d blocks found in xmlShellPrintXPathResult",
7884 xmlMemBlocks() - mem_base);
7885 test_ret++;
7886 printf(" %d", n_list);
7887 printf("\n");
7888 }
7889 }
7890#endif
7891
7892 function_tests++;
7893 return(test_ret);
7894}
7895
7896
7897static int
7898test_xmlShellPwd(void) {
7899 int test_ret = 0;
7900
7901#ifdef LIBXML_DEBUG_ENABLED
7902 int mem_base;
7903 int ret_val;
7904 xmlShellCtxtPtr ctxt; /* the shell context */
7905 int n_ctxt;
7906 char * buffer; /* the output buffer */
7907 int n_buffer;
7908 xmlNodePtr node; /* a node */
7909 int n_node;
7910 xmlNodePtr node2; /* unused */
7911 int n_node2;
7912
7913 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7914 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
7915 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7916 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7917 mem_base = xmlMemBlocks();
7918 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7919 buffer = gen_char_ptr(n_buffer, 1);
7920 node = gen_xmlNodePtr(n_node, 2);
7921 node2 = gen_xmlNodePtr(n_node2, 3);
7922
7923 ret_val = xmlShellPwd(ctxt, buffer, node, node2);
7924 desret_int(ret_val);
7925 call_tests++;
7926 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7927 des_char_ptr(n_buffer, buffer, 1);
7928 des_xmlNodePtr(n_node, node, 2);
7929 des_xmlNodePtr(n_node2, node2, 3);
7930 xmlResetLastError();
7931 if (mem_base != xmlMemBlocks()) {
7932 printf("Leak of %d blocks found in xmlShellPwd",
7933 xmlMemBlocks() - mem_base);
7934 test_ret++;
7935 printf(" %d", n_ctxt);
7936 printf(" %d", n_buffer);
7937 printf(" %d", n_node);
7938 printf(" %d", n_node2);
7939 printf("\n");
7940 }
7941 }
7942 }
7943 }
7944 }
7945#endif
7946
7947 function_tests++;
7948 return(test_ret);
7949}
7950
7951
7952static int
7953test_xmlShellSave(void) {
7954 int test_ret = 0;
7955
7956#ifdef LIBXML_DEBUG_ENABLED
7957#ifdef LIBXML_OUTPUT_ENABLED
7958 int mem_base;
7959 int ret_val;
7960 xmlShellCtxtPtr ctxt; /* the shell context */
7961 int n_ctxt;
7962 char * filename; /* the file name (optional) */
7963 int n_filename;
7964 xmlNodePtr node; /* unused */
7965 int n_node;
7966 xmlNodePtr node2; /* unused */
7967 int n_node2;
7968
7969 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7970 for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7971 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7972 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7973 mem_base = xmlMemBlocks();
7974 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7975 filename = gen_char_ptr(n_filename, 1);
7976 node = gen_xmlNodePtr(n_node, 2);
7977 node2 = gen_xmlNodePtr(n_node2, 3);
7978
7979 ret_val = xmlShellSave(ctxt, filename, node, node2);
7980 desret_int(ret_val);
7981 call_tests++;
7982 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7983 des_char_ptr(n_filename, filename, 1);
7984 des_xmlNodePtr(n_node, node, 2);
7985 des_xmlNodePtr(n_node2, node2, 3);
7986 xmlResetLastError();
7987 if (mem_base != xmlMemBlocks()) {
7988 printf("Leak of %d blocks found in xmlShellSave",
7989 xmlMemBlocks() - mem_base);
7990 test_ret++;
7991 printf(" %d", n_ctxt);
7992 printf(" %d", n_filename);
7993 printf(" %d", n_node);
7994 printf(" %d", n_node2);
7995 printf("\n");
7996 }
7997 }
7998 }
7999 }
8000 }
8001#endif
8002#endif
8003
8004 function_tests++;
8005 return(test_ret);
8006}
8007
8008
8009static int
8010test_xmlShellValidate(void) {
8011 int test_ret = 0;
8012
8013#ifdef LIBXML_DEBUG_ENABLED
8014 int mem_base;
8015 int ret_val;
8016 xmlShellCtxtPtr ctxt; /* the shell context */
8017 int n_ctxt;
8018 char * dtd; /* the DTD URI (optional) */
8019 int n_dtd;
8020 xmlNodePtr node; /* unused */
8021 int n_node;
8022 xmlNodePtr node2; /* unused */
8023 int n_node2;
8024
8025 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8026 for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
8027 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8028 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8029 mem_base = xmlMemBlocks();
8030 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8031 dtd = gen_char_ptr(n_dtd, 1);
8032 node = gen_xmlNodePtr(n_node, 2);
8033 node2 = gen_xmlNodePtr(n_node2, 3);
8034
8035 ret_val = xmlShellValidate(ctxt, dtd, node, node2);
8036 desret_int(ret_val);
8037 call_tests++;
8038 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8039 des_char_ptr(n_dtd, dtd, 1);
8040 des_xmlNodePtr(n_node, node, 2);
8041 des_xmlNodePtr(n_node2, node2, 3);
8042 xmlResetLastError();
8043 if (mem_base != xmlMemBlocks()) {
8044 printf("Leak of %d blocks found in xmlShellValidate",
8045 xmlMemBlocks() - mem_base);
8046 test_ret++;
8047 printf(" %d", n_ctxt);
8048 printf(" %d", n_dtd);
8049 printf(" %d", n_node);
8050 printf(" %d", n_node2);
8051 printf("\n");
8052 }
8053 }
8054 }
8055 }
8056 }
8057#endif
8058
8059 function_tests++;
8060 return(test_ret);
8061}
8062
8063
8064static int
8065test_xmlShellWrite(void) {
8066 int test_ret = 0;
8067
8068#ifdef LIBXML_DEBUG_ENABLED
8069#ifdef LIBXML_OUTPUT_ENABLED
8070 int mem_base;
8071 int ret_val;
8072 xmlShellCtxtPtr ctxt; /* the shell context */
8073 int n_ctxt;
8074 char * filename; /* the file name */
8075 int n_filename;
8076 xmlNodePtr node; /* a node in the tree */
8077 int n_node;
8078 xmlNodePtr node2; /* unused */
8079 int n_node2;
8080
8081 for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8082 for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
8083 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8084 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8085 mem_base = xmlMemBlocks();
8086 ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8087 filename = gen_char_ptr(n_filename, 1);
8088 node = gen_xmlNodePtr(n_node, 2);
8089 node2 = gen_xmlNodePtr(n_node2, 3);
8090
8091 ret_val = xmlShellWrite(ctxt, filename, node, node2);
8092 desret_int(ret_val);
8093 call_tests++;
8094 des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8095 des_char_ptr(n_filename, filename, 1);
8096 des_xmlNodePtr(n_node, node, 2);
8097 des_xmlNodePtr(n_node2, node2, 3);
8098 xmlResetLastError();
8099 if (mem_base != xmlMemBlocks()) {
8100 printf("Leak of %d blocks found in xmlShellWrite",
8101 xmlMemBlocks() - mem_base);
8102 test_ret++;
8103 printf(" %d", n_ctxt);
8104 printf(" %d", n_filename);
8105 printf(" %d", n_node);
8106 printf(" %d", n_node2);
8107 printf("\n");
8108 }
8109 }
8110 }
8111 }
8112 }
8113#endif
8114#endif
8115
8116 function_tests++;
8117 return(test_ret);
8118}
8119
8120static int
8121test_debugXML(void) {
8122 int test_ret = 0;
8123
8124 printf("Testing debugXML : 25 of 28 functions ...\n");
8125 test_ret += test_xmlBoolToText();
8126 test_ret += test_xmlDebugCheckDocument();
8127 test_ret += test_xmlDebugDumpAttr();
8128 test_ret += test_xmlDebugDumpAttrList();
8129 test_ret += test_xmlDebugDumpDTD();
8130 test_ret += test_xmlDebugDumpDocument();
8131 test_ret += test_xmlDebugDumpDocumentHead();
8132 test_ret += test_xmlDebugDumpEntities();
8133 test_ret += test_xmlDebugDumpNode();
8134 test_ret += test_xmlDebugDumpNodeList();
8135 test_ret += test_xmlDebugDumpOneNode();
8136 test_ret += test_xmlDebugDumpString();
8137 test_ret += test_xmlLsCountNode();
8138 test_ret += test_xmlLsOneNode();
8139 test_ret += test_xmlShell();
8140 test_ret += test_xmlShellBase();
8141 test_ret += test_xmlShellCat();
8142 test_ret += test_xmlShellDir();
8143 test_ret += test_xmlShellDu();
8144 test_ret += test_xmlShellList();
8145 test_ret += test_xmlShellLoad();
8146 test_ret += test_xmlShellPrintXPathResult();
8147 test_ret += test_xmlShellPwd();
8148 test_ret += test_xmlShellSave();
8149 test_ret += test_xmlShellValidate();
8150 test_ret += test_xmlShellWrite();
8151
8152 if (test_ret != 0)
8153 printf("Module debugXML: %d errors\n", test_ret);
8154 return(test_ret);
8155}
8156
8157static int
Daniel Veillardd93f6252004-11-02 15:53:51 +00008158test_xmlDictCreate(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008159 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008160
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008161 int mem_base;
8162 xmlDictPtr ret_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008163
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008164 mem_base = xmlMemBlocks();
8165
8166 ret_val = xmlDictCreate();
8167 desret_xmlDictPtr(ret_val);
8168 call_tests++;
8169 xmlResetLastError();
8170 if (mem_base != xmlMemBlocks()) {
8171 printf("Leak of %d blocks found in xmlDictCreate",
8172 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00008173 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008174 printf("\n");
8175 }
8176
8177 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008178 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008179}
8180
8181
8182static int
8183test_xmlDictCreateSub(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008184 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008185
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008186 int mem_base;
8187 xmlDictPtr ret_val;
8188 xmlDictPtr sub; /* an existing dictionnary */
8189 int n_sub;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008190
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008191 for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8192 mem_base = xmlMemBlocks();
8193 sub = gen_xmlDictPtr(n_sub, 0);
8194
8195 ret_val = xmlDictCreateSub(sub);
8196 desret_xmlDictPtr(ret_val);
8197 call_tests++;
8198 des_xmlDictPtr(n_sub, sub, 0);
8199 xmlResetLastError();
8200 if (mem_base != xmlMemBlocks()) {
8201 printf("Leak of %d blocks found in xmlDictCreateSub",
8202 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00008203 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008204 printf(" %d", n_sub);
8205 printf("\n");
8206 }
8207 }
8208
8209 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008210 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008211}
8212
8213
8214static int
8215test_xmlDictLookup(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008216 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008217
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008218 int mem_base;
8219 const xmlChar * ret_val;
8220 xmlDictPtr dict; /* the dictionnary */
8221 int n_dict;
Daniel Veillardce682bc2004-11-05 17:22:25 +00008222 xmlChar * name; /* the name of the userdata */
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008223 int n_name;
8224 int len; /* the length of the name, if -1 it is recomputed */
8225 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008226
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008227 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8228 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8229 for (n_len = 0;n_len < gen_nb_int;n_len++) {
8230 mem_base = xmlMemBlocks();
8231 dict = gen_xmlDictPtr(n_dict, 0);
8232 name = gen_const_xmlChar_ptr(n_name, 1);
8233 len = gen_int(n_len, 2);
8234
8235 ret_val = xmlDictLookup(dict, name, len);
8236 desret_const_xmlChar_ptr(ret_val);
8237 call_tests++;
8238 des_xmlDictPtr(n_dict, dict, 0);
8239 des_const_xmlChar_ptr(n_name, name, 1);
8240 des_int(n_len, len, 2);
8241 xmlResetLastError();
8242 if (mem_base != xmlMemBlocks()) {
8243 printf("Leak of %d blocks found in xmlDictLookup",
8244 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00008245 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008246 printf(" %d", n_dict);
8247 printf(" %d", n_name);
8248 printf(" %d", n_len);
8249 printf("\n");
8250 }
8251 }
8252 }
8253 }
8254
8255 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008256 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008257}
8258
8259
8260static int
8261test_xmlDictOwns(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008262 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008263
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008264 int mem_base;
8265 int ret_val;
8266 xmlDictPtr dict; /* the dictionnary */
8267 int n_dict;
Daniel Veillardce682bc2004-11-05 17:22:25 +00008268 xmlChar * str; /* the string */
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008269 int n_str;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008270
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008271 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8272 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8273 mem_base = xmlMemBlocks();
8274 dict = gen_xmlDictPtr(n_dict, 0);
8275 str = gen_const_xmlChar_ptr(n_str, 1);
8276
8277 ret_val = xmlDictOwns(dict, str);
8278 desret_int(ret_val);
8279 call_tests++;
8280 des_xmlDictPtr(n_dict, dict, 0);
8281 des_const_xmlChar_ptr(n_str, str, 1);
8282 xmlResetLastError();
8283 if (mem_base != xmlMemBlocks()) {
8284 printf("Leak of %d blocks found in xmlDictOwns",
8285 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00008286 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008287 printf(" %d", n_dict);
8288 printf(" %d", n_str);
8289 printf("\n");
8290 }
8291 }
8292 }
8293
8294 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008295 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008296}
8297
8298
8299static int
8300test_xmlDictQLookup(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008301 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008302
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008303 int mem_base;
8304 const xmlChar * ret_val;
8305 xmlDictPtr dict; /* the dictionnary */
8306 int n_dict;
Daniel Veillardce682bc2004-11-05 17:22:25 +00008307 xmlChar * prefix; /* the prefix */
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008308 int n_prefix;
Daniel Veillardce682bc2004-11-05 17:22:25 +00008309 xmlChar * name; /* the name */
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008310 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008311
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008312 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8313 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8314 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8315 mem_base = xmlMemBlocks();
8316 dict = gen_xmlDictPtr(n_dict, 0);
8317 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8318 name = gen_const_xmlChar_ptr(n_name, 2);
8319
8320 ret_val = xmlDictQLookup(dict, prefix, name);
8321 desret_const_xmlChar_ptr(ret_val);
8322 call_tests++;
8323 des_xmlDictPtr(n_dict, dict, 0);
8324 des_const_xmlChar_ptr(n_prefix, prefix, 1);
8325 des_const_xmlChar_ptr(n_name, name, 2);
8326 xmlResetLastError();
8327 if (mem_base != xmlMemBlocks()) {
8328 printf("Leak of %d blocks found in xmlDictQLookup",
8329 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00008330 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008331 printf(" %d", n_dict);
8332 printf(" %d", n_prefix);
8333 printf(" %d", n_name);
8334 printf("\n");
8335 }
8336 }
8337 }
8338 }
8339
8340 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008341 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008342}
8343
8344
8345static int
8346test_xmlDictReference(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008347 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008348
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008349 int mem_base;
8350 int ret_val;
8351 xmlDictPtr dict; /* the dictionnary */
8352 int n_dict;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008353
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008354 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8355 mem_base = xmlMemBlocks();
8356 dict = gen_xmlDictPtr(n_dict, 0);
8357
8358 ret_val = xmlDictReference(dict);
8359 xmlDictFree(dict);
8360 desret_int(ret_val);
8361 call_tests++;
8362 des_xmlDictPtr(n_dict, dict, 0);
8363 xmlResetLastError();
8364 if (mem_base != xmlMemBlocks()) {
8365 printf("Leak of %d blocks found in xmlDictReference",
8366 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00008367 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008368 printf(" %d", n_dict);
8369 printf("\n");
8370 }
8371 }
8372
8373 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008374 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008375}
8376
8377
8378static int
8379test_xmlDictSize(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008380 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008381
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008382 int mem_base;
8383 int ret_val;
8384 xmlDictPtr dict; /* the dictionnary */
8385 int n_dict;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008386
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008387 for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8388 mem_base = xmlMemBlocks();
8389 dict = gen_xmlDictPtr(n_dict, 0);
8390
8391 ret_val = xmlDictSize(dict);
8392 desret_int(ret_val);
8393 call_tests++;
8394 des_xmlDictPtr(n_dict, dict, 0);
8395 xmlResetLastError();
8396 if (mem_base != xmlMemBlocks()) {
8397 printf("Leak of %d blocks found in xmlDictSize",
8398 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00008399 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008400 printf(" %d", n_dict);
8401 printf("\n");
8402 }
8403 }
8404
8405 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008406 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008407}
8408
8409static int
8410test_dict(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008411 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008412
Daniel Veillard1ba06bb2004-11-04 12:32:18 +00008413 printf("Testing dict : 7 of 8 functions ...\n");
Daniel Veillard42595322004-11-08 10:52:06 +00008414 test_ret += test_xmlDictCreate();
8415 test_ret += test_xmlDictCreateSub();
8416 test_ret += test_xmlDictLookup();
8417 test_ret += test_xmlDictOwns();
8418 test_ret += test_xmlDictQLookup();
8419 test_ret += test_xmlDictReference();
8420 test_ret += test_xmlDictSize();
Daniel Veillardd93f6252004-11-02 15:53:51 +00008421
Daniel Veillard42595322004-11-08 10:52:06 +00008422 if (test_ret != 0)
8423 printf("Module dict: %d errors\n", test_ret);
8424 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008425}
8426
8427static int
8428test_UTF8Toisolat1(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008429 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008430
Daniel Veillardce682bc2004-11-05 17:22:25 +00008431 int mem_base;
8432 int ret_val;
8433 unsigned char * out; /* a pointer to an array of bytes to store the result */
8434 int n_out;
8435 int * outlen; /* the length of @out */
8436 int n_outlen;
8437 unsigned char * in; /* a pointer to an array of UTF-8 chars */
8438 int n_in;
8439 int * inlen; /* the length of @in */
8440 int n_inlen;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008441
Daniel Veillardce682bc2004-11-05 17:22:25 +00008442 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8443 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8444 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8445 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8446 mem_base = xmlMemBlocks();
8447 out = gen_unsigned_char_ptr(n_out, 0);
8448 outlen = gen_int_ptr(n_outlen, 1);
8449 in = gen_const_unsigned_char_ptr(n_in, 2);
8450 inlen = gen_int_ptr(n_inlen, 3);
8451
8452 ret_val = UTF8Toisolat1(out, outlen, in, inlen);
8453 desret_int(ret_val);
8454 call_tests++;
8455 des_unsigned_char_ptr(n_out, out, 0);
8456 des_int_ptr(n_outlen, outlen, 1);
8457 des_const_unsigned_char_ptr(n_in, in, 2);
8458 des_int_ptr(n_inlen, inlen, 3);
8459 xmlResetLastError();
8460 if (mem_base != xmlMemBlocks()) {
8461 printf("Leak of %d blocks found in UTF8Toisolat1",
8462 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00008463 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00008464 printf(" %d", n_out);
8465 printf(" %d", n_outlen);
8466 printf(" %d", n_in);
8467 printf(" %d", n_inlen);
8468 printf("\n");
8469 }
8470 }
8471 }
8472 }
8473 }
8474
8475 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008476 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008477}
8478
8479
8480static int
8481test_isolat1ToUTF8(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008482 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008483
Daniel Veillardce682bc2004-11-05 17:22:25 +00008484 int mem_base;
8485 int ret_val;
8486 unsigned char * out; /* a pointer to an array of bytes to store the result */
8487 int n_out;
8488 int * outlen; /* the length of @out */
8489 int n_outlen;
8490 unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8491 int n_in;
8492 int * inlen; /* the length of @in */
8493 int n_inlen;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008494
Daniel Veillardce682bc2004-11-05 17:22:25 +00008495 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8496 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8497 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8498 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8499 mem_base = xmlMemBlocks();
8500 out = gen_unsigned_char_ptr(n_out, 0);
8501 outlen = gen_int_ptr(n_outlen, 1);
8502 in = gen_const_unsigned_char_ptr(n_in, 2);
8503 inlen = gen_int_ptr(n_inlen, 3);
8504
8505 ret_val = isolat1ToUTF8(out, outlen, in, inlen);
8506 desret_int(ret_val);
8507 call_tests++;
8508 des_unsigned_char_ptr(n_out, out, 0);
8509 des_int_ptr(n_outlen, outlen, 1);
8510 des_const_unsigned_char_ptr(n_in, in, 2);
8511 des_int_ptr(n_inlen, inlen, 3);
8512 xmlResetLastError();
8513 if (mem_base != xmlMemBlocks()) {
8514 printf("Leak of %d blocks found in isolat1ToUTF8",
8515 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00008516 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00008517 printf(" %d", n_out);
8518 printf(" %d", n_outlen);
8519 printf(" %d", n_in);
8520 printf(" %d", n_inlen);
8521 printf("\n");
8522 }
8523 }
8524 }
8525 }
8526 }
8527
8528 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008529 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008530}
8531
8532
8533static int
8534test_xmlAddEncodingAlias(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008535 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008536
8537 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +00008538 char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
Daniel Veillardd93f6252004-11-02 15:53:51 +00008539 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +00008540 char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
Daniel Veillardd93f6252004-11-02 15:53:51 +00008541 int n_alias;
8542
8543 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8544 for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
Daniel Veillard3d97e662004-11-04 10:49:00 +00008545 name = gen_const_char_ptr(n_name, 0);
8546 alias = gen_const_char_ptr(n_alias, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008547
8548 ret_val = xmlAddEncodingAlias(name, alias);
8549 desret_int(ret_val);
8550 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00008551 des_const_char_ptr(n_name, name, 0);
8552 des_const_char_ptr(n_alias, alias, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008553 xmlResetLastError();
8554 }
8555 }
8556
Daniel Veillard3d97e662004-11-04 10:49:00 +00008557 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008558 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008559}
8560
8561
Daniel Veillardce682bc2004-11-05 17:22:25 +00008562#define gen_nb_xmlCharEncodingHandler_ptr 1
8563static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8564 return(NULL);
8565}
8566static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8567}
8568
Daniel Veillardd93f6252004-11-02 15:53:51 +00008569static int
8570test_xmlCharEncCloseFunc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008571 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008572
Daniel Veillardce682bc2004-11-05 17:22:25 +00008573 int mem_base;
8574 int ret_val;
8575 xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8576 int n_handler;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008577
Daniel Veillardce682bc2004-11-05 17:22:25 +00008578 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8579 mem_base = xmlMemBlocks();
8580 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8581
8582 ret_val = xmlCharEncCloseFunc(handler);
8583 desret_int(ret_val);
8584 call_tests++;
8585 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8586 xmlResetLastError();
8587 if (mem_base != xmlMemBlocks()) {
8588 printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8589 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00008590 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00008591 printf(" %d", n_handler);
8592 printf("\n");
8593 }
8594 }
8595
8596 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008597 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008598}
8599
8600
8601static int
8602test_xmlCharEncFirstLine(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008603 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008604
Daniel Veillardce682bc2004-11-05 17:22:25 +00008605 int mem_base;
8606 int ret_val;
8607 xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8608 int n_handler;
8609 xmlBufferPtr out; /* an xmlBuffer for the output. */
8610 int n_out;
8611 xmlBufferPtr in; /* an xmlBuffer for the input */
8612 int n_in;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008613
Daniel Veillardce682bc2004-11-05 17:22:25 +00008614 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8615 for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8616 for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8617 mem_base = xmlMemBlocks();
8618 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8619 out = gen_xmlBufferPtr(n_out, 1);
8620 in = gen_xmlBufferPtr(n_in, 2);
8621
8622 ret_val = xmlCharEncFirstLine(handler, out, in);
8623 desret_int(ret_val);
8624 call_tests++;
8625 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8626 des_xmlBufferPtr(n_out, out, 1);
8627 des_xmlBufferPtr(n_in, in, 2);
8628 xmlResetLastError();
8629 if (mem_base != xmlMemBlocks()) {
8630 printf("Leak of %d blocks found in xmlCharEncFirstLine",
8631 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00008632 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00008633 printf(" %d", n_handler);
8634 printf(" %d", n_out);
8635 printf(" %d", n_in);
8636 printf("\n");
8637 }
8638 }
8639 }
8640 }
8641
8642 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008643 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008644}
8645
8646
8647static int
8648test_xmlCharEncInFunc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008649 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008650
Daniel Veillardce682bc2004-11-05 17:22:25 +00008651 int mem_base;
8652 int ret_val;
8653 xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8654 int n_handler;
8655 xmlBufferPtr out; /* an xmlBuffer for the output. */
8656 int n_out;
8657 xmlBufferPtr in; /* an xmlBuffer for the input */
8658 int n_in;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008659
Daniel Veillardce682bc2004-11-05 17:22:25 +00008660 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8661 for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8662 for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8663 mem_base = xmlMemBlocks();
8664 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8665 out = gen_xmlBufferPtr(n_out, 1);
8666 in = gen_xmlBufferPtr(n_in, 2);
8667
8668 ret_val = xmlCharEncInFunc(handler, out, in);
8669 desret_int(ret_val);
8670 call_tests++;
8671 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8672 des_xmlBufferPtr(n_out, out, 1);
8673 des_xmlBufferPtr(n_in, in, 2);
8674 xmlResetLastError();
8675 if (mem_base != xmlMemBlocks()) {
8676 printf("Leak of %d blocks found in xmlCharEncInFunc",
8677 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00008678 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00008679 printf(" %d", n_handler);
8680 printf(" %d", n_out);
8681 printf(" %d", n_in);
8682 printf("\n");
8683 }
8684 }
8685 }
8686 }
8687
8688 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008689 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008690}
8691
8692
8693static int
8694test_xmlCharEncOutFunc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008695 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008696
Daniel Veillardce682bc2004-11-05 17:22:25 +00008697 int mem_base;
8698 int ret_val;
8699 xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8700 int n_handler;
8701 xmlBufferPtr out; /* an xmlBuffer for the output. */
8702 int n_out;
8703 xmlBufferPtr in; /* an xmlBuffer for the input */
8704 int n_in;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008705
Daniel Veillardce682bc2004-11-05 17:22:25 +00008706 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8707 for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8708 for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8709 mem_base = xmlMemBlocks();
8710 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8711 out = gen_xmlBufferPtr(n_out, 1);
8712 in = gen_xmlBufferPtr(n_in, 2);
8713
8714 ret_val = xmlCharEncOutFunc(handler, out, in);
8715 desret_int(ret_val);
8716 call_tests++;
8717 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8718 des_xmlBufferPtr(n_out, out, 1);
8719 des_xmlBufferPtr(n_in, in, 2);
8720 xmlResetLastError();
8721 if (mem_base != xmlMemBlocks()) {
8722 printf("Leak of %d blocks found in xmlCharEncOutFunc",
8723 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00008724 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00008725 printf(" %d", n_handler);
8726 printf(" %d", n_out);
8727 printf(" %d", n_in);
8728 printf("\n");
8729 }
8730 }
8731 }
8732 }
8733
8734 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008735 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008736}
8737
8738
8739static int
8740test_xmlCleanupCharEncodingHandlers(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008741 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008742
8743
8744
8745 xmlCleanupCharEncodingHandlers();
8746 call_tests++;
8747 xmlResetLastError();
8748
Daniel Veillard3d97e662004-11-04 10:49:00 +00008749 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008750 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008751}
8752
8753
8754static int
8755test_xmlCleanupEncodingAliases(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008756 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008757
8758 int mem_base;
8759
8760 mem_base = xmlMemBlocks();
8761
8762 xmlCleanupEncodingAliases();
8763 call_tests++;
8764 xmlResetLastError();
8765 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +00008766 printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
Daniel Veillardd93f6252004-11-02 15:53:51 +00008767 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00008768 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00008769 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +00008770 }
8771
Daniel Veillard3d97e662004-11-04 10:49:00 +00008772 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008773 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008774}
8775
8776
8777static int
8778test_xmlDelEncodingAlias(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008779 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008780
8781 int mem_base;
8782 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +00008783 char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
Daniel Veillardd93f6252004-11-02 15:53:51 +00008784 int n_alias;
8785
8786 for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8787 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00008788 alias = gen_const_char_ptr(n_alias, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008789
8790 ret_val = xmlDelEncodingAlias(alias);
8791 desret_int(ret_val);
8792 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00008793 des_const_char_ptr(n_alias, alias, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008794 xmlResetLastError();
8795 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +00008796 printf("Leak of %d blocks found in xmlDelEncodingAlias",
Daniel Veillardd93f6252004-11-02 15:53:51 +00008797 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00008798 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00008799 printf(" %d", n_alias);
8800 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +00008801 }
8802 }
8803
Daniel Veillard3d97e662004-11-04 10:49:00 +00008804 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008805 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008806}
8807
8808
8809static int
8810test_xmlDetectCharEncoding(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008811 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008812
Daniel Veillardce682bc2004-11-05 17:22:25 +00008813 int mem_base;
8814 xmlCharEncoding ret_val;
8815 unsigned char * in; /* a pointer to the first bytes of the XML entity, must be at least 2 bytes long (at least 4 if encoding is UTF4 variant). */
8816 int n_in;
8817 int len; /* pointer to the length of the buffer */
8818 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008819
Daniel Veillardce682bc2004-11-05 17:22:25 +00008820 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8821 for (n_len = 0;n_len < gen_nb_int;n_len++) {
8822 mem_base = xmlMemBlocks();
8823 in = gen_const_unsigned_char_ptr(n_in, 0);
8824 len = gen_int(n_len, 1);
8825
8826 ret_val = xmlDetectCharEncoding(in, len);
8827 desret_xmlCharEncoding(ret_val);
8828 call_tests++;
8829 des_const_unsigned_char_ptr(n_in, in, 0);
8830 des_int(n_len, len, 1);
8831 xmlResetLastError();
8832 if (mem_base != xmlMemBlocks()) {
8833 printf("Leak of %d blocks found in xmlDetectCharEncoding",
8834 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00008835 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00008836 printf(" %d", n_in);
8837 printf(" %d", n_len);
8838 printf("\n");
8839 }
8840 }
8841 }
8842
8843 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008844 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008845}
8846
8847
8848static int
8849test_xmlFindCharEncodingHandler(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008850 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008851
8852
8853 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +00008854 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008855}
8856
8857
8858static int
8859test_xmlGetCharEncodingHandler(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008860 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008861
8862
8863 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +00008864 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008865}
8866
8867
8868static int
8869test_xmlGetCharEncodingName(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008870 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008871
Daniel Veillard3d97e662004-11-04 10:49:00 +00008872 int mem_base;
8873 const char * ret_val;
8874 xmlCharEncoding enc; /* the encoding */
8875 int n_enc;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008876
Daniel Veillard3d97e662004-11-04 10:49:00 +00008877 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
8878 mem_base = xmlMemBlocks();
8879 enc = gen_xmlCharEncoding(n_enc, 0);
8880
8881 ret_val = xmlGetCharEncodingName(enc);
8882 desret_const_char_ptr(ret_val);
8883 call_tests++;
8884 des_xmlCharEncoding(n_enc, enc, 0);
8885 xmlResetLastError();
8886 if (mem_base != xmlMemBlocks()) {
8887 printf("Leak of %d blocks found in xmlGetCharEncodingName",
8888 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00008889 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00008890 printf(" %d", n_enc);
8891 printf("\n");
8892 }
8893 }
8894
8895 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008896 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008897}
8898
8899
8900static int
8901test_xmlGetEncodingAlias(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008902 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008903
8904 int mem_base;
8905 const char * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +00008906 char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
Daniel Veillardd93f6252004-11-02 15:53:51 +00008907 int n_alias;
8908
8909 for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8910 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00008911 alias = gen_const_char_ptr(n_alias, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008912
8913 ret_val = xmlGetEncodingAlias(alias);
8914 desret_const_char_ptr(ret_val);
8915 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00008916 des_const_char_ptr(n_alias, alias, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008917 xmlResetLastError();
8918 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +00008919 printf("Leak of %d blocks found in xmlGetEncodingAlias",
Daniel Veillardd93f6252004-11-02 15:53:51 +00008920 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00008921 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00008922 printf(" %d", n_alias);
8923 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +00008924 }
8925 }
8926
Daniel Veillard3d97e662004-11-04 10:49:00 +00008927 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008928 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008929}
8930
8931
8932static int
8933test_xmlInitCharEncodingHandlers(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008934 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008935
8936
8937
8938 xmlInitCharEncodingHandlers();
8939 call_tests++;
8940 xmlResetLastError();
8941
Daniel Veillard3d97e662004-11-04 10:49:00 +00008942 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008943 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008944}
8945
8946
8947static int
8948test_xmlNewCharEncodingHandler(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008949 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008950
8951
8952 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +00008953 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008954}
8955
8956
8957static int
8958test_xmlParseCharEncoding(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008959 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008960
Daniel Veillard3d97e662004-11-04 10:49:00 +00008961 int mem_base;
8962 xmlCharEncoding ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +00008963 char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
Daniel Veillard3d97e662004-11-04 10:49:00 +00008964 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008965
Daniel Veillard3d97e662004-11-04 10:49:00 +00008966 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8967 mem_base = xmlMemBlocks();
8968 name = gen_const_char_ptr(n_name, 0);
8969
8970 ret_val = xmlParseCharEncoding(name);
8971 desret_xmlCharEncoding(ret_val);
8972 call_tests++;
8973 des_const_char_ptr(n_name, name, 0);
8974 xmlResetLastError();
8975 if (mem_base != xmlMemBlocks()) {
8976 printf("Leak of %d blocks found in xmlParseCharEncoding",
8977 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00008978 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00008979 printf(" %d", n_name);
8980 printf("\n");
8981 }
8982 }
8983
8984 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00008985 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00008986}
8987
8988
Daniel Veillardce682bc2004-11-05 17:22:25 +00008989#define gen_nb_xmlCharEncodingHandlerPtr 1
8990static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8991 return(NULL);
8992}
8993static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8994}
8995
Daniel Veillardd93f6252004-11-02 15:53:51 +00008996static int
8997test_xmlRegisterCharEncodingHandler(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00008998 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00008999
Daniel Veillardce682bc2004-11-05 17:22:25 +00009000 int mem_base;
9001 xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
9002 int n_handler;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009003
Daniel Veillardce682bc2004-11-05 17:22:25 +00009004 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
9005 mem_base = xmlMemBlocks();
9006 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
9007
9008 xmlRegisterCharEncodingHandler(handler);
9009 call_tests++;
9010 des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
9011 xmlResetLastError();
9012 if (mem_base != xmlMemBlocks()) {
9013 printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
9014 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00009015 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009016 printf(" %d", n_handler);
9017 printf("\n");
9018 }
9019 }
9020
9021 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00009022 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009023}
9024
9025static int
9026test_encoding(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009027 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009028
Daniel Veillardce682bc2004-11-05 17:22:25 +00009029 printf("Testing encoding : 16 of 19 functions ...\n");
Daniel Veillard42595322004-11-08 10:52:06 +00009030 test_ret += test_UTF8Toisolat1();
9031 test_ret += test_isolat1ToUTF8();
9032 test_ret += test_xmlAddEncodingAlias();
9033 test_ret += test_xmlCharEncCloseFunc();
9034 test_ret += test_xmlCharEncFirstLine();
9035 test_ret += test_xmlCharEncInFunc();
9036 test_ret += test_xmlCharEncOutFunc();
9037 test_ret += test_xmlCleanupCharEncodingHandlers();
9038 test_ret += test_xmlCleanupEncodingAliases();
9039 test_ret += test_xmlDelEncodingAlias();
9040 test_ret += test_xmlDetectCharEncoding();
9041 test_ret += test_xmlFindCharEncodingHandler();
9042 test_ret += test_xmlGetCharEncodingHandler();
9043 test_ret += test_xmlGetCharEncodingName();
9044 test_ret += test_xmlGetEncodingAlias();
9045 test_ret += test_xmlInitCharEncodingHandlers();
9046 test_ret += test_xmlNewCharEncodingHandler();
9047 test_ret += test_xmlParseCharEncoding();
9048 test_ret += test_xmlRegisterCharEncodingHandler();
Daniel Veillardd93f6252004-11-02 15:53:51 +00009049
Daniel Veillard42595322004-11-08 10:52:06 +00009050 if (test_ret != 0)
9051 printf("Module encoding: %d errors\n", test_ret);
9052 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009053}
9054
9055static int
9056test_xmlAddDocEntity(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009057 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009058
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00009059 int mem_base;
9060 xmlEntityPtr ret_val;
9061 xmlDocPtr doc; /* the document */
9062 int n_doc;
9063 xmlChar * name; /* the entity name */
9064 int n_name;
9065 int type; /* the entity type XML_xxx_yyy_ENTITY */
9066 int n_type;
9067 xmlChar * ExternalID; /* the entity external ID if available */
9068 int n_ExternalID;
9069 xmlChar * SystemID; /* the entity system ID if available */
9070 int n_SystemID;
9071 xmlChar * content; /* the entity content */
9072 int n_content;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009073
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00009074 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9075 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9076 for (n_type = 0;n_type < gen_nb_int;n_type++) {
9077 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9078 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9079 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9080 mem_base = xmlMemBlocks();
9081 doc = gen_xmlDocPtr(n_doc, 0);
9082 name = gen_const_xmlChar_ptr(n_name, 1);
9083 type = gen_int(n_type, 2);
9084 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9085 SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9086 content = gen_const_xmlChar_ptr(n_content, 5);
9087
9088 ret_val = xmlAddDocEntity(doc, name, type, ExternalID, SystemID, content);
9089 desret_xmlEntityPtr(ret_val);
9090 call_tests++;
9091 des_xmlDocPtr(n_doc, doc, 0);
9092 des_const_xmlChar_ptr(n_name, name, 1);
9093 des_int(n_type, type, 2);
9094 des_const_xmlChar_ptr(n_ExternalID, ExternalID, 3);
9095 des_const_xmlChar_ptr(n_SystemID, SystemID, 4);
9096 des_const_xmlChar_ptr(n_content, content, 5);
9097 xmlResetLastError();
9098 if (mem_base != xmlMemBlocks()) {
9099 printf("Leak of %d blocks found in xmlAddDocEntity",
9100 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00009101 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00009102 printf(" %d", n_doc);
9103 printf(" %d", n_name);
9104 printf(" %d", n_type);
9105 printf(" %d", n_ExternalID);
9106 printf(" %d", n_SystemID);
9107 printf(" %d", n_content);
9108 printf("\n");
9109 }
9110 }
9111 }
9112 }
9113 }
9114 }
9115 }
9116
9117 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00009118 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009119}
9120
9121
9122static int
9123test_xmlAddDtdEntity(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009124 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009125
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00009126 int mem_base;
9127 xmlEntityPtr ret_val;
9128 xmlDocPtr doc; /* the document */
9129 int n_doc;
9130 xmlChar * name; /* the entity name */
9131 int n_name;
9132 int type; /* the entity type XML_xxx_yyy_ENTITY */
9133 int n_type;
9134 xmlChar * ExternalID; /* the entity external ID if available */
9135 int n_ExternalID;
9136 xmlChar * SystemID; /* the entity system ID if available */
9137 int n_SystemID;
9138 xmlChar * content; /* the entity content */
9139 int n_content;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009140
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00009141 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9142 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9143 for (n_type = 0;n_type < gen_nb_int;n_type++) {
9144 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9145 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9146 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9147 mem_base = xmlMemBlocks();
9148 doc = gen_xmlDocPtr(n_doc, 0);
9149 name = gen_const_xmlChar_ptr(n_name, 1);
9150 type = gen_int(n_type, 2);
9151 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9152 SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9153 content = gen_const_xmlChar_ptr(n_content, 5);
9154
9155 ret_val = xmlAddDtdEntity(doc, name, type, ExternalID, SystemID, content);
9156 desret_xmlEntityPtr(ret_val);
9157 call_tests++;
9158 des_xmlDocPtr(n_doc, doc, 0);
9159 des_const_xmlChar_ptr(n_name, name, 1);
9160 des_int(n_type, type, 2);
9161 des_const_xmlChar_ptr(n_ExternalID, ExternalID, 3);
9162 des_const_xmlChar_ptr(n_SystemID, SystemID, 4);
9163 des_const_xmlChar_ptr(n_content, content, 5);
9164 xmlResetLastError();
9165 if (mem_base != xmlMemBlocks()) {
9166 printf("Leak of %d blocks found in xmlAddDtdEntity",
9167 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00009168 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00009169 printf(" %d", n_doc);
9170 printf(" %d", n_name);
9171 printf(" %d", n_type);
9172 printf(" %d", n_ExternalID);
9173 printf(" %d", n_SystemID);
9174 printf(" %d", n_content);
9175 printf("\n");
9176 }
9177 }
9178 }
9179 }
9180 }
9181 }
9182 }
9183
9184 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00009185 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009186}
9187
9188
9189static int
9190test_xmlCleanupPredefinedEntities(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009191 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009192
9193 int mem_base;
9194
9195 mem_base = xmlMemBlocks();
9196
9197 xmlCleanupPredefinedEntities();
9198 call_tests++;
9199 xmlResetLastError();
9200 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +00009201 printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
Daniel Veillardd93f6252004-11-02 15:53:51 +00009202 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00009203 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00009204 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +00009205 }
9206
Daniel Veillard3d97e662004-11-04 10:49:00 +00009207 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00009208 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009209}
9210
9211
Daniel Veillardce682bc2004-11-05 17:22:25 +00009212#define gen_nb_xmlEntitiesTablePtr 1
9213static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9214 return(NULL);
9215}
9216static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9217}
9218
Daniel Veillardd93f6252004-11-02 15:53:51 +00009219static int
9220test_xmlCopyEntitiesTable(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009221 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009222
9223
9224 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +00009225 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009226}
9227
9228
9229static int
9230test_xmlCreateEntitiesTable(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009231 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009232
9233
9234 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +00009235 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009236}
9237
9238
9239static int
9240test_xmlDumpEntitiesTable(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009241 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009242
Daniel Veillardce682bc2004-11-05 17:22:25 +00009243#ifdef LIBXML_OUTPUT_ENABLED
9244 int mem_base;
9245 xmlBufferPtr buf; /* An XML buffer. */
9246 int n_buf;
9247 xmlEntitiesTablePtr table; /* An entity table */
9248 int n_table;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009249
Daniel Veillardce682bc2004-11-05 17:22:25 +00009250 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9251 for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9252 mem_base = xmlMemBlocks();
9253 buf = gen_xmlBufferPtr(n_buf, 0);
9254 table = gen_xmlEntitiesTablePtr(n_table, 1);
9255
9256 xmlDumpEntitiesTable(buf, table);
9257 call_tests++;
9258 des_xmlBufferPtr(n_buf, buf, 0);
9259 des_xmlEntitiesTablePtr(n_table, table, 1);
9260 xmlResetLastError();
9261 if (mem_base != xmlMemBlocks()) {
9262 printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9263 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00009264 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009265 printf(" %d", n_buf);
9266 printf(" %d", n_table);
9267 printf("\n");
9268 }
9269 }
9270 }
9271#endif
9272
9273 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00009274 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009275}
9276
9277
Daniel Veillardce682bc2004-11-05 17:22:25 +00009278#define gen_nb_xmlEntityPtr 1
9279static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9280 return(NULL);
9281}
9282static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9283}
9284
Daniel Veillardd93f6252004-11-02 15:53:51 +00009285static int
9286test_xmlDumpEntityDecl(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009287 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009288
Daniel Veillardce682bc2004-11-05 17:22:25 +00009289#ifdef LIBXML_OUTPUT_ENABLED
9290 int mem_base;
9291 xmlBufferPtr buf; /* An XML buffer. */
9292 int n_buf;
9293 xmlEntityPtr ent; /* An entity table */
9294 int n_ent;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009295
Daniel Veillardce682bc2004-11-05 17:22:25 +00009296 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9297 for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9298 mem_base = xmlMemBlocks();
9299 buf = gen_xmlBufferPtr(n_buf, 0);
9300 ent = gen_xmlEntityPtr(n_ent, 1);
9301
9302 xmlDumpEntityDecl(buf, ent);
9303 call_tests++;
9304 des_xmlBufferPtr(n_buf, buf, 0);
9305 des_xmlEntityPtr(n_ent, ent, 1);
9306 xmlResetLastError();
9307 if (mem_base != xmlMemBlocks()) {
9308 printf("Leak of %d blocks found in xmlDumpEntityDecl",
9309 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00009310 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009311 printf(" %d", n_buf);
9312 printf(" %d", n_ent);
9313 printf("\n");
9314 }
9315 }
9316 }
9317#endif
9318
9319 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00009320 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009321}
9322
9323
9324static int
Daniel Veillardd93f6252004-11-02 15:53:51 +00009325test_xmlEncodeEntitiesReentrant(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009326 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009327
Daniel Veillard8a32fe42004-11-02 22:10:16 +00009328 int mem_base;
9329 xmlChar * ret_val;
9330 xmlDocPtr doc; /* the document containing the string */
9331 int n_doc;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009332 xmlChar * input; /* A string to convert to XML. */
Daniel Veillard8a32fe42004-11-02 22:10:16 +00009333 int n_input;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009334
Daniel Veillard8a32fe42004-11-02 22:10:16 +00009335 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9336 for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9337 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00009338 doc = gen_xmlDocPtr(n_doc, 0);
9339 input = gen_const_xmlChar_ptr(n_input, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +00009340
9341 ret_val = xmlEncodeEntitiesReentrant(doc, input);
9342 desret_xmlChar_ptr(ret_val);
9343 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00009344 des_xmlDocPtr(n_doc, doc, 0);
9345 des_const_xmlChar_ptr(n_input, input, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +00009346 xmlResetLastError();
9347 if (mem_base != xmlMemBlocks()) {
9348 printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9349 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00009350 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +00009351 printf(" %d", n_doc);
9352 printf(" %d", n_input);
9353 printf("\n");
9354 }
9355 }
9356 }
9357
Daniel Veillard3d97e662004-11-04 10:49:00 +00009358 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00009359 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009360}
9361
9362
9363static int
9364test_xmlEncodeSpecialChars(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009365 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009366
Daniel Veillard8a32fe42004-11-02 22:10:16 +00009367 int mem_base;
9368 xmlChar * ret_val;
9369 xmlDocPtr doc; /* the document containing the string */
9370 int n_doc;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009371 xmlChar * input; /* A string to convert to XML. */
Daniel Veillard8a32fe42004-11-02 22:10:16 +00009372 int n_input;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009373
Daniel Veillard8a32fe42004-11-02 22:10:16 +00009374 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9375 for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9376 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00009377 doc = gen_xmlDocPtr(n_doc, 0);
9378 input = gen_const_xmlChar_ptr(n_input, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +00009379
9380 ret_val = xmlEncodeSpecialChars(doc, input);
9381 desret_xmlChar_ptr(ret_val);
9382 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00009383 des_xmlDocPtr(n_doc, doc, 0);
9384 des_const_xmlChar_ptr(n_input, input, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +00009385 xmlResetLastError();
9386 if (mem_base != xmlMemBlocks()) {
9387 printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9388 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00009389 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +00009390 printf(" %d", n_doc);
9391 printf(" %d", n_input);
9392 printf("\n");
9393 }
9394 }
9395 }
9396
Daniel Veillard3d97e662004-11-04 10:49:00 +00009397 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00009398 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009399}
9400
9401
9402static int
9403test_xmlGetDocEntity(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009404 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009405
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00009406 int mem_base;
9407 xmlEntityPtr ret_val;
9408 xmlDocPtr doc; /* the document referencing the entity */
9409 int n_doc;
9410 xmlChar * name; /* the entity name */
9411 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009412
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00009413 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9414 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9415 mem_base = xmlMemBlocks();
9416 doc = gen_xmlDocPtr(n_doc, 0);
9417 name = gen_const_xmlChar_ptr(n_name, 1);
9418
9419 ret_val = xmlGetDocEntity(doc, name);
9420 desret_xmlEntityPtr(ret_val);
9421 call_tests++;
9422 des_xmlDocPtr(n_doc, doc, 0);
9423 des_const_xmlChar_ptr(n_name, name, 1);
9424 xmlResetLastError();
9425 if (mem_base != xmlMemBlocks()) {
9426 printf("Leak of %d blocks found in xmlGetDocEntity",
9427 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00009428 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00009429 printf(" %d", n_doc);
9430 printf(" %d", n_name);
9431 printf("\n");
9432 }
9433 }
9434 }
9435
9436 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00009437 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009438}
9439
9440
9441static int
9442test_xmlGetDtdEntity(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009443 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009444
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00009445 int mem_base;
9446 xmlEntityPtr ret_val;
9447 xmlDocPtr doc; /* the document referencing the entity */
9448 int n_doc;
9449 xmlChar * name; /* the entity name */
9450 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009451
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00009452 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9453 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9454 mem_base = xmlMemBlocks();
9455 doc = gen_xmlDocPtr(n_doc, 0);
9456 name = gen_const_xmlChar_ptr(n_name, 1);
9457
9458 ret_val = xmlGetDtdEntity(doc, name);
9459 desret_xmlEntityPtr(ret_val);
9460 call_tests++;
9461 des_xmlDocPtr(n_doc, doc, 0);
9462 des_const_xmlChar_ptr(n_name, name, 1);
9463 xmlResetLastError();
9464 if (mem_base != xmlMemBlocks()) {
9465 printf("Leak of %d blocks found in xmlGetDtdEntity",
9466 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00009467 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00009468 printf(" %d", n_doc);
9469 printf(" %d", n_name);
9470 printf("\n");
9471 }
9472 }
9473 }
9474
9475 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00009476 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009477}
9478
9479
9480static int
9481test_xmlGetParameterEntity(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009482 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009483
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00009484 int mem_base;
9485 xmlEntityPtr ret_val;
9486 xmlDocPtr doc; /* the document referencing the entity */
9487 int n_doc;
9488 xmlChar * name; /* the entity name */
9489 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009490
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00009491 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9492 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9493 mem_base = xmlMemBlocks();
9494 doc = gen_xmlDocPtr(n_doc, 0);
9495 name = gen_const_xmlChar_ptr(n_name, 1);
9496
9497 ret_val = xmlGetParameterEntity(doc, name);
9498 desret_xmlEntityPtr(ret_val);
9499 call_tests++;
9500 des_xmlDocPtr(n_doc, doc, 0);
9501 des_const_xmlChar_ptr(n_name, name, 1);
9502 xmlResetLastError();
9503 if (mem_base != xmlMemBlocks()) {
9504 printf("Leak of %d blocks found in xmlGetParameterEntity",
9505 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00009506 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00009507 printf(" %d", n_doc);
9508 printf(" %d", n_name);
9509 printf("\n");
9510 }
9511 }
9512 }
9513
9514 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00009515 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009516}
9517
9518
9519static int
9520test_xmlGetPredefinedEntity(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009521 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009522
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00009523 int mem_base;
9524 xmlEntityPtr ret_val;
9525 xmlChar * name; /* the entity name */
9526 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009527
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00009528 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9529 mem_base = xmlMemBlocks();
9530 name = gen_const_xmlChar_ptr(n_name, 0);
9531
9532 ret_val = xmlGetPredefinedEntity(name);
9533 desret_xmlEntityPtr(ret_val);
9534 call_tests++;
9535 des_const_xmlChar_ptr(n_name, name, 0);
9536 xmlResetLastError();
9537 if (mem_base != xmlMemBlocks()) {
9538 printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9539 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00009540 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00009541 printf(" %d", n_name);
9542 printf("\n");
9543 }
9544 }
9545
9546 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00009547 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009548}
9549
9550
9551static int
9552test_xmlInitializePredefinedEntities(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009553 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009554
9555 int mem_base;
9556
9557 mem_base = xmlMemBlocks();
9558
9559 xmlInitializePredefinedEntities();
9560 call_tests++;
9561 xmlResetLastError();
9562 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +00009563 printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
Daniel Veillardd93f6252004-11-02 15:53:51 +00009564 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00009565 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +00009566 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +00009567 }
9568
Daniel Veillard3d97e662004-11-04 10:49:00 +00009569 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00009570 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009571}
9572
9573static int
9574test_entities(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009575 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009576
Daniel Veillardd5cc0f72004-11-06 19:24:28 +00009577 printf("Testing entities : 12 of 16 functions ...\n");
Daniel Veillard42595322004-11-08 10:52:06 +00009578 test_ret += test_xmlAddDocEntity();
9579 test_ret += test_xmlAddDtdEntity();
9580 test_ret += test_xmlCleanupPredefinedEntities();
9581 test_ret += test_xmlCopyEntitiesTable();
9582 test_ret += test_xmlCreateEntitiesTable();
9583 test_ret += test_xmlDumpEntitiesTable();
9584 test_ret += test_xmlDumpEntityDecl();
9585 test_ret += test_xmlEncodeEntitiesReentrant();
9586 test_ret += test_xmlEncodeSpecialChars();
9587 test_ret += test_xmlGetDocEntity();
9588 test_ret += test_xmlGetDtdEntity();
9589 test_ret += test_xmlGetParameterEntity();
9590 test_ret += test_xmlGetPredefinedEntity();
9591 test_ret += test_xmlInitializePredefinedEntities();
Daniel Veillardd93f6252004-11-02 15:53:51 +00009592
Daniel Veillard42595322004-11-08 10:52:06 +00009593 if (test_ret != 0)
9594 printf("Module entities: %d errors\n", test_ret);
9595 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009596}
9597
9598static int
9599test_xmlHashAddEntry(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009600 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009601
Daniel Veillardd005b9e2004-11-03 17:07:05 +00009602 int mem_base;
9603 int ret_val;
9604 xmlHashTablePtr table; /* the hash table */
9605 int n_table;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009606 xmlChar * name; /* the name of the userdata */
Daniel Veillardd005b9e2004-11-03 17:07:05 +00009607 int n_name;
9608 void * userdata; /* a pointer to the userdata */
9609 int n_userdata;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009610
Daniel Veillardd005b9e2004-11-03 17:07:05 +00009611 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9612 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9613 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9614 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00009615 table = gen_xmlHashTablePtr(n_table, 0);
9616 name = gen_const_xmlChar_ptr(n_name, 1);
9617 userdata = gen_userdata(n_userdata, 2);
Daniel Veillardd005b9e2004-11-03 17:07:05 +00009618
9619 ret_val = xmlHashAddEntry(table, name, userdata);
9620 desret_int(ret_val);
9621 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00009622 des_xmlHashTablePtr(n_table, table, 0);
9623 des_const_xmlChar_ptr(n_name, name, 1);
9624 des_userdata(n_userdata, userdata, 2);
Daniel Veillardd005b9e2004-11-03 17:07:05 +00009625 xmlResetLastError();
9626 if (mem_base != xmlMemBlocks()) {
9627 printf("Leak of %d blocks found in xmlHashAddEntry",
9628 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00009629 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +00009630 printf(" %d", n_table);
9631 printf(" %d", n_name);
9632 printf(" %d", n_userdata);
9633 printf("\n");
9634 }
9635 }
9636 }
9637 }
9638
Daniel Veillard3d97e662004-11-04 10:49:00 +00009639 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00009640 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009641}
9642
9643
9644static int
9645test_xmlHashAddEntry2(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009646 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009647
Daniel Veillardd005b9e2004-11-03 17:07:05 +00009648 int mem_base;
9649 int ret_val;
9650 xmlHashTablePtr table; /* the hash table */
9651 int n_table;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009652 xmlChar * name; /* the name of the userdata */
Daniel Veillardd005b9e2004-11-03 17:07:05 +00009653 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009654 xmlChar * name2; /* a second name of the userdata */
Daniel Veillardd005b9e2004-11-03 17:07:05 +00009655 int n_name2;
9656 void * userdata; /* a pointer to the userdata */
9657 int n_userdata;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009658
Daniel Veillardd005b9e2004-11-03 17:07:05 +00009659 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9660 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9661 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9662 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9663 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00009664 table = gen_xmlHashTablePtr(n_table, 0);
9665 name = gen_const_xmlChar_ptr(n_name, 1);
9666 name2 = gen_const_xmlChar_ptr(n_name2, 2);
9667 userdata = gen_userdata(n_userdata, 3);
Daniel Veillardd005b9e2004-11-03 17:07:05 +00009668
9669 ret_val = xmlHashAddEntry2(table, name, name2, userdata);
9670 desret_int(ret_val);
9671 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00009672 des_xmlHashTablePtr(n_table, table, 0);
9673 des_const_xmlChar_ptr(n_name, name, 1);
9674 des_const_xmlChar_ptr(n_name2, name2, 2);
9675 des_userdata(n_userdata, userdata, 3);
Daniel Veillardd005b9e2004-11-03 17:07:05 +00009676 xmlResetLastError();
9677 if (mem_base != xmlMemBlocks()) {
9678 printf("Leak of %d blocks found in xmlHashAddEntry2",
9679 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00009680 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +00009681 printf(" %d", n_table);
9682 printf(" %d", n_name);
9683 printf(" %d", n_name2);
9684 printf(" %d", n_userdata);
9685 printf("\n");
9686 }
9687 }
9688 }
9689 }
9690 }
9691
Daniel Veillard3d97e662004-11-04 10:49:00 +00009692 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00009693 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009694}
9695
9696
9697static int
9698test_xmlHashAddEntry3(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009699 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009700
Daniel Veillardd005b9e2004-11-03 17:07:05 +00009701 int mem_base;
9702 int ret_val;
9703 xmlHashTablePtr table; /* the hash table */
9704 int n_table;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009705 xmlChar * name; /* the name of the userdata */
Daniel Veillardd005b9e2004-11-03 17:07:05 +00009706 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009707 xmlChar * name2; /* a second name of the userdata */
Daniel Veillardd005b9e2004-11-03 17:07:05 +00009708 int n_name2;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009709 xmlChar * name3; /* a third name of the userdata */
Daniel Veillardd005b9e2004-11-03 17:07:05 +00009710 int n_name3;
9711 void * userdata; /* a pointer to the userdata */
9712 int n_userdata;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009713
Daniel Veillardd005b9e2004-11-03 17:07:05 +00009714 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9715 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9716 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9717 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9718 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9719 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00009720 table = gen_xmlHashTablePtr(n_table, 0);
9721 name = gen_const_xmlChar_ptr(n_name, 1);
9722 name2 = gen_const_xmlChar_ptr(n_name2, 2);
9723 name3 = gen_const_xmlChar_ptr(n_name3, 3);
9724 userdata = gen_userdata(n_userdata, 4);
Daniel Veillardd005b9e2004-11-03 17:07:05 +00009725
9726 ret_val = xmlHashAddEntry3(table, name, name2, name3, userdata);
9727 desret_int(ret_val);
9728 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00009729 des_xmlHashTablePtr(n_table, table, 0);
9730 des_const_xmlChar_ptr(n_name, name, 1);
9731 des_const_xmlChar_ptr(n_name2, name2, 2);
9732 des_const_xmlChar_ptr(n_name3, name3, 3);
9733 des_userdata(n_userdata, userdata, 4);
Daniel Veillardd005b9e2004-11-03 17:07:05 +00009734 xmlResetLastError();
9735 if (mem_base != xmlMemBlocks()) {
9736 printf("Leak of %d blocks found in xmlHashAddEntry3",
9737 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00009738 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +00009739 printf(" %d", n_table);
9740 printf(" %d", n_name);
9741 printf(" %d", n_name2);
9742 printf(" %d", n_name3);
9743 printf(" %d", n_userdata);
9744 printf("\n");
9745 }
9746 }
9747 }
9748 }
9749 }
9750 }
9751
Daniel Veillard3d97e662004-11-04 10:49:00 +00009752 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00009753 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009754}
9755
9756
9757static int
9758test_xmlHashCopy(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009759 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009760
9761
9762 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +00009763 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009764}
9765
9766
9767static int
9768test_xmlHashCreate(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009769 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009770
9771
9772 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +00009773 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009774}
9775
9776
9777static int
9778test_xmlHashLookup(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009779 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009780
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009781 int mem_base;
9782 void * ret_val;
9783 xmlHashTablePtr table; /* the hash table */
9784 int n_table;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009785 xmlChar * name; /* the name of the userdata */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009786 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009787
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009788 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9789 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9790 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00009791 table = gen_xmlHashTablePtr(n_table, 0);
9792 name = gen_const_xmlChar_ptr(n_name, 1);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009793
9794 ret_val = xmlHashLookup(table, name);
9795 desret_void_ptr(ret_val);
9796 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00009797 des_xmlHashTablePtr(n_table, table, 0);
9798 des_const_xmlChar_ptr(n_name, name, 1);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009799 xmlResetLastError();
9800 if (mem_base != xmlMemBlocks()) {
9801 printf("Leak of %d blocks found in xmlHashLookup",
9802 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00009803 test_ret++;
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009804 printf(" %d", n_table);
9805 printf(" %d", n_name);
9806 printf("\n");
9807 }
9808 }
9809 }
9810
Daniel Veillard3d97e662004-11-04 10:49:00 +00009811 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00009812 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009813}
9814
9815
9816static int
9817test_xmlHashLookup2(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009818 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009819
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009820 int mem_base;
9821 void * ret_val;
9822 xmlHashTablePtr table; /* the hash table */
9823 int n_table;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009824 xmlChar * name; /* the name of the userdata */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009825 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009826 xmlChar * name2; /* a second name of the userdata */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009827 int n_name2;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009828
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009829 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9830 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9831 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9832 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00009833 table = gen_xmlHashTablePtr(n_table, 0);
9834 name = gen_const_xmlChar_ptr(n_name, 1);
9835 name2 = gen_const_xmlChar_ptr(n_name2, 2);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009836
9837 ret_val = xmlHashLookup2(table, name, name2);
9838 desret_void_ptr(ret_val);
9839 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00009840 des_xmlHashTablePtr(n_table, table, 0);
9841 des_const_xmlChar_ptr(n_name, name, 1);
9842 des_const_xmlChar_ptr(n_name2, name2, 2);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009843 xmlResetLastError();
9844 if (mem_base != xmlMemBlocks()) {
9845 printf("Leak of %d blocks found in xmlHashLookup2",
9846 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00009847 test_ret++;
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009848 printf(" %d", n_table);
9849 printf(" %d", n_name);
9850 printf(" %d", n_name2);
9851 printf("\n");
9852 }
9853 }
9854 }
9855 }
9856
Daniel Veillard3d97e662004-11-04 10:49:00 +00009857 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00009858 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009859}
9860
9861
9862static int
9863test_xmlHashLookup3(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009864 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009865
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009866 int mem_base;
9867 void * ret_val;
9868 xmlHashTablePtr table; /* the hash table */
9869 int n_table;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009870 xmlChar * name; /* the name of the userdata */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009871 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009872 xmlChar * name2; /* a second name of the userdata */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009873 int n_name2;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009874 xmlChar * name3; /* a third name of the userdata */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009875 int n_name3;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009876
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009877 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9878 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9879 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9880 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9881 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00009882 table = gen_xmlHashTablePtr(n_table, 0);
9883 name = gen_const_xmlChar_ptr(n_name, 1);
9884 name2 = gen_const_xmlChar_ptr(n_name2, 2);
9885 name3 = gen_const_xmlChar_ptr(n_name3, 3);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009886
9887 ret_val = xmlHashLookup3(table, name, name2, name3);
9888 desret_void_ptr(ret_val);
9889 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00009890 des_xmlHashTablePtr(n_table, table, 0);
9891 des_const_xmlChar_ptr(n_name, name, 1);
9892 des_const_xmlChar_ptr(n_name2, name2, 2);
9893 des_const_xmlChar_ptr(n_name3, name3, 3);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009894 xmlResetLastError();
9895 if (mem_base != xmlMemBlocks()) {
9896 printf("Leak of %d blocks found in xmlHashLookup3",
9897 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00009898 test_ret++;
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009899 printf(" %d", n_table);
9900 printf(" %d", n_name);
9901 printf(" %d", n_name2);
9902 printf(" %d", n_name3);
9903 printf("\n");
9904 }
9905 }
9906 }
9907 }
9908 }
9909
Daniel Veillard3d97e662004-11-04 10:49:00 +00009910 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00009911 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009912}
9913
9914
9915static int
9916test_xmlHashQLookup(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009917 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009918
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009919 int mem_base;
9920 void * ret_val;
9921 xmlHashTablePtr table; /* the hash table */
9922 int n_table;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009923 xmlChar * prefix; /* the prefix of the userdata */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009924 int n_prefix;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009925 xmlChar * name; /* the name of the userdata */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009926 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009927
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009928 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9929 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
9930 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9931 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00009932 table = gen_xmlHashTablePtr(n_table, 0);
9933 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
9934 name = gen_const_xmlChar_ptr(n_name, 2);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009935
9936 ret_val = xmlHashQLookup(table, prefix, name);
9937 desret_void_ptr(ret_val);
9938 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00009939 des_xmlHashTablePtr(n_table, table, 0);
9940 des_const_xmlChar_ptr(n_prefix, prefix, 1);
9941 des_const_xmlChar_ptr(n_name, name, 2);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009942 xmlResetLastError();
9943 if (mem_base != xmlMemBlocks()) {
9944 printf("Leak of %d blocks found in xmlHashQLookup",
9945 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +00009946 test_ret++;
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009947 printf(" %d", n_table);
9948 printf(" %d", n_prefix);
9949 printf(" %d", n_name);
9950 printf("\n");
9951 }
9952 }
9953 }
9954 }
9955
Daniel Veillard3d97e662004-11-04 10:49:00 +00009956 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +00009957 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +00009958}
9959
9960
9961static int
9962test_xmlHashQLookup2(void) {
Daniel Veillard42595322004-11-08 10:52:06 +00009963 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009964
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009965 int mem_base;
9966 void * ret_val;
9967 xmlHashTablePtr table; /* the hash table */
9968 int n_table;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009969 xmlChar * prefix; /* the prefix of the userdata */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009970 int n_prefix;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009971 xmlChar * name; /* the name of the userdata */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009972 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009973 xmlChar * prefix2; /* the second prefix of the userdata */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009974 int n_prefix2;
Daniel Veillardce682bc2004-11-05 17:22:25 +00009975 xmlChar * name2; /* a second name of the userdata */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009976 int n_name2;
Daniel Veillardd93f6252004-11-02 15:53:51 +00009977
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009978 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9979 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
9980 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9981 for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
9982 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9983 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +00009984 table = gen_xmlHashTablePtr(n_table, 0);
9985 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
9986 name = gen_const_xmlChar_ptr(n_name, 2);
9987 prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
9988 name2 = gen_const_xmlChar_ptr(n_name2, 4);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009989
9990 ret_val = xmlHashQLookup2(table, prefix, name, prefix2, name2);
9991 desret_void_ptr(ret_val);
9992 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +00009993 des_xmlHashTablePtr(n_table, table, 0);
9994 des_const_xmlChar_ptr(n_prefix, prefix, 1);
9995 des_const_xmlChar_ptr(n_name, name, 2);
9996 des_const_xmlChar_ptr(n_prefix2, prefix2, 3);
9997 des_const_xmlChar_ptr(n_name2, name2, 4);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +00009998 xmlResetLastError();
9999 if (mem_base != xmlMemBlocks()) {
10000 printf("Leak of %d blocks found in xmlHashQLookup2",
10001 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000010002 test_ret++;
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000010003 printf(" %d", n_table);
10004 printf(" %d", n_prefix);
10005 printf(" %d", n_name);
10006 printf(" %d", n_prefix2);
10007 printf(" %d", n_name2);
10008 printf("\n");
10009 }
10010 }
10011 }
10012 }
10013 }
10014 }
10015
Daniel Veillard3d97e662004-11-04 10:49:00 +000010016 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000010017 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010018}
10019
10020
10021static int
10022test_xmlHashQLookup3(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010023 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010024
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000010025 int mem_base;
10026 void * ret_val;
10027 xmlHashTablePtr table; /* the hash table */
10028 int n_table;
Daniel Veillardce682bc2004-11-05 17:22:25 +000010029 xmlChar * prefix; /* the prefix of the userdata */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000010030 int n_prefix;
Daniel Veillardce682bc2004-11-05 17:22:25 +000010031 xmlChar * name; /* the name of the userdata */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000010032 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000010033 xmlChar * prefix2; /* the second prefix of the userdata */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000010034 int n_prefix2;
Daniel Veillardce682bc2004-11-05 17:22:25 +000010035 xmlChar * name2; /* a second name of the userdata */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000010036 int n_name2;
Daniel Veillardce682bc2004-11-05 17:22:25 +000010037 xmlChar * prefix3; /* the third prefix of the userdata */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000010038 int n_prefix3;
Daniel Veillardce682bc2004-11-05 17:22:25 +000010039 xmlChar * name3; /* a third name of the userdata */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000010040 int n_name3;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010041
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000010042 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10043 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10044 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10045 for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10046 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10047 for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
10048 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10049 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000010050 table = gen_xmlHashTablePtr(n_table, 0);
10051 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10052 name = gen_const_xmlChar_ptr(n_name, 2);
10053 prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10054 name2 = gen_const_xmlChar_ptr(n_name2, 4);
10055 prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
10056 name3 = gen_const_xmlChar_ptr(n_name3, 6);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000010057
10058 ret_val = xmlHashQLookup3(table, prefix, name, prefix2, name2, prefix3, name3);
10059 desret_void_ptr(ret_val);
10060 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000010061 des_xmlHashTablePtr(n_table, table, 0);
10062 des_const_xmlChar_ptr(n_prefix, prefix, 1);
10063 des_const_xmlChar_ptr(n_name, name, 2);
10064 des_const_xmlChar_ptr(n_prefix2, prefix2, 3);
10065 des_const_xmlChar_ptr(n_name2, name2, 4);
10066 des_const_xmlChar_ptr(n_prefix3, prefix3, 5);
10067 des_const_xmlChar_ptr(n_name3, name3, 6);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000010068 xmlResetLastError();
10069 if (mem_base != xmlMemBlocks()) {
10070 printf("Leak of %d blocks found in xmlHashQLookup3",
10071 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000010072 test_ret++;
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000010073 printf(" %d", n_table);
10074 printf(" %d", n_prefix);
10075 printf(" %d", n_name);
10076 printf(" %d", n_prefix2);
10077 printf(" %d", n_name2);
10078 printf(" %d", n_prefix3);
10079 printf(" %d", n_name3);
10080 printf("\n");
10081 }
10082 }
10083 }
10084 }
10085 }
10086 }
10087 }
10088 }
10089
Daniel Veillard3d97e662004-11-04 10:49:00 +000010090 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000010091 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010092}
10093
10094
10095static int
10096test_xmlHashRemoveEntry(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010097 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010098
Daniel Veillard42595322004-11-08 10:52:06 +000010099 int mem_base;
10100 int ret_val;
10101 xmlHashTablePtr table; /* the hash table */
10102 int n_table;
10103 xmlChar * name; /* the name of the userdata */
10104 int n_name;
10105 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10106 int n_f;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010107
Daniel Veillard42595322004-11-08 10:52:06 +000010108 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10109 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10110 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10111 mem_base = xmlMemBlocks();
10112 table = gen_xmlHashTablePtr(n_table, 0);
10113 name = gen_const_xmlChar_ptr(n_name, 1);
10114 f = gen_xmlHashDeallocator(n_f, 2);
10115
10116 ret_val = xmlHashRemoveEntry(table, name, f);
10117 desret_int(ret_val);
10118 call_tests++;
10119 des_xmlHashTablePtr(n_table, table, 0);
10120 des_const_xmlChar_ptr(n_name, name, 1);
10121 des_xmlHashDeallocator(n_f, f, 2);
10122 xmlResetLastError();
10123 if (mem_base != xmlMemBlocks()) {
10124 printf("Leak of %d blocks found in xmlHashRemoveEntry",
10125 xmlMemBlocks() - mem_base);
10126 test_ret++;
10127 printf(" %d", n_table);
10128 printf(" %d", n_name);
10129 printf(" %d", n_f);
10130 printf("\n");
10131 }
10132 }
10133 }
10134 }
10135
10136 function_tests++;
10137 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010138}
10139
10140
10141static int
10142test_xmlHashRemoveEntry2(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010143 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010144
Daniel Veillard42595322004-11-08 10:52:06 +000010145 int mem_base;
10146 int ret_val;
10147 xmlHashTablePtr table; /* the hash table */
10148 int n_table;
10149 xmlChar * name; /* the name of the userdata */
10150 int n_name;
10151 xmlChar * name2; /* a second name of the userdata */
10152 int n_name2;
10153 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10154 int n_f;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010155
Daniel Veillard42595322004-11-08 10:52:06 +000010156 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10157 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10158 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10159 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10160 mem_base = xmlMemBlocks();
10161 table = gen_xmlHashTablePtr(n_table, 0);
10162 name = gen_const_xmlChar_ptr(n_name, 1);
10163 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10164 f = gen_xmlHashDeallocator(n_f, 3);
10165
10166 ret_val = xmlHashRemoveEntry2(table, name, name2, f);
10167 desret_int(ret_val);
10168 call_tests++;
10169 des_xmlHashTablePtr(n_table, table, 0);
10170 des_const_xmlChar_ptr(n_name, name, 1);
10171 des_const_xmlChar_ptr(n_name2, name2, 2);
10172 des_xmlHashDeallocator(n_f, f, 3);
10173 xmlResetLastError();
10174 if (mem_base != xmlMemBlocks()) {
10175 printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10176 xmlMemBlocks() - mem_base);
10177 test_ret++;
10178 printf(" %d", n_table);
10179 printf(" %d", n_name);
10180 printf(" %d", n_name2);
10181 printf(" %d", n_f);
10182 printf("\n");
10183 }
10184 }
10185 }
10186 }
10187 }
10188
10189 function_tests++;
10190 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010191}
10192
10193
10194static int
10195test_xmlHashRemoveEntry3(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010196 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010197
Daniel Veillard42595322004-11-08 10:52:06 +000010198 int mem_base;
10199 int ret_val;
10200 xmlHashTablePtr table; /* the hash table */
10201 int n_table;
10202 xmlChar * name; /* the name of the userdata */
10203 int n_name;
10204 xmlChar * name2; /* a second name of the userdata */
10205 int n_name2;
10206 xmlChar * name3; /* a third name of the userdata */
10207 int n_name3;
10208 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10209 int n_f;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010210
Daniel Veillard42595322004-11-08 10:52:06 +000010211 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10212 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10213 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10214 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10215 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10216 mem_base = xmlMemBlocks();
10217 table = gen_xmlHashTablePtr(n_table, 0);
10218 name = gen_const_xmlChar_ptr(n_name, 1);
10219 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10220 name3 = gen_const_xmlChar_ptr(n_name3, 3);
10221 f = gen_xmlHashDeallocator(n_f, 4);
10222
10223 ret_val = xmlHashRemoveEntry3(table, name, name2, name3, f);
10224 desret_int(ret_val);
10225 call_tests++;
10226 des_xmlHashTablePtr(n_table, table, 0);
10227 des_const_xmlChar_ptr(n_name, name, 1);
10228 des_const_xmlChar_ptr(n_name2, name2, 2);
10229 des_const_xmlChar_ptr(n_name3, name3, 3);
10230 des_xmlHashDeallocator(n_f, f, 4);
10231 xmlResetLastError();
10232 if (mem_base != xmlMemBlocks()) {
10233 printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10234 xmlMemBlocks() - mem_base);
10235 test_ret++;
10236 printf(" %d", n_table);
10237 printf(" %d", n_name);
10238 printf(" %d", n_name2);
10239 printf(" %d", n_name3);
10240 printf(" %d", n_f);
10241 printf("\n");
10242 }
10243 }
10244 }
10245 }
10246 }
10247 }
10248
10249 function_tests++;
10250 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010251}
10252
10253
10254static int
10255test_xmlHashScan(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010256 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010257
10258
10259 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000010260 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010261}
10262
10263
10264static int
10265test_xmlHashScan3(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010266 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010267
10268
10269 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000010270 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010271}
10272
10273
10274static int
10275test_xmlHashScanFull(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010276 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010277
10278
10279 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000010280 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010281}
10282
10283
10284static int
10285test_xmlHashScanFull3(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010286 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010287
10288
10289 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000010290 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010291}
10292
10293
10294static int
10295test_xmlHashSize(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010296 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010297
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010298 int mem_base;
10299 int ret_val;
10300 xmlHashTablePtr table; /* the hash table */
10301 int n_table;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010302
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010303 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10304 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000010305 table = gen_xmlHashTablePtr(n_table, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010306
10307 ret_val = xmlHashSize(table);
10308 desret_int(ret_val);
10309 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000010310 des_xmlHashTablePtr(n_table, table, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010311 xmlResetLastError();
10312 if (mem_base != xmlMemBlocks()) {
10313 printf("Leak of %d blocks found in xmlHashSize",
10314 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000010315 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010316 printf(" %d", n_table);
10317 printf("\n");
10318 }
10319 }
10320
Daniel Veillard3d97e662004-11-04 10:49:00 +000010321 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000010322 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010323}
10324
10325
10326static int
10327test_xmlHashUpdateEntry(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010328 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010329
Daniel Veillard42595322004-11-08 10:52:06 +000010330 int mem_base;
10331 int ret_val;
10332 xmlHashTablePtr table; /* the hash table */
10333 int n_table;
10334 xmlChar * name; /* the name of the userdata */
10335 int n_name;
10336 void * userdata; /* a pointer to the userdata */
10337 int n_userdata;
10338 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10339 int n_f;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010340
Daniel Veillard42595322004-11-08 10:52:06 +000010341 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10342 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10343 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10344 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10345 mem_base = xmlMemBlocks();
10346 table = gen_xmlHashTablePtr(n_table, 0);
10347 name = gen_const_xmlChar_ptr(n_name, 1);
10348 userdata = gen_userdata(n_userdata, 2);
10349 f = gen_xmlHashDeallocator(n_f, 3);
10350
10351 ret_val = xmlHashUpdateEntry(table, name, userdata, f);
10352 desret_int(ret_val);
10353 call_tests++;
10354 des_xmlHashTablePtr(n_table, table, 0);
10355 des_const_xmlChar_ptr(n_name, name, 1);
10356 des_userdata(n_userdata, userdata, 2);
10357 des_xmlHashDeallocator(n_f, f, 3);
10358 xmlResetLastError();
10359 if (mem_base != xmlMemBlocks()) {
10360 printf("Leak of %d blocks found in xmlHashUpdateEntry",
10361 xmlMemBlocks() - mem_base);
10362 test_ret++;
10363 printf(" %d", n_table);
10364 printf(" %d", n_name);
10365 printf(" %d", n_userdata);
10366 printf(" %d", n_f);
10367 printf("\n");
10368 }
10369 }
10370 }
10371 }
10372 }
10373
10374 function_tests++;
10375 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010376}
10377
10378
10379static int
10380test_xmlHashUpdateEntry2(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010381 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010382
Daniel Veillard42595322004-11-08 10:52:06 +000010383 int mem_base;
10384 int ret_val;
10385 xmlHashTablePtr table; /* the hash table */
10386 int n_table;
10387 xmlChar * name; /* the name of the userdata */
10388 int n_name;
10389 xmlChar * name2; /* a second name of the userdata */
10390 int n_name2;
10391 void * userdata; /* a pointer to the userdata */
10392 int n_userdata;
10393 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10394 int n_f;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010395
Daniel Veillard42595322004-11-08 10:52:06 +000010396 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10397 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10398 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10399 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10400 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10401 mem_base = xmlMemBlocks();
10402 table = gen_xmlHashTablePtr(n_table, 0);
10403 name = gen_const_xmlChar_ptr(n_name, 1);
10404 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10405 userdata = gen_userdata(n_userdata, 3);
10406 f = gen_xmlHashDeallocator(n_f, 4);
10407
10408 ret_val = xmlHashUpdateEntry2(table, name, name2, userdata, f);
10409 desret_int(ret_val);
10410 call_tests++;
10411 des_xmlHashTablePtr(n_table, table, 0);
10412 des_const_xmlChar_ptr(n_name, name, 1);
10413 des_const_xmlChar_ptr(n_name2, name2, 2);
10414 des_userdata(n_userdata, userdata, 3);
10415 des_xmlHashDeallocator(n_f, f, 4);
10416 xmlResetLastError();
10417 if (mem_base != xmlMemBlocks()) {
10418 printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10419 xmlMemBlocks() - mem_base);
10420 test_ret++;
10421 printf(" %d", n_table);
10422 printf(" %d", n_name);
10423 printf(" %d", n_name2);
10424 printf(" %d", n_userdata);
10425 printf(" %d", n_f);
10426 printf("\n");
10427 }
10428 }
10429 }
10430 }
10431 }
10432 }
10433
10434 function_tests++;
10435 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010436}
10437
10438
10439static int
10440test_xmlHashUpdateEntry3(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010441 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010442
Daniel Veillard42595322004-11-08 10:52:06 +000010443 int mem_base;
10444 int ret_val;
10445 xmlHashTablePtr table; /* the hash table */
10446 int n_table;
10447 xmlChar * name; /* the name of the userdata */
10448 int n_name;
10449 xmlChar * name2; /* a second name of the userdata */
10450 int n_name2;
10451 xmlChar * name3; /* a third name of the userdata */
10452 int n_name3;
10453 void * userdata; /* a pointer to the userdata */
10454 int n_userdata;
10455 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10456 int n_f;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010457
Daniel Veillard42595322004-11-08 10:52:06 +000010458 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10459 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10460 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10461 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10462 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10463 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10464 mem_base = xmlMemBlocks();
10465 table = gen_xmlHashTablePtr(n_table, 0);
10466 name = gen_const_xmlChar_ptr(n_name, 1);
10467 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10468 name3 = gen_const_xmlChar_ptr(n_name3, 3);
10469 userdata = gen_userdata(n_userdata, 4);
10470 f = gen_xmlHashDeallocator(n_f, 5);
10471
10472 ret_val = xmlHashUpdateEntry3(table, name, name2, name3, userdata, f);
10473 desret_int(ret_val);
10474 call_tests++;
10475 des_xmlHashTablePtr(n_table, table, 0);
10476 des_const_xmlChar_ptr(n_name, name, 1);
10477 des_const_xmlChar_ptr(n_name2, name2, 2);
10478 des_const_xmlChar_ptr(n_name3, name3, 3);
10479 des_userdata(n_userdata, userdata, 4);
10480 des_xmlHashDeallocator(n_f, f, 5);
10481 xmlResetLastError();
10482 if (mem_base != xmlMemBlocks()) {
10483 printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10484 xmlMemBlocks() - mem_base);
10485 test_ret++;
10486 printf(" %d", n_table);
10487 printf(" %d", n_name);
10488 printf(" %d", n_name2);
10489 printf(" %d", n_name3);
10490 printf(" %d", n_userdata);
10491 printf(" %d", n_f);
10492 printf("\n");
10493 }
10494 }
10495 }
10496 }
10497 }
10498 }
10499 }
10500
10501 function_tests++;
10502 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010503}
10504
10505static int
10506test_hash(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010507 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010508
Daniel Veillard42595322004-11-08 10:52:06 +000010509 printf("Testing hash : 16 of 23 functions ...\n");
10510 test_ret += test_xmlHashAddEntry();
10511 test_ret += test_xmlHashAddEntry2();
10512 test_ret += test_xmlHashAddEntry3();
10513 test_ret += test_xmlHashCopy();
10514 test_ret += test_xmlHashCreate();
10515 test_ret += test_xmlHashLookup();
10516 test_ret += test_xmlHashLookup2();
10517 test_ret += test_xmlHashLookup3();
10518 test_ret += test_xmlHashQLookup();
10519 test_ret += test_xmlHashQLookup2();
10520 test_ret += test_xmlHashQLookup3();
10521 test_ret += test_xmlHashRemoveEntry();
10522 test_ret += test_xmlHashRemoveEntry2();
10523 test_ret += test_xmlHashRemoveEntry3();
10524 test_ret += test_xmlHashScan();
10525 test_ret += test_xmlHashScan3();
10526 test_ret += test_xmlHashScanFull();
10527 test_ret += test_xmlHashScanFull3();
10528 test_ret += test_xmlHashSize();
10529 test_ret += test_xmlHashUpdateEntry();
10530 test_ret += test_xmlHashUpdateEntry2();
10531 test_ret += test_xmlHashUpdateEntry3();
Daniel Veillardd93f6252004-11-02 15:53:51 +000010532
Daniel Veillard42595322004-11-08 10:52:06 +000010533 if (test_ret != 0)
10534 printf("Module hash: %d errors\n", test_ret);
10535 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010536}
10537
Daniel Veillardce682bc2004-11-05 17:22:25 +000010538#define gen_nb_xmlLinkPtr 1
10539static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10540 return(NULL);
10541}
10542static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10543}
10544
Daniel Veillardd93f6252004-11-02 15:53:51 +000010545static int
10546test_xmlLinkGetData(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010547 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010548
Daniel Veillardce682bc2004-11-05 17:22:25 +000010549 int mem_base;
10550 void * ret_val;
10551 xmlLinkPtr lk; /* a link */
10552 int n_lk;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010553
Daniel Veillardce682bc2004-11-05 17:22:25 +000010554 for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10555 mem_base = xmlMemBlocks();
10556 lk = gen_xmlLinkPtr(n_lk, 0);
10557
10558 ret_val = xmlLinkGetData(lk);
10559 desret_void_ptr(ret_val);
10560 call_tests++;
10561 des_xmlLinkPtr(n_lk, lk, 0);
10562 xmlResetLastError();
10563 if (mem_base != xmlMemBlocks()) {
10564 printf("Leak of %d blocks found in xmlLinkGetData",
10565 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000010566 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000010567 printf(" %d", n_lk);
10568 printf("\n");
10569 }
10570 }
10571
10572 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000010573 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010574}
10575
10576
10577static int
10578test_xmlListAppend(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010579 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010580
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010581 int mem_base;
10582 int ret_val;
10583 xmlListPtr l; /* a list */
10584 int n_l;
10585 void * data; /* the data */
10586 int n_data;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010587
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010588 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10589 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10590 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000010591 l = gen_xmlListPtr(n_l, 0);
10592 data = gen_userdata(n_data, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010593
10594 ret_val = xmlListAppend(l, data);
10595 desret_int(ret_val);
10596 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000010597 des_xmlListPtr(n_l, l, 0);
10598 des_userdata(n_data, data, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010599 xmlResetLastError();
10600 if (mem_base != xmlMemBlocks()) {
10601 printf("Leak of %d blocks found in xmlListAppend",
10602 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000010603 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010604 printf(" %d", n_l);
10605 printf(" %d", n_data);
10606 printf("\n");
10607 }
10608 }
10609 }
10610
Daniel Veillard3d97e662004-11-04 10:49:00 +000010611 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000010612 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010613}
10614
10615
10616static int
10617test_xmlListClear(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010618 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010619
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010620 int mem_base;
10621 xmlListPtr l; /* a list */
10622 int n_l;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010623
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010624 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10625 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000010626 l = gen_xmlListPtr(n_l, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010627
10628 xmlListClear(l);
10629 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000010630 des_xmlListPtr(n_l, l, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010631 xmlResetLastError();
10632 if (mem_base != xmlMemBlocks()) {
10633 printf("Leak of %d blocks found in xmlListClear",
10634 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000010635 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010636 printf(" %d", n_l);
10637 printf("\n");
10638 }
10639 }
10640
Daniel Veillard3d97e662004-11-04 10:49:00 +000010641 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000010642 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010643}
10644
10645
Daniel Veillardce682bc2004-11-05 17:22:25 +000010646#define gen_nb_const_xmlListPtr 1
10647static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10648 return(NULL);
10649}
10650static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10651}
10652
Daniel Veillardd93f6252004-11-02 15:53:51 +000010653static int
10654test_xmlListCopy(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010655 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010656
Daniel Veillardce682bc2004-11-05 17:22:25 +000010657 int mem_base;
10658 int ret_val;
10659 xmlListPtr cur; /* the new list */
10660 int n_cur;
10661 xmlListPtr old; /* the old list */
10662 int n_old;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010663
Daniel Veillardce682bc2004-11-05 17:22:25 +000010664 for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10665 for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10666 mem_base = xmlMemBlocks();
10667 cur = gen_xmlListPtr(n_cur, 0);
10668 old = gen_const_xmlListPtr(n_old, 1);
10669
10670 ret_val = xmlListCopy(cur, old);
10671 desret_int(ret_val);
10672 call_tests++;
10673 des_xmlListPtr(n_cur, cur, 0);
10674 des_const_xmlListPtr(n_old, old, 1);
10675 xmlResetLastError();
10676 if (mem_base != xmlMemBlocks()) {
10677 printf("Leak of %d blocks found in xmlListCopy",
10678 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000010679 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000010680 printf(" %d", n_cur);
10681 printf(" %d", n_old);
10682 printf("\n");
10683 }
10684 }
10685 }
10686
10687 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000010688 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010689}
10690
10691
10692static int
10693test_xmlListCreate(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010694 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010695
10696
10697 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000010698 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010699}
10700
10701
10702static int
Daniel Veillardd93f6252004-11-02 15:53:51 +000010703test_xmlListDup(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010704 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010705
10706
10707 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000010708 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010709}
10710
10711
10712static int
10713test_xmlListEmpty(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010714 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010715
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010716 int mem_base;
10717 int ret_val;
10718 xmlListPtr l; /* a list */
10719 int n_l;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010720
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010721 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10722 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000010723 l = gen_xmlListPtr(n_l, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010724
10725 ret_val = xmlListEmpty(l);
10726 desret_int(ret_val);
10727 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000010728 des_xmlListPtr(n_l, l, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010729 xmlResetLastError();
10730 if (mem_base != xmlMemBlocks()) {
10731 printf("Leak of %d blocks found in xmlListEmpty",
10732 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000010733 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010734 printf(" %d", n_l);
10735 printf("\n");
10736 }
10737 }
10738
Daniel Veillard3d97e662004-11-04 10:49:00 +000010739 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000010740 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010741}
10742
10743
10744static int
10745test_xmlListEnd(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010746 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010747
10748
10749 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000010750 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010751}
10752
10753
10754static int
10755test_xmlListFront(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010756 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010757
10758
10759 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000010760 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010761}
10762
10763
10764static int
10765test_xmlListInsert(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010766 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010767
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010768 int mem_base;
10769 int ret_val;
10770 xmlListPtr l; /* a list */
10771 int n_l;
10772 void * data; /* the data */
10773 int n_data;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010774
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010775 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10776 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10777 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000010778 l = gen_xmlListPtr(n_l, 0);
10779 data = gen_userdata(n_data, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010780
10781 ret_val = xmlListInsert(l, data);
10782 desret_int(ret_val);
10783 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000010784 des_xmlListPtr(n_l, l, 0);
10785 des_userdata(n_data, data, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010786 xmlResetLastError();
10787 if (mem_base != xmlMemBlocks()) {
10788 printf("Leak of %d blocks found in xmlListInsert",
10789 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000010790 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010791 printf(" %d", n_l);
10792 printf(" %d", n_data);
10793 printf("\n");
10794 }
10795 }
10796 }
10797
Daniel Veillard3d97e662004-11-04 10:49:00 +000010798 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000010799 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010800}
10801
10802
10803static int
10804test_xmlListMerge(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010805 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010806
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010807 int mem_base;
10808 xmlListPtr l1; /* the original list */
10809 int n_l1;
10810 xmlListPtr l2; /* the new list */
10811 int n_l2;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010812
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010813 for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
10814 for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
10815 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000010816 l1 = gen_xmlListPtr(n_l1, 0);
10817 l2 = gen_xmlListPtr(n_l2, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010818
10819 xmlListMerge(l1, l2);
10820 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000010821 des_xmlListPtr(n_l1, l1, 0);
10822 des_xmlListPtr(n_l2, l2, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010823 xmlResetLastError();
10824 if (mem_base != xmlMemBlocks()) {
10825 printf("Leak of %d blocks found in xmlListMerge",
10826 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000010827 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010828 printf(" %d", n_l1);
10829 printf(" %d", n_l2);
10830 printf("\n");
10831 }
10832 }
10833 }
10834
Daniel Veillard3d97e662004-11-04 10:49:00 +000010835 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000010836 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010837}
10838
10839
10840static int
10841test_xmlListPopBack(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010842 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010843
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010844 int mem_base;
10845 xmlListPtr l; /* a list */
10846 int n_l;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010847
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010848 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10849 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000010850 l = gen_xmlListPtr(n_l, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010851
10852 xmlListPopBack(l);
10853 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000010854 des_xmlListPtr(n_l, l, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010855 xmlResetLastError();
10856 if (mem_base != xmlMemBlocks()) {
10857 printf("Leak of %d blocks found in xmlListPopBack",
10858 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000010859 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010860 printf(" %d", n_l);
10861 printf("\n");
10862 }
10863 }
10864
Daniel Veillard3d97e662004-11-04 10:49:00 +000010865 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000010866 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010867}
10868
10869
10870static int
10871test_xmlListPopFront(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010872 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010873
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010874 int mem_base;
10875 xmlListPtr l; /* a list */
10876 int n_l;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010877
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010878 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10879 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000010880 l = gen_xmlListPtr(n_l, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010881
10882 xmlListPopFront(l);
10883 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000010884 des_xmlListPtr(n_l, l, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010885 xmlResetLastError();
10886 if (mem_base != xmlMemBlocks()) {
10887 printf("Leak of %d blocks found in xmlListPopFront",
10888 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000010889 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010890 printf(" %d", n_l);
10891 printf("\n");
10892 }
10893 }
10894
Daniel Veillard3d97e662004-11-04 10:49:00 +000010895 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000010896 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010897}
10898
10899
10900static int
10901test_xmlListPushBack(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010902 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010903
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010904 int mem_base;
10905 int ret_val;
10906 xmlListPtr l; /* a list */
10907 int n_l;
10908 void * data; /* new data */
10909 int n_data;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010910
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010911 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10912 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10913 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000010914 l = gen_xmlListPtr(n_l, 0);
10915 data = gen_userdata(n_data, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010916
10917 ret_val = xmlListPushBack(l, data);
10918 desret_int(ret_val);
10919 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000010920 des_xmlListPtr(n_l, l, 0);
10921 des_userdata(n_data, data, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010922 xmlResetLastError();
10923 if (mem_base != xmlMemBlocks()) {
10924 printf("Leak of %d blocks found in xmlListPushBack",
10925 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000010926 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010927 printf(" %d", n_l);
10928 printf(" %d", n_data);
10929 printf("\n");
10930 }
10931 }
10932 }
10933
Daniel Veillard3d97e662004-11-04 10:49:00 +000010934 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000010935 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010936}
10937
10938
10939static int
10940test_xmlListPushFront(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010941 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010942
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010943 int mem_base;
10944 int ret_val;
10945 xmlListPtr l; /* a list */
10946 int n_l;
10947 void * data; /* new data */
10948 int n_data;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010949
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010950 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10951 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10952 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000010953 l = gen_xmlListPtr(n_l, 0);
10954 data = gen_userdata(n_data, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010955
10956 ret_val = xmlListPushFront(l, data);
10957 desret_int(ret_val);
10958 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000010959 des_xmlListPtr(n_l, l, 0);
10960 des_userdata(n_data, data, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010961 xmlResetLastError();
10962 if (mem_base != xmlMemBlocks()) {
10963 printf("Leak of %d blocks found in xmlListPushFront",
10964 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000010965 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010966 printf(" %d", n_l);
10967 printf(" %d", n_data);
10968 printf("\n");
10969 }
10970 }
10971 }
10972
Daniel Veillard3d97e662004-11-04 10:49:00 +000010973 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000010974 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000010975}
10976
10977
10978static int
10979test_xmlListRemoveAll(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000010980 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010981
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010982 int mem_base;
10983 int ret_val;
10984 xmlListPtr l; /* a list */
10985 int n_l;
10986 void * data; /* list data */
10987 int n_data;
Daniel Veillardd93f6252004-11-02 15:53:51 +000010988
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010989 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10990 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10991 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000010992 l = gen_xmlListPtr(n_l, 0);
10993 data = gen_userdata(n_data, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000010994
10995 ret_val = xmlListRemoveAll(l, data);
10996 desret_int(ret_val);
10997 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000010998 des_xmlListPtr(n_l, l, 0);
10999 des_userdata(n_data, data, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011000 xmlResetLastError();
11001 if (mem_base != xmlMemBlocks()) {
11002 printf("Leak of %d blocks found in xmlListRemoveAll",
11003 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011004 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011005 printf(" %d", n_l);
11006 printf(" %d", n_data);
11007 printf("\n");
11008 }
11009 }
11010 }
11011
Daniel Veillard3d97e662004-11-04 10:49:00 +000011012 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011013 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011014}
11015
11016
11017static int
11018test_xmlListRemoveFirst(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011019 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011020
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011021 int mem_base;
11022 int ret_val;
11023 xmlListPtr l; /* a list */
11024 int n_l;
11025 void * data; /* list data */
11026 int n_data;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011027
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011028 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11029 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11030 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000011031 l = gen_xmlListPtr(n_l, 0);
11032 data = gen_userdata(n_data, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011033
11034 ret_val = xmlListRemoveFirst(l, data);
11035 desret_int(ret_val);
11036 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000011037 des_xmlListPtr(n_l, l, 0);
11038 des_userdata(n_data, data, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011039 xmlResetLastError();
11040 if (mem_base != xmlMemBlocks()) {
11041 printf("Leak of %d blocks found in xmlListRemoveFirst",
11042 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011043 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011044 printf(" %d", n_l);
11045 printf(" %d", n_data);
11046 printf("\n");
11047 }
11048 }
11049 }
11050
Daniel Veillard3d97e662004-11-04 10:49:00 +000011051 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011052 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011053}
11054
11055
11056static int
11057test_xmlListRemoveLast(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011058 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011059
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011060 int mem_base;
11061 int ret_val;
11062 xmlListPtr l; /* a list */
11063 int n_l;
11064 void * data; /* list data */
11065 int n_data;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011066
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011067 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11068 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11069 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000011070 l = gen_xmlListPtr(n_l, 0);
11071 data = gen_userdata(n_data, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011072
11073 ret_val = xmlListRemoveLast(l, data);
11074 desret_int(ret_val);
11075 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000011076 des_xmlListPtr(n_l, l, 0);
11077 des_userdata(n_data, data, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011078 xmlResetLastError();
11079 if (mem_base != xmlMemBlocks()) {
11080 printf("Leak of %d blocks found in xmlListRemoveLast",
11081 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011082 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011083 printf(" %d", n_l);
11084 printf(" %d", n_data);
11085 printf("\n");
11086 }
11087 }
11088 }
11089
Daniel Veillard3d97e662004-11-04 10:49:00 +000011090 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011091 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011092}
11093
11094
11095static int
11096test_xmlListReverse(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011097 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011098
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011099 int mem_base;
11100 xmlListPtr l; /* a list */
11101 int n_l;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011102
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011103 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11104 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000011105 l = gen_xmlListPtr(n_l, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011106
11107 xmlListReverse(l);
11108 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000011109 des_xmlListPtr(n_l, l, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011110 xmlResetLastError();
11111 if (mem_base != xmlMemBlocks()) {
11112 printf("Leak of %d blocks found in xmlListReverse",
11113 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011114 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011115 printf(" %d", n_l);
11116 printf("\n");
11117 }
11118 }
11119
Daniel Veillard3d97e662004-11-04 10:49:00 +000011120 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011121 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011122}
11123
11124
11125static int
11126test_xmlListReverseSearch(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011127 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011128
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011129 int mem_base;
11130 void * ret_val;
11131 xmlListPtr l; /* a list */
11132 int n_l;
11133 void * data; /* a search value */
11134 int n_data;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011135
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011136 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11137 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11138 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000011139 l = gen_xmlListPtr(n_l, 0);
11140 data = gen_userdata(n_data, 1);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011141
11142 ret_val = xmlListReverseSearch(l, data);
11143 desret_void_ptr(ret_val);
11144 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000011145 des_xmlListPtr(n_l, l, 0);
11146 des_userdata(n_data, data, 1);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011147 xmlResetLastError();
11148 if (mem_base != xmlMemBlocks()) {
11149 printf("Leak of %d blocks found in xmlListReverseSearch",
11150 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011151 test_ret++;
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011152 printf(" %d", n_l);
11153 printf(" %d", n_data);
11154 printf("\n");
11155 }
11156 }
11157 }
11158
Daniel Veillard3d97e662004-11-04 10:49:00 +000011159 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011160 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011161}
11162
11163
11164static int
11165test_xmlListReverseWalk(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011166 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011167
11168
11169 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000011170 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011171}
11172
11173
11174static int
11175test_xmlListSearch(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011176 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011177
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011178 int mem_base;
11179 void * ret_val;
11180 xmlListPtr l; /* a list */
11181 int n_l;
11182 void * data; /* a search value */
11183 int n_data;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011184
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011185 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11186 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11187 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000011188 l = gen_xmlListPtr(n_l, 0);
11189 data = gen_userdata(n_data, 1);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011190
11191 ret_val = xmlListSearch(l, data);
11192 desret_void_ptr(ret_val);
11193 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000011194 des_xmlListPtr(n_l, l, 0);
11195 des_userdata(n_data, data, 1);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011196 xmlResetLastError();
11197 if (mem_base != xmlMemBlocks()) {
11198 printf("Leak of %d blocks found in xmlListSearch",
11199 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011200 test_ret++;
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011201 printf(" %d", n_l);
11202 printf(" %d", n_data);
11203 printf("\n");
11204 }
11205 }
11206 }
11207
Daniel Veillard3d97e662004-11-04 10:49:00 +000011208 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011209 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011210}
11211
11212
11213static int
11214test_xmlListSize(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011215 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011216
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011217 int mem_base;
11218 int ret_val;
11219 xmlListPtr l; /* a list */
11220 int n_l;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011221
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011222 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11223 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000011224 l = gen_xmlListPtr(n_l, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011225
11226 ret_val = xmlListSize(l);
11227 desret_int(ret_val);
11228 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000011229 des_xmlListPtr(n_l, l, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011230 xmlResetLastError();
11231 if (mem_base != xmlMemBlocks()) {
11232 printf("Leak of %d blocks found in xmlListSize",
11233 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011234 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011235 printf(" %d", n_l);
11236 printf("\n");
11237 }
11238 }
11239
Daniel Veillard3d97e662004-11-04 10:49:00 +000011240 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011241 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011242}
11243
11244
11245static int
11246test_xmlListSort(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011247 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011248
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011249 int mem_base;
11250 xmlListPtr l; /* a list */
11251 int n_l;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011252
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011253 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11254 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000011255 l = gen_xmlListPtr(n_l, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011256
11257 xmlListSort(l);
11258 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000011259 des_xmlListPtr(n_l, l, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011260 xmlResetLastError();
11261 if (mem_base != xmlMemBlocks()) {
11262 printf("Leak of %d blocks found in xmlListSort",
11263 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011264 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000011265 printf(" %d", n_l);
11266 printf("\n");
11267 }
11268 }
11269
Daniel Veillard3d97e662004-11-04 10:49:00 +000011270 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011271 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011272}
11273
11274
11275static int
11276test_xmlListWalk(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011277 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011278
11279
11280 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000011281 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011282}
11283
11284static int
11285test_list(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011286 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011287
Daniel Veillardce682bc2004-11-05 17:22:25 +000011288 printf("Testing list : 19 of 26 functions ...\n");
Daniel Veillard42595322004-11-08 10:52:06 +000011289 test_ret += test_xmlLinkGetData();
11290 test_ret += test_xmlListAppend();
11291 test_ret += test_xmlListClear();
11292 test_ret += test_xmlListCopy();
11293 test_ret += test_xmlListCreate();
11294 test_ret += test_xmlListDup();
11295 test_ret += test_xmlListEmpty();
11296 test_ret += test_xmlListEnd();
11297 test_ret += test_xmlListFront();
11298 test_ret += test_xmlListInsert();
11299 test_ret += test_xmlListMerge();
11300 test_ret += test_xmlListPopBack();
11301 test_ret += test_xmlListPopFront();
11302 test_ret += test_xmlListPushBack();
11303 test_ret += test_xmlListPushFront();
11304 test_ret += test_xmlListRemoveAll();
11305 test_ret += test_xmlListRemoveFirst();
11306 test_ret += test_xmlListRemoveLast();
11307 test_ret += test_xmlListReverse();
11308 test_ret += test_xmlListReverseSearch();
11309 test_ret += test_xmlListReverseWalk();
11310 test_ret += test_xmlListSearch();
11311 test_ret += test_xmlListSize();
11312 test_ret += test_xmlListSort();
11313 test_ret += test_xmlListWalk();
Daniel Veillardd93f6252004-11-02 15:53:51 +000011314
Daniel Veillard42595322004-11-08 10:52:06 +000011315 if (test_ret != 0)
11316 printf("Module list: %d errors\n", test_ret);
11317 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011318}
11319
11320static int
11321test_xmlNanoFTPCheckResponse(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011322 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011323
Daniel Veillard27f20102004-11-05 11:50:11 +000011324#ifdef LIBXML_FTP_ENABLED
11325 int mem_base;
11326 int ret_val;
11327 void * ctx; /* an FTP context */
11328 int n_ctx;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011329
Daniel Veillard27f20102004-11-05 11:50:11 +000011330 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11331 mem_base = xmlMemBlocks();
11332 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11333
11334 ret_val = xmlNanoFTPCheckResponse(ctx);
11335 desret_int(ret_val);
11336 call_tests++;
11337 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11338 xmlResetLastError();
11339 if (mem_base != xmlMemBlocks()) {
11340 printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11341 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011342 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000011343 printf(" %d", n_ctx);
11344 printf("\n");
11345 }
11346 }
11347#endif
11348
11349 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011350 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011351}
11352
11353
11354static int
11355test_xmlNanoFTPCleanup(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011356 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011357
11358#ifdef LIBXML_FTP_ENABLED
11359 int mem_base;
11360
11361 mem_base = xmlMemBlocks();
11362
11363 xmlNanoFTPCleanup();
11364 call_tests++;
11365 xmlResetLastError();
11366 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000011367 printf("Leak of %d blocks found in xmlNanoFTPCleanup",
Daniel Veillardd93f6252004-11-02 15:53:51 +000011368 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011369 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000011370 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000011371 }
11372#endif
11373
Daniel Veillard3d97e662004-11-04 10:49:00 +000011374 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011375 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011376}
11377
11378
11379static int
Daniel Veillardd93f6252004-11-02 15:53:51 +000011380test_xmlNanoFTPCloseConnection(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011381 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011382
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011383#ifdef LIBXML_FTP_ENABLED
11384 int mem_base;
Daniel Veillard27f20102004-11-05 11:50:11 +000011385 int ret_val;
11386 void * ctx; /* an FTP context */
11387 int n_ctx;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011388
Daniel Veillard27f20102004-11-05 11:50:11 +000011389 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011390 mem_base = xmlMemBlocks();
Daniel Veillard27f20102004-11-05 11:50:11 +000011391 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011392
Daniel Veillard27f20102004-11-05 11:50:11 +000011393 ret_val = xmlNanoFTPCloseConnection(ctx);
11394 desret_int(ret_val);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011395 call_tests++;
Daniel Veillard27f20102004-11-05 11:50:11 +000011396 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011397 xmlResetLastError();
11398 if (mem_base != xmlMemBlocks()) {
Daniel Veillard27f20102004-11-05 11:50:11 +000011399 printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011400 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011401 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000011402 printf(" %d", n_ctx);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011403 printf("\n");
11404 }
11405 }
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011406#endif
11407
Daniel Veillard3d97e662004-11-04 10:49:00 +000011408 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011409 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011410}
11411
11412
11413static int
11414test_xmlNanoFTPCwd(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011415 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011416
Daniel Veillard27f20102004-11-05 11:50:11 +000011417#ifdef LIBXML_FTP_ENABLED
11418 int mem_base;
11419 int ret_val;
11420 void * ctx; /* an FTP context */
11421 int n_ctx;
Daniel Veillardce682bc2004-11-05 17:22:25 +000011422 char * directory; /* a directory on the server */
Daniel Veillard27f20102004-11-05 11:50:11 +000011423 int n_directory;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011424
Daniel Veillard27f20102004-11-05 11:50:11 +000011425 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11426 for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11427 mem_base = xmlMemBlocks();
11428 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11429 directory = gen_const_char_ptr(n_directory, 1);
11430
11431 ret_val = xmlNanoFTPCwd(ctx, directory);
11432 desret_int(ret_val);
11433 call_tests++;
11434 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11435 des_const_char_ptr(n_directory, directory, 1);
11436 xmlResetLastError();
11437 if (mem_base != xmlMemBlocks()) {
11438 printf("Leak of %d blocks found in xmlNanoFTPCwd",
11439 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011440 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000011441 printf(" %d", n_ctx);
11442 printf(" %d", n_directory);
11443 printf("\n");
11444 }
11445 }
11446 }
11447#endif
11448
11449 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011450 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011451}
11452
11453
11454static int
11455test_xmlNanoFTPDele(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011456 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011457
Daniel Veillard27f20102004-11-05 11:50:11 +000011458#ifdef LIBXML_FTP_ENABLED
11459 int mem_base;
11460 int ret_val;
11461 void * ctx; /* an FTP context */
11462 int n_ctx;
11463 const char * file; /* a file or directory on the server */
11464 int n_file;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011465
Daniel Veillard27f20102004-11-05 11:50:11 +000011466 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11467 for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11468 mem_base = xmlMemBlocks();
11469 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11470 file = gen_filepath(n_file, 1);
11471
11472 ret_val = xmlNanoFTPDele(ctx, file);
11473 desret_int(ret_val);
11474 call_tests++;
11475 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11476 des_filepath(n_file, file, 1);
11477 xmlResetLastError();
11478 if (mem_base != xmlMemBlocks()) {
11479 printf("Leak of %d blocks found in xmlNanoFTPDele",
11480 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011481 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000011482 printf(" %d", n_ctx);
11483 printf(" %d", n_file);
11484 printf("\n");
11485 }
11486 }
11487 }
11488#endif
11489
11490 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011491 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011492}
11493
11494
11495static int
11496test_xmlNanoFTPGet(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011497 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011498
11499
11500 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000011501 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011502}
11503
11504
11505static int
11506test_xmlNanoFTPGetConnection(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011507 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011508
Daniel Veillard27f20102004-11-05 11:50:11 +000011509#ifdef LIBXML_FTP_ENABLED
11510 int mem_base;
11511 int ret_val;
11512 void * ctx; /* an FTP context */
11513 int n_ctx;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011514
Daniel Veillard27f20102004-11-05 11:50:11 +000011515 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11516 mem_base = xmlMemBlocks();
11517 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11518
11519 ret_val = xmlNanoFTPGetConnection(ctx);
11520 desret_int(ret_val);
11521 call_tests++;
11522 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11523 xmlResetLastError();
11524 if (mem_base != xmlMemBlocks()) {
11525 printf("Leak of %d blocks found in xmlNanoFTPGetConnection",
11526 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011527 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000011528 printf(" %d", n_ctx);
11529 printf("\n");
11530 }
11531 }
11532#endif
11533
11534 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011535 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011536}
11537
11538
11539static int
11540test_xmlNanoFTPGetResponse(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011541 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011542
Daniel Veillard27f20102004-11-05 11:50:11 +000011543#ifdef LIBXML_FTP_ENABLED
11544 int mem_base;
11545 int ret_val;
11546 void * ctx; /* an FTP context */
11547 int n_ctx;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011548
Daniel Veillard27f20102004-11-05 11:50:11 +000011549 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11550 mem_base = xmlMemBlocks();
11551 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11552
11553 ret_val = xmlNanoFTPGetResponse(ctx);
11554 desret_int(ret_val);
11555 call_tests++;
11556 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11557 xmlResetLastError();
11558 if (mem_base != xmlMemBlocks()) {
11559 printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11560 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011561 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000011562 printf(" %d", n_ctx);
11563 printf("\n");
11564 }
11565 }
11566#endif
11567
11568 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011569 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011570}
11571
11572
11573static int
11574test_xmlNanoFTPGetSocket(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011575 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011576
Daniel Veillard27f20102004-11-05 11:50:11 +000011577#ifdef LIBXML_FTP_ENABLED
11578 int mem_base;
11579 int ret_val;
11580 void * ctx; /* an FTP context */
11581 int n_ctx;
11582 const char * filename; /* the file to retrieve (or NULL if path is in context). */
11583 int n_filename;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011584
Daniel Veillard27f20102004-11-05 11:50:11 +000011585 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11586 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
11587 mem_base = xmlMemBlocks();
11588 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11589 filename = gen_filepath(n_filename, 1);
11590
11591 ret_val = xmlNanoFTPGetSocket(ctx, filename);
11592 desret_int(ret_val);
11593 call_tests++;
11594 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11595 des_filepath(n_filename, filename, 1);
11596 xmlResetLastError();
11597 if (mem_base != xmlMemBlocks()) {
11598 printf("Leak of %d blocks found in xmlNanoFTPGetSocket",
11599 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011600 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000011601 printf(" %d", n_ctx);
11602 printf(" %d", n_filename);
11603 printf("\n");
11604 }
11605 }
11606 }
11607#endif
11608
11609 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011610 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011611}
11612
11613
11614static int
11615test_xmlNanoFTPInit(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011616 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011617
11618#ifdef LIBXML_FTP_ENABLED
11619 int mem_base;
11620
11621 mem_base = xmlMemBlocks();
11622
11623 xmlNanoFTPInit();
11624 call_tests++;
11625 xmlResetLastError();
11626 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000011627 printf("Leak of %d blocks found in xmlNanoFTPInit",
Daniel Veillardd93f6252004-11-02 15:53:51 +000011628 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011629 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000011630 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000011631 }
11632#endif
11633
Daniel Veillard3d97e662004-11-04 10:49:00 +000011634 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011635 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011636}
11637
11638
11639static int
11640test_xmlNanoFTPList(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011641 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011642
11643
11644 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000011645 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011646}
11647
11648
11649static int
11650test_xmlNanoFTPNewCtxt(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011651 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011652
11653
11654 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000011655 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011656}
11657
11658
11659static int
11660test_xmlNanoFTPOpen(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011661 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011662
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011663#ifdef LIBXML_FTP_ENABLED
11664 int mem_base;
11665 void * ret_val;
11666 const char * URL; /* the URL to the resource */
11667 int n_URL;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011668
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011669 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11670 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000011671 URL = gen_filepath(n_URL, 0);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011672
11673 ret_val = xmlNanoFTPOpen(URL);
11674 desret_void_ptr(ret_val);
11675 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000011676 des_filepath(n_URL, URL, 0);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011677 xmlResetLastError();
11678 if (mem_base != xmlMemBlocks()) {
11679 printf("Leak of %d blocks found in xmlNanoFTPOpen",
11680 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011681 test_ret++;
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000011682 printf(" %d", n_URL);
11683 printf("\n");
11684 }
11685 }
11686#endif
11687
Daniel Veillard3d97e662004-11-04 10:49:00 +000011688 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011689 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011690}
11691
11692
11693static int
11694test_xmlNanoFTPProxy(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011695 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011696
11697#ifdef LIBXML_FTP_ENABLED
Daniel Veillardce682bc2004-11-05 17:22:25 +000011698 char * host; /* the proxy host name */
Daniel Veillardd93f6252004-11-02 15:53:51 +000011699 int n_host;
11700 int port; /* the proxy port */
11701 int n_port;
Daniel Veillardce682bc2004-11-05 17:22:25 +000011702 char * user; /* the proxy user name */
Daniel Veillardd93f6252004-11-02 15:53:51 +000011703 int n_user;
Daniel Veillardce682bc2004-11-05 17:22:25 +000011704 char * passwd; /* the proxy password */
Daniel Veillardd93f6252004-11-02 15:53:51 +000011705 int n_passwd;
11706 int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11707 int n_type;
11708
11709 for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11710 for (n_port = 0;n_port < gen_nb_int;n_port++) {
11711 for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11712 for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11713 for (n_type = 0;n_type < gen_nb_int;n_type++) {
Daniel Veillard3d97e662004-11-04 10:49:00 +000011714 host = gen_const_char_ptr(n_host, 0);
11715 port = gen_int(n_port, 1);
11716 user = gen_const_char_ptr(n_user, 2);
11717 passwd = gen_const_char_ptr(n_passwd, 3);
11718 type = gen_int(n_type, 4);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011719
11720 xmlNanoFTPProxy(host, port, user, passwd, type);
11721 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000011722 des_const_char_ptr(n_host, host, 0);
11723 des_int(n_port, port, 1);
11724 des_const_char_ptr(n_user, user, 2);
11725 des_const_char_ptr(n_passwd, passwd, 3);
11726 des_int(n_type, type, 4);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011727 xmlResetLastError();
11728 }
11729 }
11730 }
11731 }
11732 }
11733#endif
11734
Daniel Veillard3d97e662004-11-04 10:49:00 +000011735 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011736 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011737}
11738
11739
11740static int
11741test_xmlNanoFTPQuit(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011742 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011743
Daniel Veillard27f20102004-11-05 11:50:11 +000011744#ifdef LIBXML_FTP_ENABLED
11745 int mem_base;
11746 int ret_val;
11747 void * ctx; /* an FTP context */
11748 int n_ctx;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011749
Daniel Veillard27f20102004-11-05 11:50:11 +000011750 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11751 mem_base = xmlMemBlocks();
11752 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11753
11754 ret_val = xmlNanoFTPQuit(ctx);
11755 desret_int(ret_val);
11756 call_tests++;
11757 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11758 xmlResetLastError();
11759 if (mem_base != xmlMemBlocks()) {
11760 printf("Leak of %d blocks found in xmlNanoFTPQuit",
11761 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011762 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000011763 printf(" %d", n_ctx);
11764 printf("\n");
11765 }
11766 }
11767#endif
11768
11769 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011770 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011771}
11772
11773
11774static int
11775test_xmlNanoFTPRead(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011776 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011777
Daniel Veillard27f20102004-11-05 11:50:11 +000011778#ifdef LIBXML_FTP_ENABLED
11779 int mem_base;
11780 int ret_val;
11781 void * ctx; /* the FTP context */
11782 int n_ctx;
11783 void * dest; /* a buffer */
11784 int n_dest;
11785 int len; /* the buffer length */
11786 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011787
Daniel Veillard27f20102004-11-05 11:50:11 +000011788 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11789 for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11790 for (n_len = 0;n_len < gen_nb_int;n_len++) {
11791 mem_base = xmlMemBlocks();
11792 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11793 dest = gen_void_ptr(n_dest, 1);
11794 len = gen_int(n_len, 2);
11795
11796 ret_val = xmlNanoFTPRead(ctx, dest, len);
11797 desret_int(ret_val);
11798 call_tests++;
11799 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11800 des_void_ptr(n_dest, dest, 1);
11801 des_int(n_len, len, 2);
11802 xmlResetLastError();
11803 if (mem_base != xmlMemBlocks()) {
11804 printf("Leak of %d blocks found in xmlNanoFTPRead",
11805 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011806 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000011807 printf(" %d", n_ctx);
11808 printf(" %d", n_dest);
11809 printf(" %d", n_len);
11810 printf("\n");
11811 }
11812 }
11813 }
11814 }
11815#endif
11816
11817 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011818 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011819}
11820
11821
11822static int
11823test_xmlNanoFTPScanProxy(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011824 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011825
11826#ifdef LIBXML_FTP_ENABLED
11827 const char * URL; /* The proxy URL used to initialize the proxy context */
11828 int n_URL;
11829
11830 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
Daniel Veillard3d97e662004-11-04 10:49:00 +000011831 URL = gen_filepath(n_URL, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011832
11833 xmlNanoFTPScanProxy(URL);
11834 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000011835 des_filepath(n_URL, URL, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011836 xmlResetLastError();
11837 }
11838#endif
11839
Daniel Veillard3d97e662004-11-04 10:49:00 +000011840 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011841 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011842}
11843
11844
11845static int
11846test_xmlNanoFTPUpdateURL(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011847 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011848
Daniel Veillard27f20102004-11-05 11:50:11 +000011849#ifdef LIBXML_FTP_ENABLED
11850 int mem_base;
11851 int ret_val;
11852 void * ctx; /* an FTP context */
11853 int n_ctx;
11854 const char * URL; /* The URL used to update the context */
11855 int n_URL;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011856
Daniel Veillard27f20102004-11-05 11:50:11 +000011857 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11858 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11859 mem_base = xmlMemBlocks();
11860 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11861 URL = gen_filepath(n_URL, 1);
11862
11863 ret_val = xmlNanoFTPUpdateURL(ctx, URL);
11864 desret_int(ret_val);
11865 call_tests++;
11866 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11867 des_filepath(n_URL, URL, 1);
11868 xmlResetLastError();
11869 if (mem_base != xmlMemBlocks()) {
11870 printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
11871 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011872 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000011873 printf(" %d", n_ctx);
11874 printf(" %d", n_URL);
11875 printf("\n");
11876 }
11877 }
11878 }
11879#endif
11880
11881 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011882 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011883}
11884
11885static int
11886test_nanoftp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011887 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011888
Daniel Veillard27f20102004-11-05 11:50:11 +000011889 printf("Testing nanoftp : 15 of 22 functions ...\n");
Daniel Veillard42595322004-11-08 10:52:06 +000011890 test_ret += test_xmlNanoFTPCheckResponse();
11891 test_ret += test_xmlNanoFTPCleanup();
11892 test_ret += test_xmlNanoFTPCloseConnection();
11893 test_ret += test_xmlNanoFTPCwd();
11894 test_ret += test_xmlNanoFTPDele();
11895 test_ret += test_xmlNanoFTPGet();
11896 test_ret += test_xmlNanoFTPGetConnection();
11897 test_ret += test_xmlNanoFTPGetResponse();
11898 test_ret += test_xmlNanoFTPGetSocket();
11899 test_ret += test_xmlNanoFTPInit();
11900 test_ret += test_xmlNanoFTPList();
11901 test_ret += test_xmlNanoFTPNewCtxt();
11902 test_ret += test_xmlNanoFTPOpen();
11903 test_ret += test_xmlNanoFTPProxy();
11904 test_ret += test_xmlNanoFTPQuit();
11905 test_ret += test_xmlNanoFTPRead();
11906 test_ret += test_xmlNanoFTPScanProxy();
11907 test_ret += test_xmlNanoFTPUpdateURL();
Daniel Veillardd93f6252004-11-02 15:53:51 +000011908
Daniel Veillard42595322004-11-08 10:52:06 +000011909 if (test_ret != 0)
11910 printf("Module nanoftp: %d errors\n", test_ret);
11911 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011912}
11913
11914static int
11915test_xmlNanoHTTPAuthHeader(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011916 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011917
Daniel Veillard27f20102004-11-05 11:50:11 +000011918#ifdef LIBXML_HTTP_ENABLED
11919 int mem_base;
11920 const char * ret_val;
11921 void * ctx; /* the HTTP context */
11922 int n_ctx;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011923
Daniel Veillard27f20102004-11-05 11:50:11 +000011924 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11925 mem_base = xmlMemBlocks();
11926 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11927
11928 ret_val = xmlNanoHTTPAuthHeader(ctx);
11929 desret_const_char_ptr(ret_val);
11930 call_tests++;
11931 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11932 xmlResetLastError();
11933 if (mem_base != xmlMemBlocks()) {
11934 printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
11935 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011936 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000011937 printf(" %d", n_ctx);
11938 printf("\n");
11939 }
11940 }
11941#endif
11942
11943 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011944 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011945}
11946
11947
11948static int
11949test_xmlNanoHTTPCleanup(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011950 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011951
11952#ifdef LIBXML_HTTP_ENABLED
11953 int mem_base;
11954
11955 mem_base = xmlMemBlocks();
11956
11957 xmlNanoHTTPCleanup();
11958 call_tests++;
11959 xmlResetLastError();
11960 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000011961 printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
Daniel Veillardd93f6252004-11-02 15:53:51 +000011962 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011963 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000011964 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000011965 }
11966#endif
11967
Daniel Veillard3d97e662004-11-04 10:49:00 +000011968 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000011969 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000011970}
11971
11972
11973static int
11974test_xmlNanoHTTPClose(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000011975 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011976
Daniel Veillard27f20102004-11-05 11:50:11 +000011977#ifdef LIBXML_HTTP_ENABLED
11978 int mem_base;
11979 void * ctx; /* the HTTP context */
11980 int n_ctx;
Daniel Veillardd93f6252004-11-02 15:53:51 +000011981
Daniel Veillard27f20102004-11-05 11:50:11 +000011982 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11983 mem_base = xmlMemBlocks();
11984 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11985
11986 xmlNanoHTTPClose(ctx);
11987 call_tests++;
11988 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11989 xmlResetLastError();
11990 if (mem_base != xmlMemBlocks()) {
11991 printf("Leak of %d blocks found in xmlNanoHTTPClose",
11992 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000011993 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000011994 printf(" %d", n_ctx);
11995 printf("\n");
11996 }
11997 }
11998#endif
11999
12000 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012001 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012002}
12003
12004
12005static int
12006test_xmlNanoHTTPContentLength(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012007 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012008
Daniel Veillard27f20102004-11-05 11:50:11 +000012009#ifdef LIBXML_HTTP_ENABLED
12010 int mem_base;
12011 int ret_val;
12012 void * ctx; /* the HTTP context */
12013 int n_ctx;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012014
Daniel Veillard27f20102004-11-05 11:50:11 +000012015 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12016 mem_base = xmlMemBlocks();
12017 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12018
12019 ret_val = xmlNanoHTTPContentLength(ctx);
12020 desret_int(ret_val);
12021 call_tests++;
12022 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12023 xmlResetLastError();
12024 if (mem_base != xmlMemBlocks()) {
12025 printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
12026 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000012027 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000012028 printf(" %d", n_ctx);
12029 printf("\n");
12030 }
12031 }
12032#endif
12033
12034 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012035 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012036}
12037
12038
12039static int
12040test_xmlNanoHTTPEncoding(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012041 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012042
Daniel Veillard27f20102004-11-05 11:50:11 +000012043#ifdef LIBXML_HTTP_ENABLED
12044 int mem_base;
12045 const char * ret_val;
12046 void * ctx; /* the HTTP context */
12047 int n_ctx;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012048
Daniel Veillard27f20102004-11-05 11:50:11 +000012049 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12050 mem_base = xmlMemBlocks();
12051 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12052
12053 ret_val = xmlNanoHTTPEncoding(ctx);
12054 desret_const_char_ptr(ret_val);
12055 call_tests++;
12056 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12057 xmlResetLastError();
12058 if (mem_base != xmlMemBlocks()) {
12059 printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
12060 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000012061 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000012062 printf(" %d", n_ctx);
12063 printf("\n");
12064 }
12065 }
12066#endif
12067
12068 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012069 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012070}
12071
12072
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000012073#define gen_nb_char_ptr_ptr 1
12074static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12075 return(NULL);
12076}
12077static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12078}
12079
Daniel Veillardd93f6252004-11-02 15:53:51 +000012080static int
12081test_xmlNanoHTTPFetch(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012082 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012083
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000012084#ifdef LIBXML_HTTP_ENABLED
12085 int mem_base;
12086 int ret_val;
12087 const char * URL; /* The URL to load */
12088 int n_URL;
12089 const char * filename; /* the filename where the content should be saved */
12090 int n_filename;
12091 char ** contentType; /* if available the Content-Type information will be returned at that location */
12092 int n_contentType;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012093
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000012094 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12095 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12096 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12097 mem_base = xmlMemBlocks();
12098 URL = gen_filepath(n_URL, 0);
12099 filename = gen_filepath(n_filename, 1);
12100 contentType = gen_char_ptr_ptr(n_contentType, 2);
12101
12102 ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12103 desret_int(ret_val);
12104 call_tests++;
12105 des_filepath(n_URL, URL, 0);
12106 des_filepath(n_filename, filename, 1);
12107 des_char_ptr_ptr(n_contentType, contentType, 2);
12108 xmlResetLastError();
12109 if (mem_base != xmlMemBlocks()) {
12110 printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12111 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000012112 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000012113 printf(" %d", n_URL);
12114 printf(" %d", n_filename);
12115 printf(" %d", n_contentType);
12116 printf("\n");
12117 }
12118 }
12119 }
12120 }
12121#endif
12122
12123 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012124 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012125}
12126
12127
12128static int
12129test_xmlNanoHTTPInit(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012130 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012131
12132#ifdef LIBXML_HTTP_ENABLED
12133 int mem_base;
12134
12135 mem_base = xmlMemBlocks();
12136
12137 xmlNanoHTTPInit();
12138 call_tests++;
12139 xmlResetLastError();
12140 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000012141 printf("Leak of %d blocks found in xmlNanoHTTPInit",
Daniel Veillardd93f6252004-11-02 15:53:51 +000012142 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000012143 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000012144 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000012145 }
12146#endif
12147
Daniel Veillard3d97e662004-11-04 10:49:00 +000012148 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012149 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012150}
12151
12152
12153static int
12154test_xmlNanoHTTPMethod(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012155 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012156
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000012157#ifdef LIBXML_HTTP_ENABLED
12158 int mem_base;
12159 void * ret_val;
12160 const char * URL; /* The URL to load */
12161 int n_URL;
12162 char * method; /* the HTTP method to use */
12163 int n_method;
12164 char * input; /* the input string if any */
12165 int n_input;
12166 char ** contentType; /* the Content-Type information IN and OUT */
12167 int n_contentType;
12168 char * headers; /* the extra headers */
12169 int n_headers;
12170 int ilen; /* input length */
12171 int n_ilen;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012172
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000012173 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12174 for (n_method = 0;n_method < gen_nb_const_char_ptr;n_method++) {
12175 for (n_input = 0;n_input < gen_nb_const_char_ptr;n_input++) {
12176 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12177 for (n_headers = 0;n_headers < gen_nb_const_char_ptr;n_headers++) {
12178 for (n_ilen = 0;n_ilen < gen_nb_int;n_ilen++) {
12179 mem_base = xmlMemBlocks();
12180 URL = gen_filepath(n_URL, 0);
12181 method = gen_const_char_ptr(n_method, 1);
12182 input = gen_const_char_ptr(n_input, 2);
12183 contentType = gen_char_ptr_ptr(n_contentType, 3);
12184 headers = gen_const_char_ptr(n_headers, 4);
12185 ilen = gen_int(n_ilen, 5);
12186
12187 ret_val = xmlNanoHTTPMethod(URL, method, input, contentType, headers, ilen);
12188 desret_void_ptr(ret_val);
12189 call_tests++;
12190 des_filepath(n_URL, URL, 0);
12191 des_const_char_ptr(n_method, method, 1);
12192 des_const_char_ptr(n_input, input, 2);
12193 des_char_ptr_ptr(n_contentType, contentType, 3);
12194 des_const_char_ptr(n_headers, headers, 4);
12195 des_int(n_ilen, ilen, 5);
12196 xmlResetLastError();
12197 if (mem_base != xmlMemBlocks()) {
12198 printf("Leak of %d blocks found in xmlNanoHTTPMethod",
12199 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000012200 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000012201 printf(" %d", n_URL);
12202 printf(" %d", n_method);
12203 printf(" %d", n_input);
12204 printf(" %d", n_contentType);
12205 printf(" %d", n_headers);
12206 printf(" %d", n_ilen);
12207 printf("\n");
12208 }
12209 }
12210 }
12211 }
12212 }
12213 }
12214 }
12215#endif
12216
12217 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012218 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012219}
12220
12221
12222static int
12223test_xmlNanoHTTPMethodRedir(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012224 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012225
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000012226#ifdef LIBXML_HTTP_ENABLED
12227 int mem_base;
12228 void * ret_val;
12229 const char * URL; /* The URL to load */
12230 int n_URL;
12231 char * method; /* the HTTP method to use */
12232 int n_method;
12233 char * input; /* the input string if any */
12234 int n_input;
12235 char ** contentType; /* the Content-Type information IN and OUT */
12236 int n_contentType;
12237 char ** redir; /* the redirected URL OUT */
12238 int n_redir;
12239 char * headers; /* the extra headers */
12240 int n_headers;
12241 int ilen; /* input length */
12242 int n_ilen;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012243
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000012244 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12245 for (n_method = 0;n_method < gen_nb_const_char_ptr;n_method++) {
12246 for (n_input = 0;n_input < gen_nb_const_char_ptr;n_input++) {
12247 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12248 for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12249 for (n_headers = 0;n_headers < gen_nb_const_char_ptr;n_headers++) {
12250 for (n_ilen = 0;n_ilen < gen_nb_int;n_ilen++) {
12251 mem_base = xmlMemBlocks();
12252 URL = gen_filepath(n_URL, 0);
12253 method = gen_const_char_ptr(n_method, 1);
12254 input = gen_const_char_ptr(n_input, 2);
12255 contentType = gen_char_ptr_ptr(n_contentType, 3);
12256 redir = gen_char_ptr_ptr(n_redir, 4);
12257 headers = gen_const_char_ptr(n_headers, 5);
12258 ilen = gen_int(n_ilen, 6);
12259
12260 ret_val = xmlNanoHTTPMethodRedir(URL, method, input, contentType, redir, headers, ilen);
12261 desret_void_ptr(ret_val);
12262 call_tests++;
12263 des_filepath(n_URL, URL, 0);
12264 des_const_char_ptr(n_method, method, 1);
12265 des_const_char_ptr(n_input, input, 2);
12266 des_char_ptr_ptr(n_contentType, contentType, 3);
12267 des_char_ptr_ptr(n_redir, redir, 4);
12268 des_const_char_ptr(n_headers, headers, 5);
12269 des_int(n_ilen, ilen, 6);
12270 xmlResetLastError();
12271 if (mem_base != xmlMemBlocks()) {
12272 printf("Leak of %d blocks found in xmlNanoHTTPMethodRedir",
12273 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000012274 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000012275 printf(" %d", n_URL);
12276 printf(" %d", n_method);
12277 printf(" %d", n_input);
12278 printf(" %d", n_contentType);
12279 printf(" %d", n_redir);
12280 printf(" %d", n_headers);
12281 printf(" %d", n_ilen);
12282 printf("\n");
12283 }
12284 }
12285 }
12286 }
12287 }
12288 }
12289 }
12290 }
12291#endif
12292
12293 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012294 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012295}
12296
12297
12298static int
12299test_xmlNanoHTTPMimeType(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012300 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012301
Daniel Veillard27f20102004-11-05 11:50:11 +000012302#ifdef LIBXML_HTTP_ENABLED
12303 int mem_base;
12304 const char * ret_val;
12305 void * ctx; /* the HTTP context */
12306 int n_ctx;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012307
Daniel Veillard27f20102004-11-05 11:50:11 +000012308 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12309 mem_base = xmlMemBlocks();
12310 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12311
12312 ret_val = xmlNanoHTTPMimeType(ctx);
12313 desret_const_char_ptr(ret_val);
12314 call_tests++;
12315 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12316 xmlResetLastError();
12317 if (mem_base != xmlMemBlocks()) {
12318 printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12319 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000012320 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000012321 printf(" %d", n_ctx);
12322 printf("\n");
12323 }
12324 }
12325#endif
12326
12327 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012328 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012329}
12330
12331
12332static int
12333test_xmlNanoHTTPOpen(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012334 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012335
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000012336#ifdef LIBXML_HTTP_ENABLED
12337 int mem_base;
12338 void * ret_val;
12339 const char * URL; /* The URL to load */
12340 int n_URL;
12341 char ** contentType; /* if available the Content-Type information will be returned at that location */
12342 int n_contentType;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012343
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000012344 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12345 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12346 mem_base = xmlMemBlocks();
12347 URL = gen_filepath(n_URL, 0);
12348 contentType = gen_char_ptr_ptr(n_contentType, 1);
12349
12350 ret_val = xmlNanoHTTPOpen(URL, contentType);
12351 desret_void_ptr(ret_val);
12352 call_tests++;
12353 des_filepath(n_URL, URL, 0);
12354 des_char_ptr_ptr(n_contentType, contentType, 1);
12355 xmlResetLastError();
12356 if (mem_base != xmlMemBlocks()) {
12357 printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12358 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000012359 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000012360 printf(" %d", n_URL);
12361 printf(" %d", n_contentType);
12362 printf("\n");
12363 }
12364 }
12365 }
12366#endif
12367
12368 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012369 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012370}
12371
12372
12373static int
12374test_xmlNanoHTTPOpenRedir(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012375 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012376
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000012377#ifdef LIBXML_HTTP_ENABLED
12378 int mem_base;
12379 void * ret_val;
12380 const char * URL; /* The URL to load */
12381 int n_URL;
12382 char ** contentType; /* if available the Content-Type information will be returned at that location */
12383 int n_contentType;
12384 char ** redir; /* if available the redirected URL will be returned */
12385 int n_redir;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012386
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000012387 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12388 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12389 for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12390 mem_base = xmlMemBlocks();
12391 URL = gen_filepath(n_URL, 0);
12392 contentType = gen_char_ptr_ptr(n_contentType, 1);
12393 redir = gen_char_ptr_ptr(n_redir, 2);
12394
12395 ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12396 desret_void_ptr(ret_val);
12397 call_tests++;
12398 des_filepath(n_URL, URL, 0);
12399 des_char_ptr_ptr(n_contentType, contentType, 1);
12400 des_char_ptr_ptr(n_redir, redir, 2);
12401 xmlResetLastError();
12402 if (mem_base != xmlMemBlocks()) {
12403 printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12404 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000012405 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000012406 printf(" %d", n_URL);
12407 printf(" %d", n_contentType);
12408 printf(" %d", n_redir);
12409 printf("\n");
12410 }
12411 }
12412 }
12413 }
12414#endif
12415
12416 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012417 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012418}
12419
12420
12421static int
12422test_xmlNanoHTTPRead(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012423 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012424
Daniel Veillard27f20102004-11-05 11:50:11 +000012425#ifdef LIBXML_HTTP_ENABLED
12426 int mem_base;
12427 int ret_val;
12428 void * ctx; /* the HTTP context */
12429 int n_ctx;
12430 void * dest; /* a buffer */
12431 int n_dest;
12432 int len; /* the buffer length */
12433 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012434
Daniel Veillard27f20102004-11-05 11:50:11 +000012435 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12436 for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12437 for (n_len = 0;n_len < gen_nb_int;n_len++) {
12438 mem_base = xmlMemBlocks();
12439 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12440 dest = gen_void_ptr(n_dest, 1);
12441 len = gen_int(n_len, 2);
12442
12443 ret_val = xmlNanoHTTPRead(ctx, dest, len);
12444 desret_int(ret_val);
12445 call_tests++;
12446 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12447 des_void_ptr(n_dest, dest, 1);
12448 des_int(n_len, len, 2);
12449 xmlResetLastError();
12450 if (mem_base != xmlMemBlocks()) {
12451 printf("Leak of %d blocks found in xmlNanoHTTPRead",
12452 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000012453 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000012454 printf(" %d", n_ctx);
12455 printf(" %d", n_dest);
12456 printf(" %d", n_len);
12457 printf("\n");
12458 }
12459 }
12460 }
12461 }
12462#endif
12463
12464 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012465 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012466}
12467
12468
12469static int
12470test_xmlNanoHTTPRedir(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012471 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012472
12473
12474 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000012475 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012476}
12477
12478
12479static int
12480test_xmlNanoHTTPReturnCode(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012481 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012482
Daniel Veillard27f20102004-11-05 11:50:11 +000012483#ifdef LIBXML_HTTP_ENABLED
12484 int mem_base;
12485 int ret_val;
12486 void * ctx; /* the HTTP context */
12487 int n_ctx;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012488
Daniel Veillard27f20102004-11-05 11:50:11 +000012489 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12490 mem_base = xmlMemBlocks();
12491 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12492
12493 ret_val = xmlNanoHTTPReturnCode(ctx);
12494 desret_int(ret_val);
12495 call_tests++;
12496 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12497 xmlResetLastError();
12498 if (mem_base != xmlMemBlocks()) {
12499 printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12500 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000012501 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000012502 printf(" %d", n_ctx);
12503 printf("\n");
12504 }
12505 }
12506#endif
12507
12508 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012509 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012510}
12511
12512
12513static int
12514test_xmlNanoHTTPSave(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012515 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012516
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000012517#ifdef LIBXML_HTTP_ENABLED
12518#ifdef LIBXML_OUTPUT_ENABLED
12519 int mem_base;
12520 int ret_val;
12521 void * ctxt; /* the HTTP context */
12522 int n_ctxt;
12523 const char * filename; /* the filename where the content should be saved */
12524 int n_filename;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012525
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000012526 for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12527 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12528 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000012529 ctxt = gen_void_ptr(n_ctxt, 0);
12530 filename = gen_fileoutput(n_filename, 1);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000012531
12532 ret_val = xmlNanoHTTPSave(ctxt, filename);
12533 desret_int(ret_val);
12534 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000012535 des_void_ptr(n_ctxt, ctxt, 0);
12536 des_fileoutput(n_filename, filename, 1);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000012537 xmlResetLastError();
12538 if (mem_base != xmlMemBlocks()) {
12539 printf("Leak of %d blocks found in xmlNanoHTTPSave",
12540 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000012541 test_ret++;
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000012542 printf(" %d", n_ctxt);
12543 printf(" %d", n_filename);
12544 printf("\n");
12545 }
12546 }
12547 }
12548#endif
12549#endif
12550
Daniel Veillard3d97e662004-11-04 10:49:00 +000012551 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012552 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012553}
12554
12555
12556static int
12557test_xmlNanoHTTPScanProxy(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012558 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012559
12560#ifdef LIBXML_HTTP_ENABLED
12561 const char * URL; /* The proxy URL used to initialize the proxy context */
12562 int n_URL;
12563
12564 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
Daniel Veillard3d97e662004-11-04 10:49:00 +000012565 URL = gen_filepath(n_URL, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012566
12567 xmlNanoHTTPScanProxy(URL);
12568 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000012569 des_filepath(n_URL, URL, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012570 xmlResetLastError();
12571 }
12572#endif
12573
Daniel Veillard3d97e662004-11-04 10:49:00 +000012574 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012575 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012576}
12577
12578static int
12579test_nanohttp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012580 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012581
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000012582 printf("Testing nanohttp : 16 of 17 functions ...\n");
Daniel Veillard42595322004-11-08 10:52:06 +000012583 test_ret += test_xmlNanoHTTPAuthHeader();
12584 test_ret += test_xmlNanoHTTPCleanup();
12585 test_ret += test_xmlNanoHTTPClose();
12586 test_ret += test_xmlNanoHTTPContentLength();
12587 test_ret += test_xmlNanoHTTPEncoding();
12588 test_ret += test_xmlNanoHTTPFetch();
12589 test_ret += test_xmlNanoHTTPInit();
12590 test_ret += test_xmlNanoHTTPMethod();
12591 test_ret += test_xmlNanoHTTPMethodRedir();
12592 test_ret += test_xmlNanoHTTPMimeType();
12593 test_ret += test_xmlNanoHTTPOpen();
12594 test_ret += test_xmlNanoHTTPOpenRedir();
12595 test_ret += test_xmlNanoHTTPRead();
12596 test_ret += test_xmlNanoHTTPRedir();
12597 test_ret += test_xmlNanoHTTPReturnCode();
12598 test_ret += test_xmlNanoHTTPSave();
12599 test_ret += test_xmlNanoHTTPScanProxy();
Daniel Veillardd93f6252004-11-02 15:53:51 +000012600
Daniel Veillard42595322004-11-08 10:52:06 +000012601 if (test_ret != 0)
12602 printf("Module nanohttp: %d errors\n", test_ret);
12603 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012604}
12605
12606static int
12607test_xmlByteConsumed(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012608 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012609
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000012610 int mem_base;
12611 long ret_val;
12612 xmlParserCtxtPtr ctxt; /* an XML parser context */
12613 int n_ctxt;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012614
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000012615 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12616 mem_base = xmlMemBlocks();
12617 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12618
12619 ret_val = xmlByteConsumed(ctxt);
12620 desret_long(ret_val);
12621 call_tests++;
12622 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12623 xmlResetLastError();
12624 if (mem_base != xmlMemBlocks()) {
12625 printf("Leak of %d blocks found in xmlByteConsumed",
12626 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000012627 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000012628 printf(" %d", n_ctxt);
12629 printf("\n");
12630 }
12631 }
12632
12633 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012634 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012635}
12636
12637
Daniel Veillardce682bc2004-11-05 17:22:25 +000012638#define gen_nb_xmlParserNodeInfoSeqPtr 1
12639static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12640 return(NULL);
12641}
12642static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12643}
12644
Daniel Veillardd93f6252004-11-02 15:53:51 +000012645static int
12646test_xmlClearNodeInfoSeq(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012647 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012648
Daniel Veillardce682bc2004-11-05 17:22:25 +000012649 int mem_base;
12650 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12651 int n_seq;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012652
Daniel Veillardce682bc2004-11-05 17:22:25 +000012653 for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12654 mem_base = xmlMemBlocks();
12655 seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12656
12657 xmlClearNodeInfoSeq(seq);
12658 call_tests++;
12659 des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12660 xmlResetLastError();
12661 if (mem_base != xmlMemBlocks()) {
12662 printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12663 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000012664 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000012665 printf(" %d", n_seq);
12666 printf("\n");
12667 }
12668 }
12669
12670 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012671 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012672}
12673
12674
12675static int
12676test_xmlClearParserCtxt(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012677 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012678
12679 int mem_base;
12680 xmlParserCtxtPtr ctxt; /* an XML parser context */
12681 int n_ctxt;
12682
12683 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12684 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000012685 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012686
12687 xmlClearParserCtxt(ctxt);
12688 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000012689 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012690 xmlResetLastError();
12691 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000012692 printf("Leak of %d blocks found in xmlClearParserCtxt",
Daniel Veillardd93f6252004-11-02 15:53:51 +000012693 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000012694 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000012695 printf(" %d", n_ctxt);
12696 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000012697 }
12698 }
12699
Daniel Veillard3d97e662004-11-04 10:49:00 +000012700 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012701 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012702}
12703
12704
12705static int
12706test_xmlCreateDocParserCtxt(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012707 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012708
Daniel Veillard34099b42004-11-04 17:34:35 +000012709 int mem_base;
12710 xmlParserCtxtPtr ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000012711 xmlChar * cur; /* a pointer to an array of xmlChar */
Daniel Veillard34099b42004-11-04 17:34:35 +000012712 int n_cur;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012713
Daniel Veillard34099b42004-11-04 17:34:35 +000012714 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12715 mem_base = xmlMemBlocks();
12716 cur = gen_const_xmlChar_ptr(n_cur, 0);
12717
12718 ret_val = xmlCreateDocParserCtxt(cur);
12719 desret_xmlParserCtxtPtr(ret_val);
12720 call_tests++;
12721 des_const_xmlChar_ptr(n_cur, cur, 0);
12722 xmlResetLastError();
12723 if (mem_base != xmlMemBlocks()) {
12724 printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12725 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000012726 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000012727 printf(" %d", n_cur);
12728 printf("\n");
12729 }
12730 }
12731
12732 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012733 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012734}
12735
12736
12737static int
12738test_xmlCreatePushParserCtxt(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012739 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012740
Daniel Veillard34099b42004-11-04 17:34:35 +000012741#ifdef LIBXML_PUSH_ENABLED
12742 int mem_base;
12743 xmlParserCtxtPtr ret_val;
12744 xmlSAXHandlerPtr sax; /* a SAX handler */
12745 int n_sax;
12746 void * user_data; /* The user data returned on SAX callbacks */
12747 int n_user_data;
Daniel Veillardce682bc2004-11-05 17:22:25 +000012748 char * chunk; /* a pointer to an array of chars */
Daniel Veillard34099b42004-11-04 17:34:35 +000012749 int n_chunk;
12750 int size; /* number of chars in the array */
12751 int n_size;
12752 const char * filename; /* an optional file name or URI */
12753 int n_filename;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012754
Daniel Veillard34099b42004-11-04 17:34:35 +000012755 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12756 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12757 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12758 for (n_size = 0;n_size < gen_nb_int;n_size++) {
Daniel Veillard42595322004-11-08 10:52:06 +000012759 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
Daniel Veillard34099b42004-11-04 17:34:35 +000012760 mem_base = xmlMemBlocks();
12761 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12762 user_data = gen_userdata(n_user_data, 1);
12763 chunk = gen_const_char_ptr(n_chunk, 2);
12764 size = gen_int(n_size, 3);
Daniel Veillard42595322004-11-08 10:52:06 +000012765 filename = gen_fileoutput(n_filename, 4);
Daniel Veillard34099b42004-11-04 17:34:35 +000012766
12767 ret_val = xmlCreatePushParserCtxt(sax, user_data, chunk, size, filename);
12768 desret_xmlParserCtxtPtr(ret_val);
12769 call_tests++;
12770 des_xmlSAXHandlerPtr(n_sax, sax, 0);
12771 des_userdata(n_user_data, user_data, 1);
12772 des_const_char_ptr(n_chunk, chunk, 2);
12773 des_int(n_size, size, 3);
Daniel Veillard42595322004-11-08 10:52:06 +000012774 des_fileoutput(n_filename, filename, 4);
Daniel Veillard34099b42004-11-04 17:34:35 +000012775 xmlResetLastError();
12776 if (mem_base != xmlMemBlocks()) {
12777 printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12778 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000012779 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000012780 printf(" %d", n_sax);
12781 printf(" %d", n_user_data);
12782 printf(" %d", n_chunk);
12783 printf(" %d", n_size);
12784 printf(" %d", n_filename);
12785 printf("\n");
12786 }
12787 }
12788 }
12789 }
12790 }
12791 }
12792#endif
12793
12794 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012795 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012796}
12797
12798
12799static int
12800test_xmlCtxtReadDoc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012801 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012802
12803 int mem_base;
12804 xmlDocPtr ret_val;
12805 xmlParserCtxtPtr ctxt; /* an XML parser context */
12806 int n_ctxt;
Daniel Veillardce682bc2004-11-05 17:22:25 +000012807 xmlChar * cur; /* a pointer to a zero terminated string */
Daniel Veillardd93f6252004-11-02 15:53:51 +000012808 int n_cur;
12809 const char * URL; /* the base URL to use for the document */
12810 int n_URL;
Daniel Veillardce682bc2004-11-05 17:22:25 +000012811 char * encoding; /* the document encoding, or NULL */
Daniel Veillardd93f6252004-11-02 15:53:51 +000012812 int n_encoding;
12813 int options; /* a combination of xmlParserOption */
12814 int n_options;
12815
12816 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12817 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12818 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12819 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
Daniel Veillard6128c012004-11-08 17:16:15 +000012820 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
Daniel Veillardd93f6252004-11-02 15:53:51 +000012821 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000012822 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12823 cur = gen_const_xmlChar_ptr(n_cur, 1);
12824 URL = gen_filepath(n_URL, 2);
12825 encoding = gen_const_char_ptr(n_encoding, 3);
Daniel Veillard6128c012004-11-08 17:16:15 +000012826 options = gen_parseroptions(n_options, 4);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012827
12828 ret_val = xmlCtxtReadDoc(ctxt, cur, URL, encoding, options);
12829 desret_xmlDocPtr(ret_val);
12830 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000012831 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12832 des_const_xmlChar_ptr(n_cur, cur, 1);
12833 des_filepath(n_URL, URL, 2);
12834 des_const_char_ptr(n_encoding, encoding, 3);
Daniel Veillard6128c012004-11-08 17:16:15 +000012835 des_parseroptions(n_options, options, 4);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012836 xmlResetLastError();
12837 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000012838 printf("Leak of %d blocks found in xmlCtxtReadDoc",
Daniel Veillardd93f6252004-11-02 15:53:51 +000012839 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000012840 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000012841 printf(" %d", n_ctxt);
12842 printf(" %d", n_cur);
12843 printf(" %d", n_URL);
12844 printf(" %d", n_encoding);
12845 printf(" %d", n_options);
12846 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000012847 }
12848 }
12849 }
12850 }
12851 }
12852 }
12853
Daniel Veillard3d97e662004-11-04 10:49:00 +000012854 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012855 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012856}
12857
12858
12859static int
12860test_xmlCtxtReadFile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012861 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012862
12863 int mem_base;
12864 xmlDocPtr ret_val;
12865 xmlParserCtxtPtr ctxt; /* an XML parser context */
12866 int n_ctxt;
12867 const char * filename; /* a file or URL */
12868 int n_filename;
Daniel Veillardce682bc2004-11-05 17:22:25 +000012869 char * encoding; /* the document encoding, or NULL */
Daniel Veillardd93f6252004-11-02 15:53:51 +000012870 int n_encoding;
12871 int options; /* a combination of xmlParserOption */
12872 int n_options;
12873
12874 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12875 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12876 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
Daniel Veillard6128c012004-11-08 17:16:15 +000012877 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
Daniel Veillardd93f6252004-11-02 15:53:51 +000012878 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000012879 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12880 filename = gen_filepath(n_filename, 1);
12881 encoding = gen_const_char_ptr(n_encoding, 2);
Daniel Veillard6128c012004-11-08 17:16:15 +000012882 options = gen_parseroptions(n_options, 3);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012883
12884 ret_val = xmlCtxtReadFile(ctxt, filename, encoding, options);
12885 desret_xmlDocPtr(ret_val);
12886 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000012887 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12888 des_filepath(n_filename, filename, 1);
12889 des_const_char_ptr(n_encoding, encoding, 2);
Daniel Veillard6128c012004-11-08 17:16:15 +000012890 des_parseroptions(n_options, options, 3);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012891 xmlResetLastError();
12892 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000012893 printf("Leak of %d blocks found in xmlCtxtReadFile",
Daniel Veillardd93f6252004-11-02 15:53:51 +000012894 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000012895 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000012896 printf(" %d", n_ctxt);
12897 printf(" %d", n_filename);
12898 printf(" %d", n_encoding);
12899 printf(" %d", n_options);
12900 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000012901 }
12902 }
12903 }
12904 }
12905 }
12906
Daniel Veillard3d97e662004-11-04 10:49:00 +000012907 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012908 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012909}
12910
12911
12912static int
Daniel Veillardd93f6252004-11-02 15:53:51 +000012913test_xmlCtxtReadMemory(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012914 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012915
12916 int mem_base;
12917 xmlDocPtr ret_val;
12918 xmlParserCtxtPtr ctxt; /* an XML parser context */
12919 int n_ctxt;
Daniel Veillardce682bc2004-11-05 17:22:25 +000012920 char * buffer; /* a pointer to a char array */
Daniel Veillardd93f6252004-11-02 15:53:51 +000012921 int n_buffer;
12922 int size; /* the size of the array */
12923 int n_size;
12924 const char * URL; /* the base URL to use for the document */
12925 int n_URL;
Daniel Veillardce682bc2004-11-05 17:22:25 +000012926 char * encoding; /* the document encoding, or NULL */
Daniel Veillardd93f6252004-11-02 15:53:51 +000012927 int n_encoding;
12928 int options; /* a combination of xmlParserOption */
12929 int n_options;
12930
12931 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12932 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12933 for (n_size = 0;n_size < gen_nb_int;n_size++) {
12934 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12935 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
Daniel Veillard6128c012004-11-08 17:16:15 +000012936 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
Daniel Veillardd93f6252004-11-02 15:53:51 +000012937 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000012938 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12939 buffer = gen_const_char_ptr(n_buffer, 1);
12940 size = gen_int(n_size, 2);
12941 URL = gen_filepath(n_URL, 3);
12942 encoding = gen_const_char_ptr(n_encoding, 4);
Daniel Veillard6128c012004-11-08 17:16:15 +000012943 options = gen_parseroptions(n_options, 5);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012944
12945 ret_val = xmlCtxtReadMemory(ctxt, buffer, size, URL, encoding, options);
12946 desret_xmlDocPtr(ret_val);
12947 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000012948 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12949 des_const_char_ptr(n_buffer, buffer, 1);
12950 des_int(n_size, size, 2);
12951 des_filepath(n_URL, URL, 3);
12952 des_const_char_ptr(n_encoding, encoding, 4);
Daniel Veillard6128c012004-11-08 17:16:15 +000012953 des_parseroptions(n_options, options, 5);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012954 xmlResetLastError();
12955 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000012956 printf("Leak of %d blocks found in xmlCtxtReadMemory",
Daniel Veillardd93f6252004-11-02 15:53:51 +000012957 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000012958 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000012959 printf(" %d", n_ctxt);
12960 printf(" %d", n_buffer);
12961 printf(" %d", n_size);
12962 printf(" %d", n_URL);
12963 printf(" %d", n_encoding);
12964 printf(" %d", n_options);
12965 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000012966 }
12967 }
12968 }
12969 }
12970 }
12971 }
12972 }
12973
Daniel Veillard3d97e662004-11-04 10:49:00 +000012974 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000012975 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012976}
12977
12978
12979static int
12980test_xmlCtxtReset(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000012981 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000012982
12983 int mem_base;
12984 xmlParserCtxtPtr ctxt; /* an XML parser context */
12985 int n_ctxt;
12986
12987 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12988 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000012989 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012990
12991 xmlCtxtReset(ctxt);
12992 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000012993 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000012994 xmlResetLastError();
12995 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000012996 printf("Leak of %d blocks found in xmlCtxtReset",
Daniel Veillardd93f6252004-11-02 15:53:51 +000012997 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000012998 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000012999 printf(" %d", n_ctxt);
13000 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000013001 }
13002 }
13003
Daniel Veillard3d97e662004-11-04 10:49:00 +000013004 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000013005 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013006}
13007
13008
13009static int
13010test_xmlCtxtResetPush(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013011 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013012
13013 int mem_base;
13014 int ret_val;
13015 xmlParserCtxtPtr ctxt; /* an XML parser context */
13016 int n_ctxt;
Daniel Veillardce682bc2004-11-05 17:22:25 +000013017 char * chunk; /* a pointer to an array of chars */
Daniel Veillardd93f6252004-11-02 15:53:51 +000013018 int n_chunk;
13019 int size; /* number of chars in the array */
13020 int n_size;
13021 const char * filename; /* an optional file name or URI */
13022 int n_filename;
Daniel Veillardce682bc2004-11-05 17:22:25 +000013023 char * encoding; /* the document encoding, or NULL */
Daniel Veillardd93f6252004-11-02 15:53:51 +000013024 int n_encoding;
13025
13026 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13027 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13028 for (n_size = 0;n_size < gen_nb_int;n_size++) {
13029 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13030 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
13031 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000013032 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13033 chunk = gen_const_char_ptr(n_chunk, 1);
13034 size = gen_int(n_size, 2);
13035 filename = gen_filepath(n_filename, 3);
13036 encoding = gen_const_char_ptr(n_encoding, 4);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013037
13038 ret_val = xmlCtxtResetPush(ctxt, chunk, size, filename, encoding);
13039 desret_int(ret_val);
13040 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000013041 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13042 des_const_char_ptr(n_chunk, chunk, 1);
13043 des_int(n_size, size, 2);
13044 des_filepath(n_filename, filename, 3);
13045 des_const_char_ptr(n_encoding, encoding, 4);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013046 xmlResetLastError();
13047 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000013048 printf("Leak of %d blocks found in xmlCtxtResetPush",
Daniel Veillardd93f6252004-11-02 15:53:51 +000013049 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000013050 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000013051 printf(" %d", n_ctxt);
13052 printf(" %d", n_chunk);
13053 printf(" %d", n_size);
13054 printf(" %d", n_filename);
13055 printf(" %d", n_encoding);
13056 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000013057 }
13058 }
13059 }
13060 }
13061 }
13062 }
13063
Daniel Veillard3d97e662004-11-04 10:49:00 +000013064 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000013065 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013066}
13067
13068
13069static int
13070test_xmlCtxtUseOptions(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013071 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013072
13073 int mem_base;
13074 int ret_val;
13075 xmlParserCtxtPtr ctxt; /* an XML parser context */
13076 int n_ctxt;
13077 int options; /* a combination of xmlParserOption */
13078 int n_options;
13079
13080 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
Daniel Veillard6128c012004-11-08 17:16:15 +000013081 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
Daniel Veillardd93f6252004-11-02 15:53:51 +000013082 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000013083 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
Daniel Veillard6128c012004-11-08 17:16:15 +000013084 options = gen_parseroptions(n_options, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013085
13086 ret_val = xmlCtxtUseOptions(ctxt, options);
13087 desret_int(ret_val);
13088 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000013089 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
Daniel Veillard6128c012004-11-08 17:16:15 +000013090 des_parseroptions(n_options, options, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013091 xmlResetLastError();
13092 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000013093 printf("Leak of %d blocks found in xmlCtxtUseOptions",
Daniel Veillardd93f6252004-11-02 15:53:51 +000013094 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000013095 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000013096 printf(" %d", n_ctxt);
13097 printf(" %d", n_options);
13098 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000013099 }
13100 }
13101 }
13102
Daniel Veillard3d97e662004-11-04 10:49:00 +000013103 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000013104 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013105}
13106
13107
13108static int
13109test_xmlGetExternalEntityLoader(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013110 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013111
13112
13113 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000013114 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013115}
13116
13117
13118static int
13119test_xmlGetFeature(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013120 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013121
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000013122 int mem_base;
13123 int ret_val;
13124 xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
13125 int n_ctxt;
Daniel Veillardce682bc2004-11-05 17:22:25 +000013126 char * name; /* the feature name */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000013127 int n_name;
13128 void * result; /* location to store the result */
13129 int n_result;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013130
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000013131 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13132 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
13133 for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
13134 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000013135 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13136 name = gen_const_char_ptr(n_name, 1);
13137 result = gen_void_ptr(n_result, 2);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000013138
13139 ret_val = xmlGetFeature(ctxt, name, result);
13140 desret_int(ret_val);
13141 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000013142 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13143 des_const_char_ptr(n_name, name, 1);
13144 des_void_ptr(n_result, result, 2);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000013145 xmlResetLastError();
13146 if (mem_base != xmlMemBlocks()) {
13147 printf("Leak of %d blocks found in xmlGetFeature",
13148 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000013149 test_ret++;
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000013150 printf(" %d", n_ctxt);
13151 printf(" %d", n_name);
13152 printf(" %d", n_result);
13153 printf("\n");
13154 }
13155 }
13156 }
13157 }
13158
Daniel Veillard3d97e662004-11-04 10:49:00 +000013159 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000013160 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013161}
13162
13163
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000013164#define gen_nb_const_char_ptr_ptr 1
13165static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13166 return(NULL);
13167}
13168static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13169}
13170
Daniel Veillardd93f6252004-11-02 15:53:51 +000013171static int
13172test_xmlGetFeaturesList(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013173 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013174
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000013175 int mem_base;
13176 int ret_val;
13177 int * len; /* the length of the features name array (input/output) */
13178 int n_len;
13179 char ** result; /* an array of string to be filled with the features name. */
13180 int n_result;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013181
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000013182 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13183 for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
13184 mem_base = xmlMemBlocks();
13185 len = gen_int_ptr(n_len, 0);
13186 result = gen_const_char_ptr_ptr(n_result, 1);
13187
13188 ret_val = xmlGetFeaturesList(len, result);
13189 desret_int(ret_val);
13190 call_tests++;
13191 des_int_ptr(n_len, len, 0);
13192 des_const_char_ptr_ptr(n_result, result, 1);
13193 xmlResetLastError();
13194 if (mem_base != xmlMemBlocks()) {
13195 printf("Leak of %d blocks found in xmlGetFeaturesList",
13196 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000013197 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000013198 printf(" %d", n_len);
13199 printf(" %d", n_result);
13200 printf("\n");
13201 }
13202 }
13203 }
13204
13205 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000013206 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013207}
13208
13209
13210static int
13211test_xmlIOParseDTD(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013212 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013213
Daniel Veillard34099b42004-11-04 17:34:35 +000013214 int mem_base;
13215 xmlDtdPtr ret_val;
13216 xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13217 int n_sax;
13218 xmlParserInputBufferPtr input; /* an Input Buffer */
13219 int n_input;
13220 xmlCharEncoding enc; /* the charset encoding if known */
13221 int n_enc;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013222
Daniel Veillard34099b42004-11-04 17:34:35 +000013223 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13224 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13225 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13226 mem_base = xmlMemBlocks();
13227 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13228 input = gen_xmlParserInputBufferPtr(n_input, 1);
13229 enc = gen_xmlCharEncoding(n_enc, 2);
13230
13231 ret_val = xmlIOParseDTD(sax, input, enc);
13232 input = NULL;
13233 desret_xmlDtdPtr(ret_val);
13234 call_tests++;
13235 des_xmlSAXHandlerPtr(n_sax, sax, 0);
13236 des_xmlParserInputBufferPtr(n_input, input, 1);
13237 des_xmlCharEncoding(n_enc, enc, 2);
13238 xmlResetLastError();
13239 if (mem_base != xmlMemBlocks()) {
13240 printf("Leak of %d blocks found in xmlIOParseDTD",
13241 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000013242 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000013243 printf(" %d", n_sax);
13244 printf(" %d", n_input);
13245 printf(" %d", n_enc);
13246 printf("\n");
13247 }
13248 }
13249 }
13250 }
13251
13252 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000013253 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013254}
13255
13256
13257static int
13258test_xmlInitNodeInfoSeq(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013259 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013260
Daniel Veillardce682bc2004-11-05 17:22:25 +000013261 int mem_base;
13262 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13263 int n_seq;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013264
Daniel Veillardce682bc2004-11-05 17:22:25 +000013265 for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13266 mem_base = xmlMemBlocks();
13267 seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13268
13269 xmlInitNodeInfoSeq(seq);
13270 call_tests++;
13271 des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13272 xmlResetLastError();
13273 if (mem_base != xmlMemBlocks()) {
13274 printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13275 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000013276 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000013277 printf(" %d", n_seq);
13278 printf("\n");
13279 }
13280 }
13281
13282 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000013283 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013284}
13285
13286
13287static int
13288test_xmlInitParser(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013289 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013290
13291 int mem_base;
13292
13293 mem_base = xmlMemBlocks();
13294
13295 xmlInitParser();
13296 call_tests++;
13297 xmlResetLastError();
13298 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000013299 printf("Leak of %d blocks found in xmlInitParser",
Daniel Veillardd93f6252004-11-02 15:53:51 +000013300 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000013301 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000013302 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000013303 }
13304
Daniel Veillard3d97e662004-11-04 10:49:00 +000013305 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000013306 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013307}
13308
13309
13310static int
13311test_xmlInitParserCtxt(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013312 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013313
13314 int mem_base;
13315 int ret_val;
13316 xmlParserCtxtPtr ctxt; /* an XML parser context */
13317 int n_ctxt;
13318
13319 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13320 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000013321 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013322
13323 ret_val = xmlInitParserCtxt(ctxt);
13324 desret_int(ret_val);
13325 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000013326 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013327 xmlResetLastError();
13328 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000013329 printf("Leak of %d blocks found in xmlInitParserCtxt",
Daniel Veillardd93f6252004-11-02 15:53:51 +000013330 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000013331 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000013332 printf(" %d", n_ctxt);
13333 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000013334 }
13335 }
13336
Daniel Veillard3d97e662004-11-04 10:49:00 +000013337 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000013338 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013339}
13340
13341
13342static int
13343test_xmlKeepBlanksDefault(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013344 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013345
13346 int mem_base;
13347 int ret_val;
13348 int val; /* int 0 or 1 */
13349 int n_val;
13350
13351 for (n_val = 0;n_val < gen_nb_int;n_val++) {
13352 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000013353 val = gen_int(n_val, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013354
13355 ret_val = xmlKeepBlanksDefault(val);
13356 desret_int(ret_val);
13357 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000013358 des_int(n_val, val, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013359 xmlResetLastError();
13360 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000013361 printf("Leak of %d blocks found in xmlKeepBlanksDefault",
Daniel Veillardd93f6252004-11-02 15:53:51 +000013362 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000013363 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000013364 printf(" %d", n_val);
13365 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000013366 }
13367 }
13368
Daniel Veillard3d97e662004-11-04 10:49:00 +000013369 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000013370 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013371}
13372
13373
13374static int
13375test_xmlLineNumbersDefault(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013376 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013377
13378 int mem_base;
13379 int ret_val;
13380 int val; /* int 0 or 1 */
13381 int n_val;
13382
13383 for (n_val = 0;n_val < gen_nb_int;n_val++) {
13384 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000013385 val = gen_int(n_val, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013386
13387 ret_val = xmlLineNumbersDefault(val);
13388 desret_int(ret_val);
13389 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000013390 des_int(n_val, val, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013391 xmlResetLastError();
13392 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000013393 printf("Leak of %d blocks found in xmlLineNumbersDefault",
Daniel Veillardd93f6252004-11-02 15:53:51 +000013394 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000013395 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000013396 printf(" %d", n_val);
13397 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000013398 }
13399 }
13400
Daniel Veillard3d97e662004-11-04 10:49:00 +000013401 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000013402 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013403}
13404
13405
13406static int
13407test_xmlLoadExternalEntity(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013408 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013409
Daniel Veillard42595322004-11-08 10:52:06 +000013410 int mem_base;
13411 xmlParserInputPtr ret_val;
13412 const char * URL; /* the URL for the entity to load */
13413 int n_URL;
13414 char * ID; /* the Public ID for the entity to load */
13415 int n_ID;
13416 xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13417 int n_ctxt;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013418
Daniel Veillard42595322004-11-08 10:52:06 +000013419 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13420 for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13421 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13422 mem_base = xmlMemBlocks();
13423 URL = gen_filepath(n_URL, 0);
13424 ID = gen_const_char_ptr(n_ID, 1);
13425 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13426
13427 ret_val = xmlLoadExternalEntity(URL, ID, ctxt);
13428 desret_xmlParserInputPtr(ret_val);
13429 call_tests++;
13430 des_filepath(n_URL, URL, 0);
13431 des_const_char_ptr(n_ID, ID, 1);
13432 des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13433 xmlResetLastError();
13434 if (mem_base != xmlMemBlocks()) {
13435 printf("Leak of %d blocks found in xmlLoadExternalEntity",
13436 xmlMemBlocks() - mem_base);
13437 test_ret++;
13438 printf(" %d", n_URL);
13439 printf(" %d", n_ID);
13440 printf(" %d", n_ctxt);
13441 printf("\n");
13442 }
13443 }
13444 }
13445 }
13446
13447 function_tests++;
13448 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013449}
13450
13451
13452static int
13453test_xmlNewIOInputStream(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013454 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013455
Daniel Veillard42595322004-11-08 10:52:06 +000013456 int mem_base;
13457 xmlParserInputPtr ret_val;
13458 xmlParserCtxtPtr ctxt; /* an XML parser context */
13459 int n_ctxt;
13460 xmlParserInputBufferPtr input; /* an I/O Input */
13461 int n_input;
13462 xmlCharEncoding enc; /* the charset encoding if known */
13463 int n_enc;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013464
Daniel Veillard42595322004-11-08 10:52:06 +000013465 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13466 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13467 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13468 mem_base = xmlMemBlocks();
13469 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13470 input = gen_xmlParserInputBufferPtr(n_input, 1);
13471 enc = gen_xmlCharEncoding(n_enc, 2);
13472
13473 ret_val = xmlNewIOInputStream(ctxt, input, enc);
13474 if (ret_val != NULL) input = NULL;
13475 desret_xmlParserInputPtr(ret_val);
13476 call_tests++;
13477 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13478 des_xmlParserInputBufferPtr(n_input, input, 1);
13479 des_xmlCharEncoding(n_enc, enc, 2);
13480 xmlResetLastError();
13481 if (mem_base != xmlMemBlocks()) {
13482 printf("Leak of %d blocks found in xmlNewIOInputStream",
13483 xmlMemBlocks() - mem_base);
13484 test_ret++;
13485 printf(" %d", n_ctxt);
13486 printf(" %d", n_input);
13487 printf(" %d", n_enc);
13488 printf("\n");
13489 }
13490 }
13491 }
13492 }
13493
13494 function_tests++;
13495 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013496}
13497
13498
13499static int
13500test_xmlNewParserCtxt(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013501 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013502
Daniel Veillard34099b42004-11-04 17:34:35 +000013503 int mem_base;
13504 xmlParserCtxtPtr ret_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013505
Daniel Veillard34099b42004-11-04 17:34:35 +000013506 mem_base = xmlMemBlocks();
13507
13508 ret_val = xmlNewParserCtxt();
13509 desret_xmlParserCtxtPtr(ret_val);
13510 call_tests++;
13511 xmlResetLastError();
13512 if (mem_base != xmlMemBlocks()) {
13513 printf("Leak of %d blocks found in xmlNewParserCtxt",
13514 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000013515 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000013516 printf("\n");
13517 }
13518
13519 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000013520 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013521}
13522
13523
Daniel Veillardce682bc2004-11-05 17:22:25 +000013524#define gen_nb_xmlNodePtr_ptr 1
13525static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13526 return(NULL);
13527}
13528static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13529}
13530
Daniel Veillardd93f6252004-11-02 15:53:51 +000013531static int
13532test_xmlParseBalancedChunkMemory(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013533 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013534
Daniel Veillardce682bc2004-11-05 17:22:25 +000013535 int mem_base;
13536 int ret_val;
13537 xmlDocPtr doc; /* the document the chunk pertains to */
13538 int n_doc;
13539 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13540 int n_sax;
13541 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13542 int n_user_data;
13543 int depth; /* Used for loop detection, use 0 */
13544 int n_depth;
13545 xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13546 int n_string;
13547 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13548 int n_lst;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013549
Daniel Veillardce682bc2004-11-05 17:22:25 +000013550 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13551 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13552 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13553 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13554 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13555 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13556 mem_base = xmlMemBlocks();
13557 doc = gen_xmlDocPtr(n_doc, 0);
13558 sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13559 user_data = gen_userdata(n_user_data, 2);
13560 depth = gen_int(n_depth, 3);
13561 string = gen_const_xmlChar_ptr(n_string, 4);
13562 lst = gen_xmlNodePtr_ptr(n_lst, 5);
13563 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13564
13565 ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, string, lst);
13566 desret_int(ret_val);
13567 call_tests++;
13568 des_xmlDocPtr(n_doc, doc, 0);
13569 des_xmlSAXHandlerPtr(n_sax, sax, 1);
13570 des_userdata(n_user_data, user_data, 2);
13571 des_int(n_depth, depth, 3);
13572 des_const_xmlChar_ptr(n_string, string, 4);
13573 des_xmlNodePtr_ptr(n_lst, lst, 5);
13574 xmlResetLastError();
13575 if (mem_base != xmlMemBlocks()) {
13576 printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13577 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000013578 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000013579 printf(" %d", n_doc);
13580 printf(" %d", n_sax);
13581 printf(" %d", n_user_data);
13582 printf(" %d", n_depth);
13583 printf(" %d", n_string);
13584 printf(" %d", n_lst);
13585 printf("\n");
13586 }
13587 }
13588 }
13589 }
13590 }
13591 }
13592 }
13593
13594 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000013595 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013596}
13597
13598
13599static int
13600test_xmlParseBalancedChunkMemoryRecover(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013601 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013602
Daniel Veillardce682bc2004-11-05 17:22:25 +000013603 int mem_base;
13604 int ret_val;
13605 xmlDocPtr doc; /* the document the chunk pertains to */
13606 int n_doc;
13607 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13608 int n_sax;
13609 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13610 int n_user_data;
13611 int depth; /* Used for loop detection, use 0 */
13612 int n_depth;
13613 xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13614 int n_string;
13615 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13616 int n_lst;
13617 int recover; /* return nodes even if the data is broken (use 0) */
13618 int n_recover;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013619
Daniel Veillardce682bc2004-11-05 17:22:25 +000013620 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13621 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13622 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13623 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13624 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13625 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13626 for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13627 mem_base = xmlMemBlocks();
13628 doc = gen_xmlDocPtr(n_doc, 0);
13629 sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13630 user_data = gen_userdata(n_user_data, 2);
13631 depth = gen_int(n_depth, 3);
13632 string = gen_const_xmlChar_ptr(n_string, 4);
13633 lst = gen_xmlNodePtr_ptr(n_lst, 5);
13634 recover = gen_int(n_recover, 6);
13635 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13636
13637 ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, string, lst, recover);
13638 desret_int(ret_val);
13639 call_tests++;
13640 des_xmlDocPtr(n_doc, doc, 0);
13641 des_xmlSAXHandlerPtr(n_sax, sax, 1);
13642 des_userdata(n_user_data, user_data, 2);
13643 des_int(n_depth, depth, 3);
13644 des_const_xmlChar_ptr(n_string, string, 4);
13645 des_xmlNodePtr_ptr(n_lst, lst, 5);
13646 des_int(n_recover, recover, 6);
13647 xmlResetLastError();
13648 if (mem_base != xmlMemBlocks()) {
13649 printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13650 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000013651 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000013652 printf(" %d", n_doc);
13653 printf(" %d", n_sax);
13654 printf(" %d", n_user_data);
13655 printf(" %d", n_depth);
13656 printf(" %d", n_string);
13657 printf(" %d", n_lst);
13658 printf(" %d", n_recover);
13659 printf("\n");
13660 }
13661 }
13662 }
13663 }
13664 }
13665 }
13666 }
13667 }
13668
13669 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000013670 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013671}
13672
13673
13674static int
13675test_xmlParseChunk(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013676 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013677
13678#ifdef LIBXML_PUSH_ENABLED
13679 int mem_base;
13680 int ret_val;
13681 xmlParserCtxtPtr ctxt; /* an XML parser context */
13682 int n_ctxt;
Daniel Veillardce682bc2004-11-05 17:22:25 +000013683 char * chunk; /* an char array */
Daniel Veillardd93f6252004-11-02 15:53:51 +000013684 int n_chunk;
13685 int size; /* the size in byte of the chunk */
13686 int n_size;
13687 int terminate; /* last chunk indicator */
13688 int n_terminate;
13689
13690 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13691 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13692 for (n_size = 0;n_size < gen_nb_int;n_size++) {
13693 for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13694 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000013695 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13696 chunk = gen_const_char_ptr(n_chunk, 1);
13697 size = gen_int(n_size, 2);
13698 terminate = gen_int(n_terminate, 3);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013699
13700 ret_val = xmlParseChunk(ctxt, chunk, size, terminate);
13701 desret_int(ret_val);
13702 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000013703 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13704 des_const_char_ptr(n_chunk, chunk, 1);
13705 des_int(n_size, size, 2);
13706 des_int(n_terminate, terminate, 3);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013707 xmlResetLastError();
13708 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000013709 printf("Leak of %d blocks found in xmlParseChunk",
Daniel Veillardd93f6252004-11-02 15:53:51 +000013710 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000013711 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000013712 printf(" %d", n_ctxt);
13713 printf(" %d", n_chunk);
13714 printf(" %d", n_size);
13715 printf(" %d", n_terminate);
13716 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000013717 }
13718 }
13719 }
13720 }
13721 }
13722#endif
13723
Daniel Veillard3d97e662004-11-04 10:49:00 +000013724 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000013725 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013726}
13727
13728
13729static int
13730test_xmlParseCtxtExternalEntity(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013731 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013732
Daniel Veillardce682bc2004-11-05 17:22:25 +000013733 int mem_base;
13734 int ret_val;
13735 xmlParserCtxtPtr ctx; /* the existing parsing context */
13736 int n_ctx;
13737 xmlChar * URL; /* the URL for the entity to load */
13738 int n_URL;
13739 xmlChar * ID; /* the System ID for the entity to load */
13740 int n_ID;
13741 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13742 int n_lst;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013743
Daniel Veillardce682bc2004-11-05 17:22:25 +000013744 for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13745 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13746 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13747 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13748 mem_base = xmlMemBlocks();
13749 ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13750 URL = gen_const_xmlChar_ptr(n_URL, 1);
13751 ID = gen_const_xmlChar_ptr(n_ID, 2);
13752 lst = gen_xmlNodePtr_ptr(n_lst, 3);
13753
13754 ret_val = xmlParseCtxtExternalEntity(ctx, URL, ID, lst);
13755 desret_int(ret_val);
13756 call_tests++;
13757 des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13758 des_const_xmlChar_ptr(n_URL, URL, 1);
13759 des_const_xmlChar_ptr(n_ID, ID, 2);
13760 des_xmlNodePtr_ptr(n_lst, lst, 3);
13761 xmlResetLastError();
13762 if (mem_base != xmlMemBlocks()) {
13763 printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13764 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000013765 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000013766 printf(" %d", n_ctx);
13767 printf(" %d", n_URL);
13768 printf(" %d", n_ID);
13769 printf(" %d", n_lst);
13770 printf("\n");
13771 }
13772 }
13773 }
13774 }
13775 }
13776
13777 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000013778 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013779}
13780
13781
13782static int
13783test_xmlParseDTD(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013784 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013785
Daniel Veillard34099b42004-11-04 17:34:35 +000013786 int mem_base;
13787 xmlDtdPtr ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000013788 xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
Daniel Veillard34099b42004-11-04 17:34:35 +000013789 int n_ExternalID;
Daniel Veillardce682bc2004-11-05 17:22:25 +000013790 xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
Daniel Veillard34099b42004-11-04 17:34:35 +000013791 int n_SystemID;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013792
Daniel Veillard34099b42004-11-04 17:34:35 +000013793 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13794 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13795 mem_base = xmlMemBlocks();
13796 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13797 SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13798
13799 ret_val = xmlParseDTD(ExternalID, SystemID);
13800 desret_xmlDtdPtr(ret_val);
13801 call_tests++;
13802 des_const_xmlChar_ptr(n_ExternalID, ExternalID, 0);
13803 des_const_xmlChar_ptr(n_SystemID, SystemID, 1);
13804 xmlResetLastError();
13805 if (mem_base != xmlMemBlocks()) {
13806 printf("Leak of %d blocks found in xmlParseDTD",
13807 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000013808 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000013809 printf(" %d", n_ExternalID);
13810 printf(" %d", n_SystemID);
13811 printf("\n");
13812 }
13813 }
13814 }
13815
13816 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000013817 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013818}
13819
13820
13821static int
13822test_xmlParseDoc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013823 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013824
Daniel Veillard8a32fe42004-11-02 22:10:16 +000013825 int mem_base;
13826 xmlDocPtr ret_val;
13827 xmlChar * cur; /* a pointer to an array of xmlChar */
13828 int n_cur;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013829
Daniel Veillard8a32fe42004-11-02 22:10:16 +000013830 for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
13831 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000013832 cur = gen_xmlChar_ptr(n_cur, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000013833
13834 ret_val = xmlParseDoc(cur);
13835 desret_xmlDocPtr(ret_val);
13836 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000013837 des_xmlChar_ptr(n_cur, cur, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000013838 xmlResetLastError();
13839 if (mem_base != xmlMemBlocks()) {
13840 printf("Leak of %d blocks found in xmlParseDoc",
13841 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000013842 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000013843 printf(" %d", n_cur);
13844 printf("\n");
13845 }
13846 }
13847
Daniel Veillard3d97e662004-11-04 10:49:00 +000013848 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000013849 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013850}
13851
13852
13853static int
13854test_xmlParseDocument(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013855 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013856
13857 int mem_base;
13858 int ret_val;
13859 xmlParserCtxtPtr ctxt; /* an XML parser context */
13860 int n_ctxt;
13861
13862 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13863 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000013864 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013865
13866 ret_val = xmlParseDocument(ctxt);
13867 desret_int(ret_val);
13868 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000013869 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013870 xmlResetLastError();
13871 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000013872 printf("Leak of %d blocks found in xmlParseDocument",
Daniel Veillardd93f6252004-11-02 15:53:51 +000013873 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000013874 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000013875 printf(" %d", n_ctxt);
13876 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000013877 }
13878 }
13879
Daniel Veillard3d97e662004-11-04 10:49:00 +000013880 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000013881 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013882}
13883
13884
13885static int
13886test_xmlParseEntity(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013887 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013888
13889 int mem_base;
13890 xmlDocPtr ret_val;
13891 const char * filename; /* the filename */
13892 int n_filename;
13893
13894 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13895 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000013896 filename = gen_filepath(n_filename, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013897
13898 ret_val = xmlParseEntity(filename);
13899 desret_xmlDocPtr(ret_val);
13900 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000013901 des_filepath(n_filename, filename, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013902 xmlResetLastError();
13903 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000013904 printf("Leak of %d blocks found in xmlParseEntity",
Daniel Veillardd93f6252004-11-02 15:53:51 +000013905 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000013906 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000013907 printf(" %d", n_filename);
13908 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000013909 }
13910 }
13911
Daniel Veillard3d97e662004-11-04 10:49:00 +000013912 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000013913 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013914}
13915
13916
13917static int
13918test_xmlParseExtParsedEnt(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013919 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013920
13921 int mem_base;
13922 int ret_val;
13923 xmlParserCtxtPtr ctxt; /* an XML parser context */
13924 int n_ctxt;
13925
13926 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13927 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000013928 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013929
13930 ret_val = xmlParseExtParsedEnt(ctxt);
13931 desret_int(ret_val);
13932 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000013933 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013934 xmlResetLastError();
13935 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000013936 printf("Leak of %d blocks found in xmlParseExtParsedEnt",
Daniel Veillardd93f6252004-11-02 15:53:51 +000013937 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000013938 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000013939 printf(" %d", n_ctxt);
13940 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000013941 }
13942 }
13943
Daniel Veillard3d97e662004-11-04 10:49:00 +000013944 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000013945 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000013946}
13947
13948
13949static int
13950test_xmlParseExternalEntity(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000013951 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013952
Daniel Veillardce682bc2004-11-05 17:22:25 +000013953 int mem_base;
13954 int ret_val;
13955 xmlDocPtr doc; /* the document the chunk pertains to */
13956 int n_doc;
13957 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13958 int n_sax;
13959 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13960 int n_user_data;
13961 int depth; /* Used for loop detection, use 0 */
13962 int n_depth;
13963 xmlChar * URL; /* the URL for the entity to load */
13964 int n_URL;
13965 xmlChar * ID; /* the System ID for the entity to load */
13966 int n_ID;
13967 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13968 int n_lst;
Daniel Veillardd93f6252004-11-02 15:53:51 +000013969
Daniel Veillardce682bc2004-11-05 17:22:25 +000013970 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13971 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13972 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13973 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13974 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13975 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13976 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13977 mem_base = xmlMemBlocks();
13978 doc = gen_xmlDocPtr(n_doc, 0);
13979 sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13980 user_data = gen_userdata(n_user_data, 2);
13981 depth = gen_int(n_depth, 3);
13982 URL = gen_const_xmlChar_ptr(n_URL, 4);
13983 ID = gen_const_xmlChar_ptr(n_ID, 5);
13984 lst = gen_xmlNodePtr_ptr(n_lst, 6);
13985
13986 ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, URL, ID, lst);
13987 desret_int(ret_val);
13988 call_tests++;
13989 des_xmlDocPtr(n_doc, doc, 0);
13990 des_xmlSAXHandlerPtr(n_sax, sax, 1);
13991 des_userdata(n_user_data, user_data, 2);
13992 des_int(n_depth, depth, 3);
13993 des_const_xmlChar_ptr(n_URL, URL, 4);
13994 des_const_xmlChar_ptr(n_ID, ID, 5);
13995 des_xmlNodePtr_ptr(n_lst, lst, 6);
13996 xmlResetLastError();
13997 if (mem_base != xmlMemBlocks()) {
13998 printf("Leak of %d blocks found in xmlParseExternalEntity",
13999 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014000 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000014001 printf(" %d", n_doc);
14002 printf(" %d", n_sax);
14003 printf(" %d", n_user_data);
14004 printf(" %d", n_depth);
14005 printf(" %d", n_URL);
14006 printf(" %d", n_ID);
14007 printf(" %d", n_lst);
14008 printf("\n");
14009 }
14010 }
14011 }
14012 }
14013 }
14014 }
14015 }
14016 }
14017
14018 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014019 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014020}
14021
14022
14023static int
14024test_xmlParseFile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014025 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014026
14027 int mem_base;
14028 xmlDocPtr ret_val;
14029 const char * filename; /* the filename */
14030 int n_filename;
14031
14032 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14033 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000014034 filename = gen_filepath(n_filename, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014035
14036 ret_val = xmlParseFile(filename);
14037 desret_xmlDocPtr(ret_val);
14038 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000014039 des_filepath(n_filename, filename, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014040 xmlResetLastError();
14041 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000014042 printf("Leak of %d blocks found in xmlParseFile",
Daniel Veillardd93f6252004-11-02 15:53:51 +000014043 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014044 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000014045 printf(" %d", n_filename);
14046 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000014047 }
14048 }
14049
Daniel Veillard3d97e662004-11-04 10:49:00 +000014050 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014051 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014052}
14053
14054
14055static int
14056test_xmlParseInNodeContext(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014057 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014058
Daniel Veillard57b25162004-11-06 14:50:18 +000014059 int mem_base;
14060 xmlParserErrors ret_val;
14061 xmlNodePtr node; /* the context node */
14062 int n_node;
14063 char * data; /* the input string */
14064 int n_data;
14065 int datalen; /* the input string length in bytes */
14066 int n_datalen;
14067 int options; /* a combination of xmlParserOption */
14068 int n_options;
14069 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14070 int n_lst;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014071
Daniel Veillard57b25162004-11-06 14:50:18 +000014072 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
14073 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
14074 for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
Daniel Veillard6128c012004-11-08 17:16:15 +000014075 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
Daniel Veillard57b25162004-11-06 14:50:18 +000014076 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14077 mem_base = xmlMemBlocks();
14078 node = gen_xmlNodePtr(n_node, 0);
14079 data = gen_const_char_ptr(n_data, 1);
14080 datalen = gen_int(n_datalen, 2);
Daniel Veillard6128c012004-11-08 17:16:15 +000014081 options = gen_parseroptions(n_options, 3);
Daniel Veillard57b25162004-11-06 14:50:18 +000014082 lst = gen_xmlNodePtr_ptr(n_lst, 4);
14083
14084 ret_val = xmlParseInNodeContext(node, data, datalen, options, lst);
14085 desret_xmlParserErrors(ret_val);
14086 call_tests++;
14087 des_xmlNodePtr(n_node, node, 0);
14088 des_const_char_ptr(n_data, data, 1);
14089 des_int(n_datalen, datalen, 2);
Daniel Veillard6128c012004-11-08 17:16:15 +000014090 des_parseroptions(n_options, options, 3);
Daniel Veillard57b25162004-11-06 14:50:18 +000014091 des_xmlNodePtr_ptr(n_lst, lst, 4);
14092 xmlResetLastError();
14093 if (mem_base != xmlMemBlocks()) {
14094 printf("Leak of %d blocks found in xmlParseInNodeContext",
14095 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014096 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +000014097 printf(" %d", n_node);
14098 printf(" %d", n_data);
14099 printf(" %d", n_datalen);
14100 printf(" %d", n_options);
14101 printf(" %d", n_lst);
14102 printf("\n");
14103 }
14104 }
14105 }
14106 }
14107 }
14108 }
14109
14110 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014111 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014112}
14113
14114
14115static int
14116test_xmlParseMemory(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014117 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014118
14119 int mem_base;
14120 xmlDocPtr ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000014121 char * buffer; /* an pointer to a char array */
Daniel Veillardd93f6252004-11-02 15:53:51 +000014122 int n_buffer;
14123 int size; /* the size of the array */
14124 int n_size;
14125
14126 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14127 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14128 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000014129 buffer = gen_const_char_ptr(n_buffer, 0);
14130 size = gen_int(n_size, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014131
14132 ret_val = xmlParseMemory(buffer, size);
14133 desret_xmlDocPtr(ret_val);
14134 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000014135 des_const_char_ptr(n_buffer, buffer, 0);
14136 des_int(n_size, size, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014137 xmlResetLastError();
14138 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000014139 printf("Leak of %d blocks found in xmlParseMemory",
Daniel Veillardd93f6252004-11-02 15:53:51 +000014140 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014141 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000014142 printf(" %d", n_buffer);
14143 printf(" %d", n_size);
14144 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000014145 }
14146 }
14147 }
14148
Daniel Veillard3d97e662004-11-04 10:49:00 +000014149 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014150 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014151}
14152
14153
Daniel Veillardce682bc2004-11-05 17:22:25 +000014154#define gen_nb_const_xmlParserNodeInfoPtr 1
14155static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14156 return(NULL);
14157}
14158static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14159}
14160
Daniel Veillardd93f6252004-11-02 15:53:51 +000014161static int
14162test_xmlParserAddNodeInfo(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014163 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014164
Daniel Veillardce682bc2004-11-05 17:22:25 +000014165 int mem_base;
14166 xmlParserCtxtPtr ctxt; /* an XML parser context */
14167 int n_ctxt;
14168 xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14169 int n_info;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014170
Daniel Veillardce682bc2004-11-05 17:22:25 +000014171 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14172 for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14173 mem_base = xmlMemBlocks();
14174 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14175 info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14176
14177 xmlParserAddNodeInfo(ctxt, info);
14178 call_tests++;
14179 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14180 des_const_xmlParserNodeInfoPtr(n_info, info, 1);
14181 xmlResetLastError();
14182 if (mem_base != xmlMemBlocks()) {
14183 printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14184 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014185 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000014186 printf(" %d", n_ctxt);
14187 printf(" %d", n_info);
14188 printf("\n");
14189 }
14190 }
14191 }
14192
14193 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014194 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014195}
14196
14197
Daniel Veillardce682bc2004-11-05 17:22:25 +000014198#define gen_nb_const_xmlParserCtxtPtr 1
14199static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14200 return(NULL);
14201}
14202static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14203}
14204
Daniel Veillardd93f6252004-11-02 15:53:51 +000014205static int
14206test_xmlParserFindNodeInfo(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014207 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014208
14209
14210 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000014211 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014212}
14213
14214
Daniel Veillardce682bc2004-11-05 17:22:25 +000014215#define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14216static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14217 return(NULL);
14218}
14219static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14220}
14221
Daniel Veillardd93f6252004-11-02 15:53:51 +000014222static int
14223test_xmlParserFindNodeInfoIndex(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014224 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014225
14226
14227 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000014228 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014229}
14230
14231
Daniel Veillardce682bc2004-11-05 17:22:25 +000014232#define gen_nb_xmlParserInputPtr 1
14233static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14234 return(NULL);
14235}
14236static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14237}
14238
Daniel Veillardd93f6252004-11-02 15:53:51 +000014239static int
14240test_xmlParserInputGrow(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014241 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014242
Daniel Veillardce682bc2004-11-05 17:22:25 +000014243 int mem_base;
14244 int ret_val;
14245 xmlParserInputPtr in; /* an XML parser input */
14246 int n_in;
14247 int len; /* an indicative size for the lookahead */
14248 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014249
Daniel Veillardce682bc2004-11-05 17:22:25 +000014250 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14251 for (n_len = 0;n_len < gen_nb_int;n_len++) {
14252 mem_base = xmlMemBlocks();
14253 in = gen_xmlParserInputPtr(n_in, 0);
14254 len = gen_int(n_len, 1);
14255
14256 ret_val = xmlParserInputGrow(in, len);
14257 desret_int(ret_val);
14258 call_tests++;
14259 des_xmlParserInputPtr(n_in, in, 0);
14260 des_int(n_len, len, 1);
14261 xmlResetLastError();
14262 if (mem_base != xmlMemBlocks()) {
14263 printf("Leak of %d blocks found in xmlParserInputGrow",
14264 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014265 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000014266 printf(" %d", n_in);
14267 printf(" %d", n_len);
14268 printf("\n");
14269 }
14270 }
14271 }
14272
14273 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014274 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014275}
14276
14277
14278static int
14279test_xmlParserInputRead(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014280 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014281
Daniel Veillardce682bc2004-11-05 17:22:25 +000014282 int mem_base;
14283 int ret_val;
14284 xmlParserInputPtr in; /* an XML parser input */
14285 int n_in;
14286 int len; /* an indicative size for the lookahead */
14287 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014288
Daniel Veillardce682bc2004-11-05 17:22:25 +000014289 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14290 for (n_len = 0;n_len < gen_nb_int;n_len++) {
14291 mem_base = xmlMemBlocks();
14292 in = gen_xmlParserInputPtr(n_in, 0);
14293 len = gen_int(n_len, 1);
14294
14295 ret_val = xmlParserInputRead(in, len);
14296 desret_int(ret_val);
14297 call_tests++;
14298 des_xmlParserInputPtr(n_in, in, 0);
14299 des_int(n_len, len, 1);
14300 xmlResetLastError();
14301 if (mem_base != xmlMemBlocks()) {
14302 printf("Leak of %d blocks found in xmlParserInputRead",
14303 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014304 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000014305 printf(" %d", n_in);
14306 printf(" %d", n_len);
14307 printf("\n");
14308 }
14309 }
14310 }
14311
14312 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014313 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014314}
14315
14316
14317static int
14318test_xmlPedanticParserDefault(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014319 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014320
14321 int mem_base;
14322 int ret_val;
14323 int val; /* int 0 or 1 */
14324 int n_val;
14325
14326 for (n_val = 0;n_val < gen_nb_int;n_val++) {
14327 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000014328 val = gen_int(n_val, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014329
14330 ret_val = xmlPedanticParserDefault(val);
14331 desret_int(ret_val);
14332 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000014333 des_int(n_val, val, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014334 xmlResetLastError();
14335 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000014336 printf("Leak of %d blocks found in xmlPedanticParserDefault",
Daniel Veillardd93f6252004-11-02 15:53:51 +000014337 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014338 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000014339 printf(" %d", n_val);
14340 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000014341 }
14342 }
14343
Daniel Veillard3d97e662004-11-04 10:49:00 +000014344 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014345 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014346}
14347
14348
14349static int
14350test_xmlReadDoc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014351 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014352
14353 int mem_base;
14354 xmlDocPtr ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000014355 xmlChar * cur; /* a pointer to a zero terminated string */
Daniel Veillardd93f6252004-11-02 15:53:51 +000014356 int n_cur;
14357 const char * URL; /* the base URL to use for the document */
14358 int n_URL;
Daniel Veillardce682bc2004-11-05 17:22:25 +000014359 char * encoding; /* the document encoding, or NULL */
Daniel Veillardd93f6252004-11-02 15:53:51 +000014360 int n_encoding;
14361 int options; /* a combination of xmlParserOption */
14362 int n_options;
14363
14364 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14365 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14366 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
Daniel Veillard6128c012004-11-08 17:16:15 +000014367 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
Daniel Veillardd93f6252004-11-02 15:53:51 +000014368 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000014369 cur = gen_const_xmlChar_ptr(n_cur, 0);
14370 URL = gen_filepath(n_URL, 1);
14371 encoding = gen_const_char_ptr(n_encoding, 2);
Daniel Veillard6128c012004-11-08 17:16:15 +000014372 options = gen_parseroptions(n_options, 3);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014373
14374 ret_val = xmlReadDoc(cur, URL, encoding, options);
14375 desret_xmlDocPtr(ret_val);
14376 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000014377 des_const_xmlChar_ptr(n_cur, cur, 0);
14378 des_filepath(n_URL, URL, 1);
14379 des_const_char_ptr(n_encoding, encoding, 2);
Daniel Veillard6128c012004-11-08 17:16:15 +000014380 des_parseroptions(n_options, options, 3);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014381 xmlResetLastError();
14382 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000014383 printf("Leak of %d blocks found in xmlReadDoc",
Daniel Veillardd93f6252004-11-02 15:53:51 +000014384 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014385 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000014386 printf(" %d", n_cur);
14387 printf(" %d", n_URL);
14388 printf(" %d", n_encoding);
14389 printf(" %d", n_options);
14390 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000014391 }
14392 }
14393 }
14394 }
14395 }
14396
Daniel Veillard3d97e662004-11-04 10:49:00 +000014397 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014398 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014399}
14400
14401
14402static int
14403test_xmlReadFile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014404 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014405
14406 int mem_base;
14407 xmlDocPtr ret_val;
14408 const char * filename; /* a file or URL */
14409 int n_filename;
Daniel Veillardce682bc2004-11-05 17:22:25 +000014410 char * encoding; /* the document encoding, or NULL */
Daniel Veillardd93f6252004-11-02 15:53:51 +000014411 int n_encoding;
14412 int options; /* a combination of xmlParserOption */
14413 int n_options;
14414
14415 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14416 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
Daniel Veillard6128c012004-11-08 17:16:15 +000014417 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
Daniel Veillardd93f6252004-11-02 15:53:51 +000014418 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000014419 filename = gen_filepath(n_filename, 0);
14420 encoding = gen_const_char_ptr(n_encoding, 1);
Daniel Veillard6128c012004-11-08 17:16:15 +000014421 options = gen_parseroptions(n_options, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014422
14423 ret_val = xmlReadFile(filename, encoding, options);
14424 desret_xmlDocPtr(ret_val);
14425 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000014426 des_filepath(n_filename, filename, 0);
14427 des_const_char_ptr(n_encoding, encoding, 1);
Daniel Veillard6128c012004-11-08 17:16:15 +000014428 des_parseroptions(n_options, options, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014429 xmlResetLastError();
14430 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000014431 printf("Leak of %d blocks found in xmlReadFile",
Daniel Veillardd93f6252004-11-02 15:53:51 +000014432 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014433 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000014434 printf(" %d", n_filename);
14435 printf(" %d", n_encoding);
14436 printf(" %d", n_options);
14437 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000014438 }
14439 }
14440 }
14441 }
14442
Daniel Veillard3d97e662004-11-04 10:49:00 +000014443 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014444 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014445}
14446
14447
14448static int
Daniel Veillardd93f6252004-11-02 15:53:51 +000014449test_xmlReadMemory(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014450 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014451
14452 int mem_base;
14453 xmlDocPtr ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000014454 char * buffer; /* a pointer to a char array */
Daniel Veillardd93f6252004-11-02 15:53:51 +000014455 int n_buffer;
14456 int size; /* the size of the array */
14457 int n_size;
14458 const char * URL; /* the base URL to use for the document */
14459 int n_URL;
Daniel Veillardce682bc2004-11-05 17:22:25 +000014460 char * encoding; /* the document encoding, or NULL */
Daniel Veillardd93f6252004-11-02 15:53:51 +000014461 int n_encoding;
14462 int options; /* a combination of xmlParserOption */
14463 int n_options;
14464
14465 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14466 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14467 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14468 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
Daniel Veillard6128c012004-11-08 17:16:15 +000014469 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
Daniel Veillardd93f6252004-11-02 15:53:51 +000014470 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000014471 buffer = gen_const_char_ptr(n_buffer, 0);
14472 size = gen_int(n_size, 1);
14473 URL = gen_filepath(n_URL, 2);
14474 encoding = gen_const_char_ptr(n_encoding, 3);
Daniel Veillard6128c012004-11-08 17:16:15 +000014475 options = gen_parseroptions(n_options, 4);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014476
14477 ret_val = xmlReadMemory(buffer, size, URL, encoding, options);
14478 desret_xmlDocPtr(ret_val);
14479 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000014480 des_const_char_ptr(n_buffer, buffer, 0);
14481 des_int(n_size, size, 1);
14482 des_filepath(n_URL, URL, 2);
14483 des_const_char_ptr(n_encoding, encoding, 3);
Daniel Veillard6128c012004-11-08 17:16:15 +000014484 des_parseroptions(n_options, options, 4);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014485 xmlResetLastError();
14486 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000014487 printf("Leak of %d blocks found in xmlReadMemory",
Daniel Veillardd93f6252004-11-02 15:53:51 +000014488 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014489 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000014490 printf(" %d", n_buffer);
14491 printf(" %d", n_size);
14492 printf(" %d", n_URL);
14493 printf(" %d", n_encoding);
14494 printf(" %d", n_options);
14495 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000014496 }
14497 }
14498 }
14499 }
14500 }
14501 }
14502
Daniel Veillard3d97e662004-11-04 10:49:00 +000014503 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014504 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014505}
14506
14507
14508static int
14509test_xmlRecoverDoc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014510 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014511
Daniel Veillard8a32fe42004-11-02 22:10:16 +000014512 int mem_base;
14513 xmlDocPtr ret_val;
14514 xmlChar * cur; /* a pointer to an array of xmlChar */
14515 int n_cur;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014516
Daniel Veillard8a32fe42004-11-02 22:10:16 +000014517 for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
14518 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000014519 cur = gen_xmlChar_ptr(n_cur, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000014520
14521 ret_val = xmlRecoverDoc(cur);
14522 desret_xmlDocPtr(ret_val);
14523 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000014524 des_xmlChar_ptr(n_cur, cur, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000014525 xmlResetLastError();
14526 if (mem_base != xmlMemBlocks()) {
14527 printf("Leak of %d blocks found in xmlRecoverDoc",
14528 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014529 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000014530 printf(" %d", n_cur);
14531 printf("\n");
14532 }
14533 }
14534
Daniel Veillard3d97e662004-11-04 10:49:00 +000014535 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014536 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014537}
14538
14539
14540static int
14541test_xmlRecoverFile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014542 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014543
14544 int mem_base;
14545 xmlDocPtr ret_val;
14546 const char * filename; /* the filename */
14547 int n_filename;
14548
14549 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14550 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000014551 filename = gen_filepath(n_filename, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014552
14553 ret_val = xmlRecoverFile(filename);
14554 desret_xmlDocPtr(ret_val);
14555 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000014556 des_filepath(n_filename, filename, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014557 xmlResetLastError();
14558 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000014559 printf("Leak of %d blocks found in xmlRecoverFile",
Daniel Veillardd93f6252004-11-02 15:53:51 +000014560 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014561 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000014562 printf(" %d", n_filename);
14563 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000014564 }
14565 }
14566
Daniel Veillard3d97e662004-11-04 10:49:00 +000014567 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014568 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014569}
14570
14571
14572static int
14573test_xmlRecoverMemory(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014574 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014575
14576 int mem_base;
14577 xmlDocPtr ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000014578 char * buffer; /* an pointer to a char array */
Daniel Veillardd93f6252004-11-02 15:53:51 +000014579 int n_buffer;
14580 int size; /* the size of the array */
14581 int n_size;
14582
14583 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14584 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14585 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000014586 buffer = gen_const_char_ptr(n_buffer, 0);
14587 size = gen_int(n_size, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014588
14589 ret_val = xmlRecoverMemory(buffer, size);
14590 desret_xmlDocPtr(ret_val);
14591 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000014592 des_const_char_ptr(n_buffer, buffer, 0);
14593 des_int(n_size, size, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014594 xmlResetLastError();
14595 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000014596 printf("Leak of %d blocks found in xmlRecoverMemory",
Daniel Veillardd93f6252004-11-02 15:53:51 +000014597 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014598 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000014599 printf(" %d", n_buffer);
14600 printf(" %d", n_size);
14601 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000014602 }
14603 }
14604 }
14605
Daniel Veillard3d97e662004-11-04 10:49:00 +000014606 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014607 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014608}
14609
14610
14611static int
14612test_xmlSAXParseDTD(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014613 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014614
Daniel Veillard34099b42004-11-04 17:34:35 +000014615 int mem_base;
14616 xmlDtdPtr ret_val;
14617 xmlSAXHandlerPtr sax; /* the SAX handler block */
14618 int n_sax;
Daniel Veillardce682bc2004-11-05 17:22:25 +000014619 xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
Daniel Veillard34099b42004-11-04 17:34:35 +000014620 int n_ExternalID;
Daniel Veillardce682bc2004-11-05 17:22:25 +000014621 xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
Daniel Veillard34099b42004-11-04 17:34:35 +000014622 int n_SystemID;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014623
Daniel Veillard34099b42004-11-04 17:34:35 +000014624 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14625 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14626 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14627 mem_base = xmlMemBlocks();
14628 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14629 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14630 SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14631
14632 ret_val = xmlSAXParseDTD(sax, ExternalID, SystemID);
14633 desret_xmlDtdPtr(ret_val);
14634 call_tests++;
14635 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14636 des_const_xmlChar_ptr(n_ExternalID, ExternalID, 1);
14637 des_const_xmlChar_ptr(n_SystemID, SystemID, 2);
14638 xmlResetLastError();
14639 if (mem_base != xmlMemBlocks()) {
14640 printf("Leak of %d blocks found in xmlSAXParseDTD",
14641 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014642 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000014643 printf(" %d", n_sax);
14644 printf(" %d", n_ExternalID);
14645 printf(" %d", n_SystemID);
14646 printf("\n");
14647 }
14648 }
14649 }
14650 }
14651
14652 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014653 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014654}
14655
14656
14657static int
14658test_xmlSAXParseDoc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014659 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014660
Daniel Veillard34099b42004-11-04 17:34:35 +000014661 int mem_base;
14662 xmlDocPtr ret_val;
14663 xmlSAXHandlerPtr sax; /* the SAX handler block */
14664 int n_sax;
14665 xmlChar * cur; /* a pointer to an array of xmlChar */
14666 int n_cur;
14667 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14668 int n_recovery;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014669
Daniel Veillard34099b42004-11-04 17:34:35 +000014670 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14671 for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
14672 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14673 mem_base = xmlMemBlocks();
14674 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14675 cur = gen_xmlChar_ptr(n_cur, 1);
14676 recovery = gen_int(n_recovery, 2);
14677
14678 ret_val = xmlSAXParseDoc(sax, cur, recovery);
14679 desret_xmlDocPtr(ret_val);
14680 call_tests++;
14681 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14682 des_xmlChar_ptr(n_cur, cur, 1);
14683 des_int(n_recovery, recovery, 2);
14684 xmlResetLastError();
14685 if (mem_base != xmlMemBlocks()) {
14686 printf("Leak of %d blocks found in xmlSAXParseDoc",
14687 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014688 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000014689 printf(" %d", n_sax);
14690 printf(" %d", n_cur);
14691 printf(" %d", n_recovery);
14692 printf("\n");
14693 }
14694 }
14695 }
14696 }
14697
14698 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014699 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014700}
14701
14702
14703static int
14704test_xmlSAXParseEntity(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014705 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014706
Daniel Veillard34099b42004-11-04 17:34:35 +000014707 int mem_base;
14708 xmlDocPtr ret_val;
14709 xmlSAXHandlerPtr sax; /* the SAX handler block */
14710 int n_sax;
14711 const char * filename; /* the filename */
14712 int n_filename;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014713
Daniel Veillard34099b42004-11-04 17:34:35 +000014714 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14715 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14716 mem_base = xmlMemBlocks();
14717 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14718 filename = gen_filepath(n_filename, 1);
14719
14720 ret_val = xmlSAXParseEntity(sax, filename);
14721 desret_xmlDocPtr(ret_val);
14722 call_tests++;
14723 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14724 des_filepath(n_filename, filename, 1);
14725 xmlResetLastError();
14726 if (mem_base != xmlMemBlocks()) {
14727 printf("Leak of %d blocks found in xmlSAXParseEntity",
14728 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014729 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000014730 printf(" %d", n_sax);
14731 printf(" %d", n_filename);
14732 printf("\n");
14733 }
14734 }
14735 }
14736
14737 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014738 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014739}
14740
14741
14742static int
14743test_xmlSAXParseFile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014744 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014745
Daniel Veillard34099b42004-11-04 17:34:35 +000014746 int mem_base;
14747 xmlDocPtr ret_val;
14748 xmlSAXHandlerPtr sax; /* the SAX handler block */
14749 int n_sax;
14750 const char * filename; /* the filename */
14751 int n_filename;
14752 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14753 int n_recovery;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014754
Daniel Veillard34099b42004-11-04 17:34:35 +000014755 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14756 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14757 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14758 mem_base = xmlMemBlocks();
14759 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14760 filename = gen_filepath(n_filename, 1);
14761 recovery = gen_int(n_recovery, 2);
14762
14763 ret_val = xmlSAXParseFile(sax, filename, recovery);
14764 desret_xmlDocPtr(ret_val);
14765 call_tests++;
14766 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14767 des_filepath(n_filename, filename, 1);
14768 des_int(n_recovery, recovery, 2);
14769 xmlResetLastError();
14770 if (mem_base != xmlMemBlocks()) {
14771 printf("Leak of %d blocks found in xmlSAXParseFile",
14772 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014773 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000014774 printf(" %d", n_sax);
14775 printf(" %d", n_filename);
14776 printf(" %d", n_recovery);
14777 printf("\n");
14778 }
14779 }
14780 }
14781 }
14782
14783 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014784 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014785}
14786
14787
14788static int
14789test_xmlSAXParseFileWithData(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014790 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014791
Daniel Veillard34099b42004-11-04 17:34:35 +000014792 int mem_base;
14793 xmlDocPtr ret_val;
14794 xmlSAXHandlerPtr sax; /* the SAX handler block */
14795 int n_sax;
14796 const char * filename; /* the filename */
14797 int n_filename;
14798 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14799 int n_recovery;
14800 void * data; /* the userdata */
14801 int n_data;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014802
Daniel Veillard34099b42004-11-04 17:34:35 +000014803 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14804 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14805 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14806 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14807 mem_base = xmlMemBlocks();
14808 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14809 filename = gen_filepath(n_filename, 1);
14810 recovery = gen_int(n_recovery, 2);
14811 data = gen_userdata(n_data, 3);
14812
14813 ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
14814 desret_xmlDocPtr(ret_val);
14815 call_tests++;
14816 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14817 des_filepath(n_filename, filename, 1);
14818 des_int(n_recovery, recovery, 2);
14819 des_userdata(n_data, data, 3);
14820 xmlResetLastError();
14821 if (mem_base != xmlMemBlocks()) {
14822 printf("Leak of %d blocks found in xmlSAXParseFileWithData",
14823 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014824 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000014825 printf(" %d", n_sax);
14826 printf(" %d", n_filename);
14827 printf(" %d", n_recovery);
14828 printf(" %d", n_data);
14829 printf("\n");
14830 }
14831 }
14832 }
14833 }
14834 }
14835
14836 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014837 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014838}
14839
14840
14841static int
14842test_xmlSAXParseMemory(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014843 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014844
Daniel Veillard34099b42004-11-04 17:34:35 +000014845 int mem_base;
14846 xmlDocPtr ret_val;
14847 xmlSAXHandlerPtr sax; /* the SAX handler block */
14848 int n_sax;
Daniel Veillardce682bc2004-11-05 17:22:25 +000014849 char * buffer; /* an pointer to a char array */
Daniel Veillard34099b42004-11-04 17:34:35 +000014850 int n_buffer;
14851 int size; /* the size of the array */
14852 int n_size;
14853 int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
14854 int n_recovery;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014855
Daniel Veillard34099b42004-11-04 17:34:35 +000014856 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14857 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14858 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14859 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14860 mem_base = xmlMemBlocks();
14861 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14862 buffer = gen_const_char_ptr(n_buffer, 1);
14863 size = gen_int(n_size, 2);
14864 recovery = gen_int(n_recovery, 3);
14865
14866 ret_val = xmlSAXParseMemory(sax, buffer, size, recovery);
14867 desret_xmlDocPtr(ret_val);
14868 call_tests++;
14869 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14870 des_const_char_ptr(n_buffer, buffer, 1);
14871 des_int(n_size, size, 2);
14872 des_int(n_recovery, recovery, 3);
14873 xmlResetLastError();
14874 if (mem_base != xmlMemBlocks()) {
14875 printf("Leak of %d blocks found in xmlSAXParseMemory",
14876 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014877 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000014878 printf(" %d", n_sax);
14879 printf(" %d", n_buffer);
14880 printf(" %d", n_size);
14881 printf(" %d", n_recovery);
14882 printf("\n");
14883 }
14884 }
14885 }
14886 }
14887 }
14888
14889 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014890 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014891}
14892
14893
14894static int
14895test_xmlSAXParseMemoryWithData(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014896 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014897
Daniel Veillard34099b42004-11-04 17:34:35 +000014898 int mem_base;
14899 xmlDocPtr ret_val;
14900 xmlSAXHandlerPtr sax; /* the SAX handler block */
14901 int n_sax;
Daniel Veillardce682bc2004-11-05 17:22:25 +000014902 char * buffer; /* an pointer to a char array */
Daniel Veillard34099b42004-11-04 17:34:35 +000014903 int n_buffer;
14904 int size; /* the size of the array */
14905 int n_size;
14906 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14907 int n_recovery;
14908 void * data; /* the userdata */
14909 int n_data;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014910
Daniel Veillard34099b42004-11-04 17:34:35 +000014911 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14912 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14913 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14914 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14915 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14916 mem_base = xmlMemBlocks();
14917 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14918 buffer = gen_const_char_ptr(n_buffer, 1);
14919 size = gen_int(n_size, 2);
14920 recovery = gen_int(n_recovery, 3);
14921 data = gen_userdata(n_data, 4);
14922
14923 ret_val = xmlSAXParseMemoryWithData(sax, buffer, size, recovery, data);
14924 desret_xmlDocPtr(ret_val);
14925 call_tests++;
14926 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14927 des_const_char_ptr(n_buffer, buffer, 1);
14928 des_int(n_size, size, 2);
14929 des_int(n_recovery, recovery, 3);
14930 des_userdata(n_data, data, 4);
14931 xmlResetLastError();
14932 if (mem_base != xmlMemBlocks()) {
14933 printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
14934 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014935 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000014936 printf(" %d", n_sax);
14937 printf(" %d", n_buffer);
14938 printf(" %d", n_size);
14939 printf(" %d", n_recovery);
14940 printf(" %d", n_data);
14941 printf("\n");
14942 }
14943 }
14944 }
14945 }
14946 }
14947 }
14948
14949 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014950 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014951}
14952
14953
14954static int
14955test_xmlSAXUserParseFile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000014956 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014957
Daniel Veillard34099b42004-11-04 17:34:35 +000014958 int mem_base;
14959 int ret_val;
14960 xmlSAXHandlerPtr sax; /* a SAX handler */
14961 int n_sax;
14962 void * user_data; /* The user data returned on SAX callbacks */
14963 int n_user_data;
14964 const char * filename; /* a file name */
14965 int n_filename;
Daniel Veillardd93f6252004-11-02 15:53:51 +000014966
Daniel Veillard34099b42004-11-04 17:34:35 +000014967 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14968 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
14969 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14970 mem_base = xmlMemBlocks();
14971 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14972 user_data = gen_userdata(n_user_data, 1);
14973 filename = gen_filepath(n_filename, 2);
Daniel Veillardce244ad2004-11-05 10:03:46 +000014974 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
Daniel Veillard34099b42004-11-04 17:34:35 +000014975
14976 ret_val = xmlSAXUserParseFile(sax, user_data, filename);
14977 desret_int(ret_val);
14978 call_tests++;
14979 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14980 des_userdata(n_user_data, user_data, 1);
14981 des_filepath(n_filename, filename, 2);
14982 xmlResetLastError();
14983 if (mem_base != xmlMemBlocks()) {
14984 printf("Leak of %d blocks found in xmlSAXUserParseFile",
14985 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000014986 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000014987 printf(" %d", n_sax);
14988 printf(" %d", n_user_data);
14989 printf(" %d", n_filename);
14990 printf("\n");
14991 }
14992 }
14993 }
14994 }
14995
14996 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000014997 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000014998}
14999
15000
15001static int
15002test_xmlSAXUserParseMemory(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000015003 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000015004
Daniel Veillard34099b42004-11-04 17:34:35 +000015005 int mem_base;
15006 int ret_val;
15007 xmlSAXHandlerPtr sax; /* a SAX handler */
15008 int n_sax;
15009 void * user_data; /* The user data returned on SAX callbacks */
15010 int n_user_data;
Daniel Veillardce682bc2004-11-05 17:22:25 +000015011 char * buffer; /* an in-memory XML document input */
Daniel Veillard34099b42004-11-04 17:34:35 +000015012 int n_buffer;
15013 int size; /* the length of the XML document in bytes */
15014 int n_size;
Daniel Veillardd93f6252004-11-02 15:53:51 +000015015
Daniel Veillard34099b42004-11-04 17:34:35 +000015016 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15017 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15018 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15019 for (n_size = 0;n_size < gen_nb_int;n_size++) {
15020 mem_base = xmlMemBlocks();
15021 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15022 user_data = gen_userdata(n_user_data, 1);
15023 buffer = gen_const_char_ptr(n_buffer, 2);
15024 size = gen_int(n_size, 3);
Daniel Veillardce244ad2004-11-05 10:03:46 +000015025 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
Daniel Veillard34099b42004-11-04 17:34:35 +000015026
15027 ret_val = xmlSAXUserParseMemory(sax, user_data, buffer, size);
15028 desret_int(ret_val);
15029 call_tests++;
15030 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15031 des_userdata(n_user_data, user_data, 1);
15032 des_const_char_ptr(n_buffer, buffer, 2);
15033 des_int(n_size, size, 3);
15034 xmlResetLastError();
15035 if (mem_base != xmlMemBlocks()) {
15036 printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15037 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000015038 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000015039 printf(" %d", n_sax);
15040 printf(" %d", n_user_data);
15041 printf(" %d", n_buffer);
15042 printf(" %d", n_size);
15043 printf("\n");
15044 }
15045 }
15046 }
15047 }
15048 }
15049
15050 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000015051 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000015052}
15053
15054
15055static int
15056test_xmlSetExternalEntityLoader(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000015057 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000015058
15059
15060 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000015061 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000015062}
15063
15064
15065static int
15066test_xmlSetFeature(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000015067 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000015068
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000015069 int mem_base;
15070 int ret_val;
15071 xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15072 int n_ctxt;
Daniel Veillardce682bc2004-11-05 17:22:25 +000015073 char * name; /* the feature name */
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000015074 int n_name;
15075 void * value; /* pointer to the location of the new value */
15076 int n_value;
Daniel Veillardd93f6252004-11-02 15:53:51 +000015077
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000015078 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15079 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15080 for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15081 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000015082 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15083 name = gen_const_char_ptr(n_name, 1);
15084 value = gen_void_ptr(n_value, 2);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000015085
15086 ret_val = xmlSetFeature(ctxt, name, value);
15087 desret_int(ret_val);
15088 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000015089 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15090 des_const_char_ptr(n_name, name, 1);
15091 des_void_ptr(n_value, value, 2);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000015092 xmlResetLastError();
15093 if (mem_base != xmlMemBlocks()) {
15094 printf("Leak of %d blocks found in xmlSetFeature",
15095 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000015096 test_ret++;
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000015097 printf(" %d", n_ctxt);
15098 printf(" %d", n_name);
15099 printf(" %d", n_value);
15100 printf("\n");
15101 }
15102 }
15103 }
15104 }
15105
Daniel Veillard3d97e662004-11-04 10:49:00 +000015106 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000015107 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000015108}
15109
15110
15111static int
15112test_xmlSetupParserForBuffer(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000015113 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000015114
15115 int mem_base;
15116 xmlParserCtxtPtr ctxt; /* an XML parser context */
15117 int n_ctxt;
Daniel Veillardce682bc2004-11-05 17:22:25 +000015118 xmlChar * buffer; /* a xmlChar * buffer */
Daniel Veillardd93f6252004-11-02 15:53:51 +000015119 int n_buffer;
15120 const char * filename; /* a file name */
15121 int n_filename;
15122
15123 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15124 for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15125 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15126 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000015127 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15128 buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15129 filename = gen_filepath(n_filename, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000015130
15131 xmlSetupParserForBuffer(ctxt, buffer, filename);
15132 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000015133 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15134 des_const_xmlChar_ptr(n_buffer, buffer, 1);
15135 des_filepath(n_filename, filename, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000015136 xmlResetLastError();
15137 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000015138 printf("Leak of %d blocks found in xmlSetupParserForBuffer",
Daniel Veillardd93f6252004-11-02 15:53:51 +000015139 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000015140 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000015141 printf(" %d", n_ctxt);
15142 printf(" %d", n_buffer);
15143 printf(" %d", n_filename);
15144 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000015145 }
15146 }
15147 }
15148 }
15149
Daniel Veillard3d97e662004-11-04 10:49:00 +000015150 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000015151 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000015152}
15153
15154
15155static int
15156test_xmlStopParser(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000015157 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000015158
15159 int mem_base;
15160 xmlParserCtxtPtr ctxt; /* an XML parser context */
15161 int n_ctxt;
15162
15163 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15164 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000015165 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000015166
15167 xmlStopParser(ctxt);
15168 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000015169 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000015170 xmlResetLastError();
15171 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000015172 printf("Leak of %d blocks found in xmlStopParser",
Daniel Veillardd93f6252004-11-02 15:53:51 +000015173 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000015174 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000015175 printf(" %d", n_ctxt);
15176 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000015177 }
15178 }
15179
Daniel Veillard3d97e662004-11-04 10:49:00 +000015180 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000015181 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000015182}
15183
15184
15185static int
15186test_xmlSubstituteEntitiesDefault(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000015187 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000015188
15189 int mem_base;
15190 int ret_val;
15191 int val; /* int 0 or 1 */
15192 int n_val;
15193
15194 for (n_val = 0;n_val < gen_nb_int;n_val++) {
15195 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000015196 val = gen_int(n_val, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000015197
15198 ret_val = xmlSubstituteEntitiesDefault(val);
15199 desret_int(ret_val);
15200 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000015201 des_int(n_val, val, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000015202 xmlResetLastError();
15203 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000015204 printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
Daniel Veillardd93f6252004-11-02 15:53:51 +000015205 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000015206 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000015207 printf(" %d", n_val);
15208 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000015209 }
15210 }
15211
Daniel Veillard3d97e662004-11-04 10:49:00 +000015212 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000015213 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000015214}
15215
15216static int
15217test_parser(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000015218 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000015219
Daniel Veillard42595322004-11-08 10:52:06 +000015220 printf("Testing parser : 58 of 69 functions ...\n");
15221 test_ret += test_xmlByteConsumed();
15222 test_ret += test_xmlClearNodeInfoSeq();
15223 test_ret += test_xmlClearParserCtxt();
15224 test_ret += test_xmlCreateDocParserCtxt();
15225 test_ret += test_xmlCreatePushParserCtxt();
15226 test_ret += test_xmlCtxtReadDoc();
15227 test_ret += test_xmlCtxtReadFile();
15228 test_ret += test_xmlCtxtReadMemory();
15229 test_ret += test_xmlCtxtReset();
15230 test_ret += test_xmlCtxtResetPush();
15231 test_ret += test_xmlCtxtUseOptions();
15232 test_ret += test_xmlGetExternalEntityLoader();
15233 test_ret += test_xmlGetFeature();
15234 test_ret += test_xmlGetFeaturesList();
15235 test_ret += test_xmlIOParseDTD();
15236 test_ret += test_xmlInitNodeInfoSeq();
15237 test_ret += test_xmlInitParser();
15238 test_ret += test_xmlInitParserCtxt();
15239 test_ret += test_xmlKeepBlanksDefault();
15240 test_ret += test_xmlLineNumbersDefault();
15241 test_ret += test_xmlLoadExternalEntity();
15242 test_ret += test_xmlNewIOInputStream();
15243 test_ret += test_xmlNewParserCtxt();
15244 test_ret += test_xmlParseBalancedChunkMemory();
15245 test_ret += test_xmlParseBalancedChunkMemoryRecover();
15246 test_ret += test_xmlParseChunk();
15247 test_ret += test_xmlParseCtxtExternalEntity();
15248 test_ret += test_xmlParseDTD();
15249 test_ret += test_xmlParseDoc();
15250 test_ret += test_xmlParseDocument();
15251 test_ret += test_xmlParseEntity();
15252 test_ret += test_xmlParseExtParsedEnt();
15253 test_ret += test_xmlParseExternalEntity();
15254 test_ret += test_xmlParseFile();
15255 test_ret += test_xmlParseInNodeContext();
15256 test_ret += test_xmlParseMemory();
15257 test_ret += test_xmlParserAddNodeInfo();
15258 test_ret += test_xmlParserFindNodeInfo();
15259 test_ret += test_xmlParserFindNodeInfoIndex();
15260 test_ret += test_xmlParserInputGrow();
15261 test_ret += test_xmlParserInputRead();
15262 test_ret += test_xmlPedanticParserDefault();
15263 test_ret += test_xmlReadDoc();
15264 test_ret += test_xmlReadFile();
15265 test_ret += test_xmlReadMemory();
15266 test_ret += test_xmlRecoverDoc();
15267 test_ret += test_xmlRecoverFile();
15268 test_ret += test_xmlRecoverMemory();
15269 test_ret += test_xmlSAXParseDTD();
15270 test_ret += test_xmlSAXParseDoc();
15271 test_ret += test_xmlSAXParseEntity();
15272 test_ret += test_xmlSAXParseFile();
15273 test_ret += test_xmlSAXParseFileWithData();
15274 test_ret += test_xmlSAXParseMemory();
15275 test_ret += test_xmlSAXParseMemoryWithData();
15276 test_ret += test_xmlSAXUserParseFile();
15277 test_ret += test_xmlSAXUserParseMemory();
15278 test_ret += test_xmlSetExternalEntityLoader();
15279 test_ret += test_xmlSetFeature();
15280 test_ret += test_xmlSetupParserForBuffer();
15281 test_ret += test_xmlStopParser();
15282 test_ret += test_xmlSubstituteEntitiesDefault();
Daniel Veillardd93f6252004-11-02 15:53:51 +000015283
Daniel Veillard42595322004-11-08 10:52:06 +000015284 if (test_ret != 0)
15285 printf("Module parser: %d errors\n", test_ret);
15286 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000015287}
15288
Daniel Veillard2a4fb5a2004-11-08 14:02:18 +000015289static int
15290test_htmlCreateFileParserCtxt(void) {
15291 int test_ret = 0;
15292
15293#ifdef LIBXML_HTML_ENABLED
15294 int mem_base;
15295 htmlParserCtxtPtr ret_val;
15296 const char * filename; /* the filename */
15297 int n_filename;
15298 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15299 int n_encoding;
15300
15301 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15302 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15303 mem_base = xmlMemBlocks();
15304 filename = gen_fileoutput(n_filename, 0);
15305 encoding = gen_const_char_ptr(n_encoding, 1);
15306
15307 ret_val = htmlCreateFileParserCtxt(filename, encoding);
15308 desret_xmlParserCtxtPtr(ret_val);
15309 call_tests++;
15310 des_fileoutput(n_filename, filename, 0);
15311 des_const_char_ptr(n_encoding, encoding, 1);
15312 xmlResetLastError();
15313 if (mem_base != xmlMemBlocks()) {
15314 printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15315 xmlMemBlocks() - mem_base);
15316 test_ret++;
15317 printf(" %d", n_filename);
15318 printf(" %d", n_encoding);
15319 printf("\n");
15320 }
15321 }
15322 }
15323#endif
15324
15325 function_tests++;
15326 return(test_ret);
15327}
15328
15329
15330static int
15331test_htmlInitAutoClose(void) {
15332 int test_ret = 0;
15333
15334#ifdef LIBXML_HTML_ENABLED
15335 int mem_base;
15336
15337 mem_base = xmlMemBlocks();
15338
15339 htmlInitAutoClose();
15340 call_tests++;
15341 xmlResetLastError();
15342 if (mem_base != xmlMemBlocks()) {
15343 printf("Leak of %d blocks found in htmlInitAutoClose",
15344 xmlMemBlocks() - mem_base);
15345 test_ret++;
15346 printf("\n");
15347 }
15348#endif
15349
15350 function_tests++;
15351 return(test_ret);
15352}
15353
15354
15355static int
15356test_inputPop(void) {
15357 int test_ret = 0;
15358
15359 int mem_base;
15360 xmlParserInputPtr ret_val;
15361 xmlParserCtxtPtr ctxt; /* an XML parser context */
15362 int n_ctxt;
15363
15364 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15365 mem_base = xmlMemBlocks();
15366 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15367
15368 ret_val = inputPop(ctxt);
15369 desret_xmlParserInputPtr(ret_val);
15370 call_tests++;
15371 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15372 xmlResetLastError();
15373 if (mem_base != xmlMemBlocks()) {
15374 printf("Leak of %d blocks found in inputPop",
15375 xmlMemBlocks() - mem_base);
15376 test_ret++;
15377 printf(" %d", n_ctxt);
15378 printf("\n");
15379 }
15380 }
15381
15382 function_tests++;
15383 return(test_ret);
15384}
15385
15386
15387static int
15388test_inputPush(void) {
15389 int test_ret = 0;
15390
15391 int mem_base;
15392 int ret_val;
15393 xmlParserCtxtPtr ctxt; /* an XML parser context */
15394 int n_ctxt;
15395 xmlParserInputPtr value; /* the parser input */
15396 int n_value;
15397
15398 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15399 for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15400 mem_base = xmlMemBlocks();
15401 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15402 value = gen_xmlParserInputPtr(n_value, 1);
15403
15404 ret_val = inputPush(ctxt, value);
15405 desret_int(ret_val);
15406 call_tests++;
15407 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15408 des_xmlParserInputPtr(n_value, value, 1);
15409 xmlResetLastError();
15410 if (mem_base != xmlMemBlocks()) {
15411 printf("Leak of %d blocks found in inputPush",
15412 xmlMemBlocks() - mem_base);
15413 test_ret++;
15414 printf(" %d", n_ctxt);
15415 printf(" %d", n_value);
15416 printf("\n");
15417 }
15418 }
15419 }
15420
15421 function_tests++;
15422 return(test_ret);
15423}
15424
15425
15426static int
15427test_namePop(void) {
15428 int test_ret = 0;
15429
15430 int mem_base;
15431 const xmlChar * ret_val;
15432 xmlParserCtxtPtr ctxt; /* an XML parser context */
15433 int n_ctxt;
15434
15435 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15436 mem_base = xmlMemBlocks();
15437 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15438
15439 ret_val = namePop(ctxt);
15440 desret_const_xmlChar_ptr(ret_val);
15441 call_tests++;
15442 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15443 xmlResetLastError();
15444 if (mem_base != xmlMemBlocks()) {
15445 printf("Leak of %d blocks found in namePop",
15446 xmlMemBlocks() - mem_base);
15447 test_ret++;
15448 printf(" %d", n_ctxt);
15449 printf("\n");
15450 }
15451 }
15452
15453 function_tests++;
15454 return(test_ret);
15455}
15456
15457
15458static int
15459test_namePush(void) {
15460 int test_ret = 0;
15461
15462 int mem_base;
15463 int ret_val;
15464 xmlParserCtxtPtr ctxt; /* an XML parser context */
15465 int n_ctxt;
15466 xmlChar * value; /* the element name */
15467 int n_value;
15468
15469 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15470 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15471 mem_base = xmlMemBlocks();
15472 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15473 value = gen_const_xmlChar_ptr(n_value, 1);
15474
15475 ret_val = namePush(ctxt, value);
15476 desret_int(ret_val);
15477 call_tests++;
15478 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15479 des_const_xmlChar_ptr(n_value, value, 1);
15480 xmlResetLastError();
15481 if (mem_base != xmlMemBlocks()) {
15482 printf("Leak of %d blocks found in namePush",
15483 xmlMemBlocks() - mem_base);
15484 test_ret++;
15485 printf(" %d", n_ctxt);
15486 printf(" %d", n_value);
15487 printf("\n");
15488 }
15489 }
15490 }
15491
15492 function_tests++;
15493 return(test_ret);
15494}
15495
15496
15497static int
15498test_nodePop(void) {
15499 int test_ret = 0;
15500
15501 int mem_base;
15502 xmlNodePtr ret_val;
15503 xmlParserCtxtPtr ctxt; /* an XML parser context */
15504 int n_ctxt;
15505
15506 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15507 mem_base = xmlMemBlocks();
15508 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15509
15510 ret_val = nodePop(ctxt);
15511 desret_xmlNodePtr(ret_val);
15512 call_tests++;
15513 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15514 xmlResetLastError();
15515 if (mem_base != xmlMemBlocks()) {
15516 printf("Leak of %d blocks found in nodePop",
15517 xmlMemBlocks() - mem_base);
15518 test_ret++;
15519 printf(" %d", n_ctxt);
15520 printf("\n");
15521 }
15522 }
15523
15524 function_tests++;
15525 return(test_ret);
15526}
15527
15528
15529static int
15530test_nodePush(void) {
15531 int test_ret = 0;
15532
15533 int mem_base;
15534 int ret_val;
15535 xmlParserCtxtPtr ctxt; /* an XML parser context */
15536 int n_ctxt;
15537 xmlNodePtr value; /* the element node */
15538 int n_value;
15539
15540 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15541 for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15542 mem_base = xmlMemBlocks();
15543 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15544 value = gen_xmlNodePtr(n_value, 1);
15545
15546 ret_val = nodePush(ctxt, value);
15547 desret_int(ret_val);
15548 call_tests++;
15549 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15550 des_xmlNodePtr(n_value, value, 1);
15551 xmlResetLastError();
15552 if (mem_base != xmlMemBlocks()) {
15553 printf("Leak of %d blocks found in nodePush",
15554 xmlMemBlocks() - mem_base);
15555 test_ret++;
15556 printf(" %d", n_ctxt);
15557 printf(" %d", n_value);
15558 printf("\n");
15559 }
15560 }
15561 }
15562
15563 function_tests++;
15564 return(test_ret);
15565}
15566
15567
15568static int
15569test_xmlCheckLanguageID(void) {
15570 int test_ret = 0;
15571
15572 int mem_base;
15573 int ret_val;
15574 xmlChar * lang; /* pointer to the string value */
15575 int n_lang;
15576
15577 for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15578 mem_base = xmlMemBlocks();
15579 lang = gen_const_xmlChar_ptr(n_lang, 0);
15580
15581 ret_val = xmlCheckLanguageID(lang);
15582 desret_int(ret_val);
15583 call_tests++;
15584 des_const_xmlChar_ptr(n_lang, lang, 0);
15585 xmlResetLastError();
15586 if (mem_base != xmlMemBlocks()) {
15587 printf("Leak of %d blocks found in xmlCheckLanguageID",
15588 xmlMemBlocks() - mem_base);
15589 test_ret++;
15590 printf(" %d", n_lang);
15591 printf("\n");
15592 }
15593 }
15594
15595 function_tests++;
15596 return(test_ret);
15597}
15598
15599
15600static int
15601test_xmlCopyChar(void) {
15602 int test_ret = 0;
15603
15604 int mem_base;
15605 int ret_val;
15606 int len; /* Ignored, compatibility */
15607 int n_len;
15608 xmlChar * out; /* pointer to an array of xmlChar */
15609 int n_out;
15610 int val; /* the char value */
15611 int n_val;
15612
15613 for (n_len = 0;n_len < gen_nb_int;n_len++) {
15614 for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15615 for (n_val = 0;n_val < gen_nb_int;n_val++) {
15616 mem_base = xmlMemBlocks();
15617 len = gen_int(n_len, 0);
15618 out = gen_xmlChar_ptr(n_out, 1);
15619 val = gen_int(n_val, 2);
15620
15621 ret_val = xmlCopyChar(len, out, val);
15622 desret_int(ret_val);
15623 call_tests++;
15624 des_int(n_len, len, 0);
15625 des_xmlChar_ptr(n_out, out, 1);
15626 des_int(n_val, val, 2);
15627 xmlResetLastError();
15628 if (mem_base != xmlMemBlocks()) {
15629 printf("Leak of %d blocks found in xmlCopyChar",
15630 xmlMemBlocks() - mem_base);
15631 test_ret++;
15632 printf(" %d", n_len);
15633 printf(" %d", n_out);
15634 printf(" %d", n_val);
15635 printf("\n");
15636 }
15637 }
15638 }
15639 }
15640
15641 function_tests++;
15642 return(test_ret);
15643}
15644
15645
15646static int
15647test_xmlCopyCharMultiByte(void) {
15648 int test_ret = 0;
15649
15650 int mem_base;
15651 int ret_val;
15652 xmlChar * out; /* pointer to an array of xmlChar */
15653 int n_out;
15654 int val; /* the char value */
15655 int n_val;
15656
15657 for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15658 for (n_val = 0;n_val < gen_nb_int;n_val++) {
15659 mem_base = xmlMemBlocks();
15660 out = gen_xmlChar_ptr(n_out, 0);
15661 val = gen_int(n_val, 1);
15662
15663 ret_val = xmlCopyCharMultiByte(out, val);
15664 desret_int(ret_val);
15665 call_tests++;
15666 des_xmlChar_ptr(n_out, out, 0);
15667 des_int(n_val, val, 1);
15668 xmlResetLastError();
15669 if (mem_base != xmlMemBlocks()) {
15670 printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15671 xmlMemBlocks() - mem_base);
15672 test_ret++;
15673 printf(" %d", n_out);
15674 printf(" %d", n_val);
15675 printf("\n");
15676 }
15677 }
15678 }
15679
15680 function_tests++;
15681 return(test_ret);
15682}
15683
15684
15685static int
15686test_xmlCreateEntityParserCtxt(void) {
15687 int test_ret = 0;
15688
15689 int mem_base;
15690 xmlParserCtxtPtr ret_val;
15691 xmlChar * URL; /* the entity URL */
15692 int n_URL;
15693 xmlChar * ID; /* the entity PUBLIC ID */
15694 int n_ID;
15695 xmlChar * base; /* a possible base for the target URI */
15696 int n_base;
15697
15698 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15699 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15700 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15701 mem_base = xmlMemBlocks();
15702 URL = gen_const_xmlChar_ptr(n_URL, 0);
15703 ID = gen_const_xmlChar_ptr(n_ID, 1);
15704 base = gen_const_xmlChar_ptr(n_base, 2);
15705
15706 ret_val = xmlCreateEntityParserCtxt(URL, ID, base);
15707 desret_xmlParserCtxtPtr(ret_val);
15708 call_tests++;
15709 des_const_xmlChar_ptr(n_URL, URL, 0);
15710 des_const_xmlChar_ptr(n_ID, ID, 1);
15711 des_const_xmlChar_ptr(n_base, base, 2);
15712 xmlResetLastError();
15713 if (mem_base != xmlMemBlocks()) {
15714 printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15715 xmlMemBlocks() - mem_base);
15716 test_ret++;
15717 printf(" %d", n_URL);
15718 printf(" %d", n_ID);
15719 printf(" %d", n_base);
15720 printf("\n");
15721 }
15722 }
15723 }
15724 }
15725
15726 function_tests++;
15727 return(test_ret);
15728}
15729
15730
15731static int
15732test_xmlCreateFileParserCtxt(void) {
15733 int test_ret = 0;
15734
15735 int mem_base;
15736 xmlParserCtxtPtr ret_val;
15737 const char * filename; /* the filename */
15738 int n_filename;
15739
15740 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15741 mem_base = xmlMemBlocks();
15742 filename = gen_fileoutput(n_filename, 0);
15743
15744 ret_val = xmlCreateFileParserCtxt(filename);
15745 desret_xmlParserCtxtPtr(ret_val);
15746 call_tests++;
15747 des_fileoutput(n_filename, filename, 0);
15748 xmlResetLastError();
15749 if (mem_base != xmlMemBlocks()) {
15750 printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15751 xmlMemBlocks() - mem_base);
15752 test_ret++;
15753 printf(" %d", n_filename);
15754 printf("\n");
15755 }
15756 }
15757
15758 function_tests++;
15759 return(test_ret);
15760}
15761
15762
15763static int
15764test_xmlCreateMemoryParserCtxt(void) {
15765 int test_ret = 0;
15766
15767 int mem_base;
15768 xmlParserCtxtPtr ret_val;
15769 char * buffer; /* a pointer to a char array */
15770 int n_buffer;
15771 int size; /* the size of the array */
15772 int n_size;
15773
15774 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15775 for (n_size = 0;n_size < gen_nb_int;n_size++) {
15776 mem_base = xmlMemBlocks();
15777 buffer = gen_const_char_ptr(n_buffer, 0);
15778 size = gen_int(n_size, 1);
15779
15780 ret_val = xmlCreateMemoryParserCtxt(buffer, size);
15781 desret_xmlParserCtxtPtr(ret_val);
15782 call_tests++;
15783 des_const_char_ptr(n_buffer, buffer, 0);
15784 des_int(n_size, size, 1);
15785 xmlResetLastError();
15786 if (mem_base != xmlMemBlocks()) {
15787 printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
15788 xmlMemBlocks() - mem_base);
15789 test_ret++;
15790 printf(" %d", n_buffer);
15791 printf(" %d", n_size);
15792 printf("\n");
15793 }
15794 }
15795 }
15796
15797 function_tests++;
15798 return(test_ret);
15799}
15800
15801
15802static int
15803test_xmlCreateURLParserCtxt(void) {
15804 int test_ret = 0;
15805
15806 int mem_base;
15807 xmlParserCtxtPtr ret_val;
15808 const char * filename; /* the filename or URL */
15809 int n_filename;
15810 int options; /* a combination of xmlParserOption */
15811 int n_options;
15812
15813 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15814 for (n_options = 0;n_options < gen_nb_int;n_options++) {
15815 mem_base = xmlMemBlocks();
15816 filename = gen_fileoutput(n_filename, 0);
15817 options = gen_int(n_options, 1);
15818
15819 ret_val = xmlCreateURLParserCtxt(filename, options);
15820 desret_xmlParserCtxtPtr(ret_val);
15821 call_tests++;
15822 des_fileoutput(n_filename, filename, 0);
15823 des_int(n_options, options, 1);
15824 xmlResetLastError();
15825 if (mem_base != xmlMemBlocks()) {
15826 printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
15827 xmlMemBlocks() - mem_base);
15828 test_ret++;
15829 printf(" %d", n_filename);
15830 printf(" %d", n_options);
15831 printf("\n");
15832 }
15833 }
15834 }
15835
15836 function_tests++;
15837 return(test_ret);
15838}
15839
15840
15841static int
15842test_xmlCurrentChar(void) {
15843 int test_ret = 0;
15844
15845 int mem_base;
15846 int ret_val;
15847 xmlParserCtxtPtr ctxt; /* the XML parser context */
15848 int n_ctxt;
15849 int * len; /* pointer to the length of the char read */
15850 int n_len;
15851
15852 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15853 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
15854 mem_base = xmlMemBlocks();
15855 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15856 len = gen_int_ptr(n_len, 1);
15857
15858 ret_val = xmlCurrentChar(ctxt, len);
15859 desret_int(ret_val);
15860 call_tests++;
15861 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15862 des_int_ptr(n_len, len, 1);
15863 xmlResetLastError();
15864 if (mem_base != xmlMemBlocks()) {
15865 printf("Leak of %d blocks found in xmlCurrentChar",
15866 xmlMemBlocks() - mem_base);
15867 test_ret++;
15868 printf(" %d", n_ctxt);
15869 printf(" %d", n_len);
15870 printf("\n");
15871 }
15872 }
15873 }
15874
15875 function_tests++;
15876 return(test_ret);
15877}
15878
15879
15880static int
Daniel Veillard2a4fb5a2004-11-08 14:02:18 +000015881test_xmlErrMemory(void) {
15882 int test_ret = 0;
15883
15884 int mem_base;
15885 xmlParserCtxtPtr ctxt; /* an XML parser context */
15886 int n_ctxt;
15887 char * extra; /* extra informations */
15888 int n_extra;
15889
15890 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15891 for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
15892 mem_base = xmlMemBlocks();
15893 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15894 extra = gen_const_char_ptr(n_extra, 1);
15895
15896 xmlErrMemory(ctxt, extra);
15897 call_tests++;
15898 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15899 des_const_char_ptr(n_extra, extra, 1);
15900 xmlResetLastError();
15901 if (mem_base != xmlMemBlocks()) {
15902 printf("Leak of %d blocks found in xmlErrMemory",
15903 xmlMemBlocks() - mem_base);
15904 test_ret++;
15905 printf(" %d", n_ctxt);
15906 printf(" %d", n_extra);
15907 printf("\n");
15908 }
15909 }
15910 }
15911
15912 function_tests++;
15913 return(test_ret);
15914}
15915
15916
15917static int
15918test_xmlIsLetter(void) {
15919 int test_ret = 0;
15920
15921 int mem_base;
15922 int ret_val;
15923 int c; /* an unicode character (int) */
15924 int n_c;
15925
15926 for (n_c = 0;n_c < gen_nb_int;n_c++) {
15927 mem_base = xmlMemBlocks();
15928 c = gen_int(n_c, 0);
15929
15930 ret_val = xmlIsLetter(c);
15931 desret_int(ret_val);
15932 call_tests++;
15933 des_int(n_c, c, 0);
15934 xmlResetLastError();
15935 if (mem_base != xmlMemBlocks()) {
15936 printf("Leak of %d blocks found in xmlIsLetter",
15937 xmlMemBlocks() - mem_base);
15938 test_ret++;
15939 printf(" %d", n_c);
15940 printf("\n");
15941 }
15942 }
15943
15944 function_tests++;
15945 return(test_ret);
15946}
15947
15948
15949static int
15950test_xmlNewEntityInputStream(void) {
15951 int test_ret = 0;
15952
15953 int mem_base;
15954 xmlParserInputPtr ret_val;
15955 xmlParserCtxtPtr ctxt; /* an XML parser context */
15956 int n_ctxt;
15957 xmlEntityPtr entity; /* an Entity pointer */
15958 int n_entity;
15959
15960 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15961 for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
15962 mem_base = xmlMemBlocks();
15963 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15964 entity = gen_xmlEntityPtr(n_entity, 1);
15965
15966 ret_val = xmlNewEntityInputStream(ctxt, entity);
15967 desret_xmlParserInputPtr(ret_val);
15968 call_tests++;
15969 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15970 des_xmlEntityPtr(n_entity, entity, 1);
15971 xmlResetLastError();
15972 if (mem_base != xmlMemBlocks()) {
15973 printf("Leak of %d blocks found in xmlNewEntityInputStream",
15974 xmlMemBlocks() - mem_base);
15975 test_ret++;
15976 printf(" %d", n_ctxt);
15977 printf(" %d", n_entity);
15978 printf("\n");
15979 }
15980 }
15981 }
15982
15983 function_tests++;
15984 return(test_ret);
15985}
15986
15987
15988static int
15989test_xmlNewInputFromFile(void) {
15990 int test_ret = 0;
15991
15992 int mem_base;
15993 xmlParserInputPtr ret_val;
15994 xmlParserCtxtPtr ctxt; /* an XML parser context */
15995 int n_ctxt;
15996 const char * filename; /* the filename to use as entity */
15997 int n_filename;
15998
15999 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16000 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16001 mem_base = xmlMemBlocks();
16002 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16003 filename = gen_filepath(n_filename, 1);
16004
16005 ret_val = xmlNewInputFromFile(ctxt, filename);
16006 desret_xmlParserInputPtr(ret_val);
16007 call_tests++;
16008 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16009 des_filepath(n_filename, filename, 1);
16010 xmlResetLastError();
16011 if (mem_base != xmlMemBlocks()) {
16012 printf("Leak of %d blocks found in xmlNewInputFromFile",
16013 xmlMemBlocks() - mem_base);
16014 test_ret++;
16015 printf(" %d", n_ctxt);
16016 printf(" %d", n_filename);
16017 printf("\n");
16018 }
16019 }
16020 }
16021
16022 function_tests++;
16023 return(test_ret);
16024}
16025
16026
16027static int
16028test_xmlNewInputStream(void) {
16029 int test_ret = 0;
16030
16031 int mem_base;
16032 xmlParserInputPtr ret_val;
16033 xmlParserCtxtPtr ctxt; /* an XML parser context */
16034 int n_ctxt;
16035
16036 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16037 mem_base = xmlMemBlocks();
16038 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16039
16040 ret_val = xmlNewInputStream(ctxt);
16041 desret_xmlParserInputPtr(ret_val);
16042 call_tests++;
16043 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16044 xmlResetLastError();
16045 if (mem_base != xmlMemBlocks()) {
16046 printf("Leak of %d blocks found in xmlNewInputStream",
16047 xmlMemBlocks() - mem_base);
16048 test_ret++;
16049 printf(" %d", n_ctxt);
16050 printf("\n");
16051 }
16052 }
16053
16054 function_tests++;
16055 return(test_ret);
16056}
16057
16058
16059static int
16060test_xmlNewStringInputStream(void) {
16061 int test_ret = 0;
16062
16063 int mem_base;
16064 xmlParserInputPtr ret_val;
16065 xmlParserCtxtPtr ctxt; /* an XML parser context */
16066 int n_ctxt;
16067 xmlChar * buffer; /* an memory buffer */
16068 int n_buffer;
16069
16070 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16071 for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16072 mem_base = xmlMemBlocks();
16073 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16074 buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16075
16076 ret_val = xmlNewStringInputStream(ctxt, buffer);
16077 desret_xmlParserInputPtr(ret_val);
16078 call_tests++;
16079 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16080 des_const_xmlChar_ptr(n_buffer, buffer, 1);
16081 xmlResetLastError();
16082 if (mem_base != xmlMemBlocks()) {
16083 printf("Leak of %d blocks found in xmlNewStringInputStream",
16084 xmlMemBlocks() - mem_base);
16085 test_ret++;
16086 printf(" %d", n_ctxt);
16087 printf(" %d", n_buffer);
16088 printf("\n");
16089 }
16090 }
16091 }
16092
16093 function_tests++;
16094 return(test_ret);
16095}
16096
16097
16098static int
16099test_xmlNextChar(void) {
16100 int test_ret = 0;
16101
16102 int mem_base;
16103 xmlParserCtxtPtr ctxt; /* the XML parser context */
16104 int n_ctxt;
16105
16106 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16107 mem_base = xmlMemBlocks();
16108 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16109
16110 xmlNextChar(ctxt);
16111 call_tests++;
16112 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16113 xmlResetLastError();
16114 if (mem_base != xmlMemBlocks()) {
16115 printf("Leak of %d blocks found in xmlNextChar",
16116 xmlMemBlocks() - mem_base);
16117 test_ret++;
16118 printf(" %d", n_ctxt);
16119 printf("\n");
16120 }
16121 }
16122
16123 function_tests++;
16124 return(test_ret);
16125}
16126
16127
16128static int
16129test_xmlParserInputShrink(void) {
16130 int test_ret = 0;
16131
16132 int mem_base;
16133 xmlParserInputPtr in; /* an XML parser input */
16134 int n_in;
16135
16136 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16137 mem_base = xmlMemBlocks();
16138 in = gen_xmlParserInputPtr(n_in, 0);
16139
16140 xmlParserInputShrink(in);
16141 call_tests++;
16142 des_xmlParserInputPtr(n_in, in, 0);
16143 xmlResetLastError();
16144 if (mem_base != xmlMemBlocks()) {
16145 printf("Leak of %d blocks found in xmlParserInputShrink",
16146 xmlMemBlocks() - mem_base);
16147 test_ret++;
16148 printf(" %d", n_in);
16149 printf("\n");
16150 }
16151 }
16152
16153 function_tests++;
16154 return(test_ret);
16155}
16156
16157
16158static int
16159test_xmlPopInput(void) {
16160 int test_ret = 0;
16161
16162
16163 /* missing type support */
16164 return(test_ret);
16165}
16166
16167
16168static int
16169test_xmlPushInput(void) {
16170 int test_ret = 0;
16171
16172 int mem_base;
16173 xmlParserCtxtPtr ctxt; /* an XML parser context */
16174 int n_ctxt;
16175 xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16176 int n_input;
16177
16178 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16179 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16180 mem_base = xmlMemBlocks();
16181 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16182 input = gen_xmlParserInputPtr(n_input, 1);
16183
16184 xmlPushInput(ctxt, input);
16185 call_tests++;
16186 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16187 des_xmlParserInputPtr(n_input, input, 1);
16188 xmlResetLastError();
16189 if (mem_base != xmlMemBlocks()) {
16190 printf("Leak of %d blocks found in xmlPushInput",
16191 xmlMemBlocks() - mem_base);
16192 test_ret++;
16193 printf(" %d", n_ctxt);
16194 printf(" %d", n_input);
16195 printf("\n");
16196 }
16197 }
16198 }
16199
16200 function_tests++;
16201 return(test_ret);
16202}
16203
16204
16205static int
16206test_xmlSetEntityReferenceFunc(void) {
16207 int test_ret = 0;
16208
16209
16210 /* missing type support */
16211 return(test_ret);
16212}
16213
16214
16215static int
16216test_xmlSplitQName(void) {
16217 int test_ret = 0;
16218
16219 int mem_base;
16220 xmlChar * ret_val;
16221 xmlParserCtxtPtr ctxt; /* an XML parser context */
16222 int n_ctxt;
16223 xmlChar * name; /* an XML parser context */
16224 int n_name;
16225 xmlChar ** prefix; /* a xmlChar ** */
16226 int n_prefix;
16227
16228 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16229 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16230 for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16231 mem_base = xmlMemBlocks();
16232 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16233 name = gen_const_xmlChar_ptr(n_name, 1);
16234 prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16235
16236 ret_val = xmlSplitQName(ctxt, name, prefix);
16237 desret_xmlChar_ptr(ret_val);
16238 call_tests++;
16239 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16240 des_const_xmlChar_ptr(n_name, name, 1);
16241 des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16242 xmlResetLastError();
16243 if (mem_base != xmlMemBlocks()) {
16244 printf("Leak of %d blocks found in xmlSplitQName",
16245 xmlMemBlocks() - mem_base);
16246 test_ret++;
16247 printf(" %d", n_ctxt);
16248 printf(" %d", n_name);
16249 printf(" %d", n_prefix);
16250 printf("\n");
16251 }
16252 }
16253 }
16254 }
16255
16256 function_tests++;
16257 return(test_ret);
16258}
16259
16260
16261static int
16262test_xmlStringCurrentChar(void) {
16263 int test_ret = 0;
16264
16265 int mem_base;
16266 int ret_val;
16267 xmlParserCtxtPtr ctxt; /* the XML parser context */
16268 int n_ctxt;
16269 xmlChar * cur; /* pointer to the beginning of the char */
16270 int n_cur;
16271 int * len; /* pointer to the length of the char read */
16272 int n_len;
16273
16274 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16275 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16276 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16277 mem_base = xmlMemBlocks();
16278 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16279 cur = gen_const_xmlChar_ptr(n_cur, 1);
16280 len = gen_int_ptr(n_len, 2);
16281
16282 ret_val = xmlStringCurrentChar(ctxt, cur, len);
16283 desret_int(ret_val);
16284 call_tests++;
16285 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16286 des_const_xmlChar_ptr(n_cur, cur, 1);
16287 des_int_ptr(n_len, len, 2);
16288 xmlResetLastError();
16289 if (mem_base != xmlMemBlocks()) {
16290 printf("Leak of %d blocks found in xmlStringCurrentChar",
16291 xmlMemBlocks() - mem_base);
16292 test_ret++;
16293 printf(" %d", n_ctxt);
16294 printf(" %d", n_cur);
16295 printf(" %d", n_len);
16296 printf("\n");
16297 }
16298 }
16299 }
16300 }
16301
16302 function_tests++;
16303 return(test_ret);
16304}
16305
16306
16307static int
16308test_xmlStringDecodeEntities(void) {
16309 int test_ret = 0;
16310
16311
16312 /* missing type support */
16313 return(test_ret);
16314}
16315
16316
16317static int
16318test_xmlStringLenDecodeEntities(void) {
16319 int test_ret = 0;
16320
16321
16322 /* missing type support */
16323 return(test_ret);
16324}
16325
16326
16327static int
16328test_xmlSwitchEncoding(void) {
16329 int test_ret = 0;
16330
16331 int mem_base;
16332 int ret_val;
16333 xmlParserCtxtPtr ctxt; /* the parser context */
16334 int n_ctxt;
16335 xmlCharEncoding enc; /* the encoding value (number) */
16336 int n_enc;
16337
16338 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16339 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16340 mem_base = xmlMemBlocks();
16341 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16342 enc = gen_xmlCharEncoding(n_enc, 1);
16343
16344 ret_val = xmlSwitchEncoding(ctxt, enc);
16345 desret_int(ret_val);
16346 call_tests++;
16347 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16348 des_xmlCharEncoding(n_enc, enc, 1);
16349 xmlResetLastError();
16350 if (mem_base != xmlMemBlocks()) {
16351 printf("Leak of %d blocks found in xmlSwitchEncoding",
16352 xmlMemBlocks() - mem_base);
16353 test_ret++;
16354 printf(" %d", n_ctxt);
16355 printf(" %d", n_enc);
16356 printf("\n");
16357 }
16358 }
16359 }
16360
16361 function_tests++;
16362 return(test_ret);
16363}
16364
16365
16366static int
16367test_xmlSwitchInputEncoding(void) {
16368 int test_ret = 0;
16369
16370 int mem_base;
16371 int ret_val;
16372 xmlParserCtxtPtr ctxt; /* the parser context */
16373 int n_ctxt;
16374 xmlParserInputPtr input; /* the input stream */
16375 int n_input;
16376 xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16377 int n_handler;
16378
16379 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16380 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16381 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16382 mem_base = xmlMemBlocks();
16383 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16384 input = gen_xmlParserInputPtr(n_input, 1);
16385 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16386
16387 ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16388 desret_int(ret_val);
16389 call_tests++;
16390 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16391 des_xmlParserInputPtr(n_input, input, 1);
16392 des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16393 xmlResetLastError();
16394 if (mem_base != xmlMemBlocks()) {
16395 printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16396 xmlMemBlocks() - mem_base);
16397 test_ret++;
16398 printf(" %d", n_ctxt);
16399 printf(" %d", n_input);
16400 printf(" %d", n_handler);
16401 printf("\n");
16402 }
16403 }
16404 }
16405 }
16406
16407 function_tests++;
16408 return(test_ret);
16409}
16410
16411
16412static int
16413test_xmlSwitchToEncoding(void) {
16414 int test_ret = 0;
16415
16416 int mem_base;
16417 int ret_val;
16418 xmlParserCtxtPtr ctxt; /* the parser context */
16419 int n_ctxt;
16420 xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16421 int n_handler;
16422
16423 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16424 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16425 mem_base = xmlMemBlocks();
16426 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16427 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16428
16429 ret_val = xmlSwitchToEncoding(ctxt, handler);
16430 desret_int(ret_val);
16431 call_tests++;
16432 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16433 des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16434 xmlResetLastError();
16435 if (mem_base != xmlMemBlocks()) {
16436 printf("Leak of %d blocks found in xmlSwitchToEncoding",
16437 xmlMemBlocks() - mem_base);
16438 test_ret++;
16439 printf(" %d", n_ctxt);
16440 printf(" %d", n_handler);
16441 printf("\n");
16442 }
16443 }
16444 }
16445
16446 function_tests++;
16447 return(test_ret);
16448}
16449
16450static int
16451test_parserInternals(void) {
16452 int test_ret = 0;
16453
16454 printf("Testing parserInternals : 30 of 90 functions ...\n");
16455 test_ret += test_htmlCreateFileParserCtxt();
16456 test_ret += test_htmlInitAutoClose();
16457 test_ret += test_inputPop();
16458 test_ret += test_inputPush();
16459 test_ret += test_namePop();
16460 test_ret += test_namePush();
16461 test_ret += test_nodePop();
16462 test_ret += test_nodePush();
16463 test_ret += test_xmlCheckLanguageID();
16464 test_ret += test_xmlCopyChar();
16465 test_ret += test_xmlCopyCharMultiByte();
16466 test_ret += test_xmlCreateEntityParserCtxt();
16467 test_ret += test_xmlCreateFileParserCtxt();
16468 test_ret += test_xmlCreateMemoryParserCtxt();
16469 test_ret += test_xmlCreateURLParserCtxt();
16470 test_ret += test_xmlCurrentChar();
Daniel Veillard2a4fb5a2004-11-08 14:02:18 +000016471 test_ret += test_xmlErrMemory();
16472 test_ret += test_xmlIsLetter();
16473 test_ret += test_xmlNewEntityInputStream();
16474 test_ret += test_xmlNewInputFromFile();
16475 test_ret += test_xmlNewInputStream();
16476 test_ret += test_xmlNewStringInputStream();
16477 test_ret += test_xmlNextChar();
16478 test_ret += test_xmlParserInputShrink();
16479 test_ret += test_xmlPopInput();
16480 test_ret += test_xmlPushInput();
16481 test_ret += test_xmlSetEntityReferenceFunc();
16482 test_ret += test_xmlSplitQName();
16483 test_ret += test_xmlStringCurrentChar();
16484 test_ret += test_xmlStringDecodeEntities();
16485 test_ret += test_xmlStringLenDecodeEntities();
16486 test_ret += test_xmlSwitchEncoding();
16487 test_ret += test_xmlSwitchInputEncoding();
16488 test_ret += test_xmlSwitchToEncoding();
16489
16490 if (test_ret != 0)
16491 printf("Module parserInternals: %d errors\n", test_ret);
16492 return(test_ret);
16493}
16494
Daniel Veillardce682bc2004-11-05 17:22:25 +000016495#define gen_nb_xmlPatternPtr 1
16496static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16497 return(NULL);
16498}
16499static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16500}
16501
Daniel Veillardd93f6252004-11-02 15:53:51 +000016502static int
16503test_xmlPatternMatch(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000016504 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016505
Daniel Veillardce682bc2004-11-05 17:22:25 +000016506#ifdef LIBXML_PATTERN_ENABLED
16507 int mem_base;
16508 int ret_val;
16509 xmlPatternPtr comp; /* the precompiled pattern */
16510 int n_comp;
16511 xmlNodePtr node; /* a node */
16512 int n_node;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016513
Daniel Veillardce682bc2004-11-05 17:22:25 +000016514 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16515 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16516 mem_base = xmlMemBlocks();
16517 comp = gen_xmlPatternPtr(n_comp, 0);
16518 node = gen_xmlNodePtr(n_node, 1);
16519
16520 ret_val = xmlPatternMatch(comp, node);
16521 desret_int(ret_val);
16522 call_tests++;
16523 des_xmlPatternPtr(n_comp, comp, 0);
16524 des_xmlNodePtr(n_node, node, 1);
16525 xmlResetLastError();
16526 if (mem_base != xmlMemBlocks()) {
16527 printf("Leak of %d blocks found in xmlPatternMatch",
16528 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000016529 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000016530 printf(" %d", n_comp);
16531 printf(" %d", n_node);
16532 printf("\n");
16533 }
16534 }
16535 }
16536#endif
16537
16538 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000016539 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000016540}
16541
16542
16543static int
16544test_xmlPatterncompile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000016545 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016546
16547
16548 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000016549 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000016550}
16551
16552static int
16553test_pattern(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000016554 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016555
Daniel Veillardce682bc2004-11-05 17:22:25 +000016556 printf("Testing pattern : 1 of 4 functions ...\n");
Daniel Veillard42595322004-11-08 10:52:06 +000016557 test_ret += test_xmlPatternMatch();
16558 test_ret += test_xmlPatterncompile();
Daniel Veillardd93f6252004-11-02 15:53:51 +000016559
Daniel Veillard42595322004-11-08 10:52:06 +000016560 if (test_ret != 0)
16561 printf("Module pattern: %d errors\n", test_ret);
16562 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000016563}
16564
Daniel Veillardce682bc2004-11-05 17:22:25 +000016565#define gen_nb_xmlRelaxNGPtr 1
16566static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16567 return(NULL);
16568}
16569static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16570}
16571
Daniel Veillardd93f6252004-11-02 15:53:51 +000016572static int
Daniel Veillardd93f6252004-11-02 15:53:51 +000016573test_xmlRelaxNGDump(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000016574 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016575
Daniel Veillardce682bc2004-11-05 17:22:25 +000016576#ifdef LIBXML_SCHEMAS_ENABLED
16577#ifdef LIBXML_OUTPUT_ENABLED
16578 int mem_base;
16579 FILE * output; /* the file output */
16580 int n_output;
16581 xmlRelaxNGPtr schema; /* a schema structure */
16582 int n_schema;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016583
Daniel Veillardce682bc2004-11-05 17:22:25 +000016584 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
16585 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
16586 mem_base = xmlMemBlocks();
16587 output = gen_FILE_ptr(n_output, 0);
16588 schema = gen_xmlRelaxNGPtr(n_schema, 1);
16589
16590 xmlRelaxNGDump(output, schema);
16591 call_tests++;
16592 des_FILE_ptr(n_output, output, 0);
16593 des_xmlRelaxNGPtr(n_schema, schema, 1);
16594 xmlResetLastError();
16595 if (mem_base != xmlMemBlocks()) {
16596 printf("Leak of %d blocks found in xmlRelaxNGDump",
16597 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000016598 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000016599 printf(" %d", n_output);
16600 printf(" %d", n_schema);
16601 printf("\n");
16602 }
16603 }
16604 }
16605#endif
16606#endif
16607
16608 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000016609 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000016610}
16611
16612
16613static int
16614test_xmlRelaxNGDumpTree(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000016615 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016616
Daniel Veillardce682bc2004-11-05 17:22:25 +000016617#ifdef LIBXML_SCHEMAS_ENABLED
16618#ifdef LIBXML_OUTPUT_ENABLED
16619 int mem_base;
16620 FILE * output; /* the file output */
16621 int n_output;
16622 xmlRelaxNGPtr schema; /* a schema structure */
16623 int n_schema;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016624
Daniel Veillardce682bc2004-11-05 17:22:25 +000016625 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
16626 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
16627 mem_base = xmlMemBlocks();
16628 output = gen_FILE_ptr(n_output, 0);
16629 schema = gen_xmlRelaxNGPtr(n_schema, 1);
16630
16631 xmlRelaxNGDumpTree(output, schema);
16632 call_tests++;
16633 des_FILE_ptr(n_output, output, 0);
16634 des_xmlRelaxNGPtr(n_schema, schema, 1);
16635 xmlResetLastError();
16636 if (mem_base != xmlMemBlocks()) {
16637 printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
16638 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000016639 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000016640 printf(" %d", n_output);
16641 printf(" %d", n_schema);
16642 printf("\n");
16643 }
16644 }
16645 }
16646#endif
16647#endif
16648
16649 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000016650 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000016651}
16652
16653
Daniel Veillardce682bc2004-11-05 17:22:25 +000016654#define gen_nb_xmlRelaxNGParserCtxtPtr 1
16655static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16656 return(NULL);
16657}
16658static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16659}
16660
16661#define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
16662static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16663 return(NULL);
16664}
16665static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16666}
16667
16668#define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
16669static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16670 return(NULL);
16671}
16672static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16673}
16674
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000016675#define gen_nb_void_ptr_ptr 1
16676static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16677 return(NULL);
16678}
16679static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16680}
16681
Daniel Veillardd93f6252004-11-02 15:53:51 +000016682static int
16683test_xmlRelaxNGGetParserErrors(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000016684 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016685
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000016686#ifdef LIBXML_SCHEMAS_ENABLED
16687 int mem_base;
16688 int ret_val;
16689 xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
16690 int n_ctxt;
16691 xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
16692 int n_err;
16693 xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
16694 int n_warn;
16695 void ** ctx; /* contextual data for the callbacks result */
16696 int n_ctx;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016697
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000016698 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
16699 for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
16700 for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
16701 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
16702 mem_base = xmlMemBlocks();
16703 ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
16704 err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
16705 warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
16706 ctx = gen_void_ptr_ptr(n_ctx, 3);
16707
16708 ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
16709 desret_int(ret_val);
16710 call_tests++;
16711 des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
16712 des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
16713 des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
16714 des_void_ptr_ptr(n_ctx, ctx, 3);
16715 xmlResetLastError();
16716 if (mem_base != xmlMemBlocks()) {
16717 printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
16718 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000016719 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000016720 printf(" %d", n_ctxt);
16721 printf(" %d", n_err);
16722 printf(" %d", n_warn);
16723 printf(" %d", n_ctx);
16724 printf("\n");
16725 }
16726 }
16727 }
16728 }
16729 }
16730#endif
16731
16732 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000016733 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000016734}
16735
16736
Daniel Veillardce682bc2004-11-05 17:22:25 +000016737#define gen_nb_xmlRelaxNGValidCtxtPtr 1
16738static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16739 return(NULL);
16740}
16741static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16742}
16743
Daniel Veillardd93f6252004-11-02 15:53:51 +000016744static int
16745test_xmlRelaxNGGetValidErrors(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000016746 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016747
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000016748#ifdef LIBXML_SCHEMAS_ENABLED
16749 int mem_base;
16750 int ret_val;
16751 xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
16752 int n_ctxt;
16753 xmlRelaxNGValidityErrorFunc * err; /* the error function result */
16754 int n_err;
16755 xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
16756 int n_warn;
16757 void ** ctx; /* the functions context result */
16758 int n_ctx;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016759
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000016760 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
16761 for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
16762 for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
16763 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
16764 mem_base = xmlMemBlocks();
16765 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
16766 err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
16767 warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
16768 ctx = gen_void_ptr_ptr(n_ctx, 3);
16769
16770 ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
16771 desret_int(ret_val);
16772 call_tests++;
16773 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
16774 des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
16775 des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
16776 des_void_ptr_ptr(n_ctx, ctx, 3);
16777 xmlResetLastError();
16778 if (mem_base != xmlMemBlocks()) {
16779 printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
16780 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000016781 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000016782 printf(" %d", n_ctxt);
16783 printf(" %d", n_err);
16784 printf(" %d", n_warn);
16785 printf(" %d", n_ctx);
16786 printf("\n");
16787 }
16788 }
16789 }
16790 }
16791 }
16792#endif
16793
16794 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000016795 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000016796}
16797
16798
16799static int
Daniel Veillard34099b42004-11-04 17:34:35 +000016800test_xmlRelaxNGInitTypes(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000016801 int test_ret = 0;
Daniel Veillard34099b42004-11-04 17:34:35 +000016802
16803#ifdef LIBXML_SCHEMAS_ENABLED
16804 int mem_base;
16805 int ret_val;
16806
16807 mem_base = xmlMemBlocks();
16808
16809 ret_val = xmlRelaxNGInitTypes();
16810 desret_int(ret_val);
16811 call_tests++;
16812 xmlResetLastError();
16813 if (mem_base != xmlMemBlocks()) {
16814 printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
16815 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000016816 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000016817 printf("\n");
16818 }
16819#endif
16820
16821 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000016822 return(test_ret);
Daniel Veillard34099b42004-11-04 17:34:35 +000016823}
16824
16825
16826static int
Daniel Veillardd93f6252004-11-02 15:53:51 +000016827test_xmlRelaxNGNewDocParserCtxt(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000016828 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016829
Daniel Veillard42595322004-11-08 10:52:06 +000016830#ifdef LIBXML_SCHEMAS_ENABLED
16831 int mem_base;
16832 xmlRelaxNGParserCtxtPtr ret_val;
16833 xmlDocPtr doc; /* a preparsed document tree */
16834 int n_doc;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016835
Daniel Veillard42595322004-11-08 10:52:06 +000016836 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
16837 mem_base = xmlMemBlocks();
16838 doc = gen_xmlDocPtr(n_doc, 0);
16839
16840 ret_val = xmlRelaxNGNewDocParserCtxt(doc);
16841 desret_xmlRelaxNGParserCtxtPtr(ret_val);
16842 call_tests++;
16843 des_xmlDocPtr(n_doc, doc, 0);
16844 xmlResetLastError();
16845 if (mem_base != xmlMemBlocks()) {
16846 printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
16847 xmlMemBlocks() - mem_base);
16848 test_ret++;
16849 printf(" %d", n_doc);
16850 printf("\n");
16851 }
16852 }
16853#endif
16854
16855 function_tests++;
16856 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000016857}
16858
16859
16860static int
16861test_xmlRelaxNGNewMemParserCtxt(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000016862 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016863
Daniel Veillard42595322004-11-08 10:52:06 +000016864#ifdef LIBXML_SCHEMAS_ENABLED
16865 int mem_base;
16866 xmlRelaxNGParserCtxtPtr ret_val;
16867 char * buffer; /* a pointer to a char array containing the schemas */
16868 int n_buffer;
16869 int size; /* the size of the array */
16870 int n_size;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016871
Daniel Veillard42595322004-11-08 10:52:06 +000016872 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
16873 for (n_size = 0;n_size < gen_nb_int;n_size++) {
16874 mem_base = xmlMemBlocks();
16875 buffer = gen_const_char_ptr(n_buffer, 0);
16876 size = gen_int(n_size, 1);
16877
16878 ret_val = xmlRelaxNGNewMemParserCtxt(buffer, size);
16879 desret_xmlRelaxNGParserCtxtPtr(ret_val);
16880 call_tests++;
16881 des_const_char_ptr(n_buffer, buffer, 0);
16882 des_int(n_size, size, 1);
16883 xmlResetLastError();
16884 if (mem_base != xmlMemBlocks()) {
16885 printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
16886 xmlMemBlocks() - mem_base);
16887 test_ret++;
16888 printf(" %d", n_buffer);
16889 printf(" %d", n_size);
16890 printf("\n");
16891 }
16892 }
16893 }
16894#endif
16895
16896 function_tests++;
16897 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000016898}
16899
16900
16901static int
16902test_xmlRelaxNGNewParserCtxt(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000016903 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016904
Daniel Veillard42595322004-11-08 10:52:06 +000016905#ifdef LIBXML_SCHEMAS_ENABLED
16906 int mem_base;
16907 xmlRelaxNGParserCtxtPtr ret_val;
16908 char * URL; /* the location of the schema */
16909 int n_URL;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016910
Daniel Veillard42595322004-11-08 10:52:06 +000016911 for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
16912 mem_base = xmlMemBlocks();
16913 URL = gen_const_char_ptr(n_URL, 0);
16914
16915 ret_val = xmlRelaxNGNewParserCtxt(URL);
16916 desret_xmlRelaxNGParserCtxtPtr(ret_val);
16917 call_tests++;
16918 des_const_char_ptr(n_URL, URL, 0);
16919 xmlResetLastError();
16920 if (mem_base != xmlMemBlocks()) {
16921 printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
16922 xmlMemBlocks() - mem_base);
16923 test_ret++;
16924 printf(" %d", n_URL);
16925 printf("\n");
16926 }
16927 }
16928#endif
16929
16930 function_tests++;
16931 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000016932}
16933
16934
16935static int
16936test_xmlRelaxNGNewValidCtxt(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000016937 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016938
16939
16940 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000016941 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000016942}
16943
16944
16945static int
16946test_xmlRelaxNGParse(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000016947 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016948
16949
16950 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000016951 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000016952}
16953
16954
16955static int
16956test_xmlRelaxNGSetParserErrors(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000016957 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016958
16959
16960 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000016961 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000016962}
16963
16964
16965static int
16966test_xmlRelaxNGSetValidErrors(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000016967 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016968
16969
16970 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000016971 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000016972}
16973
16974
16975static int
16976test_xmlRelaxNGValidateDoc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000016977 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016978
Daniel Veillardce682bc2004-11-05 17:22:25 +000016979#ifdef LIBXML_SCHEMAS_ENABLED
16980 int mem_base;
16981 int ret_val;
16982 xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
16983 int n_ctxt;
16984 xmlDocPtr doc; /* a parsed document tree */
16985 int n_doc;
Daniel Veillardd93f6252004-11-02 15:53:51 +000016986
Daniel Veillardce682bc2004-11-05 17:22:25 +000016987 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
16988 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
16989 mem_base = xmlMemBlocks();
16990 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
16991 doc = gen_xmlDocPtr(n_doc, 1);
16992
16993 ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
16994 desret_int(ret_val);
16995 call_tests++;
16996 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
16997 des_xmlDocPtr(n_doc, doc, 1);
16998 xmlResetLastError();
16999 if (mem_base != xmlMemBlocks()) {
17000 printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17001 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017002 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000017003 printf(" %d", n_ctxt);
17004 printf(" %d", n_doc);
17005 printf("\n");
17006 }
17007 }
17008 }
17009#endif
17010
17011 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017012 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017013}
17014
17015
17016static int
17017test_xmlRelaxNGValidateFullElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017018 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017019
Daniel Veillardce682bc2004-11-05 17:22:25 +000017020#ifdef LIBXML_SCHEMAS_ENABLED
17021 int mem_base;
17022 int ret_val;
17023 xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17024 int n_ctxt;
17025 xmlDocPtr doc; /* a document instance */
17026 int n_doc;
17027 xmlNodePtr elem; /* an element instance */
17028 int n_elem;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017029
Daniel Veillardce682bc2004-11-05 17:22:25 +000017030 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17031 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17032 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17033 mem_base = xmlMemBlocks();
17034 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17035 doc = gen_xmlDocPtr(n_doc, 1);
17036 elem = gen_xmlNodePtr(n_elem, 2);
17037
17038 ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17039 desret_int(ret_val);
17040 call_tests++;
17041 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17042 des_xmlDocPtr(n_doc, doc, 1);
17043 des_xmlNodePtr(n_elem, elem, 2);
17044 xmlResetLastError();
17045 if (mem_base != xmlMemBlocks()) {
17046 printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17047 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017048 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000017049 printf(" %d", n_ctxt);
17050 printf(" %d", n_doc);
17051 printf(" %d", n_elem);
17052 printf("\n");
17053 }
17054 }
17055 }
17056 }
17057#endif
17058
17059 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017060 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017061}
17062
17063
17064static int
17065test_xmlRelaxNGValidatePopElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017066 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017067
Daniel Veillardce682bc2004-11-05 17:22:25 +000017068#ifdef LIBXML_SCHEMAS_ENABLED
17069 int mem_base;
17070 int ret_val;
17071 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17072 int n_ctxt;
17073 xmlDocPtr doc; /* a document instance */
17074 int n_doc;
17075 xmlNodePtr elem; /* an element instance */
17076 int n_elem;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017077
Daniel Veillardce682bc2004-11-05 17:22:25 +000017078 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17079 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17080 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17081 mem_base = xmlMemBlocks();
17082 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17083 doc = gen_xmlDocPtr(n_doc, 1);
17084 elem = gen_xmlNodePtr(n_elem, 2);
17085
17086 ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17087 desret_int(ret_val);
17088 call_tests++;
17089 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17090 des_xmlDocPtr(n_doc, doc, 1);
17091 des_xmlNodePtr(n_elem, elem, 2);
17092 xmlResetLastError();
17093 if (mem_base != xmlMemBlocks()) {
17094 printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17095 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017096 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000017097 printf(" %d", n_ctxt);
17098 printf(" %d", n_doc);
17099 printf(" %d", n_elem);
17100 printf("\n");
17101 }
17102 }
17103 }
17104 }
17105#endif
17106
17107 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017108 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017109}
17110
17111
17112static int
17113test_xmlRelaxNGValidatePushCData(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017114 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017115
Daniel Veillardce682bc2004-11-05 17:22:25 +000017116#ifdef LIBXML_SCHEMAS_ENABLED
17117 int mem_base;
17118 int ret_val;
17119 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17120 int n_ctxt;
17121 xmlChar * data; /* some character data read */
17122 int n_data;
17123 int len; /* the lenght of the data */
17124 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017125
Daniel Veillardce682bc2004-11-05 17:22:25 +000017126 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17127 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17128 for (n_len = 0;n_len < gen_nb_int;n_len++) {
17129 mem_base = xmlMemBlocks();
17130 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17131 data = gen_const_xmlChar_ptr(n_data, 1);
17132 len = gen_int(n_len, 2);
17133
17134 ret_val = xmlRelaxNGValidatePushCData(ctxt, data, len);
17135 desret_int(ret_val);
17136 call_tests++;
17137 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17138 des_const_xmlChar_ptr(n_data, data, 1);
17139 des_int(n_len, len, 2);
17140 xmlResetLastError();
17141 if (mem_base != xmlMemBlocks()) {
17142 printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17143 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017144 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000017145 printf(" %d", n_ctxt);
17146 printf(" %d", n_data);
17147 printf(" %d", n_len);
17148 printf("\n");
17149 }
17150 }
17151 }
17152 }
17153#endif
17154
17155 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017156 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017157}
17158
17159
17160static int
17161test_xmlRelaxNGValidatePushElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017162 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017163
Daniel Veillardce682bc2004-11-05 17:22:25 +000017164#ifdef LIBXML_SCHEMAS_ENABLED
17165 int mem_base;
17166 int ret_val;
17167 xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17168 int n_ctxt;
17169 xmlDocPtr doc; /* a document instance */
17170 int n_doc;
17171 xmlNodePtr elem; /* an element instance */
17172 int n_elem;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017173
Daniel Veillardce682bc2004-11-05 17:22:25 +000017174 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17175 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17176 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17177 mem_base = xmlMemBlocks();
17178 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17179 doc = gen_xmlDocPtr(n_doc, 1);
17180 elem = gen_xmlNodePtr(n_elem, 2);
17181
17182 ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17183 desret_int(ret_val);
17184 call_tests++;
17185 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17186 des_xmlDocPtr(n_doc, doc, 1);
17187 des_xmlNodePtr(n_elem, elem, 2);
17188 xmlResetLastError();
17189 if (mem_base != xmlMemBlocks()) {
17190 printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17191 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017192 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000017193 printf(" %d", n_ctxt);
17194 printf(" %d", n_doc);
17195 printf(" %d", n_elem);
17196 printf("\n");
17197 }
17198 }
17199 }
17200 }
17201#endif
17202
17203 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017204 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017205}
17206
17207
17208static int
17209test_xmlRelaxParserSetFlag(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017210 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017211
Daniel Veillardce682bc2004-11-05 17:22:25 +000017212#ifdef LIBXML_SCHEMAS_ENABLED
17213 int mem_base;
17214 int ret_val;
17215 xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17216 int n_ctxt;
17217 int flags; /* a set of flags values */
17218 int n_flags;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017219
Daniel Veillardce682bc2004-11-05 17:22:25 +000017220 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17221 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17222 mem_base = xmlMemBlocks();
17223 ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17224 flags = gen_int(n_flags, 1);
17225
17226 ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17227 desret_int(ret_val);
17228 call_tests++;
17229 des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17230 des_int(n_flags, flags, 1);
17231 xmlResetLastError();
17232 if (mem_base != xmlMemBlocks()) {
17233 printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17234 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017235 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000017236 printf(" %d", n_ctxt);
17237 printf(" %d", n_flags);
17238 printf("\n");
17239 }
17240 }
17241 }
17242#endif
17243
17244 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017245 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017246}
17247
17248static int
17249test_relaxng(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017250 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017251
Daniel Veillard42595322004-11-08 10:52:06 +000017252 printf("Testing relaxng : 14 of 22 functions ...\n");
17253 test_ret += test_xmlRelaxNGDump();
17254 test_ret += test_xmlRelaxNGDumpTree();
17255 test_ret += test_xmlRelaxNGGetParserErrors();
17256 test_ret += test_xmlRelaxNGGetValidErrors();
17257 test_ret += test_xmlRelaxNGInitTypes();
17258 test_ret += test_xmlRelaxNGNewDocParserCtxt();
17259 test_ret += test_xmlRelaxNGNewMemParserCtxt();
17260 test_ret += test_xmlRelaxNGNewParserCtxt();
17261 test_ret += test_xmlRelaxNGNewValidCtxt();
17262 test_ret += test_xmlRelaxNGParse();
17263 test_ret += test_xmlRelaxNGSetParserErrors();
17264 test_ret += test_xmlRelaxNGSetValidErrors();
17265 test_ret += test_xmlRelaxNGValidateDoc();
17266 test_ret += test_xmlRelaxNGValidateFullElement();
17267 test_ret += test_xmlRelaxNGValidatePopElement();
17268 test_ret += test_xmlRelaxNGValidatePushCData();
17269 test_ret += test_xmlRelaxNGValidatePushElement();
17270 test_ret += test_xmlRelaxParserSetFlag();
Daniel Veillardd93f6252004-11-02 15:53:51 +000017271
Daniel Veillard42595322004-11-08 10:52:06 +000017272 if (test_ret != 0)
17273 printf("Module relaxng: %d errors\n", test_ret);
17274 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017275}
17276static int
17277test_schemasInternals(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017278 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017279
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000017280 printf("Testing schemasInternals : 0 of 2 functions ...\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000017281
Daniel Veillard42595322004-11-08 10:52:06 +000017282 if (test_ret != 0)
17283 printf("Module schemasInternals: %d errors\n", test_ret);
17284 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017285}
17286
17287static int
17288test_xmlAddChild(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017289 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017290
17291 int mem_base;
17292 xmlNodePtr ret_val;
17293 xmlNodePtr parent; /* the parent node */
17294 int n_parent;
17295 xmlNodePtr cur; /* the child node */
17296 int n_cur;
17297
Daniel Veillarda03e3652004-11-02 18:45:30 +000017298 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
Daniel Veillardd93f6252004-11-02 15:53:51 +000017299 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
17300 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000017301 parent = gen_xmlNodePtr(n_parent, 0);
17302 cur = gen_xmlNodePtr_in(n_cur, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017303
17304 ret_val = xmlAddChild(parent, cur);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000017305 if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
Daniel Veillardd93f6252004-11-02 15:53:51 +000017306 desret_xmlNodePtr(ret_val);
17307 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000017308 des_xmlNodePtr(n_parent, parent, 0);
17309 des_xmlNodePtr_in(n_cur, cur, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017310 xmlResetLastError();
17311 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000017312 printf("Leak of %d blocks found in xmlAddChild",
Daniel Veillardd93f6252004-11-02 15:53:51 +000017313 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017314 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000017315 printf(" %d", n_parent);
17316 printf(" %d", n_cur);
17317 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000017318 }
17319 }
17320 }
17321
Daniel Veillard3d97e662004-11-04 10:49:00 +000017322 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017323 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017324}
17325
17326
17327static int
17328test_xmlAddChildList(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017329 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017330
17331 int mem_base;
17332 xmlNodePtr ret_val;
17333 xmlNodePtr parent; /* the parent node */
17334 int n_parent;
17335 xmlNodePtr cur; /* the first node in the list */
17336 int n_cur;
17337
Daniel Veillarda03e3652004-11-02 18:45:30 +000017338 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
Daniel Veillardd93f6252004-11-02 15:53:51 +000017339 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
17340 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000017341 parent = gen_xmlNodePtr(n_parent, 0);
17342 cur = gen_xmlNodePtr_in(n_cur, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017343
17344 ret_val = xmlAddChildList(parent, cur);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000017345 if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
Daniel Veillardd93f6252004-11-02 15:53:51 +000017346 desret_xmlNodePtr(ret_val);
17347 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000017348 des_xmlNodePtr(n_parent, parent, 0);
17349 des_xmlNodePtr_in(n_cur, cur, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017350 xmlResetLastError();
17351 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000017352 printf("Leak of %d blocks found in xmlAddChildList",
Daniel Veillardd93f6252004-11-02 15:53:51 +000017353 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017354 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000017355 printf(" %d", n_parent);
17356 printf(" %d", n_cur);
17357 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000017358 }
17359 }
17360 }
17361
Daniel Veillard3d97e662004-11-04 10:49:00 +000017362 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017363 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017364}
17365
17366
17367static int
17368test_xmlAddNextSibling(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017369 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017370
17371 int mem_base;
17372 xmlNodePtr ret_val;
17373 xmlNodePtr cur; /* the child node */
17374 int n_cur;
17375 xmlNodePtr elem; /* the new node */
17376 int n_elem;
17377
17378 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000017379 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
Daniel Veillardd93f6252004-11-02 15:53:51 +000017380 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000017381 cur = gen_xmlNodePtr(n_cur, 0);
17382 elem = gen_xmlNodePtr_in(n_elem, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017383
17384 ret_val = xmlAddNextSibling(cur, elem);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000017385 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
Daniel Veillardd93f6252004-11-02 15:53:51 +000017386 desret_xmlNodePtr(ret_val);
17387 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000017388 des_xmlNodePtr(n_cur, cur, 0);
17389 des_xmlNodePtr_in(n_elem, elem, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017390 xmlResetLastError();
17391 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000017392 printf("Leak of %d blocks found in xmlAddNextSibling",
Daniel Veillardd93f6252004-11-02 15:53:51 +000017393 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017394 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000017395 printf(" %d", n_cur);
17396 printf(" %d", n_elem);
17397 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000017398 }
17399 }
17400 }
17401
Daniel Veillard3d97e662004-11-04 10:49:00 +000017402 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017403 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017404}
17405
17406
17407static int
17408test_xmlAddPrevSibling(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017409 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017410
17411#ifdef LIBXML_TREE_ENABLED
17412 int mem_base;
17413 xmlNodePtr ret_val;
17414 xmlNodePtr cur; /* the child node */
17415 int n_cur;
17416 xmlNodePtr elem; /* the new node */
17417 int n_elem;
17418
17419 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000017420 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
Daniel Veillardd93f6252004-11-02 15:53:51 +000017421 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000017422 cur = gen_xmlNodePtr(n_cur, 0);
17423 elem = gen_xmlNodePtr_in(n_elem, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017424
17425 ret_val = xmlAddPrevSibling(cur, elem);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000017426 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
Daniel Veillardd93f6252004-11-02 15:53:51 +000017427 desret_xmlNodePtr(ret_val);
17428 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000017429 des_xmlNodePtr(n_cur, cur, 0);
17430 des_xmlNodePtr_in(n_elem, elem, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017431 xmlResetLastError();
17432 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000017433 printf("Leak of %d blocks found in xmlAddPrevSibling",
Daniel Veillardd93f6252004-11-02 15:53:51 +000017434 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017435 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000017436 printf(" %d", n_cur);
17437 printf(" %d", n_elem);
17438 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000017439 }
17440 }
17441 }
17442#endif
17443
Daniel Veillard3d97e662004-11-04 10:49:00 +000017444 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017445 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017446}
17447
17448
17449static int
17450test_xmlAddSibling(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017451 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017452
17453 int mem_base;
17454 xmlNodePtr ret_val;
17455 xmlNodePtr cur; /* the child node */
17456 int n_cur;
17457 xmlNodePtr elem; /* the new node */
17458 int n_elem;
17459
17460 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000017461 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
Daniel Veillardd93f6252004-11-02 15:53:51 +000017462 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000017463 cur = gen_xmlNodePtr(n_cur, 0);
17464 elem = gen_xmlNodePtr_in(n_elem, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017465
17466 ret_val = xmlAddSibling(cur, elem);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000017467 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
Daniel Veillardd93f6252004-11-02 15:53:51 +000017468 desret_xmlNodePtr(ret_val);
17469 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000017470 des_xmlNodePtr(n_cur, cur, 0);
17471 des_xmlNodePtr_in(n_elem, elem, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017472 xmlResetLastError();
17473 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000017474 printf("Leak of %d blocks found in xmlAddSibling",
Daniel Veillardd93f6252004-11-02 15:53:51 +000017475 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017476 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000017477 printf(" %d", n_cur);
17478 printf(" %d", n_elem);
17479 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000017480 }
17481 }
17482 }
17483
Daniel Veillard3d97e662004-11-04 10:49:00 +000017484 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017485 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017486}
17487
17488
17489static int
17490test_xmlAttrSerializeTxtContent(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017491 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017492
Daniel Veillardce244ad2004-11-05 10:03:46 +000017493 int mem_base;
17494 xmlBufferPtr buf; /* the XML buffer output */
17495 int n_buf;
17496 xmlDocPtr doc; /* the document */
17497 int n_doc;
17498 xmlAttrPtr attr; /* the attribute node */
17499 int n_attr;
Daniel Veillardce682bc2004-11-05 17:22:25 +000017500 xmlChar * string; /* the text content */
Daniel Veillardce244ad2004-11-05 10:03:46 +000017501 int n_string;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017502
Daniel Veillardce244ad2004-11-05 10:03:46 +000017503 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17504 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17505 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
17506 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
17507 mem_base = xmlMemBlocks();
17508 buf = gen_xmlBufferPtr(n_buf, 0);
17509 doc = gen_xmlDocPtr(n_doc, 1);
17510 attr = gen_xmlAttrPtr(n_attr, 2);
17511 string = gen_const_xmlChar_ptr(n_string, 3);
17512
17513 xmlAttrSerializeTxtContent(buf, doc, attr, string);
17514 call_tests++;
17515 des_xmlBufferPtr(n_buf, buf, 0);
17516 des_xmlDocPtr(n_doc, doc, 1);
17517 des_xmlAttrPtr(n_attr, attr, 2);
17518 des_const_xmlChar_ptr(n_string, string, 3);
17519 xmlResetLastError();
17520 if (mem_base != xmlMemBlocks()) {
17521 printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
17522 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017523 test_ret++;
Daniel Veillardce244ad2004-11-05 10:03:46 +000017524 printf(" %d", n_buf);
17525 printf(" %d", n_doc);
17526 printf(" %d", n_attr);
17527 printf(" %d", n_string);
17528 printf("\n");
17529 }
17530 }
17531 }
17532 }
17533 }
17534
17535 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017536 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017537}
17538
17539
17540static int
17541test_xmlBufferAdd(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017542 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017543
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017544 int mem_base;
17545 int ret_val;
17546 xmlBufferPtr buf; /* the buffer to dump */
17547 int n_buf;
Daniel Veillardce682bc2004-11-05 17:22:25 +000017548 xmlChar * str; /* the #xmlChar string */
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017549 int n_str;
17550 int len; /* the number of #xmlChar to add */
17551 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017552
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017553 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17554 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
17555 for (n_len = 0;n_len < gen_nb_int;n_len++) {
17556 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000017557 buf = gen_xmlBufferPtr(n_buf, 0);
17558 str = gen_const_xmlChar_ptr(n_str, 1);
17559 len = gen_int(n_len, 2);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017560
17561 ret_val = xmlBufferAdd(buf, str, len);
17562 desret_int(ret_val);
17563 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000017564 des_xmlBufferPtr(n_buf, buf, 0);
17565 des_const_xmlChar_ptr(n_str, str, 1);
17566 des_int(n_len, len, 2);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017567 xmlResetLastError();
17568 if (mem_base != xmlMemBlocks()) {
17569 printf("Leak of %d blocks found in xmlBufferAdd",
17570 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017571 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017572 printf(" %d", n_buf);
17573 printf(" %d", n_str);
17574 printf(" %d", n_len);
17575 printf("\n");
17576 }
17577 }
17578 }
17579 }
17580
Daniel Veillard3d97e662004-11-04 10:49:00 +000017581 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017582 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017583}
17584
17585
17586static int
17587test_xmlBufferAddHead(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017588 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017589
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017590 int mem_base;
17591 int ret_val;
17592 xmlBufferPtr buf; /* the buffer */
17593 int n_buf;
Daniel Veillardce682bc2004-11-05 17:22:25 +000017594 xmlChar * str; /* the #xmlChar string */
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017595 int n_str;
17596 int len; /* the number of #xmlChar to add */
17597 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017598
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017599 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17600 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
17601 for (n_len = 0;n_len < gen_nb_int;n_len++) {
17602 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000017603 buf = gen_xmlBufferPtr(n_buf, 0);
17604 str = gen_const_xmlChar_ptr(n_str, 1);
17605 len = gen_int(n_len, 2);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017606
17607 ret_val = xmlBufferAddHead(buf, str, len);
17608 desret_int(ret_val);
17609 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000017610 des_xmlBufferPtr(n_buf, buf, 0);
17611 des_const_xmlChar_ptr(n_str, str, 1);
17612 des_int(n_len, len, 2);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017613 xmlResetLastError();
17614 if (mem_base != xmlMemBlocks()) {
17615 printf("Leak of %d blocks found in xmlBufferAddHead",
17616 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017617 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017618 printf(" %d", n_buf);
17619 printf(" %d", n_str);
17620 printf(" %d", n_len);
17621 printf("\n");
17622 }
17623 }
17624 }
17625 }
17626
Daniel Veillard3d97e662004-11-04 10:49:00 +000017627 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017628 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017629}
17630
17631
17632static int
17633test_xmlBufferCCat(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017634 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017635
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017636 int mem_base;
17637 int ret_val;
17638 xmlBufferPtr buf; /* the buffer to dump */
17639 int n_buf;
Daniel Veillardce682bc2004-11-05 17:22:25 +000017640 char * str; /* the C char string */
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017641 int n_str;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017642
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017643 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17644 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
17645 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000017646 buf = gen_xmlBufferPtr(n_buf, 0);
17647 str = gen_const_char_ptr(n_str, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017648
17649 ret_val = xmlBufferCCat(buf, str);
17650 desret_int(ret_val);
17651 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000017652 des_xmlBufferPtr(n_buf, buf, 0);
17653 des_const_char_ptr(n_str, str, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017654 xmlResetLastError();
17655 if (mem_base != xmlMemBlocks()) {
17656 printf("Leak of %d blocks found in xmlBufferCCat",
17657 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017658 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017659 printf(" %d", n_buf);
17660 printf(" %d", n_str);
17661 printf("\n");
17662 }
17663 }
17664 }
17665
Daniel Veillard3d97e662004-11-04 10:49:00 +000017666 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017667 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017668}
17669
17670
17671static int
17672test_xmlBufferCat(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017673 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017674
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017675 int mem_base;
17676 int ret_val;
17677 xmlBufferPtr buf; /* the buffer to add to */
17678 int n_buf;
Daniel Veillardce682bc2004-11-05 17:22:25 +000017679 xmlChar * str; /* the #xmlChar string */
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017680 int n_str;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017681
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017682 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17683 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
17684 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000017685 buf = gen_xmlBufferPtr(n_buf, 0);
17686 str = gen_const_xmlChar_ptr(n_str, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017687
17688 ret_val = xmlBufferCat(buf, str);
17689 desret_int(ret_val);
17690 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000017691 des_xmlBufferPtr(n_buf, buf, 0);
17692 des_const_xmlChar_ptr(n_str, str, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017693 xmlResetLastError();
17694 if (mem_base != xmlMemBlocks()) {
17695 printf("Leak of %d blocks found in xmlBufferCat",
17696 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017697 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017698 printf(" %d", n_buf);
17699 printf(" %d", n_str);
17700 printf("\n");
17701 }
17702 }
17703 }
17704
Daniel Veillard3d97e662004-11-04 10:49:00 +000017705 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017706 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017707}
17708
17709
Daniel Veillardce682bc2004-11-05 17:22:25 +000017710#define gen_nb_const_xmlBufferPtr 1
17711static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17712 return(NULL);
17713}
17714static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17715}
17716
Daniel Veillardd93f6252004-11-02 15:53:51 +000017717static int
17718test_xmlBufferContent(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017719 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017720
Daniel Veillardce682bc2004-11-05 17:22:25 +000017721 int mem_base;
17722 const xmlChar * ret_val;
17723 xmlBufferPtr buf; /* the buffer */
17724 int n_buf;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017725
Daniel Veillardce682bc2004-11-05 17:22:25 +000017726 for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
17727 mem_base = xmlMemBlocks();
17728 buf = gen_const_xmlBufferPtr(n_buf, 0);
17729
17730 ret_val = xmlBufferContent(buf);
17731 desret_const_xmlChar_ptr(ret_val);
17732 call_tests++;
17733 des_const_xmlBufferPtr(n_buf, buf, 0);
17734 xmlResetLastError();
17735 if (mem_base != xmlMemBlocks()) {
17736 printf("Leak of %d blocks found in xmlBufferContent",
17737 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017738 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000017739 printf(" %d", n_buf);
17740 printf("\n");
17741 }
17742 }
17743
17744 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017745 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017746}
17747
17748
17749static int
17750test_xmlBufferCreate(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017751 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017752
Daniel Veillard3d95c732004-11-06 22:25:14 +000017753 int mem_base;
17754 xmlBufferPtr ret_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017755
Daniel Veillard3d95c732004-11-06 22:25:14 +000017756 mem_base = xmlMemBlocks();
17757
17758 ret_val = xmlBufferCreate();
17759 desret_xmlBufferPtr(ret_val);
17760 call_tests++;
17761 xmlResetLastError();
17762 if (mem_base != xmlMemBlocks()) {
17763 printf("Leak of %d blocks found in xmlBufferCreate",
17764 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017765 test_ret++;
Daniel Veillard3d95c732004-11-06 22:25:14 +000017766 printf("\n");
17767 }
17768
17769 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017770 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017771}
17772
17773
17774static int
17775test_xmlBufferCreateSize(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017776 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017777
17778
17779 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000017780 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017781}
17782
17783
17784static int
17785test_xmlBufferCreateStatic(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017786 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017787
17788
17789 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000017790 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017791}
17792
17793
17794static int
Daniel Veillardd93f6252004-11-02 15:53:51 +000017795test_xmlBufferEmpty(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017796 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017797
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017798 int mem_base;
17799 xmlBufferPtr buf; /* the buffer */
17800 int n_buf;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017801
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017802 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17803 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000017804 buf = gen_xmlBufferPtr(n_buf, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017805
17806 xmlBufferEmpty(buf);
17807 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000017808 des_xmlBufferPtr(n_buf, buf, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017809 xmlResetLastError();
17810 if (mem_base != xmlMemBlocks()) {
17811 printf("Leak of %d blocks found in xmlBufferEmpty",
17812 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017813 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000017814 printf(" %d", n_buf);
17815 printf("\n");
17816 }
17817 }
17818
Daniel Veillard3d97e662004-11-04 10:49:00 +000017819 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017820 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017821}
17822
17823
17824static int
17825test_xmlBufferGrow(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017826 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017827
Daniel Veillard3d97e662004-11-04 10:49:00 +000017828 int mem_base;
17829 int ret_val;
17830 xmlBufferPtr buf; /* the buffer */
17831 int n_buf;
17832 unsigned int len; /* the minimum free size to allocate */
17833 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017834
Daniel Veillard3d97e662004-11-04 10:49:00 +000017835 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17836 for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
17837 mem_base = xmlMemBlocks();
17838 buf = gen_xmlBufferPtr(n_buf, 0);
17839 len = gen_unsigned_int(n_len, 1);
17840
17841 ret_val = xmlBufferGrow(buf, len);
17842 desret_int(ret_val);
17843 call_tests++;
17844 des_xmlBufferPtr(n_buf, buf, 0);
17845 des_unsigned_int(n_len, len, 1);
17846 xmlResetLastError();
17847 if (mem_base != xmlMemBlocks()) {
17848 printf("Leak of %d blocks found in xmlBufferGrow",
17849 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017850 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000017851 printf(" %d", n_buf);
17852 printf(" %d", n_len);
17853 printf("\n");
17854 }
17855 }
17856 }
17857
17858 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017859 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017860}
17861
17862
17863static int
17864test_xmlBufferLength(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017865 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017866
Daniel Veillardce682bc2004-11-05 17:22:25 +000017867 int mem_base;
17868 int ret_val;
17869 xmlBufferPtr buf; /* the buffer */
17870 int n_buf;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017871
Daniel Veillardce682bc2004-11-05 17:22:25 +000017872 for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
17873 mem_base = xmlMemBlocks();
17874 buf = gen_const_xmlBufferPtr(n_buf, 0);
17875
17876 ret_val = xmlBufferLength(buf);
17877 desret_int(ret_val);
17878 call_tests++;
17879 des_const_xmlBufferPtr(n_buf, buf, 0);
17880 xmlResetLastError();
17881 if (mem_base != xmlMemBlocks()) {
17882 printf("Leak of %d blocks found in xmlBufferLength",
17883 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017884 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000017885 printf(" %d", n_buf);
17886 printf("\n");
17887 }
17888 }
17889
17890 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017891 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017892}
17893
17894
17895static int
17896test_xmlBufferResize(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017897 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017898
Daniel Veillard3d97e662004-11-04 10:49:00 +000017899 int mem_base;
17900 int ret_val;
17901 xmlBufferPtr buf; /* the buffer to resize */
17902 int n_buf;
17903 unsigned int size; /* the desired size */
17904 int n_size;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017905
Daniel Veillard3d97e662004-11-04 10:49:00 +000017906 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17907 for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
17908 mem_base = xmlMemBlocks();
17909 buf = gen_xmlBufferPtr(n_buf, 0);
17910 size = gen_unsigned_int(n_size, 1);
17911
17912 ret_val = xmlBufferResize(buf, size);
17913 desret_int(ret_val);
17914 call_tests++;
17915 des_xmlBufferPtr(n_buf, buf, 0);
17916 des_unsigned_int(n_size, size, 1);
17917 xmlResetLastError();
17918 if (mem_base != xmlMemBlocks()) {
17919 printf("Leak of %d blocks found in xmlBufferResize",
17920 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017921 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000017922 printf(" %d", n_buf);
17923 printf(" %d", n_size);
17924 printf("\n");
17925 }
17926 }
17927 }
17928
17929 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017930 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017931}
17932
17933
17934static int
17935test_xmlBufferSetAllocationScheme(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017936 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017937
Daniel Veillard57b25162004-11-06 14:50:18 +000017938 int mem_base;
17939 xmlBufferPtr buf; /* the buffer to tune */
17940 int n_buf;
17941 xmlBufferAllocationScheme scheme; /* allocation scheme to use */
17942 int n_scheme;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017943
Daniel Veillard57b25162004-11-06 14:50:18 +000017944 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17945 for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
17946 mem_base = xmlMemBlocks();
17947 buf = gen_xmlBufferPtr(n_buf, 0);
17948 scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
17949
17950 xmlBufferSetAllocationScheme(buf, scheme);
17951 call_tests++;
17952 des_xmlBufferPtr(n_buf, buf, 0);
17953 des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
17954 xmlResetLastError();
17955 if (mem_base != xmlMemBlocks()) {
17956 printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
17957 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017958 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +000017959 printf(" %d", n_buf);
17960 printf(" %d", n_scheme);
17961 printf("\n");
17962 }
17963 }
17964 }
17965
17966 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000017967 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000017968}
17969
17970
17971static int
17972test_xmlBufferShrink(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000017973 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017974
Daniel Veillard3d97e662004-11-04 10:49:00 +000017975 int mem_base;
17976 int ret_val;
17977 xmlBufferPtr buf; /* the buffer to dump */
17978 int n_buf;
17979 unsigned int len; /* the number of xmlChar to remove */
17980 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000017981
Daniel Veillard3d97e662004-11-04 10:49:00 +000017982 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17983 for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
17984 mem_base = xmlMemBlocks();
17985 buf = gen_xmlBufferPtr(n_buf, 0);
17986 len = gen_unsigned_int(n_len, 1);
17987
17988 ret_val = xmlBufferShrink(buf, len);
17989 desret_int(ret_val);
17990 call_tests++;
17991 des_xmlBufferPtr(n_buf, buf, 0);
17992 des_unsigned_int(n_len, len, 1);
17993 xmlResetLastError();
17994 if (mem_base != xmlMemBlocks()) {
17995 printf("Leak of %d blocks found in xmlBufferShrink",
17996 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000017997 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000017998 printf(" %d", n_buf);
17999 printf(" %d", n_len);
18000 printf("\n");
18001 }
18002 }
18003 }
18004
18005 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018006 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018007}
18008
18009
18010static int
18011test_xmlBufferWriteCHAR(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018012 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018013
Daniel Veillardd005b9e2004-11-03 17:07:05 +000018014 int mem_base;
18015 xmlBufferPtr buf; /* the XML buffer */
18016 int n_buf;
Daniel Veillardce682bc2004-11-05 17:22:25 +000018017 xmlChar * string; /* the string to add */
Daniel Veillardd005b9e2004-11-03 17:07:05 +000018018 int n_string;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018019
Daniel Veillardd005b9e2004-11-03 17:07:05 +000018020 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18021 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18022 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000018023 buf = gen_xmlBufferPtr(n_buf, 0);
18024 string = gen_const_xmlChar_ptr(n_string, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000018025
18026 xmlBufferWriteCHAR(buf, string);
18027 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000018028 des_xmlBufferPtr(n_buf, buf, 0);
18029 des_const_xmlChar_ptr(n_string, string, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000018030 xmlResetLastError();
18031 if (mem_base != xmlMemBlocks()) {
18032 printf("Leak of %d blocks found in xmlBufferWriteCHAR",
18033 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018034 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000018035 printf(" %d", n_buf);
18036 printf(" %d", n_string);
18037 printf("\n");
18038 }
18039 }
18040 }
18041
Daniel Veillard3d97e662004-11-04 10:49:00 +000018042 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018043 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018044}
18045
18046
18047static int
18048test_xmlBufferWriteChar(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018049 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018050
Daniel Veillardd005b9e2004-11-03 17:07:05 +000018051 int mem_base;
18052 xmlBufferPtr buf; /* the XML buffer output */
18053 int n_buf;
Daniel Veillardce682bc2004-11-05 17:22:25 +000018054 char * string; /* the string to add */
Daniel Veillardd005b9e2004-11-03 17:07:05 +000018055 int n_string;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018056
Daniel Veillardd005b9e2004-11-03 17:07:05 +000018057 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18058 for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
18059 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000018060 buf = gen_xmlBufferPtr(n_buf, 0);
18061 string = gen_const_char_ptr(n_string, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000018062
18063 xmlBufferWriteChar(buf, string);
18064 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000018065 des_xmlBufferPtr(n_buf, buf, 0);
18066 des_const_char_ptr(n_string, string, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000018067 xmlResetLastError();
18068 if (mem_base != xmlMemBlocks()) {
18069 printf("Leak of %d blocks found in xmlBufferWriteChar",
18070 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018071 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000018072 printf(" %d", n_buf);
18073 printf(" %d", n_string);
18074 printf("\n");
18075 }
18076 }
18077 }
18078
Daniel Veillard3d97e662004-11-04 10:49:00 +000018079 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018080 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018081}
18082
18083
18084static int
18085test_xmlBufferWriteQuotedString(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018086 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018087
Daniel Veillardd005b9e2004-11-03 17:07:05 +000018088 int mem_base;
18089 xmlBufferPtr buf; /* the XML buffer output */
18090 int n_buf;
Daniel Veillardce682bc2004-11-05 17:22:25 +000018091 xmlChar * string; /* the string to add */
Daniel Veillardd005b9e2004-11-03 17:07:05 +000018092 int n_string;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018093
Daniel Veillardd005b9e2004-11-03 17:07:05 +000018094 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18095 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18096 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000018097 buf = gen_xmlBufferPtr(n_buf, 0);
18098 string = gen_const_xmlChar_ptr(n_string, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000018099
18100 xmlBufferWriteQuotedString(buf, string);
18101 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000018102 des_xmlBufferPtr(n_buf, buf, 0);
18103 des_const_xmlChar_ptr(n_string, string, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000018104 xmlResetLastError();
18105 if (mem_base != xmlMemBlocks()) {
18106 printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
18107 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018108 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000018109 printf(" %d", n_buf);
18110 printf(" %d", n_string);
18111 printf("\n");
18112 }
18113 }
18114 }
18115
Daniel Veillard3d97e662004-11-04 10:49:00 +000018116 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018117 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018118}
18119
18120
18121static int
18122test_xmlBuildQName(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018123 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018124
Daniel Veillard8a32fe42004-11-02 22:10:16 +000018125 int mem_base;
18126 xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000018127 xmlChar * ncname; /* the Name */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000018128 int n_ncname;
Daniel Veillardce682bc2004-11-05 17:22:25 +000018129 xmlChar * prefix; /* the prefix */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000018130 int n_prefix;
18131 xmlChar * memory; /* preallocated memory */
18132 int n_memory;
18133 int len; /* preallocated memory length */
18134 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018135
Daniel Veillard8a32fe42004-11-02 22:10:16 +000018136 for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
18137 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
18138 for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
18139 for (n_len = 0;n_len < gen_nb_int;n_len++) {
18140 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000018141 ncname = gen_const_xmlChar_ptr(n_ncname, 0);
18142 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
18143 memory = gen_xmlChar_ptr(n_memory, 2);
18144 len = gen_int(n_len, 3);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000018145
18146 ret_val = xmlBuildQName(ncname, prefix, memory, len);
18147 if ((ret_val != NULL) && (ret_val != ncname) &&
18148 (ret_val != prefix) && (ret_val != memory))
18149 xmlFree(ret_val);
18150 ret_val = NULL;
18151 desret_xmlChar_ptr(ret_val);
18152 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000018153 des_const_xmlChar_ptr(n_ncname, ncname, 0);
18154 des_const_xmlChar_ptr(n_prefix, prefix, 1);
18155 des_xmlChar_ptr(n_memory, memory, 2);
18156 des_int(n_len, len, 3);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000018157 xmlResetLastError();
18158 if (mem_base != xmlMemBlocks()) {
18159 printf("Leak of %d blocks found in xmlBuildQName",
18160 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018161 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000018162 printf(" %d", n_ncname);
18163 printf(" %d", n_prefix);
18164 printf(" %d", n_memory);
18165 printf(" %d", n_len);
18166 printf("\n");
18167 }
18168 }
18169 }
18170 }
18171 }
18172
Daniel Veillard3d97e662004-11-04 10:49:00 +000018173 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018174 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018175}
18176
18177
18178static int
18179test_xmlCopyDoc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018180 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018181
18182#ifdef LIBXML_TREE_ENABLED
18183 int mem_base;
18184 xmlDocPtr ret_val;
18185 xmlDocPtr doc; /* the document */
18186 int n_doc;
18187 int recursive; /* if not zero do a recursive copy. */
18188 int n_recursive;
18189
18190 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18191 for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
18192 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000018193 doc = gen_xmlDocPtr(n_doc, 0);
18194 recursive = gen_int(n_recursive, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018195
18196 ret_val = xmlCopyDoc(doc, recursive);
18197 desret_xmlDocPtr(ret_val);
18198 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000018199 des_xmlDocPtr(n_doc, doc, 0);
18200 des_int(n_recursive, recursive, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018201 xmlResetLastError();
18202 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000018203 printf("Leak of %d blocks found in xmlCopyDoc",
Daniel Veillardd93f6252004-11-02 15:53:51 +000018204 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018205 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000018206 printf(" %d", n_doc);
18207 printf(" %d", n_recursive);
18208 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000018209 }
18210 }
18211 }
18212#endif
18213
Daniel Veillard3d97e662004-11-04 10:49:00 +000018214 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018215 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018216}
18217
18218
18219static int
18220test_xmlCopyDtd(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018221 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018222
Daniel Veillard27f20102004-11-05 11:50:11 +000018223#ifdef LIBXML_TREE_ENABLED
18224 int mem_base;
18225 xmlDtdPtr ret_val;
18226 xmlDtdPtr dtd; /* the dtd */
18227 int n_dtd;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018228
Daniel Veillard27f20102004-11-05 11:50:11 +000018229 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
18230 mem_base = xmlMemBlocks();
18231 dtd = gen_xmlDtdPtr(n_dtd, 0);
18232
18233 ret_val = xmlCopyDtd(dtd);
18234 desret_xmlDtdPtr(ret_val);
18235 call_tests++;
18236 des_xmlDtdPtr(n_dtd, dtd, 0);
18237 xmlResetLastError();
18238 if (mem_base != xmlMemBlocks()) {
18239 printf("Leak of %d blocks found in xmlCopyDtd",
18240 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018241 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000018242 printf(" %d", n_dtd);
18243 printf("\n");
18244 }
18245 }
18246#endif
18247
18248 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018249 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018250}
18251
18252
18253static int
18254test_xmlCopyNamespace(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018255 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018256
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000018257 int mem_base;
18258 xmlNsPtr ret_val;
18259 xmlNsPtr cur; /* the namespace */
18260 int n_cur;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018261
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000018262 for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
18263 mem_base = xmlMemBlocks();
18264 cur = gen_xmlNsPtr(n_cur, 0);
18265
18266 ret_val = xmlCopyNamespace(cur);
18267 if (ret_val != NULL) xmlFreeNs(ret_val);
18268 desret_xmlNsPtr(ret_val);
18269 call_tests++;
18270 des_xmlNsPtr(n_cur, cur, 0);
18271 xmlResetLastError();
18272 if (mem_base != xmlMemBlocks()) {
18273 printf("Leak of %d blocks found in xmlCopyNamespace",
18274 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018275 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000018276 printf(" %d", n_cur);
18277 printf("\n");
18278 }
18279 }
18280
18281 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018282 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018283}
18284
18285
18286static int
18287test_xmlCopyNamespaceList(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018288 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018289
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000018290 int mem_base;
18291 xmlNsPtr ret_val;
18292 xmlNsPtr cur; /* the first namespace */
18293 int n_cur;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018294
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000018295 for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
18296 mem_base = xmlMemBlocks();
18297 cur = gen_xmlNsPtr(n_cur, 0);
18298
18299 ret_val = xmlCopyNamespaceList(cur);
18300 if (ret_val != NULL) xmlFreeNsList(ret_val);
18301 desret_xmlNsPtr(ret_val);
18302 call_tests++;
18303 des_xmlNsPtr(n_cur, cur, 0);
18304 xmlResetLastError();
18305 if (mem_base != xmlMemBlocks()) {
18306 printf("Leak of %d blocks found in xmlCopyNamespaceList",
18307 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018308 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000018309 printf(" %d", n_cur);
18310 printf("\n");
18311 }
18312 }
18313
18314 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018315 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018316}
18317
18318
18319static int
18320test_xmlCopyNode(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018321 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018322
Daniel Veillardce682bc2004-11-05 17:22:25 +000018323 int mem_base;
18324 xmlNodePtr ret_val;
18325 xmlNodePtr node; /* the node */
18326 int n_node;
18327 int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
18328 int n_extended;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018329
Daniel Veillardce682bc2004-11-05 17:22:25 +000018330 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
18331 for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
18332 mem_base = xmlMemBlocks();
18333 node = gen_const_xmlNodePtr(n_node, 0);
18334 extended = gen_int(n_extended, 1);
18335
18336 ret_val = xmlCopyNode(node, extended);
18337 desret_xmlNodePtr(ret_val);
18338 call_tests++;
18339 des_const_xmlNodePtr(n_node, node, 0);
18340 des_int(n_extended, extended, 1);
18341 xmlResetLastError();
18342 if (mem_base != xmlMemBlocks()) {
18343 printf("Leak of %d blocks found in xmlCopyNode",
18344 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018345 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000018346 printf(" %d", n_node);
18347 printf(" %d", n_extended);
18348 printf("\n");
18349 }
18350 }
18351 }
18352
18353 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018354 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018355}
18356
18357
18358static int
18359test_xmlCopyNodeList(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018360 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018361
Daniel Veillardce682bc2004-11-05 17:22:25 +000018362 int mem_base;
18363 xmlNodePtr ret_val;
18364 xmlNodePtr node; /* the first node in the list. */
18365 int n_node;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018366
Daniel Veillardce682bc2004-11-05 17:22:25 +000018367 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
18368 mem_base = xmlMemBlocks();
18369 node = gen_const_xmlNodePtr(n_node, 0);
18370
18371 ret_val = xmlCopyNodeList(node);
18372 desret_xmlNodePtr(ret_val);
18373 call_tests++;
18374 des_const_xmlNodePtr(n_node, node, 0);
18375 xmlResetLastError();
18376 if (mem_base != xmlMemBlocks()) {
18377 printf("Leak of %d blocks found in xmlCopyNodeList",
18378 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018379 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000018380 printf(" %d", n_node);
18381 printf("\n");
18382 }
18383 }
18384
18385 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018386 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018387}
18388
18389
18390static int
18391test_xmlCopyProp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018392 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018393
Daniel Veillard57b25162004-11-06 14:50:18 +000018394 int mem_base;
18395 xmlAttrPtr ret_val;
18396 xmlNodePtr target; /* the element where the attribute will be grafted */
18397 int n_target;
18398 xmlAttrPtr cur; /* the attribute */
18399 int n_cur;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018400
Daniel Veillard57b25162004-11-06 14:50:18 +000018401 for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
18402 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
18403 mem_base = xmlMemBlocks();
18404 target = gen_xmlNodePtr(n_target, 0);
18405 cur = gen_xmlAttrPtr(n_cur, 1);
18406
18407 ret_val = xmlCopyProp(target, cur);
18408 desret_xmlAttrPtr(ret_val);
18409 call_tests++;
18410 des_xmlNodePtr(n_target, target, 0);
18411 des_xmlAttrPtr(n_cur, cur, 1);
18412 xmlResetLastError();
18413 if (mem_base != xmlMemBlocks()) {
18414 printf("Leak of %d blocks found in xmlCopyProp",
18415 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018416 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +000018417 printf(" %d", n_target);
18418 printf(" %d", n_cur);
18419 printf("\n");
18420 }
18421 }
18422 }
18423
18424 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018425 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018426}
18427
18428
18429static int
18430test_xmlCopyPropList(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018431 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018432
Daniel Veillard57b25162004-11-06 14:50:18 +000018433 int mem_base;
18434 xmlAttrPtr ret_val;
18435 xmlNodePtr target; /* the element where the attributes will be grafted */
18436 int n_target;
18437 xmlAttrPtr cur; /* the first attribute */
18438 int n_cur;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018439
Daniel Veillard57b25162004-11-06 14:50:18 +000018440 for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
18441 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
18442 mem_base = xmlMemBlocks();
18443 target = gen_xmlNodePtr(n_target, 0);
18444 cur = gen_xmlAttrPtr(n_cur, 1);
18445
18446 ret_val = xmlCopyPropList(target, cur);
18447 desret_xmlAttrPtr(ret_val);
18448 call_tests++;
18449 des_xmlNodePtr(n_target, target, 0);
18450 des_xmlAttrPtr(n_cur, cur, 1);
18451 xmlResetLastError();
18452 if (mem_base != xmlMemBlocks()) {
18453 printf("Leak of %d blocks found in xmlCopyPropList",
18454 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018455 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +000018456 printf(" %d", n_target);
18457 printf(" %d", n_cur);
18458 printf("\n");
18459 }
18460 }
18461 }
18462
18463 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018464 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018465}
18466
18467
18468static int
18469test_xmlCreateIntSubset(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018470 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018471
Daniel Veillard34099b42004-11-04 17:34:35 +000018472 int mem_base;
18473 xmlDtdPtr ret_val;
18474 xmlDocPtr doc; /* the document pointer */
18475 int n_doc;
Daniel Veillardce682bc2004-11-05 17:22:25 +000018476 xmlChar * name; /* the DTD name */
Daniel Veillard34099b42004-11-04 17:34:35 +000018477 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000018478 xmlChar * ExternalID; /* the external (PUBLIC) ID */
Daniel Veillard34099b42004-11-04 17:34:35 +000018479 int n_ExternalID;
Daniel Veillardce682bc2004-11-05 17:22:25 +000018480 xmlChar * SystemID; /* the system ID */
Daniel Veillard34099b42004-11-04 17:34:35 +000018481 int n_SystemID;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018482
Daniel Veillard34099b42004-11-04 17:34:35 +000018483 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18484 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
18485 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
18486 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
18487 mem_base = xmlMemBlocks();
18488 doc = gen_xmlDocPtr(n_doc, 0);
18489 name = gen_const_xmlChar_ptr(n_name, 1);
18490 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
18491 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
18492
18493 ret_val = xmlCreateIntSubset(doc, name, ExternalID, SystemID);
18494 desret_xmlDtdPtr(ret_val);
18495 call_tests++;
18496 des_xmlDocPtr(n_doc, doc, 0);
18497 des_const_xmlChar_ptr(n_name, name, 1);
18498 des_const_xmlChar_ptr(n_ExternalID, ExternalID, 2);
18499 des_const_xmlChar_ptr(n_SystemID, SystemID, 3);
18500 xmlResetLastError();
18501 if (mem_base != xmlMemBlocks()) {
18502 printf("Leak of %d blocks found in xmlCreateIntSubset",
18503 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018504 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000018505 printf(" %d", n_doc);
18506 printf(" %d", n_name);
18507 printf(" %d", n_ExternalID);
18508 printf(" %d", n_SystemID);
18509 printf("\n");
18510 }
18511 }
18512 }
18513 }
18514 }
18515
18516 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018517 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018518}
18519
18520
18521static int
18522test_xmlDocCopyNode(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018523 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018524
Daniel Veillardce682bc2004-11-05 17:22:25 +000018525 int mem_base;
18526 xmlNodePtr ret_val;
18527 xmlNodePtr node; /* the node */
18528 int n_node;
18529 xmlDocPtr doc; /* the document */
18530 int n_doc;
18531 int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
18532 int n_extended;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018533
Daniel Veillardce682bc2004-11-05 17:22:25 +000018534 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
18535 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18536 for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
18537 mem_base = xmlMemBlocks();
18538 node = gen_const_xmlNodePtr(n_node, 0);
18539 doc = gen_xmlDocPtr(n_doc, 1);
18540 extended = gen_int(n_extended, 2);
18541
18542 ret_val = xmlDocCopyNode(node, doc, extended);
18543 desret_xmlNodePtr(ret_val);
18544 call_tests++;
18545 des_const_xmlNodePtr(n_node, node, 0);
18546 des_xmlDocPtr(n_doc, doc, 1);
18547 des_int(n_extended, extended, 2);
18548 xmlResetLastError();
18549 if (mem_base != xmlMemBlocks()) {
18550 printf("Leak of %d blocks found in xmlDocCopyNode",
18551 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018552 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000018553 printf(" %d", n_node);
18554 printf(" %d", n_doc);
18555 printf(" %d", n_extended);
18556 printf("\n");
18557 }
18558 }
18559 }
18560 }
18561
18562 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018563 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018564}
18565
18566
18567static int
18568test_xmlDocCopyNodeList(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018569 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018570
Daniel Veillardce682bc2004-11-05 17:22:25 +000018571 int mem_base;
18572 xmlNodePtr ret_val;
18573 xmlDocPtr doc; /* the target document */
18574 int n_doc;
18575 xmlNodePtr node; /* the first node in the list. */
18576 int n_node;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018577
Daniel Veillardce682bc2004-11-05 17:22:25 +000018578 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18579 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
18580 mem_base = xmlMemBlocks();
18581 doc = gen_xmlDocPtr(n_doc, 0);
18582 node = gen_const_xmlNodePtr(n_node, 1);
18583
18584 ret_val = xmlDocCopyNodeList(doc, node);
18585 desret_xmlNodePtr(ret_val);
18586 call_tests++;
18587 des_xmlDocPtr(n_doc, doc, 0);
18588 des_const_xmlNodePtr(n_node, node, 1);
18589 xmlResetLastError();
18590 if (mem_base != xmlMemBlocks()) {
18591 printf("Leak of %d blocks found in xmlDocCopyNodeList",
18592 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018593 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000018594 printf(" %d", n_doc);
18595 printf(" %d", n_node);
18596 printf("\n");
18597 }
18598 }
18599 }
18600
18601 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018602 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018603}
18604
18605
18606static int
18607test_xmlDocDump(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018608 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018609
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000018610#ifdef LIBXML_OUTPUT_ENABLED
18611 int mem_base;
18612 int ret_val;
18613 FILE * f; /* the FILE* */
18614 int n_f;
18615 xmlDocPtr cur; /* the document */
18616 int n_cur;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018617
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000018618 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
18619 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
18620 mem_base = xmlMemBlocks();
18621 f = gen_FILE_ptr(n_f, 0);
18622 cur = gen_xmlDocPtr(n_cur, 1);
18623
18624 ret_val = xmlDocDump(f, cur);
18625 desret_int(ret_val);
18626 call_tests++;
18627 des_FILE_ptr(n_f, f, 0);
18628 des_xmlDocPtr(n_cur, cur, 1);
18629 xmlResetLastError();
18630 if (mem_base != xmlMemBlocks()) {
18631 printf("Leak of %d blocks found in xmlDocDump",
18632 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018633 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000018634 printf(" %d", n_f);
18635 printf(" %d", n_cur);
18636 printf("\n");
18637 }
18638 }
18639 }
18640#endif
18641
18642 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018643 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018644}
18645
18646
18647static int
18648test_xmlDocDumpFormatMemory(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018649 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018650
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000018651#ifdef LIBXML_OUTPUT_ENABLED
18652 int mem_base;
18653 xmlDocPtr cur; /* the document */
18654 int n_cur;
18655 xmlChar ** mem; /* OUT: the memory pointer */
18656 int n_mem;
18657 int * size; /* OUT: the memory length */
18658 int n_size;
18659 int format; /* should formatting spaces been added */
18660 int n_format;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018661
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000018662 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
18663 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
18664 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
18665 for (n_format = 0;n_format < gen_nb_int;n_format++) {
18666 mem_base = xmlMemBlocks();
18667 cur = gen_xmlDocPtr(n_cur, 0);
18668 mem = gen_xmlChar_ptr_ptr(n_mem, 1);
18669 size = gen_int_ptr(n_size, 2);
18670 format = gen_int(n_format, 3);
18671
18672 xmlDocDumpFormatMemory(cur, mem, size, format);
18673 call_tests++;
18674 des_xmlDocPtr(n_cur, cur, 0);
18675 des_xmlChar_ptr_ptr(n_mem, mem, 1);
18676 des_int_ptr(n_size, size, 2);
18677 des_int(n_format, format, 3);
18678 xmlResetLastError();
18679 if (mem_base != xmlMemBlocks()) {
18680 printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
18681 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018682 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000018683 printf(" %d", n_cur);
18684 printf(" %d", n_mem);
18685 printf(" %d", n_size);
18686 printf(" %d", n_format);
18687 printf("\n");
18688 }
18689 }
18690 }
18691 }
18692 }
18693#endif
18694
18695 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018696 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018697}
18698
18699
18700static int
18701test_xmlDocDumpFormatMemoryEnc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018702 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018703
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000018704#ifdef LIBXML_OUTPUT_ENABLED
18705 int mem_base;
18706 xmlDocPtr out_doc; /* Document to generate XML text from */
18707 int n_out_doc;
18708 xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
18709 int n_doc_txt_ptr;
18710 int * doc_txt_len; /* Length of the generated XML text */
18711 int n_doc_txt_len;
18712 char * txt_encoding; /* Character encoding to use when generating XML text */
18713 int n_txt_encoding;
18714 int format; /* should formatting spaces been added */
18715 int n_format;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018716
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000018717 for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
18718 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
18719 for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
18720 for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
18721 for (n_format = 0;n_format < gen_nb_int;n_format++) {
18722 mem_base = xmlMemBlocks();
18723 out_doc = gen_xmlDocPtr(n_out_doc, 0);
18724 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
18725 doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
18726 txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
18727 format = gen_int(n_format, 4);
18728
18729 xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, txt_encoding, format);
18730 call_tests++;
18731 des_xmlDocPtr(n_out_doc, out_doc, 0);
18732 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
18733 des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
18734 des_const_char_ptr(n_txt_encoding, txt_encoding, 3);
18735 des_int(n_format, format, 4);
18736 xmlResetLastError();
18737 if (mem_base != xmlMemBlocks()) {
18738 printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
18739 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018740 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000018741 printf(" %d", n_out_doc);
18742 printf(" %d", n_doc_txt_ptr);
18743 printf(" %d", n_doc_txt_len);
18744 printf(" %d", n_txt_encoding);
18745 printf(" %d", n_format);
18746 printf("\n");
18747 }
18748 }
18749 }
18750 }
18751 }
18752 }
18753#endif
18754
18755 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018756 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018757}
18758
18759
18760static int
18761test_xmlDocDumpMemory(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018762 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018763
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000018764#ifdef LIBXML_OUTPUT_ENABLED
18765 int mem_base;
18766 xmlDocPtr cur; /* the document */
18767 int n_cur;
18768 xmlChar ** mem; /* OUT: the memory pointer */
18769 int n_mem;
18770 int * size; /* OUT: the memory length */
18771 int n_size;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018772
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000018773 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
18774 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
18775 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
18776 mem_base = xmlMemBlocks();
18777 cur = gen_xmlDocPtr(n_cur, 0);
18778 mem = gen_xmlChar_ptr_ptr(n_mem, 1);
18779 size = gen_int_ptr(n_size, 2);
18780
18781 xmlDocDumpMemory(cur, mem, size);
18782 call_tests++;
18783 des_xmlDocPtr(n_cur, cur, 0);
18784 des_xmlChar_ptr_ptr(n_mem, mem, 1);
18785 des_int_ptr(n_size, size, 2);
18786 xmlResetLastError();
18787 if (mem_base != xmlMemBlocks()) {
18788 printf("Leak of %d blocks found in xmlDocDumpMemory",
18789 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018790 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000018791 printf(" %d", n_cur);
18792 printf(" %d", n_mem);
18793 printf(" %d", n_size);
18794 printf("\n");
18795 }
18796 }
18797 }
18798 }
18799#endif
18800
18801 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018802 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018803}
18804
18805
18806static int
18807test_xmlDocDumpMemoryEnc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018808 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018809
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000018810#ifdef LIBXML_OUTPUT_ENABLED
18811 int mem_base;
18812 xmlDocPtr out_doc; /* Document to generate XML text from */
18813 int n_out_doc;
18814 xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
18815 int n_doc_txt_ptr;
18816 int * doc_txt_len; /* Length of the generated XML text */
18817 int n_doc_txt_len;
18818 char * txt_encoding; /* Character encoding to use when generating XML text */
18819 int n_txt_encoding;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018820
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000018821 for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
18822 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
18823 for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
18824 for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
18825 mem_base = xmlMemBlocks();
18826 out_doc = gen_xmlDocPtr(n_out_doc, 0);
18827 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
18828 doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
18829 txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
18830
18831 xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, txt_encoding);
18832 call_tests++;
18833 des_xmlDocPtr(n_out_doc, out_doc, 0);
18834 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
18835 des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
18836 des_const_char_ptr(n_txt_encoding, txt_encoding, 3);
18837 xmlResetLastError();
18838 if (mem_base != xmlMemBlocks()) {
18839 printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
18840 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018841 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000018842 printf(" %d", n_out_doc);
18843 printf(" %d", n_doc_txt_ptr);
18844 printf(" %d", n_doc_txt_len);
18845 printf(" %d", n_txt_encoding);
18846 printf("\n");
18847 }
18848 }
18849 }
18850 }
18851 }
18852#endif
18853
18854 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018855 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018856}
18857
18858
18859static int
18860test_xmlDocFormatDump(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018861 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018862
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000018863#ifdef LIBXML_OUTPUT_ENABLED
18864 int mem_base;
18865 int ret_val;
18866 FILE * f; /* the FILE* */
18867 int n_f;
18868 xmlDocPtr cur; /* the document */
18869 int n_cur;
18870 int format; /* should formatting spaces been added */
18871 int n_format;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018872
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000018873 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
18874 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
18875 for (n_format = 0;n_format < gen_nb_int;n_format++) {
18876 mem_base = xmlMemBlocks();
18877 f = gen_FILE_ptr(n_f, 0);
18878 cur = gen_xmlDocPtr(n_cur, 1);
18879 format = gen_int(n_format, 2);
18880
18881 ret_val = xmlDocFormatDump(f, cur, format);
18882 desret_int(ret_val);
18883 call_tests++;
18884 des_FILE_ptr(n_f, f, 0);
18885 des_xmlDocPtr(n_cur, cur, 1);
18886 des_int(n_format, format, 2);
18887 xmlResetLastError();
18888 if (mem_base != xmlMemBlocks()) {
18889 printf("Leak of %d blocks found in xmlDocFormatDump",
18890 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018891 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000018892 printf(" %d", n_f);
18893 printf(" %d", n_cur);
18894 printf(" %d", n_format);
18895 printf("\n");
18896 }
18897 }
18898 }
18899 }
18900#endif
18901
18902 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018903 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018904}
18905
18906
18907static int
18908test_xmlDocGetRootElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018909 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018910
18911 int mem_base;
18912 xmlNodePtr ret_val;
18913 xmlDocPtr doc; /* the document */
18914 int n_doc;
18915
18916 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18917 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000018918 doc = gen_xmlDocPtr(n_doc, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018919
18920 ret_val = xmlDocGetRootElement(doc);
18921 desret_xmlNodePtr(ret_val);
18922 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000018923 des_xmlDocPtr(n_doc, doc, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018924 xmlResetLastError();
18925 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000018926 printf("Leak of %d blocks found in xmlDocGetRootElement",
Daniel Veillardd93f6252004-11-02 15:53:51 +000018927 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018928 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000018929 printf(" %d", n_doc);
18930 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000018931 }
18932 }
18933
Daniel Veillard3d97e662004-11-04 10:49:00 +000018934 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018935 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018936}
18937
18938
18939static int
18940test_xmlDocSetRootElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018941 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018942
18943#ifdef LIBXML_TREE_ENABLED
18944 int mem_base;
18945 xmlNodePtr ret_val;
18946 xmlDocPtr doc; /* the document */
18947 int n_doc;
18948 xmlNodePtr root; /* the new document root element */
18949 int n_root;
18950
18951 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000018952 for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
Daniel Veillardd93f6252004-11-02 15:53:51 +000018953 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000018954 doc = gen_xmlDocPtr(n_doc, 0);
18955 root = gen_xmlNodePtr_in(n_root, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018956
18957 ret_val = xmlDocSetRootElement(doc, root);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000018958 if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
Daniel Veillardd93f6252004-11-02 15:53:51 +000018959 desret_xmlNodePtr(ret_val);
18960 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000018961 des_xmlDocPtr(n_doc, doc, 0);
18962 des_xmlNodePtr_in(n_root, root, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018963 xmlResetLastError();
18964 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000018965 printf("Leak of %d blocks found in xmlDocSetRootElement",
Daniel Veillardd93f6252004-11-02 15:53:51 +000018966 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000018967 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000018968 printf(" %d", n_doc);
18969 printf(" %d", n_root);
18970 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000018971 }
18972 }
18973 }
18974#endif
18975
Daniel Veillard3d97e662004-11-04 10:49:00 +000018976 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000018977 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000018978}
18979
18980
18981static int
18982test_xmlElemDump(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000018983 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018984
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000018985#ifdef LIBXML_OUTPUT_ENABLED
18986 int mem_base;
18987 FILE * f; /* the FILE * for the output */
18988 int n_f;
18989 xmlDocPtr doc; /* the document */
18990 int n_doc;
18991 xmlNodePtr cur; /* the current node */
18992 int n_cur;
Daniel Veillardd93f6252004-11-02 15:53:51 +000018993
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000018994 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
18995 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18996 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18997 mem_base = xmlMemBlocks();
18998 f = gen_FILE_ptr(n_f, 0);
18999 doc = gen_xmlDocPtr(n_doc, 1);
19000 cur = gen_xmlNodePtr(n_cur, 2);
19001
19002 xmlElemDump(f, doc, cur);
19003 call_tests++;
19004 des_FILE_ptr(n_f, f, 0);
19005 des_xmlDocPtr(n_doc, doc, 1);
19006 des_xmlNodePtr(n_cur, cur, 2);
19007 xmlResetLastError();
19008 if (mem_base != xmlMemBlocks()) {
19009 printf("Leak of %d blocks found in xmlElemDump",
19010 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019011 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000019012 printf(" %d", n_f);
19013 printf(" %d", n_doc);
19014 printf(" %d", n_cur);
19015 printf("\n");
19016 }
19017 }
19018 }
19019 }
19020#endif
19021
19022 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019023 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019024}
19025
19026
19027static int
19028test_xmlGetBufferAllocationScheme(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019029 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019030
Daniel Veillard57b25162004-11-06 14:50:18 +000019031 int mem_base;
19032 xmlBufferAllocationScheme ret_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019033
Daniel Veillard57b25162004-11-06 14:50:18 +000019034 mem_base = xmlMemBlocks();
19035
19036 ret_val = xmlGetBufferAllocationScheme();
19037 desret_xmlBufferAllocationScheme(ret_val);
19038 call_tests++;
19039 xmlResetLastError();
19040 if (mem_base != xmlMemBlocks()) {
19041 printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
19042 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019043 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +000019044 printf("\n");
19045 }
19046
19047 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019048 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019049}
19050
19051
19052static int
19053test_xmlGetCompressMode(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019054 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019055
19056 int mem_base;
19057 int ret_val;
19058
19059 mem_base = xmlMemBlocks();
19060
19061 ret_val = xmlGetCompressMode();
19062 desret_int(ret_val);
19063 call_tests++;
19064 xmlResetLastError();
19065 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000019066 printf("Leak of %d blocks found in xmlGetCompressMode",
Daniel Veillardd93f6252004-11-02 15:53:51 +000019067 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019068 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000019069 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000019070 }
19071
Daniel Veillard3d97e662004-11-04 10:49:00 +000019072 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019073 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019074}
19075
19076
19077static int
19078test_xmlGetDocCompressMode(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019079 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019080
19081 int mem_base;
19082 int ret_val;
19083 xmlDocPtr doc; /* the document */
19084 int n_doc;
19085
19086 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19087 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000019088 doc = gen_xmlDocPtr(n_doc, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019089
19090 ret_val = xmlGetDocCompressMode(doc);
19091 desret_int(ret_val);
19092 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000019093 des_xmlDocPtr(n_doc, doc, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019094 xmlResetLastError();
19095 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000019096 printf("Leak of %d blocks found in xmlGetDocCompressMode",
Daniel Veillardd93f6252004-11-02 15:53:51 +000019097 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019098 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000019099 printf(" %d", n_doc);
19100 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000019101 }
19102 }
19103
Daniel Veillard3d97e662004-11-04 10:49:00 +000019104 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019105 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019106}
19107
19108
19109static int
19110test_xmlGetIntSubset(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019111 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019112
Daniel Veillard34099b42004-11-04 17:34:35 +000019113 int mem_base;
19114 xmlDtdPtr ret_val;
19115 xmlDocPtr doc; /* the document pointer */
19116 int n_doc;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019117
Daniel Veillard34099b42004-11-04 17:34:35 +000019118 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19119 mem_base = xmlMemBlocks();
19120 doc = gen_xmlDocPtr(n_doc, 0);
19121
19122 ret_val = xmlGetIntSubset(doc);
19123 desret_xmlDtdPtr(ret_val);
19124 call_tests++;
19125 des_xmlDocPtr(n_doc, doc, 0);
19126 xmlResetLastError();
19127 if (mem_base != xmlMemBlocks()) {
19128 printf("Leak of %d blocks found in xmlGetIntSubset",
19129 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019130 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000019131 printf(" %d", n_doc);
19132 printf("\n");
19133 }
19134 }
19135
19136 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019137 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019138}
19139
19140
19141static int
19142test_xmlGetLastChild(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019143 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019144
19145 int mem_base;
19146 xmlNodePtr ret_val;
19147 xmlNodePtr parent; /* the parent node */
19148 int n_parent;
19149
19150 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19151 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000019152 parent = gen_xmlNodePtr(n_parent, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019153
19154 ret_val = xmlGetLastChild(parent);
19155 desret_xmlNodePtr(ret_val);
19156 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000019157 des_xmlNodePtr(n_parent, parent, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019158 xmlResetLastError();
19159 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000019160 printf("Leak of %d blocks found in xmlGetLastChild",
Daniel Veillardd93f6252004-11-02 15:53:51 +000019161 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019162 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000019163 printf(" %d", n_parent);
19164 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000019165 }
19166 }
19167
Daniel Veillard3d97e662004-11-04 10:49:00 +000019168 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019169 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019170}
19171
19172
19173static int
19174test_xmlGetLineNo(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019175 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019176
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000019177 int mem_base;
19178 long ret_val;
19179 xmlNodePtr node; /* valid node */
19180 int n_node;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019181
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000019182 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19183 mem_base = xmlMemBlocks();
19184 node = gen_xmlNodePtr(n_node, 0);
19185
19186 ret_val = xmlGetLineNo(node);
19187 desret_long(ret_val);
19188 call_tests++;
19189 des_xmlNodePtr(n_node, node, 0);
19190 xmlResetLastError();
19191 if (mem_base != xmlMemBlocks()) {
19192 printf("Leak of %d blocks found in xmlGetLineNo",
19193 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019194 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000019195 printf(" %d", n_node);
19196 printf("\n");
19197 }
19198 }
19199
19200 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019201 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019202}
19203
19204
19205static int
19206test_xmlGetNoNsProp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019207 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019208
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019209 int mem_base;
19210 xmlChar * ret_val;
19211 xmlNodePtr node; /* the node */
19212 int n_node;
Daniel Veillardce682bc2004-11-05 17:22:25 +000019213 xmlChar * name; /* the attribute name */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019214 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019215
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019216 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19217 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19218 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000019219 node = gen_xmlNodePtr(n_node, 0);
19220 name = gen_const_xmlChar_ptr(n_name, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019221
19222 ret_val = xmlGetNoNsProp(node, name);
19223 desret_xmlChar_ptr(ret_val);
19224 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000019225 des_xmlNodePtr(n_node, node, 0);
19226 des_const_xmlChar_ptr(n_name, name, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019227 xmlResetLastError();
19228 if (mem_base != xmlMemBlocks()) {
19229 printf("Leak of %d blocks found in xmlGetNoNsProp",
19230 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019231 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019232 printf(" %d", n_node);
19233 printf(" %d", n_name);
19234 printf("\n");
19235 }
19236 }
19237 }
19238
Daniel Veillard3d97e662004-11-04 10:49:00 +000019239 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019240 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019241}
19242
19243
19244static int
19245test_xmlGetNodePath(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019246 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019247
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019248#ifdef LIBXML_TREE_ENABLED
19249 int mem_base;
19250 xmlChar * ret_val;
19251 xmlNodePtr node; /* a node */
19252 int n_node;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019253
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019254 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19255 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000019256 node = gen_xmlNodePtr(n_node, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019257
19258 ret_val = xmlGetNodePath(node);
19259 desret_xmlChar_ptr(ret_val);
19260 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000019261 des_xmlNodePtr(n_node, node, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019262 xmlResetLastError();
19263 if (mem_base != xmlMemBlocks()) {
19264 printf("Leak of %d blocks found in xmlGetNodePath",
19265 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019266 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019267 printf(" %d", n_node);
19268 printf("\n");
19269 }
19270 }
19271#endif
19272
Daniel Veillard3d97e662004-11-04 10:49:00 +000019273 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019274 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019275}
19276
19277
19278static int
19279test_xmlGetNsList(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019280 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019281
19282
19283 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000019284 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019285}
19286
19287
19288static int
19289test_xmlGetNsProp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019290 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019291
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019292 int mem_base;
19293 xmlChar * ret_val;
19294 xmlNodePtr node; /* the node */
19295 int n_node;
Daniel Veillardce682bc2004-11-05 17:22:25 +000019296 xmlChar * name; /* the attribute name */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019297 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000019298 xmlChar * nameSpace; /* the URI of the namespace */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019299 int n_nameSpace;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019300
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019301 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19302 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19303 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
19304 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000019305 node = gen_xmlNodePtr(n_node, 0);
19306 name = gen_const_xmlChar_ptr(n_name, 1);
19307 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019308
19309 ret_val = xmlGetNsProp(node, name, nameSpace);
19310 desret_xmlChar_ptr(ret_val);
19311 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000019312 des_xmlNodePtr(n_node, node, 0);
19313 des_const_xmlChar_ptr(n_name, name, 1);
19314 des_const_xmlChar_ptr(n_nameSpace, nameSpace, 2);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019315 xmlResetLastError();
19316 if (mem_base != xmlMemBlocks()) {
19317 printf("Leak of %d blocks found in xmlGetNsProp",
19318 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019319 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019320 printf(" %d", n_node);
19321 printf(" %d", n_name);
19322 printf(" %d", n_nameSpace);
19323 printf("\n");
19324 }
19325 }
19326 }
19327 }
19328
Daniel Veillard3d97e662004-11-04 10:49:00 +000019329 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019330 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019331}
19332
19333
19334static int
19335test_xmlGetProp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019336 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019337
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019338 int mem_base;
19339 xmlChar * ret_val;
19340 xmlNodePtr node; /* the node */
19341 int n_node;
Daniel Veillardce682bc2004-11-05 17:22:25 +000019342 xmlChar * name; /* the attribute name */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019343 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019344
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019345 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19346 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19347 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000019348 node = gen_xmlNodePtr(n_node, 0);
19349 name = gen_const_xmlChar_ptr(n_name, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019350
19351 ret_val = xmlGetProp(node, name);
19352 desret_xmlChar_ptr(ret_val);
19353 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000019354 des_xmlNodePtr(n_node, node, 0);
19355 des_const_xmlChar_ptr(n_name, name, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019356 xmlResetLastError();
19357 if (mem_base != xmlMemBlocks()) {
19358 printf("Leak of %d blocks found in xmlGetProp",
19359 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019360 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000019361 printf(" %d", n_node);
19362 printf(" %d", n_name);
19363 printf("\n");
19364 }
19365 }
19366 }
19367
Daniel Veillard3d97e662004-11-04 10:49:00 +000019368 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019369 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019370}
19371
19372
19373static int
19374test_xmlHasNsProp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019375 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019376
Daniel Veillard57b25162004-11-06 14:50:18 +000019377 int mem_base;
19378 xmlAttrPtr ret_val;
19379 xmlNodePtr node; /* the node */
19380 int n_node;
19381 xmlChar * name; /* the attribute name */
19382 int n_name;
19383 xmlChar * nameSpace; /* the URI of the namespace */
19384 int n_nameSpace;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019385
Daniel Veillard57b25162004-11-06 14:50:18 +000019386 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19387 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19388 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
19389 mem_base = xmlMemBlocks();
19390 node = gen_xmlNodePtr(n_node, 0);
19391 name = gen_const_xmlChar_ptr(n_name, 1);
19392 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
19393
19394 ret_val = xmlHasNsProp(node, name, nameSpace);
19395 desret_xmlAttrPtr(ret_val);
19396 call_tests++;
19397 des_xmlNodePtr(n_node, node, 0);
19398 des_const_xmlChar_ptr(n_name, name, 1);
19399 des_const_xmlChar_ptr(n_nameSpace, nameSpace, 2);
19400 xmlResetLastError();
19401 if (mem_base != xmlMemBlocks()) {
19402 printf("Leak of %d blocks found in xmlHasNsProp",
19403 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019404 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +000019405 printf(" %d", n_node);
19406 printf(" %d", n_name);
19407 printf(" %d", n_nameSpace);
19408 printf("\n");
19409 }
19410 }
19411 }
19412 }
19413
19414 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019415 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019416}
19417
19418
19419static int
19420test_xmlHasProp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019421 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019422
Daniel Veillard57b25162004-11-06 14:50:18 +000019423 int mem_base;
19424 xmlAttrPtr ret_val;
19425 xmlNodePtr node; /* the node */
19426 int n_node;
19427 xmlChar * name; /* the attribute name */
19428 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019429
Daniel Veillard57b25162004-11-06 14:50:18 +000019430 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19431 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19432 mem_base = xmlMemBlocks();
19433 node = gen_xmlNodePtr(n_node, 0);
19434 name = gen_const_xmlChar_ptr(n_name, 1);
19435
19436 ret_val = xmlHasProp(node, name);
19437 desret_xmlAttrPtr(ret_val);
19438 call_tests++;
19439 des_xmlNodePtr(n_node, node, 0);
19440 des_const_xmlChar_ptr(n_name, name, 1);
19441 xmlResetLastError();
19442 if (mem_base != xmlMemBlocks()) {
19443 printf("Leak of %d blocks found in xmlHasProp",
19444 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019445 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +000019446 printf(" %d", n_node);
19447 printf(" %d", n_name);
19448 printf("\n");
19449 }
19450 }
19451 }
19452
19453 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019454 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019455}
19456
19457
19458static int
19459test_xmlIsBlankNode(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019460 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019461
19462 int mem_base;
19463 int ret_val;
19464 xmlNodePtr node; /* the node */
19465 int n_node;
19466
19467 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19468 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000019469 node = gen_xmlNodePtr(n_node, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019470
19471 ret_val = xmlIsBlankNode(node);
19472 desret_int(ret_val);
19473 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000019474 des_xmlNodePtr(n_node, node, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019475 xmlResetLastError();
19476 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000019477 printf("Leak of %d blocks found in xmlIsBlankNode",
Daniel Veillardd93f6252004-11-02 15:53:51 +000019478 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019479 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000019480 printf(" %d", n_node);
19481 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000019482 }
19483 }
19484
Daniel Veillard3d97e662004-11-04 10:49:00 +000019485 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019486 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019487}
19488
19489
19490static int
19491test_xmlIsXHTML(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019492 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019493
19494 int mem_base;
19495 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000019496 xmlChar * systemID; /* the system identifier */
Daniel Veillardd93f6252004-11-02 15:53:51 +000019497 int n_systemID;
Daniel Veillardce682bc2004-11-05 17:22:25 +000019498 xmlChar * publicID; /* the public identifier */
Daniel Veillardd93f6252004-11-02 15:53:51 +000019499 int n_publicID;
19500
19501 for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
19502 for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
19503 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000019504 systemID = gen_const_xmlChar_ptr(n_systemID, 0);
19505 publicID = gen_const_xmlChar_ptr(n_publicID, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019506
19507 ret_val = xmlIsXHTML(systemID, publicID);
19508 desret_int(ret_val);
19509 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000019510 des_const_xmlChar_ptr(n_systemID, systemID, 0);
19511 des_const_xmlChar_ptr(n_publicID, publicID, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019512 xmlResetLastError();
19513 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000019514 printf("Leak of %d blocks found in xmlIsXHTML",
Daniel Veillardd93f6252004-11-02 15:53:51 +000019515 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019516 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000019517 printf(" %d", n_systemID);
19518 printf(" %d", n_publicID);
19519 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000019520 }
19521 }
19522 }
19523
Daniel Veillard3d97e662004-11-04 10:49:00 +000019524 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019525 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019526}
19527
19528
19529static int
19530test_xmlNewCDataBlock(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019531 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019532
19533 int mem_base;
19534 xmlNodePtr ret_val;
19535 xmlDocPtr doc; /* the document */
19536 int n_doc;
Daniel Veillardce682bc2004-11-05 17:22:25 +000019537 xmlChar * content; /* the CDATA block content content */
Daniel Veillardd93f6252004-11-02 15:53:51 +000019538 int n_content;
19539 int len; /* the length of the block */
19540 int n_len;
19541
19542 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19543 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
19544 for (n_len = 0;n_len < gen_nb_int;n_len++) {
19545 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000019546 doc = gen_xmlDocPtr(n_doc, 0);
19547 content = gen_const_xmlChar_ptr(n_content, 1);
19548 len = gen_int(n_len, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019549
19550 ret_val = xmlNewCDataBlock(doc, content, len);
19551 desret_xmlNodePtr(ret_val);
19552 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000019553 des_xmlDocPtr(n_doc, doc, 0);
19554 des_const_xmlChar_ptr(n_content, content, 1);
19555 des_int(n_len, len, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019556 xmlResetLastError();
19557 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000019558 printf("Leak of %d blocks found in xmlNewCDataBlock",
Daniel Veillardd93f6252004-11-02 15:53:51 +000019559 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019560 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000019561 printf(" %d", n_doc);
19562 printf(" %d", n_content);
19563 printf(" %d", n_len);
19564 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000019565 }
19566 }
19567 }
19568 }
19569
Daniel Veillard3d97e662004-11-04 10:49:00 +000019570 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019571 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019572}
19573
19574
19575static int
19576test_xmlNewCharRef(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019577 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019578
19579 int mem_base;
19580 xmlNodePtr ret_val;
19581 xmlDocPtr doc; /* the document */
19582 int n_doc;
Daniel Veillardce682bc2004-11-05 17:22:25 +000019583 xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
Daniel Veillardd93f6252004-11-02 15:53:51 +000019584 int n_name;
19585
19586 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19587 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19588 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000019589 doc = gen_xmlDocPtr(n_doc, 0);
19590 name = gen_const_xmlChar_ptr(n_name, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019591
19592 ret_val = xmlNewCharRef(doc, name);
19593 desret_xmlNodePtr(ret_val);
19594 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000019595 des_xmlDocPtr(n_doc, doc, 0);
19596 des_const_xmlChar_ptr(n_name, name, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019597 xmlResetLastError();
19598 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000019599 printf("Leak of %d blocks found in xmlNewCharRef",
Daniel Veillardd93f6252004-11-02 15:53:51 +000019600 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019601 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000019602 printf(" %d", n_doc);
19603 printf(" %d", n_name);
19604 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000019605 }
19606 }
19607 }
19608
Daniel Veillard3d97e662004-11-04 10:49:00 +000019609 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019610 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019611}
19612
19613
19614static int
19615test_xmlNewChild(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019616 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019617
Daniel Veillard27f20102004-11-05 11:50:11 +000019618 int mem_base;
19619 xmlNodePtr ret_val;
19620 xmlNodePtr parent; /* the parent node */
19621 int n_parent;
19622 xmlNsPtr ns; /* a namespace if any */
19623 int n_ns;
Daniel Veillardce682bc2004-11-05 17:22:25 +000019624 xmlChar * name; /* the name of the child */
Daniel Veillard27f20102004-11-05 11:50:11 +000019625 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000019626 xmlChar * content; /* the XML content of the child if any. */
Daniel Veillard27f20102004-11-05 11:50:11 +000019627 int n_content;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019628
Daniel Veillard27f20102004-11-05 11:50:11 +000019629 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19630 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
19631 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19632 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
19633 mem_base = xmlMemBlocks();
19634 parent = gen_xmlNodePtr(n_parent, 0);
19635 ns = gen_xmlNsPtr(n_ns, 1);
19636 name = gen_const_xmlChar_ptr(n_name, 2);
19637 content = gen_const_xmlChar_ptr(n_content, 3);
19638
19639 ret_val = xmlNewChild(parent, ns, name, content);
19640 desret_xmlNodePtr(ret_val);
19641 call_tests++;
19642 des_xmlNodePtr(n_parent, parent, 0);
19643 des_xmlNsPtr(n_ns, ns, 1);
19644 des_const_xmlChar_ptr(n_name, name, 2);
19645 des_const_xmlChar_ptr(n_content, content, 3);
19646 xmlResetLastError();
19647 if (mem_base != xmlMemBlocks()) {
19648 printf("Leak of %d blocks found in xmlNewChild",
19649 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019650 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000019651 printf(" %d", n_parent);
19652 printf(" %d", n_ns);
19653 printf(" %d", n_name);
19654 printf(" %d", n_content);
19655 printf("\n");
19656 }
19657 }
19658 }
19659 }
19660 }
19661
19662 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019663 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019664}
19665
19666
19667static int
19668test_xmlNewComment(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019669 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019670
19671 int mem_base;
19672 xmlNodePtr ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000019673 xmlChar * content; /* the comment content */
Daniel Veillardd93f6252004-11-02 15:53:51 +000019674 int n_content;
19675
19676 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
19677 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000019678 content = gen_const_xmlChar_ptr(n_content, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019679
19680 ret_val = xmlNewComment(content);
19681 desret_xmlNodePtr(ret_val);
19682 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000019683 des_const_xmlChar_ptr(n_content, content, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019684 xmlResetLastError();
19685 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000019686 printf("Leak of %d blocks found in xmlNewComment",
Daniel Veillardd93f6252004-11-02 15:53:51 +000019687 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019688 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000019689 printf(" %d", n_content);
19690 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000019691 }
19692 }
19693
Daniel Veillard3d97e662004-11-04 10:49:00 +000019694 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019695 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019696}
19697
19698
19699static int
19700test_xmlNewDoc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019701 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019702
19703 int mem_base;
19704 xmlDocPtr ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000019705 xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
Daniel Veillardd93f6252004-11-02 15:53:51 +000019706 int n_version;
19707
19708 for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
19709 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000019710 version = gen_const_xmlChar_ptr(n_version, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019711
19712 ret_val = xmlNewDoc(version);
19713 desret_xmlDocPtr(ret_val);
19714 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000019715 des_const_xmlChar_ptr(n_version, version, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019716 xmlResetLastError();
19717 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000019718 printf("Leak of %d blocks found in xmlNewDoc",
Daniel Veillardd93f6252004-11-02 15:53:51 +000019719 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019720 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000019721 printf(" %d", n_version);
19722 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000019723 }
19724 }
19725
Daniel Veillard3d97e662004-11-04 10:49:00 +000019726 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019727 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019728}
19729
19730
19731static int
19732test_xmlNewDocComment(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019733 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019734
19735 int mem_base;
19736 xmlNodePtr ret_val;
19737 xmlDocPtr doc; /* the document */
19738 int n_doc;
Daniel Veillardce682bc2004-11-05 17:22:25 +000019739 xmlChar * content; /* the comment content */
Daniel Veillardd93f6252004-11-02 15:53:51 +000019740 int n_content;
19741
19742 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19743 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
19744 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000019745 doc = gen_xmlDocPtr(n_doc, 0);
19746 content = gen_const_xmlChar_ptr(n_content, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019747
19748 ret_val = xmlNewDocComment(doc, content);
19749 desret_xmlNodePtr(ret_val);
19750 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000019751 des_xmlDocPtr(n_doc, doc, 0);
19752 des_const_xmlChar_ptr(n_content, content, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019753 xmlResetLastError();
19754 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000019755 printf("Leak of %d blocks found in xmlNewDocComment",
Daniel Veillardd93f6252004-11-02 15:53:51 +000019756 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019757 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000019758 printf(" %d", n_doc);
19759 printf(" %d", n_content);
19760 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000019761 }
19762 }
19763 }
19764
Daniel Veillard3d97e662004-11-04 10:49:00 +000019765 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019766 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019767}
19768
19769
19770static int
19771test_xmlNewDocFragment(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019772 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019773
19774#ifdef LIBXML_TREE_ENABLED
19775 int mem_base;
19776 xmlNodePtr ret_val;
19777 xmlDocPtr doc; /* the document owning the fragment */
19778 int n_doc;
19779
19780 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19781 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000019782 doc = gen_xmlDocPtr(n_doc, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019783
19784 ret_val = xmlNewDocFragment(doc);
19785 desret_xmlNodePtr(ret_val);
19786 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000019787 des_xmlDocPtr(n_doc, doc, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019788 xmlResetLastError();
19789 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000019790 printf("Leak of %d blocks found in xmlNewDocFragment",
Daniel Veillardd93f6252004-11-02 15:53:51 +000019791 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019792 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000019793 printf(" %d", n_doc);
19794 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000019795 }
19796 }
19797#endif
19798
Daniel Veillard3d97e662004-11-04 10:49:00 +000019799 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019800 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019801}
19802
19803
19804static int
19805test_xmlNewDocNode(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019806 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019807
Daniel Veillard27f20102004-11-05 11:50:11 +000019808 int mem_base;
19809 xmlNodePtr ret_val;
19810 xmlDocPtr doc; /* the document */
19811 int n_doc;
19812 xmlNsPtr ns; /* namespace if any */
19813 int n_ns;
Daniel Veillardce682bc2004-11-05 17:22:25 +000019814 xmlChar * name; /* the node name */
Daniel Veillard27f20102004-11-05 11:50:11 +000019815 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000019816 xmlChar * content; /* the XML text content if any */
Daniel Veillard27f20102004-11-05 11:50:11 +000019817 int n_content;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019818
Daniel Veillard27f20102004-11-05 11:50:11 +000019819 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19820 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
19821 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19822 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
19823 mem_base = xmlMemBlocks();
19824 doc = gen_xmlDocPtr(n_doc, 0);
19825 ns = gen_xmlNsPtr(n_ns, 1);
19826 name = gen_const_xmlChar_ptr(n_name, 2);
19827 content = gen_const_xmlChar_ptr(n_content, 3);
19828
19829 ret_val = xmlNewDocNode(doc, ns, name, content);
19830 desret_xmlNodePtr(ret_val);
19831 call_tests++;
19832 des_xmlDocPtr(n_doc, doc, 0);
19833 des_xmlNsPtr(n_ns, ns, 1);
19834 des_const_xmlChar_ptr(n_name, name, 2);
19835 des_const_xmlChar_ptr(n_content, content, 3);
19836 xmlResetLastError();
19837 if (mem_base != xmlMemBlocks()) {
19838 printf("Leak of %d blocks found in xmlNewDocNode",
19839 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019840 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000019841 printf(" %d", n_doc);
19842 printf(" %d", n_ns);
19843 printf(" %d", n_name);
19844 printf(" %d", n_content);
19845 printf("\n");
19846 }
19847 }
19848 }
19849 }
19850 }
19851
19852 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019853 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019854}
19855
19856
19857static int
19858test_xmlNewDocNodeEatName(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019859 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019860
Daniel Veillard27f20102004-11-05 11:50:11 +000019861 int mem_base;
19862 xmlNodePtr ret_val;
19863 xmlDocPtr doc; /* the document */
19864 int n_doc;
19865 xmlNsPtr ns; /* namespace if any */
19866 int n_ns;
19867 xmlChar * name; /* the node name */
19868 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000019869 xmlChar * content; /* the XML text content if any */
Daniel Veillard27f20102004-11-05 11:50:11 +000019870 int n_content;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019871
Daniel Veillard27f20102004-11-05 11:50:11 +000019872 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19873 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
19874 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
19875 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
19876 mem_base = xmlMemBlocks();
19877 doc = gen_xmlDocPtr(n_doc, 0);
19878 ns = gen_xmlNsPtr(n_ns, 1);
19879 name = gen_eaten_name(n_name, 2);
19880 content = gen_const_xmlChar_ptr(n_content, 3);
19881
19882 ret_val = xmlNewDocNodeEatName(doc, ns, name, content);
19883 desret_xmlNodePtr(ret_val);
19884 call_tests++;
19885 des_xmlDocPtr(n_doc, doc, 0);
19886 des_xmlNsPtr(n_ns, ns, 1);
19887 des_eaten_name(n_name, name, 2);
19888 des_const_xmlChar_ptr(n_content, content, 3);
19889 xmlResetLastError();
19890 if (mem_base != xmlMemBlocks()) {
19891 printf("Leak of %d blocks found in xmlNewDocNodeEatName",
19892 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019893 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000019894 printf(" %d", n_doc);
19895 printf(" %d", n_ns);
19896 printf(" %d", n_name);
19897 printf(" %d", n_content);
19898 printf("\n");
19899 }
19900 }
19901 }
19902 }
19903 }
19904
19905 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019906 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019907}
19908
19909
19910static int
19911test_xmlNewDocPI(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019912 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019913
19914 int mem_base;
19915 xmlNodePtr ret_val;
19916 xmlDocPtr doc; /* the target document */
19917 int n_doc;
Daniel Veillardce682bc2004-11-05 17:22:25 +000019918 xmlChar * name; /* the processing instruction name */
Daniel Veillardd93f6252004-11-02 15:53:51 +000019919 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000019920 xmlChar * content; /* the PI content */
Daniel Veillardd93f6252004-11-02 15:53:51 +000019921 int n_content;
19922
19923 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19924 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19925 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
19926 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000019927 doc = gen_xmlDocPtr(n_doc, 0);
19928 name = gen_const_xmlChar_ptr(n_name, 1);
19929 content = gen_const_xmlChar_ptr(n_content, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019930
19931 ret_val = xmlNewDocPI(doc, name, content);
19932 desret_xmlNodePtr(ret_val);
19933 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000019934 des_xmlDocPtr(n_doc, doc, 0);
19935 des_const_xmlChar_ptr(n_name, name, 1);
19936 des_const_xmlChar_ptr(n_content, content, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019937 xmlResetLastError();
19938 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000019939 printf("Leak of %d blocks found in xmlNewDocPI",
Daniel Veillardd93f6252004-11-02 15:53:51 +000019940 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019941 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000019942 printf(" %d", n_doc);
19943 printf(" %d", n_name);
19944 printf(" %d", n_content);
19945 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000019946 }
19947 }
19948 }
19949 }
19950
Daniel Veillard3d97e662004-11-04 10:49:00 +000019951 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019952 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019953}
19954
19955
19956static int
19957test_xmlNewDocProp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000019958 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019959
Daniel Veillard57b25162004-11-06 14:50:18 +000019960 int mem_base;
19961 xmlAttrPtr ret_val;
19962 xmlDocPtr doc; /* the document */
19963 int n_doc;
19964 xmlChar * name; /* the name of the attribute */
19965 int n_name;
19966 xmlChar * value; /* the value of the attribute */
19967 int n_value;
Daniel Veillardd93f6252004-11-02 15:53:51 +000019968
Daniel Veillard57b25162004-11-06 14:50:18 +000019969 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19970 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19971 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
19972 mem_base = xmlMemBlocks();
19973 doc = gen_xmlDocPtr(n_doc, 0);
19974 name = gen_const_xmlChar_ptr(n_name, 1);
19975 value = gen_const_xmlChar_ptr(n_value, 2);
19976
19977 ret_val = xmlNewDocProp(doc, name, value);
19978 desret_xmlAttrPtr(ret_val);
19979 call_tests++;
19980 des_xmlDocPtr(n_doc, doc, 0);
19981 des_const_xmlChar_ptr(n_name, name, 1);
19982 des_const_xmlChar_ptr(n_value, value, 2);
19983 xmlResetLastError();
19984 if (mem_base != xmlMemBlocks()) {
19985 printf("Leak of %d blocks found in xmlNewDocProp",
19986 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000019987 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +000019988 printf(" %d", n_doc);
19989 printf(" %d", n_name);
19990 printf(" %d", n_value);
19991 printf("\n");
19992 }
19993 }
19994 }
19995 }
19996
19997 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000019998 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000019999}
20000
20001
20002static int
20003test_xmlNewDocRawNode(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020004 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020005
Daniel Veillard27f20102004-11-05 11:50:11 +000020006 int mem_base;
20007 xmlNodePtr ret_val;
20008 xmlDocPtr doc; /* the document */
20009 int n_doc;
20010 xmlNsPtr ns; /* namespace if any */
20011 int n_ns;
Daniel Veillardce682bc2004-11-05 17:22:25 +000020012 xmlChar * name; /* the node name */
Daniel Veillard27f20102004-11-05 11:50:11 +000020013 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000020014 xmlChar * content; /* the text content if any */
Daniel Veillard27f20102004-11-05 11:50:11 +000020015 int n_content;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020016
Daniel Veillard27f20102004-11-05 11:50:11 +000020017 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20018 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20019 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20020 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20021 mem_base = xmlMemBlocks();
20022 doc = gen_xmlDocPtr(n_doc, 0);
20023 ns = gen_xmlNsPtr(n_ns, 1);
20024 name = gen_const_xmlChar_ptr(n_name, 2);
20025 content = gen_const_xmlChar_ptr(n_content, 3);
20026
20027 ret_val = xmlNewDocRawNode(doc, ns, name, content);
20028 desret_xmlNodePtr(ret_val);
20029 call_tests++;
20030 des_xmlDocPtr(n_doc, doc, 0);
20031 des_xmlNsPtr(n_ns, ns, 1);
20032 des_const_xmlChar_ptr(n_name, name, 2);
20033 des_const_xmlChar_ptr(n_content, content, 3);
20034 xmlResetLastError();
20035 if (mem_base != xmlMemBlocks()) {
20036 printf("Leak of %d blocks found in xmlNewDocRawNode",
20037 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020038 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000020039 printf(" %d", n_doc);
20040 printf(" %d", n_ns);
20041 printf(" %d", n_name);
20042 printf(" %d", n_content);
20043 printf("\n");
20044 }
20045 }
20046 }
20047 }
20048 }
20049
20050 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020051 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020052}
20053
20054
20055static int
20056test_xmlNewDocText(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020057 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020058
20059 int mem_base;
20060 xmlNodePtr ret_val;
20061 xmlDocPtr doc; /* the document */
20062 int n_doc;
Daniel Veillardce682bc2004-11-05 17:22:25 +000020063 xmlChar * content; /* the text content */
Daniel Veillardd93f6252004-11-02 15:53:51 +000020064 int n_content;
20065
20066 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20067 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20068 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000020069 doc = gen_xmlDocPtr(n_doc, 0);
20070 content = gen_const_xmlChar_ptr(n_content, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020071
20072 ret_val = xmlNewDocText(doc, content);
20073 desret_xmlNodePtr(ret_val);
20074 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000020075 des_xmlDocPtr(n_doc, doc, 0);
20076 des_const_xmlChar_ptr(n_content, content, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020077 xmlResetLastError();
20078 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000020079 printf("Leak of %d blocks found in xmlNewDocText",
Daniel Veillardd93f6252004-11-02 15:53:51 +000020080 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020081 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000020082 printf(" %d", n_doc);
20083 printf(" %d", n_content);
20084 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000020085 }
20086 }
20087 }
20088
Daniel Veillard3d97e662004-11-04 10:49:00 +000020089 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020090 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020091}
20092
20093
20094static int
20095test_xmlNewDocTextLen(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020096 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020097
20098 int mem_base;
20099 xmlNodePtr ret_val;
20100 xmlDocPtr doc; /* the document */
20101 int n_doc;
Daniel Veillardce682bc2004-11-05 17:22:25 +000020102 xmlChar * content; /* the text content */
Daniel Veillardd93f6252004-11-02 15:53:51 +000020103 int n_content;
20104 int len; /* the text len. */
20105 int n_len;
20106
20107 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20108 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20109 for (n_len = 0;n_len < gen_nb_int;n_len++) {
20110 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000020111 doc = gen_xmlDocPtr(n_doc, 0);
20112 content = gen_const_xmlChar_ptr(n_content, 1);
20113 len = gen_int(n_len, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020114
20115 ret_val = xmlNewDocTextLen(doc, content, len);
20116 desret_xmlNodePtr(ret_val);
20117 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000020118 des_xmlDocPtr(n_doc, doc, 0);
20119 des_const_xmlChar_ptr(n_content, content, 1);
20120 des_int(n_len, len, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020121 xmlResetLastError();
20122 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000020123 printf("Leak of %d blocks found in xmlNewDocTextLen",
Daniel Veillardd93f6252004-11-02 15:53:51 +000020124 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020125 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000020126 printf(" %d", n_doc);
20127 printf(" %d", n_content);
20128 printf(" %d", n_len);
20129 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000020130 }
20131 }
20132 }
20133 }
20134
Daniel Veillard3d97e662004-11-04 10:49:00 +000020135 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020136 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020137}
20138
20139
20140static int
20141test_xmlNewDtd(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020142 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020143
Daniel Veillard34099b42004-11-04 17:34:35 +000020144 int mem_base;
20145 xmlDtdPtr ret_val;
20146 xmlDocPtr doc; /* the document pointer */
20147 int n_doc;
Daniel Veillardce682bc2004-11-05 17:22:25 +000020148 xmlChar * name; /* the DTD name */
Daniel Veillard34099b42004-11-04 17:34:35 +000020149 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000020150 xmlChar * ExternalID; /* the external ID */
Daniel Veillard34099b42004-11-04 17:34:35 +000020151 int n_ExternalID;
Daniel Veillardce682bc2004-11-05 17:22:25 +000020152 xmlChar * SystemID; /* the system ID */
Daniel Veillard34099b42004-11-04 17:34:35 +000020153 int n_SystemID;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020154
Daniel Veillard34099b42004-11-04 17:34:35 +000020155 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20156 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20157 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
20158 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
20159 mem_base = xmlMemBlocks();
20160 doc = gen_xmlDocPtr(n_doc, 0);
20161 name = gen_const_xmlChar_ptr(n_name, 1);
20162 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
20163 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
20164
20165 ret_val = xmlNewDtd(doc, name, ExternalID, SystemID);
20166 desret_xmlDtdPtr(ret_val);
20167 call_tests++;
20168 des_xmlDocPtr(n_doc, doc, 0);
20169 des_const_xmlChar_ptr(n_name, name, 1);
20170 des_const_xmlChar_ptr(n_ExternalID, ExternalID, 2);
20171 des_const_xmlChar_ptr(n_SystemID, SystemID, 3);
20172 xmlResetLastError();
20173 if (mem_base != xmlMemBlocks()) {
20174 printf("Leak of %d blocks found in xmlNewDtd",
20175 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020176 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000020177 printf(" %d", n_doc);
20178 printf(" %d", n_name);
20179 printf(" %d", n_ExternalID);
20180 printf(" %d", n_SystemID);
20181 printf("\n");
20182 }
20183 }
20184 }
20185 }
20186 }
20187
20188 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020189 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020190}
20191
20192
20193static int
Daniel Veillardd93f6252004-11-02 15:53:51 +000020194test_xmlNewNode(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020195 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020196
Daniel Veillard27f20102004-11-05 11:50:11 +000020197 int mem_base;
20198 xmlNodePtr ret_val;
20199 xmlNsPtr ns; /* namespace if any */
20200 int n_ns;
Daniel Veillardce682bc2004-11-05 17:22:25 +000020201 xmlChar * name; /* the node name */
Daniel Veillard27f20102004-11-05 11:50:11 +000020202 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020203
Daniel Veillard27f20102004-11-05 11:50:11 +000020204 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20205 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20206 mem_base = xmlMemBlocks();
20207 ns = gen_xmlNsPtr(n_ns, 0);
20208 name = gen_const_xmlChar_ptr(n_name, 1);
20209
20210 ret_val = xmlNewNode(ns, name);
20211 desret_xmlNodePtr(ret_val);
20212 call_tests++;
20213 des_xmlNsPtr(n_ns, ns, 0);
20214 des_const_xmlChar_ptr(n_name, name, 1);
20215 xmlResetLastError();
20216 if (mem_base != xmlMemBlocks()) {
20217 printf("Leak of %d blocks found in xmlNewNode",
20218 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020219 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000020220 printf(" %d", n_ns);
20221 printf(" %d", n_name);
20222 printf("\n");
20223 }
20224 }
20225 }
20226
20227 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020228 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020229}
20230
20231
20232static int
20233test_xmlNewNodeEatName(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020234 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020235
Daniel Veillard27f20102004-11-05 11:50:11 +000020236 int mem_base;
20237 xmlNodePtr ret_val;
20238 xmlNsPtr ns; /* namespace if any */
20239 int n_ns;
20240 xmlChar * name; /* the node name */
20241 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020242
Daniel Veillard27f20102004-11-05 11:50:11 +000020243 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20244 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
20245 mem_base = xmlMemBlocks();
20246 ns = gen_xmlNsPtr(n_ns, 0);
20247 name = gen_eaten_name(n_name, 1);
20248
20249 ret_val = xmlNewNodeEatName(ns, name);
20250 desret_xmlNodePtr(ret_val);
20251 call_tests++;
20252 des_xmlNsPtr(n_ns, ns, 0);
20253 des_eaten_name(n_name, name, 1);
20254 xmlResetLastError();
20255 if (mem_base != xmlMemBlocks()) {
20256 printf("Leak of %d blocks found in xmlNewNodeEatName",
20257 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020258 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000020259 printf(" %d", n_ns);
20260 printf(" %d", n_name);
20261 printf("\n");
20262 }
20263 }
20264 }
20265
20266 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020267 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020268}
20269
20270
20271static int
20272test_xmlNewNs(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020273 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020274
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000020275 int mem_base;
20276 xmlNsPtr ret_val;
20277 xmlNodePtr node; /* the element carrying the namespace */
20278 int n_node;
20279 xmlChar * href; /* the URI associated */
20280 int n_href;
20281 xmlChar * prefix; /* the prefix for the namespace */
20282 int n_prefix;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020283
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000020284 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20285 for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
20286 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
20287 mem_base = xmlMemBlocks();
20288 node = gen_xmlNodePtr(n_node, 0);
20289 href = gen_const_xmlChar_ptr(n_href, 1);
20290 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
20291
20292 ret_val = xmlNewNs(node, href, prefix);
20293 if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
20294 desret_xmlNsPtr(ret_val);
20295 call_tests++;
20296 des_xmlNodePtr(n_node, node, 0);
20297 des_const_xmlChar_ptr(n_href, href, 1);
20298 des_const_xmlChar_ptr(n_prefix, prefix, 2);
20299 xmlResetLastError();
20300 if (mem_base != xmlMemBlocks()) {
20301 printf("Leak of %d blocks found in xmlNewNs",
20302 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020303 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000020304 printf(" %d", n_node);
20305 printf(" %d", n_href);
20306 printf(" %d", n_prefix);
20307 printf("\n");
20308 }
20309 }
20310 }
20311 }
20312
20313 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020314 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020315}
20316
20317
20318static int
20319test_xmlNewNsProp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020320 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020321
Daniel Veillard57b25162004-11-06 14:50:18 +000020322 int mem_base;
20323 xmlAttrPtr ret_val;
20324 xmlNodePtr node; /* the holding node */
20325 int n_node;
20326 xmlNsPtr ns; /* the namespace */
20327 int n_ns;
20328 xmlChar * name; /* the name of the attribute */
20329 int n_name;
20330 xmlChar * value; /* the value of the attribute */
20331 int n_value;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020332
Daniel Veillard57b25162004-11-06 14:50:18 +000020333 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20334 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20335 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20336 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
20337 mem_base = xmlMemBlocks();
20338 node = gen_xmlNodePtr(n_node, 0);
20339 ns = gen_xmlNsPtr(n_ns, 1);
20340 name = gen_const_xmlChar_ptr(n_name, 2);
20341 value = gen_const_xmlChar_ptr(n_value, 3);
20342
20343 ret_val = xmlNewNsProp(node, ns, name, value);
20344 desret_xmlAttrPtr(ret_val);
20345 call_tests++;
20346 des_xmlNodePtr(n_node, node, 0);
20347 des_xmlNsPtr(n_ns, ns, 1);
20348 des_const_xmlChar_ptr(n_name, name, 2);
20349 des_const_xmlChar_ptr(n_value, value, 3);
20350 xmlResetLastError();
20351 if (mem_base != xmlMemBlocks()) {
20352 printf("Leak of %d blocks found in xmlNewNsProp",
20353 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020354 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +000020355 printf(" %d", n_node);
20356 printf(" %d", n_ns);
20357 printf(" %d", n_name);
20358 printf(" %d", n_value);
20359 printf("\n");
20360 }
20361 }
20362 }
20363 }
20364 }
20365
20366 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020367 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020368}
20369
20370
20371static int
20372test_xmlNewNsPropEatName(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020373 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020374
Daniel Veillard57b25162004-11-06 14:50:18 +000020375 int mem_base;
20376 xmlAttrPtr ret_val;
20377 xmlNodePtr node; /* the holding node */
20378 int n_node;
20379 xmlNsPtr ns; /* the namespace */
20380 int n_ns;
20381 xmlChar * name; /* the name of the attribute */
20382 int n_name;
20383 xmlChar * value; /* the value of the attribute */
20384 int n_value;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020385
Daniel Veillard57b25162004-11-06 14:50:18 +000020386 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20387 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20388 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
20389 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
20390 mem_base = xmlMemBlocks();
20391 node = gen_xmlNodePtr(n_node, 0);
20392 ns = gen_xmlNsPtr(n_ns, 1);
20393 name = gen_eaten_name(n_name, 2);
20394 value = gen_const_xmlChar_ptr(n_value, 3);
20395
20396 ret_val = xmlNewNsPropEatName(node, ns, name, value);
20397 desret_xmlAttrPtr(ret_val);
20398 call_tests++;
20399 des_xmlNodePtr(n_node, node, 0);
20400 des_xmlNsPtr(n_ns, ns, 1);
20401 des_eaten_name(n_name, name, 2);
20402 des_const_xmlChar_ptr(n_value, value, 3);
20403 xmlResetLastError();
20404 if (mem_base != xmlMemBlocks()) {
20405 printf("Leak of %d blocks found in xmlNewNsPropEatName",
20406 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020407 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +000020408 printf(" %d", n_node);
20409 printf(" %d", n_ns);
20410 printf(" %d", n_name);
20411 printf(" %d", n_value);
20412 printf("\n");
20413 }
20414 }
20415 }
20416 }
20417 }
20418
20419 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020420 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020421}
20422
20423
20424static int
20425test_xmlNewPI(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020426 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020427
20428 int mem_base;
20429 xmlNodePtr ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000020430 xmlChar * name; /* the processing instruction name */
Daniel Veillardd93f6252004-11-02 15:53:51 +000020431 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000020432 xmlChar * content; /* the PI content */
Daniel Veillardd93f6252004-11-02 15:53:51 +000020433 int n_content;
20434
20435 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20436 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20437 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000020438 name = gen_const_xmlChar_ptr(n_name, 0);
20439 content = gen_const_xmlChar_ptr(n_content, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020440
20441 ret_val = xmlNewPI(name, content);
20442 desret_xmlNodePtr(ret_val);
20443 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000020444 des_const_xmlChar_ptr(n_name, name, 0);
20445 des_const_xmlChar_ptr(n_content, content, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020446 xmlResetLastError();
20447 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000020448 printf("Leak of %d blocks found in xmlNewPI",
Daniel Veillardd93f6252004-11-02 15:53:51 +000020449 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020450 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000020451 printf(" %d", n_name);
20452 printf(" %d", n_content);
20453 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000020454 }
20455 }
20456 }
20457
Daniel Veillard3d97e662004-11-04 10:49:00 +000020458 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020459 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020460}
20461
20462
20463static int
20464test_xmlNewProp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020465 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020466
Daniel Veillard57b25162004-11-06 14:50:18 +000020467 int mem_base;
20468 xmlAttrPtr ret_val;
20469 xmlNodePtr node; /* the holding node */
20470 int n_node;
20471 xmlChar * name; /* the name of the attribute */
20472 int n_name;
20473 xmlChar * value; /* the value of the attribute */
20474 int n_value;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020475
Daniel Veillard57b25162004-11-06 14:50:18 +000020476 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20477 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20478 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
20479 mem_base = xmlMemBlocks();
20480 node = gen_xmlNodePtr(n_node, 0);
20481 name = gen_const_xmlChar_ptr(n_name, 1);
20482 value = gen_const_xmlChar_ptr(n_value, 2);
20483
20484 ret_val = xmlNewProp(node, name, value);
20485 desret_xmlAttrPtr(ret_val);
20486 call_tests++;
20487 des_xmlNodePtr(n_node, node, 0);
20488 des_const_xmlChar_ptr(n_name, name, 1);
20489 des_const_xmlChar_ptr(n_value, value, 2);
20490 xmlResetLastError();
20491 if (mem_base != xmlMemBlocks()) {
20492 printf("Leak of %d blocks found in xmlNewProp",
20493 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020494 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +000020495 printf(" %d", n_node);
20496 printf(" %d", n_name);
20497 printf(" %d", n_value);
20498 printf("\n");
20499 }
20500 }
20501 }
20502 }
20503
20504 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020505 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020506}
20507
20508
20509static int
20510test_xmlNewReference(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020511 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020512
20513 int mem_base;
20514 xmlNodePtr ret_val;
20515 xmlDocPtr doc; /* the document */
20516 int n_doc;
Daniel Veillardce682bc2004-11-05 17:22:25 +000020517 xmlChar * name; /* the reference name, or the reference string with & and ; */
Daniel Veillardd93f6252004-11-02 15:53:51 +000020518 int n_name;
20519
20520 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20521 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20522 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000020523 doc = gen_xmlDocPtr(n_doc, 0);
20524 name = gen_const_xmlChar_ptr(n_name, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020525
20526 ret_val = xmlNewReference(doc, name);
20527 desret_xmlNodePtr(ret_val);
20528 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000020529 des_xmlDocPtr(n_doc, doc, 0);
20530 des_const_xmlChar_ptr(n_name, name, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020531 xmlResetLastError();
20532 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000020533 printf("Leak of %d blocks found in xmlNewReference",
Daniel Veillardd93f6252004-11-02 15:53:51 +000020534 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020535 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000020536 printf(" %d", n_doc);
20537 printf(" %d", n_name);
20538 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000020539 }
20540 }
20541 }
20542
Daniel Veillard3d97e662004-11-04 10:49:00 +000020543 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020544 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020545}
20546
20547
20548static int
20549test_xmlNewText(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020550 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020551
20552 int mem_base;
20553 xmlNodePtr ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000020554 xmlChar * content; /* the text content */
Daniel Veillardd93f6252004-11-02 15:53:51 +000020555 int n_content;
20556
20557 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20558 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000020559 content = gen_const_xmlChar_ptr(n_content, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020560
20561 ret_val = xmlNewText(content);
20562 desret_xmlNodePtr(ret_val);
20563 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000020564 des_const_xmlChar_ptr(n_content, content, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020565 xmlResetLastError();
20566 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000020567 printf("Leak of %d blocks found in xmlNewText",
Daniel Veillardd93f6252004-11-02 15:53:51 +000020568 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020569 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000020570 printf(" %d", n_content);
20571 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000020572 }
20573 }
20574
Daniel Veillard3d97e662004-11-04 10:49:00 +000020575 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020576 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020577}
20578
20579
20580static int
20581test_xmlNewTextChild(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020582 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020583
Daniel Veillard27f20102004-11-05 11:50:11 +000020584 int mem_base;
20585 xmlNodePtr ret_val;
20586 xmlNodePtr parent; /* the parent node */
20587 int n_parent;
20588 xmlNsPtr ns; /* a namespace if any */
20589 int n_ns;
Daniel Veillardce682bc2004-11-05 17:22:25 +000020590 xmlChar * name; /* the name of the child */
Daniel Veillard27f20102004-11-05 11:50:11 +000020591 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000020592 xmlChar * content; /* the text content of the child if any. */
Daniel Veillard27f20102004-11-05 11:50:11 +000020593 int n_content;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020594
Daniel Veillard27f20102004-11-05 11:50:11 +000020595 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20596 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20597 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20598 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20599 mem_base = xmlMemBlocks();
20600 parent = gen_xmlNodePtr(n_parent, 0);
20601 ns = gen_xmlNsPtr(n_ns, 1);
20602 name = gen_const_xmlChar_ptr(n_name, 2);
20603 content = gen_const_xmlChar_ptr(n_content, 3);
20604
20605 ret_val = xmlNewTextChild(parent, ns, name, content);
20606 desret_xmlNodePtr(ret_val);
20607 call_tests++;
20608 des_xmlNodePtr(n_parent, parent, 0);
20609 des_xmlNsPtr(n_ns, ns, 1);
20610 des_const_xmlChar_ptr(n_name, name, 2);
20611 des_const_xmlChar_ptr(n_content, content, 3);
20612 xmlResetLastError();
20613 if (mem_base != xmlMemBlocks()) {
20614 printf("Leak of %d blocks found in xmlNewTextChild",
20615 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020616 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000020617 printf(" %d", n_parent);
20618 printf(" %d", n_ns);
20619 printf(" %d", n_name);
20620 printf(" %d", n_content);
20621 printf("\n");
20622 }
20623 }
20624 }
20625 }
20626 }
20627
20628 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020629 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020630}
20631
20632
20633static int
20634test_xmlNewTextLen(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020635 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020636
20637 int mem_base;
20638 xmlNodePtr ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000020639 xmlChar * content; /* the text content */
Daniel Veillardd93f6252004-11-02 15:53:51 +000020640 int n_content;
20641 int len; /* the text len. */
20642 int n_len;
20643
20644 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20645 for (n_len = 0;n_len < gen_nb_int;n_len++) {
20646 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000020647 content = gen_const_xmlChar_ptr(n_content, 0);
20648 len = gen_int(n_len, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020649
20650 ret_val = xmlNewTextLen(content, len);
20651 desret_xmlNodePtr(ret_val);
20652 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000020653 des_const_xmlChar_ptr(n_content, content, 0);
20654 des_int(n_len, len, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020655 xmlResetLastError();
20656 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000020657 printf("Leak of %d blocks found in xmlNewTextLen",
Daniel Veillardd93f6252004-11-02 15:53:51 +000020658 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020659 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000020660 printf(" %d", n_content);
20661 printf(" %d", n_len);
20662 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000020663 }
20664 }
20665 }
20666
Daniel Veillard3d97e662004-11-04 10:49:00 +000020667 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020668 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020669}
20670
20671
20672static int
20673test_xmlNodeAddContent(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020674 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020675
20676 int mem_base;
20677 xmlNodePtr cur; /* the node being modified */
20678 int n_cur;
Daniel Veillardce682bc2004-11-05 17:22:25 +000020679 xmlChar * content; /* extra content */
Daniel Veillardd93f6252004-11-02 15:53:51 +000020680 int n_content;
20681
20682 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20683 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20684 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000020685 cur = gen_xmlNodePtr(n_cur, 0);
20686 content = gen_const_xmlChar_ptr(n_content, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020687
20688 xmlNodeAddContent(cur, content);
20689 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000020690 des_xmlNodePtr(n_cur, cur, 0);
20691 des_const_xmlChar_ptr(n_content, content, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020692 xmlResetLastError();
20693 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000020694 printf("Leak of %d blocks found in xmlNodeAddContent",
Daniel Veillardd93f6252004-11-02 15:53:51 +000020695 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020696 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000020697 printf(" %d", n_cur);
20698 printf(" %d", n_content);
20699 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000020700 }
20701 }
20702 }
20703
Daniel Veillard3d97e662004-11-04 10:49:00 +000020704 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020705 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020706}
20707
20708
20709static int
20710test_xmlNodeAddContentLen(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020711 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020712
20713 int mem_base;
20714 xmlNodePtr cur; /* the node being modified */
20715 int n_cur;
Daniel Veillardce682bc2004-11-05 17:22:25 +000020716 xmlChar * content; /* extra content */
Daniel Veillardd93f6252004-11-02 15:53:51 +000020717 int n_content;
20718 int len; /* the size of @content */
20719 int n_len;
20720
20721 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20722 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20723 for (n_len = 0;n_len < gen_nb_int;n_len++) {
20724 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000020725 cur = gen_xmlNodePtr(n_cur, 0);
20726 content = gen_const_xmlChar_ptr(n_content, 1);
20727 len = gen_int(n_len, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020728
20729 xmlNodeAddContentLen(cur, content, len);
20730 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000020731 des_xmlNodePtr(n_cur, cur, 0);
20732 des_const_xmlChar_ptr(n_content, content, 1);
20733 des_int(n_len, len, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020734 xmlResetLastError();
20735 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000020736 printf("Leak of %d blocks found in xmlNodeAddContentLen",
Daniel Veillardd93f6252004-11-02 15:53:51 +000020737 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020738 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000020739 printf(" %d", n_cur);
20740 printf(" %d", n_content);
20741 printf(" %d", n_len);
20742 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000020743 }
20744 }
20745 }
20746 }
20747
Daniel Veillard3d97e662004-11-04 10:49:00 +000020748 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020749 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020750}
20751
20752
20753static int
20754test_xmlNodeBufGetContent(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020755 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020756
Daniel Veillardd005b9e2004-11-03 17:07:05 +000020757 int mem_base;
20758 int ret_val;
20759 xmlBufferPtr buffer; /* a buffer */
20760 int n_buffer;
20761 xmlNodePtr cur; /* the node being read */
20762 int n_cur;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020763
Daniel Veillardd005b9e2004-11-03 17:07:05 +000020764 for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
20765 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20766 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000020767 buffer = gen_xmlBufferPtr(n_buffer, 0);
20768 cur = gen_xmlNodePtr(n_cur, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000020769
20770 ret_val = xmlNodeBufGetContent(buffer, cur);
20771 desret_int(ret_val);
20772 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000020773 des_xmlBufferPtr(n_buffer, buffer, 0);
20774 des_xmlNodePtr(n_cur, cur, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000020775 xmlResetLastError();
20776 if (mem_base != xmlMemBlocks()) {
20777 printf("Leak of %d blocks found in xmlNodeBufGetContent",
20778 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020779 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000020780 printf(" %d", n_buffer);
20781 printf(" %d", n_cur);
20782 printf("\n");
20783 }
20784 }
20785 }
20786
Daniel Veillard3d97e662004-11-04 10:49:00 +000020787 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020788 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020789}
20790
20791
20792static int
20793test_xmlNodeDump(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020794 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020795
Daniel Veillardd005b9e2004-11-03 17:07:05 +000020796#ifdef LIBXML_OUTPUT_ENABLED
20797 int mem_base;
20798 int ret_val;
20799 xmlBufferPtr buf; /* the XML buffer output */
20800 int n_buf;
20801 xmlDocPtr doc; /* the document */
20802 int n_doc;
20803 xmlNodePtr cur; /* the current node */
20804 int n_cur;
20805 int level; /* the imbrication level for indenting */
20806 int n_level;
20807 int format; /* is formatting allowed */
20808 int n_format;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020809
Daniel Veillardd005b9e2004-11-03 17:07:05 +000020810 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
20811 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20812 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20813 for (n_level = 0;n_level < gen_nb_int;n_level++) {
20814 for (n_format = 0;n_format < gen_nb_int;n_format++) {
20815 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000020816 buf = gen_xmlBufferPtr(n_buf, 0);
20817 doc = gen_xmlDocPtr(n_doc, 1);
20818 cur = gen_xmlNodePtr(n_cur, 2);
20819 level = gen_int(n_level, 3);
20820 format = gen_int(n_format, 4);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000020821
20822 ret_val = xmlNodeDump(buf, doc, cur, level, format);
20823 desret_int(ret_val);
20824 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000020825 des_xmlBufferPtr(n_buf, buf, 0);
20826 des_xmlDocPtr(n_doc, doc, 1);
20827 des_xmlNodePtr(n_cur, cur, 2);
20828 des_int(n_level, level, 3);
20829 des_int(n_format, format, 4);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000020830 xmlResetLastError();
20831 if (mem_base != xmlMemBlocks()) {
20832 printf("Leak of %d blocks found in xmlNodeDump",
20833 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020834 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000020835 printf(" %d", n_buf);
20836 printf(" %d", n_doc);
20837 printf(" %d", n_cur);
20838 printf(" %d", n_level);
20839 printf(" %d", n_format);
20840 printf("\n");
20841 }
20842 }
20843 }
20844 }
20845 }
20846 }
20847#endif
20848
Daniel Veillard3d97e662004-11-04 10:49:00 +000020849 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020850 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020851}
20852
20853
20854static int
20855test_xmlNodeDumpOutput(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020856 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020857
Daniel Veillard3d97e662004-11-04 10:49:00 +000020858#ifdef LIBXML_OUTPUT_ENABLED
20859 int mem_base;
20860 xmlOutputBufferPtr buf; /* the XML buffer output */
20861 int n_buf;
20862 xmlDocPtr doc; /* the document */
20863 int n_doc;
20864 xmlNodePtr cur; /* the current node */
20865 int n_cur;
20866 int level; /* the imbrication level for indenting */
20867 int n_level;
20868 int format; /* is formatting allowed */
20869 int n_format;
Daniel Veillardce682bc2004-11-05 17:22:25 +000020870 char * encoding; /* an optional encoding string */
Daniel Veillard3d97e662004-11-04 10:49:00 +000020871 int n_encoding;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020872
Daniel Veillard3d97e662004-11-04 10:49:00 +000020873 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
20874 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20875 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20876 for (n_level = 0;n_level < gen_nb_int;n_level++) {
20877 for (n_format = 0;n_format < gen_nb_int;n_format++) {
20878 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
20879 mem_base = xmlMemBlocks();
20880 buf = gen_xmlOutputBufferPtr(n_buf, 0);
20881 doc = gen_xmlDocPtr(n_doc, 1);
20882 cur = gen_xmlNodePtr(n_cur, 2);
20883 level = gen_int(n_level, 3);
20884 format = gen_int(n_format, 4);
20885 encoding = gen_const_char_ptr(n_encoding, 5);
20886
20887 xmlNodeDumpOutput(buf, doc, cur, level, format, encoding);
20888 call_tests++;
20889 des_xmlOutputBufferPtr(n_buf, buf, 0);
20890 des_xmlDocPtr(n_doc, doc, 1);
20891 des_xmlNodePtr(n_cur, cur, 2);
20892 des_int(n_level, level, 3);
20893 des_int(n_format, format, 4);
20894 des_const_char_ptr(n_encoding, encoding, 5);
20895 xmlResetLastError();
20896 if (mem_base != xmlMemBlocks()) {
20897 printf("Leak of %d blocks found in xmlNodeDumpOutput",
20898 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020899 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000020900 printf(" %d", n_buf);
20901 printf(" %d", n_doc);
20902 printf(" %d", n_cur);
20903 printf(" %d", n_level);
20904 printf(" %d", n_format);
20905 printf(" %d", n_encoding);
20906 printf("\n");
20907 }
20908 }
20909 }
20910 }
20911 }
20912 }
20913 }
20914#endif
20915
20916 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020917 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020918}
20919
20920
20921static int
20922test_xmlNodeGetBase(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020923 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020924
Daniel Veillard8a32fe42004-11-02 22:10:16 +000020925 int mem_base;
20926 xmlChar * ret_val;
20927 xmlDocPtr doc; /* the document the node pertains to */
20928 int n_doc;
20929 xmlNodePtr cur; /* the node being checked */
20930 int n_cur;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020931
Daniel Veillard8a32fe42004-11-02 22:10:16 +000020932 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20933 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20934 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000020935 doc = gen_xmlDocPtr(n_doc, 0);
20936 cur = gen_xmlNodePtr(n_cur, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000020937
20938 ret_val = xmlNodeGetBase(doc, cur);
20939 desret_xmlChar_ptr(ret_val);
20940 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000020941 des_xmlDocPtr(n_doc, doc, 0);
20942 des_xmlNodePtr(n_cur, cur, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000020943 xmlResetLastError();
20944 if (mem_base != xmlMemBlocks()) {
20945 printf("Leak of %d blocks found in xmlNodeGetBase",
20946 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020947 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000020948 printf(" %d", n_doc);
20949 printf(" %d", n_cur);
20950 printf("\n");
20951 }
20952 }
20953 }
20954
Daniel Veillard3d97e662004-11-04 10:49:00 +000020955 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020956 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020957}
20958
20959
20960static int
20961test_xmlNodeGetContent(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020962 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020963
Daniel Veillard8a32fe42004-11-02 22:10:16 +000020964 int mem_base;
20965 xmlChar * ret_val;
20966 xmlNodePtr cur; /* the node being read */
20967 int n_cur;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020968
Daniel Veillard8a32fe42004-11-02 22:10:16 +000020969 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20970 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000020971 cur = gen_xmlNodePtr(n_cur, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000020972
20973 ret_val = xmlNodeGetContent(cur);
20974 desret_xmlChar_ptr(ret_val);
20975 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000020976 des_xmlNodePtr(n_cur, cur, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000020977 xmlResetLastError();
20978 if (mem_base != xmlMemBlocks()) {
20979 printf("Leak of %d blocks found in xmlNodeGetContent",
20980 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000020981 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000020982 printf(" %d", n_cur);
20983 printf("\n");
20984 }
20985 }
20986
Daniel Veillard3d97e662004-11-04 10:49:00 +000020987 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000020988 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000020989}
20990
20991
20992static int
20993test_xmlNodeGetLang(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000020994 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000020995
Daniel Veillard8a32fe42004-11-02 22:10:16 +000020996 int mem_base;
20997 xmlChar * ret_val;
20998 xmlNodePtr cur; /* the node being checked */
20999 int n_cur;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021000
Daniel Veillard8a32fe42004-11-02 22:10:16 +000021001 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21002 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000021003 cur = gen_xmlNodePtr(n_cur, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000021004
21005 ret_val = xmlNodeGetLang(cur);
21006 desret_xmlChar_ptr(ret_val);
21007 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000021008 des_xmlNodePtr(n_cur, cur, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000021009 xmlResetLastError();
21010 if (mem_base != xmlMemBlocks()) {
21011 printf("Leak of %d blocks found in xmlNodeGetLang",
21012 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021013 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000021014 printf(" %d", n_cur);
21015 printf("\n");
21016 }
21017 }
21018
Daniel Veillard3d97e662004-11-04 10:49:00 +000021019 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021020 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021021}
21022
21023
21024static int
21025test_xmlNodeGetSpacePreserve(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021026 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021027
21028 int mem_base;
21029 int ret_val;
21030 xmlNodePtr cur; /* the node being checked */
21031 int n_cur;
21032
21033 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21034 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000021035 cur = gen_xmlNodePtr(n_cur, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021036
21037 ret_val = xmlNodeGetSpacePreserve(cur);
21038 desret_int(ret_val);
21039 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000021040 des_xmlNodePtr(n_cur, cur, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021041 xmlResetLastError();
21042 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000021043 printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
Daniel Veillardd93f6252004-11-02 15:53:51 +000021044 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021045 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000021046 printf(" %d", n_cur);
21047 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000021048 }
21049 }
21050
Daniel Veillard3d97e662004-11-04 10:49:00 +000021051 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021052 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021053}
21054
21055
21056static int
21057test_xmlNodeIsText(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021058 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021059
21060 int mem_base;
21061 int ret_val;
21062 xmlNodePtr node; /* the node */
21063 int n_node;
21064
21065 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21066 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000021067 node = gen_xmlNodePtr(n_node, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021068
21069 ret_val = xmlNodeIsText(node);
21070 desret_int(ret_val);
21071 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000021072 des_xmlNodePtr(n_node, node, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021073 xmlResetLastError();
21074 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000021075 printf("Leak of %d blocks found in xmlNodeIsText",
Daniel Veillardd93f6252004-11-02 15:53:51 +000021076 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021077 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000021078 printf(" %d", n_node);
21079 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000021080 }
21081 }
21082
Daniel Veillard3d97e662004-11-04 10:49:00 +000021083 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021084 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021085}
21086
21087
21088static int
21089test_xmlNodeListGetRawString(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021090 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021091
Daniel Veillard8a32fe42004-11-02 22:10:16 +000021092#ifdef LIBXML_TREE_ENABLED
21093 int mem_base;
21094 xmlChar * ret_val;
21095 xmlDocPtr doc; /* the document */
21096 int n_doc;
21097 xmlNodePtr list; /* a Node list */
21098 int n_list;
21099 int inLine; /* should we replace entity contents or show their external form */
21100 int n_inLine;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021101
Daniel Veillard8a32fe42004-11-02 22:10:16 +000021102 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21103 for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
21104 for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
21105 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000021106 doc = gen_xmlDocPtr(n_doc, 0);
21107 list = gen_xmlNodePtr(n_list, 1);
21108 inLine = gen_int(n_inLine, 2);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000021109
21110 ret_val = xmlNodeListGetRawString(doc, list, inLine);
21111 desret_xmlChar_ptr(ret_val);
21112 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000021113 des_xmlDocPtr(n_doc, doc, 0);
21114 des_xmlNodePtr(n_list, list, 1);
21115 des_int(n_inLine, inLine, 2);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000021116 xmlResetLastError();
21117 if (mem_base != xmlMemBlocks()) {
21118 printf("Leak of %d blocks found in xmlNodeListGetRawString",
21119 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021120 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000021121 printf(" %d", n_doc);
21122 printf(" %d", n_list);
21123 printf(" %d", n_inLine);
21124 printf("\n");
21125 }
21126 }
21127 }
21128 }
21129#endif
21130
Daniel Veillard3d97e662004-11-04 10:49:00 +000021131 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021132 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021133}
21134
21135
21136static int
21137test_xmlNodeListGetString(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021138 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021139
Daniel Veillard8a32fe42004-11-02 22:10:16 +000021140 int mem_base;
21141 xmlChar * ret_val;
21142 xmlDocPtr doc; /* the document */
21143 int n_doc;
21144 xmlNodePtr list; /* a Node list */
21145 int n_list;
21146 int inLine; /* should we replace entity contents or show their external form */
21147 int n_inLine;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021148
Daniel Veillard8a32fe42004-11-02 22:10:16 +000021149 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21150 for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
21151 for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
21152 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000021153 doc = gen_xmlDocPtr(n_doc, 0);
21154 list = gen_xmlNodePtr(n_list, 1);
21155 inLine = gen_int(n_inLine, 2);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000021156
21157 ret_val = xmlNodeListGetString(doc, list, inLine);
21158 desret_xmlChar_ptr(ret_val);
21159 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000021160 des_xmlDocPtr(n_doc, doc, 0);
21161 des_xmlNodePtr(n_list, list, 1);
21162 des_int(n_inLine, inLine, 2);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000021163 xmlResetLastError();
21164 if (mem_base != xmlMemBlocks()) {
21165 printf("Leak of %d blocks found in xmlNodeListGetString",
21166 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021167 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000021168 printf(" %d", n_doc);
21169 printf(" %d", n_list);
21170 printf(" %d", n_inLine);
21171 printf("\n");
21172 }
21173 }
21174 }
21175 }
21176
Daniel Veillard3d97e662004-11-04 10:49:00 +000021177 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021178 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021179}
21180
21181
21182static int
21183test_xmlNodeSetBase(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021184 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021185
21186#ifdef LIBXML_TREE_ENABLED
21187 int mem_base;
21188 xmlNodePtr cur; /* the node being changed */
21189 int n_cur;
Daniel Veillardce682bc2004-11-05 17:22:25 +000021190 xmlChar * uri; /* the new base URI */
Daniel Veillardd93f6252004-11-02 15:53:51 +000021191 int n_uri;
21192
21193 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21194 for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
21195 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000021196 cur = gen_xmlNodePtr(n_cur, 0);
21197 uri = gen_const_xmlChar_ptr(n_uri, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021198
21199 xmlNodeSetBase(cur, uri);
21200 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000021201 des_xmlNodePtr(n_cur, cur, 0);
21202 des_const_xmlChar_ptr(n_uri, uri, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021203 xmlResetLastError();
21204 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000021205 printf("Leak of %d blocks found in xmlNodeSetBase",
Daniel Veillardd93f6252004-11-02 15:53:51 +000021206 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021207 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000021208 printf(" %d", n_cur);
21209 printf(" %d", n_uri);
21210 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000021211 }
21212 }
21213 }
21214#endif
21215
Daniel Veillard3d97e662004-11-04 10:49:00 +000021216 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021217 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021218}
21219
21220
21221static int
21222test_xmlNodeSetContent(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021223 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021224
21225 int mem_base;
21226 xmlNodePtr cur; /* the node being modified */
21227 int n_cur;
Daniel Veillardce682bc2004-11-05 17:22:25 +000021228 xmlChar * content; /* the new value of the content */
Daniel Veillardd93f6252004-11-02 15:53:51 +000021229 int n_content;
21230
21231 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21232 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21233 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000021234 cur = gen_xmlNodePtr(n_cur, 0);
21235 content = gen_const_xmlChar_ptr(n_content, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021236
21237 xmlNodeSetContent(cur, content);
21238 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000021239 des_xmlNodePtr(n_cur, cur, 0);
21240 des_const_xmlChar_ptr(n_content, content, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021241 xmlResetLastError();
21242 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000021243 printf("Leak of %d blocks found in xmlNodeSetContent",
Daniel Veillardd93f6252004-11-02 15:53:51 +000021244 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021245 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000021246 printf(" %d", n_cur);
21247 printf(" %d", n_content);
21248 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000021249 }
21250 }
21251 }
21252
Daniel Veillard3d97e662004-11-04 10:49:00 +000021253 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021254 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021255}
21256
21257
21258static int
21259test_xmlNodeSetContentLen(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021260 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021261
21262#ifdef LIBXML_TREE_ENABLED
21263 int mem_base;
21264 xmlNodePtr cur; /* the node being modified */
21265 int n_cur;
Daniel Veillardce682bc2004-11-05 17:22:25 +000021266 xmlChar * content; /* the new value of the content */
Daniel Veillardd93f6252004-11-02 15:53:51 +000021267 int n_content;
21268 int len; /* the size of @content */
21269 int n_len;
21270
21271 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21272 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21273 for (n_len = 0;n_len < gen_nb_int;n_len++) {
21274 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000021275 cur = gen_xmlNodePtr(n_cur, 0);
21276 content = gen_const_xmlChar_ptr(n_content, 1);
21277 len = gen_int(n_len, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021278
21279 xmlNodeSetContentLen(cur, content, len);
21280 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000021281 des_xmlNodePtr(n_cur, cur, 0);
21282 des_const_xmlChar_ptr(n_content, content, 1);
21283 des_int(n_len, len, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021284 xmlResetLastError();
21285 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000021286 printf("Leak of %d blocks found in xmlNodeSetContentLen",
Daniel Veillardd93f6252004-11-02 15:53:51 +000021287 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021288 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000021289 printf(" %d", n_cur);
21290 printf(" %d", n_content);
21291 printf(" %d", n_len);
21292 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000021293 }
21294 }
21295 }
21296 }
21297#endif
21298
Daniel Veillard3d97e662004-11-04 10:49:00 +000021299 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021300 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021301}
21302
21303
21304static int
21305test_xmlNodeSetLang(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021306 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021307
21308#ifdef LIBXML_TREE_ENABLED
21309 int mem_base;
21310 xmlNodePtr cur; /* the node being changed */
21311 int n_cur;
Daniel Veillardce682bc2004-11-05 17:22:25 +000021312 xmlChar * lang; /* the language description */
Daniel Veillardd93f6252004-11-02 15:53:51 +000021313 int n_lang;
21314
21315 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21316 for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
21317 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000021318 cur = gen_xmlNodePtr(n_cur, 0);
21319 lang = gen_const_xmlChar_ptr(n_lang, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021320
21321 xmlNodeSetLang(cur, lang);
21322 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000021323 des_xmlNodePtr(n_cur, cur, 0);
21324 des_const_xmlChar_ptr(n_lang, lang, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021325 xmlResetLastError();
21326 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000021327 printf("Leak of %d blocks found in xmlNodeSetLang",
Daniel Veillardd93f6252004-11-02 15:53:51 +000021328 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021329 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000021330 printf(" %d", n_cur);
21331 printf(" %d", n_lang);
21332 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000021333 }
21334 }
21335 }
21336#endif
21337
Daniel Veillard3d97e662004-11-04 10:49:00 +000021338 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021339 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021340}
21341
21342
21343static int
21344test_xmlNodeSetName(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021345 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021346
21347#ifdef LIBXML_TREE_ENABLED
21348 int mem_base;
21349 xmlNodePtr cur; /* the node being changed */
21350 int n_cur;
Daniel Veillardce682bc2004-11-05 17:22:25 +000021351 xmlChar * name; /* the new tag name */
Daniel Veillardd93f6252004-11-02 15:53:51 +000021352 int n_name;
21353
21354 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21355 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21356 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000021357 cur = gen_xmlNodePtr(n_cur, 0);
21358 name = gen_const_xmlChar_ptr(n_name, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021359
21360 xmlNodeSetName(cur, name);
21361 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000021362 des_xmlNodePtr(n_cur, cur, 0);
21363 des_const_xmlChar_ptr(n_name, name, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021364 xmlResetLastError();
21365 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000021366 printf("Leak of %d blocks found in xmlNodeSetName",
Daniel Veillardd93f6252004-11-02 15:53:51 +000021367 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021368 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000021369 printf(" %d", n_cur);
21370 printf(" %d", n_name);
21371 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000021372 }
21373 }
21374 }
21375#endif
21376
Daniel Veillard3d97e662004-11-04 10:49:00 +000021377 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021378 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021379}
21380
21381
21382static int
21383test_xmlNodeSetSpacePreserve(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021384 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021385
21386#ifdef LIBXML_TREE_ENABLED
21387 int mem_base;
21388 xmlNodePtr cur; /* the node being changed */
21389 int n_cur;
21390 int val; /* the xml:space value ("0": default, 1: "preserve") */
21391 int n_val;
21392
21393 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21394 for (n_val = 0;n_val < gen_nb_int;n_val++) {
21395 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000021396 cur = gen_xmlNodePtr(n_cur, 0);
21397 val = gen_int(n_val, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021398
21399 xmlNodeSetSpacePreserve(cur, val);
21400 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000021401 des_xmlNodePtr(n_cur, cur, 0);
21402 des_int(n_val, val, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021403 xmlResetLastError();
21404 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000021405 printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
Daniel Veillardd93f6252004-11-02 15:53:51 +000021406 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021407 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000021408 printf(" %d", n_cur);
21409 printf(" %d", n_val);
21410 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000021411 }
21412 }
21413 }
21414#endif
21415
Daniel Veillard3d97e662004-11-04 10:49:00 +000021416 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021417 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021418}
21419
21420
21421static int
21422test_xmlReconciliateNs(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021423 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021424
21425 int mem_base;
21426 int ret_val;
21427 xmlDocPtr doc; /* the document */
21428 int n_doc;
21429 xmlNodePtr tree; /* a node defining the subtree to reconciliate */
21430 int n_tree;
21431
21432 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21433 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
21434 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000021435 doc = gen_xmlDocPtr(n_doc, 0);
21436 tree = gen_xmlNodePtr(n_tree, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021437
21438 ret_val = xmlReconciliateNs(doc, tree);
21439 desret_int(ret_val);
21440 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000021441 des_xmlDocPtr(n_doc, doc, 0);
21442 des_xmlNodePtr(n_tree, tree, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021443 xmlResetLastError();
21444 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000021445 printf("Leak of %d blocks found in xmlReconciliateNs",
Daniel Veillardd93f6252004-11-02 15:53:51 +000021446 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021447 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000021448 printf(" %d", n_doc);
21449 printf(" %d", n_tree);
21450 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000021451 }
21452 }
21453 }
21454
Daniel Veillard3d97e662004-11-04 10:49:00 +000021455 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021456 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021457}
21458
21459
21460static int
21461test_xmlRemoveProp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021462 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021463
Daniel Veillardce244ad2004-11-05 10:03:46 +000021464#ifdef LIBXML_TREE_ENABLED
21465 int mem_base;
21466 int ret_val;
21467 xmlAttrPtr cur; /* an attribute */
21468 int n_cur;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021469
Daniel Veillardce244ad2004-11-05 10:03:46 +000021470 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
21471 mem_base = xmlMemBlocks();
21472 cur = gen_xmlAttrPtr(n_cur, 0);
21473
21474 ret_val = xmlRemoveProp(cur);
21475 cur = NULL;
21476 desret_int(ret_val);
21477 call_tests++;
21478 des_xmlAttrPtr(n_cur, cur, 0);
21479 xmlResetLastError();
21480 if (mem_base != xmlMemBlocks()) {
21481 printf("Leak of %d blocks found in xmlRemoveProp",
21482 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021483 test_ret++;
Daniel Veillardce244ad2004-11-05 10:03:46 +000021484 printf(" %d", n_cur);
21485 printf("\n");
21486 }
21487 }
21488#endif
21489
21490 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021491 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021492}
21493
21494
21495static int
21496test_xmlReplaceNode(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021497 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021498
21499#ifdef LIBXML_TREE_ENABLED
21500 int mem_base;
21501 xmlNodePtr ret_val;
21502 xmlNodePtr old; /* the old node */
21503 int n_old;
21504 xmlNodePtr cur; /* the node */
21505 int n_cur;
21506
21507 for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000021508 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
Daniel Veillardd93f6252004-11-02 15:53:51 +000021509 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000021510 old = gen_xmlNodePtr(n_old, 0);
21511 cur = gen_xmlNodePtr_in(n_cur, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021512
21513 ret_val = xmlReplaceNode(old, cur);
Daniel Veillardce244ad2004-11-05 10:03:46 +000021514 if (cur != NULL) {
21515 xmlUnlinkNode(cur);
Daniel Veillarda03e3652004-11-02 18:45:30 +000021516 xmlFreeNode(cur) ; cur = NULL ; }
Daniel Veillardce244ad2004-11-05 10:03:46 +000021517 if (old != NULL) {
21518 xmlUnlinkNode(old);
21519 xmlFreeNode(old) ; old = NULL ; }
21520 ret_val = NULL;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000021521 desret_xmlNodePtr(ret_val);
21522 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000021523 des_xmlNodePtr(n_old, old, 0);
21524 des_xmlNodePtr_in(n_cur, cur, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021525 xmlResetLastError();
21526 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000021527 printf("Leak of %d blocks found in xmlReplaceNode",
Daniel Veillardd93f6252004-11-02 15:53:51 +000021528 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021529 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000021530 printf(" %d", n_old);
21531 printf(" %d", n_cur);
21532 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000021533 }
21534 }
21535 }
21536#endif
21537
Daniel Veillard3d97e662004-11-04 10:49:00 +000021538 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021539 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021540}
21541
21542
21543static int
21544test_xmlSaveFile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021545 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021546
21547#ifdef LIBXML_OUTPUT_ENABLED
21548 int mem_base;
21549 int ret_val;
21550 const char * filename; /* the filename (or URL) */
21551 int n_filename;
21552 xmlDocPtr cur; /* the document */
21553 int n_cur;
21554
21555 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
21556 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
21557 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000021558 filename = gen_fileoutput(n_filename, 0);
21559 cur = gen_xmlDocPtr(n_cur, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021560
21561 ret_val = xmlSaveFile(filename, cur);
21562 desret_int(ret_val);
21563 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000021564 des_fileoutput(n_filename, filename, 0);
21565 des_xmlDocPtr(n_cur, cur, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021566 xmlResetLastError();
21567 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000021568 printf("Leak of %d blocks found in xmlSaveFile",
Daniel Veillardd93f6252004-11-02 15:53:51 +000021569 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021570 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000021571 printf(" %d", n_filename);
21572 printf(" %d", n_cur);
21573 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000021574 }
21575 }
21576 }
21577#endif
21578
Daniel Veillard3d97e662004-11-04 10:49:00 +000021579 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021580 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021581}
21582
21583
21584static int
21585test_xmlSaveFileEnc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021586 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021587
21588#ifdef LIBXML_OUTPUT_ENABLED
21589 int mem_base;
21590 int ret_val;
21591 const char * filename; /* the filename (or URL) */
21592 int n_filename;
21593 xmlDocPtr cur; /* the document */
21594 int n_cur;
Daniel Veillardce682bc2004-11-05 17:22:25 +000021595 char * encoding; /* the name of an encoding (or NULL) */
Daniel Veillardd93f6252004-11-02 15:53:51 +000021596 int n_encoding;
21597
21598 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
21599 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
21600 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
21601 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000021602 filename = gen_fileoutput(n_filename, 0);
21603 cur = gen_xmlDocPtr(n_cur, 1);
21604 encoding = gen_const_char_ptr(n_encoding, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021605
21606 ret_val = xmlSaveFileEnc(filename, cur, encoding);
21607 desret_int(ret_val);
21608 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000021609 des_fileoutput(n_filename, filename, 0);
21610 des_xmlDocPtr(n_cur, cur, 1);
21611 des_const_char_ptr(n_encoding, encoding, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021612 xmlResetLastError();
21613 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000021614 printf("Leak of %d blocks found in xmlSaveFileEnc",
Daniel Veillardd93f6252004-11-02 15:53:51 +000021615 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021616 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000021617 printf(" %d", n_filename);
21618 printf(" %d", n_cur);
21619 printf(" %d", n_encoding);
21620 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000021621 }
21622 }
21623 }
21624 }
21625#endif
21626
Daniel Veillard3d97e662004-11-04 10:49:00 +000021627 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021628 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021629}
21630
21631
21632static int
21633test_xmlSaveFileTo(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021634 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021635
Daniel Veillard3d97e662004-11-04 10:49:00 +000021636#ifdef LIBXML_OUTPUT_ENABLED
21637 int mem_base;
21638 int ret_val;
21639 xmlOutputBufferPtr buf; /* an output I/O buffer */
21640 int n_buf;
21641 xmlDocPtr cur; /* the document */
21642 int n_cur;
Daniel Veillardce682bc2004-11-05 17:22:25 +000021643 char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
Daniel Veillard3d97e662004-11-04 10:49:00 +000021644 int n_encoding;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021645
Daniel Veillard3d97e662004-11-04 10:49:00 +000021646 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
21647 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
21648 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
21649 mem_base = xmlMemBlocks();
21650 buf = gen_xmlOutputBufferPtr(n_buf, 0);
21651 cur = gen_xmlDocPtr(n_cur, 1);
21652 encoding = gen_const_char_ptr(n_encoding, 2);
21653
21654 ret_val = xmlSaveFileTo(buf, cur, encoding);
21655 buf = NULL;
21656 desret_int(ret_val);
21657 call_tests++;
21658 des_xmlOutputBufferPtr(n_buf, buf, 0);
21659 des_xmlDocPtr(n_cur, cur, 1);
21660 des_const_char_ptr(n_encoding, encoding, 2);
21661 xmlResetLastError();
21662 if (mem_base != xmlMemBlocks()) {
21663 printf("Leak of %d blocks found in xmlSaveFileTo",
21664 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021665 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000021666 printf(" %d", n_buf);
21667 printf(" %d", n_cur);
21668 printf(" %d", n_encoding);
21669 printf("\n");
21670 }
21671 }
21672 }
21673 }
21674#endif
21675
21676 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021677 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021678}
21679
21680
21681static int
21682test_xmlSaveFormatFile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021683 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021684
21685#ifdef LIBXML_OUTPUT_ENABLED
21686 int mem_base;
21687 int ret_val;
21688 const char * filename; /* the filename (or URL) */
21689 int n_filename;
21690 xmlDocPtr cur; /* the document */
21691 int n_cur;
21692 int format; /* should formatting spaces been added */
21693 int n_format;
21694
21695 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
21696 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
21697 for (n_format = 0;n_format < gen_nb_int;n_format++) {
21698 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000021699 filename = gen_fileoutput(n_filename, 0);
21700 cur = gen_xmlDocPtr(n_cur, 1);
21701 format = gen_int(n_format, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021702
21703 ret_val = xmlSaveFormatFile(filename, cur, format);
21704 desret_int(ret_val);
21705 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000021706 des_fileoutput(n_filename, filename, 0);
21707 des_xmlDocPtr(n_cur, cur, 1);
21708 des_int(n_format, format, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021709 xmlResetLastError();
21710 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000021711 printf("Leak of %d blocks found in xmlSaveFormatFile",
Daniel Veillardd93f6252004-11-02 15:53:51 +000021712 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021713 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000021714 printf(" %d", n_filename);
21715 printf(" %d", n_cur);
21716 printf(" %d", n_format);
21717 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000021718 }
21719 }
21720 }
21721 }
21722#endif
21723
Daniel Veillard3d97e662004-11-04 10:49:00 +000021724 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021725 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021726}
21727
21728
21729static int
21730test_xmlSaveFormatFileEnc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021731 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021732
21733#ifdef LIBXML_OUTPUT_ENABLED
21734 int mem_base;
21735 int ret_val;
21736 const char * filename; /* the filename or URL to output */
21737 int n_filename;
21738 xmlDocPtr cur; /* the document being saved */
21739 int n_cur;
Daniel Veillardce682bc2004-11-05 17:22:25 +000021740 char * encoding; /* the name of the encoding to use or NULL. */
Daniel Veillardd93f6252004-11-02 15:53:51 +000021741 int n_encoding;
21742 int format; /* should formatting spaces be added. */
21743 int n_format;
21744
21745 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
21746 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
21747 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
21748 for (n_format = 0;n_format < gen_nb_int;n_format++) {
21749 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000021750 filename = gen_fileoutput(n_filename, 0);
21751 cur = gen_xmlDocPtr(n_cur, 1);
21752 encoding = gen_const_char_ptr(n_encoding, 2);
21753 format = gen_int(n_format, 3);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021754
21755 ret_val = xmlSaveFormatFileEnc(filename, cur, encoding, format);
21756 desret_int(ret_val);
21757 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000021758 des_fileoutput(n_filename, filename, 0);
21759 des_xmlDocPtr(n_cur, cur, 1);
21760 des_const_char_ptr(n_encoding, encoding, 2);
21761 des_int(n_format, format, 3);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021762 xmlResetLastError();
21763 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000021764 printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
Daniel Veillardd93f6252004-11-02 15:53:51 +000021765 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021766 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000021767 printf(" %d", n_filename);
21768 printf(" %d", n_cur);
21769 printf(" %d", n_encoding);
21770 printf(" %d", n_format);
21771 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000021772 }
21773 }
21774 }
21775 }
21776 }
21777#endif
21778
Daniel Veillard3d97e662004-11-04 10:49:00 +000021779 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021780 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021781}
21782
21783
21784static int
21785test_xmlSaveFormatFileTo(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021786 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021787
Daniel Veillard3d97e662004-11-04 10:49:00 +000021788#ifdef LIBXML_OUTPUT_ENABLED
21789 int mem_base;
21790 int ret_val;
21791 xmlOutputBufferPtr buf; /* an output I/O buffer */
21792 int n_buf;
21793 xmlDocPtr cur; /* the document */
21794 int n_cur;
Daniel Veillardce682bc2004-11-05 17:22:25 +000021795 char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
Daniel Veillard3d97e662004-11-04 10:49:00 +000021796 int n_encoding;
21797 int format; /* should formatting spaces been added */
21798 int n_format;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021799
Daniel Veillard3d97e662004-11-04 10:49:00 +000021800 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
21801 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
21802 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
21803 for (n_format = 0;n_format < gen_nb_int;n_format++) {
21804 mem_base = xmlMemBlocks();
21805 buf = gen_xmlOutputBufferPtr(n_buf, 0);
21806 cur = gen_xmlDocPtr(n_cur, 1);
21807 encoding = gen_const_char_ptr(n_encoding, 2);
21808 format = gen_int(n_format, 3);
21809
21810 ret_val = xmlSaveFormatFileTo(buf, cur, encoding, format);
21811 buf = NULL;
21812 desret_int(ret_val);
21813 call_tests++;
21814 des_xmlOutputBufferPtr(n_buf, buf, 0);
21815 des_xmlDocPtr(n_cur, cur, 1);
21816 des_const_char_ptr(n_encoding, encoding, 2);
21817 des_int(n_format, format, 3);
21818 xmlResetLastError();
21819 if (mem_base != xmlMemBlocks()) {
21820 printf("Leak of %d blocks found in xmlSaveFormatFileTo",
21821 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021822 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000021823 printf(" %d", n_buf);
21824 printf(" %d", n_cur);
21825 printf(" %d", n_encoding);
21826 printf(" %d", n_format);
21827 printf("\n");
21828 }
21829 }
21830 }
21831 }
21832 }
21833#endif
21834
21835 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021836 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021837}
21838
21839
21840static int
21841test_xmlSearchNs(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021842 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021843
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000021844 int mem_base;
21845 xmlNsPtr ret_val;
21846 xmlDocPtr doc; /* the document */
21847 int n_doc;
21848 xmlNodePtr node; /* the current node */
21849 int n_node;
21850 xmlChar * nameSpace; /* the namespace prefix */
21851 int n_nameSpace;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021852
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000021853 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21854 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21855 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
21856 mem_base = xmlMemBlocks();
21857 doc = gen_xmlDocPtr(n_doc, 0);
21858 node = gen_xmlNodePtr(n_node, 1);
21859 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
21860
21861 ret_val = xmlSearchNs(doc, node, nameSpace);
21862 desret_xmlNsPtr(ret_val);
21863 call_tests++;
21864 des_xmlDocPtr(n_doc, doc, 0);
21865 des_xmlNodePtr(n_node, node, 1);
21866 des_const_xmlChar_ptr(n_nameSpace, nameSpace, 2);
21867 xmlResetLastError();
21868 if (mem_base != xmlMemBlocks()) {
21869 printf("Leak of %d blocks found in xmlSearchNs",
21870 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021871 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000021872 printf(" %d", n_doc);
21873 printf(" %d", n_node);
21874 printf(" %d", n_nameSpace);
21875 printf("\n");
21876 }
21877 }
21878 }
21879 }
21880
21881 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021882 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021883}
21884
21885
21886static int
21887test_xmlSearchNsByHref(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021888 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021889
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000021890 int mem_base;
21891 xmlNsPtr ret_val;
21892 xmlDocPtr doc; /* the document */
21893 int n_doc;
21894 xmlNodePtr node; /* the current node */
21895 int n_node;
21896 xmlChar * href; /* the namespace value */
21897 int n_href;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021898
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000021899 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21900 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21901 for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21902 mem_base = xmlMemBlocks();
21903 doc = gen_xmlDocPtr(n_doc, 0);
21904 node = gen_xmlNodePtr(n_node, 1);
21905 href = gen_const_xmlChar_ptr(n_href, 2);
21906
21907 ret_val = xmlSearchNsByHref(doc, node, href);
21908 desret_xmlNsPtr(ret_val);
21909 call_tests++;
21910 des_xmlDocPtr(n_doc, doc, 0);
21911 des_xmlNodePtr(n_node, node, 1);
21912 des_const_xmlChar_ptr(n_href, href, 2);
21913 xmlResetLastError();
21914 if (mem_base != xmlMemBlocks()) {
21915 printf("Leak of %d blocks found in xmlSearchNsByHref",
21916 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021917 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000021918 printf(" %d", n_doc);
21919 printf(" %d", n_node);
21920 printf(" %d", n_href);
21921 printf("\n");
21922 }
21923 }
21924 }
21925 }
21926
21927 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021928 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021929}
21930
21931
21932static int
21933test_xmlSetBufferAllocationScheme(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021934 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021935
Daniel Veillard57b25162004-11-06 14:50:18 +000021936 int mem_base;
21937 xmlBufferAllocationScheme scheme; /* allocation method to use */
21938 int n_scheme;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021939
Daniel Veillard57b25162004-11-06 14:50:18 +000021940 for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
21941 mem_base = xmlMemBlocks();
21942 scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
21943
21944 xmlSetBufferAllocationScheme(scheme);
21945 call_tests++;
21946 des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
21947 xmlResetLastError();
21948 if (mem_base != xmlMemBlocks()) {
21949 printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
21950 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021951 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +000021952 printf(" %d", n_scheme);
21953 printf("\n");
21954 }
21955 }
21956
21957 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021958 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021959}
21960
21961
21962static int
21963test_xmlSetCompressMode(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021964 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021965
21966 int mem_base;
21967 int mode; /* the compression ratio */
21968 int n_mode;
21969
21970 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
21971 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000021972 mode = gen_int(n_mode, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021973
21974 xmlSetCompressMode(mode);
21975 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000021976 des_int(n_mode, mode, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021977 xmlResetLastError();
21978 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000021979 printf("Leak of %d blocks found in xmlSetCompressMode",
Daniel Veillardd93f6252004-11-02 15:53:51 +000021980 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000021981 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000021982 printf(" %d", n_mode);
21983 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000021984 }
21985 }
21986
Daniel Veillard3d97e662004-11-04 10:49:00 +000021987 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000021988 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000021989}
21990
21991
21992static int
21993test_xmlSetDocCompressMode(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000021994 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000021995
21996 int mem_base;
21997 xmlDocPtr doc; /* the document */
21998 int n_doc;
21999 int mode; /* the compression ratio */
22000 int n_mode;
22001
22002 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22003 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
22004 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000022005 doc = gen_xmlDocPtr(n_doc, 0);
22006 mode = gen_int(n_mode, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022007
22008 xmlSetDocCompressMode(doc, mode);
22009 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000022010 des_xmlDocPtr(n_doc, doc, 0);
22011 des_int(n_mode, mode, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022012 xmlResetLastError();
22013 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000022014 printf("Leak of %d blocks found in xmlSetDocCompressMode",
Daniel Veillardd93f6252004-11-02 15:53:51 +000022015 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000022016 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000022017 printf(" %d", n_doc);
22018 printf(" %d", n_mode);
22019 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000022020 }
22021 }
22022 }
22023
Daniel Veillard3d97e662004-11-04 10:49:00 +000022024 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000022025 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022026}
22027
22028
22029static int
Daniel Veillardd93f6252004-11-02 15:53:51 +000022030test_xmlSetNs(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022031 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022032
Daniel Veillard27f20102004-11-05 11:50:11 +000022033 int mem_base;
22034 xmlNodePtr node; /* a node in the document */
22035 int n_node;
22036 xmlNsPtr ns; /* a namespace pointer */
22037 int n_ns;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022038
Daniel Veillard27f20102004-11-05 11:50:11 +000022039 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22040 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22041 mem_base = xmlMemBlocks();
22042 node = gen_xmlNodePtr(n_node, 0);
22043 ns = gen_xmlNsPtr(n_ns, 1);
22044
22045 xmlSetNs(node, ns);
22046 call_tests++;
22047 des_xmlNodePtr(n_node, node, 0);
22048 des_xmlNsPtr(n_ns, ns, 1);
22049 xmlResetLastError();
22050 if (mem_base != xmlMemBlocks()) {
22051 printf("Leak of %d blocks found in xmlSetNs",
22052 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000022053 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000022054 printf(" %d", n_node);
22055 printf(" %d", n_ns);
22056 printf("\n");
22057 }
22058 }
22059 }
22060
22061 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000022062 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022063}
22064
22065
22066static int
22067test_xmlSetNsProp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022068 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022069
Daniel Veillard57b25162004-11-06 14:50:18 +000022070#ifdef LIBXML_TREE_ENABLED
22071 int mem_base;
22072 xmlAttrPtr ret_val;
22073 xmlNodePtr node; /* the node */
22074 int n_node;
22075 xmlNsPtr ns; /* the namespace definition */
22076 int n_ns;
22077 xmlChar * name; /* the attribute name */
22078 int n_name;
22079 xmlChar * value; /* the attribute value */
22080 int n_value;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022081
Daniel Veillard57b25162004-11-06 14:50:18 +000022082 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22083 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22084 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22085 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22086 mem_base = xmlMemBlocks();
22087 node = gen_xmlNodePtr(n_node, 0);
22088 ns = gen_xmlNsPtr(n_ns, 1);
22089 name = gen_const_xmlChar_ptr(n_name, 2);
22090 value = gen_const_xmlChar_ptr(n_value, 3);
22091
22092 ret_val = xmlSetNsProp(node, ns, name, value);
22093 desret_xmlAttrPtr(ret_val);
22094 call_tests++;
22095 des_xmlNodePtr(n_node, node, 0);
22096 des_xmlNsPtr(n_ns, ns, 1);
22097 des_const_xmlChar_ptr(n_name, name, 2);
22098 des_const_xmlChar_ptr(n_value, value, 3);
22099 xmlResetLastError();
22100 if (mem_base != xmlMemBlocks()) {
22101 printf("Leak of %d blocks found in xmlSetNsProp",
22102 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000022103 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +000022104 printf(" %d", n_node);
22105 printf(" %d", n_ns);
22106 printf(" %d", n_name);
22107 printf(" %d", n_value);
22108 printf("\n");
22109 }
22110 }
22111 }
22112 }
22113 }
22114#endif
22115
22116 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000022117 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022118}
22119
22120
22121static int
22122test_xmlSetProp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022123 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022124
Daniel Veillard57b25162004-11-06 14:50:18 +000022125#ifdef LIBXML_TREE_ENABLED
22126 int mem_base;
22127 xmlAttrPtr ret_val;
22128 xmlNodePtr node; /* the node */
22129 int n_node;
22130 xmlChar * name; /* the attribute name */
22131 int n_name;
22132 xmlChar * value; /* the attribute value */
22133 int n_value;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022134
Daniel Veillard57b25162004-11-06 14:50:18 +000022135 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22136 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22137 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22138 mem_base = xmlMemBlocks();
22139 node = gen_xmlNodePtr(n_node, 0);
22140 name = gen_const_xmlChar_ptr(n_name, 1);
22141 value = gen_const_xmlChar_ptr(n_value, 2);
22142
22143 ret_val = xmlSetProp(node, name, value);
22144 desret_xmlAttrPtr(ret_val);
22145 call_tests++;
22146 des_xmlNodePtr(n_node, node, 0);
22147 des_const_xmlChar_ptr(n_name, name, 1);
22148 des_const_xmlChar_ptr(n_value, value, 2);
22149 xmlResetLastError();
22150 if (mem_base != xmlMemBlocks()) {
22151 printf("Leak of %d blocks found in xmlSetProp",
22152 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000022153 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +000022154 printf(" %d", n_node);
22155 printf(" %d", n_name);
22156 printf(" %d", n_value);
22157 printf("\n");
22158 }
22159 }
22160 }
22161 }
22162#endif
22163
22164 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000022165 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022166}
22167
22168
22169static int
Daniel Veillardd93f6252004-11-02 15:53:51 +000022170test_xmlSplitQName2(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022171 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022172
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000022173 int mem_base;
22174 xmlChar * ret_val;
22175 xmlChar * name; /* the full QName */
22176 int n_name;
22177 xmlChar ** prefix; /* a xmlChar ** */
22178 int n_prefix;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022179
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000022180 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22181 for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
22182 mem_base = xmlMemBlocks();
22183 name = gen_const_xmlChar_ptr(n_name, 0);
22184 prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
22185
22186 ret_val = xmlSplitQName2(name, prefix);
22187 desret_xmlChar_ptr(ret_val);
22188 call_tests++;
22189 des_const_xmlChar_ptr(n_name, name, 0);
22190 des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
22191 xmlResetLastError();
22192 if (mem_base != xmlMemBlocks()) {
22193 printf("Leak of %d blocks found in xmlSplitQName2",
22194 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000022195 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000022196 printf(" %d", n_name);
22197 printf(" %d", n_prefix);
22198 printf("\n");
22199 }
22200 }
22201 }
22202
22203 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000022204 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022205}
22206
22207
22208static int
22209test_xmlSplitQName3(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022210 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022211
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000022212 int mem_base;
22213 const xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000022214 xmlChar * name; /* the full QName */
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000022215 int n_name;
22216 int * len; /* an int * */
22217 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022218
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000022219 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22220 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
22221 mem_base = xmlMemBlocks();
22222 name = gen_const_xmlChar_ptr(n_name, 0);
22223 len = gen_int_ptr(n_len, 1);
22224
22225 ret_val = xmlSplitQName3(name, len);
22226 desret_const_xmlChar_ptr(ret_val);
22227 call_tests++;
22228 des_const_xmlChar_ptr(n_name, name, 0);
22229 des_int_ptr(n_len, len, 1);
22230 xmlResetLastError();
22231 if (mem_base != xmlMemBlocks()) {
22232 printf("Leak of %d blocks found in xmlSplitQName3",
22233 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000022234 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000022235 printf(" %d", n_name);
22236 printf(" %d", n_len);
22237 printf("\n");
22238 }
22239 }
22240 }
22241
22242 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000022243 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022244}
22245
22246
22247static int
22248test_xmlStringGetNodeList(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022249 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022250
22251 int mem_base;
22252 xmlNodePtr ret_val;
22253 xmlDocPtr doc; /* the document */
22254 int n_doc;
Daniel Veillardce682bc2004-11-05 17:22:25 +000022255 xmlChar * value; /* the value of the attribute */
Daniel Veillardd93f6252004-11-02 15:53:51 +000022256 int n_value;
22257
22258 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22259 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22260 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000022261 doc = gen_xmlDocPtr(n_doc, 0);
22262 value = gen_const_xmlChar_ptr(n_value, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022263
22264 ret_val = xmlStringGetNodeList(doc, value);
22265 desret_xmlNodePtr(ret_val);
22266 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000022267 des_xmlDocPtr(n_doc, doc, 0);
22268 des_const_xmlChar_ptr(n_value, value, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022269 xmlResetLastError();
22270 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000022271 printf("Leak of %d blocks found in xmlStringGetNodeList",
Daniel Veillardd93f6252004-11-02 15:53:51 +000022272 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000022273 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000022274 printf(" %d", n_doc);
22275 printf(" %d", n_value);
22276 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000022277 }
22278 }
22279 }
22280
Daniel Veillard3d97e662004-11-04 10:49:00 +000022281 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000022282 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022283}
22284
22285
22286static int
22287test_xmlStringLenGetNodeList(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022288 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022289
22290 int mem_base;
22291 xmlNodePtr ret_val;
22292 xmlDocPtr doc; /* the document */
22293 int n_doc;
Daniel Veillardce682bc2004-11-05 17:22:25 +000022294 xmlChar * value; /* the value of the text */
Daniel Veillardd93f6252004-11-02 15:53:51 +000022295 int n_value;
22296 int len; /* the length of the string value */
22297 int n_len;
22298
22299 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22300 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22301 for (n_len = 0;n_len < gen_nb_int;n_len++) {
22302 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000022303 doc = gen_xmlDocPtr(n_doc, 0);
22304 value = gen_const_xmlChar_ptr(n_value, 1);
22305 len = gen_int(n_len, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022306
22307 ret_val = xmlStringLenGetNodeList(doc, value, len);
22308 desret_xmlNodePtr(ret_val);
22309 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000022310 des_xmlDocPtr(n_doc, doc, 0);
22311 des_const_xmlChar_ptr(n_value, value, 1);
22312 des_int(n_len, len, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022313 xmlResetLastError();
22314 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000022315 printf("Leak of %d blocks found in xmlStringLenGetNodeList",
Daniel Veillardd93f6252004-11-02 15:53:51 +000022316 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000022317 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000022318 printf(" %d", n_doc);
22319 printf(" %d", n_value);
22320 printf(" %d", n_len);
22321 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000022322 }
22323 }
22324 }
22325 }
22326
Daniel Veillard3d97e662004-11-04 10:49:00 +000022327 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000022328 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022329}
22330
22331
22332static int
22333test_xmlTextConcat(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022334 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022335
22336 int mem_base;
22337 int ret_val;
22338 xmlNodePtr node; /* the node */
22339 int n_node;
Daniel Veillardce682bc2004-11-05 17:22:25 +000022340 xmlChar * content; /* the content */
Daniel Veillardd93f6252004-11-02 15:53:51 +000022341 int n_content;
22342 int len; /* @content length */
22343 int n_len;
22344
22345 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22346 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22347 for (n_len = 0;n_len < gen_nb_int;n_len++) {
22348 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000022349 node = gen_xmlNodePtr(n_node, 0);
22350 content = gen_const_xmlChar_ptr(n_content, 1);
22351 len = gen_int(n_len, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022352
22353 ret_val = xmlTextConcat(node, content, len);
22354 desret_int(ret_val);
22355 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000022356 des_xmlNodePtr(n_node, node, 0);
22357 des_const_xmlChar_ptr(n_content, content, 1);
22358 des_int(n_len, len, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022359 xmlResetLastError();
22360 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000022361 printf("Leak of %d blocks found in xmlTextConcat",
Daniel Veillardd93f6252004-11-02 15:53:51 +000022362 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000022363 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000022364 printf(" %d", n_node);
22365 printf(" %d", n_content);
22366 printf(" %d", n_len);
22367 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000022368 }
22369 }
22370 }
22371 }
22372
Daniel Veillard3d97e662004-11-04 10:49:00 +000022373 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000022374 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022375}
22376
22377
22378static int
22379test_xmlTextMerge(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022380 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022381
22382 int mem_base;
22383 xmlNodePtr ret_val;
22384 xmlNodePtr first; /* the first text node */
22385 int n_first;
22386 xmlNodePtr second; /* the second text node being merged */
22387 int n_second;
22388
Daniel Veillarda03e3652004-11-02 18:45:30 +000022389 for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
22390 for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
Daniel Veillardd93f6252004-11-02 15:53:51 +000022391 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000022392 first = gen_xmlNodePtr_in(n_first, 0);
22393 second = gen_xmlNodePtr_in(n_second, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022394
22395 ret_val = xmlTextMerge(first, second);
Daniel Veillarda03e3652004-11-02 18:45:30 +000022396 if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
Daniel Veillardce244ad2004-11-05 10:03:46 +000022397 xmlUnlinkNode(second);
Daniel Veillarda03e3652004-11-02 18:45:30 +000022398 xmlFreeNode(second) ; second = NULL ; }
Daniel Veillard8a32fe42004-11-02 22:10:16 +000022399 desret_xmlNodePtr(ret_val);
22400 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000022401 des_xmlNodePtr_in(n_first, first, 0);
22402 des_xmlNodePtr_in(n_second, second, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022403 xmlResetLastError();
22404 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000022405 printf("Leak of %d blocks found in xmlTextMerge",
Daniel Veillardd93f6252004-11-02 15:53:51 +000022406 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000022407 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000022408 printf(" %d", n_first);
22409 printf(" %d", n_second);
22410 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000022411 }
22412 }
22413 }
22414
Daniel Veillard3d97e662004-11-04 10:49:00 +000022415 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000022416 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022417}
22418
22419
22420static int
Daniel Veillardd93f6252004-11-02 15:53:51 +000022421test_xmlUnsetNsProp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022422 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022423
Daniel Veillard27f20102004-11-05 11:50:11 +000022424#ifdef LIBXML_TREE_ENABLED
22425 int mem_base;
22426 int ret_val;
22427 xmlNodePtr node; /* the node */
22428 int n_node;
22429 xmlNsPtr ns; /* the namespace definition */
22430 int n_ns;
Daniel Veillardce682bc2004-11-05 17:22:25 +000022431 xmlChar * name; /* the attribute name */
Daniel Veillard27f20102004-11-05 11:50:11 +000022432 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022433
Daniel Veillard27f20102004-11-05 11:50:11 +000022434 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22435 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22436 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22437 mem_base = xmlMemBlocks();
22438 node = gen_xmlNodePtr(n_node, 0);
22439 ns = gen_xmlNsPtr(n_ns, 1);
22440 name = gen_const_xmlChar_ptr(n_name, 2);
22441
22442 ret_val = xmlUnsetNsProp(node, ns, name);
22443 desret_int(ret_val);
22444 call_tests++;
22445 des_xmlNodePtr(n_node, node, 0);
22446 des_xmlNsPtr(n_ns, ns, 1);
22447 des_const_xmlChar_ptr(n_name, name, 2);
22448 xmlResetLastError();
22449 if (mem_base != xmlMemBlocks()) {
22450 printf("Leak of %d blocks found in xmlUnsetNsProp",
22451 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000022452 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000022453 printf(" %d", n_node);
22454 printf(" %d", n_ns);
22455 printf(" %d", n_name);
22456 printf("\n");
22457 }
22458 }
22459 }
22460 }
22461#endif
22462
22463 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000022464 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022465}
22466
22467
22468static int
22469test_xmlUnsetProp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022470 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022471
22472#ifdef LIBXML_TREE_ENABLED
22473 int mem_base;
22474 int ret_val;
22475 xmlNodePtr node; /* the node */
22476 int n_node;
Daniel Veillardce682bc2004-11-05 17:22:25 +000022477 xmlChar * name; /* the attribute name */
Daniel Veillardd93f6252004-11-02 15:53:51 +000022478 int n_name;
22479
22480 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22481 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22482 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000022483 node = gen_xmlNodePtr(n_node, 0);
22484 name = gen_const_xmlChar_ptr(n_name, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022485
22486 ret_val = xmlUnsetProp(node, name);
22487 desret_int(ret_val);
22488 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000022489 des_xmlNodePtr(n_node, node, 0);
22490 des_const_xmlChar_ptr(n_name, name, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022491 xmlResetLastError();
22492 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000022493 printf("Leak of %d blocks found in xmlUnsetProp",
Daniel Veillardd93f6252004-11-02 15:53:51 +000022494 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000022495 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000022496 printf(" %d", n_node);
22497 printf(" %d", n_name);
22498 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000022499 }
22500 }
22501 }
22502#endif
22503
Daniel Veillard3d97e662004-11-04 10:49:00 +000022504 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000022505 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022506}
22507
22508
22509static int
22510test_xmlValidateNCName(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022511 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022512
22513 int mem_base;
22514 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000022515 xmlChar * value; /* the value to check */
Daniel Veillardd93f6252004-11-02 15:53:51 +000022516 int n_value;
22517 int space; /* allow spaces in front and end of the string */
22518 int n_space;
22519
22520 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22521 for (n_space = 0;n_space < gen_nb_int;n_space++) {
22522 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000022523 value = gen_const_xmlChar_ptr(n_value, 0);
22524 space = gen_int(n_space, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022525
22526 ret_val = xmlValidateNCName(value, space);
22527 desret_int(ret_val);
22528 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000022529 des_const_xmlChar_ptr(n_value, value, 0);
22530 des_int(n_space, space, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022531 xmlResetLastError();
22532 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000022533 printf("Leak of %d blocks found in xmlValidateNCName",
Daniel Veillardd93f6252004-11-02 15:53:51 +000022534 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000022535 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000022536 printf(" %d", n_value);
22537 printf(" %d", n_space);
22538 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000022539 }
22540 }
22541 }
22542
Daniel Veillard3d97e662004-11-04 10:49:00 +000022543 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000022544 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022545}
22546
22547
22548static int
22549test_xmlValidateNMToken(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022550 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022551
22552 int mem_base;
22553 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000022554 xmlChar * value; /* the value to check */
Daniel Veillardd93f6252004-11-02 15:53:51 +000022555 int n_value;
22556 int space; /* allow spaces in front and end of the string */
22557 int n_space;
22558
22559 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22560 for (n_space = 0;n_space < gen_nb_int;n_space++) {
22561 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000022562 value = gen_const_xmlChar_ptr(n_value, 0);
22563 space = gen_int(n_space, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022564
22565 ret_val = xmlValidateNMToken(value, space);
22566 desret_int(ret_val);
22567 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000022568 des_const_xmlChar_ptr(n_value, value, 0);
22569 des_int(n_space, space, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022570 xmlResetLastError();
22571 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000022572 printf("Leak of %d blocks found in xmlValidateNMToken",
Daniel Veillardd93f6252004-11-02 15:53:51 +000022573 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000022574 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000022575 printf(" %d", n_value);
22576 printf(" %d", n_space);
22577 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000022578 }
22579 }
22580 }
22581
Daniel Veillard3d97e662004-11-04 10:49:00 +000022582 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000022583 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022584}
22585
22586
22587static int
22588test_xmlValidateName(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022589 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022590
22591 int mem_base;
22592 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000022593 xmlChar * value; /* the value to check */
Daniel Veillardd93f6252004-11-02 15:53:51 +000022594 int n_value;
22595 int space; /* allow spaces in front and end of the string */
22596 int n_space;
22597
22598 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22599 for (n_space = 0;n_space < gen_nb_int;n_space++) {
22600 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000022601 value = gen_const_xmlChar_ptr(n_value, 0);
22602 space = gen_int(n_space, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022603
22604 ret_val = xmlValidateName(value, space);
22605 desret_int(ret_val);
22606 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000022607 des_const_xmlChar_ptr(n_value, value, 0);
22608 des_int(n_space, space, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022609 xmlResetLastError();
22610 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000022611 printf("Leak of %d blocks found in xmlValidateName",
Daniel Veillardd93f6252004-11-02 15:53:51 +000022612 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000022613 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000022614 printf(" %d", n_value);
22615 printf(" %d", n_space);
22616 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000022617 }
22618 }
22619 }
22620
Daniel Veillard3d97e662004-11-04 10:49:00 +000022621 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000022622 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022623}
22624
22625
22626static int
22627test_xmlValidateQName(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022628 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022629
22630 int mem_base;
22631 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000022632 xmlChar * value; /* the value to check */
Daniel Veillardd93f6252004-11-02 15:53:51 +000022633 int n_value;
22634 int space; /* allow spaces in front and end of the string */
22635 int n_space;
22636
22637 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22638 for (n_space = 0;n_space < gen_nb_int;n_space++) {
22639 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000022640 value = gen_const_xmlChar_ptr(n_value, 0);
22641 space = gen_int(n_space, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022642
22643 ret_val = xmlValidateQName(value, space);
22644 desret_int(ret_val);
22645 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000022646 des_const_xmlChar_ptr(n_value, value, 0);
22647 des_int(n_space, space, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022648 xmlResetLastError();
22649 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000022650 printf("Leak of %d blocks found in xmlValidateQName",
Daniel Veillardd93f6252004-11-02 15:53:51 +000022651 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000022652 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000022653 printf(" %d", n_value);
22654 printf(" %d", n_space);
22655 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000022656 }
22657 }
22658 }
22659
Daniel Veillard3d97e662004-11-04 10:49:00 +000022660 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000022661 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022662}
22663
22664static int
22665test_tree(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022666 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022667
Daniel Veillard3d95c732004-11-06 22:25:14 +000022668 printf("Testing tree : 129 of 146 functions ...\n");
Daniel Veillard42595322004-11-08 10:52:06 +000022669 test_ret += test_xmlAddChild();
22670 test_ret += test_xmlAddChildList();
22671 test_ret += test_xmlAddNextSibling();
22672 test_ret += test_xmlAddPrevSibling();
22673 test_ret += test_xmlAddSibling();
22674 test_ret += test_xmlAttrSerializeTxtContent();
22675 test_ret += test_xmlBufferAdd();
22676 test_ret += test_xmlBufferAddHead();
22677 test_ret += test_xmlBufferCCat();
22678 test_ret += test_xmlBufferCat();
22679 test_ret += test_xmlBufferContent();
22680 test_ret += test_xmlBufferCreate();
22681 test_ret += test_xmlBufferCreateSize();
22682 test_ret += test_xmlBufferCreateStatic();
22683 test_ret += test_xmlBufferEmpty();
22684 test_ret += test_xmlBufferGrow();
22685 test_ret += test_xmlBufferLength();
22686 test_ret += test_xmlBufferResize();
22687 test_ret += test_xmlBufferSetAllocationScheme();
22688 test_ret += test_xmlBufferShrink();
22689 test_ret += test_xmlBufferWriteCHAR();
22690 test_ret += test_xmlBufferWriteChar();
22691 test_ret += test_xmlBufferWriteQuotedString();
22692 test_ret += test_xmlBuildQName();
22693 test_ret += test_xmlCopyDoc();
22694 test_ret += test_xmlCopyDtd();
22695 test_ret += test_xmlCopyNamespace();
22696 test_ret += test_xmlCopyNamespaceList();
22697 test_ret += test_xmlCopyNode();
22698 test_ret += test_xmlCopyNodeList();
22699 test_ret += test_xmlCopyProp();
22700 test_ret += test_xmlCopyPropList();
22701 test_ret += test_xmlCreateIntSubset();
22702 test_ret += test_xmlDocCopyNode();
22703 test_ret += test_xmlDocCopyNodeList();
22704 test_ret += test_xmlDocDump();
22705 test_ret += test_xmlDocDumpFormatMemory();
22706 test_ret += test_xmlDocDumpFormatMemoryEnc();
22707 test_ret += test_xmlDocDumpMemory();
22708 test_ret += test_xmlDocDumpMemoryEnc();
22709 test_ret += test_xmlDocFormatDump();
22710 test_ret += test_xmlDocGetRootElement();
22711 test_ret += test_xmlDocSetRootElement();
22712 test_ret += test_xmlElemDump();
22713 test_ret += test_xmlGetBufferAllocationScheme();
22714 test_ret += test_xmlGetCompressMode();
22715 test_ret += test_xmlGetDocCompressMode();
22716 test_ret += test_xmlGetIntSubset();
22717 test_ret += test_xmlGetLastChild();
22718 test_ret += test_xmlGetLineNo();
22719 test_ret += test_xmlGetNoNsProp();
22720 test_ret += test_xmlGetNodePath();
22721 test_ret += test_xmlGetNsList();
22722 test_ret += test_xmlGetNsProp();
22723 test_ret += test_xmlGetProp();
22724 test_ret += test_xmlHasNsProp();
22725 test_ret += test_xmlHasProp();
22726 test_ret += test_xmlIsBlankNode();
22727 test_ret += test_xmlIsXHTML();
22728 test_ret += test_xmlNewCDataBlock();
22729 test_ret += test_xmlNewCharRef();
22730 test_ret += test_xmlNewChild();
22731 test_ret += test_xmlNewComment();
22732 test_ret += test_xmlNewDoc();
22733 test_ret += test_xmlNewDocComment();
22734 test_ret += test_xmlNewDocFragment();
22735 test_ret += test_xmlNewDocNode();
22736 test_ret += test_xmlNewDocNodeEatName();
22737 test_ret += test_xmlNewDocPI();
22738 test_ret += test_xmlNewDocProp();
22739 test_ret += test_xmlNewDocRawNode();
22740 test_ret += test_xmlNewDocText();
22741 test_ret += test_xmlNewDocTextLen();
22742 test_ret += test_xmlNewDtd();
22743 test_ret += test_xmlNewNode();
22744 test_ret += test_xmlNewNodeEatName();
22745 test_ret += test_xmlNewNs();
22746 test_ret += test_xmlNewNsProp();
22747 test_ret += test_xmlNewNsPropEatName();
22748 test_ret += test_xmlNewPI();
22749 test_ret += test_xmlNewProp();
22750 test_ret += test_xmlNewReference();
22751 test_ret += test_xmlNewText();
22752 test_ret += test_xmlNewTextChild();
22753 test_ret += test_xmlNewTextLen();
22754 test_ret += test_xmlNodeAddContent();
22755 test_ret += test_xmlNodeAddContentLen();
22756 test_ret += test_xmlNodeBufGetContent();
22757 test_ret += test_xmlNodeDump();
22758 test_ret += test_xmlNodeDumpOutput();
22759 test_ret += test_xmlNodeGetBase();
22760 test_ret += test_xmlNodeGetContent();
22761 test_ret += test_xmlNodeGetLang();
22762 test_ret += test_xmlNodeGetSpacePreserve();
22763 test_ret += test_xmlNodeIsText();
22764 test_ret += test_xmlNodeListGetRawString();
22765 test_ret += test_xmlNodeListGetString();
22766 test_ret += test_xmlNodeSetBase();
22767 test_ret += test_xmlNodeSetContent();
22768 test_ret += test_xmlNodeSetContentLen();
22769 test_ret += test_xmlNodeSetLang();
22770 test_ret += test_xmlNodeSetName();
22771 test_ret += test_xmlNodeSetSpacePreserve();
22772 test_ret += test_xmlReconciliateNs();
22773 test_ret += test_xmlRemoveProp();
22774 test_ret += test_xmlReplaceNode();
22775 test_ret += test_xmlSaveFile();
22776 test_ret += test_xmlSaveFileEnc();
22777 test_ret += test_xmlSaveFileTo();
22778 test_ret += test_xmlSaveFormatFile();
22779 test_ret += test_xmlSaveFormatFileEnc();
22780 test_ret += test_xmlSaveFormatFileTo();
22781 test_ret += test_xmlSearchNs();
22782 test_ret += test_xmlSearchNsByHref();
22783 test_ret += test_xmlSetBufferAllocationScheme();
22784 test_ret += test_xmlSetCompressMode();
22785 test_ret += test_xmlSetDocCompressMode();
22786 test_ret += test_xmlSetNs();
22787 test_ret += test_xmlSetNsProp();
22788 test_ret += test_xmlSetProp();
22789 test_ret += test_xmlSplitQName2();
22790 test_ret += test_xmlSplitQName3();
22791 test_ret += test_xmlStringGetNodeList();
22792 test_ret += test_xmlStringLenGetNodeList();
22793 test_ret += test_xmlTextConcat();
22794 test_ret += test_xmlTextMerge();
22795 test_ret += test_xmlUnsetNsProp();
22796 test_ret += test_xmlUnsetProp();
22797 test_ret += test_xmlValidateNCName();
22798 test_ret += test_xmlValidateNMToken();
22799 test_ret += test_xmlValidateName();
22800 test_ret += test_xmlValidateQName();
Daniel Veillardd93f6252004-11-02 15:53:51 +000022801
Daniel Veillard42595322004-11-08 10:52:06 +000022802 if (test_ret != 0)
22803 printf("Module tree: %d errors\n", test_ret);
22804 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022805}
22806
22807static int
22808test_xmlBuildRelativeURI(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022809 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022810
Daniel Veillard8a32fe42004-11-02 22:10:16 +000022811 int mem_base;
22812 xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000022813 xmlChar * URI; /* the URI reference under consideration */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000022814 int n_URI;
Daniel Veillardce682bc2004-11-05 17:22:25 +000022815 xmlChar * base; /* the base value */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000022816 int n_base;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022817
Daniel Veillard8a32fe42004-11-02 22:10:16 +000022818 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
22819 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
22820 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000022821 URI = gen_const_xmlChar_ptr(n_URI, 0);
22822 base = gen_const_xmlChar_ptr(n_base, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000022823
22824 ret_val = xmlBuildRelativeURI(URI, base);
22825 desret_xmlChar_ptr(ret_val);
22826 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000022827 des_const_xmlChar_ptr(n_URI, URI, 0);
22828 des_const_xmlChar_ptr(n_base, base, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000022829 xmlResetLastError();
22830 if (mem_base != xmlMemBlocks()) {
22831 printf("Leak of %d blocks found in xmlBuildRelativeURI",
22832 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000022833 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000022834 printf(" %d", n_URI);
22835 printf(" %d", n_base);
22836 printf("\n");
22837 }
22838 }
22839 }
22840
Daniel Veillard3d97e662004-11-04 10:49:00 +000022841 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000022842 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022843}
22844
22845
22846static int
22847test_xmlBuildURI(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022848 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022849
Daniel Veillard8a32fe42004-11-02 22:10:16 +000022850 int mem_base;
22851 xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000022852 xmlChar * URI; /* the URI instance found in the document */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000022853 int n_URI;
Daniel Veillardce682bc2004-11-05 17:22:25 +000022854 xmlChar * base; /* the base value */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000022855 int n_base;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022856
Daniel Veillard8a32fe42004-11-02 22:10:16 +000022857 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
22858 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
22859 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000022860 URI = gen_const_xmlChar_ptr(n_URI, 0);
22861 base = gen_const_xmlChar_ptr(n_base, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000022862
22863 ret_val = xmlBuildURI(URI, base);
22864 desret_xmlChar_ptr(ret_val);
22865 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000022866 des_const_xmlChar_ptr(n_URI, URI, 0);
22867 des_const_xmlChar_ptr(n_base, base, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000022868 xmlResetLastError();
22869 if (mem_base != xmlMemBlocks()) {
22870 printf("Leak of %d blocks found in xmlBuildURI",
22871 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000022872 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000022873 printf(" %d", n_URI);
22874 printf(" %d", n_base);
22875 printf("\n");
22876 }
22877 }
22878 }
22879
Daniel Veillard3d97e662004-11-04 10:49:00 +000022880 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000022881 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022882}
22883
22884
22885static int
22886test_xmlCanonicPath(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022887 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022888
Daniel Veillard8a32fe42004-11-02 22:10:16 +000022889 int mem_base;
22890 xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000022891 xmlChar * path; /* the resource locator in a filesystem notation */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000022892 int n_path;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022893
Daniel Veillard8a32fe42004-11-02 22:10:16 +000022894 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
22895 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000022896 path = gen_const_xmlChar_ptr(n_path, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000022897
22898 ret_val = xmlCanonicPath(path);
22899 desret_xmlChar_ptr(ret_val);
22900 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000022901 des_const_xmlChar_ptr(n_path, path, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000022902 xmlResetLastError();
22903 if (mem_base != xmlMemBlocks()) {
22904 printf("Leak of %d blocks found in xmlCanonicPath",
22905 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000022906 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000022907 printf(" %d", n_path);
22908 printf("\n");
22909 }
22910 }
22911
Daniel Veillard3d97e662004-11-04 10:49:00 +000022912 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000022913 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022914}
22915
22916
22917static int
22918test_xmlCreateURI(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022919 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022920
22921
22922 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000022923 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022924}
22925
22926
22927static int
22928test_xmlNormalizeURIPath(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022929 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022930
Daniel Veillardce682bc2004-11-05 17:22:25 +000022931 int mem_base;
22932 int ret_val;
22933 char * path; /* pointer to the path string */
22934 int n_path;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022935
Daniel Veillardce682bc2004-11-05 17:22:25 +000022936 for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
22937 mem_base = xmlMemBlocks();
22938 path = gen_char_ptr(n_path, 0);
22939
22940 ret_val = xmlNormalizeURIPath(path);
22941 desret_int(ret_val);
22942 call_tests++;
22943 des_char_ptr(n_path, path, 0);
22944 xmlResetLastError();
22945 if (mem_base != xmlMemBlocks()) {
22946 printf("Leak of %d blocks found in xmlNormalizeURIPath",
22947 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000022948 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000022949 printf(" %d", n_path);
22950 printf("\n");
22951 }
22952 }
22953
22954 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000022955 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022956}
22957
22958
22959static int
22960test_xmlParseURI(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022961 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022962
22963
22964 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000022965 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000022966}
22967
22968
Daniel Veillardce682bc2004-11-05 17:22:25 +000022969#define gen_nb_xmlURIPtr 1
22970static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
22971 return(NULL);
22972}
22973static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
22974}
22975
Daniel Veillardd93f6252004-11-02 15:53:51 +000022976static int
22977test_xmlParseURIReference(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000022978 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022979
Daniel Veillardce682bc2004-11-05 17:22:25 +000022980 int mem_base;
22981 int ret_val;
22982 xmlURIPtr uri; /* pointer to an URI structure */
22983 int n_uri;
22984 char * str; /* the string to analyze */
22985 int n_str;
Daniel Veillardd93f6252004-11-02 15:53:51 +000022986
Daniel Veillardce682bc2004-11-05 17:22:25 +000022987 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
22988 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
22989 mem_base = xmlMemBlocks();
22990 uri = gen_xmlURIPtr(n_uri, 0);
22991 str = gen_const_char_ptr(n_str, 1);
22992
22993 ret_val = xmlParseURIReference(uri, str);
22994 desret_int(ret_val);
22995 call_tests++;
22996 des_xmlURIPtr(n_uri, uri, 0);
22997 des_const_char_ptr(n_str, str, 1);
22998 xmlResetLastError();
22999 if (mem_base != xmlMemBlocks()) {
23000 printf("Leak of %d blocks found in xmlParseURIReference",
23001 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000023002 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000023003 printf(" %d", n_uri);
23004 printf(" %d", n_str);
23005 printf("\n");
23006 }
23007 }
23008 }
23009
23010 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000023011 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023012}
23013
23014
23015static int
23016test_xmlPrintURI(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023017 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023018
Daniel Veillardce682bc2004-11-05 17:22:25 +000023019 int mem_base;
23020 FILE * stream; /* a FILE* for the output */
23021 int n_stream;
23022 xmlURIPtr uri; /* pointer to an xmlURI */
23023 int n_uri;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023024
Daniel Veillardce682bc2004-11-05 17:22:25 +000023025 for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
23026 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
23027 mem_base = xmlMemBlocks();
23028 stream = gen_FILE_ptr(n_stream, 0);
23029 uri = gen_xmlURIPtr(n_uri, 1);
23030
23031 xmlPrintURI(stream, uri);
23032 call_tests++;
23033 des_FILE_ptr(n_stream, stream, 0);
23034 des_xmlURIPtr(n_uri, uri, 1);
23035 xmlResetLastError();
23036 if (mem_base != xmlMemBlocks()) {
23037 printf("Leak of %d blocks found in xmlPrintURI",
23038 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000023039 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000023040 printf(" %d", n_stream);
23041 printf(" %d", n_uri);
23042 printf("\n");
23043 }
23044 }
23045 }
23046
23047 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000023048 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023049}
23050
23051
23052static int
23053test_xmlSaveUri(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023054 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023055
Daniel Veillardce682bc2004-11-05 17:22:25 +000023056 int mem_base;
23057 xmlChar * ret_val;
23058 xmlURIPtr uri; /* pointer to an xmlURI */
23059 int n_uri;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023060
Daniel Veillardce682bc2004-11-05 17:22:25 +000023061 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
23062 mem_base = xmlMemBlocks();
23063 uri = gen_xmlURIPtr(n_uri, 0);
23064
23065 ret_val = xmlSaveUri(uri);
23066 desret_xmlChar_ptr(ret_val);
23067 call_tests++;
23068 des_xmlURIPtr(n_uri, uri, 0);
23069 xmlResetLastError();
23070 if (mem_base != xmlMemBlocks()) {
23071 printf("Leak of %d blocks found in xmlSaveUri",
23072 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000023073 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000023074 printf(" %d", n_uri);
23075 printf("\n");
23076 }
23077 }
23078
23079 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000023080 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023081}
23082
23083
23084static int
23085test_xmlURIEscape(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023086 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023087
Daniel Veillard8a32fe42004-11-02 22:10:16 +000023088 int mem_base;
23089 xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000023090 xmlChar * str; /* the string of the URI to escape */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000023091 int n_str;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023092
Daniel Veillard8a32fe42004-11-02 22:10:16 +000023093 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
23094 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000023095 str = gen_const_xmlChar_ptr(n_str, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000023096
23097 ret_val = xmlURIEscape(str);
23098 desret_xmlChar_ptr(ret_val);
23099 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000023100 des_const_xmlChar_ptr(n_str, str, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000023101 xmlResetLastError();
23102 if (mem_base != xmlMemBlocks()) {
23103 printf("Leak of %d blocks found in xmlURIEscape",
23104 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000023105 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000023106 printf(" %d", n_str);
23107 printf("\n");
23108 }
23109 }
23110
Daniel Veillard3d97e662004-11-04 10:49:00 +000023111 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000023112 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023113}
23114
23115
23116static int
23117test_xmlURIEscapeStr(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023118 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023119
Daniel Veillard8a32fe42004-11-02 22:10:16 +000023120 int mem_base;
23121 xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000023122 xmlChar * str; /* string to escape */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000023123 int n_str;
Daniel Veillardce682bc2004-11-05 17:22:25 +000023124 xmlChar * list; /* exception list string of chars not to escape */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000023125 int n_list;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023126
Daniel Veillard8a32fe42004-11-02 22:10:16 +000023127 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
23128 for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
23129 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000023130 str = gen_const_xmlChar_ptr(n_str, 0);
23131 list = gen_const_xmlChar_ptr(n_list, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000023132
23133 ret_val = xmlURIEscapeStr(str, list);
23134 desret_xmlChar_ptr(ret_val);
23135 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000023136 des_const_xmlChar_ptr(n_str, str, 0);
23137 des_const_xmlChar_ptr(n_list, list, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000023138 xmlResetLastError();
23139 if (mem_base != xmlMemBlocks()) {
23140 printf("Leak of %d blocks found in xmlURIEscapeStr",
23141 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000023142 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000023143 printf(" %d", n_str);
23144 printf(" %d", n_list);
23145 printf("\n");
23146 }
23147 }
23148 }
23149
Daniel Veillard3d97e662004-11-04 10:49:00 +000023150 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000023151 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023152}
23153
23154
23155static int
23156test_xmlURIUnescapeString(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023157 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023158
23159
23160 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000023161 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023162}
23163
23164static int
23165test_uri(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023166 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023167
Daniel Veillardce682bc2004-11-05 17:22:25 +000023168 printf("Testing uri : 9 of 13 functions ...\n");
Daniel Veillard42595322004-11-08 10:52:06 +000023169 test_ret += test_xmlBuildRelativeURI();
23170 test_ret += test_xmlBuildURI();
23171 test_ret += test_xmlCanonicPath();
23172 test_ret += test_xmlCreateURI();
23173 test_ret += test_xmlNormalizeURIPath();
23174 test_ret += test_xmlParseURI();
23175 test_ret += test_xmlParseURIReference();
23176 test_ret += test_xmlPrintURI();
23177 test_ret += test_xmlSaveUri();
23178 test_ret += test_xmlURIEscape();
23179 test_ret += test_xmlURIEscapeStr();
23180 test_ret += test_xmlURIUnescapeString();
Daniel Veillardd93f6252004-11-02 15:53:51 +000023181
Daniel Veillard42595322004-11-08 10:52:06 +000023182 if (test_ret != 0)
23183 printf("Module uri: %d errors\n", test_ret);
23184 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023185}
23186
23187static int
23188test_xmlAddAttributeDecl(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023189 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023190
Daniel Veillard42595322004-11-08 10:52:06 +000023191 int mem_base;
23192 xmlAttributePtr ret_val;
23193 xmlValidCtxtPtr ctxt; /* the validation context */
23194 int n_ctxt;
23195 xmlDtdPtr dtd; /* pointer to the DTD */
23196 int n_dtd;
23197 xmlChar * elem; /* the element name */
23198 int n_elem;
23199 xmlChar * name; /* the attribute name */
23200 int n_name;
23201 xmlChar * ns; /* the attribute namespace prefix */
23202 int n_ns;
23203 xmlAttributeType type; /* the attribute type */
23204 int n_type;
23205 xmlAttributeDefault def; /* the attribute default type */
23206 int n_def;
23207 xmlChar * defaultValue; /* the attribute default value */
23208 int n_defaultValue;
23209 xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
23210 int n_tree;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023211
Daniel Veillard42595322004-11-08 10:52:06 +000023212 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
23213 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
23214 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
23215 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23216 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
23217 for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
23218 for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
23219 for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
23220 for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
23221 mem_base = xmlMemBlocks();
23222 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
23223 dtd = gen_xmlDtdPtr(n_dtd, 1);
23224 elem = gen_const_xmlChar_ptr(n_elem, 2);
23225 name = gen_const_xmlChar_ptr(n_name, 3);
23226 ns = gen_const_xmlChar_ptr(n_ns, 4);
23227 type = gen_xmlAttributeType(n_type, 5);
23228 def = gen_xmlAttributeDefault(n_def, 6);
23229 defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
23230 tree = gen_xmlEnumerationPtr(n_tree, 8);
23231
23232 ret_val = xmlAddAttributeDecl(ctxt, dtd, elem, name, ns, type, def, defaultValue, tree);
23233 desret_xmlAttributePtr(ret_val);
23234 call_tests++;
23235 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
23236 des_xmlDtdPtr(n_dtd, dtd, 1);
23237 des_const_xmlChar_ptr(n_elem, elem, 2);
23238 des_const_xmlChar_ptr(n_name, name, 3);
23239 des_const_xmlChar_ptr(n_ns, ns, 4);
23240 des_xmlAttributeType(n_type, type, 5);
23241 des_xmlAttributeDefault(n_def, def, 6);
23242 des_const_xmlChar_ptr(n_defaultValue, defaultValue, 7);
23243 des_xmlEnumerationPtr(n_tree, tree, 8);
23244 xmlResetLastError();
23245 if (mem_base != xmlMemBlocks()) {
23246 printf("Leak of %d blocks found in xmlAddAttributeDecl",
23247 xmlMemBlocks() - mem_base);
23248 test_ret++;
23249 printf(" %d", n_ctxt);
23250 printf(" %d", n_dtd);
23251 printf(" %d", n_elem);
23252 printf(" %d", n_name);
23253 printf(" %d", n_ns);
23254 printf(" %d", n_type);
23255 printf(" %d", n_def);
23256 printf(" %d", n_defaultValue);
23257 printf(" %d", n_tree);
23258 printf("\n");
23259 }
23260 }
23261 }
23262 }
23263 }
23264 }
23265 }
23266 }
23267 }
23268 }
23269
23270 function_tests++;
23271 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023272}
23273
23274
23275static int
23276test_xmlAddElementDecl(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023277 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023278
Daniel Veillard42595322004-11-08 10:52:06 +000023279 int mem_base;
23280 xmlElementPtr ret_val;
23281 xmlValidCtxtPtr ctxt; /* the validation context */
23282 int n_ctxt;
23283 xmlDtdPtr dtd; /* pointer to the DTD */
23284 int n_dtd;
23285 xmlChar * name; /* the entity name */
23286 int n_name;
23287 xmlElementTypeVal type; /* the element type */
23288 int n_type;
23289 xmlElementContentPtr content; /* the element content tree or NULL */
23290 int n_content;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023291
Daniel Veillard42595322004-11-08 10:52:06 +000023292 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
23293 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
23294 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23295 for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
23296 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
23297 mem_base = xmlMemBlocks();
23298 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
23299 dtd = gen_xmlDtdPtr(n_dtd, 1);
23300 name = gen_const_xmlChar_ptr(n_name, 2);
23301 type = gen_xmlElementTypeVal(n_type, 3);
23302 content = gen_xmlElementContentPtr(n_content, 4);
23303
23304 ret_val = xmlAddElementDecl(ctxt, dtd, name, type, content);
23305 desret_xmlElementPtr(ret_val);
23306 call_tests++;
23307 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
23308 des_xmlDtdPtr(n_dtd, dtd, 1);
23309 des_const_xmlChar_ptr(n_name, name, 2);
23310 des_xmlElementTypeVal(n_type, type, 3);
23311 des_xmlElementContentPtr(n_content, content, 4);
23312 xmlResetLastError();
23313 if (mem_base != xmlMemBlocks()) {
23314 printf("Leak of %d blocks found in xmlAddElementDecl",
23315 xmlMemBlocks() - mem_base);
23316 test_ret++;
23317 printf(" %d", n_ctxt);
23318 printf(" %d", n_dtd);
23319 printf(" %d", n_name);
23320 printf(" %d", n_type);
23321 printf(" %d", n_content);
23322 printf("\n");
23323 }
23324 }
23325 }
23326 }
23327 }
23328 }
23329
23330 function_tests++;
23331 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023332}
23333
23334
23335static int
23336test_xmlAddID(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023337 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023338
23339
23340 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000023341 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023342}
23343
23344
23345static int
23346test_xmlAddNotationDecl(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023347 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023348
23349
23350 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000023351 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023352}
23353
23354
23355static int
23356test_xmlAddRef(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023357 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023358
23359
23360 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000023361 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023362}
23363
23364
Daniel Veillardce682bc2004-11-05 17:22:25 +000023365#define gen_nb_xmlAttributeTablePtr 1
23366static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23367 return(NULL);
23368}
23369static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23370}
23371
Daniel Veillardd93f6252004-11-02 15:53:51 +000023372static int
23373test_xmlCopyAttributeTable(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023374 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023375
23376
23377 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000023378 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023379}
23380
23381
23382static int
23383test_xmlCopyElementContent(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023384 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023385
23386
23387 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000023388 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023389}
23390
23391
Daniel Veillardce682bc2004-11-05 17:22:25 +000023392#define gen_nb_xmlElementTablePtr 1
23393static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23394 return(NULL);
23395}
23396static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23397}
23398
Daniel Veillardd93f6252004-11-02 15:53:51 +000023399static int
23400test_xmlCopyElementTable(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023401 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023402
23403
23404 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000023405 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023406}
23407
23408
23409static int
23410test_xmlCopyEnumeration(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023411 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023412
23413
23414 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000023415 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023416}
23417
23418
Daniel Veillardce682bc2004-11-05 17:22:25 +000023419#define gen_nb_xmlNotationTablePtr 1
23420static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23421 return(NULL);
23422}
23423static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23424}
23425
Daniel Veillardd93f6252004-11-02 15:53:51 +000023426static int
23427test_xmlCopyNotationTable(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023428 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023429
23430
23431 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000023432 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023433}
23434
23435
23436static int
23437test_xmlCreateEnumeration(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023438 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023439
23440
23441 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000023442 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023443}
23444
23445
Daniel Veillardce682bc2004-11-05 17:22:25 +000023446#define gen_nb_xmlAttributePtr 1
23447static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23448 return(NULL);
23449}
23450static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23451}
23452
Daniel Veillardd93f6252004-11-02 15:53:51 +000023453static int
23454test_xmlDumpAttributeDecl(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023455 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023456
Daniel Veillardce682bc2004-11-05 17:22:25 +000023457#ifdef LIBXML_OUTPUT_ENABLED
23458 int mem_base;
23459 xmlBufferPtr buf; /* the XML buffer output */
23460 int n_buf;
23461 xmlAttributePtr attr; /* An attribute declaration */
23462 int n_attr;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023463
Daniel Veillardce682bc2004-11-05 17:22:25 +000023464 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
23465 for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
23466 mem_base = xmlMemBlocks();
23467 buf = gen_xmlBufferPtr(n_buf, 0);
23468 attr = gen_xmlAttributePtr(n_attr, 1);
23469
23470 xmlDumpAttributeDecl(buf, attr);
23471 call_tests++;
23472 des_xmlBufferPtr(n_buf, buf, 0);
23473 des_xmlAttributePtr(n_attr, attr, 1);
23474 xmlResetLastError();
23475 if (mem_base != xmlMemBlocks()) {
23476 printf("Leak of %d blocks found in xmlDumpAttributeDecl",
23477 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000023478 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000023479 printf(" %d", n_buf);
23480 printf(" %d", n_attr);
23481 printf("\n");
23482 }
23483 }
23484 }
23485#endif
23486
23487 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000023488 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023489}
23490
23491
23492static int
23493test_xmlDumpAttributeTable(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023494 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023495
Daniel Veillardce682bc2004-11-05 17:22:25 +000023496#ifdef LIBXML_OUTPUT_ENABLED
23497 int mem_base;
23498 xmlBufferPtr buf; /* the XML buffer output */
23499 int n_buf;
23500 xmlAttributeTablePtr table; /* An attribute table */
23501 int n_table;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023502
Daniel Veillardce682bc2004-11-05 17:22:25 +000023503 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
23504 for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
23505 mem_base = xmlMemBlocks();
23506 buf = gen_xmlBufferPtr(n_buf, 0);
23507 table = gen_xmlAttributeTablePtr(n_table, 1);
23508
23509 xmlDumpAttributeTable(buf, table);
23510 call_tests++;
23511 des_xmlBufferPtr(n_buf, buf, 0);
23512 des_xmlAttributeTablePtr(n_table, table, 1);
23513 xmlResetLastError();
23514 if (mem_base != xmlMemBlocks()) {
23515 printf("Leak of %d blocks found in xmlDumpAttributeTable",
23516 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000023517 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000023518 printf(" %d", n_buf);
23519 printf(" %d", n_table);
23520 printf("\n");
23521 }
23522 }
23523 }
23524#endif
23525
23526 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000023527 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023528}
23529
23530
Daniel Veillardce682bc2004-11-05 17:22:25 +000023531#define gen_nb_xmlElementPtr 1
23532static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23533 return(NULL);
23534}
23535static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23536}
23537
Daniel Veillardd93f6252004-11-02 15:53:51 +000023538static int
23539test_xmlDumpElementDecl(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023540 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023541
Daniel Veillardce682bc2004-11-05 17:22:25 +000023542#ifdef LIBXML_OUTPUT_ENABLED
23543 int mem_base;
23544 xmlBufferPtr buf; /* the XML buffer output */
23545 int n_buf;
23546 xmlElementPtr elem; /* An element table */
23547 int n_elem;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023548
Daniel Veillardce682bc2004-11-05 17:22:25 +000023549 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
23550 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
23551 mem_base = xmlMemBlocks();
23552 buf = gen_xmlBufferPtr(n_buf, 0);
23553 elem = gen_xmlElementPtr(n_elem, 1);
23554
23555 xmlDumpElementDecl(buf, elem);
23556 call_tests++;
23557 des_xmlBufferPtr(n_buf, buf, 0);
23558 des_xmlElementPtr(n_elem, elem, 1);
23559 xmlResetLastError();
23560 if (mem_base != xmlMemBlocks()) {
23561 printf("Leak of %d blocks found in xmlDumpElementDecl",
23562 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000023563 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000023564 printf(" %d", n_buf);
23565 printf(" %d", n_elem);
23566 printf("\n");
23567 }
23568 }
23569 }
23570#endif
23571
23572 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000023573 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023574}
23575
23576
23577static int
23578test_xmlDumpElementTable(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023579 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023580
Daniel Veillardce682bc2004-11-05 17:22:25 +000023581#ifdef LIBXML_OUTPUT_ENABLED
23582 int mem_base;
23583 xmlBufferPtr buf; /* the XML buffer output */
23584 int n_buf;
23585 xmlElementTablePtr table; /* An element table */
23586 int n_table;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023587
Daniel Veillardce682bc2004-11-05 17:22:25 +000023588 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
23589 for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
23590 mem_base = xmlMemBlocks();
23591 buf = gen_xmlBufferPtr(n_buf, 0);
23592 table = gen_xmlElementTablePtr(n_table, 1);
23593
23594 xmlDumpElementTable(buf, table);
23595 call_tests++;
23596 des_xmlBufferPtr(n_buf, buf, 0);
23597 des_xmlElementTablePtr(n_table, table, 1);
23598 xmlResetLastError();
23599 if (mem_base != xmlMemBlocks()) {
23600 printf("Leak of %d blocks found in xmlDumpElementTable",
23601 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000023602 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000023603 printf(" %d", n_buf);
23604 printf(" %d", n_table);
23605 printf("\n");
23606 }
23607 }
23608 }
23609#endif
23610
23611 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000023612 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023613}
23614
23615
Daniel Veillardce682bc2004-11-05 17:22:25 +000023616#define gen_nb_xmlNotationPtr 1
23617static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23618 return(NULL);
23619}
23620static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23621}
23622
Daniel Veillardd93f6252004-11-02 15:53:51 +000023623static int
23624test_xmlDumpNotationDecl(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023625 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023626
Daniel Veillardce682bc2004-11-05 17:22:25 +000023627#ifdef LIBXML_OUTPUT_ENABLED
23628 int mem_base;
23629 xmlBufferPtr buf; /* the XML buffer output */
23630 int n_buf;
23631 xmlNotationPtr nota; /* A notation declaration */
23632 int n_nota;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023633
Daniel Veillardce682bc2004-11-05 17:22:25 +000023634 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
23635 for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
23636 mem_base = xmlMemBlocks();
23637 buf = gen_xmlBufferPtr(n_buf, 0);
23638 nota = gen_xmlNotationPtr(n_nota, 1);
23639
23640 xmlDumpNotationDecl(buf, nota);
23641 call_tests++;
23642 des_xmlBufferPtr(n_buf, buf, 0);
23643 des_xmlNotationPtr(n_nota, nota, 1);
23644 xmlResetLastError();
23645 if (mem_base != xmlMemBlocks()) {
23646 printf("Leak of %d blocks found in xmlDumpNotationDecl",
23647 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000023648 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000023649 printf(" %d", n_buf);
23650 printf(" %d", n_nota);
23651 printf("\n");
23652 }
23653 }
23654 }
23655#endif
23656
23657 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000023658 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023659}
23660
23661
23662static int
23663test_xmlDumpNotationTable(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023664 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023665
Daniel Veillardce682bc2004-11-05 17:22:25 +000023666#ifdef LIBXML_OUTPUT_ENABLED
23667 int mem_base;
23668 xmlBufferPtr buf; /* the XML buffer output */
23669 int n_buf;
23670 xmlNotationTablePtr table; /* A notation table */
23671 int n_table;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023672
Daniel Veillardce682bc2004-11-05 17:22:25 +000023673 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
23674 for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
23675 mem_base = xmlMemBlocks();
23676 buf = gen_xmlBufferPtr(n_buf, 0);
23677 table = gen_xmlNotationTablePtr(n_table, 1);
23678
23679 xmlDumpNotationTable(buf, table);
23680 call_tests++;
23681 des_xmlBufferPtr(n_buf, buf, 0);
23682 des_xmlNotationTablePtr(n_table, table, 1);
23683 xmlResetLastError();
23684 if (mem_base != xmlMemBlocks()) {
23685 printf("Leak of %d blocks found in xmlDumpNotationTable",
23686 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000023687 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000023688 printf(" %d", n_buf);
23689 printf(" %d", n_table);
23690 printf("\n");
23691 }
23692 }
23693 }
23694#endif
23695
23696 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000023697 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023698}
23699
23700
23701static int
23702test_xmlGetDtdAttrDesc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023703 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023704
Daniel Veillard42595322004-11-08 10:52:06 +000023705 int mem_base;
23706 xmlAttributePtr ret_val;
23707 xmlDtdPtr dtd; /* a pointer to the DtD to search */
23708 int n_dtd;
23709 xmlChar * elem; /* the element name */
23710 int n_elem;
23711 xmlChar * name; /* the attribute name */
23712 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023713
Daniel Veillard42595322004-11-08 10:52:06 +000023714 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
23715 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
23716 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23717 mem_base = xmlMemBlocks();
23718 dtd = gen_xmlDtdPtr(n_dtd, 0);
23719 elem = gen_const_xmlChar_ptr(n_elem, 1);
23720 name = gen_const_xmlChar_ptr(n_name, 2);
23721
23722 ret_val = xmlGetDtdAttrDesc(dtd, elem, name);
23723 desret_xmlAttributePtr(ret_val);
23724 call_tests++;
23725 des_xmlDtdPtr(n_dtd, dtd, 0);
23726 des_const_xmlChar_ptr(n_elem, elem, 1);
23727 des_const_xmlChar_ptr(n_name, name, 2);
23728 xmlResetLastError();
23729 if (mem_base != xmlMemBlocks()) {
23730 printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
23731 xmlMemBlocks() - mem_base);
23732 test_ret++;
23733 printf(" %d", n_dtd);
23734 printf(" %d", n_elem);
23735 printf(" %d", n_name);
23736 printf("\n");
23737 }
23738 }
23739 }
23740 }
23741
23742 function_tests++;
23743 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023744}
23745
23746
23747static int
23748test_xmlGetDtdElementDesc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023749 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023750
Daniel Veillard42595322004-11-08 10:52:06 +000023751 int mem_base;
23752 xmlElementPtr ret_val;
23753 xmlDtdPtr dtd; /* a pointer to the DtD to search */
23754 int n_dtd;
23755 xmlChar * name; /* the element name */
23756 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023757
Daniel Veillard42595322004-11-08 10:52:06 +000023758 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
23759 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23760 mem_base = xmlMemBlocks();
23761 dtd = gen_xmlDtdPtr(n_dtd, 0);
23762 name = gen_const_xmlChar_ptr(n_name, 1);
23763
23764 ret_val = xmlGetDtdElementDesc(dtd, name);
23765 desret_xmlElementPtr(ret_val);
23766 call_tests++;
23767 des_xmlDtdPtr(n_dtd, dtd, 0);
23768 des_const_xmlChar_ptr(n_name, name, 1);
23769 xmlResetLastError();
23770 if (mem_base != xmlMemBlocks()) {
23771 printf("Leak of %d blocks found in xmlGetDtdElementDesc",
23772 xmlMemBlocks() - mem_base);
23773 test_ret++;
23774 printf(" %d", n_dtd);
23775 printf(" %d", n_name);
23776 printf("\n");
23777 }
23778 }
23779 }
23780
23781 function_tests++;
23782 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023783}
23784
23785
23786static int
23787test_xmlGetDtdNotationDesc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023788 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023789
23790
23791 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000023792 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023793}
23794
23795
23796static int
23797test_xmlGetDtdQAttrDesc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023798 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023799
Daniel Veillard42595322004-11-08 10:52:06 +000023800 int mem_base;
23801 xmlAttributePtr ret_val;
23802 xmlDtdPtr dtd; /* a pointer to the DtD to search */
23803 int n_dtd;
23804 xmlChar * elem; /* the element name */
23805 int n_elem;
23806 xmlChar * name; /* the attribute name */
23807 int n_name;
23808 xmlChar * prefix; /* the attribute namespace prefix */
23809 int n_prefix;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023810
Daniel Veillard42595322004-11-08 10:52:06 +000023811 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
23812 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
23813 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23814 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
23815 mem_base = xmlMemBlocks();
23816 dtd = gen_xmlDtdPtr(n_dtd, 0);
23817 elem = gen_const_xmlChar_ptr(n_elem, 1);
23818 name = gen_const_xmlChar_ptr(n_name, 2);
23819 prefix = gen_const_xmlChar_ptr(n_prefix, 3);
23820
23821 ret_val = xmlGetDtdQAttrDesc(dtd, elem, name, prefix);
23822 desret_xmlAttributePtr(ret_val);
23823 call_tests++;
23824 des_xmlDtdPtr(n_dtd, dtd, 0);
23825 des_const_xmlChar_ptr(n_elem, elem, 1);
23826 des_const_xmlChar_ptr(n_name, name, 2);
23827 des_const_xmlChar_ptr(n_prefix, prefix, 3);
23828 xmlResetLastError();
23829 if (mem_base != xmlMemBlocks()) {
23830 printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
23831 xmlMemBlocks() - mem_base);
23832 test_ret++;
23833 printf(" %d", n_dtd);
23834 printf(" %d", n_elem);
23835 printf(" %d", n_name);
23836 printf(" %d", n_prefix);
23837 printf("\n");
23838 }
23839 }
23840 }
23841 }
23842 }
23843
23844 function_tests++;
23845 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023846}
23847
23848
23849static int
23850test_xmlGetDtdQElementDesc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023851 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023852
Daniel Veillard42595322004-11-08 10:52:06 +000023853 int mem_base;
23854 xmlElementPtr ret_val;
23855 xmlDtdPtr dtd; /* a pointer to the DtD to search */
23856 int n_dtd;
23857 xmlChar * name; /* the element name */
23858 int n_name;
23859 xmlChar * prefix; /* the element namespace prefix */
23860 int n_prefix;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023861
Daniel Veillard42595322004-11-08 10:52:06 +000023862 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
23863 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23864 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
23865 mem_base = xmlMemBlocks();
23866 dtd = gen_xmlDtdPtr(n_dtd, 0);
23867 name = gen_const_xmlChar_ptr(n_name, 1);
23868 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
23869
23870 ret_val = xmlGetDtdQElementDesc(dtd, name, prefix);
23871 desret_xmlElementPtr(ret_val);
23872 call_tests++;
23873 des_xmlDtdPtr(n_dtd, dtd, 0);
23874 des_const_xmlChar_ptr(n_name, name, 1);
23875 des_const_xmlChar_ptr(n_prefix, prefix, 2);
23876 xmlResetLastError();
23877 if (mem_base != xmlMemBlocks()) {
23878 printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
23879 xmlMemBlocks() - mem_base);
23880 test_ret++;
23881 printf(" %d", n_dtd);
23882 printf(" %d", n_name);
23883 printf(" %d", n_prefix);
23884 printf("\n");
23885 }
23886 }
23887 }
23888 }
23889
23890 function_tests++;
23891 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023892}
23893
23894
23895static int
23896test_xmlGetID(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023897 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023898
Daniel Veillard57b25162004-11-06 14:50:18 +000023899 int mem_base;
23900 xmlAttrPtr ret_val;
23901 xmlDocPtr doc; /* pointer to the document */
23902 int n_doc;
23903 xmlChar * ID; /* the ID value */
23904 int n_ID;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023905
Daniel Veillard57b25162004-11-06 14:50:18 +000023906 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23907 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
23908 mem_base = xmlMemBlocks();
23909 doc = gen_xmlDocPtr(n_doc, 0);
23910 ID = gen_const_xmlChar_ptr(n_ID, 1);
23911
23912 ret_val = xmlGetID(doc, ID);
23913 desret_xmlAttrPtr(ret_val);
23914 call_tests++;
23915 des_xmlDocPtr(n_doc, doc, 0);
23916 des_const_xmlChar_ptr(n_ID, ID, 1);
23917 xmlResetLastError();
23918 if (mem_base != xmlMemBlocks()) {
23919 printf("Leak of %d blocks found in xmlGetID",
23920 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000023921 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +000023922 printf(" %d", n_doc);
23923 printf(" %d", n_ID);
23924 printf("\n");
23925 }
23926 }
23927 }
23928
23929 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000023930 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023931}
23932
23933
23934static int
23935test_xmlGetRefs(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023936 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023937
23938
23939 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000023940 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023941}
23942
23943
23944static int
23945test_xmlIsID(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023946 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023947
Daniel Veillardce244ad2004-11-05 10:03:46 +000023948 int mem_base;
23949 int ret_val;
23950 xmlDocPtr doc; /* the document */
23951 int n_doc;
23952 xmlNodePtr elem; /* the element carrying the attribute */
23953 int n_elem;
23954 xmlAttrPtr attr; /* the attribute */
23955 int n_attr;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023956
Daniel Veillardce244ad2004-11-05 10:03:46 +000023957 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23958 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
23959 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
23960 mem_base = xmlMemBlocks();
23961 doc = gen_xmlDocPtr(n_doc, 0);
23962 elem = gen_xmlNodePtr(n_elem, 1);
23963 attr = gen_xmlAttrPtr(n_attr, 2);
23964
23965 ret_val = xmlIsID(doc, elem, attr);
23966 desret_int(ret_val);
23967 call_tests++;
23968 des_xmlDocPtr(n_doc, doc, 0);
23969 des_xmlNodePtr(n_elem, elem, 1);
23970 des_xmlAttrPtr(n_attr, attr, 2);
23971 xmlResetLastError();
23972 if (mem_base != xmlMemBlocks()) {
23973 printf("Leak of %d blocks found in xmlIsID",
23974 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000023975 test_ret++;
Daniel Veillardce244ad2004-11-05 10:03:46 +000023976 printf(" %d", n_doc);
23977 printf(" %d", n_elem);
23978 printf(" %d", n_attr);
23979 printf("\n");
23980 }
23981 }
23982 }
23983 }
23984
23985 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000023986 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000023987}
23988
23989
23990static int
23991test_xmlIsMixedElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000023992 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000023993
23994 int mem_base;
23995 int ret_val;
23996 xmlDocPtr doc; /* the document */
23997 int n_doc;
Daniel Veillardce682bc2004-11-05 17:22:25 +000023998 xmlChar * name; /* the element name */
Daniel Veillardd93f6252004-11-02 15:53:51 +000023999 int n_name;
24000
24001 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24002 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24003 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000024004 doc = gen_xmlDocPtr(n_doc, 0);
24005 name = gen_const_xmlChar_ptr(n_name, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024006
24007 ret_val = xmlIsMixedElement(doc, name);
24008 desret_int(ret_val);
24009 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000024010 des_xmlDocPtr(n_doc, doc, 0);
24011 des_const_xmlChar_ptr(n_name, name, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024012 xmlResetLastError();
24013 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000024014 printf("Leak of %d blocks found in xmlIsMixedElement",
Daniel Veillardd93f6252004-11-02 15:53:51 +000024015 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024016 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000024017 printf(" %d", n_doc);
24018 printf(" %d", n_name);
24019 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000024020 }
24021 }
24022 }
24023
Daniel Veillard3d97e662004-11-04 10:49:00 +000024024 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024025 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024026}
24027
24028
24029static int
24030test_xmlIsRef(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024031 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024032
Daniel Veillardce244ad2004-11-05 10:03:46 +000024033 int mem_base;
24034 int ret_val;
24035 xmlDocPtr doc; /* the document */
24036 int n_doc;
24037 xmlNodePtr elem; /* the element carrying the attribute */
24038 int n_elem;
24039 xmlAttrPtr attr; /* the attribute */
24040 int n_attr;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024041
Daniel Veillardce244ad2004-11-05 10:03:46 +000024042 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24043 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
24044 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
24045 mem_base = xmlMemBlocks();
24046 doc = gen_xmlDocPtr(n_doc, 0);
24047 elem = gen_xmlNodePtr(n_elem, 1);
24048 attr = gen_xmlAttrPtr(n_attr, 2);
24049
24050 ret_val = xmlIsRef(doc, elem, attr);
24051 desret_int(ret_val);
24052 call_tests++;
24053 des_xmlDocPtr(n_doc, doc, 0);
24054 des_xmlNodePtr(n_elem, elem, 1);
24055 des_xmlAttrPtr(n_attr, attr, 2);
24056 xmlResetLastError();
24057 if (mem_base != xmlMemBlocks()) {
24058 printf("Leak of %d blocks found in xmlIsRef",
24059 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024060 test_ret++;
Daniel Veillardce244ad2004-11-05 10:03:46 +000024061 printf(" %d", n_doc);
24062 printf(" %d", n_elem);
24063 printf(" %d", n_attr);
24064 printf("\n");
24065 }
24066 }
24067 }
24068 }
24069
24070 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024071 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024072}
24073
24074
24075static int
24076test_xmlNewElementContent(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024077 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024078
24079
24080 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000024081 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024082}
24083
24084
24085static int
24086test_xmlNewValidCtxt(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024087 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024088
24089
24090 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000024091 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024092}
24093
24094
24095static int
24096test_xmlRemoveID(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024097 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024098
Daniel Veillardce244ad2004-11-05 10:03:46 +000024099 int mem_base;
24100 int ret_val;
24101 xmlDocPtr doc; /* the document */
24102 int n_doc;
24103 xmlAttrPtr attr; /* the attribute */
24104 int n_attr;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024105
Daniel Veillardce244ad2004-11-05 10:03:46 +000024106 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24107 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
24108 mem_base = xmlMemBlocks();
24109 doc = gen_xmlDocPtr(n_doc, 0);
24110 attr = gen_xmlAttrPtr(n_attr, 1);
24111
24112 ret_val = xmlRemoveID(doc, attr);
24113 desret_int(ret_val);
24114 call_tests++;
24115 des_xmlDocPtr(n_doc, doc, 0);
24116 des_xmlAttrPtr(n_attr, attr, 1);
24117 xmlResetLastError();
24118 if (mem_base != xmlMemBlocks()) {
24119 printf("Leak of %d blocks found in xmlRemoveID",
24120 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024121 test_ret++;
Daniel Veillardce244ad2004-11-05 10:03:46 +000024122 printf(" %d", n_doc);
24123 printf(" %d", n_attr);
24124 printf("\n");
24125 }
24126 }
24127 }
24128
24129 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024130 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024131}
24132
24133
24134static int
24135test_xmlRemoveRef(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024136 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024137
Daniel Veillardce244ad2004-11-05 10:03:46 +000024138 int mem_base;
24139 int ret_val;
24140 xmlDocPtr doc; /* the document */
24141 int n_doc;
24142 xmlAttrPtr attr; /* the attribute */
24143 int n_attr;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024144
Daniel Veillardce244ad2004-11-05 10:03:46 +000024145 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24146 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
24147 mem_base = xmlMemBlocks();
24148 doc = gen_xmlDocPtr(n_doc, 0);
24149 attr = gen_xmlAttrPtr(n_attr, 1);
24150
24151 ret_val = xmlRemoveRef(doc, attr);
24152 desret_int(ret_val);
24153 call_tests++;
24154 des_xmlDocPtr(n_doc, doc, 0);
24155 des_xmlAttrPtr(n_attr, attr, 1);
24156 xmlResetLastError();
24157 if (mem_base != xmlMemBlocks()) {
24158 printf("Leak of %d blocks found in xmlRemoveRef",
24159 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024160 test_ret++;
Daniel Veillardce244ad2004-11-05 10:03:46 +000024161 printf(" %d", n_doc);
24162 printf(" %d", n_attr);
24163 printf("\n");
24164 }
24165 }
24166 }
24167
24168 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024169 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024170}
24171
24172
24173static int
24174test_xmlSnprintfElementContent(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024175 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024176
Daniel Veillardce682bc2004-11-05 17:22:25 +000024177 int mem_base;
24178 char * buf; /* an output buffer */
24179 int n_buf;
24180 int size; /* the buffer size */
24181 int n_size;
24182 xmlElementContentPtr content; /* An element table */
24183 int n_content;
24184 int glob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
24185 int n_glob;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024186
Daniel Veillardce682bc2004-11-05 17:22:25 +000024187 for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
24188 for (n_size = 0;n_size < gen_nb_int;n_size++) {
24189 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24190 for (n_glob = 0;n_glob < gen_nb_int;n_glob++) {
24191 mem_base = xmlMemBlocks();
24192 buf = gen_char_ptr(n_buf, 0);
24193 size = gen_int(n_size, 1);
24194 content = gen_xmlElementContentPtr(n_content, 2);
24195 glob = gen_int(n_glob, 3);
24196
24197 xmlSnprintfElementContent(buf, size, content, glob);
24198 call_tests++;
24199 des_char_ptr(n_buf, buf, 0);
24200 des_int(n_size, size, 1);
24201 des_xmlElementContentPtr(n_content, content, 2);
24202 des_int(n_glob, glob, 3);
24203 xmlResetLastError();
24204 if (mem_base != xmlMemBlocks()) {
24205 printf("Leak of %d blocks found in xmlSnprintfElementContent",
24206 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024207 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000024208 printf(" %d", n_buf);
24209 printf(" %d", n_size);
24210 printf(" %d", n_content);
24211 printf(" %d", n_glob);
24212 printf("\n");
24213 }
24214 }
24215 }
24216 }
24217 }
24218
24219 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024220 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024221}
24222
24223
24224static int
24225test_xmlSprintfElementContent(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024226 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024227
Daniel Veillardce682bc2004-11-05 17:22:25 +000024228 int mem_base;
24229 char * buf; /* an output buffer */
24230 int n_buf;
24231 xmlElementContentPtr content; /* An element table */
24232 int n_content;
24233 int glob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
24234 int n_glob;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024235
Daniel Veillardce682bc2004-11-05 17:22:25 +000024236 for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
24237 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24238 for (n_glob = 0;n_glob < gen_nb_int;n_glob++) {
24239 mem_base = xmlMemBlocks();
24240 buf = gen_char_ptr(n_buf, 0);
24241 content = gen_xmlElementContentPtr(n_content, 1);
24242 glob = gen_int(n_glob, 2);
24243
24244 xmlSprintfElementContent(buf, content, glob);
24245 call_tests++;
24246 des_char_ptr(n_buf, buf, 0);
24247 des_xmlElementContentPtr(n_content, content, 1);
24248 des_int(n_glob, glob, 2);
24249 xmlResetLastError();
24250 if (mem_base != xmlMemBlocks()) {
24251 printf("Leak of %d blocks found in xmlSprintfElementContent",
24252 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024253 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000024254 printf(" %d", n_buf);
24255 printf(" %d", n_content);
24256 printf(" %d", n_glob);
24257 printf("\n");
24258 }
24259 }
24260 }
24261 }
24262
24263 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024264 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024265}
24266
24267
24268static int
24269test_xmlValidBuildContentModel(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024270 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024271
Daniel Veillardce682bc2004-11-05 17:22:25 +000024272#ifdef LIBXML_REGEXP_ENABLED
24273 int mem_base;
24274 int ret_val;
24275 xmlValidCtxtPtr ctxt; /* a validation context */
24276 int n_ctxt;
24277 xmlElementPtr elem; /* an element declaration node */
24278 int n_elem;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024279
Daniel Veillardce682bc2004-11-05 17:22:25 +000024280 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24281 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
24282 mem_base = xmlMemBlocks();
24283 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24284 elem = gen_xmlElementPtr(n_elem, 1);
24285
24286 ret_val = xmlValidBuildContentModel(ctxt, elem);
24287 desret_int(ret_val);
24288 call_tests++;
24289 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24290 des_xmlElementPtr(n_elem, elem, 1);
24291 xmlResetLastError();
24292 if (mem_base != xmlMemBlocks()) {
24293 printf("Leak of %d blocks found in xmlValidBuildContentModel",
24294 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024295 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000024296 printf(" %d", n_ctxt);
24297 printf(" %d", n_elem);
24298 printf("\n");
24299 }
24300 }
24301 }
24302#endif
24303
24304 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024305 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024306}
24307
24308
24309static int
24310test_xmlValidCtxtNormalizeAttributeValue(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024311 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024312
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024313#ifdef LIBXML_VALID_ENABLED
24314 int mem_base;
24315 xmlChar * ret_val;
24316 xmlValidCtxtPtr ctxt; /* the validation context or NULL */
24317 int n_ctxt;
24318 xmlDocPtr doc; /* the document */
24319 int n_doc;
24320 xmlNodePtr elem; /* the parent */
24321 int n_elem;
Daniel Veillardce682bc2004-11-05 17:22:25 +000024322 xmlChar * name; /* the attribute name */
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024323 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000024324 xmlChar * value; /* the attribute value */
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024325 int n_value;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024326
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024327 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24328 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24329 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
24330 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24331 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24332 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000024333 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24334 doc = gen_xmlDocPtr(n_doc, 1);
24335 elem = gen_xmlNodePtr(n_elem, 2);
24336 name = gen_const_xmlChar_ptr(n_name, 3);
24337 value = gen_const_xmlChar_ptr(n_value, 4);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024338
24339 ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, name, value);
24340 desret_xmlChar_ptr(ret_val);
24341 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000024342 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24343 des_xmlDocPtr(n_doc, doc, 1);
24344 des_xmlNodePtr(n_elem, elem, 2);
24345 des_const_xmlChar_ptr(n_name, name, 3);
24346 des_const_xmlChar_ptr(n_value, value, 4);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024347 xmlResetLastError();
24348 if (mem_base != xmlMemBlocks()) {
24349 printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
24350 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024351 test_ret++;
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024352 printf(" %d", n_ctxt);
24353 printf(" %d", n_doc);
24354 printf(" %d", n_elem);
24355 printf(" %d", n_name);
24356 printf(" %d", n_value);
24357 printf("\n");
24358 }
24359 }
24360 }
24361 }
24362 }
24363 }
24364#endif
24365
Daniel Veillard3d97e662004-11-04 10:49:00 +000024366 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024367 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024368}
24369
24370
Daniel Veillardce682bc2004-11-05 17:22:25 +000024371#define gen_nb_xmlElementContent_ptr 1
24372static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24373 return(NULL);
24374}
24375static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24376}
24377
Daniel Veillardd93f6252004-11-02 15:53:51 +000024378static int
24379test_xmlValidGetPotentialChildren(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024380 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024381
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000024382 int mem_base;
24383 int ret_val;
24384 xmlElementContent * ctree; /* an element content tree */
24385 int n_ctree;
24386 xmlChar ** list; /* an array to store the list of child names */
24387 int n_list;
24388 int * len; /* a pointer to the number of element in the list */
24389 int n_len;
24390 int max; /* the size of the array */
24391 int n_max;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024392
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000024393 for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
24394 for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr_ptr;n_list++) {
24395 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
24396 for (n_max = 0;n_max < gen_nb_int;n_max++) {
24397 mem_base = xmlMemBlocks();
24398 ctree = gen_xmlElementContent_ptr(n_ctree, 0);
24399 list = gen_const_xmlChar_ptr_ptr(n_list, 1);
24400 len = gen_int_ptr(n_len, 2);
24401 max = gen_int(n_max, 3);
24402
24403 ret_val = xmlValidGetPotentialChildren(ctree, list, len, max);
24404 desret_int(ret_val);
24405 call_tests++;
24406 des_xmlElementContent_ptr(n_ctree, ctree, 0);
24407 des_const_xmlChar_ptr_ptr(n_list, list, 1);
24408 des_int_ptr(n_len, len, 2);
24409 des_int(n_max, max, 3);
24410 xmlResetLastError();
24411 if (mem_base != xmlMemBlocks()) {
24412 printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
24413 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024414 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000024415 printf(" %d", n_ctree);
24416 printf(" %d", n_list);
24417 printf(" %d", n_len);
24418 printf(" %d", n_max);
24419 printf("\n");
24420 }
24421 }
24422 }
24423 }
24424 }
24425
24426 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024427 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024428}
24429
24430
24431static int
24432test_xmlValidGetValidElements(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024433 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024434
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000024435 int mem_base;
24436 int ret_val;
24437 xmlNode * prev; /* an element to insert after */
24438 int n_prev;
24439 xmlNode * next; /* an element to insert next */
24440 int n_next;
24441 xmlChar ** names; /* an array to store the list of child names */
24442 int n_names;
24443 int max; /* the size of the array */
24444 int n_max;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024445
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000024446 for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
24447 for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
24448 for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
24449 for (n_max = 0;n_max < gen_nb_int;n_max++) {
24450 mem_base = xmlMemBlocks();
24451 prev = gen_xmlNodePtr(n_prev, 0);
24452 next = gen_xmlNodePtr(n_next, 1);
24453 names = gen_const_xmlChar_ptr_ptr(n_names, 2);
24454 max = gen_int(n_max, 3);
24455
24456 ret_val = xmlValidGetValidElements(prev, next, names, max);
24457 desret_int(ret_val);
24458 call_tests++;
24459 des_xmlNodePtr(n_prev, prev, 0);
24460 des_xmlNodePtr(n_next, next, 1);
24461 des_const_xmlChar_ptr_ptr(n_names, names, 2);
24462 des_int(n_max, max, 3);
24463 xmlResetLastError();
24464 if (mem_base != xmlMemBlocks()) {
24465 printf("Leak of %d blocks found in xmlValidGetValidElements",
24466 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024467 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000024468 printf(" %d", n_prev);
24469 printf(" %d", n_next);
24470 printf(" %d", n_names);
24471 printf(" %d", n_max);
24472 printf("\n");
24473 }
24474 }
24475 }
24476 }
24477 }
24478
24479 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024480 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024481}
24482
24483
24484static int
24485test_xmlValidNormalizeAttributeValue(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024486 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024487
Daniel Veillard8a32fe42004-11-02 22:10:16 +000024488#ifdef LIBXML_VALID_ENABLED
24489 int mem_base;
24490 xmlChar * ret_val;
24491 xmlDocPtr doc; /* the document */
24492 int n_doc;
24493 xmlNodePtr elem; /* the parent */
24494 int n_elem;
Daniel Veillardce682bc2004-11-05 17:22:25 +000024495 xmlChar * name; /* the attribute name */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000024496 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000024497 xmlChar * value; /* the attribute value */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000024498 int n_value;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024499
Daniel Veillard8a32fe42004-11-02 22:10:16 +000024500 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24501 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
24502 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24503 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24504 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000024505 doc = gen_xmlDocPtr(n_doc, 0);
24506 elem = gen_xmlNodePtr(n_elem, 1);
24507 name = gen_const_xmlChar_ptr(n_name, 2);
24508 value = gen_const_xmlChar_ptr(n_value, 3);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000024509
24510 ret_val = xmlValidNormalizeAttributeValue(doc, elem, name, value);
24511 desret_xmlChar_ptr(ret_val);
24512 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000024513 des_xmlDocPtr(n_doc, doc, 0);
24514 des_xmlNodePtr(n_elem, elem, 1);
24515 des_const_xmlChar_ptr(n_name, name, 2);
24516 des_const_xmlChar_ptr(n_value, value, 3);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000024517 xmlResetLastError();
24518 if (mem_base != xmlMemBlocks()) {
24519 printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
24520 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024521 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000024522 printf(" %d", n_doc);
24523 printf(" %d", n_elem);
24524 printf(" %d", n_name);
24525 printf(" %d", n_value);
24526 printf("\n");
24527 }
24528 }
24529 }
24530 }
24531 }
24532#endif
24533
Daniel Veillard3d97e662004-11-04 10:49:00 +000024534 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024535 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024536}
24537
24538
24539static int
24540test_xmlValidateAttributeDecl(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024541 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024542
Daniel Veillardce682bc2004-11-05 17:22:25 +000024543#ifdef LIBXML_VALID_ENABLED
24544 int mem_base;
24545 int ret_val;
24546 xmlValidCtxtPtr ctxt; /* the validation context */
24547 int n_ctxt;
24548 xmlDocPtr doc; /* a document instance */
24549 int n_doc;
24550 xmlAttributePtr attr; /* an attribute definition */
24551 int n_attr;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024552
Daniel Veillardce682bc2004-11-05 17:22:25 +000024553 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24554 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24555 for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
24556 mem_base = xmlMemBlocks();
24557 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24558 doc = gen_xmlDocPtr(n_doc, 1);
24559 attr = gen_xmlAttributePtr(n_attr, 2);
24560
24561 ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
24562 desret_int(ret_val);
24563 call_tests++;
24564 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24565 des_xmlDocPtr(n_doc, doc, 1);
24566 des_xmlAttributePtr(n_attr, attr, 2);
24567 xmlResetLastError();
24568 if (mem_base != xmlMemBlocks()) {
24569 printf("Leak of %d blocks found in xmlValidateAttributeDecl",
24570 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024571 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000024572 printf(" %d", n_ctxt);
24573 printf(" %d", n_doc);
24574 printf(" %d", n_attr);
24575 printf("\n");
24576 }
24577 }
24578 }
24579 }
24580#endif
24581
24582 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024583 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024584}
24585
24586
24587static int
24588test_xmlValidateAttributeValue(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024589 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024590
Daniel Veillard57b25162004-11-06 14:50:18 +000024591#ifdef LIBXML_VALID_ENABLED
24592 int mem_base;
24593 int ret_val;
24594 xmlAttributeType type; /* an attribute type */
24595 int n_type;
24596 xmlChar * value; /* an attribute value */
24597 int n_value;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024598
Daniel Veillard57b25162004-11-06 14:50:18 +000024599 for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24600 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24601 mem_base = xmlMemBlocks();
24602 type = gen_xmlAttributeType(n_type, 0);
24603 value = gen_const_xmlChar_ptr(n_value, 1);
24604
24605 ret_val = xmlValidateAttributeValue(type, value);
24606 desret_int(ret_val);
24607 call_tests++;
24608 des_xmlAttributeType(n_type, type, 0);
24609 des_const_xmlChar_ptr(n_value, value, 1);
24610 xmlResetLastError();
24611 if (mem_base != xmlMemBlocks()) {
24612 printf("Leak of %d blocks found in xmlValidateAttributeValue",
24613 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024614 test_ret++;
Daniel Veillard57b25162004-11-06 14:50:18 +000024615 printf(" %d", n_type);
24616 printf(" %d", n_value);
24617 printf("\n");
24618 }
24619 }
24620 }
24621#endif
24622
24623 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024624 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024625}
24626
24627
24628static int
24629test_xmlValidateDocument(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024630 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024631
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024632#ifdef LIBXML_VALID_ENABLED
24633 int mem_base;
24634 int ret_val;
24635 xmlValidCtxtPtr ctxt; /* the validation context */
24636 int n_ctxt;
24637 xmlDocPtr doc; /* a document instance */
24638 int n_doc;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024639
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024640 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24641 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24642 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000024643 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24644 doc = gen_xmlDocPtr(n_doc, 1);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024645
24646 ret_val = xmlValidateDocument(ctxt, doc);
24647 desret_int(ret_val);
24648 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000024649 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24650 des_xmlDocPtr(n_doc, doc, 1);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024651 xmlResetLastError();
24652 if (mem_base != xmlMemBlocks()) {
24653 printf("Leak of %d blocks found in xmlValidateDocument",
24654 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024655 test_ret++;
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024656 printf(" %d", n_ctxt);
24657 printf(" %d", n_doc);
24658 printf("\n");
24659 }
24660 }
24661 }
24662#endif
24663
Daniel Veillard3d97e662004-11-04 10:49:00 +000024664 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024665 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024666}
24667
24668
24669static int
24670test_xmlValidateDocumentFinal(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024671 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024672
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024673#ifdef LIBXML_VALID_ENABLED
24674 int mem_base;
24675 int ret_val;
24676 xmlValidCtxtPtr ctxt; /* the validation context */
24677 int n_ctxt;
24678 xmlDocPtr doc; /* a document instance */
24679 int n_doc;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024680
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024681 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24682 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24683 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000024684 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24685 doc = gen_xmlDocPtr(n_doc, 1);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024686
24687 ret_val = xmlValidateDocumentFinal(ctxt, doc);
24688 desret_int(ret_val);
24689 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000024690 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24691 des_xmlDocPtr(n_doc, doc, 1);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024692 xmlResetLastError();
24693 if (mem_base != xmlMemBlocks()) {
24694 printf("Leak of %d blocks found in xmlValidateDocumentFinal",
24695 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024696 test_ret++;
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024697 printf(" %d", n_ctxt);
24698 printf(" %d", n_doc);
24699 printf("\n");
24700 }
24701 }
24702 }
24703#endif
24704
Daniel Veillard3d97e662004-11-04 10:49:00 +000024705 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024706 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024707}
24708
24709
24710static int
24711test_xmlValidateDtd(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024712 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024713
Daniel Veillard27f20102004-11-05 11:50:11 +000024714#ifdef LIBXML_VALID_ENABLED
24715 int mem_base;
24716 int ret_val;
24717 xmlValidCtxtPtr ctxt; /* the validation context */
24718 int n_ctxt;
24719 xmlDocPtr doc; /* a document instance */
24720 int n_doc;
24721 xmlDtdPtr dtd; /* a dtd instance */
24722 int n_dtd;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024723
Daniel Veillard27f20102004-11-05 11:50:11 +000024724 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24725 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24726 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24727 mem_base = xmlMemBlocks();
24728 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24729 doc = gen_xmlDocPtr(n_doc, 1);
24730 dtd = gen_xmlDtdPtr(n_dtd, 2);
24731
24732 ret_val = xmlValidateDtd(ctxt, doc, dtd);
24733 desret_int(ret_val);
24734 call_tests++;
24735 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24736 des_xmlDocPtr(n_doc, doc, 1);
24737 des_xmlDtdPtr(n_dtd, dtd, 2);
24738 xmlResetLastError();
24739 if (mem_base != xmlMemBlocks()) {
24740 printf("Leak of %d blocks found in xmlValidateDtd",
24741 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024742 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000024743 printf(" %d", n_ctxt);
24744 printf(" %d", n_doc);
24745 printf(" %d", n_dtd);
24746 printf("\n");
24747 }
24748 }
24749 }
24750 }
24751#endif
24752
24753 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024754 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024755}
24756
24757
24758static int
24759test_xmlValidateDtdFinal(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024760 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024761
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024762#ifdef LIBXML_VALID_ENABLED
24763 int mem_base;
24764 int ret_val;
24765 xmlValidCtxtPtr ctxt; /* the validation context */
24766 int n_ctxt;
24767 xmlDocPtr doc; /* a document instance */
24768 int n_doc;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024769
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024770 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24771 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24772 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000024773 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24774 doc = gen_xmlDocPtr(n_doc, 1);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024775
24776 ret_val = xmlValidateDtdFinal(ctxt, doc);
24777 desret_int(ret_val);
24778 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000024779 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24780 des_xmlDocPtr(n_doc, doc, 1);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024781 xmlResetLastError();
24782 if (mem_base != xmlMemBlocks()) {
24783 printf("Leak of %d blocks found in xmlValidateDtdFinal",
24784 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024785 test_ret++;
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024786 printf(" %d", n_ctxt);
24787 printf(" %d", n_doc);
24788 printf("\n");
24789 }
24790 }
24791 }
24792#endif
24793
Daniel Veillard3d97e662004-11-04 10:49:00 +000024794 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024795 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024796}
24797
24798
24799static int
24800test_xmlValidateElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024801 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024802
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024803#ifdef LIBXML_VALID_ENABLED
24804 int mem_base;
24805 int ret_val;
24806 xmlValidCtxtPtr ctxt; /* the validation context */
24807 int n_ctxt;
24808 xmlDocPtr doc; /* a document instance */
24809 int n_doc;
24810 xmlNodePtr elem; /* an element instance */
24811 int n_elem;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024812
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024813 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24814 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24815 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
24816 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000024817 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24818 doc = gen_xmlDocPtr(n_doc, 1);
24819 elem = gen_xmlNodePtr(n_elem, 2);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024820
24821 ret_val = xmlValidateElement(ctxt, doc, elem);
24822 desret_int(ret_val);
24823 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000024824 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24825 des_xmlDocPtr(n_doc, doc, 1);
24826 des_xmlNodePtr(n_elem, elem, 2);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024827 xmlResetLastError();
24828 if (mem_base != xmlMemBlocks()) {
24829 printf("Leak of %d blocks found in xmlValidateElement",
24830 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024831 test_ret++;
Daniel Veillardc0be74b2004-11-03 19:16:55 +000024832 printf(" %d", n_ctxt);
24833 printf(" %d", n_doc);
24834 printf(" %d", n_elem);
24835 printf("\n");
24836 }
24837 }
24838 }
24839 }
24840#endif
24841
Daniel Veillard3d97e662004-11-04 10:49:00 +000024842 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024843 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024844}
24845
24846
24847static int
24848test_xmlValidateElementDecl(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024849 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024850
Daniel Veillardce682bc2004-11-05 17:22:25 +000024851#ifdef LIBXML_VALID_ENABLED
24852 int mem_base;
24853 int ret_val;
24854 xmlValidCtxtPtr ctxt; /* the validation context */
24855 int n_ctxt;
24856 xmlDocPtr doc; /* a document instance */
24857 int n_doc;
24858 xmlElementPtr elem; /* an element definition */
24859 int n_elem;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024860
Daniel Veillardce682bc2004-11-05 17:22:25 +000024861 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24862 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24863 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
24864 mem_base = xmlMemBlocks();
24865 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24866 doc = gen_xmlDocPtr(n_doc, 1);
24867 elem = gen_xmlElementPtr(n_elem, 2);
24868
24869 ret_val = xmlValidateElementDecl(ctxt, doc, elem);
24870 desret_int(ret_val);
24871 call_tests++;
24872 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24873 des_xmlDocPtr(n_doc, doc, 1);
24874 des_xmlElementPtr(n_elem, elem, 2);
24875 xmlResetLastError();
24876 if (mem_base != xmlMemBlocks()) {
24877 printf("Leak of %d blocks found in xmlValidateElementDecl",
24878 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024879 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000024880 printf(" %d", n_ctxt);
24881 printf(" %d", n_doc);
24882 printf(" %d", n_elem);
24883 printf("\n");
24884 }
24885 }
24886 }
24887 }
24888#endif
24889
24890 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024891 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024892}
24893
24894
24895static int
24896test_xmlValidateNameValue(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024897 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024898
24899#ifdef LIBXML_VALID_ENABLED
24900 int mem_base;
24901 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000024902 xmlChar * value; /* an Name value */
Daniel Veillardd93f6252004-11-02 15:53:51 +000024903 int n_value;
24904
24905 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24906 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000024907 value = gen_const_xmlChar_ptr(n_value, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024908
24909 ret_val = xmlValidateNameValue(value);
24910 desret_int(ret_val);
24911 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000024912 des_const_xmlChar_ptr(n_value, value, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024913 xmlResetLastError();
24914 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000024915 printf("Leak of %d blocks found in xmlValidateNameValue",
Daniel Veillardd93f6252004-11-02 15:53:51 +000024916 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024917 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000024918 printf(" %d", n_value);
24919 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000024920 }
24921 }
24922#endif
24923
Daniel Veillard3d97e662004-11-04 10:49:00 +000024924 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024925 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024926}
24927
24928
24929static int
24930test_xmlValidateNamesValue(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024931 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024932
24933#ifdef LIBXML_VALID_ENABLED
24934 int mem_base;
24935 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000024936 xmlChar * value; /* an Names value */
Daniel Veillardd93f6252004-11-02 15:53:51 +000024937 int n_value;
24938
24939 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24940 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000024941 value = gen_const_xmlChar_ptr(n_value, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024942
24943 ret_val = xmlValidateNamesValue(value);
24944 desret_int(ret_val);
24945 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000024946 des_const_xmlChar_ptr(n_value, value, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024947 xmlResetLastError();
24948 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000024949 printf("Leak of %d blocks found in xmlValidateNamesValue",
Daniel Veillardd93f6252004-11-02 15:53:51 +000024950 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024951 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000024952 printf(" %d", n_value);
24953 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000024954 }
24955 }
24956#endif
24957
Daniel Veillard3d97e662004-11-04 10:49:00 +000024958 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024959 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024960}
24961
24962
24963static int
24964test_xmlValidateNmtokenValue(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024965 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000024966
24967#ifdef LIBXML_VALID_ENABLED
24968 int mem_base;
24969 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000024970 xmlChar * value; /* an Nmtoken value */
Daniel Veillardd93f6252004-11-02 15:53:51 +000024971 int n_value;
24972
24973 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24974 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000024975 value = gen_const_xmlChar_ptr(n_value, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024976
24977 ret_val = xmlValidateNmtokenValue(value);
24978 desret_int(ret_val);
24979 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000024980 des_const_xmlChar_ptr(n_value, value, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024981 xmlResetLastError();
24982 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000024983 printf("Leak of %d blocks found in xmlValidateNmtokenValue",
Daniel Veillardd93f6252004-11-02 15:53:51 +000024984 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000024985 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000024986 printf(" %d", n_value);
24987 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000024988 }
24989 }
24990#endif
24991
Daniel Veillard3d97e662004-11-04 10:49:00 +000024992 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000024993 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000024994}
24995
24996
24997static int
24998test_xmlValidateNmtokensValue(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000024999 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025000
25001#ifdef LIBXML_VALID_ENABLED
25002 int mem_base;
25003 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000025004 xmlChar * value; /* an Nmtokens value */
Daniel Veillardd93f6252004-11-02 15:53:51 +000025005 int n_value;
25006
25007 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25008 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000025009 value = gen_const_xmlChar_ptr(n_value, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025010
25011 ret_val = xmlValidateNmtokensValue(value);
25012 desret_int(ret_val);
25013 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000025014 des_const_xmlChar_ptr(n_value, value, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025015 xmlResetLastError();
25016 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000025017 printf("Leak of %d blocks found in xmlValidateNmtokensValue",
Daniel Veillardd93f6252004-11-02 15:53:51 +000025018 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000025019 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000025020 printf(" %d", n_value);
25021 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000025022 }
25023 }
25024#endif
25025
Daniel Veillard3d97e662004-11-04 10:49:00 +000025026 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000025027 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025028}
25029
25030
25031static int
25032test_xmlValidateNotationDecl(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025033 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025034
Daniel Veillardce682bc2004-11-05 17:22:25 +000025035#ifdef LIBXML_VALID_ENABLED
25036 int mem_base;
25037 int ret_val;
25038 xmlValidCtxtPtr ctxt; /* the validation context */
25039 int n_ctxt;
25040 xmlDocPtr doc; /* a document instance */
25041 int n_doc;
25042 xmlNotationPtr nota; /* a notation definition */
25043 int n_nota;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025044
Daniel Veillardce682bc2004-11-05 17:22:25 +000025045 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25046 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25047 for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
25048 mem_base = xmlMemBlocks();
25049 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25050 doc = gen_xmlDocPtr(n_doc, 1);
25051 nota = gen_xmlNotationPtr(n_nota, 2);
25052
25053 ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
25054 desret_int(ret_val);
25055 call_tests++;
25056 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25057 des_xmlDocPtr(n_doc, doc, 1);
25058 des_xmlNotationPtr(n_nota, nota, 2);
25059 xmlResetLastError();
25060 if (mem_base != xmlMemBlocks()) {
25061 printf("Leak of %d blocks found in xmlValidateNotationDecl",
25062 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000025063 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000025064 printf(" %d", n_ctxt);
25065 printf(" %d", n_doc);
25066 printf(" %d", n_nota);
25067 printf("\n");
25068 }
25069 }
25070 }
25071 }
25072#endif
25073
25074 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000025075 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025076}
25077
25078
25079static int
25080test_xmlValidateNotationUse(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025081 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025082
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025083#ifdef LIBXML_VALID_ENABLED
25084 int mem_base;
25085 int ret_val;
25086 xmlValidCtxtPtr ctxt; /* the validation context */
25087 int n_ctxt;
25088 xmlDocPtr doc; /* the document */
25089 int n_doc;
Daniel Veillardce682bc2004-11-05 17:22:25 +000025090 xmlChar * notationName; /* the notation name to check */
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025091 int n_notationName;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025092
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025093 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25094 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25095 for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
25096 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000025097 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25098 doc = gen_xmlDocPtr(n_doc, 1);
25099 notationName = gen_const_xmlChar_ptr(n_notationName, 2);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025100
25101 ret_val = xmlValidateNotationUse(ctxt, doc, notationName);
25102 desret_int(ret_val);
25103 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000025104 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25105 des_xmlDocPtr(n_doc, doc, 1);
25106 des_const_xmlChar_ptr(n_notationName, notationName, 2);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025107 xmlResetLastError();
25108 if (mem_base != xmlMemBlocks()) {
25109 printf("Leak of %d blocks found in xmlValidateNotationUse",
25110 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000025111 test_ret++;
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025112 printf(" %d", n_ctxt);
25113 printf(" %d", n_doc);
25114 printf(" %d", n_notationName);
25115 printf("\n");
25116 }
25117 }
25118 }
25119 }
25120#endif
25121
Daniel Veillard3d97e662004-11-04 10:49:00 +000025122 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000025123 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025124}
25125
25126
25127static int
25128test_xmlValidateOneAttribute(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025129 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025130
Daniel Veillardce244ad2004-11-05 10:03:46 +000025131#ifdef LIBXML_VALID_ENABLED
25132 int mem_base;
25133 int ret_val;
25134 xmlValidCtxtPtr ctxt; /* the validation context */
25135 int n_ctxt;
25136 xmlDocPtr doc; /* a document instance */
25137 int n_doc;
25138 xmlNodePtr elem; /* an element instance */
25139 int n_elem;
25140 xmlAttrPtr attr; /* an attribute instance */
25141 int n_attr;
Daniel Veillardce682bc2004-11-05 17:22:25 +000025142 xmlChar * value; /* the attribute value (without entities processing) */
Daniel Veillardce244ad2004-11-05 10:03:46 +000025143 int n_value;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025144
Daniel Veillardce244ad2004-11-05 10:03:46 +000025145 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25146 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25147 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25148 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25149 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25150 mem_base = xmlMemBlocks();
25151 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25152 doc = gen_xmlDocPtr(n_doc, 1);
25153 elem = gen_xmlNodePtr(n_elem, 2);
25154 attr = gen_xmlAttrPtr(n_attr, 3);
25155 value = gen_const_xmlChar_ptr(n_value, 4);
25156
25157 ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, value);
25158 desret_int(ret_val);
25159 call_tests++;
25160 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25161 des_xmlDocPtr(n_doc, doc, 1);
25162 des_xmlNodePtr(n_elem, elem, 2);
25163 des_xmlAttrPtr(n_attr, attr, 3);
25164 des_const_xmlChar_ptr(n_value, value, 4);
25165 xmlResetLastError();
25166 if (mem_base != xmlMemBlocks()) {
25167 printf("Leak of %d blocks found in xmlValidateOneAttribute",
25168 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000025169 test_ret++;
Daniel Veillardce244ad2004-11-05 10:03:46 +000025170 printf(" %d", n_ctxt);
25171 printf(" %d", n_doc);
25172 printf(" %d", n_elem);
25173 printf(" %d", n_attr);
25174 printf(" %d", n_value);
25175 printf("\n");
25176 }
25177 }
25178 }
25179 }
25180 }
25181 }
25182#endif
25183
25184 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000025185 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025186}
25187
25188
25189static int
25190test_xmlValidateOneElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025191 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025192
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025193#ifdef LIBXML_VALID_ENABLED
25194 int mem_base;
25195 int ret_val;
25196 xmlValidCtxtPtr ctxt; /* the validation context */
25197 int n_ctxt;
25198 xmlDocPtr doc; /* a document instance */
25199 int n_doc;
25200 xmlNodePtr elem; /* an element instance */
25201 int n_elem;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025202
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025203 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25204 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25205 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25206 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000025207 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25208 doc = gen_xmlDocPtr(n_doc, 1);
25209 elem = gen_xmlNodePtr(n_elem, 2);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025210
25211 ret_val = xmlValidateOneElement(ctxt, doc, elem);
25212 desret_int(ret_val);
25213 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000025214 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25215 des_xmlDocPtr(n_doc, doc, 1);
25216 des_xmlNodePtr(n_elem, elem, 2);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025217 xmlResetLastError();
25218 if (mem_base != xmlMemBlocks()) {
25219 printf("Leak of %d blocks found in xmlValidateOneElement",
25220 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000025221 test_ret++;
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025222 printf(" %d", n_ctxt);
25223 printf(" %d", n_doc);
25224 printf(" %d", n_elem);
25225 printf("\n");
25226 }
25227 }
25228 }
25229 }
25230#endif
25231
Daniel Veillard3d97e662004-11-04 10:49:00 +000025232 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000025233 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025234}
25235
25236
25237static int
25238test_xmlValidateOneNamespace(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025239 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025240
Daniel Veillard27f20102004-11-05 11:50:11 +000025241#ifdef LIBXML_VALID_ENABLED
25242 int mem_base;
25243 int ret_val;
25244 xmlValidCtxtPtr ctxt; /* the validation context */
25245 int n_ctxt;
25246 xmlDocPtr doc; /* a document instance */
25247 int n_doc;
25248 xmlNodePtr elem; /* an element instance */
25249 int n_elem;
Daniel Veillardce682bc2004-11-05 17:22:25 +000025250 xmlChar * prefix; /* the namespace prefix */
Daniel Veillard27f20102004-11-05 11:50:11 +000025251 int n_prefix;
25252 xmlNsPtr ns; /* an namespace declaration instance */
25253 int n_ns;
Daniel Veillardce682bc2004-11-05 17:22:25 +000025254 xmlChar * value; /* the attribute value (without entities processing) */
Daniel Veillard27f20102004-11-05 11:50:11 +000025255 int n_value;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025256
Daniel Veillard27f20102004-11-05 11:50:11 +000025257 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25258 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25259 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25260 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25261 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
25262 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25263 mem_base = xmlMemBlocks();
25264 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25265 doc = gen_xmlDocPtr(n_doc, 1);
25266 elem = gen_xmlNodePtr(n_elem, 2);
25267 prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25268 ns = gen_xmlNsPtr(n_ns, 4);
25269 value = gen_const_xmlChar_ptr(n_value, 5);
25270
25271 ret_val = xmlValidateOneNamespace(ctxt, doc, elem, prefix, ns, value);
25272 desret_int(ret_val);
25273 call_tests++;
25274 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25275 des_xmlDocPtr(n_doc, doc, 1);
25276 des_xmlNodePtr(n_elem, elem, 2);
25277 des_const_xmlChar_ptr(n_prefix, prefix, 3);
25278 des_xmlNsPtr(n_ns, ns, 4);
25279 des_const_xmlChar_ptr(n_value, value, 5);
25280 xmlResetLastError();
25281 if (mem_base != xmlMemBlocks()) {
25282 printf("Leak of %d blocks found in xmlValidateOneNamespace",
25283 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000025284 test_ret++;
Daniel Veillard27f20102004-11-05 11:50:11 +000025285 printf(" %d", n_ctxt);
25286 printf(" %d", n_doc);
25287 printf(" %d", n_elem);
25288 printf(" %d", n_prefix);
25289 printf(" %d", n_ns);
25290 printf(" %d", n_value);
25291 printf("\n");
25292 }
25293 }
25294 }
25295 }
25296 }
25297 }
25298 }
25299#endif
25300
25301 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000025302 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025303}
25304
25305
25306static int
25307test_xmlValidatePopElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025308 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025309
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025310#ifdef LIBXML_REGEXP_ENABLED
25311 int mem_base;
25312 int ret_val;
25313 xmlValidCtxtPtr ctxt; /* the validation context */
25314 int n_ctxt;
25315 xmlDocPtr doc; /* a document instance */
25316 int n_doc;
25317 xmlNodePtr elem; /* an element instance */
25318 int n_elem;
Daniel Veillardce682bc2004-11-05 17:22:25 +000025319 xmlChar * qname; /* the qualified name as appearing in the serialization */
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025320 int n_qname;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025321
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025322 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25323 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25324 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25325 for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
25326 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000025327 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25328 doc = gen_xmlDocPtr(n_doc, 1);
25329 elem = gen_xmlNodePtr(n_elem, 2);
25330 qname = gen_const_xmlChar_ptr(n_qname, 3);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025331
25332 ret_val = xmlValidatePopElement(ctxt, doc, elem, qname);
25333 desret_int(ret_val);
25334 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000025335 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25336 des_xmlDocPtr(n_doc, doc, 1);
25337 des_xmlNodePtr(n_elem, elem, 2);
25338 des_const_xmlChar_ptr(n_qname, qname, 3);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025339 xmlResetLastError();
25340 if (mem_base != xmlMemBlocks()) {
25341 printf("Leak of %d blocks found in xmlValidatePopElement",
25342 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000025343 test_ret++;
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025344 printf(" %d", n_ctxt);
25345 printf(" %d", n_doc);
25346 printf(" %d", n_elem);
25347 printf(" %d", n_qname);
25348 printf("\n");
25349 }
25350 }
25351 }
25352 }
25353 }
25354#endif
25355
Daniel Veillard3d97e662004-11-04 10:49:00 +000025356 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000025357 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025358}
25359
25360
25361static int
25362test_xmlValidatePushCData(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025363 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025364
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025365#ifdef LIBXML_REGEXP_ENABLED
25366 int mem_base;
25367 int ret_val;
25368 xmlValidCtxtPtr ctxt; /* the validation context */
25369 int n_ctxt;
Daniel Veillardce682bc2004-11-05 17:22:25 +000025370 xmlChar * data; /* some character data read */
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025371 int n_data;
25372 int len; /* the lenght of the data */
25373 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025374
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025375 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25376 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
25377 for (n_len = 0;n_len < gen_nb_int;n_len++) {
25378 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000025379 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25380 data = gen_const_xmlChar_ptr(n_data, 1);
25381 len = gen_int(n_len, 2);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025382
25383 ret_val = xmlValidatePushCData(ctxt, data, len);
25384 desret_int(ret_val);
25385 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000025386 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25387 des_const_xmlChar_ptr(n_data, data, 1);
25388 des_int(n_len, len, 2);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025389 xmlResetLastError();
25390 if (mem_base != xmlMemBlocks()) {
25391 printf("Leak of %d blocks found in xmlValidatePushCData",
25392 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000025393 test_ret++;
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025394 printf(" %d", n_ctxt);
25395 printf(" %d", n_data);
25396 printf(" %d", n_len);
25397 printf("\n");
25398 }
25399 }
25400 }
25401 }
25402#endif
25403
Daniel Veillard3d97e662004-11-04 10:49:00 +000025404 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000025405 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025406}
25407
25408
25409static int
25410test_xmlValidatePushElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025411 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025412
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025413#ifdef LIBXML_REGEXP_ENABLED
25414 int mem_base;
25415 int ret_val;
25416 xmlValidCtxtPtr ctxt; /* the validation context */
25417 int n_ctxt;
25418 xmlDocPtr doc; /* a document instance */
25419 int n_doc;
25420 xmlNodePtr elem; /* an element instance */
25421 int n_elem;
Daniel Veillardce682bc2004-11-05 17:22:25 +000025422 xmlChar * qname; /* the qualified name as appearing in the serialization */
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025423 int n_qname;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025424
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025425 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25426 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25427 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25428 for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
25429 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000025430 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25431 doc = gen_xmlDocPtr(n_doc, 1);
25432 elem = gen_xmlNodePtr(n_elem, 2);
25433 qname = gen_const_xmlChar_ptr(n_qname, 3);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025434
25435 ret_val = xmlValidatePushElement(ctxt, doc, elem, qname);
25436 desret_int(ret_val);
25437 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000025438 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25439 des_xmlDocPtr(n_doc, doc, 1);
25440 des_xmlNodePtr(n_elem, elem, 2);
25441 des_const_xmlChar_ptr(n_qname, qname, 3);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025442 xmlResetLastError();
25443 if (mem_base != xmlMemBlocks()) {
25444 printf("Leak of %d blocks found in xmlValidatePushElement",
25445 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000025446 test_ret++;
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025447 printf(" %d", n_ctxt);
25448 printf(" %d", n_doc);
25449 printf(" %d", n_elem);
25450 printf(" %d", n_qname);
25451 printf("\n");
25452 }
25453 }
25454 }
25455 }
25456 }
25457#endif
25458
Daniel Veillard3d97e662004-11-04 10:49:00 +000025459 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000025460 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025461}
25462
25463
25464static int
25465test_xmlValidateRoot(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025466 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025467
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025468#ifdef LIBXML_VALID_ENABLED
25469 int mem_base;
25470 int ret_val;
25471 xmlValidCtxtPtr ctxt; /* the validation context */
25472 int n_ctxt;
25473 xmlDocPtr doc; /* a document instance */
25474 int n_doc;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025475
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025476 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25477 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25478 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000025479 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25480 doc = gen_xmlDocPtr(n_doc, 1);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025481
25482 ret_val = xmlValidateRoot(ctxt, doc);
25483 desret_int(ret_val);
25484 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000025485 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25486 des_xmlDocPtr(n_doc, doc, 1);
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025487 xmlResetLastError();
25488 if (mem_base != xmlMemBlocks()) {
25489 printf("Leak of %d blocks found in xmlValidateRoot",
25490 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000025491 test_ret++;
Daniel Veillardc0be74b2004-11-03 19:16:55 +000025492 printf(" %d", n_ctxt);
25493 printf(" %d", n_doc);
25494 printf("\n");
25495 }
25496 }
25497 }
25498#endif
25499
Daniel Veillard3d97e662004-11-04 10:49:00 +000025500 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000025501 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025502}
25503
25504static int
25505test_valid(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025506 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025507
Daniel Veillard42595322004-11-08 10:52:06 +000025508 printf("Testing valid : 46 of 67 functions ...\n");
25509 test_ret += test_xmlAddAttributeDecl();
25510 test_ret += test_xmlAddElementDecl();
25511 test_ret += test_xmlAddID();
25512 test_ret += test_xmlAddNotationDecl();
25513 test_ret += test_xmlAddRef();
25514 test_ret += test_xmlCopyAttributeTable();
25515 test_ret += test_xmlCopyElementContent();
25516 test_ret += test_xmlCopyElementTable();
25517 test_ret += test_xmlCopyEnumeration();
25518 test_ret += test_xmlCopyNotationTable();
25519 test_ret += test_xmlCreateEnumeration();
25520 test_ret += test_xmlDumpAttributeDecl();
25521 test_ret += test_xmlDumpAttributeTable();
25522 test_ret += test_xmlDumpElementDecl();
25523 test_ret += test_xmlDumpElementTable();
25524 test_ret += test_xmlDumpNotationDecl();
25525 test_ret += test_xmlDumpNotationTable();
25526 test_ret += test_xmlGetDtdAttrDesc();
25527 test_ret += test_xmlGetDtdElementDesc();
25528 test_ret += test_xmlGetDtdNotationDesc();
25529 test_ret += test_xmlGetDtdQAttrDesc();
25530 test_ret += test_xmlGetDtdQElementDesc();
25531 test_ret += test_xmlGetID();
25532 test_ret += test_xmlGetRefs();
25533 test_ret += test_xmlIsID();
25534 test_ret += test_xmlIsMixedElement();
25535 test_ret += test_xmlIsRef();
25536 test_ret += test_xmlNewElementContent();
25537 test_ret += test_xmlNewValidCtxt();
25538 test_ret += test_xmlRemoveID();
25539 test_ret += test_xmlRemoveRef();
25540 test_ret += test_xmlSnprintfElementContent();
25541 test_ret += test_xmlSprintfElementContent();
25542 test_ret += test_xmlValidBuildContentModel();
25543 test_ret += test_xmlValidCtxtNormalizeAttributeValue();
25544 test_ret += test_xmlValidGetPotentialChildren();
25545 test_ret += test_xmlValidGetValidElements();
25546 test_ret += test_xmlValidNormalizeAttributeValue();
25547 test_ret += test_xmlValidateAttributeDecl();
25548 test_ret += test_xmlValidateAttributeValue();
25549 test_ret += test_xmlValidateDocument();
25550 test_ret += test_xmlValidateDocumentFinal();
25551 test_ret += test_xmlValidateDtd();
25552 test_ret += test_xmlValidateDtdFinal();
25553 test_ret += test_xmlValidateElement();
25554 test_ret += test_xmlValidateElementDecl();
25555 test_ret += test_xmlValidateNameValue();
25556 test_ret += test_xmlValidateNamesValue();
25557 test_ret += test_xmlValidateNmtokenValue();
25558 test_ret += test_xmlValidateNmtokensValue();
25559 test_ret += test_xmlValidateNotationDecl();
25560 test_ret += test_xmlValidateNotationUse();
25561 test_ret += test_xmlValidateOneAttribute();
25562 test_ret += test_xmlValidateOneElement();
25563 test_ret += test_xmlValidateOneNamespace();
25564 test_ret += test_xmlValidatePopElement();
25565 test_ret += test_xmlValidatePushCData();
25566 test_ret += test_xmlValidatePushElement();
25567 test_ret += test_xmlValidateRoot();
Daniel Veillardd93f6252004-11-02 15:53:51 +000025568
Daniel Veillard42595322004-11-08 10:52:06 +000025569 if (test_ret != 0)
25570 printf("Module valid: %d errors\n", test_ret);
25571 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025572}
25573
25574static int
25575test_xmlXIncludeNewContext(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025576 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025577
25578
25579 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000025580 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025581}
25582
25583
25584static int
25585test_xmlXIncludeProcess(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025586 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025587
25588#ifdef LIBXML_XINCLUDE_ENABLED
25589 int mem_base;
25590 int ret_val;
25591 xmlDocPtr doc; /* an XML document */
25592 int n_doc;
25593
25594 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25595 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000025596 doc = gen_xmlDocPtr(n_doc, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025597
25598 ret_val = xmlXIncludeProcess(doc);
25599 desret_int(ret_val);
25600 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000025601 des_xmlDocPtr(n_doc, doc, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025602 xmlResetLastError();
25603 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000025604 printf("Leak of %d blocks found in xmlXIncludeProcess",
Daniel Veillardd93f6252004-11-02 15:53:51 +000025605 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000025606 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000025607 printf(" %d", n_doc);
25608 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000025609 }
25610 }
25611#endif
25612
Daniel Veillard3d97e662004-11-04 10:49:00 +000025613 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000025614 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025615}
25616
25617
25618static int
25619test_xmlXIncludeProcessFlags(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025620 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025621
25622#ifdef LIBXML_XINCLUDE_ENABLED
25623 int mem_base;
25624 int ret_val;
25625 xmlDocPtr doc; /* an XML document */
25626 int n_doc;
25627 int flags; /* a set of xmlParserOption used for parsing XML includes */
25628 int n_flags;
25629
25630 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25631 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
25632 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000025633 doc = gen_xmlDocPtr(n_doc, 0);
25634 flags = gen_int(n_flags, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025635
25636 ret_val = xmlXIncludeProcessFlags(doc, flags);
25637 desret_int(ret_val);
25638 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000025639 des_xmlDocPtr(n_doc, doc, 0);
25640 des_int(n_flags, flags, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025641 xmlResetLastError();
25642 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000025643 printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
Daniel Veillardd93f6252004-11-02 15:53:51 +000025644 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000025645 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000025646 printf(" %d", n_doc);
25647 printf(" %d", n_flags);
25648 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000025649 }
25650 }
25651 }
25652#endif
25653
Daniel Veillard3d97e662004-11-04 10:49:00 +000025654 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000025655 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025656}
25657
25658
Daniel Veillardce682bc2004-11-05 17:22:25 +000025659#define gen_nb_xmlXIncludeCtxtPtr 1
25660static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25661 return(NULL);
25662}
25663static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25664}
25665
Daniel Veillardd93f6252004-11-02 15:53:51 +000025666static int
25667test_xmlXIncludeProcessNode(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025668 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025669
Daniel Veillardce682bc2004-11-05 17:22:25 +000025670#ifdef LIBXML_XINCLUDE_ENABLED
25671 int mem_base;
25672 int ret_val;
25673 xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
25674 int n_ctxt;
25675 xmlNodePtr node; /* a node in an XML document */
25676 int n_node;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025677
Daniel Veillardce682bc2004-11-05 17:22:25 +000025678 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
25679 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
25680 mem_base = xmlMemBlocks();
25681 ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
25682 node = gen_xmlNodePtr(n_node, 1);
25683
25684 ret_val = xmlXIncludeProcessNode(ctxt, node);
25685 desret_int(ret_val);
25686 call_tests++;
25687 des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
25688 des_xmlNodePtr(n_node, node, 1);
25689 xmlResetLastError();
25690 if (mem_base != xmlMemBlocks()) {
25691 printf("Leak of %d blocks found in xmlXIncludeProcessNode",
25692 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000025693 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000025694 printf(" %d", n_ctxt);
25695 printf(" %d", n_node);
25696 printf("\n");
25697 }
25698 }
25699 }
25700#endif
25701
25702 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000025703 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025704}
25705
25706
25707static int
25708test_xmlXIncludeProcessTree(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025709 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025710
25711#ifdef LIBXML_XINCLUDE_ENABLED
25712 int mem_base;
25713 int ret_val;
25714 xmlNodePtr tree; /* a node in an XML document */
25715 int n_tree;
25716
25717 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
25718 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000025719 tree = gen_xmlNodePtr(n_tree, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025720
25721 ret_val = xmlXIncludeProcessTree(tree);
25722 desret_int(ret_val);
25723 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000025724 des_xmlNodePtr(n_tree, tree, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025725 xmlResetLastError();
25726 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000025727 printf("Leak of %d blocks found in xmlXIncludeProcessTree",
Daniel Veillardd93f6252004-11-02 15:53:51 +000025728 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000025729 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000025730 printf(" %d", n_tree);
25731 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000025732 }
25733 }
25734#endif
25735
Daniel Veillard3d97e662004-11-04 10:49:00 +000025736 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000025737 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025738}
25739
25740
25741static int
25742test_xmlXIncludeProcessTreeFlags(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025743 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025744
25745#ifdef LIBXML_XINCLUDE_ENABLED
25746 int mem_base;
25747 int ret_val;
25748 xmlNodePtr tree; /* a node in an XML document */
25749 int n_tree;
25750 int flags; /* a set of xmlParserOption used for parsing XML includes */
25751 int n_flags;
25752
25753 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
25754 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
25755 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000025756 tree = gen_xmlNodePtr(n_tree, 0);
25757 flags = gen_int(n_flags, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025758
25759 ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
25760 desret_int(ret_val);
25761 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000025762 des_xmlNodePtr(n_tree, tree, 0);
25763 des_int(n_flags, flags, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025764 xmlResetLastError();
25765 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000025766 printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
Daniel Veillardd93f6252004-11-02 15:53:51 +000025767 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000025768 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000025769 printf(" %d", n_tree);
25770 printf(" %d", n_flags);
25771 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000025772 }
25773 }
25774 }
25775#endif
25776
Daniel Veillard3d97e662004-11-04 10:49:00 +000025777 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000025778 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025779}
25780
25781
25782static int
25783test_xmlXIncludeSetFlags(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025784 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025785
Daniel Veillardce682bc2004-11-05 17:22:25 +000025786#ifdef LIBXML_XINCLUDE_ENABLED
25787 int mem_base;
25788 int ret_val;
25789 xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
25790 int n_ctxt;
25791 int flags; /* a set of xmlParserOption used for parsing XML includes */
25792 int n_flags;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025793
Daniel Veillardce682bc2004-11-05 17:22:25 +000025794 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
25795 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
25796 mem_base = xmlMemBlocks();
25797 ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
25798 flags = gen_int(n_flags, 1);
25799
25800 ret_val = xmlXIncludeSetFlags(ctxt, flags);
25801 desret_int(ret_val);
25802 call_tests++;
25803 des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
25804 des_int(n_flags, flags, 1);
25805 xmlResetLastError();
25806 if (mem_base != xmlMemBlocks()) {
25807 printf("Leak of %d blocks found in xmlXIncludeSetFlags",
25808 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000025809 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000025810 printf(" %d", n_ctxt);
25811 printf(" %d", n_flags);
25812 printf("\n");
25813 }
25814 }
25815 }
25816#endif
25817
25818 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000025819 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025820}
25821
25822static int
25823test_xinclude(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025824 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025825
Daniel Veillardce682bc2004-11-05 17:22:25 +000025826 printf("Testing xinclude : 6 of 8 functions ...\n");
Daniel Veillard42595322004-11-08 10:52:06 +000025827 test_ret += test_xmlXIncludeNewContext();
25828 test_ret += test_xmlXIncludeProcess();
25829 test_ret += test_xmlXIncludeProcessFlags();
25830 test_ret += test_xmlXIncludeProcessNode();
25831 test_ret += test_xmlXIncludeProcessTree();
25832 test_ret += test_xmlXIncludeProcessTreeFlags();
25833 test_ret += test_xmlXIncludeSetFlags();
Daniel Veillardd93f6252004-11-02 15:53:51 +000025834
Daniel Veillard42595322004-11-08 10:52:06 +000025835 if (test_ret != 0)
25836 printf("Module xinclude: %d errors\n", test_ret);
25837 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025838}
25839
25840static int
25841test_xmlAllocOutputBuffer(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025842 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025843
Daniel Veillard3d95c732004-11-06 22:25:14 +000025844#ifdef LIBXML_OUTPUT_ENABLED
25845 int mem_base;
25846 xmlOutputBufferPtr ret_val;
25847 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
25848 int n_encoder;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025849
Daniel Veillard3d95c732004-11-06 22:25:14 +000025850 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
25851 mem_base = xmlMemBlocks();
25852 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
25853
25854 ret_val = xmlAllocOutputBuffer(encoder);
25855 desret_xmlOutputBufferPtr(ret_val);
25856 call_tests++;
25857 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
25858 xmlResetLastError();
25859 if (mem_base != xmlMemBlocks()) {
25860 printf("Leak of %d blocks found in xmlAllocOutputBuffer",
25861 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000025862 test_ret++;
Daniel Veillard3d95c732004-11-06 22:25:14 +000025863 printf(" %d", n_encoder);
25864 printf("\n");
25865 }
25866 }
25867#endif
25868
25869 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000025870 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025871}
25872
25873
25874static int
25875test_xmlAllocParserInputBuffer(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025876 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025877
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000025878 int mem_base;
25879 xmlParserInputBufferPtr ret_val;
25880 xmlCharEncoding enc; /* the charset encoding if known */
25881 int n_enc;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025882
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000025883 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
25884 mem_base = xmlMemBlocks();
25885 enc = gen_xmlCharEncoding(n_enc, 0);
25886
25887 ret_val = xmlAllocParserInputBuffer(enc);
25888 desret_xmlParserInputBufferPtr(ret_val);
25889 call_tests++;
25890 des_xmlCharEncoding(n_enc, enc, 0);
25891 xmlResetLastError();
25892 if (mem_base != xmlMemBlocks()) {
25893 printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
25894 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000025895 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000025896 printf(" %d", n_enc);
25897 printf("\n");
25898 }
25899 }
25900
25901 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000025902 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025903}
25904
25905
25906static int
25907test_xmlCheckFilename(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025908 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025909
25910 int mem_base;
25911 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000025912 char * path; /* the path to check */
Daniel Veillardd93f6252004-11-02 15:53:51 +000025913 int n_path;
25914
25915 for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
25916 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000025917 path = gen_const_char_ptr(n_path, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025918
25919 ret_val = xmlCheckFilename(path);
25920 desret_int(ret_val);
25921 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000025922 des_const_char_ptr(n_path, path, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025923 xmlResetLastError();
25924 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000025925 printf("Leak of %d blocks found in xmlCheckFilename",
Daniel Veillardd93f6252004-11-02 15:53:51 +000025926 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000025927 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000025928 printf(" %d", n_path);
25929 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000025930 }
25931 }
25932
Daniel Veillard3d97e662004-11-04 10:49:00 +000025933 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000025934 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025935}
25936
25937
25938static int
25939test_xmlCheckHTTPInput(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025940 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025941
Daniel Veillard42595322004-11-08 10:52:06 +000025942 int mem_base;
25943 xmlParserInputPtr ret_val;
25944 xmlParserCtxtPtr ctxt; /* an XML parser context */
25945 int n_ctxt;
25946 xmlParserInputPtr ret; /* an XML parser input */
25947 int n_ret;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025948
Daniel Veillard42595322004-11-08 10:52:06 +000025949 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
25950 for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
25951 mem_base = xmlMemBlocks();
25952 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
25953 ret = gen_xmlParserInputPtr(n_ret, 1);
25954
25955 ret_val = xmlCheckHTTPInput(ctxt, ret);
25956 desret_xmlParserInputPtr(ret_val);
25957 call_tests++;
25958 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
25959 des_xmlParserInputPtr(n_ret, ret, 1);
25960 xmlResetLastError();
25961 if (mem_base != xmlMemBlocks()) {
25962 printf("Leak of %d blocks found in xmlCheckHTTPInput",
25963 xmlMemBlocks() - mem_base);
25964 test_ret++;
25965 printf(" %d", n_ctxt);
25966 printf(" %d", n_ret);
25967 printf("\n");
25968 }
25969 }
25970 }
25971
25972 function_tests++;
25973 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025974}
25975
25976
25977static int
25978test_xmlCleanupInputCallbacks(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000025979 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000025980
25981 int mem_base;
25982
25983 mem_base = xmlMemBlocks();
25984
25985 xmlCleanupInputCallbacks();
25986 call_tests++;
25987 xmlResetLastError();
25988 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000025989 printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
Daniel Veillardd93f6252004-11-02 15:53:51 +000025990 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000025991 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000025992 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000025993 }
25994
Daniel Veillard3d97e662004-11-04 10:49:00 +000025995 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000025996 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000025997}
25998
25999
26000static int
26001test_xmlCleanupOutputCallbacks(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026002 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026003
26004#ifdef LIBXML_OUTPUT_ENABLED
26005 int mem_base;
26006
26007 mem_base = xmlMemBlocks();
26008
26009 xmlCleanupOutputCallbacks();
26010 call_tests++;
26011 xmlResetLastError();
26012 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000026013 printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
Daniel Veillardd93f6252004-11-02 15:53:51 +000026014 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026015 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000026016 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000026017 }
26018#endif
26019
Daniel Veillard3d97e662004-11-04 10:49:00 +000026020 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026021 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026022}
26023
26024
26025static int
26026test_xmlFileClose(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026027 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026028
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026029 int mem_base;
26030 int ret_val;
26031 void * context; /* the I/O context */
26032 int n_context;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026033
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026034 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26035 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000026036 context = gen_void_ptr(n_context, 0);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026037
26038 ret_val = xmlFileClose(context);
26039 desret_int(ret_val);
26040 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000026041 des_void_ptr(n_context, context, 0);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026042 xmlResetLastError();
26043 if (mem_base != xmlMemBlocks()) {
26044 printf("Leak of %d blocks found in xmlFileClose",
26045 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026046 test_ret++;
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026047 printf(" %d", n_context);
26048 printf("\n");
26049 }
26050 }
26051
Daniel Veillard3d97e662004-11-04 10:49:00 +000026052 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026053 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026054}
26055
26056
26057static int
26058test_xmlFileMatch(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026059 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026060
26061 int mem_base;
26062 int ret_val;
26063 const char * filename; /* the URI for matching */
26064 int n_filename;
26065
26066 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26067 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000026068 filename = gen_filepath(n_filename, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026069
26070 ret_val = xmlFileMatch(filename);
26071 desret_int(ret_val);
26072 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000026073 des_filepath(n_filename, filename, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026074 xmlResetLastError();
26075 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000026076 printf("Leak of %d blocks found in xmlFileMatch",
Daniel Veillardd93f6252004-11-02 15:53:51 +000026077 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026078 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000026079 printf(" %d", n_filename);
26080 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000026081 }
26082 }
26083
Daniel Veillard3d97e662004-11-04 10:49:00 +000026084 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026085 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026086}
26087
26088
26089static int
26090test_xmlFileOpen(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026091 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026092
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026093 int mem_base;
26094 void * ret_val;
26095 const char * filename; /* the URI for matching */
26096 int n_filename;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026097
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026098 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26099 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000026100 filename = gen_filepath(n_filename, 0);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026101
26102 ret_val = xmlFileOpen(filename);
26103 desret_void_ptr(ret_val);
26104 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000026105 des_filepath(n_filename, filename, 0);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026106 xmlResetLastError();
26107 if (mem_base != xmlMemBlocks()) {
26108 printf("Leak of %d blocks found in xmlFileOpen",
26109 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026110 test_ret++;
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026111 printf(" %d", n_filename);
26112 printf("\n");
26113 }
26114 }
26115
Daniel Veillard3d97e662004-11-04 10:49:00 +000026116 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026117 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026118}
26119
26120
26121static int
26122test_xmlFileRead(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026123 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026124
Daniel Veillardce682bc2004-11-05 17:22:25 +000026125 int mem_base;
26126 int ret_val;
26127 void * context; /* the I/O context */
26128 int n_context;
26129 char * buffer; /* where to drop data */
26130 int n_buffer;
26131 int len; /* number of bytes to write */
26132 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026133
Daniel Veillardce682bc2004-11-05 17:22:25 +000026134 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26135 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
26136 for (n_len = 0;n_len < gen_nb_int;n_len++) {
26137 mem_base = xmlMemBlocks();
26138 context = gen_void_ptr(n_context, 0);
26139 buffer = gen_char_ptr(n_buffer, 1);
26140 len = gen_int(n_len, 2);
26141
26142 ret_val = xmlFileRead(context, buffer, len);
26143 desret_int(ret_val);
26144 call_tests++;
26145 des_void_ptr(n_context, context, 0);
26146 des_char_ptr(n_buffer, buffer, 1);
26147 des_int(n_len, len, 2);
26148 xmlResetLastError();
26149 if (mem_base != xmlMemBlocks()) {
26150 printf("Leak of %d blocks found in xmlFileRead",
26151 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026152 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000026153 printf(" %d", n_context);
26154 printf(" %d", n_buffer);
26155 printf(" %d", n_len);
26156 printf("\n");
26157 }
26158 }
26159 }
26160 }
26161
26162 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026163 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026164}
26165
26166
26167static int
26168test_xmlIOFTPClose(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026169 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026170
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026171#ifdef LIBXML_FTP_ENABLED
26172 int mem_base;
26173 int ret_val;
26174 void * context; /* the I/O context */
26175 int n_context;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026176
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026177 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26178 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000026179 context = gen_void_ptr(n_context, 0);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026180
26181 ret_val = xmlIOFTPClose(context);
26182 desret_int(ret_val);
26183 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000026184 des_void_ptr(n_context, context, 0);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026185 xmlResetLastError();
26186 if (mem_base != xmlMemBlocks()) {
26187 printf("Leak of %d blocks found in xmlIOFTPClose",
26188 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026189 test_ret++;
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026190 printf(" %d", n_context);
26191 printf("\n");
26192 }
26193 }
26194#endif
26195
Daniel Veillard3d97e662004-11-04 10:49:00 +000026196 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026197 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026198}
26199
26200
26201static int
26202test_xmlIOFTPMatch(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026203 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026204
26205#ifdef LIBXML_FTP_ENABLED
26206 int mem_base;
26207 int ret_val;
26208 const char * filename; /* the URI for matching */
26209 int n_filename;
26210
26211 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26212 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000026213 filename = gen_filepath(n_filename, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026214
26215 ret_val = xmlIOFTPMatch(filename);
26216 desret_int(ret_val);
26217 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000026218 des_filepath(n_filename, filename, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026219 xmlResetLastError();
26220 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000026221 printf("Leak of %d blocks found in xmlIOFTPMatch",
Daniel Veillardd93f6252004-11-02 15:53:51 +000026222 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026223 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000026224 printf(" %d", n_filename);
26225 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000026226 }
26227 }
26228#endif
26229
Daniel Veillard3d97e662004-11-04 10:49:00 +000026230 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026231 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026232}
26233
26234
26235static int
26236test_xmlIOFTPOpen(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026237 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026238
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026239#ifdef LIBXML_FTP_ENABLED
26240 int mem_base;
26241 void * ret_val;
26242 const char * filename; /* the URI for matching */
26243 int n_filename;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026244
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026245 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26246 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000026247 filename = gen_filepath(n_filename, 0);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026248
26249 ret_val = xmlIOFTPOpen(filename);
26250 desret_void_ptr(ret_val);
26251 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000026252 des_filepath(n_filename, filename, 0);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026253 xmlResetLastError();
26254 if (mem_base != xmlMemBlocks()) {
26255 printf("Leak of %d blocks found in xmlIOFTPOpen",
26256 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026257 test_ret++;
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026258 printf(" %d", n_filename);
26259 printf("\n");
26260 }
26261 }
26262#endif
26263
Daniel Veillard3d97e662004-11-04 10:49:00 +000026264 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026265 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026266}
26267
26268
26269static int
26270test_xmlIOFTPRead(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026271 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026272
Daniel Veillardce682bc2004-11-05 17:22:25 +000026273#ifdef LIBXML_FTP_ENABLED
26274 int mem_base;
26275 int ret_val;
26276 void * context; /* the I/O context */
26277 int n_context;
26278 char * buffer; /* where to drop data */
26279 int n_buffer;
26280 int len; /* number of bytes to write */
26281 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026282
Daniel Veillardce682bc2004-11-05 17:22:25 +000026283 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26284 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
26285 for (n_len = 0;n_len < gen_nb_int;n_len++) {
26286 mem_base = xmlMemBlocks();
26287 context = gen_void_ptr(n_context, 0);
26288 buffer = gen_char_ptr(n_buffer, 1);
26289 len = gen_int(n_len, 2);
26290
26291 ret_val = xmlIOFTPRead(context, buffer, len);
26292 desret_int(ret_val);
26293 call_tests++;
26294 des_void_ptr(n_context, context, 0);
26295 des_char_ptr(n_buffer, buffer, 1);
26296 des_int(n_len, len, 2);
26297 xmlResetLastError();
26298 if (mem_base != xmlMemBlocks()) {
26299 printf("Leak of %d blocks found in xmlIOFTPRead",
26300 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026301 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000026302 printf(" %d", n_context);
26303 printf(" %d", n_buffer);
26304 printf(" %d", n_len);
26305 printf("\n");
26306 }
26307 }
26308 }
26309 }
26310#endif
26311
26312 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026313 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026314}
26315
26316
26317static int
26318test_xmlIOHTTPClose(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026319 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026320
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026321#ifdef LIBXML_HTTP_ENABLED
26322 int mem_base;
26323 int ret_val;
26324 void * context; /* the I/O context */
26325 int n_context;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026326
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026327 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26328 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000026329 context = gen_void_ptr(n_context, 0);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026330
26331 ret_val = xmlIOHTTPClose(context);
26332 desret_int(ret_val);
26333 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000026334 des_void_ptr(n_context, context, 0);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026335 xmlResetLastError();
26336 if (mem_base != xmlMemBlocks()) {
26337 printf("Leak of %d blocks found in xmlIOHTTPClose",
26338 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026339 test_ret++;
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026340 printf(" %d", n_context);
26341 printf("\n");
26342 }
26343 }
26344#endif
26345
Daniel Veillard3d97e662004-11-04 10:49:00 +000026346 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026347 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026348}
26349
26350
26351static int
26352test_xmlIOHTTPMatch(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026353 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026354
26355#ifdef LIBXML_HTTP_ENABLED
26356 int mem_base;
26357 int ret_val;
26358 const char * filename; /* the URI for matching */
26359 int n_filename;
26360
26361 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26362 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000026363 filename = gen_filepath(n_filename, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026364
26365 ret_val = xmlIOHTTPMatch(filename);
26366 desret_int(ret_val);
26367 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000026368 des_filepath(n_filename, filename, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026369 xmlResetLastError();
26370 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000026371 printf("Leak of %d blocks found in xmlIOHTTPMatch",
Daniel Veillardd93f6252004-11-02 15:53:51 +000026372 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026373 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000026374 printf(" %d", n_filename);
26375 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000026376 }
26377 }
26378#endif
26379
Daniel Veillard3d97e662004-11-04 10:49:00 +000026380 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026381 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026382}
26383
26384
26385static int
26386test_xmlIOHTTPOpen(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026387 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026388
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026389#ifdef LIBXML_HTTP_ENABLED
26390 int mem_base;
26391 void * ret_val;
26392 const char * filename; /* the URI for matching */
26393 int n_filename;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026394
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026395 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26396 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000026397 filename = gen_filepath(n_filename, 0);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026398
26399 ret_val = xmlIOHTTPOpen(filename);
26400 desret_void_ptr(ret_val);
26401 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000026402 des_filepath(n_filename, filename, 0);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026403 xmlResetLastError();
26404 if (mem_base != xmlMemBlocks()) {
26405 printf("Leak of %d blocks found in xmlIOHTTPOpen",
26406 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026407 test_ret++;
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000026408 printf(" %d", n_filename);
26409 printf("\n");
26410 }
26411 }
26412#endif
26413
Daniel Veillard3d97e662004-11-04 10:49:00 +000026414 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026415 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026416}
26417
26418
26419static int
26420test_xmlIOHTTPOpenW(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026421 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026422
26423
26424 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000026425 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026426}
26427
26428
26429static int
26430test_xmlIOHTTPRead(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026431 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026432
Daniel Veillardce682bc2004-11-05 17:22:25 +000026433#ifdef LIBXML_HTTP_ENABLED
26434 int mem_base;
26435 int ret_val;
26436 void * context; /* the I/O context */
26437 int n_context;
26438 char * buffer; /* where to drop data */
26439 int n_buffer;
26440 int len; /* number of bytes to write */
26441 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026442
Daniel Veillardce682bc2004-11-05 17:22:25 +000026443 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26444 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
26445 for (n_len = 0;n_len < gen_nb_int;n_len++) {
26446 mem_base = xmlMemBlocks();
26447 context = gen_void_ptr(n_context, 0);
26448 buffer = gen_char_ptr(n_buffer, 1);
26449 len = gen_int(n_len, 2);
26450
26451 ret_val = xmlIOHTTPRead(context, buffer, len);
26452 desret_int(ret_val);
26453 call_tests++;
26454 des_void_ptr(n_context, context, 0);
26455 des_char_ptr(n_buffer, buffer, 1);
26456 des_int(n_len, len, 2);
26457 xmlResetLastError();
26458 if (mem_base != xmlMemBlocks()) {
26459 printf("Leak of %d blocks found in xmlIOHTTPRead",
26460 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026461 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000026462 printf(" %d", n_context);
26463 printf(" %d", n_buffer);
26464 printf(" %d", n_len);
26465 printf("\n");
26466 }
26467 }
26468 }
26469 }
26470#endif
26471
26472 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026473 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026474}
26475
26476
26477static int
26478test_xmlNoNetExternalEntityLoader(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026479 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026480
Daniel Veillard42595322004-11-08 10:52:06 +000026481 int mem_base;
26482 xmlParserInputPtr ret_val;
26483 const char * URL; /* the URL for the entity to load */
26484 int n_URL;
26485 char * ID; /* the System ID for the entity to load */
26486 int n_ID;
26487 xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
26488 int n_ctxt;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026489
Daniel Veillard42595322004-11-08 10:52:06 +000026490 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
26491 for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
26492 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
26493 mem_base = xmlMemBlocks();
26494 URL = gen_filepath(n_URL, 0);
26495 ID = gen_const_char_ptr(n_ID, 1);
26496 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
26497
26498 ret_val = xmlNoNetExternalEntityLoader(URL, ID, ctxt);
26499 desret_xmlParserInputPtr(ret_val);
26500 call_tests++;
26501 des_filepath(n_URL, URL, 0);
26502 des_const_char_ptr(n_ID, ID, 1);
26503 des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
26504 xmlResetLastError();
26505 if (mem_base != xmlMemBlocks()) {
26506 printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
26507 xmlMemBlocks() - mem_base);
26508 test_ret++;
26509 printf(" %d", n_URL);
26510 printf(" %d", n_ID);
26511 printf(" %d", n_ctxt);
26512 printf("\n");
26513 }
26514 }
26515 }
26516 }
26517
26518 function_tests++;
26519 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026520}
26521
26522
26523static int
26524test_xmlNormalizeWindowsPath(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026525 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026526
Daniel Veillard8a32fe42004-11-02 22:10:16 +000026527 int mem_base;
26528 xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000026529 xmlChar * path; /* the input file path */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000026530 int n_path;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026531
Daniel Veillard8a32fe42004-11-02 22:10:16 +000026532 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
26533 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000026534 path = gen_const_xmlChar_ptr(n_path, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000026535
26536 ret_val = xmlNormalizeWindowsPath(path);
26537 desret_xmlChar_ptr(ret_val);
26538 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000026539 des_const_xmlChar_ptr(n_path, path, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000026540 xmlResetLastError();
26541 if (mem_base != xmlMemBlocks()) {
26542 printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
26543 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026544 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000026545 printf(" %d", n_path);
26546 printf("\n");
26547 }
26548 }
26549
Daniel Veillard3d97e662004-11-04 10:49:00 +000026550 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026551 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026552}
26553
26554
26555static int
26556test_xmlOutputBufferCreateFd(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026557 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026558
Daniel Veillard3d95c732004-11-06 22:25:14 +000026559#ifdef LIBXML_OUTPUT_ENABLED
26560 int mem_base;
26561 xmlOutputBufferPtr ret_val;
26562 int fd; /* a file descriptor number */
26563 int n_fd;
26564 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
26565 int n_encoder;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026566
Daniel Veillard3d95c732004-11-06 22:25:14 +000026567 for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
26568 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
26569 mem_base = xmlMemBlocks();
26570 fd = gen_int(n_fd, 0);
26571 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
26572
26573 ret_val = xmlOutputBufferCreateFd(fd, encoder);
26574 desret_xmlOutputBufferPtr(ret_val);
26575 call_tests++;
26576 des_int(n_fd, fd, 0);
26577 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
26578 xmlResetLastError();
26579 if (mem_base != xmlMemBlocks()) {
26580 printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
26581 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026582 test_ret++;
Daniel Veillard3d95c732004-11-06 22:25:14 +000026583 printf(" %d", n_fd);
26584 printf(" %d", n_encoder);
26585 printf("\n");
26586 }
26587 }
26588 }
26589#endif
26590
26591 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026592 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026593}
26594
26595
26596static int
26597test_xmlOutputBufferCreateFile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026598 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026599
Daniel Veillard3d95c732004-11-06 22:25:14 +000026600#ifdef LIBXML_OUTPUT_ENABLED
26601 int mem_base;
26602 xmlOutputBufferPtr ret_val;
26603 FILE * file; /* a FILE* */
26604 int n_file;
26605 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
26606 int n_encoder;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026607
Daniel Veillard3d95c732004-11-06 22:25:14 +000026608 for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
26609 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
26610 mem_base = xmlMemBlocks();
26611 file = gen_FILE_ptr(n_file, 0);
26612 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
26613
26614 ret_val = xmlOutputBufferCreateFile(file, encoder);
26615 desret_xmlOutputBufferPtr(ret_val);
26616 call_tests++;
26617 des_FILE_ptr(n_file, file, 0);
26618 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
26619 xmlResetLastError();
26620 if (mem_base != xmlMemBlocks()) {
26621 printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
26622 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026623 test_ret++;
Daniel Veillard3d95c732004-11-06 22:25:14 +000026624 printf(" %d", n_file);
26625 printf(" %d", n_encoder);
26626 printf("\n");
26627 }
26628 }
26629 }
26630#endif
26631
26632 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026633 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026634}
26635
26636
26637static int
26638test_xmlOutputBufferCreateFilename(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026639 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026640
Daniel Veillard3d95c732004-11-06 22:25:14 +000026641#ifdef LIBXML_OUTPUT_ENABLED
26642 int mem_base;
26643 xmlOutputBufferPtr ret_val;
26644 const char * URI; /* a C string containing the URI or filename */
26645 int n_URI;
26646 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
26647 int n_encoder;
26648 int compression; /* the compression ration (0 none, 9 max). */
26649 int n_compression;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026650
Daniel Veillard42595322004-11-08 10:52:06 +000026651 for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
Daniel Veillard3d95c732004-11-06 22:25:14 +000026652 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
26653 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
26654 mem_base = xmlMemBlocks();
Daniel Veillard42595322004-11-08 10:52:06 +000026655 URI = gen_fileoutput(n_URI, 0);
Daniel Veillard3d95c732004-11-06 22:25:14 +000026656 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
26657 compression = gen_int(n_compression, 2);
26658
26659 ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
26660 desret_xmlOutputBufferPtr(ret_val);
26661 call_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026662 des_fileoutput(n_URI, URI, 0);
Daniel Veillard3d95c732004-11-06 22:25:14 +000026663 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
26664 des_int(n_compression, compression, 2);
26665 xmlResetLastError();
26666 if (mem_base != xmlMemBlocks()) {
26667 printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
26668 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026669 test_ret++;
Daniel Veillard3d95c732004-11-06 22:25:14 +000026670 printf(" %d", n_URI);
26671 printf(" %d", n_encoder);
26672 printf(" %d", n_compression);
26673 printf("\n");
26674 }
26675 }
26676 }
26677 }
26678#endif
26679
26680 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026681 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026682}
26683
26684
26685static int
26686test_xmlOutputBufferFlush(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026687 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026688
Daniel Veillard3d97e662004-11-04 10:49:00 +000026689#ifdef LIBXML_OUTPUT_ENABLED
26690 int mem_base;
26691 int ret_val;
26692 xmlOutputBufferPtr out; /* a buffered output */
26693 int n_out;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026694
Daniel Veillard3d97e662004-11-04 10:49:00 +000026695 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
26696 mem_base = xmlMemBlocks();
26697 out = gen_xmlOutputBufferPtr(n_out, 0);
26698
26699 ret_val = xmlOutputBufferFlush(out);
26700 desret_int(ret_val);
26701 call_tests++;
26702 des_xmlOutputBufferPtr(n_out, out, 0);
26703 xmlResetLastError();
26704 if (mem_base != xmlMemBlocks()) {
26705 printf("Leak of %d blocks found in xmlOutputBufferFlush",
26706 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026707 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000026708 printf(" %d", n_out);
26709 printf("\n");
26710 }
26711 }
26712#endif
26713
26714 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026715 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026716}
26717
26718
26719static int
26720test_xmlOutputBufferWrite(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026721 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026722
Daniel Veillard3d97e662004-11-04 10:49:00 +000026723#ifdef LIBXML_OUTPUT_ENABLED
26724 int mem_base;
26725 int ret_val;
26726 xmlOutputBufferPtr out; /* a buffered parser output */
26727 int n_out;
26728 int len; /* the size in bytes of the array. */
26729 int n_len;
Daniel Veillardce682bc2004-11-05 17:22:25 +000026730 char * buf; /* an char array */
Daniel Veillard3d97e662004-11-04 10:49:00 +000026731 int n_buf;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026732
Daniel Veillard3d97e662004-11-04 10:49:00 +000026733 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
26734 for (n_len = 0;n_len < gen_nb_int;n_len++) {
26735 for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
26736 mem_base = xmlMemBlocks();
26737 out = gen_xmlOutputBufferPtr(n_out, 0);
26738 len = gen_int(n_len, 1);
26739 buf = gen_const_char_ptr(n_buf, 2);
26740
26741 ret_val = xmlOutputBufferWrite(out, len, buf);
26742 desret_int(ret_val);
26743 call_tests++;
26744 des_xmlOutputBufferPtr(n_out, out, 0);
26745 des_int(n_len, len, 1);
26746 des_const_char_ptr(n_buf, buf, 2);
26747 xmlResetLastError();
26748 if (mem_base != xmlMemBlocks()) {
26749 printf("Leak of %d blocks found in xmlOutputBufferWrite",
26750 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026751 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000026752 printf(" %d", n_out);
26753 printf(" %d", n_len);
26754 printf(" %d", n_buf);
26755 printf("\n");
26756 }
26757 }
26758 }
26759 }
26760#endif
26761
26762 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026763 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026764}
26765
26766
26767static int
26768test_xmlOutputBufferWriteEscape(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026769 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026770
26771
26772 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000026773 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026774}
26775
26776
26777static int
26778test_xmlOutputBufferWriteString(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026779 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026780
Daniel Veillard3d97e662004-11-04 10:49:00 +000026781#ifdef LIBXML_OUTPUT_ENABLED
26782 int mem_base;
26783 int ret_val;
26784 xmlOutputBufferPtr out; /* a buffered parser output */
26785 int n_out;
Daniel Veillardce682bc2004-11-05 17:22:25 +000026786 char * str; /* a zero terminated C string */
Daniel Veillard3d97e662004-11-04 10:49:00 +000026787 int n_str;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026788
Daniel Veillard3d97e662004-11-04 10:49:00 +000026789 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
26790 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
26791 mem_base = xmlMemBlocks();
26792 out = gen_xmlOutputBufferPtr(n_out, 0);
26793 str = gen_const_char_ptr(n_str, 1);
26794
26795 ret_val = xmlOutputBufferWriteString(out, str);
26796 desret_int(ret_val);
26797 call_tests++;
26798 des_xmlOutputBufferPtr(n_out, out, 0);
26799 des_const_char_ptr(n_str, str, 1);
26800 xmlResetLastError();
26801 if (mem_base != xmlMemBlocks()) {
26802 printf("Leak of %d blocks found in xmlOutputBufferWriteString",
26803 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026804 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000026805 printf(" %d", n_out);
26806 printf(" %d", n_str);
26807 printf("\n");
26808 }
26809 }
26810 }
26811#endif
26812
26813 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026814 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026815}
26816
26817
26818static int
26819test_xmlParserGetDirectory(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026820 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026821
26822
26823 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000026824 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026825}
26826
26827
26828static int
26829test_xmlParserInputBufferCreateFd(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026830 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026831
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000026832 int mem_base;
26833 xmlParserInputBufferPtr ret_val;
26834 int fd; /* a file descriptor number */
26835 int n_fd;
26836 xmlCharEncoding enc; /* the charset encoding if known */
26837 int n_enc;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026838
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000026839 for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
26840 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
26841 mem_base = xmlMemBlocks();
26842 fd = gen_int(n_fd, 0);
26843 enc = gen_xmlCharEncoding(n_enc, 1);
26844 if (fd >= 0) fd = -1;
26845
26846 ret_val = xmlParserInputBufferCreateFd(fd, enc);
26847 desret_xmlParserInputBufferPtr(ret_val);
26848 call_tests++;
26849 des_int(n_fd, fd, 0);
26850 des_xmlCharEncoding(n_enc, enc, 1);
26851 xmlResetLastError();
26852 if (mem_base != xmlMemBlocks()) {
26853 printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
26854 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026855 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000026856 printf(" %d", n_fd);
26857 printf(" %d", n_enc);
26858 printf("\n");
26859 }
26860 }
26861 }
26862
26863 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026864 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026865}
26866
26867
26868static int
26869test_xmlParserInputBufferCreateFile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026870 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026871
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000026872 int mem_base;
26873 xmlParserInputBufferPtr ret_val;
26874 FILE * file; /* a FILE* */
26875 int n_file;
26876 xmlCharEncoding enc; /* the charset encoding if known */
26877 int n_enc;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026878
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000026879 for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
26880 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
26881 mem_base = xmlMemBlocks();
26882 file = gen_FILE_ptr(n_file, 0);
26883 enc = gen_xmlCharEncoding(n_enc, 1);
26884
26885 ret_val = xmlParserInputBufferCreateFile(file, enc);
26886 desret_xmlParserInputBufferPtr(ret_val);
26887 call_tests++;
26888 des_FILE_ptr(n_file, file, 0);
26889 des_xmlCharEncoding(n_enc, enc, 1);
26890 xmlResetLastError();
26891 if (mem_base != xmlMemBlocks()) {
26892 printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
26893 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026894 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000026895 printf(" %d", n_file);
26896 printf(" %d", n_enc);
26897 printf("\n");
26898 }
26899 }
26900 }
26901
26902 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026903 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026904}
26905
26906
26907static int
26908test_xmlParserInputBufferCreateFilename(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026909 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026910
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000026911 int mem_base;
26912 xmlParserInputBufferPtr ret_val;
26913 const char * URI; /* a C string containing the URI or filename */
26914 int n_URI;
26915 xmlCharEncoding enc; /* the charset encoding if known */
26916 int n_enc;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026917
Daniel Veillard42595322004-11-08 10:52:06 +000026918 for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000026919 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
26920 mem_base = xmlMemBlocks();
Daniel Veillard42595322004-11-08 10:52:06 +000026921 URI = gen_fileoutput(n_URI, 0);
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000026922 enc = gen_xmlCharEncoding(n_enc, 1);
26923
26924 ret_val = xmlParserInputBufferCreateFilename(URI, enc);
26925 desret_xmlParserInputBufferPtr(ret_val);
26926 call_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026927 des_fileoutput(n_URI, URI, 0);
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000026928 des_xmlCharEncoding(n_enc, enc, 1);
26929 xmlResetLastError();
26930 if (mem_base != xmlMemBlocks()) {
26931 printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
26932 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026933 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000026934 printf(" %d", n_URI);
26935 printf(" %d", n_enc);
26936 printf("\n");
26937 }
26938 }
26939 }
26940
26941 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026942 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026943}
26944
26945
26946static int
26947test_xmlParserInputBufferCreateMem(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026948 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026949
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000026950 int mem_base;
26951 xmlParserInputBufferPtr ret_val;
26952 char * mem; /* the memory input */
26953 int n_mem;
26954 int size; /* the length of the memory block */
26955 int n_size;
26956 xmlCharEncoding enc; /* the charset encoding if known */
26957 int n_enc;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026958
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000026959 for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
26960 for (n_size = 0;n_size < gen_nb_int;n_size++) {
26961 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
26962 mem_base = xmlMemBlocks();
26963 mem = gen_const_char_ptr(n_mem, 0);
26964 size = gen_int(n_size, 1);
26965 enc = gen_xmlCharEncoding(n_enc, 2);
26966
26967 ret_val = xmlParserInputBufferCreateMem(mem, size, enc);
26968 desret_xmlParserInputBufferPtr(ret_val);
26969 call_tests++;
26970 des_const_char_ptr(n_mem, mem, 0);
26971 des_int(n_size, size, 1);
26972 des_xmlCharEncoding(n_enc, enc, 2);
26973 xmlResetLastError();
26974 if (mem_base != xmlMemBlocks()) {
26975 printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
26976 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000026977 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000026978 printf(" %d", n_mem);
26979 printf(" %d", n_size);
26980 printf(" %d", n_enc);
26981 printf("\n");
26982 }
26983 }
26984 }
26985 }
26986
26987 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000026988 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000026989}
26990
26991
26992static int
26993test_xmlParserInputBufferCreateStatic(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000026994 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000026995
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000026996 int mem_base;
26997 xmlParserInputBufferPtr ret_val;
26998 char * mem; /* the memory input */
26999 int n_mem;
27000 int size; /* the length of the memory block */
27001 int n_size;
27002 xmlCharEncoding enc; /* the charset encoding if known */
27003 int n_enc;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027004
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000027005 for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
27006 for (n_size = 0;n_size < gen_nb_int;n_size++) {
27007 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27008 mem_base = xmlMemBlocks();
27009 mem = gen_const_char_ptr(n_mem, 0);
27010 size = gen_int(n_size, 1);
27011 enc = gen_xmlCharEncoding(n_enc, 2);
27012
27013 ret_val = xmlParserInputBufferCreateStatic(mem, size, enc);
27014 desret_xmlParserInputBufferPtr(ret_val);
27015 call_tests++;
27016 des_const_char_ptr(n_mem, mem, 0);
27017 des_int(n_size, size, 1);
27018 des_xmlCharEncoding(n_enc, enc, 2);
27019 xmlResetLastError();
27020 if (mem_base != xmlMemBlocks()) {
27021 printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
27022 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000027023 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000027024 printf(" %d", n_mem);
27025 printf(" %d", n_size);
27026 printf(" %d", n_enc);
27027 printf("\n");
27028 }
27029 }
27030 }
27031 }
27032
27033 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000027034 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027035}
27036
27037
27038static int
27039test_xmlParserInputBufferGrow(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027040 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027041
Daniel Veillard34099b42004-11-04 17:34:35 +000027042 int mem_base;
27043 int ret_val;
27044 xmlParserInputBufferPtr in; /* a buffered parser input */
27045 int n_in;
27046 int len; /* indicative value of the amount of chars to read */
27047 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027048
Daniel Veillard34099b42004-11-04 17:34:35 +000027049 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
27050 for (n_len = 0;n_len < gen_nb_int;n_len++) {
27051 mem_base = xmlMemBlocks();
27052 in = gen_xmlParserInputBufferPtr(n_in, 0);
27053 len = gen_int(n_len, 1);
27054
27055 ret_val = xmlParserInputBufferGrow(in, len);
27056 desret_int(ret_val);
27057 call_tests++;
27058 des_xmlParserInputBufferPtr(n_in, in, 0);
27059 des_int(n_len, len, 1);
27060 xmlResetLastError();
27061 if (mem_base != xmlMemBlocks()) {
27062 printf("Leak of %d blocks found in xmlParserInputBufferGrow",
27063 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000027064 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000027065 printf(" %d", n_in);
27066 printf(" %d", n_len);
27067 printf("\n");
27068 }
27069 }
27070 }
27071
27072 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000027073 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027074}
27075
27076
27077static int
27078test_xmlParserInputBufferPush(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027079 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027080
Daniel Veillard34099b42004-11-04 17:34:35 +000027081 int mem_base;
27082 int ret_val;
27083 xmlParserInputBufferPtr in; /* a buffered parser input */
27084 int n_in;
27085 int len; /* the size in bytes of the array. */
27086 int n_len;
Daniel Veillardce682bc2004-11-05 17:22:25 +000027087 char * buf; /* an char array */
Daniel Veillard34099b42004-11-04 17:34:35 +000027088 int n_buf;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027089
Daniel Veillard34099b42004-11-04 17:34:35 +000027090 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
27091 for (n_len = 0;n_len < gen_nb_int;n_len++) {
27092 for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
27093 mem_base = xmlMemBlocks();
27094 in = gen_xmlParserInputBufferPtr(n_in, 0);
27095 len = gen_int(n_len, 1);
27096 buf = gen_const_char_ptr(n_buf, 2);
27097
27098 ret_val = xmlParserInputBufferPush(in, len, buf);
27099 desret_int(ret_val);
27100 call_tests++;
27101 des_xmlParserInputBufferPtr(n_in, in, 0);
27102 des_int(n_len, len, 1);
27103 des_const_char_ptr(n_buf, buf, 2);
27104 xmlResetLastError();
27105 if (mem_base != xmlMemBlocks()) {
27106 printf("Leak of %d blocks found in xmlParserInputBufferPush",
27107 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000027108 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000027109 printf(" %d", n_in);
27110 printf(" %d", n_len);
27111 printf(" %d", n_buf);
27112 printf("\n");
27113 }
27114 }
27115 }
27116 }
27117
27118 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000027119 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027120}
27121
27122
27123static int
27124test_xmlParserInputBufferRead(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027125 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027126
Daniel Veillard34099b42004-11-04 17:34:35 +000027127 int mem_base;
27128 int ret_val;
27129 xmlParserInputBufferPtr in; /* a buffered parser input */
27130 int n_in;
27131 int len; /* indicative value of the amount of chars to read */
27132 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027133
Daniel Veillard34099b42004-11-04 17:34:35 +000027134 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
27135 for (n_len = 0;n_len < gen_nb_int;n_len++) {
27136 mem_base = xmlMemBlocks();
27137 in = gen_xmlParserInputBufferPtr(n_in, 0);
27138 len = gen_int(n_len, 1);
27139
27140 ret_val = xmlParserInputBufferRead(in, len);
27141 desret_int(ret_val);
27142 call_tests++;
27143 des_xmlParserInputBufferPtr(n_in, in, 0);
27144 des_int(n_len, len, 1);
27145 xmlResetLastError();
27146 if (mem_base != xmlMemBlocks()) {
27147 printf("Leak of %d blocks found in xmlParserInputBufferRead",
27148 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000027149 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000027150 printf(" %d", n_in);
27151 printf(" %d", n_len);
27152 printf("\n");
27153 }
27154 }
27155 }
27156
27157 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000027158 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027159}
27160
27161
27162static int
27163test_xmlPopInputCallbacks(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027164 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027165
27166 int mem_base;
27167 int ret_val;
27168
27169 mem_base = xmlMemBlocks();
27170
27171 ret_val = xmlPopInputCallbacks();
27172 desret_int(ret_val);
27173 call_tests++;
27174 xmlResetLastError();
27175 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000027176 printf("Leak of %d blocks found in xmlPopInputCallbacks",
Daniel Veillardd93f6252004-11-02 15:53:51 +000027177 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000027178 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000027179 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000027180 }
27181
Daniel Veillard3d97e662004-11-04 10:49:00 +000027182 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000027183 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027184}
27185
27186
27187static int
27188test_xmlRegisterDefaultInputCallbacks(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027189 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027190
27191 int mem_base;
27192
27193 mem_base = xmlMemBlocks();
27194
27195 xmlRegisterDefaultInputCallbacks();
27196 call_tests++;
27197 xmlResetLastError();
27198 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000027199 printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
Daniel Veillardd93f6252004-11-02 15:53:51 +000027200 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000027201 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000027202 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000027203 }
27204
Daniel Veillard3d97e662004-11-04 10:49:00 +000027205 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000027206 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027207}
27208
27209
27210static int
27211test_xmlRegisterDefaultOutputCallbacks(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027212 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027213
27214#ifdef LIBXML_OUTPUT_ENABLED
27215 int mem_base;
27216
27217 mem_base = xmlMemBlocks();
27218
27219 xmlRegisterDefaultOutputCallbacks();
27220 call_tests++;
27221 xmlResetLastError();
27222 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000027223 printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
Daniel Veillardd93f6252004-11-02 15:53:51 +000027224 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000027225 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000027226 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000027227 }
27228#endif
27229
Daniel Veillard3d97e662004-11-04 10:49:00 +000027230 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000027231 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027232}
27233
27234
27235static int
27236test_xmlRegisterHTTPPostCallbacks(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027237 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027238
27239#ifdef LIBXML_HTTP_ENABLED
27240 int mem_base;
27241
27242 mem_base = xmlMemBlocks();
27243
27244 xmlRegisterHTTPPostCallbacks();
27245 call_tests++;
27246 xmlResetLastError();
27247 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000027248 printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
Daniel Veillardd93f6252004-11-02 15:53:51 +000027249 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000027250 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000027251 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000027252 }
27253#endif
27254
Daniel Veillard3d97e662004-11-04 10:49:00 +000027255 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000027256 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027257}
27258
27259static int
27260test_xmlIO(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027261 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027262
Daniel Veillard42595322004-11-08 10:52:06 +000027263 printf("Testing xmlIO : 38 of 47 functions ...\n");
27264 test_ret += test_xmlAllocOutputBuffer();
27265 test_ret += test_xmlAllocParserInputBuffer();
27266 test_ret += test_xmlCheckFilename();
27267 test_ret += test_xmlCheckHTTPInput();
27268 test_ret += test_xmlCleanupInputCallbacks();
27269 test_ret += test_xmlCleanupOutputCallbacks();
27270 test_ret += test_xmlFileClose();
27271 test_ret += test_xmlFileMatch();
27272 test_ret += test_xmlFileOpen();
27273 test_ret += test_xmlFileRead();
27274 test_ret += test_xmlIOFTPClose();
27275 test_ret += test_xmlIOFTPMatch();
27276 test_ret += test_xmlIOFTPOpen();
27277 test_ret += test_xmlIOFTPRead();
27278 test_ret += test_xmlIOHTTPClose();
27279 test_ret += test_xmlIOHTTPMatch();
27280 test_ret += test_xmlIOHTTPOpen();
27281 test_ret += test_xmlIOHTTPOpenW();
27282 test_ret += test_xmlIOHTTPRead();
27283 test_ret += test_xmlNoNetExternalEntityLoader();
27284 test_ret += test_xmlNormalizeWindowsPath();
27285 test_ret += test_xmlOutputBufferCreateFd();
27286 test_ret += test_xmlOutputBufferCreateFile();
27287 test_ret += test_xmlOutputBufferCreateFilename();
27288 test_ret += test_xmlOutputBufferFlush();
27289 test_ret += test_xmlOutputBufferWrite();
27290 test_ret += test_xmlOutputBufferWriteEscape();
27291 test_ret += test_xmlOutputBufferWriteString();
27292 test_ret += test_xmlParserGetDirectory();
27293 test_ret += test_xmlParserInputBufferCreateFd();
27294 test_ret += test_xmlParserInputBufferCreateFile();
27295 test_ret += test_xmlParserInputBufferCreateFilename();
27296 test_ret += test_xmlParserInputBufferCreateMem();
27297 test_ret += test_xmlParserInputBufferCreateStatic();
27298 test_ret += test_xmlParserInputBufferGrow();
27299 test_ret += test_xmlParserInputBufferPush();
27300 test_ret += test_xmlParserInputBufferRead();
27301 test_ret += test_xmlPopInputCallbacks();
27302 test_ret += test_xmlRegisterDefaultInputCallbacks();
27303 test_ret += test_xmlRegisterDefaultOutputCallbacks();
27304 test_ret += test_xmlRegisterHTTPPostCallbacks();
Daniel Veillardd93f6252004-11-02 15:53:51 +000027305
Daniel Veillard42595322004-11-08 10:52:06 +000027306 if (test_ret != 0)
27307 printf("Module xmlIO: %d errors\n", test_ret);
27308 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027309}
27310
Daniel Veillarda82b1822004-11-08 16:24:57 +000027311#define gen_nb_xmlAutomataPtr 1
27312static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27313 return(NULL);
27314}
27315static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27316}
27317
27318static int
27319test_xmlAutomataCompile(void) {
27320 int test_ret = 0;
27321
27322
27323 /* missing type support */
27324 return(test_ret);
27325}
27326
27327
27328static int
27329test_xmlAutomataGetInitState(void) {
27330 int test_ret = 0;
27331
27332
27333 /* missing type support */
27334 return(test_ret);
27335}
27336
27337
27338static int
27339test_xmlAutomataIsDeterminist(void) {
27340 int test_ret = 0;
27341
27342#ifdef LIBXML_AUTOMATA_ENABLED
27343 int mem_base;
27344 int ret_val;
27345 xmlAutomataPtr am; /* an automata */
27346 int n_am;
27347
27348 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
27349 mem_base = xmlMemBlocks();
27350 am = gen_xmlAutomataPtr(n_am, 0);
27351
27352 ret_val = xmlAutomataIsDeterminist(am);
27353 desret_int(ret_val);
27354 call_tests++;
27355 des_xmlAutomataPtr(n_am, am, 0);
27356 xmlResetLastError();
27357 if (mem_base != xmlMemBlocks()) {
27358 printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
27359 xmlMemBlocks() - mem_base);
27360 test_ret++;
27361 printf(" %d", n_am);
27362 printf("\n");
27363 }
27364 }
27365#endif
27366
27367 function_tests++;
27368 return(test_ret);
27369}
27370
27371
27372#define gen_nb_xmlAutomataStatePtr 1
27373static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27374 return(NULL);
27375}
27376static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27377}
27378
27379static int
27380test_xmlAutomataNewAllTrans(void) {
27381 int test_ret = 0;
27382
27383
27384 /* missing type support */
27385 return(test_ret);
27386}
27387
27388
27389static int
27390test_xmlAutomataNewCountTrans(void) {
27391 int test_ret = 0;
27392
27393
27394 /* missing type support */
27395 return(test_ret);
27396}
27397
27398
27399static int
27400test_xmlAutomataNewCountTrans2(void) {
27401 int test_ret = 0;
27402
27403
27404 /* missing type support */
27405 return(test_ret);
27406}
27407
27408
27409static int
27410test_xmlAutomataNewCountedTrans(void) {
27411 int test_ret = 0;
27412
27413
27414 /* missing type support */
27415 return(test_ret);
27416}
27417
27418
27419static int
27420test_xmlAutomataNewCounter(void) {
27421 int test_ret = 0;
27422
27423#ifdef LIBXML_AUTOMATA_ENABLED
27424 int mem_base;
27425 int ret_val;
27426 xmlAutomataPtr am; /* an automata */
27427 int n_am;
27428 int min; /* the minimal value on the counter */
27429 int n_min;
27430 int max; /* the maximal value on the counter */
27431 int n_max;
27432
27433 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
27434 for (n_min = 0;n_min < gen_nb_int;n_min++) {
27435 for (n_max = 0;n_max < gen_nb_int;n_max++) {
27436 mem_base = xmlMemBlocks();
27437 am = gen_xmlAutomataPtr(n_am, 0);
27438 min = gen_int(n_min, 1);
27439 max = gen_int(n_max, 2);
27440
27441 ret_val = xmlAutomataNewCounter(am, min, max);
27442 desret_int(ret_val);
27443 call_tests++;
27444 des_xmlAutomataPtr(n_am, am, 0);
27445 des_int(n_min, min, 1);
27446 des_int(n_max, max, 2);
27447 xmlResetLastError();
27448 if (mem_base != xmlMemBlocks()) {
27449 printf("Leak of %d blocks found in xmlAutomataNewCounter",
27450 xmlMemBlocks() - mem_base);
27451 test_ret++;
27452 printf(" %d", n_am);
27453 printf(" %d", n_min);
27454 printf(" %d", n_max);
27455 printf("\n");
27456 }
27457 }
27458 }
27459 }
27460#endif
27461
27462 function_tests++;
27463 return(test_ret);
27464}
27465
27466
27467static int
27468test_xmlAutomataNewCounterTrans(void) {
27469 int test_ret = 0;
27470
27471
27472 /* missing type support */
27473 return(test_ret);
27474}
27475
27476
27477static int
27478test_xmlAutomataNewEpsilon(void) {
27479 int test_ret = 0;
27480
27481
27482 /* missing type support */
27483 return(test_ret);
27484}
27485
27486
27487static int
27488test_xmlAutomataNewOnceTrans(void) {
27489 int test_ret = 0;
27490
27491
27492 /* missing type support */
27493 return(test_ret);
27494}
27495
27496
27497static int
27498test_xmlAutomataNewOnceTrans2(void) {
27499 int test_ret = 0;
27500
27501
27502 /* missing type support */
27503 return(test_ret);
27504}
27505
27506
27507static int
27508test_xmlAutomataNewState(void) {
27509 int test_ret = 0;
27510
27511
27512 /* missing type support */
27513 return(test_ret);
27514}
27515
27516
27517static int
27518test_xmlAutomataNewTransition(void) {
27519 int test_ret = 0;
27520
27521
27522 /* missing type support */
27523 return(test_ret);
27524}
27525
27526
27527static int
27528test_xmlAutomataNewTransition2(void) {
27529 int test_ret = 0;
27530
27531
27532 /* missing type support */
27533 return(test_ret);
27534}
27535
27536
27537static int
27538test_xmlAutomataSetFinalState(void) {
27539 int test_ret = 0;
27540
27541#ifdef LIBXML_AUTOMATA_ENABLED
27542 int mem_base;
27543 int ret_val;
27544 xmlAutomataPtr am; /* an automata */
27545 int n_am;
27546 xmlAutomataStatePtr state; /* a state in this automata */
27547 int n_state;
27548
27549 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
27550 for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
27551 mem_base = xmlMemBlocks();
27552 am = gen_xmlAutomataPtr(n_am, 0);
27553 state = gen_xmlAutomataStatePtr(n_state, 1);
27554
27555 ret_val = xmlAutomataSetFinalState(am, state);
27556 desret_int(ret_val);
27557 call_tests++;
27558 des_xmlAutomataPtr(n_am, am, 0);
27559 des_xmlAutomataStatePtr(n_state, state, 1);
27560 xmlResetLastError();
27561 if (mem_base != xmlMemBlocks()) {
27562 printf("Leak of %d blocks found in xmlAutomataSetFinalState",
27563 xmlMemBlocks() - mem_base);
27564 test_ret++;
27565 printf(" %d", n_am);
27566 printf(" %d", n_state);
27567 printf("\n");
27568 }
27569 }
27570 }
27571#endif
27572
27573 function_tests++;
27574 return(test_ret);
27575}
27576
27577
27578static int
27579test_xmlNewAutomata(void) {
27580 int test_ret = 0;
27581
27582
27583 /* missing type support */
27584 return(test_ret);
27585}
27586
27587static int
27588test_xmlautomata(void) {
27589 int test_ret = 0;
27590
27591 printf("Testing xmlautomata : 3 of 18 functions ...\n");
27592 test_ret += test_xmlAutomataCompile();
27593 test_ret += test_xmlAutomataGetInitState();
27594 test_ret += test_xmlAutomataIsDeterminist();
27595 test_ret += test_xmlAutomataNewAllTrans();
27596 test_ret += test_xmlAutomataNewCountTrans();
27597 test_ret += test_xmlAutomataNewCountTrans2();
27598 test_ret += test_xmlAutomataNewCountedTrans();
27599 test_ret += test_xmlAutomataNewCounter();
27600 test_ret += test_xmlAutomataNewCounterTrans();
27601 test_ret += test_xmlAutomataNewEpsilon();
27602 test_ret += test_xmlAutomataNewOnceTrans();
27603 test_ret += test_xmlAutomataNewOnceTrans2();
27604 test_ret += test_xmlAutomataNewState();
27605 test_ret += test_xmlAutomataNewTransition();
27606 test_ret += test_xmlAutomataNewTransition2();
27607 test_ret += test_xmlAutomataSetFinalState();
27608 test_ret += test_xmlNewAutomata();
27609
27610 if (test_ret != 0)
27611 printf("Module xmlautomata: %d errors\n", test_ret);
27612 return(test_ret);
27613}
27614
Daniel Veillardce682bc2004-11-05 17:22:25 +000027615#define gen_nb_xmlGenericErrorFunc_ptr 1
27616static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27617 return(NULL);
27618}
27619static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27620}
27621
Daniel Veillardd93f6252004-11-02 15:53:51 +000027622static int
Daniel Veillardd93f6252004-11-02 15:53:51 +000027623test_initGenericErrorDefaultFunc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027624 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027625
Daniel Veillardce682bc2004-11-05 17:22:25 +000027626 int mem_base;
27627 xmlGenericErrorFunc * handler; /* the handler */
27628 int n_handler;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027629
Daniel Veillardce682bc2004-11-05 17:22:25 +000027630 for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
27631 mem_base = xmlMemBlocks();
27632 handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
27633
27634 initGenericErrorDefaultFunc(handler);
27635 call_tests++;
27636 des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
27637 xmlResetLastError();
27638 if (mem_base != xmlMemBlocks()) {
27639 printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
27640 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000027641 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000027642 printf(" %d", n_handler);
27643 printf("\n");
27644 }
27645 }
27646
27647 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000027648 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027649}
27650
27651
Daniel Veillardce682bc2004-11-05 17:22:25 +000027652#define gen_nb_xmlErrorPtr 1
27653static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27654 return(NULL);
27655}
27656static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27657}
27658
Daniel Veillardd93f6252004-11-02 15:53:51 +000027659static int
27660test_xmlCopyError(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027661 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027662
Daniel Veillardce682bc2004-11-05 17:22:25 +000027663 int mem_base;
27664 int ret_val;
27665 xmlErrorPtr from; /* a source error */
27666 int n_from;
27667 xmlErrorPtr to; /* a target error */
27668 int n_to;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027669
Daniel Veillardce682bc2004-11-05 17:22:25 +000027670 for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
27671 for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
27672 mem_base = xmlMemBlocks();
27673 from = gen_xmlErrorPtr(n_from, 0);
27674 to = gen_xmlErrorPtr(n_to, 1);
27675
27676 ret_val = xmlCopyError(from, to);
27677 desret_int(ret_val);
27678 call_tests++;
27679 des_xmlErrorPtr(n_from, from, 0);
27680 des_xmlErrorPtr(n_to, to, 1);
27681 xmlResetLastError();
27682 if (mem_base != xmlMemBlocks()) {
27683 printf("Leak of %d blocks found in xmlCopyError",
27684 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000027685 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000027686 printf(" %d", n_from);
27687 printf(" %d", n_to);
27688 printf("\n");
27689 }
27690 }
27691 }
27692
27693 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000027694 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027695}
27696
27697
27698static int
27699test_xmlCtxtGetLastError(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027700 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027701
27702
27703 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000027704 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027705}
27706
27707
27708static int
27709test_xmlCtxtResetLastError(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027710 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027711
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000027712 int mem_base;
27713 void * ctx; /* an XML parser context */
27714 int n_ctx;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027715
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000027716 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
27717 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000027718 ctx = gen_void_ptr(n_ctx, 0);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000027719
27720 xmlCtxtResetLastError(ctx);
27721 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000027722 des_void_ptr(n_ctx, ctx, 0);
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000027723 xmlResetLastError();
27724 if (mem_base != xmlMemBlocks()) {
27725 printf("Leak of %d blocks found in xmlCtxtResetLastError",
27726 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000027727 test_ret++;
Daniel Veillardb1b3a3e2004-11-03 23:25:47 +000027728 printf(" %d", n_ctx);
27729 printf("\n");
27730 }
27731 }
27732
Daniel Veillard3d97e662004-11-04 10:49:00 +000027733 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000027734 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027735}
27736
27737
27738static int
27739test_xmlGetLastError(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027740 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027741
27742
27743 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000027744 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027745}
27746
27747
27748static int
27749test_xmlParserError(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027750 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027751
27752
27753 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000027754 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027755}
27756
27757
27758static int
27759test_xmlParserPrintFileContext(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027760 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027761
Daniel Veillardce682bc2004-11-05 17:22:25 +000027762 int mem_base;
27763 xmlParserInputPtr input; /* an xmlParserInputPtr input */
27764 int n_input;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027765
Daniel Veillardce682bc2004-11-05 17:22:25 +000027766 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
27767 mem_base = xmlMemBlocks();
27768 input = gen_xmlParserInputPtr(n_input, 0);
27769
27770 xmlParserPrintFileContext(input);
27771 call_tests++;
27772 des_xmlParserInputPtr(n_input, input, 0);
27773 xmlResetLastError();
27774 if (mem_base != xmlMemBlocks()) {
27775 printf("Leak of %d blocks found in xmlParserPrintFileContext",
27776 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000027777 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000027778 printf(" %d", n_input);
27779 printf("\n");
27780 }
27781 }
27782
27783 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000027784 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027785}
27786
27787
27788static int
27789test_xmlParserPrintFileInfo(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027790 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027791
Daniel Veillardce682bc2004-11-05 17:22:25 +000027792 int mem_base;
27793 xmlParserInputPtr input; /* an xmlParserInputPtr input */
27794 int n_input;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027795
Daniel Veillardce682bc2004-11-05 17:22:25 +000027796 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
27797 mem_base = xmlMemBlocks();
27798 input = gen_xmlParserInputPtr(n_input, 0);
27799
27800 xmlParserPrintFileInfo(input);
27801 call_tests++;
27802 des_xmlParserInputPtr(n_input, input, 0);
27803 xmlResetLastError();
27804 if (mem_base != xmlMemBlocks()) {
27805 printf("Leak of %d blocks found in xmlParserPrintFileInfo",
27806 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000027807 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000027808 printf(" %d", n_input);
27809 printf("\n");
27810 }
27811 }
27812
27813 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000027814 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027815}
27816
27817
27818static int
27819test_xmlParserValidityError(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027820 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027821
27822
27823 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000027824 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027825}
27826
27827
27828static int
27829test_xmlParserValidityWarning(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027830 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027831
27832
27833 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000027834 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027835}
27836
27837
27838static int
27839test_xmlParserWarning(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027840 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027841
27842
27843 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000027844 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027845}
27846
27847
27848static int
27849test_xmlResetError(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027850 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027851
Daniel Veillardce682bc2004-11-05 17:22:25 +000027852 int mem_base;
27853 xmlErrorPtr err; /* pointer to the error. */
27854 int n_err;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027855
Daniel Veillardce682bc2004-11-05 17:22:25 +000027856 for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
27857 mem_base = xmlMemBlocks();
27858 err = gen_xmlErrorPtr(n_err, 0);
27859
27860 xmlResetError(err);
27861 call_tests++;
27862 des_xmlErrorPtr(n_err, err, 0);
27863 xmlResetLastError();
27864 if (mem_base != xmlMemBlocks()) {
27865 printf("Leak of %d blocks found in xmlResetError",
27866 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000027867 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000027868 printf(" %d", n_err);
27869 printf("\n");
27870 }
27871 }
27872
27873 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000027874 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027875}
27876
27877
27878static int
27879test_xmlResetLastError(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027880 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027881
27882
27883
27884 xmlResetLastError();
27885 call_tests++;
27886 xmlResetLastError();
27887
Daniel Veillard3d97e662004-11-04 10:49:00 +000027888 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000027889 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027890}
27891
27892
27893static int
27894test_xmlSetGenericErrorFunc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027895 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027896
27897
27898 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000027899 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027900}
27901
27902
27903static int
27904test_xmlSetStructuredErrorFunc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027905 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027906
27907
27908 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000027909 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027910}
27911
27912static int
27913test_xmlerror(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027914 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027915
Daniel Veillardce682bc2004-11-05 17:22:25 +000027916 printf("Testing xmlerror : 7 of 15 functions ...\n");
Daniel Veillard42595322004-11-08 10:52:06 +000027917 test_ret += test_initGenericErrorDefaultFunc();
27918 test_ret += test_xmlCopyError();
27919 test_ret += test_xmlCtxtGetLastError();
27920 test_ret += test_xmlCtxtResetLastError();
27921 test_ret += test_xmlGetLastError();
27922 test_ret += test_xmlParserError();
27923 test_ret += test_xmlParserPrintFileContext();
27924 test_ret += test_xmlParserPrintFileInfo();
27925 test_ret += test_xmlParserValidityError();
27926 test_ret += test_xmlParserValidityWarning();
27927 test_ret += test_xmlParserWarning();
27928 test_ret += test_xmlResetError();
27929 test_ret += test_xmlResetLastError();
27930 test_ret += test_xmlSetGenericErrorFunc();
27931 test_ret += test_xmlSetStructuredErrorFunc();
Daniel Veillardd93f6252004-11-02 15:53:51 +000027932
Daniel Veillard42595322004-11-08 10:52:06 +000027933 if (test_ret != 0)
27934 printf("Module xmlerror: %d errors\n", test_ret);
27935 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027936}
Daniel Veillardd93f6252004-11-02 15:53:51 +000027937
27938static int
27939test_xmlNewTextReader(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027940 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027941
Daniel Veillard34099b42004-11-04 17:34:35 +000027942#ifdef LIBXML_READER_ENABLED
27943 int mem_base;
27944 xmlTextReaderPtr ret_val;
27945 xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
27946 int n_input;
27947 const char * URI; /* the URI information for the source if available */
27948 int n_URI;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027949
Daniel Veillard34099b42004-11-04 17:34:35 +000027950 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
27951 for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
27952 mem_base = xmlMemBlocks();
27953 input = gen_xmlParserInputBufferPtr(n_input, 0);
27954 URI = gen_filepath(n_URI, 1);
27955
27956 ret_val = xmlNewTextReader(input, URI);
27957 desret_xmlTextReaderPtr(ret_val);
27958 call_tests++;
27959 des_xmlParserInputBufferPtr(n_input, input, 0);
27960 des_filepath(n_URI, URI, 1);
27961 xmlResetLastError();
27962 if (mem_base != xmlMemBlocks()) {
27963 printf("Leak of %d blocks found in xmlNewTextReader",
27964 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000027965 test_ret++;
Daniel Veillard34099b42004-11-04 17:34:35 +000027966 printf(" %d", n_input);
27967 printf(" %d", n_URI);
27968 printf("\n");
27969 }
27970 }
27971 }
27972#endif
27973
27974 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000027975 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000027976}
27977
27978
27979static int
27980test_xmlNewTextReaderFilename(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000027981 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027982
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000027983#ifdef LIBXML_READER_ENABLED
27984 int mem_base;
27985 xmlTextReaderPtr ret_val;
27986 const char * URI; /* the URI of the resource to process */
27987 int n_URI;
Daniel Veillardd93f6252004-11-02 15:53:51 +000027988
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000027989 for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
27990 mem_base = xmlMemBlocks();
27991 URI = gen_filepath(n_URI, 0);
27992
27993 ret_val = xmlNewTextReaderFilename(URI);
27994 desret_xmlTextReaderPtr(ret_val);
27995 call_tests++;
27996 des_filepath(n_URI, URI, 0);
27997 xmlResetLastError();
27998 if (mem_base != xmlMemBlocks()) {
27999 printf("Leak of %d blocks found in xmlNewTextReaderFilename",
28000 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028001 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028002 printf(" %d", n_URI);
28003 printf("\n");
28004 }
28005 }
28006#endif
28007
28008 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028009 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028010}
28011
28012
28013static int
28014test_xmlReaderForDoc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028015 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028016
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028017#ifdef LIBXML_READER_ENABLED
28018 int mem_base;
28019 xmlTextReaderPtr ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000028020 xmlChar * cur; /* a pointer to a zero terminated string */
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028021 int n_cur;
28022 const char * URL; /* the base URL to use for the document */
28023 int n_URL;
Daniel Veillardce682bc2004-11-05 17:22:25 +000028024 char * encoding; /* the document encoding, or NULL */
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028025 int n_encoding;
28026 int options; /* a combination of xmlParserOption */
28027 int n_options;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028028
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028029 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
28030 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28031 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
Daniel Veillard6128c012004-11-08 17:16:15 +000028032 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028033 mem_base = xmlMemBlocks();
28034 cur = gen_const_xmlChar_ptr(n_cur, 0);
28035 URL = gen_filepath(n_URL, 1);
28036 encoding = gen_const_char_ptr(n_encoding, 2);
Daniel Veillard6128c012004-11-08 17:16:15 +000028037 options = gen_parseroptions(n_options, 3);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028038
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028039 ret_val = xmlReaderForDoc(cur, URL, encoding, options);
28040 desret_xmlTextReaderPtr(ret_val);
28041 call_tests++;
28042 des_const_xmlChar_ptr(n_cur, cur, 0);
28043 des_filepath(n_URL, URL, 1);
28044 des_const_char_ptr(n_encoding, encoding, 2);
Daniel Veillard6128c012004-11-08 17:16:15 +000028045 des_parseroptions(n_options, options, 3);
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028046 xmlResetLastError();
28047 if (mem_base != xmlMemBlocks()) {
28048 printf("Leak of %d blocks found in xmlReaderForDoc",
28049 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028050 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028051 printf(" %d", n_cur);
28052 printf(" %d", n_URL);
28053 printf(" %d", n_encoding);
28054 printf(" %d", n_options);
28055 printf("\n");
28056 }
28057 }
28058 }
28059 }
28060 }
28061#endif
Daniel Veillardd93f6252004-11-02 15:53:51 +000028062
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028063 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028064 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028065}
28066
28067
28068static int
28069test_xmlReaderForFile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028070 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028071
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028072#ifdef LIBXML_READER_ENABLED
28073 int mem_base;
28074 xmlTextReaderPtr ret_val;
28075 const char * filename; /* a file or URL */
28076 int n_filename;
Daniel Veillardce682bc2004-11-05 17:22:25 +000028077 char * encoding; /* the document encoding, or NULL */
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028078 int n_encoding;
28079 int options; /* a combination of xmlParserOption */
28080 int n_options;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028081
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028082 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28083 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
Daniel Veillard6128c012004-11-08 17:16:15 +000028084 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028085 mem_base = xmlMemBlocks();
28086 filename = gen_filepath(n_filename, 0);
28087 encoding = gen_const_char_ptr(n_encoding, 1);
Daniel Veillard6128c012004-11-08 17:16:15 +000028088 options = gen_parseroptions(n_options, 2);
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028089
28090 ret_val = xmlReaderForFile(filename, encoding, options);
28091 desret_xmlTextReaderPtr(ret_val);
28092 call_tests++;
28093 des_filepath(n_filename, filename, 0);
28094 des_const_char_ptr(n_encoding, encoding, 1);
Daniel Veillard6128c012004-11-08 17:16:15 +000028095 des_parseroptions(n_options, options, 2);
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028096 xmlResetLastError();
28097 if (mem_base != xmlMemBlocks()) {
28098 printf("Leak of %d blocks found in xmlReaderForFile",
28099 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028100 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028101 printf(" %d", n_filename);
28102 printf(" %d", n_encoding);
28103 printf(" %d", n_options);
28104 printf("\n");
28105 }
28106 }
28107 }
28108 }
28109#endif
28110
28111 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028112 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028113}
28114
28115
28116static int
28117test_xmlReaderForMemory(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028118 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028119
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028120#ifdef LIBXML_READER_ENABLED
28121 int mem_base;
28122 xmlTextReaderPtr ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000028123 char * buffer; /* a pointer to a char array */
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028124 int n_buffer;
28125 int size; /* the size of the array */
28126 int n_size;
28127 const char * URL; /* the base URL to use for the document */
28128 int n_URL;
Daniel Veillardce682bc2004-11-05 17:22:25 +000028129 char * encoding; /* the document encoding, or NULL */
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028130 int n_encoding;
28131 int options; /* a combination of xmlParserOption */
28132 int n_options;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028133
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028134 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
28135 for (n_size = 0;n_size < gen_nb_int;n_size++) {
28136 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28137 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
Daniel Veillard6128c012004-11-08 17:16:15 +000028138 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028139 mem_base = xmlMemBlocks();
28140 buffer = gen_const_char_ptr(n_buffer, 0);
28141 size = gen_int(n_size, 1);
28142 URL = gen_filepath(n_URL, 2);
28143 encoding = gen_const_char_ptr(n_encoding, 3);
Daniel Veillard6128c012004-11-08 17:16:15 +000028144 options = gen_parseroptions(n_options, 4);
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028145
28146 ret_val = xmlReaderForMemory(buffer, size, URL, encoding, options);
28147 desret_xmlTextReaderPtr(ret_val);
28148 call_tests++;
28149 des_const_char_ptr(n_buffer, buffer, 0);
28150 des_int(n_size, size, 1);
28151 des_filepath(n_URL, URL, 2);
28152 des_const_char_ptr(n_encoding, encoding, 3);
Daniel Veillard6128c012004-11-08 17:16:15 +000028153 des_parseroptions(n_options, options, 4);
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028154 xmlResetLastError();
28155 if (mem_base != xmlMemBlocks()) {
28156 printf("Leak of %d blocks found in xmlReaderForMemory",
28157 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028158 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028159 printf(" %d", n_buffer);
28160 printf(" %d", n_size);
28161 printf(" %d", n_URL);
28162 printf(" %d", n_encoding);
28163 printf(" %d", n_options);
28164 printf("\n");
28165 }
28166 }
28167 }
28168 }
28169 }
28170 }
28171#endif
28172
28173 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028174 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028175}
28176
28177
28178static int
28179test_xmlReaderNewDoc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028180 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028181
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028182#ifdef LIBXML_READER_ENABLED
28183 int mem_base;
28184 int ret_val;
28185 xmlTextReaderPtr reader; /* an XML reader */
28186 int n_reader;
Daniel Veillardce682bc2004-11-05 17:22:25 +000028187 xmlChar * cur; /* a pointer to a zero terminated string */
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028188 int n_cur;
28189 const char * URL; /* the base URL to use for the document */
28190 int n_URL;
Daniel Veillardce682bc2004-11-05 17:22:25 +000028191 char * encoding; /* the document encoding, or NULL */
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028192 int n_encoding;
28193 int options; /* a combination of xmlParserOption */
28194 int n_options;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028195
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028196 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28197 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
28198 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28199 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
Daniel Veillard6128c012004-11-08 17:16:15 +000028200 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028201 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000028202 reader = gen_xmlTextReaderPtr(n_reader, 0);
28203 cur = gen_const_xmlChar_ptr(n_cur, 1);
28204 URL = gen_filepath(n_URL, 2);
28205 encoding = gen_const_char_ptr(n_encoding, 3);
Daniel Veillard6128c012004-11-08 17:16:15 +000028206 options = gen_parseroptions(n_options, 4);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028207
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028208 ret_val = xmlReaderNewDoc(reader, cur, URL, encoding, options);
28209 desret_int(ret_val);
28210 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000028211 des_xmlTextReaderPtr(n_reader, reader, 0);
28212 des_const_xmlChar_ptr(n_cur, cur, 1);
28213 des_filepath(n_URL, URL, 2);
28214 des_const_char_ptr(n_encoding, encoding, 3);
Daniel Veillard6128c012004-11-08 17:16:15 +000028215 des_parseroptions(n_options, options, 4);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028216 xmlResetLastError();
28217 if (mem_base != xmlMemBlocks()) {
28218 printf("Leak of %d blocks found in xmlReaderNewDoc",
28219 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028220 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028221 printf(" %d", n_reader);
28222 printf(" %d", n_cur);
28223 printf(" %d", n_URL);
28224 printf(" %d", n_encoding);
28225 printf(" %d", n_options);
28226 printf("\n");
28227 }
28228 }
28229 }
28230 }
28231 }
28232 }
28233#endif
Daniel Veillardd93f6252004-11-02 15:53:51 +000028234
Daniel Veillard3d97e662004-11-04 10:49:00 +000028235 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028236 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028237}
28238
28239
28240static int
28241test_xmlReaderNewFile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028242 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028243
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028244#ifdef LIBXML_READER_ENABLED
28245 int mem_base;
28246 int ret_val;
28247 xmlTextReaderPtr reader; /* an XML reader */
28248 int n_reader;
28249 const char * filename; /* a file or URL */
28250 int n_filename;
Daniel Veillardce682bc2004-11-05 17:22:25 +000028251 char * encoding; /* the document encoding, or NULL */
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028252 int n_encoding;
28253 int options; /* a combination of xmlParserOption */
28254 int n_options;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028255
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028256 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28257 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28258 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
Daniel Veillard6128c012004-11-08 17:16:15 +000028259 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028260 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000028261 reader = gen_xmlTextReaderPtr(n_reader, 0);
28262 filename = gen_filepath(n_filename, 1);
28263 encoding = gen_const_char_ptr(n_encoding, 2);
Daniel Veillard6128c012004-11-08 17:16:15 +000028264 options = gen_parseroptions(n_options, 3);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028265
28266 ret_val = xmlReaderNewFile(reader, filename, encoding, options);
28267 desret_int(ret_val);
28268 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000028269 des_xmlTextReaderPtr(n_reader, reader, 0);
28270 des_filepath(n_filename, filename, 1);
28271 des_const_char_ptr(n_encoding, encoding, 2);
Daniel Veillard6128c012004-11-08 17:16:15 +000028272 des_parseroptions(n_options, options, 3);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028273 xmlResetLastError();
28274 if (mem_base != xmlMemBlocks()) {
28275 printf("Leak of %d blocks found in xmlReaderNewFile",
28276 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028277 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028278 printf(" %d", n_reader);
28279 printf(" %d", n_filename);
28280 printf(" %d", n_encoding);
28281 printf(" %d", n_options);
28282 printf("\n");
28283 }
28284 }
28285 }
28286 }
28287 }
28288#endif
28289
Daniel Veillard3d97e662004-11-04 10:49:00 +000028290 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028291 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028292}
28293
28294
28295static int
Daniel Veillardd93f6252004-11-02 15:53:51 +000028296test_xmlReaderNewMemory(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028297 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028298
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028299#ifdef LIBXML_READER_ENABLED
28300 int mem_base;
28301 int ret_val;
28302 xmlTextReaderPtr reader; /* an XML reader */
28303 int n_reader;
Daniel Veillardce682bc2004-11-05 17:22:25 +000028304 char * buffer; /* a pointer to a char array */
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028305 int n_buffer;
28306 int size; /* the size of the array */
28307 int n_size;
28308 const char * URL; /* the base URL to use for the document */
28309 int n_URL;
Daniel Veillardce682bc2004-11-05 17:22:25 +000028310 char * encoding; /* the document encoding, or NULL */
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028311 int n_encoding;
28312 int options; /* a combination of xmlParserOption */
28313 int n_options;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028314
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028315 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28316 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
28317 for (n_size = 0;n_size < gen_nb_int;n_size++) {
28318 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28319 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
Daniel Veillard6128c012004-11-08 17:16:15 +000028320 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028321 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000028322 reader = gen_xmlTextReaderPtr(n_reader, 0);
28323 buffer = gen_const_char_ptr(n_buffer, 1);
28324 size = gen_int(n_size, 2);
28325 URL = gen_filepath(n_URL, 3);
28326 encoding = gen_const_char_ptr(n_encoding, 4);
Daniel Veillard6128c012004-11-08 17:16:15 +000028327 options = gen_parseroptions(n_options, 5);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028328
28329 ret_val = xmlReaderNewMemory(reader, buffer, size, URL, encoding, options);
28330 desret_int(ret_val);
28331 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000028332 des_xmlTextReaderPtr(n_reader, reader, 0);
28333 des_const_char_ptr(n_buffer, buffer, 1);
28334 des_int(n_size, size, 2);
28335 des_filepath(n_URL, URL, 3);
28336 des_const_char_ptr(n_encoding, encoding, 4);
Daniel Veillard6128c012004-11-08 17:16:15 +000028337 des_parseroptions(n_options, options, 5);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028338 xmlResetLastError();
28339 if (mem_base != xmlMemBlocks()) {
28340 printf("Leak of %d blocks found in xmlReaderNewMemory",
28341 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028342 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028343 printf(" %d", n_reader);
28344 printf(" %d", n_buffer);
28345 printf(" %d", n_size);
28346 printf(" %d", n_URL);
28347 printf(" %d", n_encoding);
28348 printf(" %d", n_options);
28349 printf("\n");
28350 }
28351 }
28352 }
28353 }
28354 }
28355 }
28356 }
28357#endif
28358
Daniel Veillard3d97e662004-11-04 10:49:00 +000028359 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028360 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028361}
28362
28363
28364static int
28365test_xmlReaderNewWalker(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028366 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028367
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028368#ifdef LIBXML_READER_ENABLED
28369 int mem_base;
28370 int ret_val;
28371 xmlTextReaderPtr reader; /* an XML reader */
28372 int n_reader;
28373 xmlDocPtr doc; /* a preparsed document */
28374 int n_doc;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028375
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028376 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28377 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
28378 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000028379 reader = gen_xmlTextReaderPtr(n_reader, 0);
28380 doc = gen_xmlDocPtr(n_doc, 1);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028381
28382 ret_val = xmlReaderNewWalker(reader, doc);
28383 desret_int(ret_val);
28384 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000028385 des_xmlTextReaderPtr(n_reader, reader, 0);
28386 des_xmlDocPtr(n_doc, doc, 1);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028387 xmlResetLastError();
28388 if (mem_base != xmlMemBlocks()) {
28389 printf("Leak of %d blocks found in xmlReaderNewWalker",
28390 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028391 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028392 printf(" %d", n_reader);
28393 printf(" %d", n_doc);
28394 printf("\n");
28395 }
28396 }
28397 }
28398#endif
28399
Daniel Veillard3d97e662004-11-04 10:49:00 +000028400 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028401 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028402}
28403
28404
28405static int
28406test_xmlReaderWalker(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028407 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028408
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028409#ifdef LIBXML_READER_ENABLED
28410 int mem_base;
28411 xmlTextReaderPtr ret_val;
28412 xmlDocPtr doc; /* a preparsed document */
28413 int n_doc;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028414
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028415 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
28416 mem_base = xmlMemBlocks();
28417 doc = gen_xmlDocPtr(n_doc, 0);
28418
28419 ret_val = xmlReaderWalker(doc);
28420 desret_xmlTextReaderPtr(ret_val);
28421 call_tests++;
28422 des_xmlDocPtr(n_doc, doc, 0);
28423 xmlResetLastError();
28424 if (mem_base != xmlMemBlocks()) {
28425 printf("Leak of %d blocks found in xmlReaderWalker",
28426 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028427 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000028428 printf(" %d", n_doc);
28429 printf("\n");
28430 }
28431 }
28432#endif
28433
28434 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028435 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028436}
28437
28438
28439static int
28440test_xmlTextReaderAttributeCount(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028441 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028442
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028443#ifdef LIBXML_READER_ENABLED
28444 int mem_base;
28445 int ret_val;
28446 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28447 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028448
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028449 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28450 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000028451 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028452
28453 ret_val = xmlTextReaderAttributeCount(reader);
28454 desret_int(ret_val);
28455 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000028456 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028457 xmlResetLastError();
28458 if (mem_base != xmlMemBlocks()) {
28459 printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
28460 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028461 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028462 printf(" %d", n_reader);
28463 printf("\n");
28464 }
28465 }
28466#endif
28467
Daniel Veillard3d97e662004-11-04 10:49:00 +000028468 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028469 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028470}
28471
28472
28473static int
28474test_xmlTextReaderBaseUri(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028475 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028476
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028477#ifdef LIBXML_READER_ENABLED
28478 int mem_base;
28479 xmlChar * ret_val;
28480 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28481 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028482
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028483 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28484 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000028485 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028486
28487 ret_val = xmlTextReaderBaseUri(reader);
28488 desret_xmlChar_ptr(ret_val);
28489 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000028490 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028491 xmlResetLastError();
28492 if (mem_base != xmlMemBlocks()) {
28493 printf("Leak of %d blocks found in xmlTextReaderBaseUri",
28494 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028495 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028496 printf(" %d", n_reader);
28497 printf("\n");
28498 }
28499 }
28500#endif
28501
Daniel Veillard3d97e662004-11-04 10:49:00 +000028502 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028503 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028504}
28505
28506
28507static int
28508test_xmlTextReaderClose(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028509 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028510
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028511#ifdef LIBXML_READER_ENABLED
28512 int mem_base;
28513 int ret_val;
28514 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28515 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028516
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028517 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28518 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000028519 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028520
28521 ret_val = xmlTextReaderClose(reader);
28522 desret_int(ret_val);
28523 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000028524 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028525 xmlResetLastError();
28526 if (mem_base != xmlMemBlocks()) {
28527 printf("Leak of %d blocks found in xmlTextReaderClose",
28528 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028529 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028530 printf(" %d", n_reader);
28531 printf("\n");
28532 }
28533 }
28534#endif
28535
Daniel Veillard3d97e662004-11-04 10:49:00 +000028536 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028537 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028538}
28539
28540
28541static int
28542test_xmlTextReaderConstBaseUri(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028543 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028544
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028545#ifdef LIBXML_READER_ENABLED
28546 int mem_base;
28547 const xmlChar * ret_val;
28548 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28549 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028550
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028551 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28552 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000028553 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028554
28555 ret_val = xmlTextReaderConstBaseUri(reader);
28556 desret_const_xmlChar_ptr(ret_val);
28557 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000028558 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028559 xmlResetLastError();
28560 if (mem_base != xmlMemBlocks()) {
28561 printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
28562 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028563 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028564 printf(" %d", n_reader);
28565 printf("\n");
28566 }
28567 }
28568#endif
28569
Daniel Veillard3d97e662004-11-04 10:49:00 +000028570 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028571 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028572}
28573
28574
28575static int
28576test_xmlTextReaderConstEncoding(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028577 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028578
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028579#ifdef LIBXML_READER_ENABLED
28580 int mem_base;
28581 const xmlChar * ret_val;
28582 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28583 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028584
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028585 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28586 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000028587 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028588
28589 ret_val = xmlTextReaderConstEncoding(reader);
28590 desret_const_xmlChar_ptr(ret_val);
28591 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000028592 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028593 xmlResetLastError();
28594 if (mem_base != xmlMemBlocks()) {
28595 printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
28596 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028597 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028598 printf(" %d", n_reader);
28599 printf("\n");
28600 }
28601 }
28602#endif
28603
Daniel Veillard3d97e662004-11-04 10:49:00 +000028604 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028605 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028606}
28607
28608
28609static int
28610test_xmlTextReaderConstLocalName(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028611 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028612
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028613#ifdef LIBXML_READER_ENABLED
28614 int mem_base;
28615 const xmlChar * ret_val;
28616 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28617 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028618
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028619 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28620 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000028621 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028622
28623 ret_val = xmlTextReaderConstLocalName(reader);
28624 desret_const_xmlChar_ptr(ret_val);
28625 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000028626 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028627 xmlResetLastError();
28628 if (mem_base != xmlMemBlocks()) {
28629 printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
28630 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028631 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028632 printf(" %d", n_reader);
28633 printf("\n");
28634 }
28635 }
28636#endif
28637
Daniel Veillard3d97e662004-11-04 10:49:00 +000028638 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028639 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028640}
28641
28642
28643static int
28644test_xmlTextReaderConstName(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028645 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028646
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028647#ifdef LIBXML_READER_ENABLED
28648 int mem_base;
28649 const xmlChar * ret_val;
28650 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28651 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028652
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028653 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28654 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000028655 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028656
28657 ret_val = xmlTextReaderConstName(reader);
28658 desret_const_xmlChar_ptr(ret_val);
28659 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000028660 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028661 xmlResetLastError();
28662 if (mem_base != xmlMemBlocks()) {
28663 printf("Leak of %d blocks found in xmlTextReaderConstName",
28664 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028665 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028666 printf(" %d", n_reader);
28667 printf("\n");
28668 }
28669 }
28670#endif
28671
Daniel Veillard3d97e662004-11-04 10:49:00 +000028672 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028673 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028674}
28675
28676
28677static int
28678test_xmlTextReaderConstNamespaceUri(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028679 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028680
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028681#ifdef LIBXML_READER_ENABLED
28682 int mem_base;
28683 const xmlChar * ret_val;
28684 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28685 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028686
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028687 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28688 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000028689 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028690
28691 ret_val = xmlTextReaderConstNamespaceUri(reader);
28692 desret_const_xmlChar_ptr(ret_val);
28693 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000028694 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028695 xmlResetLastError();
28696 if (mem_base != xmlMemBlocks()) {
28697 printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
28698 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028699 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028700 printf(" %d", n_reader);
28701 printf("\n");
28702 }
28703 }
28704#endif
28705
Daniel Veillard3d97e662004-11-04 10:49:00 +000028706 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028707 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028708}
28709
28710
28711static int
28712test_xmlTextReaderConstPrefix(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028713 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028714
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028715#ifdef LIBXML_READER_ENABLED
28716 int mem_base;
28717 const xmlChar * ret_val;
28718 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28719 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028720
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028721 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28722 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000028723 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028724
28725 ret_val = xmlTextReaderConstPrefix(reader);
28726 desret_const_xmlChar_ptr(ret_val);
28727 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000028728 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028729 xmlResetLastError();
28730 if (mem_base != xmlMemBlocks()) {
28731 printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
28732 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028733 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028734 printf(" %d", n_reader);
28735 printf("\n");
28736 }
28737 }
28738#endif
28739
Daniel Veillard3d97e662004-11-04 10:49:00 +000028740 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028741 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028742}
28743
28744
28745static int
28746test_xmlTextReaderConstString(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028747 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028748
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028749#ifdef LIBXML_READER_ENABLED
28750 int mem_base;
28751 const xmlChar * ret_val;
28752 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28753 int n_reader;
Daniel Veillardce682bc2004-11-05 17:22:25 +000028754 xmlChar * str; /* the string to intern. */
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028755 int n_str;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028756
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028757 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28758 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
28759 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000028760 reader = gen_xmlTextReaderPtr(n_reader, 0);
28761 str = gen_const_xmlChar_ptr(n_str, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028762
28763 ret_val = xmlTextReaderConstString(reader, str);
28764 desret_const_xmlChar_ptr(ret_val);
28765 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000028766 des_xmlTextReaderPtr(n_reader, reader, 0);
28767 des_const_xmlChar_ptr(n_str, str, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028768 xmlResetLastError();
28769 if (mem_base != xmlMemBlocks()) {
28770 printf("Leak of %d blocks found in xmlTextReaderConstString",
28771 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028772 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028773 printf(" %d", n_reader);
28774 printf(" %d", n_str);
28775 printf("\n");
28776 }
28777 }
28778 }
28779#endif
28780
Daniel Veillard3d97e662004-11-04 10:49:00 +000028781 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028782 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028783}
28784
28785
28786static int
28787test_xmlTextReaderConstValue(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028788 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028789
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028790#ifdef LIBXML_READER_ENABLED
28791 int mem_base;
28792 const xmlChar * ret_val;
28793 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28794 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028795
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028796 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28797 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000028798 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028799
28800 ret_val = xmlTextReaderConstValue(reader);
28801 desret_const_xmlChar_ptr(ret_val);
28802 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000028803 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028804 xmlResetLastError();
28805 if (mem_base != xmlMemBlocks()) {
28806 printf("Leak of %d blocks found in xmlTextReaderConstValue",
28807 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028808 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028809 printf(" %d", n_reader);
28810 printf("\n");
28811 }
28812 }
28813#endif
28814
Daniel Veillard3d97e662004-11-04 10:49:00 +000028815 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028816 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028817}
28818
28819
28820static int
28821test_xmlTextReaderConstXmlLang(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028822 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028823
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028824#ifdef LIBXML_READER_ENABLED
28825 int mem_base;
28826 const xmlChar * ret_val;
28827 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28828 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028829
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028830 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28831 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000028832 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028833
28834 ret_val = xmlTextReaderConstXmlLang(reader);
28835 desret_const_xmlChar_ptr(ret_val);
28836 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000028837 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028838 xmlResetLastError();
28839 if (mem_base != xmlMemBlocks()) {
28840 printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
28841 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028842 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028843 printf(" %d", n_reader);
28844 printf("\n");
28845 }
28846 }
28847#endif
28848
Daniel Veillard3d97e662004-11-04 10:49:00 +000028849 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028850 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028851}
28852
28853
28854static int
28855test_xmlTextReaderConstXmlVersion(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028856 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028857
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028858#ifdef LIBXML_READER_ENABLED
28859 int mem_base;
28860 const xmlChar * ret_val;
28861 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28862 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028863
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028864 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28865 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000028866 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028867
28868 ret_val = xmlTextReaderConstXmlVersion(reader);
28869 desret_const_xmlChar_ptr(ret_val);
28870 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000028871 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028872 xmlResetLastError();
28873 if (mem_base != xmlMemBlocks()) {
28874 printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
28875 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028876 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000028877 printf(" %d", n_reader);
28878 printf("\n");
28879 }
28880 }
28881#endif
28882
Daniel Veillard3d97e662004-11-04 10:49:00 +000028883 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028884 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028885}
28886
28887
28888static int
28889test_xmlTextReaderCurrentDoc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028890 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028891
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028892#ifdef LIBXML_READER_ENABLED
28893 int mem_base;
28894 xmlDocPtr ret_val;
28895 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28896 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028897
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028898 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28899 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000028900 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028901
28902 ret_val = xmlTextReaderCurrentDoc(reader);
28903 desret_xmlDocPtr(ret_val);
28904 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000028905 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028906 xmlResetLastError();
28907 if (mem_base != xmlMemBlocks()) {
28908 printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
28909 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028910 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028911 printf(" %d", n_reader);
28912 printf("\n");
28913 }
28914 }
28915#endif
28916
Daniel Veillard3d97e662004-11-04 10:49:00 +000028917 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028918 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028919}
28920
28921
28922static int
28923test_xmlTextReaderCurrentNode(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028924 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028925
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028926#ifdef LIBXML_READER_ENABLED
28927 int mem_base;
28928 xmlNodePtr ret_val;
28929 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28930 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028931
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028932 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28933 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000028934 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028935
28936 ret_val = xmlTextReaderCurrentNode(reader);
28937 desret_xmlNodePtr(ret_val);
28938 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000028939 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028940 xmlResetLastError();
28941 if (mem_base != xmlMemBlocks()) {
28942 printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
28943 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028944 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028945 printf(" %d", n_reader);
28946 printf("\n");
28947 }
28948 }
28949#endif
28950
Daniel Veillard3d97e662004-11-04 10:49:00 +000028951 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028952 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028953}
28954
28955
28956static int
28957test_xmlTextReaderDepth(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028958 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028959
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028960#ifdef LIBXML_READER_ENABLED
28961 int mem_base;
28962 int ret_val;
28963 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28964 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028965
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028966 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28967 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000028968 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028969
28970 ret_val = xmlTextReaderDepth(reader);
28971 desret_int(ret_val);
28972 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000028973 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028974 xmlResetLastError();
28975 if (mem_base != xmlMemBlocks()) {
28976 printf("Leak of %d blocks found in xmlTextReaderDepth",
28977 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000028978 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028979 printf(" %d", n_reader);
28980 printf("\n");
28981 }
28982 }
28983#endif
28984
Daniel Veillard3d97e662004-11-04 10:49:00 +000028985 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000028986 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000028987}
28988
28989
28990static int
28991test_xmlTextReaderExpand(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000028992 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028993
Daniel Veillarddd6d3002004-11-03 14:20:29 +000028994#ifdef LIBXML_READER_ENABLED
28995 int mem_base;
28996 xmlNodePtr ret_val;
28997 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28998 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000028999
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029000 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29001 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029002 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029003
29004 ret_val = xmlTextReaderExpand(reader);
29005 desret_xmlNodePtr(ret_val);
29006 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029007 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029008 xmlResetLastError();
29009 if (mem_base != xmlMemBlocks()) {
29010 printf("Leak of %d blocks found in xmlTextReaderExpand",
29011 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029012 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029013 printf(" %d", n_reader);
29014 printf("\n");
29015 }
29016 }
29017#endif
29018
Daniel Veillard3d97e662004-11-04 10:49:00 +000029019 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029020 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029021}
29022
29023
29024static int
29025test_xmlTextReaderGetAttribute(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029026 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029027
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029028#ifdef LIBXML_READER_ENABLED
29029 int mem_base;
29030 xmlChar * ret_val;
29031 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29032 int n_reader;
Daniel Veillardce682bc2004-11-05 17:22:25 +000029033 xmlChar * name; /* the qualified name of the attribute. */
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029034 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029035
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029036 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29037 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
29038 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029039 reader = gen_xmlTextReaderPtr(n_reader, 0);
29040 name = gen_const_xmlChar_ptr(n_name, 1);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029041
29042 ret_val = xmlTextReaderGetAttribute(reader, name);
29043 desret_xmlChar_ptr(ret_val);
29044 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029045 des_xmlTextReaderPtr(n_reader, reader, 0);
29046 des_const_xmlChar_ptr(n_name, name, 1);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029047 xmlResetLastError();
29048 if (mem_base != xmlMemBlocks()) {
29049 printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
29050 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029051 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029052 printf(" %d", n_reader);
29053 printf(" %d", n_name);
29054 printf("\n");
29055 }
29056 }
29057 }
29058#endif
29059
Daniel Veillard3d97e662004-11-04 10:49:00 +000029060 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029061 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029062}
29063
29064
29065static int
29066test_xmlTextReaderGetAttributeNo(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029067 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029068
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029069#ifdef LIBXML_READER_ENABLED
29070 int mem_base;
29071 xmlChar * ret_val;
29072 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29073 int n_reader;
29074 int no; /* the zero-based index of the attribute relative to the containing element */
29075 int n_no;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029076
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029077 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29078 for (n_no = 0;n_no < gen_nb_int;n_no++) {
29079 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029080 reader = gen_xmlTextReaderPtr(n_reader, 0);
29081 no = gen_int(n_no, 1);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029082
29083 ret_val = xmlTextReaderGetAttributeNo(reader, no);
29084 desret_xmlChar_ptr(ret_val);
29085 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029086 des_xmlTextReaderPtr(n_reader, reader, 0);
29087 des_int(n_no, no, 1);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029088 xmlResetLastError();
29089 if (mem_base != xmlMemBlocks()) {
29090 printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
29091 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029092 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029093 printf(" %d", n_reader);
29094 printf(" %d", n_no);
29095 printf("\n");
29096 }
29097 }
29098 }
29099#endif
29100
Daniel Veillard3d97e662004-11-04 10:49:00 +000029101 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029102 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029103}
29104
29105
29106static int
29107test_xmlTextReaderGetAttributeNs(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029108 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029109
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029110#ifdef LIBXML_READER_ENABLED
29111 int mem_base;
29112 xmlChar * ret_val;
29113 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29114 int n_reader;
Daniel Veillardce682bc2004-11-05 17:22:25 +000029115 xmlChar * localName; /* the local name of the attribute. */
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029116 int n_localName;
Daniel Veillardce682bc2004-11-05 17:22:25 +000029117 xmlChar * namespaceURI; /* the namespace URI of the attribute. */
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029118 int n_namespaceURI;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029119
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029120 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29121 for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
29122 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
29123 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029124 reader = gen_xmlTextReaderPtr(n_reader, 0);
29125 localName = gen_const_xmlChar_ptr(n_localName, 1);
29126 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029127
29128 ret_val = xmlTextReaderGetAttributeNs(reader, localName, namespaceURI);
29129 desret_xmlChar_ptr(ret_val);
29130 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029131 des_xmlTextReaderPtr(n_reader, reader, 0);
29132 des_const_xmlChar_ptr(n_localName, localName, 1);
29133 des_const_xmlChar_ptr(n_namespaceURI, namespaceURI, 2);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029134 xmlResetLastError();
29135 if (mem_base != xmlMemBlocks()) {
29136 printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
29137 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029138 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029139 printf(" %d", n_reader);
29140 printf(" %d", n_localName);
29141 printf(" %d", n_namespaceURI);
29142 printf("\n");
29143 }
29144 }
29145 }
29146 }
29147#endif
29148
Daniel Veillard3d97e662004-11-04 10:49:00 +000029149 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029150 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029151}
29152
29153
Daniel Veillardce682bc2004-11-05 17:22:25 +000029154#define gen_nb_xmlTextReaderErrorFunc_ptr 1
29155static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29156 return(NULL);
29157}
29158static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29159}
29160
Daniel Veillardd93f6252004-11-02 15:53:51 +000029161static int
29162test_xmlTextReaderGetErrorHandler(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029163 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029164
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000029165#ifdef LIBXML_READER_ENABLED
29166 int mem_base;
29167 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29168 int n_reader;
29169 xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
29170 int n_f;
29171 void ** arg; /* a user argument */
29172 int n_arg;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029173
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000029174 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29175 for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
29176 for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
29177 mem_base = xmlMemBlocks();
29178 reader = gen_xmlTextReaderPtr(n_reader, 0);
29179 f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
29180 arg = gen_void_ptr_ptr(n_arg, 2);
29181
29182 xmlTextReaderGetErrorHandler(reader, f, arg);
29183 call_tests++;
29184 des_xmlTextReaderPtr(n_reader, reader, 0);
29185 des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
29186 des_void_ptr_ptr(n_arg, arg, 2);
29187 xmlResetLastError();
29188 if (mem_base != xmlMemBlocks()) {
29189 printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
29190 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029191 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000029192 printf(" %d", n_reader);
29193 printf(" %d", n_f);
29194 printf(" %d", n_arg);
29195 printf("\n");
29196 }
29197 }
29198 }
29199 }
29200#endif
29201
29202 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029203 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029204}
29205
29206
29207static int
29208test_xmlTextReaderGetParserProp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029209 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029210
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029211#ifdef LIBXML_READER_ENABLED
29212 int mem_base;
29213 int ret_val;
29214 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29215 int n_reader;
29216 int prop; /* the xmlParserProperties to get */
29217 int n_prop;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029218
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029219 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29220 for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
29221 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029222 reader = gen_xmlTextReaderPtr(n_reader, 0);
29223 prop = gen_int(n_prop, 1);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029224
29225 ret_val = xmlTextReaderGetParserProp(reader, prop);
29226 desret_int(ret_val);
29227 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029228 des_xmlTextReaderPtr(n_reader, reader, 0);
29229 des_int(n_prop, prop, 1);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029230 xmlResetLastError();
29231 if (mem_base != xmlMemBlocks()) {
29232 printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
29233 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029234 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029235 printf(" %d", n_reader);
29236 printf(" %d", n_prop);
29237 printf("\n");
29238 }
29239 }
29240 }
29241#endif
29242
Daniel Veillard3d97e662004-11-04 10:49:00 +000029243 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029244 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029245}
29246
29247
29248static int
29249test_xmlTextReaderGetRemainder(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029250 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029251
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000029252#ifdef LIBXML_READER_ENABLED
29253 int mem_base;
29254 xmlParserInputBufferPtr ret_val;
29255 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29256 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029257
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000029258 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29259 mem_base = xmlMemBlocks();
29260 reader = gen_xmlTextReaderPtr(n_reader, 0);
29261
29262 ret_val = xmlTextReaderGetRemainder(reader);
29263 desret_xmlParserInputBufferPtr(ret_val);
29264 call_tests++;
29265 des_xmlTextReaderPtr(n_reader, reader, 0);
29266 xmlResetLastError();
29267 if (mem_base != xmlMemBlocks()) {
29268 printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
29269 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029270 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000029271 printf(" %d", n_reader);
29272 printf("\n");
29273 }
29274 }
29275#endif
29276
29277 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029278 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029279}
29280
29281
29282static int
29283test_xmlTextReaderHasAttributes(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029284 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029285
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029286#ifdef LIBXML_READER_ENABLED
29287 int mem_base;
29288 int ret_val;
29289 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29290 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029291
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029292 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29293 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029294 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029295
29296 ret_val = xmlTextReaderHasAttributes(reader);
29297 desret_int(ret_val);
29298 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029299 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029300 xmlResetLastError();
29301 if (mem_base != xmlMemBlocks()) {
29302 printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
29303 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029304 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029305 printf(" %d", n_reader);
29306 printf("\n");
29307 }
29308 }
29309#endif
29310
Daniel Veillard3d97e662004-11-04 10:49:00 +000029311 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029312 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029313}
29314
29315
29316static int
29317test_xmlTextReaderHasValue(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029318 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029319
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029320#ifdef LIBXML_READER_ENABLED
29321 int mem_base;
29322 int ret_val;
29323 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29324 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029325
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029326 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29327 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029328 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029329
29330 ret_val = xmlTextReaderHasValue(reader);
29331 desret_int(ret_val);
29332 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029333 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029334 xmlResetLastError();
29335 if (mem_base != xmlMemBlocks()) {
29336 printf("Leak of %d blocks found in xmlTextReaderHasValue",
29337 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029338 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029339 printf(" %d", n_reader);
29340 printf("\n");
29341 }
29342 }
29343#endif
29344
Daniel Veillard3d97e662004-11-04 10:49:00 +000029345 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029346 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029347}
29348
29349
29350static int
29351test_xmlTextReaderIsDefault(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029352 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029353
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029354#ifdef LIBXML_READER_ENABLED
29355 int mem_base;
29356 int ret_val;
29357 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29358 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029359
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029360 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29361 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029362 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029363
29364 ret_val = xmlTextReaderIsDefault(reader);
29365 desret_int(ret_val);
29366 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029367 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029368 xmlResetLastError();
29369 if (mem_base != xmlMemBlocks()) {
29370 printf("Leak of %d blocks found in xmlTextReaderIsDefault",
29371 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029372 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029373 printf(" %d", n_reader);
29374 printf("\n");
29375 }
29376 }
29377#endif
29378
Daniel Veillard3d97e662004-11-04 10:49:00 +000029379 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029380 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029381}
29382
29383
29384static int
29385test_xmlTextReaderIsEmptyElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029386 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029387
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029388#ifdef LIBXML_READER_ENABLED
29389 int mem_base;
29390 int ret_val;
29391 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29392 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029393
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029394 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29395 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029396 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029397
29398 ret_val = xmlTextReaderIsEmptyElement(reader);
29399 desret_int(ret_val);
29400 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029401 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029402 xmlResetLastError();
29403 if (mem_base != xmlMemBlocks()) {
29404 printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
29405 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029406 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029407 printf(" %d", n_reader);
29408 printf("\n");
29409 }
29410 }
29411#endif
29412
Daniel Veillard3d97e662004-11-04 10:49:00 +000029413 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029414 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029415}
29416
29417
29418static int
29419test_xmlTextReaderIsNamespaceDecl(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029420 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029421
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029422#ifdef LIBXML_READER_ENABLED
29423 int mem_base;
29424 int ret_val;
29425 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29426 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029427
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029428 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29429 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029430 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029431
29432 ret_val = xmlTextReaderIsNamespaceDecl(reader);
29433 desret_int(ret_val);
29434 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029435 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029436 xmlResetLastError();
29437 if (mem_base != xmlMemBlocks()) {
29438 printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
29439 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029440 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029441 printf(" %d", n_reader);
29442 printf("\n");
29443 }
29444 }
29445#endif
29446
Daniel Veillard3d97e662004-11-04 10:49:00 +000029447 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029448 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029449}
29450
29451
29452static int
29453test_xmlTextReaderIsValid(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029454 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029455
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029456#ifdef LIBXML_READER_ENABLED
29457 int mem_base;
29458 int ret_val;
29459 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29460 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029461
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029462 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29463 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029464 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029465
29466 ret_val = xmlTextReaderIsValid(reader);
29467 desret_int(ret_val);
29468 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029469 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029470 xmlResetLastError();
29471 if (mem_base != xmlMemBlocks()) {
29472 printf("Leak of %d blocks found in xmlTextReaderIsValid",
29473 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029474 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029475 printf(" %d", n_reader);
29476 printf("\n");
29477 }
29478 }
29479#endif
29480
Daniel Veillard3d97e662004-11-04 10:49:00 +000029481 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029482 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029483}
29484
29485
29486static int
29487test_xmlTextReaderLocalName(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029488 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029489
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029490#ifdef LIBXML_READER_ENABLED
29491 int mem_base;
29492 xmlChar * ret_val;
29493 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29494 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029495
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029496 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29497 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029498 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029499
29500 ret_val = xmlTextReaderLocalName(reader);
29501 desret_xmlChar_ptr(ret_val);
29502 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029503 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029504 xmlResetLastError();
29505 if (mem_base != xmlMemBlocks()) {
29506 printf("Leak of %d blocks found in xmlTextReaderLocalName",
29507 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029508 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029509 printf(" %d", n_reader);
29510 printf("\n");
29511 }
29512 }
29513#endif
29514
Daniel Veillard3d97e662004-11-04 10:49:00 +000029515 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029516 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029517}
29518
29519
Daniel Veillardce682bc2004-11-05 17:22:25 +000029520#define gen_nb_xmlTextReaderLocatorPtr 1
29521static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29522 return(NULL);
29523}
29524static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29525}
29526
Daniel Veillardd93f6252004-11-02 15:53:51 +000029527static int
29528test_xmlTextReaderLocatorBaseURI(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029529 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029530
Daniel Veillardce682bc2004-11-05 17:22:25 +000029531#ifdef LIBXML_READER_ENABLED
29532 int mem_base;
29533 xmlChar * ret_val;
29534 xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
29535 int n_locator;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029536
Daniel Veillardce682bc2004-11-05 17:22:25 +000029537 for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
29538 mem_base = xmlMemBlocks();
29539 locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
29540
29541 ret_val = xmlTextReaderLocatorBaseURI(locator);
29542 desret_xmlChar_ptr(ret_val);
29543 call_tests++;
29544 des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
29545 xmlResetLastError();
29546 if (mem_base != xmlMemBlocks()) {
29547 printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
29548 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029549 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000029550 printf(" %d", n_locator);
29551 printf("\n");
29552 }
29553 }
29554#endif
29555
29556 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029557 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029558}
29559
29560
29561static int
29562test_xmlTextReaderLocatorLineNumber(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029563 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029564
Daniel Veillardce682bc2004-11-05 17:22:25 +000029565#ifdef LIBXML_READER_ENABLED
29566 int mem_base;
29567 int ret_val;
29568 xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
29569 int n_locator;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029570
Daniel Veillardce682bc2004-11-05 17:22:25 +000029571 for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
29572 mem_base = xmlMemBlocks();
29573 locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
29574
29575 ret_val = xmlTextReaderLocatorLineNumber(locator);
29576 desret_int(ret_val);
29577 call_tests++;
29578 des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
29579 xmlResetLastError();
29580 if (mem_base != xmlMemBlocks()) {
29581 printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
29582 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029583 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000029584 printf(" %d", n_locator);
29585 printf("\n");
29586 }
29587 }
29588#endif
29589
29590 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029591 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029592}
29593
29594
29595static int
29596test_xmlTextReaderLookupNamespace(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029597 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029598
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029599#ifdef LIBXML_READER_ENABLED
29600 int mem_base;
29601 xmlChar * ret_val;
29602 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29603 int n_reader;
Daniel Veillardce682bc2004-11-05 17:22:25 +000029604 xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029605 int n_prefix;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029606
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029607 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29608 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
29609 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029610 reader = gen_xmlTextReaderPtr(n_reader, 0);
29611 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029612
29613 ret_val = xmlTextReaderLookupNamespace(reader, prefix);
29614 desret_xmlChar_ptr(ret_val);
29615 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029616 des_xmlTextReaderPtr(n_reader, reader, 0);
29617 des_const_xmlChar_ptr(n_prefix, prefix, 1);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029618 xmlResetLastError();
29619 if (mem_base != xmlMemBlocks()) {
29620 printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
29621 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029622 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029623 printf(" %d", n_reader);
29624 printf(" %d", n_prefix);
29625 printf("\n");
29626 }
29627 }
29628 }
29629#endif
29630
Daniel Veillard3d97e662004-11-04 10:49:00 +000029631 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029632 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029633}
29634
29635
29636static int
29637test_xmlTextReaderMoveToAttribute(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029638 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029639
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029640#ifdef LIBXML_READER_ENABLED
29641 int mem_base;
29642 int ret_val;
29643 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29644 int n_reader;
Daniel Veillardce682bc2004-11-05 17:22:25 +000029645 xmlChar * name; /* the qualified name of the attribute. */
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029646 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029647
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029648 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29649 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
29650 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029651 reader = gen_xmlTextReaderPtr(n_reader, 0);
29652 name = gen_const_xmlChar_ptr(n_name, 1);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029653
29654 ret_val = xmlTextReaderMoveToAttribute(reader, name);
29655 desret_int(ret_val);
29656 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029657 des_xmlTextReaderPtr(n_reader, reader, 0);
29658 des_const_xmlChar_ptr(n_name, name, 1);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029659 xmlResetLastError();
29660 if (mem_base != xmlMemBlocks()) {
29661 printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
29662 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029663 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029664 printf(" %d", n_reader);
29665 printf(" %d", n_name);
29666 printf("\n");
29667 }
29668 }
29669 }
29670#endif
29671
Daniel Veillard3d97e662004-11-04 10:49:00 +000029672 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029673 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029674}
29675
29676
29677static int
29678test_xmlTextReaderMoveToAttributeNo(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029679 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029680
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029681#ifdef LIBXML_READER_ENABLED
29682 int mem_base;
29683 int ret_val;
29684 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29685 int n_reader;
29686 int no; /* the zero-based index of the attribute relative to the containing element. */
29687 int n_no;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029688
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029689 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29690 for (n_no = 0;n_no < gen_nb_int;n_no++) {
29691 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029692 reader = gen_xmlTextReaderPtr(n_reader, 0);
29693 no = gen_int(n_no, 1);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029694
29695 ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
29696 desret_int(ret_val);
29697 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029698 des_xmlTextReaderPtr(n_reader, reader, 0);
29699 des_int(n_no, no, 1);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029700 xmlResetLastError();
29701 if (mem_base != xmlMemBlocks()) {
29702 printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
29703 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029704 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029705 printf(" %d", n_reader);
29706 printf(" %d", n_no);
29707 printf("\n");
29708 }
29709 }
29710 }
29711#endif
29712
Daniel Veillard3d97e662004-11-04 10:49:00 +000029713 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029714 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029715}
29716
29717
29718static int
29719test_xmlTextReaderMoveToAttributeNs(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029720 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029721
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029722#ifdef LIBXML_READER_ENABLED
29723 int mem_base;
29724 int ret_val;
29725 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29726 int n_reader;
Daniel Veillardce682bc2004-11-05 17:22:25 +000029727 xmlChar * localName; /* the local name of the attribute. */
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029728 int n_localName;
Daniel Veillardce682bc2004-11-05 17:22:25 +000029729 xmlChar * namespaceURI; /* the namespace URI of the attribute. */
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029730 int n_namespaceURI;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029731
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029732 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29733 for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
29734 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
29735 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029736 reader = gen_xmlTextReaderPtr(n_reader, 0);
29737 localName = gen_const_xmlChar_ptr(n_localName, 1);
29738 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029739
29740 ret_val = xmlTextReaderMoveToAttributeNs(reader, localName, namespaceURI);
29741 desret_int(ret_val);
29742 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029743 des_xmlTextReaderPtr(n_reader, reader, 0);
29744 des_const_xmlChar_ptr(n_localName, localName, 1);
29745 des_const_xmlChar_ptr(n_namespaceURI, namespaceURI, 2);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029746 xmlResetLastError();
29747 if (mem_base != xmlMemBlocks()) {
29748 printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
29749 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029750 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029751 printf(" %d", n_reader);
29752 printf(" %d", n_localName);
29753 printf(" %d", n_namespaceURI);
29754 printf("\n");
29755 }
29756 }
29757 }
29758 }
29759#endif
29760
Daniel Veillard3d97e662004-11-04 10:49:00 +000029761 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029762 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029763}
29764
29765
29766static int
29767test_xmlTextReaderMoveToElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029768 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029769
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029770#ifdef LIBXML_READER_ENABLED
29771 int mem_base;
29772 int ret_val;
29773 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29774 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029775
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029776 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29777 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029778 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029779
29780 ret_val = xmlTextReaderMoveToElement(reader);
29781 desret_int(ret_val);
29782 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029783 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029784 xmlResetLastError();
29785 if (mem_base != xmlMemBlocks()) {
29786 printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
29787 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029788 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029789 printf(" %d", n_reader);
29790 printf("\n");
29791 }
29792 }
29793#endif
29794
Daniel Veillard3d97e662004-11-04 10:49:00 +000029795 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029796 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029797}
29798
29799
29800static int
29801test_xmlTextReaderMoveToFirstAttribute(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029802 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029803
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029804#ifdef LIBXML_READER_ENABLED
29805 int mem_base;
29806 int ret_val;
29807 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29808 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029809
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029810 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29811 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029812 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029813
29814 ret_val = xmlTextReaderMoveToFirstAttribute(reader);
29815 desret_int(ret_val);
29816 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029817 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029818 xmlResetLastError();
29819 if (mem_base != xmlMemBlocks()) {
29820 printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
29821 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029822 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029823 printf(" %d", n_reader);
29824 printf("\n");
29825 }
29826 }
29827#endif
29828
Daniel Veillard3d97e662004-11-04 10:49:00 +000029829 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029830 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029831}
29832
29833
29834static int
29835test_xmlTextReaderMoveToNextAttribute(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029836 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029837
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029838#ifdef LIBXML_READER_ENABLED
29839 int mem_base;
29840 int ret_val;
29841 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29842 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029843
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029844 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29845 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029846 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029847
29848 ret_val = xmlTextReaderMoveToNextAttribute(reader);
29849 desret_int(ret_val);
29850 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029851 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029852 xmlResetLastError();
29853 if (mem_base != xmlMemBlocks()) {
29854 printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
29855 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029856 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029857 printf(" %d", n_reader);
29858 printf("\n");
29859 }
29860 }
29861#endif
29862
Daniel Veillard3d97e662004-11-04 10:49:00 +000029863 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029864 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029865}
29866
29867
29868static int
29869test_xmlTextReaderName(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029870 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029871
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029872#ifdef LIBXML_READER_ENABLED
29873 int mem_base;
29874 xmlChar * ret_val;
29875 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29876 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029877
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029878 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29879 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029880 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029881
29882 ret_val = xmlTextReaderName(reader);
29883 desret_xmlChar_ptr(ret_val);
29884 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029885 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029886 xmlResetLastError();
29887 if (mem_base != xmlMemBlocks()) {
29888 printf("Leak of %d blocks found in xmlTextReaderName",
29889 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029890 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029891 printf(" %d", n_reader);
29892 printf("\n");
29893 }
29894 }
29895#endif
29896
Daniel Veillard3d97e662004-11-04 10:49:00 +000029897 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029898 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029899}
29900
29901
29902static int
29903test_xmlTextReaderNamespaceUri(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029904 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029905
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029906#ifdef LIBXML_READER_ENABLED
29907 int mem_base;
29908 xmlChar * ret_val;
29909 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29910 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029911
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029912 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29913 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029914 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029915
29916 ret_val = xmlTextReaderNamespaceUri(reader);
29917 desret_xmlChar_ptr(ret_val);
29918 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029919 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029920 xmlResetLastError();
29921 if (mem_base != xmlMemBlocks()) {
29922 printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
29923 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029924 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029925 printf(" %d", n_reader);
29926 printf("\n");
29927 }
29928 }
29929#endif
29930
Daniel Veillard3d97e662004-11-04 10:49:00 +000029931 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029932 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029933}
29934
29935
29936static int
29937test_xmlTextReaderNext(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029938 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029939
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029940#ifdef LIBXML_READER_ENABLED
29941 int mem_base;
29942 int ret_val;
29943 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29944 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029945
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029946 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29947 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029948 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029949
29950 ret_val = xmlTextReaderNext(reader);
29951 desret_int(ret_val);
29952 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029953 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029954 xmlResetLastError();
29955 if (mem_base != xmlMemBlocks()) {
29956 printf("Leak of %d blocks found in xmlTextReaderNext",
29957 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029958 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029959 printf(" %d", n_reader);
29960 printf("\n");
29961 }
29962 }
29963#endif
29964
Daniel Veillard3d97e662004-11-04 10:49:00 +000029965 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000029966 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000029967}
29968
29969
29970static int
29971test_xmlTextReaderNextSibling(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000029972 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029973
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029974#ifdef LIBXML_READER_ENABLED
29975 int mem_base;
29976 int ret_val;
29977 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29978 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000029979
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029980 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29981 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000029982 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029983
29984 ret_val = xmlTextReaderNextSibling(reader);
29985 desret_int(ret_val);
29986 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000029987 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029988 xmlResetLastError();
29989 if (mem_base != xmlMemBlocks()) {
29990 printf("Leak of %d blocks found in xmlTextReaderNextSibling",
29991 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000029992 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000029993 printf(" %d", n_reader);
29994 printf("\n");
29995 }
29996 }
29997#endif
29998
Daniel Veillard3d97e662004-11-04 10:49:00 +000029999 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000030000 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030001}
30002
30003
30004static int
30005test_xmlTextReaderNodeType(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000030006 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030007
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030008#ifdef LIBXML_READER_ENABLED
30009 int mem_base;
30010 int ret_val;
30011 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30012 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030013
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030014 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30015 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000030016 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030017
30018 ret_val = xmlTextReaderNodeType(reader);
30019 desret_int(ret_val);
30020 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000030021 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030022 xmlResetLastError();
30023 if (mem_base != xmlMemBlocks()) {
30024 printf("Leak of %d blocks found in xmlTextReaderNodeType",
30025 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000030026 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030027 printf(" %d", n_reader);
30028 printf("\n");
30029 }
30030 }
30031#endif
30032
Daniel Veillard3d97e662004-11-04 10:49:00 +000030033 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000030034 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030035}
30036
30037
30038static int
30039test_xmlTextReaderNormalization(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000030040 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030041
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030042#ifdef LIBXML_READER_ENABLED
30043 int mem_base;
30044 int ret_val;
30045 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30046 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030047
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030048 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30049 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000030050 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030051
30052 ret_val = xmlTextReaderNormalization(reader);
30053 desret_int(ret_val);
30054 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000030055 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030056 xmlResetLastError();
30057 if (mem_base != xmlMemBlocks()) {
30058 printf("Leak of %d blocks found in xmlTextReaderNormalization",
30059 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000030060 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030061 printf(" %d", n_reader);
30062 printf("\n");
30063 }
30064 }
30065#endif
30066
Daniel Veillard3d97e662004-11-04 10:49:00 +000030067 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000030068 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030069}
30070
30071
30072static int
30073test_xmlTextReaderPrefix(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000030074 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030075
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030076#ifdef LIBXML_READER_ENABLED
30077 int mem_base;
30078 xmlChar * ret_val;
30079 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30080 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030081
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030082 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30083 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000030084 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030085
30086 ret_val = xmlTextReaderPrefix(reader);
30087 desret_xmlChar_ptr(ret_val);
30088 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000030089 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030090 xmlResetLastError();
30091 if (mem_base != xmlMemBlocks()) {
30092 printf("Leak of %d blocks found in xmlTextReaderPrefix",
30093 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000030094 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030095 printf(" %d", n_reader);
30096 printf("\n");
30097 }
30098 }
30099#endif
30100
Daniel Veillard3d97e662004-11-04 10:49:00 +000030101 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000030102 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030103}
30104
30105
30106static int
30107test_xmlTextReaderPreserve(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000030108 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030109
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030110#ifdef LIBXML_READER_ENABLED
30111 int mem_base;
30112 xmlNodePtr ret_val;
30113 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30114 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030115
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030116 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30117 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000030118 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030119
30120 ret_val = xmlTextReaderPreserve(reader);
30121 desret_xmlNodePtr(ret_val);
30122 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000030123 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030124 xmlResetLastError();
30125 if (mem_base != xmlMemBlocks()) {
30126 printf("Leak of %d blocks found in xmlTextReaderPreserve",
30127 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000030128 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030129 printf(" %d", n_reader);
30130 printf("\n");
30131 }
30132 }
30133#endif
30134
Daniel Veillard3d97e662004-11-04 10:49:00 +000030135 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000030136 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030137}
30138
30139
30140static int
30141test_xmlTextReaderPreservePattern(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000030142 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030143
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000030144#ifdef LIBXML_READER_ENABLED
30145 int mem_base;
30146 int ret_val;
30147 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30148 int n_reader;
30149 xmlChar * pattern; /* an XPath subset pattern */
30150 int n_pattern;
30151 xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
30152 int n_namespaces;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030153
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000030154 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30155 for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
30156 for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
30157 mem_base = xmlMemBlocks();
30158 reader = gen_xmlTextReaderPtr(n_reader, 0);
30159 pattern = gen_const_xmlChar_ptr(n_pattern, 1);
30160 namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
30161
30162 ret_val = xmlTextReaderPreservePattern(reader, pattern, namespaces);
30163 desret_int(ret_val);
30164 call_tests++;
30165 des_xmlTextReaderPtr(n_reader, reader, 0);
30166 des_const_xmlChar_ptr(n_pattern, pattern, 1);
30167 des_const_xmlChar_ptr_ptr(n_namespaces, namespaces, 2);
30168 xmlResetLastError();
30169 if (mem_base != xmlMemBlocks()) {
30170 printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
30171 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000030172 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000030173 printf(" %d", n_reader);
30174 printf(" %d", n_pattern);
30175 printf(" %d", n_namespaces);
30176 printf("\n");
30177 }
30178 }
30179 }
30180 }
30181#endif
30182
30183 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000030184 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030185}
30186
30187
30188static int
30189test_xmlTextReaderQuoteChar(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000030190 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030191
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030192#ifdef LIBXML_READER_ENABLED
30193 int mem_base;
30194 int ret_val;
30195 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30196 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030197
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030198 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30199 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000030200 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030201
30202 ret_val = xmlTextReaderQuoteChar(reader);
30203 desret_int(ret_val);
30204 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000030205 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030206 xmlResetLastError();
30207 if (mem_base != xmlMemBlocks()) {
30208 printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
30209 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000030210 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030211 printf(" %d", n_reader);
30212 printf("\n");
30213 }
30214 }
30215#endif
30216
Daniel Veillard3d97e662004-11-04 10:49:00 +000030217 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000030218 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030219}
30220
30221
30222static int
30223test_xmlTextReaderRead(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000030224 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030225
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030226#ifdef LIBXML_READER_ENABLED
30227 int mem_base;
30228 int ret_val;
30229 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30230 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030231
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030232 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30233 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000030234 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030235
30236 ret_val = xmlTextReaderRead(reader);
30237 desret_int(ret_val);
30238 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000030239 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030240 xmlResetLastError();
30241 if (mem_base != xmlMemBlocks()) {
30242 printf("Leak of %d blocks found in xmlTextReaderRead",
30243 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000030244 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030245 printf(" %d", n_reader);
30246 printf("\n");
30247 }
30248 }
30249#endif
30250
Daniel Veillard3d97e662004-11-04 10:49:00 +000030251 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000030252 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030253}
30254
30255
30256static int
30257test_xmlTextReaderReadAttributeValue(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000030258 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030259
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030260#ifdef LIBXML_READER_ENABLED
30261 int mem_base;
30262 int ret_val;
30263 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30264 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030265
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030266 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30267 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000030268 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030269
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030270 ret_val = xmlTextReaderReadAttributeValue(reader);
30271 desret_int(ret_val);
30272 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000030273 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030274 xmlResetLastError();
30275 if (mem_base != xmlMemBlocks()) {
30276 printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
30277 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000030278 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030279 printf(" %d", n_reader);
30280 printf("\n");
30281 }
30282 }
30283#endif
Daniel Veillardd93f6252004-11-02 15:53:51 +000030284
Daniel Veillard3d97e662004-11-04 10:49:00 +000030285 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000030286 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030287}
30288
30289
30290static int
30291test_xmlTextReaderReadState(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000030292 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030293
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030294#ifdef LIBXML_READER_ENABLED
30295 int mem_base;
30296 int ret_val;
30297 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30298 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030299
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030300 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30301 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000030302 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030303
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030304 ret_val = xmlTextReaderReadState(reader);
30305 desret_int(ret_val);
30306 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000030307 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030308 xmlResetLastError();
30309 if (mem_base != xmlMemBlocks()) {
30310 printf("Leak of %d blocks found in xmlTextReaderReadState",
30311 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000030312 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030313 printf(" %d", n_reader);
30314 printf("\n");
30315 }
30316 }
30317#endif
Daniel Veillardd93f6252004-11-02 15:53:51 +000030318
Daniel Veillard3d97e662004-11-04 10:49:00 +000030319 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000030320 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030321}
30322
30323
30324static int
30325test_xmlTextReaderRelaxNGSetSchema(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000030326 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030327
Daniel Veillardce682bc2004-11-05 17:22:25 +000030328#ifdef LIBXML_READER_ENABLED
30329#ifdef LIBXML_SCHEMAS_ENABLED
30330 int mem_base;
30331 int ret_val;
30332 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30333 int n_reader;
30334 xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
30335 int n_schema;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030336
Daniel Veillardce682bc2004-11-05 17:22:25 +000030337 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30338 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
30339 mem_base = xmlMemBlocks();
30340 reader = gen_xmlTextReaderPtr(n_reader, 0);
30341 schema = gen_xmlRelaxNGPtr(n_schema, 1);
30342
30343 ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
30344 desret_int(ret_val);
30345 call_tests++;
30346 des_xmlTextReaderPtr(n_reader, reader, 0);
30347 des_xmlRelaxNGPtr(n_schema, schema, 1);
30348 xmlResetLastError();
30349 if (mem_base != xmlMemBlocks()) {
30350 printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
30351 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000030352 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000030353 printf(" %d", n_reader);
30354 printf(" %d", n_schema);
30355 printf("\n");
30356 }
30357 }
30358 }
30359#endif
30360#endif
30361
30362 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000030363 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030364}
30365
30366
30367static int
30368test_xmlTextReaderRelaxNGValidate(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000030369 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030370
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030371#ifdef LIBXML_READER_ENABLED
30372#ifdef LIBXML_SCHEMAS_ENABLED
30373 int mem_base;
30374 int ret_val;
30375 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30376 int n_reader;
Daniel Veillardce682bc2004-11-05 17:22:25 +000030377 char * rng; /* the path to a RelaxNG schema or NULL */
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030378 int n_rng;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030379
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030380 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30381 for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
30382 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000030383 reader = gen_xmlTextReaderPtr(n_reader, 0);
30384 rng = gen_const_char_ptr(n_rng, 1);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030385
30386 ret_val = xmlTextReaderRelaxNGValidate(reader, rng);
30387 desret_int(ret_val);
30388 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000030389 des_xmlTextReaderPtr(n_reader, reader, 0);
30390 des_const_char_ptr(n_rng, rng, 1);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030391 xmlResetLastError();
30392 if (mem_base != xmlMemBlocks()) {
30393 printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
30394 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000030395 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030396 printf(" %d", n_reader);
30397 printf(" %d", n_rng);
30398 printf("\n");
30399 }
30400 }
30401 }
30402#endif
30403#endif
30404
Daniel Veillard3d97e662004-11-04 10:49:00 +000030405 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000030406 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030407}
30408
30409
30410static int
30411test_xmlTextReaderSetErrorHandler(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000030412 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030413
30414
30415 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000030416 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030417}
30418
30419
30420static int
30421test_xmlTextReaderSetParserProp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000030422 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030423
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030424#ifdef LIBXML_READER_ENABLED
30425 int mem_base;
30426 int ret_val;
30427 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30428 int n_reader;
30429 int prop; /* the xmlParserProperties to set */
30430 int n_prop;
30431 int value; /* usually 0 or 1 to (de)activate it */
30432 int n_value;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030433
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030434 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30435 for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
30436 for (n_value = 0;n_value < gen_nb_int;n_value++) {
30437 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000030438 reader = gen_xmlTextReaderPtr(n_reader, 0);
30439 prop = gen_int(n_prop, 1);
30440 value = gen_int(n_value, 2);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030441
30442 ret_val = xmlTextReaderSetParserProp(reader, prop, value);
30443 desret_int(ret_val);
30444 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000030445 des_xmlTextReaderPtr(n_reader, reader, 0);
30446 des_int(n_prop, prop, 1);
30447 des_int(n_value, value, 2);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030448 xmlResetLastError();
30449 if (mem_base != xmlMemBlocks()) {
30450 printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
30451 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000030452 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030453 printf(" %d", n_reader);
30454 printf(" %d", n_prop);
30455 printf(" %d", n_value);
30456 printf("\n");
30457 }
30458 }
30459 }
30460 }
30461#endif
30462
Daniel Veillard3d97e662004-11-04 10:49:00 +000030463 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000030464 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030465}
30466
30467
30468static int
30469test_xmlTextReaderSetStructuredErrorHandler(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000030470 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030471
30472
30473 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000030474 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030475}
30476
30477
30478static int
30479test_xmlTextReaderStandalone(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000030480 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030481
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030482#ifdef LIBXML_READER_ENABLED
30483 int mem_base;
30484 int ret_val;
30485 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30486 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030487
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030488 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30489 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000030490 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030491
30492 ret_val = xmlTextReaderStandalone(reader);
30493 desret_int(ret_val);
30494 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000030495 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030496 xmlResetLastError();
30497 if (mem_base != xmlMemBlocks()) {
30498 printf("Leak of %d blocks found in xmlTextReaderStandalone",
30499 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000030500 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030501 printf(" %d", n_reader);
30502 printf("\n");
30503 }
30504 }
30505#endif
30506
Daniel Veillard3d97e662004-11-04 10:49:00 +000030507 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000030508 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030509}
30510
30511
30512static int
30513test_xmlTextReaderValue(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000030514 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030515
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030516#ifdef LIBXML_READER_ENABLED
30517 int mem_base;
30518 xmlChar * ret_val;
30519 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30520 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030521
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030522 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30523 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000030524 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030525
30526 ret_val = xmlTextReaderValue(reader);
30527 desret_xmlChar_ptr(ret_val);
30528 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000030529 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030530 xmlResetLastError();
30531 if (mem_base != xmlMemBlocks()) {
30532 printf("Leak of %d blocks found in xmlTextReaderValue",
30533 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000030534 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030535 printf(" %d", n_reader);
30536 printf("\n");
30537 }
30538 }
30539#endif
30540
Daniel Veillard3d97e662004-11-04 10:49:00 +000030541 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000030542 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030543}
30544
30545
30546static int
30547test_xmlTextReaderXmlLang(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000030548 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030549
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030550#ifdef LIBXML_READER_ENABLED
30551 int mem_base;
30552 xmlChar * ret_val;
30553 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30554 int n_reader;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030555
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030556 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30557 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000030558 reader = gen_xmlTextReaderPtr(n_reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030559
30560 ret_val = xmlTextReaderXmlLang(reader);
30561 desret_xmlChar_ptr(ret_val);
30562 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000030563 des_xmlTextReaderPtr(n_reader, reader, 0);
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030564 xmlResetLastError();
30565 if (mem_base != xmlMemBlocks()) {
30566 printf("Leak of %d blocks found in xmlTextReaderXmlLang",
30567 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000030568 test_ret++;
Daniel Veillarddd6d3002004-11-03 14:20:29 +000030569 printf(" %d", n_reader);
30570 printf("\n");
30571 }
30572 }
30573#endif
30574
Daniel Veillard3d97e662004-11-04 10:49:00 +000030575 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000030576 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030577}
30578
30579static int
30580test_xmlreader(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000030581 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030582
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000030583 printf("Testing xmlreader : 68 of 78 functions ...\n");
Daniel Veillard42595322004-11-08 10:52:06 +000030584 test_ret += test_xmlNewTextReader();
30585 test_ret += test_xmlNewTextReaderFilename();
30586 test_ret += test_xmlReaderForDoc();
30587 test_ret += test_xmlReaderForFile();
30588 test_ret += test_xmlReaderForMemory();
30589 test_ret += test_xmlReaderNewDoc();
30590 test_ret += test_xmlReaderNewFile();
30591 test_ret += test_xmlReaderNewMemory();
30592 test_ret += test_xmlReaderNewWalker();
30593 test_ret += test_xmlReaderWalker();
30594 test_ret += test_xmlTextReaderAttributeCount();
30595 test_ret += test_xmlTextReaderBaseUri();
30596 test_ret += test_xmlTextReaderClose();
30597 test_ret += test_xmlTextReaderConstBaseUri();
30598 test_ret += test_xmlTextReaderConstEncoding();
30599 test_ret += test_xmlTextReaderConstLocalName();
30600 test_ret += test_xmlTextReaderConstName();
30601 test_ret += test_xmlTextReaderConstNamespaceUri();
30602 test_ret += test_xmlTextReaderConstPrefix();
30603 test_ret += test_xmlTextReaderConstString();
30604 test_ret += test_xmlTextReaderConstValue();
30605 test_ret += test_xmlTextReaderConstXmlLang();
30606 test_ret += test_xmlTextReaderConstXmlVersion();
30607 test_ret += test_xmlTextReaderCurrentDoc();
30608 test_ret += test_xmlTextReaderCurrentNode();
30609 test_ret += test_xmlTextReaderDepth();
30610 test_ret += test_xmlTextReaderExpand();
30611 test_ret += test_xmlTextReaderGetAttribute();
30612 test_ret += test_xmlTextReaderGetAttributeNo();
30613 test_ret += test_xmlTextReaderGetAttributeNs();
30614 test_ret += test_xmlTextReaderGetErrorHandler();
30615 test_ret += test_xmlTextReaderGetParserProp();
30616 test_ret += test_xmlTextReaderGetRemainder();
30617 test_ret += test_xmlTextReaderHasAttributes();
30618 test_ret += test_xmlTextReaderHasValue();
30619 test_ret += test_xmlTextReaderIsDefault();
30620 test_ret += test_xmlTextReaderIsEmptyElement();
30621 test_ret += test_xmlTextReaderIsNamespaceDecl();
30622 test_ret += test_xmlTextReaderIsValid();
30623 test_ret += test_xmlTextReaderLocalName();
30624 test_ret += test_xmlTextReaderLocatorBaseURI();
30625 test_ret += test_xmlTextReaderLocatorLineNumber();
30626 test_ret += test_xmlTextReaderLookupNamespace();
30627 test_ret += test_xmlTextReaderMoveToAttribute();
30628 test_ret += test_xmlTextReaderMoveToAttributeNo();
30629 test_ret += test_xmlTextReaderMoveToAttributeNs();
30630 test_ret += test_xmlTextReaderMoveToElement();
30631 test_ret += test_xmlTextReaderMoveToFirstAttribute();
30632 test_ret += test_xmlTextReaderMoveToNextAttribute();
30633 test_ret += test_xmlTextReaderName();
30634 test_ret += test_xmlTextReaderNamespaceUri();
30635 test_ret += test_xmlTextReaderNext();
30636 test_ret += test_xmlTextReaderNextSibling();
30637 test_ret += test_xmlTextReaderNodeType();
30638 test_ret += test_xmlTextReaderNormalization();
30639 test_ret += test_xmlTextReaderPrefix();
30640 test_ret += test_xmlTextReaderPreserve();
30641 test_ret += test_xmlTextReaderPreservePattern();
30642 test_ret += test_xmlTextReaderQuoteChar();
30643 test_ret += test_xmlTextReaderRead();
30644 test_ret += test_xmlTextReaderReadAttributeValue();
30645 test_ret += test_xmlTextReaderReadState();
30646 test_ret += test_xmlTextReaderRelaxNGSetSchema();
30647 test_ret += test_xmlTextReaderRelaxNGValidate();
30648 test_ret += test_xmlTextReaderSetErrorHandler();
30649 test_ret += test_xmlTextReaderSetParserProp();
30650 test_ret += test_xmlTextReaderSetStructuredErrorHandler();
30651 test_ret += test_xmlTextReaderStandalone();
30652 test_ret += test_xmlTextReaderValue();
30653 test_ret += test_xmlTextReaderXmlLang();
Daniel Veillardd93f6252004-11-02 15:53:51 +000030654
Daniel Veillard42595322004-11-08 10:52:06 +000030655 if (test_ret != 0)
30656 printf("Module xmlreader: %d errors\n", test_ret);
30657 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030658}
30659
Daniel Veillarda82b1822004-11-08 16:24:57 +000030660#define gen_nb_xmlRegExecCtxtPtr 1
30661static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30662 return(NULL);
30663}
30664static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30665}
30666
30667static int
30668test_xmlRegExecPushString(void) {
30669 int test_ret = 0;
30670
30671#ifdef LIBXML_REGEXP_ENABLED
30672 int mem_base;
30673 int ret_val;
30674 xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
30675 int n_exec;
30676 xmlChar * value; /* a string token input */
30677 int n_value;
30678 void * data; /* data associated to the token to reuse in callbacks */
30679 int n_data;
30680
30681 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
30682 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
30683 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
30684 mem_base = xmlMemBlocks();
30685 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
30686 value = gen_const_xmlChar_ptr(n_value, 1);
30687 data = gen_userdata(n_data, 2);
30688
30689 ret_val = xmlRegExecPushString(exec, value, data);
30690 desret_int(ret_val);
30691 call_tests++;
30692 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
30693 des_const_xmlChar_ptr(n_value, value, 1);
30694 des_userdata(n_data, data, 2);
30695 xmlResetLastError();
30696 if (mem_base != xmlMemBlocks()) {
30697 printf("Leak of %d blocks found in xmlRegExecPushString",
30698 xmlMemBlocks() - mem_base);
30699 test_ret++;
30700 printf(" %d", n_exec);
30701 printf(" %d", n_value);
30702 printf(" %d", n_data);
30703 printf("\n");
30704 }
30705 }
30706 }
30707 }
30708#endif
30709
30710 function_tests++;
30711 return(test_ret);
30712}
30713
30714
30715static int
30716test_xmlRegExecPushString2(void) {
30717 int test_ret = 0;
30718
30719#ifdef LIBXML_REGEXP_ENABLED
30720 int mem_base;
30721 int ret_val;
30722 xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
30723 int n_exec;
30724 xmlChar * value; /* the first string token input */
30725 int n_value;
30726 xmlChar * value2; /* the second string token input */
30727 int n_value2;
30728 void * data; /* data associated to the token to reuse in callbacks */
30729 int n_data;
30730
30731 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
30732 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
30733 for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
30734 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
30735 mem_base = xmlMemBlocks();
30736 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
30737 value = gen_const_xmlChar_ptr(n_value, 1);
30738 value2 = gen_const_xmlChar_ptr(n_value2, 2);
30739 data = gen_userdata(n_data, 3);
30740
30741 ret_val = xmlRegExecPushString2(exec, value, value2, data);
30742 desret_int(ret_val);
30743 call_tests++;
30744 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
30745 des_const_xmlChar_ptr(n_value, value, 1);
30746 des_const_xmlChar_ptr(n_value2, value2, 2);
30747 des_userdata(n_data, data, 3);
30748 xmlResetLastError();
30749 if (mem_base != xmlMemBlocks()) {
30750 printf("Leak of %d blocks found in xmlRegExecPushString2",
30751 xmlMemBlocks() - mem_base);
30752 test_ret++;
30753 printf(" %d", n_exec);
30754 printf(" %d", n_value);
30755 printf(" %d", n_value2);
30756 printf(" %d", n_data);
30757 printf("\n");
30758 }
30759 }
30760 }
30761 }
30762 }
30763#endif
30764
30765 function_tests++;
30766 return(test_ret);
30767}
30768
30769
30770#define gen_nb_xmlRegexpPtr 1
30771static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30772 return(NULL);
30773}
30774static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30775}
30776
30777static int
30778test_xmlRegNewExecCtxt(void) {
30779 int test_ret = 0;
30780
30781
30782 /* missing type support */
30783 return(test_ret);
30784}
30785
30786
30787static int
30788test_xmlRegexpCompile(void) {
30789 int test_ret = 0;
30790
30791
30792 /* missing type support */
30793 return(test_ret);
30794}
30795
30796
30797static int
30798test_xmlRegexpExec(void) {
30799 int test_ret = 0;
30800
30801#ifdef LIBXML_REGEXP_ENABLED
30802 int mem_base;
30803 int ret_val;
30804 xmlRegexpPtr comp; /* the compiled regular expression */
30805 int n_comp;
30806 xmlChar * content; /* the value to check against the regular expression */
30807 int n_content;
30808
30809 for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
30810 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
30811 mem_base = xmlMemBlocks();
30812 comp = gen_xmlRegexpPtr(n_comp, 0);
30813 content = gen_const_xmlChar_ptr(n_content, 1);
30814
30815 ret_val = xmlRegexpExec(comp, content);
30816 desret_int(ret_val);
30817 call_tests++;
30818 des_xmlRegexpPtr(n_comp, comp, 0);
30819 des_const_xmlChar_ptr(n_content, content, 1);
30820 xmlResetLastError();
30821 if (mem_base != xmlMemBlocks()) {
30822 printf("Leak of %d blocks found in xmlRegexpExec",
30823 xmlMemBlocks() - mem_base);
30824 test_ret++;
30825 printf(" %d", n_comp);
30826 printf(" %d", n_content);
30827 printf("\n");
30828 }
30829 }
30830 }
30831#endif
30832
30833 function_tests++;
30834 return(test_ret);
30835}
30836
30837
30838static int
30839test_xmlRegexpIsDeterminist(void) {
30840 int test_ret = 0;
30841
30842#ifdef LIBXML_REGEXP_ENABLED
30843 int mem_base;
30844 int ret_val;
30845 xmlRegexpPtr comp; /* the compiled regular expression */
30846 int n_comp;
30847
30848 for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
30849 mem_base = xmlMemBlocks();
30850 comp = gen_xmlRegexpPtr(n_comp, 0);
30851
30852 ret_val = xmlRegexpIsDeterminist(comp);
30853 desret_int(ret_val);
30854 call_tests++;
30855 des_xmlRegexpPtr(n_comp, comp, 0);
30856 xmlResetLastError();
30857 if (mem_base != xmlMemBlocks()) {
30858 printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
30859 xmlMemBlocks() - mem_base);
30860 test_ret++;
30861 printf(" %d", n_comp);
30862 printf("\n");
30863 }
30864 }
30865#endif
30866
30867 function_tests++;
30868 return(test_ret);
30869}
30870
30871
30872static int
30873test_xmlRegexpPrint(void) {
30874 int test_ret = 0;
30875
30876#ifdef LIBXML_REGEXP_ENABLED
30877 int mem_base;
30878 FILE * output; /* the file for the output debug */
30879 int n_output;
30880 xmlRegexpPtr regexp; /* the compiled regexp */
30881 int n_regexp;
30882
30883 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
30884 for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
30885 mem_base = xmlMemBlocks();
30886 output = gen_FILE_ptr(n_output, 0);
30887 regexp = gen_xmlRegexpPtr(n_regexp, 1);
30888
30889 xmlRegexpPrint(output, regexp);
30890 call_tests++;
30891 des_FILE_ptr(n_output, output, 0);
30892 des_xmlRegexpPtr(n_regexp, regexp, 1);
30893 xmlResetLastError();
30894 if (mem_base != xmlMemBlocks()) {
30895 printf("Leak of %d blocks found in xmlRegexpPrint",
30896 xmlMemBlocks() - mem_base);
30897 test_ret++;
30898 printf(" %d", n_output);
30899 printf(" %d", n_regexp);
30900 printf("\n");
30901 }
30902 }
30903 }
30904#endif
30905
30906 function_tests++;
30907 return(test_ret);
30908}
30909
30910static int
30911test_xmlregexp(void) {
30912 int test_ret = 0;
30913
30914 printf("Testing xmlregexp : 5 of 9 functions ...\n");
30915 test_ret += test_xmlRegExecPushString();
30916 test_ret += test_xmlRegExecPushString2();
30917 test_ret += test_xmlRegNewExecCtxt();
30918 test_ret += test_xmlRegexpCompile();
30919 test_ret += test_xmlRegexpExec();
30920 test_ret += test_xmlRegexpIsDeterminist();
30921 test_ret += test_xmlRegexpPrint();
30922
30923 if (test_ret != 0)
30924 printf("Module xmlregexp: %d errors\n", test_ret);
30925 return(test_ret);
30926}
30927
Daniel Veillardce682bc2004-11-05 17:22:25 +000030928#define gen_nb_xmlSaveCtxtPtr 1
30929static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30930 return(NULL);
30931}
30932static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30933}
30934
Daniel Veillardd93f6252004-11-02 15:53:51 +000030935static int
Daniel Veillardd93f6252004-11-02 15:53:51 +000030936test_xmlSaveClose(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000030937 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030938
Daniel Veillardce682bc2004-11-05 17:22:25 +000030939#ifdef LIBXML_OUTPUT_ENABLED
30940 int mem_base;
30941 int ret_val;
30942 xmlSaveCtxtPtr ctxt; /* a document saving context */
30943 int n_ctxt;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030944
Daniel Veillardce682bc2004-11-05 17:22:25 +000030945 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
30946 mem_base = xmlMemBlocks();
30947 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
30948
30949 ret_val = xmlSaveClose(ctxt);
30950 desret_int(ret_val);
30951 call_tests++;
30952 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
30953 xmlResetLastError();
30954 if (mem_base != xmlMemBlocks()) {
30955 printf("Leak of %d blocks found in xmlSaveClose",
30956 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000030957 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000030958 printf(" %d", n_ctxt);
30959 printf("\n");
30960 }
30961 }
30962#endif
30963
30964 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000030965 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000030966}
30967
30968
30969static int
30970test_xmlSaveDoc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000030971 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030972
Daniel Veillardce682bc2004-11-05 17:22:25 +000030973#ifdef LIBXML_OUTPUT_ENABLED
30974 int mem_base;
30975 long ret_val;
30976 xmlSaveCtxtPtr ctxt; /* a document saving context */
30977 int n_ctxt;
30978 xmlDocPtr doc; /* a document */
30979 int n_doc;
Daniel Veillardd93f6252004-11-02 15:53:51 +000030980
Daniel Veillardce682bc2004-11-05 17:22:25 +000030981 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
30982 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30983 mem_base = xmlMemBlocks();
30984 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
30985 doc = gen_xmlDocPtr(n_doc, 1);
30986
30987 ret_val = xmlSaveDoc(ctxt, doc);
30988 desret_long(ret_val);
30989 call_tests++;
30990 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
30991 des_xmlDocPtr(n_doc, doc, 1);
30992 xmlResetLastError();
30993 if (mem_base != xmlMemBlocks()) {
30994 printf("Leak of %d blocks found in xmlSaveDoc",
30995 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000030996 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000030997 printf(" %d", n_ctxt);
30998 printf(" %d", n_doc);
30999 printf("\n");
31000 }
31001 }
31002 }
31003#endif
31004
31005 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000031006 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031007}
31008
31009
31010static int
31011test_xmlSaveFlush(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031012 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031013
Daniel Veillardce682bc2004-11-05 17:22:25 +000031014#ifdef LIBXML_OUTPUT_ENABLED
31015 int mem_base;
31016 int ret_val;
31017 xmlSaveCtxtPtr ctxt; /* a document saving context */
31018 int n_ctxt;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031019
Daniel Veillardce682bc2004-11-05 17:22:25 +000031020 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
31021 mem_base = xmlMemBlocks();
31022 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
31023
31024 ret_val = xmlSaveFlush(ctxt);
31025 desret_int(ret_val);
31026 call_tests++;
31027 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
31028 xmlResetLastError();
31029 if (mem_base != xmlMemBlocks()) {
31030 printf("Leak of %d blocks found in xmlSaveFlush",
31031 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000031032 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000031033 printf(" %d", n_ctxt);
31034 printf("\n");
31035 }
31036 }
31037#endif
31038
31039 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000031040 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031041}
31042
31043
31044static int
31045test_xmlSaveSetAttrEscape(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031046 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031047
31048
31049 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000031050 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031051}
31052
31053
31054static int
31055test_xmlSaveSetEscape(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031056 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031057
31058
31059 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000031060 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031061}
31062
31063
31064static int
31065test_xmlSaveToFd(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031066 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031067
31068
31069 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000031070 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031071}
31072
31073
31074static int
31075test_xmlSaveToFilename(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031076 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031077
31078
31079 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000031080 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031081}
31082
31083
31084static int
31085test_xmlSaveTree(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031086 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031087
Daniel Veillardce682bc2004-11-05 17:22:25 +000031088#ifdef LIBXML_OUTPUT_ENABLED
31089 int mem_base;
31090 long ret_val;
31091 xmlSaveCtxtPtr ctxt; /* a document saving context */
31092 int n_ctxt;
31093 xmlNodePtr node; /* a document */
31094 int n_node;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031095
Daniel Veillardce682bc2004-11-05 17:22:25 +000031096 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
31097 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
31098 mem_base = xmlMemBlocks();
31099 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
31100 node = gen_xmlNodePtr(n_node, 1);
31101
31102 ret_val = xmlSaveTree(ctxt, node);
31103 desret_long(ret_val);
31104 call_tests++;
31105 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
31106 des_xmlNodePtr(n_node, node, 1);
31107 xmlResetLastError();
31108 if (mem_base != xmlMemBlocks()) {
31109 printf("Leak of %d blocks found in xmlSaveTree",
31110 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000031111 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000031112 printf(" %d", n_ctxt);
31113 printf(" %d", n_node);
31114 printf("\n");
31115 }
31116 }
31117 }
31118#endif
31119
31120 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000031121 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031122}
31123
31124static int
31125test_xmlsave(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031126 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031127
Daniel Veillardce682bc2004-11-05 17:22:25 +000031128 printf("Testing xmlsave : 4 of 9 functions ...\n");
Daniel Veillard42595322004-11-08 10:52:06 +000031129 test_ret += test_xmlSaveClose();
31130 test_ret += test_xmlSaveDoc();
31131 test_ret += test_xmlSaveFlush();
31132 test_ret += test_xmlSaveSetAttrEscape();
31133 test_ret += test_xmlSaveSetEscape();
31134 test_ret += test_xmlSaveToFd();
31135 test_ret += test_xmlSaveToFilename();
31136 test_ret += test_xmlSaveTree();
Daniel Veillardd93f6252004-11-02 15:53:51 +000031137
Daniel Veillard42595322004-11-08 10:52:06 +000031138 if (test_ret != 0)
31139 printf("Module xmlsave: %d errors\n", test_ret);
31140 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031141}
31142
Daniel Veillardce682bc2004-11-05 17:22:25 +000031143#define gen_nb_xmlSchemaPtr 1
31144static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31145 return(NULL);
31146}
31147static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31148}
31149
Daniel Veillardd93f6252004-11-02 15:53:51 +000031150static int
31151test_xmlSchemaDump(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031152 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031153
Daniel Veillardce682bc2004-11-05 17:22:25 +000031154#ifdef LIBXML_SCHEMAS_ENABLED
31155#ifdef LIBXML_OUTPUT_ENABLED
31156 int mem_base;
31157 FILE * output; /* the file output */
31158 int n_output;
31159 xmlSchemaPtr schema; /* a schema structure */
31160 int n_schema;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031161
Daniel Veillardce682bc2004-11-05 17:22:25 +000031162 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
31163 for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
31164 mem_base = xmlMemBlocks();
31165 output = gen_FILE_ptr(n_output, 0);
31166 schema = gen_xmlSchemaPtr(n_schema, 1);
31167
31168 xmlSchemaDump(output, schema);
31169 call_tests++;
31170 des_FILE_ptr(n_output, output, 0);
31171 des_xmlSchemaPtr(n_schema, schema, 1);
31172 xmlResetLastError();
31173 if (mem_base != xmlMemBlocks()) {
31174 printf("Leak of %d blocks found in xmlSchemaDump",
31175 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000031176 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000031177 printf(" %d", n_output);
31178 printf(" %d", n_schema);
31179 printf("\n");
31180 }
31181 }
31182 }
31183#endif
31184#endif
31185
31186 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000031187 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031188}
31189
31190
Daniel Veillardce682bc2004-11-05 17:22:25 +000031191#define gen_nb_xmlSchemaParserCtxtPtr 1
31192static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31193 return(NULL);
31194}
31195static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31196}
31197
31198#define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
31199static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31200 return(NULL);
31201}
31202static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31203}
31204
31205#define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
31206static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31207 return(NULL);
31208}
31209static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31210}
31211
Daniel Veillardd93f6252004-11-02 15:53:51 +000031212static int
31213test_xmlSchemaGetParserErrors(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031214 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031215
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000031216#ifdef LIBXML_SCHEMAS_ENABLED
31217 int mem_base;
31218 int ret_val;
31219 xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
31220 int n_ctxt;
31221 xmlSchemaValidityErrorFunc * err; /* the error callback result */
31222 int n_err;
31223 xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
31224 int n_warn;
31225 void ** ctx; /* contextual data for the callbacks result */
31226 int n_ctx;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031227
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000031228 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
31229 for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
31230 for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
31231 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
31232 mem_base = xmlMemBlocks();
31233 ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
31234 err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
31235 warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
31236 ctx = gen_void_ptr_ptr(n_ctx, 3);
31237
31238 ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
31239 desret_int(ret_val);
31240 call_tests++;
31241 des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
31242 des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
31243 des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
31244 des_void_ptr_ptr(n_ctx, ctx, 3);
31245 xmlResetLastError();
31246 if (mem_base != xmlMemBlocks()) {
31247 printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
31248 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000031249 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000031250 printf(" %d", n_ctxt);
31251 printf(" %d", n_err);
31252 printf(" %d", n_warn);
31253 printf(" %d", n_ctx);
31254 printf("\n");
31255 }
31256 }
31257 }
31258 }
31259 }
31260#endif
31261
31262 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000031263 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031264}
31265
31266
Daniel Veillardce682bc2004-11-05 17:22:25 +000031267#define gen_nb_xmlSchemaValidCtxtPtr 1
31268static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31269 return(NULL);
31270}
31271static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31272}
31273
Daniel Veillardd93f6252004-11-02 15:53:51 +000031274static int
31275test_xmlSchemaGetValidErrors(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031276 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031277
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000031278#ifdef LIBXML_SCHEMAS_ENABLED
31279 int mem_base;
31280 int ret_val;
31281 xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
31282 int n_ctxt;
31283 xmlSchemaValidityErrorFunc * err; /* the error function result */
31284 int n_err;
31285 xmlSchemaValidityWarningFunc * warn; /* the warning function result */
31286 int n_warn;
31287 void ** ctx; /* the functions context result */
31288 int n_ctx;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031289
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000031290 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
31291 for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
31292 for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
31293 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
31294 mem_base = xmlMemBlocks();
31295 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
31296 err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
31297 warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
31298 ctx = gen_void_ptr_ptr(n_ctx, 3);
31299
31300 ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
31301 desret_int(ret_val);
31302 call_tests++;
31303 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
31304 des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
31305 des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
31306 des_void_ptr_ptr(n_ctx, ctx, 3);
31307 xmlResetLastError();
31308 if (mem_base != xmlMemBlocks()) {
31309 printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
31310 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000031311 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000031312 printf(" %d", n_ctxt);
31313 printf(" %d", n_err);
31314 printf(" %d", n_warn);
31315 printf(" %d", n_ctx);
31316 printf("\n");
31317 }
31318 }
31319 }
31320 }
31321 }
31322#endif
31323
31324 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000031325 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031326}
31327
31328
31329static int
31330test_xmlSchemaNewDocParserCtxt(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031331 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031332
Daniel Veillard42595322004-11-08 10:52:06 +000031333#ifdef LIBXML_SCHEMAS_ENABLED
31334 int mem_base;
31335 xmlSchemaParserCtxtPtr ret_val;
31336 xmlDocPtr doc; /* a preparsed document tree */
31337 int n_doc;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031338
Daniel Veillard42595322004-11-08 10:52:06 +000031339 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
31340 mem_base = xmlMemBlocks();
31341 doc = gen_xmlDocPtr(n_doc, 0);
31342
31343 ret_val = xmlSchemaNewDocParserCtxt(doc);
31344 desret_xmlSchemaParserCtxtPtr(ret_val);
31345 call_tests++;
31346 des_xmlDocPtr(n_doc, doc, 0);
31347 xmlResetLastError();
31348 if (mem_base != xmlMemBlocks()) {
31349 printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
31350 xmlMemBlocks() - mem_base);
31351 test_ret++;
31352 printf(" %d", n_doc);
31353 printf("\n");
31354 }
31355 }
31356#endif
31357
31358 function_tests++;
31359 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031360}
31361
31362
31363static int
31364test_xmlSchemaNewMemParserCtxt(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031365 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031366
Daniel Veillard42595322004-11-08 10:52:06 +000031367#ifdef LIBXML_SCHEMAS_ENABLED
31368 int mem_base;
31369 xmlSchemaParserCtxtPtr ret_val;
31370 char * buffer; /* a pointer to a char array containing the schemas */
31371 int n_buffer;
31372 int size; /* the size of the array */
31373 int n_size;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031374
Daniel Veillard42595322004-11-08 10:52:06 +000031375 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
31376 for (n_size = 0;n_size < gen_nb_int;n_size++) {
31377 mem_base = xmlMemBlocks();
31378 buffer = gen_const_char_ptr(n_buffer, 0);
31379 size = gen_int(n_size, 1);
31380
31381 ret_val = xmlSchemaNewMemParserCtxt(buffer, size);
31382 desret_xmlSchemaParserCtxtPtr(ret_val);
31383 call_tests++;
31384 des_const_char_ptr(n_buffer, buffer, 0);
31385 des_int(n_size, size, 1);
31386 xmlResetLastError();
31387 if (mem_base != xmlMemBlocks()) {
31388 printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
31389 xmlMemBlocks() - mem_base);
31390 test_ret++;
31391 printf(" %d", n_buffer);
31392 printf(" %d", n_size);
31393 printf("\n");
31394 }
31395 }
31396 }
31397#endif
31398
31399 function_tests++;
31400 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031401}
31402
31403
31404static int
31405test_xmlSchemaNewParserCtxt(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031406 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031407
Daniel Veillard42595322004-11-08 10:52:06 +000031408#ifdef LIBXML_SCHEMAS_ENABLED
31409 int mem_base;
31410 xmlSchemaParserCtxtPtr ret_val;
31411 char * URL; /* the location of the schema */
31412 int n_URL;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031413
Daniel Veillard42595322004-11-08 10:52:06 +000031414 for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
31415 mem_base = xmlMemBlocks();
31416 URL = gen_const_char_ptr(n_URL, 0);
31417
31418 ret_val = xmlSchemaNewParserCtxt(URL);
31419 desret_xmlSchemaParserCtxtPtr(ret_val);
31420 call_tests++;
31421 des_const_char_ptr(n_URL, URL, 0);
31422 xmlResetLastError();
31423 if (mem_base != xmlMemBlocks()) {
31424 printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
31425 xmlMemBlocks() - mem_base);
31426 test_ret++;
31427 printf(" %d", n_URL);
31428 printf("\n");
31429 }
31430 }
31431#endif
31432
31433 function_tests++;
31434 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031435}
31436
31437
31438static int
31439test_xmlSchemaNewValidCtxt(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031440 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031441
31442
31443 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000031444 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031445}
31446
31447
31448static int
31449test_xmlSchemaParse(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031450 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031451
31452
31453 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000031454 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031455}
31456
31457
31458static int
31459test_xmlSchemaSetParserErrors(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031460 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031461
31462
31463 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000031464 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031465}
31466
31467
31468static int
31469test_xmlSchemaSetValidErrors(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031470 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031471
31472
31473 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000031474 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031475}
31476
31477
31478static int
31479test_xmlSchemaSetValidOptions(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031480 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031481
Daniel Veillardce682bc2004-11-05 17:22:25 +000031482#ifdef LIBXML_SCHEMAS_ENABLED
31483 int mem_base;
31484 int ret_val;
31485 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
31486 int n_ctxt;
31487 int options; /* a combination of xmlSchemaValidOption */
31488 int n_options;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031489
Daniel Veillardce682bc2004-11-05 17:22:25 +000031490 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
31491 for (n_options = 0;n_options < gen_nb_int;n_options++) {
31492 mem_base = xmlMemBlocks();
31493 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
31494 options = gen_int(n_options, 1);
31495
31496 ret_val = xmlSchemaSetValidOptions(ctxt, options);
31497 desret_int(ret_val);
31498 call_tests++;
31499 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
31500 des_int(n_options, options, 1);
31501 xmlResetLastError();
31502 if (mem_base != xmlMemBlocks()) {
31503 printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
31504 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000031505 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000031506 printf(" %d", n_ctxt);
31507 printf(" %d", n_options);
31508 printf("\n");
31509 }
31510 }
31511 }
31512#endif
31513
31514 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000031515 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031516}
31517
31518
31519static int
31520test_xmlSchemaValidCtxtGetOptions(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031521 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031522
Daniel Veillardce682bc2004-11-05 17:22:25 +000031523#ifdef LIBXML_SCHEMAS_ENABLED
31524 int mem_base;
31525 int ret_val;
31526 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
31527 int n_ctxt;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031528
Daniel Veillardce682bc2004-11-05 17:22:25 +000031529 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
31530 mem_base = xmlMemBlocks();
31531 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
31532
31533 ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
31534 desret_int(ret_val);
31535 call_tests++;
31536 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
31537 xmlResetLastError();
31538 if (mem_base != xmlMemBlocks()) {
31539 printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
31540 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000031541 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000031542 printf(" %d", n_ctxt);
31543 printf("\n");
31544 }
31545 }
31546#endif
31547
31548 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000031549 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031550}
31551
31552
31553static int
31554test_xmlSchemaValidateDoc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031555 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031556
Daniel Veillardce682bc2004-11-05 17:22:25 +000031557#ifdef LIBXML_SCHEMAS_ENABLED
31558 int mem_base;
31559 int ret_val;
31560 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
31561 int n_ctxt;
31562 xmlDocPtr doc; /* a parsed document tree */
31563 int n_doc;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031564
Daniel Veillardce682bc2004-11-05 17:22:25 +000031565 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
31566 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
31567 mem_base = xmlMemBlocks();
31568 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
31569 doc = gen_xmlDocPtr(n_doc, 1);
31570
31571 ret_val = xmlSchemaValidateDoc(ctxt, doc);
31572 desret_int(ret_val);
31573 call_tests++;
31574 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
31575 des_xmlDocPtr(n_doc, doc, 1);
31576 xmlResetLastError();
31577 if (mem_base != xmlMemBlocks()) {
31578 printf("Leak of %d blocks found in xmlSchemaValidateDoc",
31579 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000031580 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000031581 printf(" %d", n_ctxt);
31582 printf(" %d", n_doc);
31583 printf("\n");
31584 }
31585 }
31586 }
31587#endif
31588
31589 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000031590 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031591}
31592
31593
31594static int
31595test_xmlSchemaValidateOneElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031596 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031597
Daniel Veillardce682bc2004-11-05 17:22:25 +000031598#ifdef LIBXML_SCHEMAS_ENABLED
31599 int mem_base;
31600 int ret_val;
31601 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
31602 int n_ctxt;
31603 xmlNodePtr elem; /* an element node */
31604 int n_elem;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031605
Daniel Veillardce682bc2004-11-05 17:22:25 +000031606 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
31607 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
31608 mem_base = xmlMemBlocks();
31609 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
31610 elem = gen_xmlNodePtr(n_elem, 1);
31611
31612 ret_val = xmlSchemaValidateOneElement(ctxt, elem);
31613 desret_int(ret_val);
31614 call_tests++;
31615 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
31616 des_xmlNodePtr(n_elem, elem, 1);
31617 xmlResetLastError();
31618 if (mem_base != xmlMemBlocks()) {
31619 printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
31620 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000031621 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000031622 printf(" %d", n_ctxt);
31623 printf(" %d", n_elem);
31624 printf("\n");
31625 }
31626 }
31627 }
31628#endif
31629
31630 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000031631 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031632}
31633
31634
31635static int
31636test_xmlSchemaValidateStream(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031637 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031638
Daniel Veillardce682bc2004-11-05 17:22:25 +000031639#ifdef LIBXML_SCHEMAS_ENABLED
31640 int mem_base;
31641 int ret_val;
31642 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
31643 int n_ctxt;
31644 xmlParserInputBufferPtr input; /* the input to use for reading the data */
31645 int n_input;
31646 xmlCharEncoding enc; /* an optional encoding information */
31647 int n_enc;
31648 xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
31649 int n_sax;
31650 void * user_data; /* the context to provide to the SAX handler. */
31651 int n_user_data;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031652
Daniel Veillardce682bc2004-11-05 17:22:25 +000031653 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
31654 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
31655 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
31656 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
31657 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
31658 mem_base = xmlMemBlocks();
31659 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
31660 input = gen_xmlParserInputBufferPtr(n_input, 1);
31661 enc = gen_xmlCharEncoding(n_enc, 2);
31662 sax = gen_xmlSAXHandlerPtr(n_sax, 3);
31663 user_data = gen_userdata(n_user_data, 4);
31664
31665 ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
31666 desret_int(ret_val);
31667 call_tests++;
31668 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
31669 des_xmlParserInputBufferPtr(n_input, input, 1);
31670 des_xmlCharEncoding(n_enc, enc, 2);
31671 des_xmlSAXHandlerPtr(n_sax, sax, 3);
31672 des_userdata(n_user_data, user_data, 4);
31673 xmlResetLastError();
31674 if (mem_base != xmlMemBlocks()) {
31675 printf("Leak of %d blocks found in xmlSchemaValidateStream",
31676 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000031677 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000031678 printf(" %d", n_ctxt);
31679 printf(" %d", n_input);
31680 printf(" %d", n_enc);
31681 printf(" %d", n_sax);
31682 printf(" %d", n_user_data);
31683 printf("\n");
31684 }
31685 }
31686 }
31687 }
31688 }
31689 }
31690#endif
31691
31692 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000031693 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031694}
31695
31696static int
31697test_xmlschemas(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031698 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031699
Daniel Veillard42595322004-11-08 10:52:06 +000031700 printf("Testing xmlschemas : 11 of 18 functions ...\n");
31701 test_ret += test_xmlSchemaDump();
31702 test_ret += test_xmlSchemaGetParserErrors();
31703 test_ret += test_xmlSchemaGetValidErrors();
31704 test_ret += test_xmlSchemaNewDocParserCtxt();
31705 test_ret += test_xmlSchemaNewMemParserCtxt();
31706 test_ret += test_xmlSchemaNewParserCtxt();
31707 test_ret += test_xmlSchemaNewValidCtxt();
31708 test_ret += test_xmlSchemaParse();
31709 test_ret += test_xmlSchemaSetParserErrors();
31710 test_ret += test_xmlSchemaSetValidErrors();
31711 test_ret += test_xmlSchemaSetValidOptions();
31712 test_ret += test_xmlSchemaValidCtxtGetOptions();
31713 test_ret += test_xmlSchemaValidateDoc();
31714 test_ret += test_xmlSchemaValidateOneElement();
31715 test_ret += test_xmlSchemaValidateStream();
Daniel Veillardd93f6252004-11-02 15:53:51 +000031716
Daniel Veillard42595322004-11-08 10:52:06 +000031717 if (test_ret != 0)
31718 printf("Module xmlschemas: %d errors\n", test_ret);
31719 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031720}
31721
Daniel Veillardce682bc2004-11-05 17:22:25 +000031722#define gen_nb_xmlSchemaFacetPtr 1
31723static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31724 return(NULL);
31725}
31726static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31727}
31728
31729#define gen_nb_xmlSchemaTypePtr 1
31730static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31731 return(NULL);
31732}
31733static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31734}
31735
Daniel Veillardd93f6252004-11-02 15:53:51 +000031736static int
31737test_xmlSchemaCheckFacet(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031738 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031739
Daniel Veillardce682bc2004-11-05 17:22:25 +000031740#ifdef LIBXML_SCHEMAS_ENABLED
31741 int mem_base;
31742 int ret_val;
31743 xmlSchemaFacetPtr facet; /* the facet */
31744 int n_facet;
31745 xmlSchemaTypePtr typeDecl; /* the schema type definition */
31746 int n_typeDecl;
31747 xmlSchemaParserCtxtPtr ctxt; /* the schema parser context or NULL */
31748 int n_ctxt;
31749 xmlChar * name; /* name of the type */
31750 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031751
Daniel Veillardce682bc2004-11-05 17:22:25 +000031752 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
31753 for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
31754 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
31755 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31756 mem_base = xmlMemBlocks();
31757 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
31758 typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
31759 ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 2);
31760 name = gen_const_xmlChar_ptr(n_name, 3);
31761
31762 ret_val = xmlSchemaCheckFacet(facet, typeDecl, ctxt, name);
31763 desret_int(ret_val);
31764 call_tests++;
31765 des_xmlSchemaFacetPtr(n_facet, facet, 0);
31766 des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
31767 des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 2);
31768 des_const_xmlChar_ptr(n_name, name, 3);
31769 xmlResetLastError();
31770 if (mem_base != xmlMemBlocks()) {
31771 printf("Leak of %d blocks found in xmlSchemaCheckFacet",
31772 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000031773 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000031774 printf(" %d", n_facet);
31775 printf(" %d", n_typeDecl);
31776 printf(" %d", n_ctxt);
31777 printf(" %d", n_name);
31778 printf("\n");
31779 }
31780 }
31781 }
31782 }
31783 }
31784#endif
31785
31786 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000031787 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031788}
31789
31790
31791static int
31792test_xmlSchemaCleanupTypes(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031793 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031794
31795#ifdef LIBXML_SCHEMAS_ENABLED
31796 int mem_base;
31797
31798 mem_base = xmlMemBlocks();
31799
31800 xmlSchemaCleanupTypes();
31801 call_tests++;
31802 xmlResetLastError();
31803 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000031804 printf("Leak of %d blocks found in xmlSchemaCleanupTypes",
Daniel Veillardd93f6252004-11-02 15:53:51 +000031805 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000031806 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000031807 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000031808 }
31809#endif
31810
Daniel Veillard3d97e662004-11-04 10:49:00 +000031811 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000031812 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031813}
31814
31815
31816static int
31817test_xmlSchemaCollapseString(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031818 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031819
Daniel Veillard8a32fe42004-11-02 22:10:16 +000031820#ifdef LIBXML_SCHEMAS_ENABLED
31821 int mem_base;
31822 xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000031823 xmlChar * value; /* a value */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000031824 int n_value;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031825
Daniel Veillard8a32fe42004-11-02 22:10:16 +000031826 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
31827 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000031828 value = gen_const_xmlChar_ptr(n_value, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000031829
31830 ret_val = xmlSchemaCollapseString(value);
31831 desret_xmlChar_ptr(ret_val);
31832 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000031833 des_const_xmlChar_ptr(n_value, value, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000031834 xmlResetLastError();
31835 if (mem_base != xmlMemBlocks()) {
31836 printf("Leak of %d blocks found in xmlSchemaCollapseString",
31837 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000031838 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000031839 printf(" %d", n_value);
31840 printf("\n");
31841 }
31842 }
31843#endif
31844
Daniel Veillard3d97e662004-11-04 10:49:00 +000031845 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000031846 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031847}
31848
31849
Daniel Veillardce682bc2004-11-05 17:22:25 +000031850#define gen_nb_xmlSchemaValPtr 1
31851static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31852 return(NULL);
31853}
31854static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31855}
31856
Daniel Veillardd93f6252004-11-02 15:53:51 +000031857static int
31858test_xmlSchemaCompareValues(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031859 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031860
Daniel Veillardce682bc2004-11-05 17:22:25 +000031861#ifdef LIBXML_SCHEMAS_ENABLED
31862 int mem_base;
31863 int ret_val;
31864 xmlSchemaValPtr x; /* a first value */
31865 int n_x;
31866 xmlSchemaValPtr y; /* a second value */
31867 int n_y;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031868
Daniel Veillardce682bc2004-11-05 17:22:25 +000031869 for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
31870 for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
31871 mem_base = xmlMemBlocks();
31872 x = gen_xmlSchemaValPtr(n_x, 0);
31873 y = gen_xmlSchemaValPtr(n_y, 1);
31874
31875 ret_val = xmlSchemaCompareValues(x, y);
31876 desret_int(ret_val);
31877 call_tests++;
31878 des_xmlSchemaValPtr(n_x, x, 0);
31879 des_xmlSchemaValPtr(n_y, y, 1);
31880 xmlResetLastError();
31881 if (mem_base != xmlMemBlocks()) {
31882 printf("Leak of %d blocks found in xmlSchemaCompareValues",
31883 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000031884 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000031885 printf(" %d", n_x);
31886 printf(" %d", n_y);
31887 printf("\n");
31888 }
31889 }
31890 }
31891#endif
31892
31893 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000031894 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031895}
31896
31897
31898static int
31899test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031900 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031901
Daniel Veillard42595322004-11-08 10:52:06 +000031902#ifdef LIBXML_SCHEMAS_ENABLED
31903 int mem_base;
31904 xmlSchemaTypePtr ret_val;
31905 xmlSchemaTypePtr type; /* the built-in simple type. */
31906 int n_type;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031907
Daniel Veillard42595322004-11-08 10:52:06 +000031908 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
31909 mem_base = xmlMemBlocks();
31910 type = gen_xmlSchemaTypePtr(n_type, 0);
31911
31912 ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
31913 desret_xmlSchemaTypePtr(ret_val);
31914 call_tests++;
31915 des_xmlSchemaTypePtr(n_type, type, 0);
31916 xmlResetLastError();
31917 if (mem_base != xmlMemBlocks()) {
31918 printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
31919 xmlMemBlocks() - mem_base);
31920 test_ret++;
31921 printf(" %d", n_type);
31922 printf("\n");
31923 }
31924 }
31925#endif
31926
31927 function_tests++;
31928 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031929}
31930
31931
31932static int
31933test_xmlSchemaGetBuiltInType(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031934 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031935
Daniel Veillard42595322004-11-08 10:52:06 +000031936#ifdef LIBXML_SCHEMAS_ENABLED
31937 xmlSchemaTypePtr ret_val;
31938 xmlSchemaValType type; /* the type of the built in type */
31939 int n_type;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031940
Daniel Veillard42595322004-11-08 10:52:06 +000031941 for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
31942 type = gen_xmlSchemaValType(n_type, 0);
31943
31944 ret_val = xmlSchemaGetBuiltInType(type);
31945 desret_xmlSchemaTypePtr(ret_val);
31946 call_tests++;
31947 des_xmlSchemaValType(n_type, type, 0);
31948 xmlResetLastError();
31949 }
31950#endif
31951
31952 function_tests++;
31953 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031954}
31955
31956
31957static int
31958test_xmlSchemaGetFacetValueAsULong(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031959 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031960
31961
31962 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000031963 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000031964}
31965
31966
31967static int
31968test_xmlSchemaGetPredefinedType(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000031969 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031970
Daniel Veillard42595322004-11-08 10:52:06 +000031971#ifdef LIBXML_SCHEMAS_ENABLED
31972 int mem_base;
31973 xmlSchemaTypePtr ret_val;
31974 xmlChar * name; /* the type name */
31975 int n_name;
31976 xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
31977 int n_ns;
Daniel Veillardd93f6252004-11-02 15:53:51 +000031978
Daniel Veillard42595322004-11-08 10:52:06 +000031979 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31980 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
31981 mem_base = xmlMemBlocks();
31982 name = gen_const_xmlChar_ptr(n_name, 0);
31983 ns = gen_const_xmlChar_ptr(n_ns, 1);
31984
31985 ret_val = xmlSchemaGetPredefinedType(name, ns);
31986 desret_xmlSchemaTypePtr(ret_val);
31987 call_tests++;
31988 des_const_xmlChar_ptr(n_name, name, 0);
31989 des_const_xmlChar_ptr(n_ns, ns, 1);
31990 xmlResetLastError();
31991 if (mem_base != xmlMemBlocks()) {
31992 printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
31993 xmlMemBlocks() - mem_base);
31994 test_ret++;
31995 printf(" %d", n_name);
31996 printf(" %d", n_ns);
31997 printf("\n");
31998 }
31999 }
32000 }
32001#endif
32002
32003 function_tests++;
32004 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032005}
32006
32007
32008static int
32009test_xmlSchemaInitTypes(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032010 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032011
32012#ifdef LIBXML_SCHEMAS_ENABLED
32013
32014
32015 xmlSchemaInitTypes();
32016 call_tests++;
32017 xmlResetLastError();
32018#endif
32019
Daniel Veillard3d97e662004-11-04 10:49:00 +000032020 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000032021 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032022}
32023
32024
32025static int
32026test_xmlSchemaIsBuiltInTypeFacet(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032027 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032028
Daniel Veillardce682bc2004-11-05 17:22:25 +000032029#ifdef LIBXML_SCHEMAS_ENABLED
32030 int mem_base;
32031 int ret_val;
32032 xmlSchemaTypePtr type; /* the built-in type */
32033 int n_type;
32034 int facetType; /* the facet type */
32035 int n_facetType;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032036
Daniel Veillardce682bc2004-11-05 17:22:25 +000032037 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
32038 for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
32039 mem_base = xmlMemBlocks();
32040 type = gen_xmlSchemaTypePtr(n_type, 0);
32041 facetType = gen_int(n_facetType, 1);
32042
32043 ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
32044 desret_int(ret_val);
32045 call_tests++;
32046 des_xmlSchemaTypePtr(n_type, type, 0);
32047 des_int(n_facetType, facetType, 1);
32048 xmlResetLastError();
32049 if (mem_base != xmlMemBlocks()) {
32050 printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
32051 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000032052 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032053 printf(" %d", n_type);
32054 printf(" %d", n_facetType);
32055 printf("\n");
32056 }
32057 }
32058 }
32059#endif
32060
32061 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000032062 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032063}
32064
32065
32066static int
32067test_xmlSchemaNewFacet(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032068 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032069
32070
32071 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000032072 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032073}
32074
32075
Daniel Veillardce682bc2004-11-05 17:22:25 +000032076#define gen_nb_xmlSchemaValPtr_ptr 1
32077static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32078 return(NULL);
32079}
32080static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32081}
32082
Daniel Veillardd93f6252004-11-02 15:53:51 +000032083static int
32084test_xmlSchemaValPredefTypeNode(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032085 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032086
Daniel Veillardce682bc2004-11-05 17:22:25 +000032087#ifdef LIBXML_SCHEMAS_ENABLED
32088 int mem_base;
32089 int ret_val;
32090 xmlSchemaTypePtr type; /* the predefined type */
32091 int n_type;
32092 xmlChar * value; /* the value to check */
32093 int n_value;
32094 xmlSchemaValPtr * val; /* the return computed value */
32095 int n_val;
32096 xmlNodePtr node; /* the node containing the value */
32097 int n_node;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032098
Daniel Veillardce682bc2004-11-05 17:22:25 +000032099 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
32100 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32101 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
32102 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
32103 mem_base = xmlMemBlocks();
32104 type = gen_xmlSchemaTypePtr(n_type, 0);
32105 value = gen_const_xmlChar_ptr(n_value, 1);
32106 val = gen_xmlSchemaValPtr_ptr(n_val, 2);
32107 node = gen_xmlNodePtr(n_node, 3);
32108
32109 ret_val = xmlSchemaValPredefTypeNode(type, value, val, node);
32110 desret_int(ret_val);
32111 call_tests++;
32112 des_xmlSchemaTypePtr(n_type, type, 0);
32113 des_const_xmlChar_ptr(n_value, value, 1);
32114 des_xmlSchemaValPtr_ptr(n_val, val, 2);
32115 des_xmlNodePtr(n_node, node, 3);
32116 xmlResetLastError();
32117 if (mem_base != xmlMemBlocks()) {
32118 printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
32119 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000032120 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032121 printf(" %d", n_type);
32122 printf(" %d", n_value);
32123 printf(" %d", n_val);
32124 printf(" %d", n_node);
32125 printf("\n");
32126 }
32127 }
32128 }
32129 }
32130 }
32131#endif
32132
32133 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000032134 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032135}
32136
32137
32138static int
32139test_xmlSchemaValPredefTypeNodeNoNorm(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032140 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032141
Daniel Veillardce682bc2004-11-05 17:22:25 +000032142#ifdef LIBXML_SCHEMAS_ENABLED
32143 int mem_base;
32144 int ret_val;
32145 xmlSchemaTypePtr type; /* the predefined type */
32146 int n_type;
32147 xmlChar * value; /* the value to check */
32148 int n_value;
32149 xmlSchemaValPtr * val; /* the return computed value */
32150 int n_val;
32151 xmlNodePtr node; /* the node containing the value */
32152 int n_node;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032153
Daniel Veillardce682bc2004-11-05 17:22:25 +000032154 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
32155 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32156 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
32157 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
32158 mem_base = xmlMemBlocks();
32159 type = gen_xmlSchemaTypePtr(n_type, 0);
32160 value = gen_const_xmlChar_ptr(n_value, 1);
32161 val = gen_xmlSchemaValPtr_ptr(n_val, 2);
32162 node = gen_xmlNodePtr(n_node, 3);
32163
32164 ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, value, val, node);
32165 desret_int(ret_val);
32166 call_tests++;
32167 des_xmlSchemaTypePtr(n_type, type, 0);
32168 des_const_xmlChar_ptr(n_value, value, 1);
32169 des_xmlSchemaValPtr_ptr(n_val, val, 2);
32170 des_xmlNodePtr(n_node, node, 3);
32171 xmlResetLastError();
32172 if (mem_base != xmlMemBlocks()) {
32173 printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
32174 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000032175 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032176 printf(" %d", n_type);
32177 printf(" %d", n_value);
32178 printf(" %d", n_val);
32179 printf(" %d", n_node);
32180 printf("\n");
32181 }
32182 }
32183 }
32184 }
32185 }
32186#endif
32187
32188 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000032189 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032190}
32191
32192
32193static int
32194test_xmlSchemaValidateFacet(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032195 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032196
Daniel Veillardce682bc2004-11-05 17:22:25 +000032197#ifdef LIBXML_SCHEMAS_ENABLED
32198 int mem_base;
32199 int ret_val;
32200 xmlSchemaTypePtr base; /* the base type */
32201 int n_base;
32202 xmlSchemaFacetPtr facet; /* the facet to check */
32203 int n_facet;
32204 xmlChar * value; /* the lexical repr of the value to validate */
32205 int n_value;
32206 xmlSchemaValPtr val; /* the precomputed value */
32207 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032208
Daniel Veillardce682bc2004-11-05 17:22:25 +000032209 for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
32210 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
32211 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32212 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
32213 mem_base = xmlMemBlocks();
32214 base = gen_xmlSchemaTypePtr(n_base, 0);
32215 facet = gen_xmlSchemaFacetPtr(n_facet, 1);
32216 value = gen_const_xmlChar_ptr(n_value, 2);
32217 val = gen_xmlSchemaValPtr(n_val, 3);
32218
32219 ret_val = xmlSchemaValidateFacet(base, facet, value, val);
32220 desret_int(ret_val);
32221 call_tests++;
32222 des_xmlSchemaTypePtr(n_base, base, 0);
32223 des_xmlSchemaFacetPtr(n_facet, facet, 1);
32224 des_const_xmlChar_ptr(n_value, value, 2);
32225 des_xmlSchemaValPtr(n_val, val, 3);
32226 xmlResetLastError();
32227 if (mem_base != xmlMemBlocks()) {
32228 printf("Leak of %d blocks found in xmlSchemaValidateFacet",
32229 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000032230 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032231 printf(" %d", n_base);
32232 printf(" %d", n_facet);
32233 printf(" %d", n_value);
32234 printf(" %d", n_val);
32235 printf("\n");
32236 }
32237 }
32238 }
32239 }
32240 }
32241#endif
32242
32243 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000032244 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032245}
32246
32247
32248static int
32249test_xmlSchemaValidateLengthFacet(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032250 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032251
Daniel Veillardce682bc2004-11-05 17:22:25 +000032252#ifdef LIBXML_SCHEMAS_ENABLED
32253 int mem_base;
32254 int ret_val;
32255 xmlSchemaTypePtr type; /* the built-in type */
32256 int n_type;
32257 xmlSchemaFacetPtr facet; /* the facet to check */
32258 int n_facet;
32259 xmlChar * value; /* the lexical repr. of the value to be validated */
32260 int n_value;
32261 xmlSchemaValPtr val; /* the precomputed value */
32262 int n_val;
32263 unsigned long * length; /* the actual length of the value */
32264 int n_length;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032265
Daniel Veillardce682bc2004-11-05 17:22:25 +000032266 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
32267 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
32268 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32269 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
32270 for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
32271 mem_base = xmlMemBlocks();
32272 type = gen_xmlSchemaTypePtr(n_type, 0);
32273 facet = gen_xmlSchemaFacetPtr(n_facet, 1);
32274 value = gen_const_xmlChar_ptr(n_value, 2);
32275 val = gen_xmlSchemaValPtr(n_val, 3);
32276 length = gen_unsigned_long_ptr(n_length, 4);
32277
32278 ret_val = xmlSchemaValidateLengthFacet(type, facet, value, val, length);
32279 desret_int(ret_val);
32280 call_tests++;
32281 des_xmlSchemaTypePtr(n_type, type, 0);
32282 des_xmlSchemaFacetPtr(n_facet, facet, 1);
32283 des_const_xmlChar_ptr(n_value, value, 2);
32284 des_xmlSchemaValPtr(n_val, val, 3);
32285 des_unsigned_long_ptr(n_length, length, 4);
32286 xmlResetLastError();
32287 if (mem_base != xmlMemBlocks()) {
32288 printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
32289 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000032290 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032291 printf(" %d", n_type);
32292 printf(" %d", n_facet);
32293 printf(" %d", n_value);
32294 printf(" %d", n_val);
32295 printf(" %d", n_length);
32296 printf("\n");
32297 }
32298 }
32299 }
32300 }
32301 }
32302 }
32303#endif
32304
32305 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000032306 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032307}
32308
32309
32310static int
32311test_xmlSchemaValidateListSimpleTypeFacet(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032312 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032313
Daniel Veillardce682bc2004-11-05 17:22:25 +000032314#ifdef LIBXML_SCHEMAS_ENABLED
32315 int mem_base;
32316 int ret_val;
32317 xmlSchemaFacetPtr facet; /* the facet to check */
32318 int n_facet;
32319 xmlChar * value; /* the lexical repr of the value to validate */
32320 int n_value;
32321 unsigned long actualLen; /* the number of list items */
32322 int n_actualLen;
32323 unsigned long * expectedLen; /* the resulting expected number of list items */
32324 int n_expectedLen;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032325
Daniel Veillardce682bc2004-11-05 17:22:25 +000032326 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
32327 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32328 for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
32329 for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
32330 mem_base = xmlMemBlocks();
32331 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
32332 value = gen_const_xmlChar_ptr(n_value, 1);
32333 actualLen = gen_unsigned_long(n_actualLen, 2);
32334 expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
32335
32336 ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, value, actualLen, expectedLen);
32337 desret_int(ret_val);
32338 call_tests++;
32339 des_xmlSchemaFacetPtr(n_facet, facet, 0);
32340 des_const_xmlChar_ptr(n_value, value, 1);
32341 des_unsigned_long(n_actualLen, actualLen, 2);
32342 des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
32343 xmlResetLastError();
32344 if (mem_base != xmlMemBlocks()) {
32345 printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
32346 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000032347 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032348 printf(" %d", n_facet);
32349 printf(" %d", n_value);
32350 printf(" %d", n_actualLen);
32351 printf(" %d", n_expectedLen);
32352 printf("\n");
32353 }
32354 }
32355 }
32356 }
32357 }
32358#endif
32359
32360 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000032361 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032362}
32363
32364
32365static int
32366test_xmlSchemaValidatePredefinedType(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032367 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032368
Daniel Veillardce682bc2004-11-05 17:22:25 +000032369#ifdef LIBXML_SCHEMAS_ENABLED
32370 int mem_base;
32371 int ret_val;
32372 xmlSchemaTypePtr type; /* the predefined type */
32373 int n_type;
32374 xmlChar * value; /* the value to check */
32375 int n_value;
32376 xmlSchemaValPtr * val; /* the return computed value */
32377 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032378
Daniel Veillardce682bc2004-11-05 17:22:25 +000032379 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
32380 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32381 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
32382 mem_base = xmlMemBlocks();
32383 type = gen_xmlSchemaTypePtr(n_type, 0);
32384 value = gen_const_xmlChar_ptr(n_value, 1);
32385 val = gen_xmlSchemaValPtr_ptr(n_val, 2);
32386
32387 ret_val = xmlSchemaValidatePredefinedType(type, value, val);
32388 desret_int(ret_val);
32389 call_tests++;
32390 des_xmlSchemaTypePtr(n_type, type, 0);
32391 des_const_xmlChar_ptr(n_value, value, 1);
32392 des_xmlSchemaValPtr_ptr(n_val, val, 2);
32393 xmlResetLastError();
32394 if (mem_base != xmlMemBlocks()) {
32395 printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
32396 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000032397 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032398 printf(" %d", n_type);
32399 printf(" %d", n_value);
32400 printf(" %d", n_val);
32401 printf("\n");
32402 }
32403 }
32404 }
32405 }
32406#endif
32407
32408 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000032409 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032410}
32411
32412static int
32413test_xmlschemastypes(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032414 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032415
Daniel Veillard42595322004-11-08 10:52:06 +000032416 printf("Testing xmlschemastypes : 15 of 19 functions ...\n");
32417 test_ret += test_xmlSchemaCheckFacet();
32418 test_ret += test_xmlSchemaCleanupTypes();
32419 test_ret += test_xmlSchemaCollapseString();
32420 test_ret += test_xmlSchemaCompareValues();
32421 test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
32422 test_ret += test_xmlSchemaGetBuiltInType();
32423 test_ret += test_xmlSchemaGetFacetValueAsULong();
32424 test_ret += test_xmlSchemaGetPredefinedType();
32425 test_ret += test_xmlSchemaInitTypes();
32426 test_ret += test_xmlSchemaIsBuiltInTypeFacet();
32427 test_ret += test_xmlSchemaNewFacet();
32428 test_ret += test_xmlSchemaValPredefTypeNode();
32429 test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
32430 test_ret += test_xmlSchemaValidateFacet();
32431 test_ret += test_xmlSchemaValidateLengthFacet();
32432 test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
32433 test_ret += test_xmlSchemaValidatePredefinedType();
Daniel Veillardd93f6252004-11-02 15:53:51 +000032434
Daniel Veillard42595322004-11-08 10:52:06 +000032435 if (test_ret != 0)
32436 printf("Module xmlschemastypes: %d errors\n", test_ret);
32437 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032438}
32439
32440static int
32441test_xmlCharStrdup(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032442 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032443
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032444 int mem_base;
32445 xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032446 char * cur; /* the input char * */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032447 int n_cur;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032448
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032449 for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
32450 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000032451 cur = gen_const_char_ptr(n_cur, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032452
32453 ret_val = xmlCharStrdup(cur);
32454 desret_xmlChar_ptr(ret_val);
32455 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000032456 des_const_char_ptr(n_cur, cur, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032457 xmlResetLastError();
32458 if (mem_base != xmlMemBlocks()) {
32459 printf("Leak of %d blocks found in xmlCharStrdup",
32460 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000032461 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032462 printf(" %d", n_cur);
32463 printf("\n");
32464 }
32465 }
32466
Daniel Veillard3d97e662004-11-04 10:49:00 +000032467 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000032468 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032469}
32470
32471
32472static int
32473test_xmlCharStrndup(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032474 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032475
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032476 int mem_base;
32477 xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032478 char * cur; /* the input char * */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032479 int n_cur;
32480 int len; /* the len of @cur */
32481 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032482
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032483 for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
32484 for (n_len = 0;n_len < gen_nb_int;n_len++) {
32485 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000032486 cur = gen_const_char_ptr(n_cur, 0);
32487 len = gen_int(n_len, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032488
32489 ret_val = xmlCharStrndup(cur, len);
32490 desret_xmlChar_ptr(ret_val);
32491 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000032492 des_const_char_ptr(n_cur, cur, 0);
32493 des_int(n_len, len, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032494 xmlResetLastError();
32495 if (mem_base != xmlMemBlocks()) {
32496 printf("Leak of %d blocks found in xmlCharStrndup",
32497 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000032498 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032499 printf(" %d", n_cur);
32500 printf(" %d", n_len);
32501 printf("\n");
32502 }
32503 }
32504 }
32505
Daniel Veillard3d97e662004-11-04 10:49:00 +000032506 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000032507 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032508}
32509
32510
32511static int
32512test_xmlCheckUTF8(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032513 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032514
Daniel Veillardce682bc2004-11-05 17:22:25 +000032515 int mem_base;
32516 int ret_val;
32517 unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
32518 int n_utf;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032519
Daniel Veillardce682bc2004-11-05 17:22:25 +000032520 for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
32521 mem_base = xmlMemBlocks();
32522 utf = gen_const_unsigned_char_ptr(n_utf, 0);
32523
32524 ret_val = xmlCheckUTF8(utf);
32525 desret_int(ret_val);
32526 call_tests++;
32527 des_const_unsigned_char_ptr(n_utf, utf, 0);
32528 xmlResetLastError();
32529 if (mem_base != xmlMemBlocks()) {
32530 printf("Leak of %d blocks found in xmlCheckUTF8",
32531 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000032532 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032533 printf(" %d", n_utf);
32534 printf("\n");
32535 }
32536 }
32537
32538 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000032539 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032540}
32541
32542
32543static int
32544test_xmlGetUTF8Char(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032545 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032546
Daniel Veillardce682bc2004-11-05 17:22:25 +000032547 int mem_base;
32548 int ret_val;
32549 unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
32550 int n_utf;
32551 int * len; /* a pointer to the minimum number of bytes present in the sequence. This is used to assure the next character is completely contained within the sequence. */
32552 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032553
Daniel Veillardce682bc2004-11-05 17:22:25 +000032554 for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
32555 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
32556 mem_base = xmlMemBlocks();
32557 utf = gen_const_unsigned_char_ptr(n_utf, 0);
32558 len = gen_int_ptr(n_len, 1);
32559
32560 ret_val = xmlGetUTF8Char(utf, len);
32561 desret_int(ret_val);
32562 call_tests++;
32563 des_const_unsigned_char_ptr(n_utf, utf, 0);
32564 des_int_ptr(n_len, len, 1);
32565 xmlResetLastError();
32566 if (mem_base != xmlMemBlocks()) {
32567 printf("Leak of %d blocks found in xmlGetUTF8Char",
32568 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000032569 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032570 printf(" %d", n_utf);
32571 printf(" %d", n_len);
32572 printf("\n");
32573 }
32574 }
32575 }
32576
32577 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000032578 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032579}
32580
32581
32582static int
32583test_xmlStrEqual(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032584 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032585
32586 int mem_base;
32587 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032588 xmlChar * str1; /* the first xmlChar * */
Daniel Veillardd93f6252004-11-02 15:53:51 +000032589 int n_str1;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032590 xmlChar * str2; /* the second xmlChar * */
Daniel Veillardd93f6252004-11-02 15:53:51 +000032591 int n_str2;
32592
32593 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
32594 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
32595 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000032596 str1 = gen_const_xmlChar_ptr(n_str1, 0);
32597 str2 = gen_const_xmlChar_ptr(n_str2, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032598
32599 ret_val = xmlStrEqual(str1, str2);
32600 desret_int(ret_val);
32601 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000032602 des_const_xmlChar_ptr(n_str1, str1, 0);
32603 des_const_xmlChar_ptr(n_str2, str2, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032604 xmlResetLastError();
32605 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000032606 printf("Leak of %d blocks found in xmlStrEqual",
Daniel Veillardd93f6252004-11-02 15:53:51 +000032607 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000032608 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000032609 printf(" %d", n_str1);
32610 printf(" %d", n_str2);
32611 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000032612 }
32613 }
32614 }
32615
Daniel Veillard3d97e662004-11-04 10:49:00 +000032616 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000032617 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032618}
32619
32620
32621static int
32622test_xmlStrPrintf(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032623 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032624
32625
32626 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000032627 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032628}
32629
32630
32631static int
32632test_xmlStrQEqual(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032633 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032634
32635 int mem_base;
32636 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032637 xmlChar * pref; /* the prefix of the QName */
Daniel Veillardd93f6252004-11-02 15:53:51 +000032638 int n_pref;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032639 xmlChar * name; /* the localname of the QName */
Daniel Veillardd93f6252004-11-02 15:53:51 +000032640 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032641 xmlChar * str; /* the second xmlChar * */
Daniel Veillardd93f6252004-11-02 15:53:51 +000032642 int n_str;
32643
32644 for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
32645 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
32646 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
32647 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000032648 pref = gen_const_xmlChar_ptr(n_pref, 0);
32649 name = gen_const_xmlChar_ptr(n_name, 1);
32650 str = gen_const_xmlChar_ptr(n_str, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032651
32652 ret_val = xmlStrQEqual(pref, name, str);
32653 desret_int(ret_val);
32654 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000032655 des_const_xmlChar_ptr(n_pref, pref, 0);
32656 des_const_xmlChar_ptr(n_name, name, 1);
32657 des_const_xmlChar_ptr(n_str, str, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032658 xmlResetLastError();
32659 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000032660 printf("Leak of %d blocks found in xmlStrQEqual",
Daniel Veillardd93f6252004-11-02 15:53:51 +000032661 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000032662 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000032663 printf(" %d", n_pref);
32664 printf(" %d", n_name);
32665 printf(" %d", n_str);
32666 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000032667 }
32668 }
32669 }
32670 }
32671
Daniel Veillard3d97e662004-11-04 10:49:00 +000032672 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000032673 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032674}
32675
32676
32677static int
32678test_xmlStrVPrintf(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032679 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032680
32681
32682 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000032683 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032684}
32685
32686
32687static int
32688test_xmlStrcasecmp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032689 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032690
32691 int mem_base;
32692 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032693 xmlChar * str1; /* the first xmlChar * */
Daniel Veillardd93f6252004-11-02 15:53:51 +000032694 int n_str1;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032695 xmlChar * str2; /* the second xmlChar * */
Daniel Veillardd93f6252004-11-02 15:53:51 +000032696 int n_str2;
32697
32698 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
32699 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
32700 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000032701 str1 = gen_const_xmlChar_ptr(n_str1, 0);
32702 str2 = gen_const_xmlChar_ptr(n_str2, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032703
32704 ret_val = xmlStrcasecmp(str1, str2);
32705 desret_int(ret_val);
32706 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000032707 des_const_xmlChar_ptr(n_str1, str1, 0);
32708 des_const_xmlChar_ptr(n_str2, str2, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032709 xmlResetLastError();
32710 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000032711 printf("Leak of %d blocks found in xmlStrcasecmp",
Daniel Veillardd93f6252004-11-02 15:53:51 +000032712 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000032713 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000032714 printf(" %d", n_str1);
32715 printf(" %d", n_str2);
32716 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000032717 }
32718 }
32719 }
32720
Daniel Veillard3d97e662004-11-04 10:49:00 +000032721 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000032722 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032723}
32724
32725
32726static int
32727test_xmlStrcasestr(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032728 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032729
Daniel Veillardd005b9e2004-11-03 17:07:05 +000032730 int mem_base;
32731 const xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032732 xmlChar * str; /* the xmlChar * array (haystack) */
Daniel Veillardd005b9e2004-11-03 17:07:05 +000032733 int n_str;
32734 xmlChar * val; /* the xmlChar to search (needle) */
32735 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032736
Daniel Veillardd005b9e2004-11-03 17:07:05 +000032737 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
32738 for (n_val = 0;n_val < gen_nb_xmlChar_ptr;n_val++) {
32739 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000032740 str = gen_const_xmlChar_ptr(n_str, 0);
32741 val = gen_xmlChar_ptr(n_val, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000032742
32743 ret_val = xmlStrcasestr(str, val);
32744 desret_const_xmlChar_ptr(ret_val);
32745 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000032746 des_const_xmlChar_ptr(n_str, str, 0);
32747 des_xmlChar_ptr(n_val, val, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000032748 xmlResetLastError();
32749 if (mem_base != xmlMemBlocks()) {
32750 printf("Leak of %d blocks found in xmlStrcasestr",
32751 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000032752 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000032753 printf(" %d", n_str);
32754 printf(" %d", n_val);
32755 printf("\n");
32756 }
32757 }
32758 }
32759
Daniel Veillard3d97e662004-11-04 10:49:00 +000032760 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000032761 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032762}
32763
32764
32765static int
Daniel Veillardd93f6252004-11-02 15:53:51 +000032766test_xmlStrchr(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032767 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032768
32769
32770 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000032771 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032772}
32773
32774
32775static int
32776test_xmlStrcmp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032777 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032778
32779 int mem_base;
32780 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032781 xmlChar * str1; /* the first xmlChar * */
Daniel Veillardd93f6252004-11-02 15:53:51 +000032782 int n_str1;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032783 xmlChar * str2; /* the second xmlChar * */
Daniel Veillardd93f6252004-11-02 15:53:51 +000032784 int n_str2;
32785
32786 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
32787 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
32788 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000032789 str1 = gen_const_xmlChar_ptr(n_str1, 0);
32790 str2 = gen_const_xmlChar_ptr(n_str2, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032791
32792 ret_val = xmlStrcmp(str1, str2);
32793 desret_int(ret_val);
32794 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000032795 des_const_xmlChar_ptr(n_str1, str1, 0);
32796 des_const_xmlChar_ptr(n_str2, str2, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032797 xmlResetLastError();
32798 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000032799 printf("Leak of %d blocks found in xmlStrcmp",
Daniel Veillardd93f6252004-11-02 15:53:51 +000032800 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000032801 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000032802 printf(" %d", n_str1);
32803 printf(" %d", n_str2);
32804 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000032805 }
32806 }
32807 }
32808
Daniel Veillard3d97e662004-11-04 10:49:00 +000032809 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000032810 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032811}
32812
32813
32814static int
32815test_xmlStrdup(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032816 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032817
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032818 int mem_base;
32819 xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032820 xmlChar * cur; /* the input xmlChar * */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032821 int n_cur;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032822
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032823 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
32824 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000032825 cur = gen_const_xmlChar_ptr(n_cur, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032826
32827 ret_val = xmlStrdup(cur);
32828 desret_xmlChar_ptr(ret_val);
32829 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000032830 des_const_xmlChar_ptr(n_cur, cur, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032831 xmlResetLastError();
32832 if (mem_base != xmlMemBlocks()) {
32833 printf("Leak of %d blocks found in xmlStrdup",
32834 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000032835 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032836 printf(" %d", n_cur);
32837 printf("\n");
32838 }
32839 }
32840
Daniel Veillard3d97e662004-11-04 10:49:00 +000032841 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000032842 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032843}
32844
32845
32846static int
32847test_xmlStrlen(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032848 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032849
32850 int mem_base;
32851 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032852 xmlChar * str; /* the xmlChar * array */
Daniel Veillardd93f6252004-11-02 15:53:51 +000032853 int n_str;
32854
32855 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
32856 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000032857 str = gen_const_xmlChar_ptr(n_str, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032858
32859 ret_val = xmlStrlen(str);
32860 desret_int(ret_val);
32861 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000032862 des_const_xmlChar_ptr(n_str, str, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032863 xmlResetLastError();
32864 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000032865 printf("Leak of %d blocks found in xmlStrlen",
Daniel Veillardd93f6252004-11-02 15:53:51 +000032866 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000032867 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000032868 printf(" %d", n_str);
32869 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000032870 }
32871 }
32872
Daniel Veillard3d97e662004-11-04 10:49:00 +000032873 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000032874 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032875}
32876
32877
32878static int
32879test_xmlStrncasecmp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032880 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032881
32882 int mem_base;
32883 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032884 xmlChar * str1; /* the first xmlChar * */
Daniel Veillardd93f6252004-11-02 15:53:51 +000032885 int n_str1;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032886 xmlChar * str2; /* the second xmlChar * */
Daniel Veillardd93f6252004-11-02 15:53:51 +000032887 int n_str2;
32888 int len; /* the max comparison length */
32889 int n_len;
32890
32891 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
32892 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
32893 for (n_len = 0;n_len < gen_nb_int;n_len++) {
32894 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000032895 str1 = gen_const_xmlChar_ptr(n_str1, 0);
32896 str2 = gen_const_xmlChar_ptr(n_str2, 1);
32897 len = gen_int(n_len, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032898
32899 ret_val = xmlStrncasecmp(str1, str2, len);
32900 desret_int(ret_val);
32901 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000032902 des_const_xmlChar_ptr(n_str1, str1, 0);
32903 des_const_xmlChar_ptr(n_str2, str2, 1);
32904 des_int(n_len, len, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032905 xmlResetLastError();
32906 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000032907 printf("Leak of %d blocks found in xmlStrncasecmp",
Daniel Veillardd93f6252004-11-02 15:53:51 +000032908 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000032909 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000032910 printf(" %d", n_str1);
32911 printf(" %d", n_str2);
32912 printf(" %d", n_len);
32913 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000032914 }
32915 }
32916 }
32917 }
32918
Daniel Veillard3d97e662004-11-04 10:49:00 +000032919 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000032920 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032921}
32922
32923
32924static int
Daniel Veillardd93f6252004-11-02 15:53:51 +000032925test_xmlStrncatNew(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032926 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032927
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032928 int mem_base;
32929 xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032930 xmlChar * str1; /* first xmlChar string */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032931 int n_str1;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032932 xmlChar * str2; /* second xmlChar string */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032933 int n_str2;
32934 int len; /* the len of @str2 */
32935 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032936
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032937 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
32938 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
32939 for (n_len = 0;n_len < gen_nb_int;n_len++) {
32940 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000032941 str1 = gen_const_xmlChar_ptr(n_str1, 0);
32942 str2 = gen_const_xmlChar_ptr(n_str2, 1);
32943 len = gen_int(n_len, 2);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032944
32945 ret_val = xmlStrncatNew(str1, str2, len);
32946 desret_xmlChar_ptr(ret_val);
32947 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000032948 des_const_xmlChar_ptr(n_str1, str1, 0);
32949 des_const_xmlChar_ptr(n_str2, str2, 1);
32950 des_int(n_len, len, 2);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032951 xmlResetLastError();
32952 if (mem_base != xmlMemBlocks()) {
32953 printf("Leak of %d blocks found in xmlStrncatNew",
32954 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000032955 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000032956 printf(" %d", n_str1);
32957 printf(" %d", n_str2);
32958 printf(" %d", n_len);
32959 printf("\n");
32960 }
32961 }
32962 }
32963 }
32964
Daniel Veillard3d97e662004-11-04 10:49:00 +000032965 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000032966 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032967}
32968
32969
32970static int
32971test_xmlStrncmp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000032972 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000032973
32974 int mem_base;
32975 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032976 xmlChar * str1; /* the first xmlChar * */
Daniel Veillardd93f6252004-11-02 15:53:51 +000032977 int n_str1;
Daniel Veillardce682bc2004-11-05 17:22:25 +000032978 xmlChar * str2; /* the second xmlChar * */
Daniel Veillardd93f6252004-11-02 15:53:51 +000032979 int n_str2;
32980 int len; /* the max comparison length */
32981 int n_len;
32982
32983 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
32984 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
32985 for (n_len = 0;n_len < gen_nb_int;n_len++) {
32986 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000032987 str1 = gen_const_xmlChar_ptr(n_str1, 0);
32988 str2 = gen_const_xmlChar_ptr(n_str2, 1);
32989 len = gen_int(n_len, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032990
32991 ret_val = xmlStrncmp(str1, str2, len);
32992 desret_int(ret_val);
32993 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000032994 des_const_xmlChar_ptr(n_str1, str1, 0);
32995 des_const_xmlChar_ptr(n_str2, str2, 1);
32996 des_int(n_len, len, 2);
Daniel Veillardd93f6252004-11-02 15:53:51 +000032997 xmlResetLastError();
32998 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000032999 printf("Leak of %d blocks found in xmlStrncmp",
Daniel Veillardd93f6252004-11-02 15:53:51 +000033000 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033001 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000033002 printf(" %d", n_str1);
33003 printf(" %d", n_str2);
33004 printf(" %d", n_len);
33005 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000033006 }
33007 }
33008 }
33009 }
33010
Daniel Veillard3d97e662004-11-04 10:49:00 +000033011 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033012 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033013}
33014
33015
33016static int
33017test_xmlStrndup(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033018 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000033019
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033020 int mem_base;
33021 xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000033022 xmlChar * cur; /* the input xmlChar * */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033023 int n_cur;
33024 int len; /* the len of @cur */
33025 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000033026
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033027 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
33028 for (n_len = 0;n_len < gen_nb_int;n_len++) {
33029 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000033030 cur = gen_const_xmlChar_ptr(n_cur, 0);
33031 len = gen_int(n_len, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033032
33033 ret_val = xmlStrndup(cur, len);
33034 desret_xmlChar_ptr(ret_val);
33035 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000033036 des_const_xmlChar_ptr(n_cur, cur, 0);
33037 des_int(n_len, len, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033038 xmlResetLastError();
33039 if (mem_base != xmlMemBlocks()) {
33040 printf("Leak of %d blocks found in xmlStrndup",
33041 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033042 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033043 printf(" %d", n_cur);
33044 printf(" %d", n_len);
33045 printf("\n");
33046 }
33047 }
33048 }
33049
Daniel Veillard3d97e662004-11-04 10:49:00 +000033050 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033051 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033052}
33053
33054
33055static int
33056test_xmlStrstr(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033057 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000033058
Daniel Veillardd005b9e2004-11-03 17:07:05 +000033059 int mem_base;
33060 const xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000033061 xmlChar * str; /* the xmlChar * array (haystack) */
Daniel Veillardd005b9e2004-11-03 17:07:05 +000033062 int n_str;
Daniel Veillardce682bc2004-11-05 17:22:25 +000033063 xmlChar * val; /* the xmlChar to search (needle) */
Daniel Veillardd005b9e2004-11-03 17:07:05 +000033064 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000033065
Daniel Veillardd005b9e2004-11-03 17:07:05 +000033066 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
33067 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
33068 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000033069 str = gen_const_xmlChar_ptr(n_str, 0);
33070 val = gen_const_xmlChar_ptr(n_val, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000033071
33072 ret_val = xmlStrstr(str, val);
33073 desret_const_xmlChar_ptr(ret_val);
33074 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000033075 des_const_xmlChar_ptr(n_str, str, 0);
33076 des_const_xmlChar_ptr(n_val, val, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000033077 xmlResetLastError();
33078 if (mem_base != xmlMemBlocks()) {
33079 printf("Leak of %d blocks found in xmlStrstr",
33080 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033081 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000033082 printf(" %d", n_str);
33083 printf(" %d", n_val);
33084 printf("\n");
33085 }
33086 }
33087 }
33088
Daniel Veillard3d97e662004-11-04 10:49:00 +000033089 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033090 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033091}
33092
33093
33094static int
33095test_xmlStrsub(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033096 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000033097
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033098 int mem_base;
33099 xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000033100 xmlChar * str; /* the xmlChar * array (haystack) */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033101 int n_str;
33102 int start; /* the index of the first char (zero based) */
33103 int n_start;
33104 int len; /* the length of the substring */
33105 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000033106
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033107 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
33108 for (n_start = 0;n_start < gen_nb_int;n_start++) {
33109 for (n_len = 0;n_len < gen_nb_int;n_len++) {
33110 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000033111 str = gen_const_xmlChar_ptr(n_str, 0);
33112 start = gen_int(n_start, 1);
33113 len = gen_int(n_len, 2);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033114
33115 ret_val = xmlStrsub(str, start, len);
33116 desret_xmlChar_ptr(ret_val);
33117 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000033118 des_const_xmlChar_ptr(n_str, str, 0);
33119 des_int(n_start, start, 1);
33120 des_int(n_len, len, 2);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033121 xmlResetLastError();
33122 if (mem_base != xmlMemBlocks()) {
33123 printf("Leak of %d blocks found in xmlStrsub",
33124 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033125 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033126 printf(" %d", n_str);
33127 printf(" %d", n_start);
33128 printf(" %d", n_len);
33129 printf("\n");
33130 }
33131 }
33132 }
33133 }
33134
Daniel Veillard3d97e662004-11-04 10:49:00 +000033135 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033136 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033137}
33138
33139
33140static int
33141test_xmlUTF8Charcmp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033142 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000033143
33144 int mem_base;
33145 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000033146 xmlChar * utf1; /* pointer to first UTF8 char */
Daniel Veillardd93f6252004-11-02 15:53:51 +000033147 int n_utf1;
Daniel Veillardce682bc2004-11-05 17:22:25 +000033148 xmlChar * utf2; /* pointer to second UTF8 char */
Daniel Veillardd93f6252004-11-02 15:53:51 +000033149 int n_utf2;
33150
33151 for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
33152 for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
33153 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000033154 utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
33155 utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033156
33157 ret_val = xmlUTF8Charcmp(utf1, utf2);
33158 desret_int(ret_val);
33159 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000033160 des_const_xmlChar_ptr(n_utf1, utf1, 0);
33161 des_const_xmlChar_ptr(n_utf2, utf2, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033162 xmlResetLastError();
33163 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000033164 printf("Leak of %d blocks found in xmlUTF8Charcmp",
Daniel Veillardd93f6252004-11-02 15:53:51 +000033165 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033166 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000033167 printf(" %d", n_utf1);
33168 printf(" %d", n_utf2);
33169 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000033170 }
33171 }
33172 }
33173
Daniel Veillard3d97e662004-11-04 10:49:00 +000033174 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033175 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033176}
33177
33178
33179static int
33180test_xmlUTF8Size(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033181 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000033182
33183 int mem_base;
33184 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000033185 xmlChar * utf; /* pointer to the UTF8 character */
Daniel Veillardd93f6252004-11-02 15:53:51 +000033186 int n_utf;
33187
33188 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
33189 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000033190 utf = gen_const_xmlChar_ptr(n_utf, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033191
33192 ret_val = xmlUTF8Size(utf);
33193 desret_int(ret_val);
33194 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000033195 des_const_xmlChar_ptr(n_utf, utf, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033196 xmlResetLastError();
33197 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000033198 printf("Leak of %d blocks found in xmlUTF8Size",
Daniel Veillardd93f6252004-11-02 15:53:51 +000033199 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033200 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000033201 printf(" %d", n_utf);
33202 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000033203 }
33204 }
33205
Daniel Veillard3d97e662004-11-04 10:49:00 +000033206 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033207 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033208}
33209
33210
33211static int
33212test_xmlUTF8Strlen(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033213 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000033214
33215 int mem_base;
33216 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000033217 xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
Daniel Veillardd93f6252004-11-02 15:53:51 +000033218 int n_utf;
33219
33220 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
33221 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000033222 utf = gen_const_xmlChar_ptr(n_utf, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033223
33224 ret_val = xmlUTF8Strlen(utf);
33225 desret_int(ret_val);
33226 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000033227 des_const_xmlChar_ptr(n_utf, utf, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033228 xmlResetLastError();
33229 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000033230 printf("Leak of %d blocks found in xmlUTF8Strlen",
Daniel Veillardd93f6252004-11-02 15:53:51 +000033231 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033232 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000033233 printf(" %d", n_utf);
33234 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000033235 }
33236 }
33237
Daniel Veillard3d97e662004-11-04 10:49:00 +000033238 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033239 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033240}
33241
33242
33243static int
33244test_xmlUTF8Strloc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033245 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000033246
33247 int mem_base;
33248 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000033249 xmlChar * utf; /* the input UTF8 * */
Daniel Veillardd93f6252004-11-02 15:53:51 +000033250 int n_utf;
Daniel Veillardce682bc2004-11-05 17:22:25 +000033251 xmlChar * utfchar; /* the UTF8 character to be found */
Daniel Veillardd93f6252004-11-02 15:53:51 +000033252 int n_utfchar;
33253
33254 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
33255 for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
33256 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000033257 utf = gen_const_xmlChar_ptr(n_utf, 0);
33258 utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033259
33260 ret_val = xmlUTF8Strloc(utf, utfchar);
33261 desret_int(ret_val);
33262 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000033263 des_const_xmlChar_ptr(n_utf, utf, 0);
33264 des_const_xmlChar_ptr(n_utfchar, utfchar, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033265 xmlResetLastError();
33266 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000033267 printf("Leak of %d blocks found in xmlUTF8Strloc",
Daniel Veillardd93f6252004-11-02 15:53:51 +000033268 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033269 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000033270 printf(" %d", n_utf);
33271 printf(" %d", n_utfchar);
33272 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000033273 }
33274 }
33275 }
33276
Daniel Veillard3d97e662004-11-04 10:49:00 +000033277 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033278 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033279}
33280
33281
33282static int
33283test_xmlUTF8Strndup(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033284 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000033285
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033286 int mem_base;
33287 xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000033288 xmlChar * utf; /* the input UTF8 * */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033289 int n_utf;
33290 int len; /* the len of @utf (in chars) */
33291 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000033292
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033293 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
33294 for (n_len = 0;n_len < gen_nb_int;n_len++) {
33295 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000033296 utf = gen_const_xmlChar_ptr(n_utf, 0);
33297 len = gen_int(n_len, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033298
33299 ret_val = xmlUTF8Strndup(utf, len);
33300 desret_xmlChar_ptr(ret_val);
33301 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000033302 des_const_xmlChar_ptr(n_utf, utf, 0);
33303 des_int(n_len, len, 1);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033304 xmlResetLastError();
33305 if (mem_base != xmlMemBlocks()) {
33306 printf("Leak of %d blocks found in xmlUTF8Strndup",
33307 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033308 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033309 printf(" %d", n_utf);
33310 printf(" %d", n_len);
33311 printf("\n");
33312 }
33313 }
33314 }
33315
Daniel Veillard3d97e662004-11-04 10:49:00 +000033316 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033317 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033318}
33319
33320
33321static int
33322test_xmlUTF8Strpos(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033323 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000033324
Daniel Veillardd005b9e2004-11-03 17:07:05 +000033325 int mem_base;
33326 const xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000033327 xmlChar * utf; /* the input UTF8 * */
Daniel Veillardd005b9e2004-11-03 17:07:05 +000033328 int n_utf;
33329 int pos; /* the position of the desired UTF8 char (in chars) */
33330 int n_pos;
Daniel Veillardd93f6252004-11-02 15:53:51 +000033331
Daniel Veillardd005b9e2004-11-03 17:07:05 +000033332 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
33333 for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
33334 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000033335 utf = gen_const_xmlChar_ptr(n_utf, 0);
33336 pos = gen_int(n_pos, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000033337
33338 ret_val = xmlUTF8Strpos(utf, pos);
33339 desret_const_xmlChar_ptr(ret_val);
33340 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000033341 des_const_xmlChar_ptr(n_utf, utf, 0);
33342 des_int(n_pos, pos, 1);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000033343 xmlResetLastError();
33344 if (mem_base != xmlMemBlocks()) {
33345 printf("Leak of %d blocks found in xmlUTF8Strpos",
33346 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033347 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000033348 printf(" %d", n_utf);
33349 printf(" %d", n_pos);
33350 printf("\n");
33351 }
33352 }
33353 }
33354
Daniel Veillard3d97e662004-11-04 10:49:00 +000033355 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033356 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033357}
33358
33359
33360static int
33361test_xmlUTF8Strsize(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033362 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000033363
33364 int mem_base;
33365 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000033366 xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
Daniel Veillardd93f6252004-11-02 15:53:51 +000033367 int n_utf;
33368 int len; /* the number of characters in the array */
33369 int n_len;
33370
33371 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
33372 for (n_len = 0;n_len < gen_nb_int;n_len++) {
33373 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000033374 utf = gen_const_xmlChar_ptr(n_utf, 0);
33375 len = gen_int(n_len, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033376
33377 ret_val = xmlUTF8Strsize(utf, len);
33378 desret_int(ret_val);
33379 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000033380 des_const_xmlChar_ptr(n_utf, utf, 0);
33381 des_int(n_len, len, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033382 xmlResetLastError();
33383 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000033384 printf("Leak of %d blocks found in xmlUTF8Strsize",
Daniel Veillardd93f6252004-11-02 15:53:51 +000033385 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033386 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000033387 printf(" %d", n_utf);
33388 printf(" %d", n_len);
33389 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000033390 }
33391 }
33392 }
33393
Daniel Veillard3d97e662004-11-04 10:49:00 +000033394 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033395 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033396}
33397
33398
33399static int
33400test_xmlUTF8Strsub(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033401 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000033402
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033403 int mem_base;
33404 xmlChar * ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000033405 xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033406 int n_utf;
33407 int start; /* relative pos of first char */
33408 int n_start;
33409 int len; /* total number to copy */
33410 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000033411
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033412 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
33413 for (n_start = 0;n_start < gen_nb_int;n_start++) {
33414 for (n_len = 0;n_len < gen_nb_int;n_len++) {
33415 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000033416 utf = gen_const_xmlChar_ptr(n_utf, 0);
33417 start = gen_int(n_start, 1);
33418 len = gen_int(n_len, 2);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033419
33420 ret_val = xmlUTF8Strsub(utf, start, len);
33421 desret_xmlChar_ptr(ret_val);
33422 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000033423 des_const_xmlChar_ptr(n_utf, utf, 0);
33424 des_int(n_start, start, 1);
33425 des_int(n_len, len, 2);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033426 xmlResetLastError();
33427 if (mem_base != xmlMemBlocks()) {
33428 printf("Leak of %d blocks found in xmlUTF8Strsub",
33429 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033430 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000033431 printf(" %d", n_utf);
33432 printf(" %d", n_start);
33433 printf(" %d", n_len);
33434 printf("\n");
33435 }
33436 }
33437 }
33438 }
33439
Daniel Veillard3d97e662004-11-04 10:49:00 +000033440 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033441 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033442}
33443
33444static int
33445test_xmlstring(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033446 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000033447
Daniel Veillardce682bc2004-11-05 17:22:25 +000033448 printf("Testing xmlstring : 25 of 30 functions ...\n");
Daniel Veillard42595322004-11-08 10:52:06 +000033449 test_ret += test_xmlCharStrdup();
33450 test_ret += test_xmlCharStrndup();
33451 test_ret += test_xmlCheckUTF8();
33452 test_ret += test_xmlGetUTF8Char();
33453 test_ret += test_xmlStrEqual();
33454 test_ret += test_xmlStrPrintf();
33455 test_ret += test_xmlStrQEqual();
33456 test_ret += test_xmlStrVPrintf();
33457 test_ret += test_xmlStrcasecmp();
33458 test_ret += test_xmlStrcasestr();
33459 test_ret += test_xmlStrchr();
33460 test_ret += test_xmlStrcmp();
33461 test_ret += test_xmlStrdup();
33462 test_ret += test_xmlStrlen();
33463 test_ret += test_xmlStrncasecmp();
33464 test_ret += test_xmlStrncatNew();
33465 test_ret += test_xmlStrncmp();
33466 test_ret += test_xmlStrndup();
33467 test_ret += test_xmlStrstr();
33468 test_ret += test_xmlStrsub();
33469 test_ret += test_xmlUTF8Charcmp();
33470 test_ret += test_xmlUTF8Size();
33471 test_ret += test_xmlUTF8Strlen();
33472 test_ret += test_xmlUTF8Strloc();
33473 test_ret += test_xmlUTF8Strndup();
33474 test_ret += test_xmlUTF8Strpos();
33475 test_ret += test_xmlUTF8Strsize();
33476 test_ret += test_xmlUTF8Strsub();
Daniel Veillardd93f6252004-11-02 15:53:51 +000033477
Daniel Veillard42595322004-11-08 10:52:06 +000033478 if (test_ret != 0)
33479 printf("Module xmlstring: %d errors\n", test_ret);
33480 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000033481}
33482
33483static int
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033484test_xmlUCSIsAegeanNumbers(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033485 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033486
33487#ifdef LIBXML_UNICODE_ENABLED
33488 int mem_base;
33489 int ret_val;
33490 int code; /* UCS code point */
33491 int n_code;
33492
33493 for (n_code = 0;n_code < gen_nb_int;n_code++) {
33494 mem_base = xmlMemBlocks();
33495 code = gen_int(n_code, 0);
33496
33497 ret_val = xmlUCSIsAegeanNumbers(code);
33498 desret_int(ret_val);
33499 call_tests++;
33500 des_int(n_code, code, 0);
33501 xmlResetLastError();
33502 if (mem_base != xmlMemBlocks()) {
33503 printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
33504 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033505 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033506 printf(" %d", n_code);
33507 printf("\n");
33508 }
33509 }
33510#endif
33511
33512 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033513 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033514}
33515
33516
33517static int
33518test_xmlUCSIsAlphabeticPresentationForms(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033519 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033520
33521#ifdef LIBXML_UNICODE_ENABLED
33522 int mem_base;
33523 int ret_val;
33524 int code; /* UCS code point */
33525 int n_code;
33526
33527 for (n_code = 0;n_code < gen_nb_int;n_code++) {
33528 mem_base = xmlMemBlocks();
33529 code = gen_int(n_code, 0);
33530
33531 ret_val = xmlUCSIsAlphabeticPresentationForms(code);
33532 desret_int(ret_val);
33533 call_tests++;
33534 des_int(n_code, code, 0);
33535 xmlResetLastError();
33536 if (mem_base != xmlMemBlocks()) {
33537 printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
33538 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033539 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033540 printf(" %d", n_code);
33541 printf("\n");
33542 }
33543 }
33544#endif
33545
33546 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033547 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033548}
33549
33550
33551static int
33552test_xmlUCSIsArabic(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033553 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033554
33555#ifdef LIBXML_UNICODE_ENABLED
33556 int mem_base;
33557 int ret_val;
33558 int code; /* UCS code point */
33559 int n_code;
33560
33561 for (n_code = 0;n_code < gen_nb_int;n_code++) {
33562 mem_base = xmlMemBlocks();
33563 code = gen_int(n_code, 0);
33564
33565 ret_val = xmlUCSIsArabic(code);
33566 desret_int(ret_val);
33567 call_tests++;
33568 des_int(n_code, code, 0);
33569 xmlResetLastError();
33570 if (mem_base != xmlMemBlocks()) {
33571 printf("Leak of %d blocks found in xmlUCSIsArabic",
33572 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033573 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033574 printf(" %d", n_code);
33575 printf("\n");
33576 }
33577 }
33578#endif
33579
33580 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033581 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033582}
33583
33584
33585static int
33586test_xmlUCSIsArabicPresentationFormsA(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033587 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033588
33589#ifdef LIBXML_UNICODE_ENABLED
33590 int mem_base;
33591 int ret_val;
33592 int code; /* UCS code point */
33593 int n_code;
33594
33595 for (n_code = 0;n_code < gen_nb_int;n_code++) {
33596 mem_base = xmlMemBlocks();
33597 code = gen_int(n_code, 0);
33598
33599 ret_val = xmlUCSIsArabicPresentationFormsA(code);
33600 desret_int(ret_val);
33601 call_tests++;
33602 des_int(n_code, code, 0);
33603 xmlResetLastError();
33604 if (mem_base != xmlMemBlocks()) {
33605 printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
33606 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033607 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033608 printf(" %d", n_code);
33609 printf("\n");
33610 }
33611 }
33612#endif
33613
33614 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033615 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033616}
33617
33618
33619static int
33620test_xmlUCSIsArabicPresentationFormsB(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033621 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033622
33623#ifdef LIBXML_UNICODE_ENABLED
33624 int mem_base;
33625 int ret_val;
33626 int code; /* UCS code point */
33627 int n_code;
33628
33629 for (n_code = 0;n_code < gen_nb_int;n_code++) {
33630 mem_base = xmlMemBlocks();
33631 code = gen_int(n_code, 0);
33632
33633 ret_val = xmlUCSIsArabicPresentationFormsB(code);
33634 desret_int(ret_val);
33635 call_tests++;
33636 des_int(n_code, code, 0);
33637 xmlResetLastError();
33638 if (mem_base != xmlMemBlocks()) {
33639 printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
33640 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033641 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033642 printf(" %d", n_code);
33643 printf("\n");
33644 }
33645 }
33646#endif
33647
33648 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033649 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033650}
33651
33652
33653static int
33654test_xmlUCSIsArmenian(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033655 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033656
33657#ifdef LIBXML_UNICODE_ENABLED
33658 int mem_base;
33659 int ret_val;
33660 int code; /* UCS code point */
33661 int n_code;
33662
33663 for (n_code = 0;n_code < gen_nb_int;n_code++) {
33664 mem_base = xmlMemBlocks();
33665 code = gen_int(n_code, 0);
33666
33667 ret_val = xmlUCSIsArmenian(code);
33668 desret_int(ret_val);
33669 call_tests++;
33670 des_int(n_code, code, 0);
33671 xmlResetLastError();
33672 if (mem_base != xmlMemBlocks()) {
33673 printf("Leak of %d blocks found in xmlUCSIsArmenian",
33674 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033675 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033676 printf(" %d", n_code);
33677 printf("\n");
33678 }
33679 }
33680#endif
33681
33682 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033683 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033684}
33685
33686
33687static int
33688test_xmlUCSIsArrows(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033689 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033690
33691#ifdef LIBXML_UNICODE_ENABLED
33692 int mem_base;
33693 int ret_val;
33694 int code; /* UCS code point */
33695 int n_code;
33696
33697 for (n_code = 0;n_code < gen_nb_int;n_code++) {
33698 mem_base = xmlMemBlocks();
33699 code = gen_int(n_code, 0);
33700
33701 ret_val = xmlUCSIsArrows(code);
33702 desret_int(ret_val);
33703 call_tests++;
33704 des_int(n_code, code, 0);
33705 xmlResetLastError();
33706 if (mem_base != xmlMemBlocks()) {
33707 printf("Leak of %d blocks found in xmlUCSIsArrows",
33708 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033709 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033710 printf(" %d", n_code);
33711 printf("\n");
33712 }
33713 }
33714#endif
33715
33716 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033717 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033718}
33719
33720
33721static int
33722test_xmlUCSIsBasicLatin(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033723 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033724
33725#ifdef LIBXML_UNICODE_ENABLED
33726 int mem_base;
33727 int ret_val;
33728 int code; /* UCS code point */
33729 int n_code;
33730
33731 for (n_code = 0;n_code < gen_nb_int;n_code++) {
33732 mem_base = xmlMemBlocks();
33733 code = gen_int(n_code, 0);
33734
33735 ret_val = xmlUCSIsBasicLatin(code);
33736 desret_int(ret_val);
33737 call_tests++;
33738 des_int(n_code, code, 0);
33739 xmlResetLastError();
33740 if (mem_base != xmlMemBlocks()) {
33741 printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
33742 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033743 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033744 printf(" %d", n_code);
33745 printf("\n");
33746 }
33747 }
33748#endif
33749
33750 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033751 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033752}
33753
33754
33755static int
33756test_xmlUCSIsBengali(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033757 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033758
33759#ifdef LIBXML_UNICODE_ENABLED
33760 int mem_base;
33761 int ret_val;
33762 int code; /* UCS code point */
33763 int n_code;
33764
33765 for (n_code = 0;n_code < gen_nb_int;n_code++) {
33766 mem_base = xmlMemBlocks();
33767 code = gen_int(n_code, 0);
33768
33769 ret_val = xmlUCSIsBengali(code);
33770 desret_int(ret_val);
33771 call_tests++;
33772 des_int(n_code, code, 0);
33773 xmlResetLastError();
33774 if (mem_base != xmlMemBlocks()) {
33775 printf("Leak of %d blocks found in xmlUCSIsBengali",
33776 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033777 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033778 printf(" %d", n_code);
33779 printf("\n");
33780 }
33781 }
33782#endif
33783
33784 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033785 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033786}
33787
33788
33789static int
33790test_xmlUCSIsBlock(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033791 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033792
33793#ifdef LIBXML_UNICODE_ENABLED
33794 int mem_base;
33795 int ret_val;
33796 int code; /* UCS code point */
33797 int n_code;
Daniel Veillardce682bc2004-11-05 17:22:25 +000033798 char * block; /* UCS block name */
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033799 int n_block;
33800
33801 for (n_code = 0;n_code < gen_nb_int;n_code++) {
33802 for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
33803 mem_base = xmlMemBlocks();
33804 code = gen_int(n_code, 0);
33805 block = gen_const_char_ptr(n_block, 1);
33806
33807 ret_val = xmlUCSIsBlock(code, block);
33808 desret_int(ret_val);
33809 call_tests++;
33810 des_int(n_code, code, 0);
33811 des_const_char_ptr(n_block, block, 1);
33812 xmlResetLastError();
33813 if (mem_base != xmlMemBlocks()) {
33814 printf("Leak of %d blocks found in xmlUCSIsBlock",
33815 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033816 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033817 printf(" %d", n_code);
33818 printf(" %d", n_block);
33819 printf("\n");
33820 }
33821 }
33822 }
33823#endif
33824
33825 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033826 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033827}
33828
33829
33830static int
33831test_xmlUCSIsBlockElements(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033832 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033833
33834#ifdef LIBXML_UNICODE_ENABLED
33835 int mem_base;
33836 int ret_val;
33837 int code; /* UCS code point */
33838 int n_code;
33839
33840 for (n_code = 0;n_code < gen_nb_int;n_code++) {
33841 mem_base = xmlMemBlocks();
33842 code = gen_int(n_code, 0);
33843
33844 ret_val = xmlUCSIsBlockElements(code);
33845 desret_int(ret_val);
33846 call_tests++;
33847 des_int(n_code, code, 0);
33848 xmlResetLastError();
33849 if (mem_base != xmlMemBlocks()) {
33850 printf("Leak of %d blocks found in xmlUCSIsBlockElements",
33851 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033852 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033853 printf(" %d", n_code);
33854 printf("\n");
33855 }
33856 }
33857#endif
33858
33859 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033860 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033861}
33862
33863
33864static int
33865test_xmlUCSIsBopomofo(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033866 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033867
33868#ifdef LIBXML_UNICODE_ENABLED
33869 int mem_base;
33870 int ret_val;
33871 int code; /* UCS code point */
33872 int n_code;
33873
33874 for (n_code = 0;n_code < gen_nb_int;n_code++) {
33875 mem_base = xmlMemBlocks();
33876 code = gen_int(n_code, 0);
33877
33878 ret_val = xmlUCSIsBopomofo(code);
33879 desret_int(ret_val);
33880 call_tests++;
33881 des_int(n_code, code, 0);
33882 xmlResetLastError();
33883 if (mem_base != xmlMemBlocks()) {
33884 printf("Leak of %d blocks found in xmlUCSIsBopomofo",
33885 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033886 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033887 printf(" %d", n_code);
33888 printf("\n");
33889 }
33890 }
33891#endif
33892
33893 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033894 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033895}
33896
33897
33898static int
33899test_xmlUCSIsBopomofoExtended(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033900 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033901
33902#ifdef LIBXML_UNICODE_ENABLED
33903 int mem_base;
33904 int ret_val;
33905 int code; /* UCS code point */
33906 int n_code;
33907
33908 for (n_code = 0;n_code < gen_nb_int;n_code++) {
33909 mem_base = xmlMemBlocks();
33910 code = gen_int(n_code, 0);
33911
33912 ret_val = xmlUCSIsBopomofoExtended(code);
33913 desret_int(ret_val);
33914 call_tests++;
33915 des_int(n_code, code, 0);
33916 xmlResetLastError();
33917 if (mem_base != xmlMemBlocks()) {
33918 printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
33919 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033920 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033921 printf(" %d", n_code);
33922 printf("\n");
33923 }
33924 }
33925#endif
33926
33927 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033928 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033929}
33930
33931
33932static int
33933test_xmlUCSIsBoxDrawing(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033934 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033935
33936#ifdef LIBXML_UNICODE_ENABLED
33937 int mem_base;
33938 int ret_val;
33939 int code; /* UCS code point */
33940 int n_code;
33941
33942 for (n_code = 0;n_code < gen_nb_int;n_code++) {
33943 mem_base = xmlMemBlocks();
33944 code = gen_int(n_code, 0);
33945
33946 ret_val = xmlUCSIsBoxDrawing(code);
33947 desret_int(ret_val);
33948 call_tests++;
33949 des_int(n_code, code, 0);
33950 xmlResetLastError();
33951 if (mem_base != xmlMemBlocks()) {
33952 printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
33953 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033954 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033955 printf(" %d", n_code);
33956 printf("\n");
33957 }
33958 }
33959#endif
33960
33961 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033962 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033963}
33964
33965
33966static int
33967test_xmlUCSIsBraillePatterns(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000033968 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033969
33970#ifdef LIBXML_UNICODE_ENABLED
33971 int mem_base;
33972 int ret_val;
33973 int code; /* UCS code point */
33974 int n_code;
33975
33976 for (n_code = 0;n_code < gen_nb_int;n_code++) {
33977 mem_base = xmlMemBlocks();
33978 code = gen_int(n_code, 0);
33979
33980 ret_val = xmlUCSIsBraillePatterns(code);
33981 desret_int(ret_val);
33982 call_tests++;
33983 des_int(n_code, code, 0);
33984 xmlResetLastError();
33985 if (mem_base != xmlMemBlocks()) {
33986 printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
33987 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000033988 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033989 printf(" %d", n_code);
33990 printf("\n");
33991 }
33992 }
33993#endif
33994
33995 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000033996 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000033997}
33998
33999
34000static int
34001test_xmlUCSIsBuhid(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034002 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034003
34004#ifdef LIBXML_UNICODE_ENABLED
34005 int mem_base;
34006 int ret_val;
34007 int code; /* UCS code point */
34008 int n_code;
34009
34010 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34011 mem_base = xmlMemBlocks();
34012 code = gen_int(n_code, 0);
34013
34014 ret_val = xmlUCSIsBuhid(code);
34015 desret_int(ret_val);
34016 call_tests++;
34017 des_int(n_code, code, 0);
34018 xmlResetLastError();
34019 if (mem_base != xmlMemBlocks()) {
34020 printf("Leak of %d blocks found in xmlUCSIsBuhid",
34021 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034022 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034023 printf(" %d", n_code);
34024 printf("\n");
34025 }
34026 }
34027#endif
34028
34029 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034030 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034031}
34032
34033
34034static int
34035test_xmlUCSIsByzantineMusicalSymbols(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034036 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034037
34038#ifdef LIBXML_UNICODE_ENABLED
34039 int mem_base;
34040 int ret_val;
34041 int code; /* UCS code point */
34042 int n_code;
34043
34044 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34045 mem_base = xmlMemBlocks();
34046 code = gen_int(n_code, 0);
34047
34048 ret_val = xmlUCSIsByzantineMusicalSymbols(code);
34049 desret_int(ret_val);
34050 call_tests++;
34051 des_int(n_code, code, 0);
34052 xmlResetLastError();
34053 if (mem_base != xmlMemBlocks()) {
34054 printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
34055 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034056 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034057 printf(" %d", n_code);
34058 printf("\n");
34059 }
34060 }
34061#endif
34062
34063 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034064 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034065}
34066
34067
34068static int
34069test_xmlUCSIsCJKCompatibility(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034070 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034071
34072#ifdef LIBXML_UNICODE_ENABLED
34073 int mem_base;
34074 int ret_val;
34075 int code; /* UCS code point */
34076 int n_code;
34077
34078 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34079 mem_base = xmlMemBlocks();
34080 code = gen_int(n_code, 0);
34081
34082 ret_val = xmlUCSIsCJKCompatibility(code);
34083 desret_int(ret_val);
34084 call_tests++;
34085 des_int(n_code, code, 0);
34086 xmlResetLastError();
34087 if (mem_base != xmlMemBlocks()) {
34088 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
34089 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034090 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034091 printf(" %d", n_code);
34092 printf("\n");
34093 }
34094 }
34095#endif
34096
34097 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034098 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034099}
34100
34101
34102static int
34103test_xmlUCSIsCJKCompatibilityForms(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034104 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034105
34106#ifdef LIBXML_UNICODE_ENABLED
34107 int mem_base;
34108 int ret_val;
34109 int code; /* UCS code point */
34110 int n_code;
34111
34112 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34113 mem_base = xmlMemBlocks();
34114 code = gen_int(n_code, 0);
34115
34116 ret_val = xmlUCSIsCJKCompatibilityForms(code);
34117 desret_int(ret_val);
34118 call_tests++;
34119 des_int(n_code, code, 0);
34120 xmlResetLastError();
34121 if (mem_base != xmlMemBlocks()) {
34122 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
34123 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034124 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034125 printf(" %d", n_code);
34126 printf("\n");
34127 }
34128 }
34129#endif
34130
34131 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034132 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034133}
34134
34135
34136static int
34137test_xmlUCSIsCJKCompatibilityIdeographs(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034138 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034139
34140#ifdef LIBXML_UNICODE_ENABLED
34141 int mem_base;
34142 int ret_val;
34143 int code; /* UCS code point */
34144 int n_code;
34145
34146 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34147 mem_base = xmlMemBlocks();
34148 code = gen_int(n_code, 0);
34149
34150 ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
34151 desret_int(ret_val);
34152 call_tests++;
34153 des_int(n_code, code, 0);
34154 xmlResetLastError();
34155 if (mem_base != xmlMemBlocks()) {
34156 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
34157 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034158 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034159 printf(" %d", n_code);
34160 printf("\n");
34161 }
34162 }
34163#endif
34164
34165 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034166 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034167}
34168
34169
34170static int
34171test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034172 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034173
34174#ifdef LIBXML_UNICODE_ENABLED
34175 int mem_base;
34176 int ret_val;
34177 int code; /* UCS code point */
34178 int n_code;
34179
34180 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34181 mem_base = xmlMemBlocks();
34182 code = gen_int(n_code, 0);
34183
34184 ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
34185 desret_int(ret_val);
34186 call_tests++;
34187 des_int(n_code, code, 0);
34188 xmlResetLastError();
34189 if (mem_base != xmlMemBlocks()) {
34190 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
34191 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034192 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034193 printf(" %d", n_code);
34194 printf("\n");
34195 }
34196 }
34197#endif
34198
34199 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034200 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034201}
34202
34203
34204static int
34205test_xmlUCSIsCJKRadicalsSupplement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034206 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034207
34208#ifdef LIBXML_UNICODE_ENABLED
34209 int mem_base;
34210 int ret_val;
34211 int code; /* UCS code point */
34212 int n_code;
34213
34214 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34215 mem_base = xmlMemBlocks();
34216 code = gen_int(n_code, 0);
34217
34218 ret_val = xmlUCSIsCJKRadicalsSupplement(code);
34219 desret_int(ret_val);
34220 call_tests++;
34221 des_int(n_code, code, 0);
34222 xmlResetLastError();
34223 if (mem_base != xmlMemBlocks()) {
34224 printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
34225 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034226 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034227 printf(" %d", n_code);
34228 printf("\n");
34229 }
34230 }
34231#endif
34232
34233 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034234 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034235}
34236
34237
34238static int
34239test_xmlUCSIsCJKSymbolsandPunctuation(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034240 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034241
34242#ifdef LIBXML_UNICODE_ENABLED
34243 int mem_base;
34244 int ret_val;
34245 int code; /* UCS code point */
34246 int n_code;
34247
34248 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34249 mem_base = xmlMemBlocks();
34250 code = gen_int(n_code, 0);
34251
34252 ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
34253 desret_int(ret_val);
34254 call_tests++;
34255 des_int(n_code, code, 0);
34256 xmlResetLastError();
34257 if (mem_base != xmlMemBlocks()) {
34258 printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
34259 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034260 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034261 printf(" %d", n_code);
34262 printf("\n");
34263 }
34264 }
34265#endif
34266
34267 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034268 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034269}
34270
34271
34272static int
34273test_xmlUCSIsCJKUnifiedIdeographs(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034274 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034275
34276#ifdef LIBXML_UNICODE_ENABLED
34277 int mem_base;
34278 int ret_val;
34279 int code; /* UCS code point */
34280 int n_code;
34281
34282 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34283 mem_base = xmlMemBlocks();
34284 code = gen_int(n_code, 0);
34285
34286 ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
34287 desret_int(ret_val);
34288 call_tests++;
34289 des_int(n_code, code, 0);
34290 xmlResetLastError();
34291 if (mem_base != xmlMemBlocks()) {
34292 printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
34293 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034294 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034295 printf(" %d", n_code);
34296 printf("\n");
34297 }
34298 }
34299#endif
34300
34301 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034302 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034303}
34304
34305
34306static int
34307test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034308 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034309
34310#ifdef LIBXML_UNICODE_ENABLED
34311 int mem_base;
34312 int ret_val;
34313 int code; /* UCS code point */
34314 int n_code;
34315
34316 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34317 mem_base = xmlMemBlocks();
34318 code = gen_int(n_code, 0);
34319
34320 ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
34321 desret_int(ret_val);
34322 call_tests++;
34323 des_int(n_code, code, 0);
34324 xmlResetLastError();
34325 if (mem_base != xmlMemBlocks()) {
34326 printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
34327 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034328 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034329 printf(" %d", n_code);
34330 printf("\n");
34331 }
34332 }
34333#endif
34334
34335 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034336 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034337}
34338
34339
34340static int
34341test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034342 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034343
34344#ifdef LIBXML_UNICODE_ENABLED
34345 int mem_base;
34346 int ret_val;
34347 int code; /* UCS code point */
34348 int n_code;
34349
34350 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34351 mem_base = xmlMemBlocks();
34352 code = gen_int(n_code, 0);
34353
34354 ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
34355 desret_int(ret_val);
34356 call_tests++;
34357 des_int(n_code, code, 0);
34358 xmlResetLastError();
34359 if (mem_base != xmlMemBlocks()) {
34360 printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
34361 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034362 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034363 printf(" %d", n_code);
34364 printf("\n");
34365 }
34366 }
34367#endif
34368
34369 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034370 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034371}
34372
34373
34374static int
34375test_xmlUCSIsCat(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034376 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034377
34378#ifdef LIBXML_UNICODE_ENABLED
34379 int mem_base;
34380 int ret_val;
34381 int code; /* UCS code point */
34382 int n_code;
Daniel Veillardce682bc2004-11-05 17:22:25 +000034383 char * cat; /* UCS Category name */
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034384 int n_cat;
34385
34386 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34387 for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
34388 mem_base = xmlMemBlocks();
34389 code = gen_int(n_code, 0);
34390 cat = gen_const_char_ptr(n_cat, 1);
34391
34392 ret_val = xmlUCSIsCat(code, cat);
34393 desret_int(ret_val);
34394 call_tests++;
34395 des_int(n_code, code, 0);
34396 des_const_char_ptr(n_cat, cat, 1);
34397 xmlResetLastError();
34398 if (mem_base != xmlMemBlocks()) {
34399 printf("Leak of %d blocks found in xmlUCSIsCat",
34400 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034401 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034402 printf(" %d", n_code);
34403 printf(" %d", n_cat);
34404 printf("\n");
34405 }
34406 }
34407 }
34408#endif
34409
34410 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034411 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034412}
34413
34414
34415static int
34416test_xmlUCSIsCatC(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034417 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034418
34419#ifdef LIBXML_UNICODE_ENABLED
34420 int mem_base;
34421 int ret_val;
34422 int code; /* UCS code point */
34423 int n_code;
34424
34425 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34426 mem_base = xmlMemBlocks();
34427 code = gen_int(n_code, 0);
34428
34429 ret_val = xmlUCSIsCatC(code);
34430 desret_int(ret_val);
34431 call_tests++;
34432 des_int(n_code, code, 0);
34433 xmlResetLastError();
34434 if (mem_base != xmlMemBlocks()) {
34435 printf("Leak of %d blocks found in xmlUCSIsCatC",
34436 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034437 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034438 printf(" %d", n_code);
34439 printf("\n");
34440 }
34441 }
34442#endif
34443
34444 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034445 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034446}
34447
34448
34449static int
34450test_xmlUCSIsCatCc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034451 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034452
34453#ifdef LIBXML_UNICODE_ENABLED
34454 int mem_base;
34455 int ret_val;
34456 int code; /* UCS code point */
34457 int n_code;
34458
34459 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34460 mem_base = xmlMemBlocks();
34461 code = gen_int(n_code, 0);
34462
34463 ret_val = xmlUCSIsCatCc(code);
34464 desret_int(ret_val);
34465 call_tests++;
34466 des_int(n_code, code, 0);
34467 xmlResetLastError();
34468 if (mem_base != xmlMemBlocks()) {
34469 printf("Leak of %d blocks found in xmlUCSIsCatCc",
34470 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034471 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034472 printf(" %d", n_code);
34473 printf("\n");
34474 }
34475 }
34476#endif
34477
34478 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034479 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034480}
34481
34482
34483static int
34484test_xmlUCSIsCatCf(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034485 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034486
34487#ifdef LIBXML_UNICODE_ENABLED
34488 int mem_base;
34489 int ret_val;
34490 int code; /* UCS code point */
34491 int n_code;
34492
34493 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34494 mem_base = xmlMemBlocks();
34495 code = gen_int(n_code, 0);
34496
34497 ret_val = xmlUCSIsCatCf(code);
34498 desret_int(ret_val);
34499 call_tests++;
34500 des_int(n_code, code, 0);
34501 xmlResetLastError();
34502 if (mem_base != xmlMemBlocks()) {
34503 printf("Leak of %d blocks found in xmlUCSIsCatCf",
34504 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034505 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034506 printf(" %d", n_code);
34507 printf("\n");
34508 }
34509 }
34510#endif
34511
34512 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034513 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034514}
34515
34516
34517static int
34518test_xmlUCSIsCatCo(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034519 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034520
34521#ifdef LIBXML_UNICODE_ENABLED
34522 int mem_base;
34523 int ret_val;
34524 int code; /* UCS code point */
34525 int n_code;
34526
34527 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34528 mem_base = xmlMemBlocks();
34529 code = gen_int(n_code, 0);
34530
34531 ret_val = xmlUCSIsCatCo(code);
34532 desret_int(ret_val);
34533 call_tests++;
34534 des_int(n_code, code, 0);
34535 xmlResetLastError();
34536 if (mem_base != xmlMemBlocks()) {
34537 printf("Leak of %d blocks found in xmlUCSIsCatCo",
34538 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034539 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034540 printf(" %d", n_code);
34541 printf("\n");
34542 }
34543 }
34544#endif
34545
34546 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034547 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034548}
34549
34550
34551static int
34552test_xmlUCSIsCatCs(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034553 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034554
34555#ifdef LIBXML_UNICODE_ENABLED
34556 int mem_base;
34557 int ret_val;
34558 int code; /* UCS code point */
34559 int n_code;
34560
34561 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34562 mem_base = xmlMemBlocks();
34563 code = gen_int(n_code, 0);
34564
34565 ret_val = xmlUCSIsCatCs(code);
34566 desret_int(ret_val);
34567 call_tests++;
34568 des_int(n_code, code, 0);
34569 xmlResetLastError();
34570 if (mem_base != xmlMemBlocks()) {
34571 printf("Leak of %d blocks found in xmlUCSIsCatCs",
34572 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034573 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034574 printf(" %d", n_code);
34575 printf("\n");
34576 }
34577 }
34578#endif
34579
34580 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034581 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034582}
34583
34584
34585static int
34586test_xmlUCSIsCatL(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034587 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034588
34589#ifdef LIBXML_UNICODE_ENABLED
34590 int mem_base;
34591 int ret_val;
34592 int code; /* UCS code point */
34593 int n_code;
34594
34595 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34596 mem_base = xmlMemBlocks();
34597 code = gen_int(n_code, 0);
34598
34599 ret_val = xmlUCSIsCatL(code);
34600 desret_int(ret_val);
34601 call_tests++;
34602 des_int(n_code, code, 0);
34603 xmlResetLastError();
34604 if (mem_base != xmlMemBlocks()) {
34605 printf("Leak of %d blocks found in xmlUCSIsCatL",
34606 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034607 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034608 printf(" %d", n_code);
34609 printf("\n");
34610 }
34611 }
34612#endif
34613
34614 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034615 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034616}
34617
34618
34619static int
34620test_xmlUCSIsCatLl(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034621 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034622
34623#ifdef LIBXML_UNICODE_ENABLED
34624 int mem_base;
34625 int ret_val;
34626 int code; /* UCS code point */
34627 int n_code;
34628
34629 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34630 mem_base = xmlMemBlocks();
34631 code = gen_int(n_code, 0);
34632
34633 ret_val = xmlUCSIsCatLl(code);
34634 desret_int(ret_val);
34635 call_tests++;
34636 des_int(n_code, code, 0);
34637 xmlResetLastError();
34638 if (mem_base != xmlMemBlocks()) {
34639 printf("Leak of %d blocks found in xmlUCSIsCatLl",
34640 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034641 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034642 printf(" %d", n_code);
34643 printf("\n");
34644 }
34645 }
34646#endif
34647
34648 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034649 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034650}
34651
34652
34653static int
34654test_xmlUCSIsCatLm(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034655 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034656
34657#ifdef LIBXML_UNICODE_ENABLED
34658 int mem_base;
34659 int ret_val;
34660 int code; /* UCS code point */
34661 int n_code;
34662
34663 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34664 mem_base = xmlMemBlocks();
34665 code = gen_int(n_code, 0);
34666
34667 ret_val = xmlUCSIsCatLm(code);
34668 desret_int(ret_val);
34669 call_tests++;
34670 des_int(n_code, code, 0);
34671 xmlResetLastError();
34672 if (mem_base != xmlMemBlocks()) {
34673 printf("Leak of %d blocks found in xmlUCSIsCatLm",
34674 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034675 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034676 printf(" %d", n_code);
34677 printf("\n");
34678 }
34679 }
34680#endif
34681
34682 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034683 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034684}
34685
34686
34687static int
34688test_xmlUCSIsCatLo(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034689 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034690
34691#ifdef LIBXML_UNICODE_ENABLED
34692 int mem_base;
34693 int ret_val;
34694 int code; /* UCS code point */
34695 int n_code;
34696
34697 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34698 mem_base = xmlMemBlocks();
34699 code = gen_int(n_code, 0);
34700
34701 ret_val = xmlUCSIsCatLo(code);
34702 desret_int(ret_val);
34703 call_tests++;
34704 des_int(n_code, code, 0);
34705 xmlResetLastError();
34706 if (mem_base != xmlMemBlocks()) {
34707 printf("Leak of %d blocks found in xmlUCSIsCatLo",
34708 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034709 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034710 printf(" %d", n_code);
34711 printf("\n");
34712 }
34713 }
34714#endif
34715
34716 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034717 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034718}
34719
34720
34721static int
34722test_xmlUCSIsCatLt(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034723 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034724
34725#ifdef LIBXML_UNICODE_ENABLED
34726 int mem_base;
34727 int ret_val;
34728 int code; /* UCS code point */
34729 int n_code;
34730
34731 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34732 mem_base = xmlMemBlocks();
34733 code = gen_int(n_code, 0);
34734
34735 ret_val = xmlUCSIsCatLt(code);
34736 desret_int(ret_val);
34737 call_tests++;
34738 des_int(n_code, code, 0);
34739 xmlResetLastError();
34740 if (mem_base != xmlMemBlocks()) {
34741 printf("Leak of %d blocks found in xmlUCSIsCatLt",
34742 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034743 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034744 printf(" %d", n_code);
34745 printf("\n");
34746 }
34747 }
34748#endif
34749
34750 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034751 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034752}
34753
34754
34755static int
34756test_xmlUCSIsCatLu(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034757 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034758
34759#ifdef LIBXML_UNICODE_ENABLED
34760 int mem_base;
34761 int ret_val;
34762 int code; /* UCS code point */
34763 int n_code;
34764
34765 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34766 mem_base = xmlMemBlocks();
34767 code = gen_int(n_code, 0);
34768
34769 ret_val = xmlUCSIsCatLu(code);
34770 desret_int(ret_val);
34771 call_tests++;
34772 des_int(n_code, code, 0);
34773 xmlResetLastError();
34774 if (mem_base != xmlMemBlocks()) {
34775 printf("Leak of %d blocks found in xmlUCSIsCatLu",
34776 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034777 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034778 printf(" %d", n_code);
34779 printf("\n");
34780 }
34781 }
34782#endif
34783
34784 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034785 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034786}
34787
34788
34789static int
34790test_xmlUCSIsCatM(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034791 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034792
34793#ifdef LIBXML_UNICODE_ENABLED
34794 int mem_base;
34795 int ret_val;
34796 int code; /* UCS code point */
34797 int n_code;
34798
34799 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34800 mem_base = xmlMemBlocks();
34801 code = gen_int(n_code, 0);
34802
34803 ret_val = xmlUCSIsCatM(code);
34804 desret_int(ret_val);
34805 call_tests++;
34806 des_int(n_code, code, 0);
34807 xmlResetLastError();
34808 if (mem_base != xmlMemBlocks()) {
34809 printf("Leak of %d blocks found in xmlUCSIsCatM",
34810 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034811 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034812 printf(" %d", n_code);
34813 printf("\n");
34814 }
34815 }
34816#endif
34817
34818 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034819 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034820}
34821
34822
34823static int
34824test_xmlUCSIsCatMc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034825 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034826
34827#ifdef LIBXML_UNICODE_ENABLED
34828 int mem_base;
34829 int ret_val;
34830 int code; /* UCS code point */
34831 int n_code;
34832
34833 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34834 mem_base = xmlMemBlocks();
34835 code = gen_int(n_code, 0);
34836
34837 ret_val = xmlUCSIsCatMc(code);
34838 desret_int(ret_val);
34839 call_tests++;
34840 des_int(n_code, code, 0);
34841 xmlResetLastError();
34842 if (mem_base != xmlMemBlocks()) {
34843 printf("Leak of %d blocks found in xmlUCSIsCatMc",
34844 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034845 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034846 printf(" %d", n_code);
34847 printf("\n");
34848 }
34849 }
34850#endif
34851
34852 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034853 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034854}
34855
34856
34857static int
34858test_xmlUCSIsCatMe(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034859 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034860
34861#ifdef LIBXML_UNICODE_ENABLED
34862 int mem_base;
34863 int ret_val;
34864 int code; /* UCS code point */
34865 int n_code;
34866
34867 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34868 mem_base = xmlMemBlocks();
34869 code = gen_int(n_code, 0);
34870
34871 ret_val = xmlUCSIsCatMe(code);
34872 desret_int(ret_val);
34873 call_tests++;
34874 des_int(n_code, code, 0);
34875 xmlResetLastError();
34876 if (mem_base != xmlMemBlocks()) {
34877 printf("Leak of %d blocks found in xmlUCSIsCatMe",
34878 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034879 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034880 printf(" %d", n_code);
34881 printf("\n");
34882 }
34883 }
34884#endif
34885
34886 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034887 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034888}
34889
34890
34891static int
34892test_xmlUCSIsCatMn(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034893 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034894
34895#ifdef LIBXML_UNICODE_ENABLED
34896 int mem_base;
34897 int ret_val;
34898 int code; /* UCS code point */
34899 int n_code;
34900
34901 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34902 mem_base = xmlMemBlocks();
34903 code = gen_int(n_code, 0);
34904
34905 ret_val = xmlUCSIsCatMn(code);
34906 desret_int(ret_val);
34907 call_tests++;
34908 des_int(n_code, code, 0);
34909 xmlResetLastError();
34910 if (mem_base != xmlMemBlocks()) {
34911 printf("Leak of %d blocks found in xmlUCSIsCatMn",
34912 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034913 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034914 printf(" %d", n_code);
34915 printf("\n");
34916 }
34917 }
34918#endif
34919
34920 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034921 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034922}
34923
34924
34925static int
34926test_xmlUCSIsCatN(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034927 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034928
34929#ifdef LIBXML_UNICODE_ENABLED
34930 int mem_base;
34931 int ret_val;
34932 int code; /* UCS code point */
34933 int n_code;
34934
34935 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34936 mem_base = xmlMemBlocks();
34937 code = gen_int(n_code, 0);
34938
34939 ret_val = xmlUCSIsCatN(code);
34940 desret_int(ret_val);
34941 call_tests++;
34942 des_int(n_code, code, 0);
34943 xmlResetLastError();
34944 if (mem_base != xmlMemBlocks()) {
34945 printf("Leak of %d blocks found in xmlUCSIsCatN",
34946 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034947 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034948 printf(" %d", n_code);
34949 printf("\n");
34950 }
34951 }
34952#endif
34953
34954 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034955 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034956}
34957
34958
34959static int
34960test_xmlUCSIsCatNd(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034961 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034962
34963#ifdef LIBXML_UNICODE_ENABLED
34964 int mem_base;
34965 int ret_val;
34966 int code; /* UCS code point */
34967 int n_code;
34968
34969 for (n_code = 0;n_code < gen_nb_int;n_code++) {
34970 mem_base = xmlMemBlocks();
34971 code = gen_int(n_code, 0);
34972
34973 ret_val = xmlUCSIsCatNd(code);
34974 desret_int(ret_val);
34975 call_tests++;
34976 des_int(n_code, code, 0);
34977 xmlResetLastError();
34978 if (mem_base != xmlMemBlocks()) {
34979 printf("Leak of %d blocks found in xmlUCSIsCatNd",
34980 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000034981 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034982 printf(" %d", n_code);
34983 printf("\n");
34984 }
34985 }
34986#endif
34987
34988 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000034989 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034990}
34991
34992
34993static int
34994test_xmlUCSIsCatNl(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000034995 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000034996
34997#ifdef LIBXML_UNICODE_ENABLED
34998 int mem_base;
34999 int ret_val;
35000 int code; /* UCS code point */
35001 int n_code;
35002
35003 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35004 mem_base = xmlMemBlocks();
35005 code = gen_int(n_code, 0);
35006
35007 ret_val = xmlUCSIsCatNl(code);
35008 desret_int(ret_val);
35009 call_tests++;
35010 des_int(n_code, code, 0);
35011 xmlResetLastError();
35012 if (mem_base != xmlMemBlocks()) {
35013 printf("Leak of %d blocks found in xmlUCSIsCatNl",
35014 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035015 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035016 printf(" %d", n_code);
35017 printf("\n");
35018 }
35019 }
35020#endif
35021
35022 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035023 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035024}
35025
35026
35027static int
35028test_xmlUCSIsCatNo(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035029 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035030
35031#ifdef LIBXML_UNICODE_ENABLED
35032 int mem_base;
35033 int ret_val;
35034 int code; /* UCS code point */
35035 int n_code;
35036
35037 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35038 mem_base = xmlMemBlocks();
35039 code = gen_int(n_code, 0);
35040
35041 ret_val = xmlUCSIsCatNo(code);
35042 desret_int(ret_val);
35043 call_tests++;
35044 des_int(n_code, code, 0);
35045 xmlResetLastError();
35046 if (mem_base != xmlMemBlocks()) {
35047 printf("Leak of %d blocks found in xmlUCSIsCatNo",
35048 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035049 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035050 printf(" %d", n_code);
35051 printf("\n");
35052 }
35053 }
35054#endif
35055
35056 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035057 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035058}
35059
35060
35061static int
35062test_xmlUCSIsCatP(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035063 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035064
35065#ifdef LIBXML_UNICODE_ENABLED
35066 int mem_base;
35067 int ret_val;
35068 int code; /* UCS code point */
35069 int n_code;
35070
35071 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35072 mem_base = xmlMemBlocks();
35073 code = gen_int(n_code, 0);
35074
35075 ret_val = xmlUCSIsCatP(code);
35076 desret_int(ret_val);
35077 call_tests++;
35078 des_int(n_code, code, 0);
35079 xmlResetLastError();
35080 if (mem_base != xmlMemBlocks()) {
35081 printf("Leak of %d blocks found in xmlUCSIsCatP",
35082 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035083 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035084 printf(" %d", n_code);
35085 printf("\n");
35086 }
35087 }
35088#endif
35089
35090 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035091 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035092}
35093
35094
35095static int
35096test_xmlUCSIsCatPc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035097 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035098
35099#ifdef LIBXML_UNICODE_ENABLED
35100 int mem_base;
35101 int ret_val;
35102 int code; /* UCS code point */
35103 int n_code;
35104
35105 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35106 mem_base = xmlMemBlocks();
35107 code = gen_int(n_code, 0);
35108
35109 ret_val = xmlUCSIsCatPc(code);
35110 desret_int(ret_val);
35111 call_tests++;
35112 des_int(n_code, code, 0);
35113 xmlResetLastError();
35114 if (mem_base != xmlMemBlocks()) {
35115 printf("Leak of %d blocks found in xmlUCSIsCatPc",
35116 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035117 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035118 printf(" %d", n_code);
35119 printf("\n");
35120 }
35121 }
35122#endif
35123
35124 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035125 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035126}
35127
35128
35129static int
35130test_xmlUCSIsCatPd(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035131 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035132
35133#ifdef LIBXML_UNICODE_ENABLED
35134 int mem_base;
35135 int ret_val;
35136 int code; /* UCS code point */
35137 int n_code;
35138
35139 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35140 mem_base = xmlMemBlocks();
35141 code = gen_int(n_code, 0);
35142
35143 ret_val = xmlUCSIsCatPd(code);
35144 desret_int(ret_val);
35145 call_tests++;
35146 des_int(n_code, code, 0);
35147 xmlResetLastError();
35148 if (mem_base != xmlMemBlocks()) {
35149 printf("Leak of %d blocks found in xmlUCSIsCatPd",
35150 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035151 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035152 printf(" %d", n_code);
35153 printf("\n");
35154 }
35155 }
35156#endif
35157
35158 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035159 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035160}
35161
35162
35163static int
35164test_xmlUCSIsCatPe(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035165 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035166
35167#ifdef LIBXML_UNICODE_ENABLED
35168 int mem_base;
35169 int ret_val;
35170 int code; /* UCS code point */
35171 int n_code;
35172
35173 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35174 mem_base = xmlMemBlocks();
35175 code = gen_int(n_code, 0);
35176
35177 ret_val = xmlUCSIsCatPe(code);
35178 desret_int(ret_val);
35179 call_tests++;
35180 des_int(n_code, code, 0);
35181 xmlResetLastError();
35182 if (mem_base != xmlMemBlocks()) {
35183 printf("Leak of %d blocks found in xmlUCSIsCatPe",
35184 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035185 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035186 printf(" %d", n_code);
35187 printf("\n");
35188 }
35189 }
35190#endif
35191
35192 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035193 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035194}
35195
35196
35197static int
35198test_xmlUCSIsCatPf(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035199 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035200
35201#ifdef LIBXML_UNICODE_ENABLED
35202 int mem_base;
35203 int ret_val;
35204 int code; /* UCS code point */
35205 int n_code;
35206
35207 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35208 mem_base = xmlMemBlocks();
35209 code = gen_int(n_code, 0);
35210
35211 ret_val = xmlUCSIsCatPf(code);
35212 desret_int(ret_val);
35213 call_tests++;
35214 des_int(n_code, code, 0);
35215 xmlResetLastError();
35216 if (mem_base != xmlMemBlocks()) {
35217 printf("Leak of %d blocks found in xmlUCSIsCatPf",
35218 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035219 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035220 printf(" %d", n_code);
35221 printf("\n");
35222 }
35223 }
35224#endif
35225
35226 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035227 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035228}
35229
35230
35231static int
35232test_xmlUCSIsCatPi(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035233 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035234
35235#ifdef LIBXML_UNICODE_ENABLED
35236 int mem_base;
35237 int ret_val;
35238 int code; /* UCS code point */
35239 int n_code;
35240
35241 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35242 mem_base = xmlMemBlocks();
35243 code = gen_int(n_code, 0);
35244
35245 ret_val = xmlUCSIsCatPi(code);
35246 desret_int(ret_val);
35247 call_tests++;
35248 des_int(n_code, code, 0);
35249 xmlResetLastError();
35250 if (mem_base != xmlMemBlocks()) {
35251 printf("Leak of %d blocks found in xmlUCSIsCatPi",
35252 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035253 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035254 printf(" %d", n_code);
35255 printf("\n");
35256 }
35257 }
35258#endif
35259
35260 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035261 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035262}
35263
35264
35265static int
35266test_xmlUCSIsCatPo(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035267 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035268
35269#ifdef LIBXML_UNICODE_ENABLED
35270 int mem_base;
35271 int ret_val;
35272 int code; /* UCS code point */
35273 int n_code;
35274
35275 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35276 mem_base = xmlMemBlocks();
35277 code = gen_int(n_code, 0);
35278
35279 ret_val = xmlUCSIsCatPo(code);
35280 desret_int(ret_val);
35281 call_tests++;
35282 des_int(n_code, code, 0);
35283 xmlResetLastError();
35284 if (mem_base != xmlMemBlocks()) {
35285 printf("Leak of %d blocks found in xmlUCSIsCatPo",
35286 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035287 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035288 printf(" %d", n_code);
35289 printf("\n");
35290 }
35291 }
35292#endif
35293
35294 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035295 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035296}
35297
35298
35299static int
35300test_xmlUCSIsCatPs(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035301 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035302
35303#ifdef LIBXML_UNICODE_ENABLED
35304 int mem_base;
35305 int ret_val;
35306 int code; /* UCS code point */
35307 int n_code;
35308
35309 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35310 mem_base = xmlMemBlocks();
35311 code = gen_int(n_code, 0);
35312
35313 ret_val = xmlUCSIsCatPs(code);
35314 desret_int(ret_val);
35315 call_tests++;
35316 des_int(n_code, code, 0);
35317 xmlResetLastError();
35318 if (mem_base != xmlMemBlocks()) {
35319 printf("Leak of %d blocks found in xmlUCSIsCatPs",
35320 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035321 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035322 printf(" %d", n_code);
35323 printf("\n");
35324 }
35325 }
35326#endif
35327
35328 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035329 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035330}
35331
35332
35333static int
35334test_xmlUCSIsCatS(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035335 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035336
35337#ifdef LIBXML_UNICODE_ENABLED
35338 int mem_base;
35339 int ret_val;
35340 int code; /* UCS code point */
35341 int n_code;
35342
35343 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35344 mem_base = xmlMemBlocks();
35345 code = gen_int(n_code, 0);
35346
35347 ret_val = xmlUCSIsCatS(code);
35348 desret_int(ret_val);
35349 call_tests++;
35350 des_int(n_code, code, 0);
35351 xmlResetLastError();
35352 if (mem_base != xmlMemBlocks()) {
35353 printf("Leak of %d blocks found in xmlUCSIsCatS",
35354 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035355 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035356 printf(" %d", n_code);
35357 printf("\n");
35358 }
35359 }
35360#endif
35361
35362 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035363 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035364}
35365
35366
35367static int
35368test_xmlUCSIsCatSc(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035369 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035370
35371#ifdef LIBXML_UNICODE_ENABLED
35372 int mem_base;
35373 int ret_val;
35374 int code; /* UCS code point */
35375 int n_code;
35376
35377 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35378 mem_base = xmlMemBlocks();
35379 code = gen_int(n_code, 0);
35380
35381 ret_val = xmlUCSIsCatSc(code);
35382 desret_int(ret_val);
35383 call_tests++;
35384 des_int(n_code, code, 0);
35385 xmlResetLastError();
35386 if (mem_base != xmlMemBlocks()) {
35387 printf("Leak of %d blocks found in xmlUCSIsCatSc",
35388 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035389 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035390 printf(" %d", n_code);
35391 printf("\n");
35392 }
35393 }
35394#endif
35395
35396 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035397 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035398}
35399
35400
35401static int
35402test_xmlUCSIsCatSk(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035403 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035404
35405#ifdef LIBXML_UNICODE_ENABLED
35406 int mem_base;
35407 int ret_val;
35408 int code; /* UCS code point */
35409 int n_code;
35410
35411 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35412 mem_base = xmlMemBlocks();
35413 code = gen_int(n_code, 0);
35414
35415 ret_val = xmlUCSIsCatSk(code);
35416 desret_int(ret_val);
35417 call_tests++;
35418 des_int(n_code, code, 0);
35419 xmlResetLastError();
35420 if (mem_base != xmlMemBlocks()) {
35421 printf("Leak of %d blocks found in xmlUCSIsCatSk",
35422 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035423 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035424 printf(" %d", n_code);
35425 printf("\n");
35426 }
35427 }
35428#endif
35429
35430 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035431 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035432}
35433
35434
35435static int
35436test_xmlUCSIsCatSm(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035437 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035438
35439#ifdef LIBXML_UNICODE_ENABLED
35440 int mem_base;
35441 int ret_val;
35442 int code; /* UCS code point */
35443 int n_code;
35444
35445 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35446 mem_base = xmlMemBlocks();
35447 code = gen_int(n_code, 0);
35448
35449 ret_val = xmlUCSIsCatSm(code);
35450 desret_int(ret_val);
35451 call_tests++;
35452 des_int(n_code, code, 0);
35453 xmlResetLastError();
35454 if (mem_base != xmlMemBlocks()) {
35455 printf("Leak of %d blocks found in xmlUCSIsCatSm",
35456 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035457 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035458 printf(" %d", n_code);
35459 printf("\n");
35460 }
35461 }
35462#endif
35463
35464 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035465 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035466}
35467
35468
35469static int
35470test_xmlUCSIsCatSo(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035471 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035472
35473#ifdef LIBXML_UNICODE_ENABLED
35474 int mem_base;
35475 int ret_val;
35476 int code; /* UCS code point */
35477 int n_code;
35478
35479 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35480 mem_base = xmlMemBlocks();
35481 code = gen_int(n_code, 0);
35482
35483 ret_val = xmlUCSIsCatSo(code);
35484 desret_int(ret_val);
35485 call_tests++;
35486 des_int(n_code, code, 0);
35487 xmlResetLastError();
35488 if (mem_base != xmlMemBlocks()) {
35489 printf("Leak of %d blocks found in xmlUCSIsCatSo",
35490 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035491 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035492 printf(" %d", n_code);
35493 printf("\n");
35494 }
35495 }
35496#endif
35497
35498 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035499 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035500}
35501
35502
35503static int
35504test_xmlUCSIsCatZ(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035505 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035506
35507#ifdef LIBXML_UNICODE_ENABLED
35508 int mem_base;
35509 int ret_val;
35510 int code; /* UCS code point */
35511 int n_code;
35512
35513 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35514 mem_base = xmlMemBlocks();
35515 code = gen_int(n_code, 0);
35516
35517 ret_val = xmlUCSIsCatZ(code);
35518 desret_int(ret_val);
35519 call_tests++;
35520 des_int(n_code, code, 0);
35521 xmlResetLastError();
35522 if (mem_base != xmlMemBlocks()) {
35523 printf("Leak of %d blocks found in xmlUCSIsCatZ",
35524 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035525 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035526 printf(" %d", n_code);
35527 printf("\n");
35528 }
35529 }
35530#endif
35531
35532 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035533 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035534}
35535
35536
35537static int
35538test_xmlUCSIsCatZl(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035539 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035540
35541#ifdef LIBXML_UNICODE_ENABLED
35542 int mem_base;
35543 int ret_val;
35544 int code; /* UCS code point */
35545 int n_code;
35546
35547 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35548 mem_base = xmlMemBlocks();
35549 code = gen_int(n_code, 0);
35550
35551 ret_val = xmlUCSIsCatZl(code);
35552 desret_int(ret_val);
35553 call_tests++;
35554 des_int(n_code, code, 0);
35555 xmlResetLastError();
35556 if (mem_base != xmlMemBlocks()) {
35557 printf("Leak of %d blocks found in xmlUCSIsCatZl",
35558 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035559 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035560 printf(" %d", n_code);
35561 printf("\n");
35562 }
35563 }
35564#endif
35565
35566 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035567 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035568}
35569
35570
35571static int
35572test_xmlUCSIsCatZp(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035573 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035574
35575#ifdef LIBXML_UNICODE_ENABLED
35576 int mem_base;
35577 int ret_val;
35578 int code; /* UCS code point */
35579 int n_code;
35580
35581 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35582 mem_base = xmlMemBlocks();
35583 code = gen_int(n_code, 0);
35584
35585 ret_val = xmlUCSIsCatZp(code);
35586 desret_int(ret_val);
35587 call_tests++;
35588 des_int(n_code, code, 0);
35589 xmlResetLastError();
35590 if (mem_base != xmlMemBlocks()) {
35591 printf("Leak of %d blocks found in xmlUCSIsCatZp",
35592 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035593 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035594 printf(" %d", n_code);
35595 printf("\n");
35596 }
35597 }
35598#endif
35599
35600 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035601 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035602}
35603
35604
35605static int
35606test_xmlUCSIsCatZs(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035607 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035608
35609#ifdef LIBXML_UNICODE_ENABLED
35610 int mem_base;
35611 int ret_val;
35612 int code; /* UCS code point */
35613 int n_code;
35614
35615 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35616 mem_base = xmlMemBlocks();
35617 code = gen_int(n_code, 0);
35618
35619 ret_val = xmlUCSIsCatZs(code);
35620 desret_int(ret_val);
35621 call_tests++;
35622 des_int(n_code, code, 0);
35623 xmlResetLastError();
35624 if (mem_base != xmlMemBlocks()) {
35625 printf("Leak of %d blocks found in xmlUCSIsCatZs",
35626 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035627 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035628 printf(" %d", n_code);
35629 printf("\n");
35630 }
35631 }
35632#endif
35633
35634 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035635 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035636}
35637
35638
35639static int
35640test_xmlUCSIsCherokee(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035641 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035642
35643#ifdef LIBXML_UNICODE_ENABLED
35644 int mem_base;
35645 int ret_val;
35646 int code; /* UCS code point */
35647 int n_code;
35648
35649 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35650 mem_base = xmlMemBlocks();
35651 code = gen_int(n_code, 0);
35652
35653 ret_val = xmlUCSIsCherokee(code);
35654 desret_int(ret_val);
35655 call_tests++;
35656 des_int(n_code, code, 0);
35657 xmlResetLastError();
35658 if (mem_base != xmlMemBlocks()) {
35659 printf("Leak of %d blocks found in xmlUCSIsCherokee",
35660 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035661 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035662 printf(" %d", n_code);
35663 printf("\n");
35664 }
35665 }
35666#endif
35667
35668 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035669 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035670}
35671
35672
35673static int
35674test_xmlUCSIsCombiningDiacriticalMarks(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035675 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035676
35677#ifdef LIBXML_UNICODE_ENABLED
35678 int mem_base;
35679 int ret_val;
35680 int code; /* UCS code point */
35681 int n_code;
35682
35683 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35684 mem_base = xmlMemBlocks();
35685 code = gen_int(n_code, 0);
35686
35687 ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
35688 desret_int(ret_val);
35689 call_tests++;
35690 des_int(n_code, code, 0);
35691 xmlResetLastError();
35692 if (mem_base != xmlMemBlocks()) {
35693 printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
35694 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035695 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035696 printf(" %d", n_code);
35697 printf("\n");
35698 }
35699 }
35700#endif
35701
35702 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035703 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035704}
35705
35706
35707static int
35708test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035709 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035710
35711#ifdef LIBXML_UNICODE_ENABLED
35712 int mem_base;
35713 int ret_val;
35714 int code; /* UCS code point */
35715 int n_code;
35716
35717 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35718 mem_base = xmlMemBlocks();
35719 code = gen_int(n_code, 0);
35720
35721 ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
35722 desret_int(ret_val);
35723 call_tests++;
35724 des_int(n_code, code, 0);
35725 xmlResetLastError();
35726 if (mem_base != xmlMemBlocks()) {
35727 printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
35728 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035729 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035730 printf(" %d", n_code);
35731 printf("\n");
35732 }
35733 }
35734#endif
35735
35736 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035737 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035738}
35739
35740
35741static int
35742test_xmlUCSIsCombiningHalfMarks(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035743 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035744
35745#ifdef LIBXML_UNICODE_ENABLED
35746 int mem_base;
35747 int ret_val;
35748 int code; /* UCS code point */
35749 int n_code;
35750
35751 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35752 mem_base = xmlMemBlocks();
35753 code = gen_int(n_code, 0);
35754
35755 ret_val = xmlUCSIsCombiningHalfMarks(code);
35756 desret_int(ret_val);
35757 call_tests++;
35758 des_int(n_code, code, 0);
35759 xmlResetLastError();
35760 if (mem_base != xmlMemBlocks()) {
35761 printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
35762 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035763 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035764 printf(" %d", n_code);
35765 printf("\n");
35766 }
35767 }
35768#endif
35769
35770 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035771 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035772}
35773
35774
35775static int
35776test_xmlUCSIsCombiningMarksforSymbols(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035777 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035778
35779#ifdef LIBXML_UNICODE_ENABLED
35780 int mem_base;
35781 int ret_val;
35782 int code; /* UCS code point */
35783 int n_code;
35784
35785 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35786 mem_base = xmlMemBlocks();
35787 code = gen_int(n_code, 0);
35788
35789 ret_val = xmlUCSIsCombiningMarksforSymbols(code);
35790 desret_int(ret_val);
35791 call_tests++;
35792 des_int(n_code, code, 0);
35793 xmlResetLastError();
35794 if (mem_base != xmlMemBlocks()) {
35795 printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
35796 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035797 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035798 printf(" %d", n_code);
35799 printf("\n");
35800 }
35801 }
35802#endif
35803
35804 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035805 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035806}
35807
35808
35809static int
35810test_xmlUCSIsControlPictures(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035811 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035812
35813#ifdef LIBXML_UNICODE_ENABLED
35814 int mem_base;
35815 int ret_val;
35816 int code; /* UCS code point */
35817 int n_code;
35818
35819 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35820 mem_base = xmlMemBlocks();
35821 code = gen_int(n_code, 0);
35822
35823 ret_val = xmlUCSIsControlPictures(code);
35824 desret_int(ret_val);
35825 call_tests++;
35826 des_int(n_code, code, 0);
35827 xmlResetLastError();
35828 if (mem_base != xmlMemBlocks()) {
35829 printf("Leak of %d blocks found in xmlUCSIsControlPictures",
35830 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035831 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035832 printf(" %d", n_code);
35833 printf("\n");
35834 }
35835 }
35836#endif
35837
35838 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035839 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035840}
35841
35842
35843static int
35844test_xmlUCSIsCurrencySymbols(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035845 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035846
35847#ifdef LIBXML_UNICODE_ENABLED
35848 int mem_base;
35849 int ret_val;
35850 int code; /* UCS code point */
35851 int n_code;
35852
35853 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35854 mem_base = xmlMemBlocks();
35855 code = gen_int(n_code, 0);
35856
35857 ret_val = xmlUCSIsCurrencySymbols(code);
35858 desret_int(ret_val);
35859 call_tests++;
35860 des_int(n_code, code, 0);
35861 xmlResetLastError();
35862 if (mem_base != xmlMemBlocks()) {
35863 printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
35864 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035865 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035866 printf(" %d", n_code);
35867 printf("\n");
35868 }
35869 }
35870#endif
35871
35872 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035873 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035874}
35875
35876
35877static int
35878test_xmlUCSIsCypriotSyllabary(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035879 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035880
35881#ifdef LIBXML_UNICODE_ENABLED
35882 int mem_base;
35883 int ret_val;
35884 int code; /* UCS code point */
35885 int n_code;
35886
35887 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35888 mem_base = xmlMemBlocks();
35889 code = gen_int(n_code, 0);
35890
35891 ret_val = xmlUCSIsCypriotSyllabary(code);
35892 desret_int(ret_val);
35893 call_tests++;
35894 des_int(n_code, code, 0);
35895 xmlResetLastError();
35896 if (mem_base != xmlMemBlocks()) {
35897 printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
35898 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035899 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035900 printf(" %d", n_code);
35901 printf("\n");
35902 }
35903 }
35904#endif
35905
35906 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035907 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035908}
35909
35910
35911static int
35912test_xmlUCSIsCyrillic(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035913 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035914
35915#ifdef LIBXML_UNICODE_ENABLED
35916 int mem_base;
35917 int ret_val;
35918 int code; /* UCS code point */
35919 int n_code;
35920
35921 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35922 mem_base = xmlMemBlocks();
35923 code = gen_int(n_code, 0);
35924
35925 ret_val = xmlUCSIsCyrillic(code);
35926 desret_int(ret_val);
35927 call_tests++;
35928 des_int(n_code, code, 0);
35929 xmlResetLastError();
35930 if (mem_base != xmlMemBlocks()) {
35931 printf("Leak of %d blocks found in xmlUCSIsCyrillic",
35932 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035933 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035934 printf(" %d", n_code);
35935 printf("\n");
35936 }
35937 }
35938#endif
35939
35940 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035941 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035942}
35943
35944
35945static int
35946test_xmlUCSIsCyrillicSupplement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035947 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035948
35949#ifdef LIBXML_UNICODE_ENABLED
35950 int mem_base;
35951 int ret_val;
35952 int code; /* UCS code point */
35953 int n_code;
35954
35955 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35956 mem_base = xmlMemBlocks();
35957 code = gen_int(n_code, 0);
35958
35959 ret_val = xmlUCSIsCyrillicSupplement(code);
35960 desret_int(ret_val);
35961 call_tests++;
35962 des_int(n_code, code, 0);
35963 xmlResetLastError();
35964 if (mem_base != xmlMemBlocks()) {
35965 printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
35966 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000035967 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035968 printf(" %d", n_code);
35969 printf("\n");
35970 }
35971 }
35972#endif
35973
35974 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000035975 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035976}
35977
35978
35979static int
35980test_xmlUCSIsDeseret(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000035981 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000035982
35983#ifdef LIBXML_UNICODE_ENABLED
35984 int mem_base;
35985 int ret_val;
35986 int code; /* UCS code point */
35987 int n_code;
35988
35989 for (n_code = 0;n_code < gen_nb_int;n_code++) {
35990 mem_base = xmlMemBlocks();
35991 code = gen_int(n_code, 0);
35992
35993 ret_val = xmlUCSIsDeseret(code);
35994 desret_int(ret_val);
35995 call_tests++;
35996 des_int(n_code, code, 0);
35997 xmlResetLastError();
35998 if (mem_base != xmlMemBlocks()) {
35999 printf("Leak of %d blocks found in xmlUCSIsDeseret",
36000 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036001 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036002 printf(" %d", n_code);
36003 printf("\n");
36004 }
36005 }
36006#endif
36007
36008 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036009 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036010}
36011
36012
36013static int
36014test_xmlUCSIsDevanagari(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036015 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036016
36017#ifdef LIBXML_UNICODE_ENABLED
36018 int mem_base;
36019 int ret_val;
36020 int code; /* UCS code point */
36021 int n_code;
36022
36023 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36024 mem_base = xmlMemBlocks();
36025 code = gen_int(n_code, 0);
36026
36027 ret_val = xmlUCSIsDevanagari(code);
36028 desret_int(ret_val);
36029 call_tests++;
36030 des_int(n_code, code, 0);
36031 xmlResetLastError();
36032 if (mem_base != xmlMemBlocks()) {
36033 printf("Leak of %d blocks found in xmlUCSIsDevanagari",
36034 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036035 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036036 printf(" %d", n_code);
36037 printf("\n");
36038 }
36039 }
36040#endif
36041
36042 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036043 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036044}
36045
36046
36047static int
36048test_xmlUCSIsDingbats(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036049 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036050
36051#ifdef LIBXML_UNICODE_ENABLED
36052 int mem_base;
36053 int ret_val;
36054 int code; /* UCS code point */
36055 int n_code;
36056
36057 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36058 mem_base = xmlMemBlocks();
36059 code = gen_int(n_code, 0);
36060
36061 ret_val = xmlUCSIsDingbats(code);
36062 desret_int(ret_val);
36063 call_tests++;
36064 des_int(n_code, code, 0);
36065 xmlResetLastError();
36066 if (mem_base != xmlMemBlocks()) {
36067 printf("Leak of %d blocks found in xmlUCSIsDingbats",
36068 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036069 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036070 printf(" %d", n_code);
36071 printf("\n");
36072 }
36073 }
36074#endif
36075
36076 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036077 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036078}
36079
36080
36081static int
36082test_xmlUCSIsEnclosedAlphanumerics(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036083 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036084
36085#ifdef LIBXML_UNICODE_ENABLED
36086 int mem_base;
36087 int ret_val;
36088 int code; /* UCS code point */
36089 int n_code;
36090
36091 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36092 mem_base = xmlMemBlocks();
36093 code = gen_int(n_code, 0);
36094
36095 ret_val = xmlUCSIsEnclosedAlphanumerics(code);
36096 desret_int(ret_val);
36097 call_tests++;
36098 des_int(n_code, code, 0);
36099 xmlResetLastError();
36100 if (mem_base != xmlMemBlocks()) {
36101 printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
36102 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036103 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036104 printf(" %d", n_code);
36105 printf("\n");
36106 }
36107 }
36108#endif
36109
36110 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036111 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036112}
36113
36114
36115static int
36116test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036117 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036118
36119#ifdef LIBXML_UNICODE_ENABLED
36120 int mem_base;
36121 int ret_val;
36122 int code; /* UCS code point */
36123 int n_code;
36124
36125 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36126 mem_base = xmlMemBlocks();
36127 code = gen_int(n_code, 0);
36128
36129 ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
36130 desret_int(ret_val);
36131 call_tests++;
36132 des_int(n_code, code, 0);
36133 xmlResetLastError();
36134 if (mem_base != xmlMemBlocks()) {
36135 printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
36136 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036137 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036138 printf(" %d", n_code);
36139 printf("\n");
36140 }
36141 }
36142#endif
36143
36144 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036145 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036146}
36147
36148
36149static int
36150test_xmlUCSIsEthiopic(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036151 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036152
36153#ifdef LIBXML_UNICODE_ENABLED
36154 int mem_base;
36155 int ret_val;
36156 int code; /* UCS code point */
36157 int n_code;
36158
36159 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36160 mem_base = xmlMemBlocks();
36161 code = gen_int(n_code, 0);
36162
36163 ret_val = xmlUCSIsEthiopic(code);
36164 desret_int(ret_val);
36165 call_tests++;
36166 des_int(n_code, code, 0);
36167 xmlResetLastError();
36168 if (mem_base != xmlMemBlocks()) {
36169 printf("Leak of %d blocks found in xmlUCSIsEthiopic",
36170 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036171 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036172 printf(" %d", n_code);
36173 printf("\n");
36174 }
36175 }
36176#endif
36177
36178 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036179 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036180}
36181
36182
36183static int
36184test_xmlUCSIsGeneralPunctuation(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036185 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036186
36187#ifdef LIBXML_UNICODE_ENABLED
36188 int mem_base;
36189 int ret_val;
36190 int code; /* UCS code point */
36191 int n_code;
36192
36193 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36194 mem_base = xmlMemBlocks();
36195 code = gen_int(n_code, 0);
36196
36197 ret_val = xmlUCSIsGeneralPunctuation(code);
36198 desret_int(ret_val);
36199 call_tests++;
36200 des_int(n_code, code, 0);
36201 xmlResetLastError();
36202 if (mem_base != xmlMemBlocks()) {
36203 printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
36204 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036205 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036206 printf(" %d", n_code);
36207 printf("\n");
36208 }
36209 }
36210#endif
36211
36212 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036213 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036214}
36215
36216
36217static int
36218test_xmlUCSIsGeometricShapes(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036219 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036220
36221#ifdef LIBXML_UNICODE_ENABLED
36222 int mem_base;
36223 int ret_val;
36224 int code; /* UCS code point */
36225 int n_code;
36226
36227 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36228 mem_base = xmlMemBlocks();
36229 code = gen_int(n_code, 0);
36230
36231 ret_val = xmlUCSIsGeometricShapes(code);
36232 desret_int(ret_val);
36233 call_tests++;
36234 des_int(n_code, code, 0);
36235 xmlResetLastError();
36236 if (mem_base != xmlMemBlocks()) {
36237 printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
36238 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036239 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036240 printf(" %d", n_code);
36241 printf("\n");
36242 }
36243 }
36244#endif
36245
36246 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036247 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036248}
36249
36250
36251static int
36252test_xmlUCSIsGeorgian(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036253 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036254
36255#ifdef LIBXML_UNICODE_ENABLED
36256 int mem_base;
36257 int ret_val;
36258 int code; /* UCS code point */
36259 int n_code;
36260
36261 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36262 mem_base = xmlMemBlocks();
36263 code = gen_int(n_code, 0);
36264
36265 ret_val = xmlUCSIsGeorgian(code);
36266 desret_int(ret_val);
36267 call_tests++;
36268 des_int(n_code, code, 0);
36269 xmlResetLastError();
36270 if (mem_base != xmlMemBlocks()) {
36271 printf("Leak of %d blocks found in xmlUCSIsGeorgian",
36272 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036273 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036274 printf(" %d", n_code);
36275 printf("\n");
36276 }
36277 }
36278#endif
36279
36280 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036281 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036282}
36283
36284
36285static int
36286test_xmlUCSIsGothic(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036287 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036288
36289#ifdef LIBXML_UNICODE_ENABLED
36290 int mem_base;
36291 int ret_val;
36292 int code; /* UCS code point */
36293 int n_code;
36294
36295 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36296 mem_base = xmlMemBlocks();
36297 code = gen_int(n_code, 0);
36298
36299 ret_val = xmlUCSIsGothic(code);
36300 desret_int(ret_val);
36301 call_tests++;
36302 des_int(n_code, code, 0);
36303 xmlResetLastError();
36304 if (mem_base != xmlMemBlocks()) {
36305 printf("Leak of %d blocks found in xmlUCSIsGothic",
36306 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036307 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036308 printf(" %d", n_code);
36309 printf("\n");
36310 }
36311 }
36312#endif
36313
36314 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036315 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036316}
36317
36318
36319static int
36320test_xmlUCSIsGreek(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036321 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036322
36323#ifdef LIBXML_UNICODE_ENABLED
36324 int mem_base;
36325 int ret_val;
36326 int code; /* UCS code point */
36327 int n_code;
36328
36329 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36330 mem_base = xmlMemBlocks();
36331 code = gen_int(n_code, 0);
36332
36333 ret_val = xmlUCSIsGreek(code);
36334 desret_int(ret_val);
36335 call_tests++;
36336 des_int(n_code, code, 0);
36337 xmlResetLastError();
36338 if (mem_base != xmlMemBlocks()) {
36339 printf("Leak of %d blocks found in xmlUCSIsGreek",
36340 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036341 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036342 printf(" %d", n_code);
36343 printf("\n");
36344 }
36345 }
36346#endif
36347
36348 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036349 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036350}
36351
36352
36353static int
36354test_xmlUCSIsGreekExtended(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036355 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036356
36357#ifdef LIBXML_UNICODE_ENABLED
36358 int mem_base;
36359 int ret_val;
36360 int code; /* UCS code point */
36361 int n_code;
36362
36363 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36364 mem_base = xmlMemBlocks();
36365 code = gen_int(n_code, 0);
36366
36367 ret_val = xmlUCSIsGreekExtended(code);
36368 desret_int(ret_val);
36369 call_tests++;
36370 des_int(n_code, code, 0);
36371 xmlResetLastError();
36372 if (mem_base != xmlMemBlocks()) {
36373 printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
36374 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036375 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036376 printf(" %d", n_code);
36377 printf("\n");
36378 }
36379 }
36380#endif
36381
36382 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036383 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036384}
36385
36386
36387static int
36388test_xmlUCSIsGreekandCoptic(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036389 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036390
36391#ifdef LIBXML_UNICODE_ENABLED
36392 int mem_base;
36393 int ret_val;
36394 int code; /* UCS code point */
36395 int n_code;
36396
36397 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36398 mem_base = xmlMemBlocks();
36399 code = gen_int(n_code, 0);
36400
36401 ret_val = xmlUCSIsGreekandCoptic(code);
36402 desret_int(ret_val);
36403 call_tests++;
36404 des_int(n_code, code, 0);
36405 xmlResetLastError();
36406 if (mem_base != xmlMemBlocks()) {
36407 printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
36408 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036409 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036410 printf(" %d", n_code);
36411 printf("\n");
36412 }
36413 }
36414#endif
36415
36416 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036417 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036418}
36419
36420
36421static int
36422test_xmlUCSIsGujarati(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036423 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036424
36425#ifdef LIBXML_UNICODE_ENABLED
36426 int mem_base;
36427 int ret_val;
36428 int code; /* UCS code point */
36429 int n_code;
36430
36431 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36432 mem_base = xmlMemBlocks();
36433 code = gen_int(n_code, 0);
36434
36435 ret_val = xmlUCSIsGujarati(code);
36436 desret_int(ret_val);
36437 call_tests++;
36438 des_int(n_code, code, 0);
36439 xmlResetLastError();
36440 if (mem_base != xmlMemBlocks()) {
36441 printf("Leak of %d blocks found in xmlUCSIsGujarati",
36442 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036443 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036444 printf(" %d", n_code);
36445 printf("\n");
36446 }
36447 }
36448#endif
36449
36450 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036451 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036452}
36453
36454
36455static int
36456test_xmlUCSIsGurmukhi(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036457 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036458
36459#ifdef LIBXML_UNICODE_ENABLED
36460 int mem_base;
36461 int ret_val;
36462 int code; /* UCS code point */
36463 int n_code;
36464
36465 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36466 mem_base = xmlMemBlocks();
36467 code = gen_int(n_code, 0);
36468
36469 ret_val = xmlUCSIsGurmukhi(code);
36470 desret_int(ret_val);
36471 call_tests++;
36472 des_int(n_code, code, 0);
36473 xmlResetLastError();
36474 if (mem_base != xmlMemBlocks()) {
36475 printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
36476 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036477 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036478 printf(" %d", n_code);
36479 printf("\n");
36480 }
36481 }
36482#endif
36483
36484 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036485 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036486}
36487
36488
36489static int
36490test_xmlUCSIsHalfwidthandFullwidthForms(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036491 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036492
36493#ifdef LIBXML_UNICODE_ENABLED
36494 int mem_base;
36495 int ret_val;
36496 int code; /* UCS code point */
36497 int n_code;
36498
36499 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36500 mem_base = xmlMemBlocks();
36501 code = gen_int(n_code, 0);
36502
36503 ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
36504 desret_int(ret_val);
36505 call_tests++;
36506 des_int(n_code, code, 0);
36507 xmlResetLastError();
36508 if (mem_base != xmlMemBlocks()) {
36509 printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
36510 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036511 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036512 printf(" %d", n_code);
36513 printf("\n");
36514 }
36515 }
36516#endif
36517
36518 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036519 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036520}
36521
36522
36523static int
36524test_xmlUCSIsHangulCompatibilityJamo(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036525 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036526
36527#ifdef LIBXML_UNICODE_ENABLED
36528 int mem_base;
36529 int ret_val;
36530 int code; /* UCS code point */
36531 int n_code;
36532
36533 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36534 mem_base = xmlMemBlocks();
36535 code = gen_int(n_code, 0);
36536
36537 ret_val = xmlUCSIsHangulCompatibilityJamo(code);
36538 desret_int(ret_val);
36539 call_tests++;
36540 des_int(n_code, code, 0);
36541 xmlResetLastError();
36542 if (mem_base != xmlMemBlocks()) {
36543 printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
36544 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036545 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036546 printf(" %d", n_code);
36547 printf("\n");
36548 }
36549 }
36550#endif
36551
36552 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036553 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036554}
36555
36556
36557static int
36558test_xmlUCSIsHangulJamo(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036559 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036560
36561#ifdef LIBXML_UNICODE_ENABLED
36562 int mem_base;
36563 int ret_val;
36564 int code; /* UCS code point */
36565 int n_code;
36566
36567 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36568 mem_base = xmlMemBlocks();
36569 code = gen_int(n_code, 0);
36570
36571 ret_val = xmlUCSIsHangulJamo(code);
36572 desret_int(ret_val);
36573 call_tests++;
36574 des_int(n_code, code, 0);
36575 xmlResetLastError();
36576 if (mem_base != xmlMemBlocks()) {
36577 printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
36578 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036579 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036580 printf(" %d", n_code);
36581 printf("\n");
36582 }
36583 }
36584#endif
36585
36586 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036587 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036588}
36589
36590
36591static int
36592test_xmlUCSIsHangulSyllables(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036593 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036594
36595#ifdef LIBXML_UNICODE_ENABLED
36596 int mem_base;
36597 int ret_val;
36598 int code; /* UCS code point */
36599 int n_code;
36600
36601 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36602 mem_base = xmlMemBlocks();
36603 code = gen_int(n_code, 0);
36604
36605 ret_val = xmlUCSIsHangulSyllables(code);
36606 desret_int(ret_val);
36607 call_tests++;
36608 des_int(n_code, code, 0);
36609 xmlResetLastError();
36610 if (mem_base != xmlMemBlocks()) {
36611 printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
36612 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036613 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036614 printf(" %d", n_code);
36615 printf("\n");
36616 }
36617 }
36618#endif
36619
36620 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036621 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036622}
36623
36624
36625static int
36626test_xmlUCSIsHanunoo(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036627 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036628
36629#ifdef LIBXML_UNICODE_ENABLED
36630 int mem_base;
36631 int ret_val;
36632 int code; /* UCS code point */
36633 int n_code;
36634
36635 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36636 mem_base = xmlMemBlocks();
36637 code = gen_int(n_code, 0);
36638
36639 ret_val = xmlUCSIsHanunoo(code);
36640 desret_int(ret_val);
36641 call_tests++;
36642 des_int(n_code, code, 0);
36643 xmlResetLastError();
36644 if (mem_base != xmlMemBlocks()) {
36645 printf("Leak of %d blocks found in xmlUCSIsHanunoo",
36646 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036647 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036648 printf(" %d", n_code);
36649 printf("\n");
36650 }
36651 }
36652#endif
36653
36654 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036655 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036656}
36657
36658
36659static int
36660test_xmlUCSIsHebrew(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036661 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036662
36663#ifdef LIBXML_UNICODE_ENABLED
36664 int mem_base;
36665 int ret_val;
36666 int code; /* UCS code point */
36667 int n_code;
36668
36669 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36670 mem_base = xmlMemBlocks();
36671 code = gen_int(n_code, 0);
36672
36673 ret_val = xmlUCSIsHebrew(code);
36674 desret_int(ret_val);
36675 call_tests++;
36676 des_int(n_code, code, 0);
36677 xmlResetLastError();
36678 if (mem_base != xmlMemBlocks()) {
36679 printf("Leak of %d blocks found in xmlUCSIsHebrew",
36680 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036681 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036682 printf(" %d", n_code);
36683 printf("\n");
36684 }
36685 }
36686#endif
36687
36688 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036689 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036690}
36691
36692
36693static int
36694test_xmlUCSIsHighPrivateUseSurrogates(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036695 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036696
36697#ifdef LIBXML_UNICODE_ENABLED
36698 int mem_base;
36699 int ret_val;
36700 int code; /* UCS code point */
36701 int n_code;
36702
36703 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36704 mem_base = xmlMemBlocks();
36705 code = gen_int(n_code, 0);
36706
36707 ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
36708 desret_int(ret_val);
36709 call_tests++;
36710 des_int(n_code, code, 0);
36711 xmlResetLastError();
36712 if (mem_base != xmlMemBlocks()) {
36713 printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
36714 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036715 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036716 printf(" %d", n_code);
36717 printf("\n");
36718 }
36719 }
36720#endif
36721
36722 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036723 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036724}
36725
36726
36727static int
36728test_xmlUCSIsHighSurrogates(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036729 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036730
36731#ifdef LIBXML_UNICODE_ENABLED
36732 int mem_base;
36733 int ret_val;
36734 int code; /* UCS code point */
36735 int n_code;
36736
36737 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36738 mem_base = xmlMemBlocks();
36739 code = gen_int(n_code, 0);
36740
36741 ret_val = xmlUCSIsHighSurrogates(code);
36742 desret_int(ret_val);
36743 call_tests++;
36744 des_int(n_code, code, 0);
36745 xmlResetLastError();
36746 if (mem_base != xmlMemBlocks()) {
36747 printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
36748 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036749 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036750 printf(" %d", n_code);
36751 printf("\n");
36752 }
36753 }
36754#endif
36755
36756 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036757 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036758}
36759
36760
36761static int
36762test_xmlUCSIsHiragana(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036763 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036764
36765#ifdef LIBXML_UNICODE_ENABLED
36766 int mem_base;
36767 int ret_val;
36768 int code; /* UCS code point */
36769 int n_code;
36770
36771 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36772 mem_base = xmlMemBlocks();
36773 code = gen_int(n_code, 0);
36774
36775 ret_val = xmlUCSIsHiragana(code);
36776 desret_int(ret_val);
36777 call_tests++;
36778 des_int(n_code, code, 0);
36779 xmlResetLastError();
36780 if (mem_base != xmlMemBlocks()) {
36781 printf("Leak of %d blocks found in xmlUCSIsHiragana",
36782 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036783 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036784 printf(" %d", n_code);
36785 printf("\n");
36786 }
36787 }
36788#endif
36789
36790 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036791 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036792}
36793
36794
36795static int
36796test_xmlUCSIsIPAExtensions(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036797 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036798
36799#ifdef LIBXML_UNICODE_ENABLED
36800 int mem_base;
36801 int ret_val;
36802 int code; /* UCS code point */
36803 int n_code;
36804
36805 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36806 mem_base = xmlMemBlocks();
36807 code = gen_int(n_code, 0);
36808
36809 ret_val = xmlUCSIsIPAExtensions(code);
36810 desret_int(ret_val);
36811 call_tests++;
36812 des_int(n_code, code, 0);
36813 xmlResetLastError();
36814 if (mem_base != xmlMemBlocks()) {
36815 printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
36816 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036817 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036818 printf(" %d", n_code);
36819 printf("\n");
36820 }
36821 }
36822#endif
36823
36824 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036825 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036826}
36827
36828
36829static int
36830test_xmlUCSIsIdeographicDescriptionCharacters(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036831 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036832
36833#ifdef LIBXML_UNICODE_ENABLED
36834 int mem_base;
36835 int ret_val;
36836 int code; /* UCS code point */
36837 int n_code;
36838
36839 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36840 mem_base = xmlMemBlocks();
36841 code = gen_int(n_code, 0);
36842
36843 ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
36844 desret_int(ret_val);
36845 call_tests++;
36846 des_int(n_code, code, 0);
36847 xmlResetLastError();
36848 if (mem_base != xmlMemBlocks()) {
36849 printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
36850 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036851 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036852 printf(" %d", n_code);
36853 printf("\n");
36854 }
36855 }
36856#endif
36857
36858 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036859 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036860}
36861
36862
36863static int
36864test_xmlUCSIsKanbun(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036865 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036866
36867#ifdef LIBXML_UNICODE_ENABLED
36868 int mem_base;
36869 int ret_val;
36870 int code; /* UCS code point */
36871 int n_code;
36872
36873 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36874 mem_base = xmlMemBlocks();
36875 code = gen_int(n_code, 0);
36876
36877 ret_val = xmlUCSIsKanbun(code);
36878 desret_int(ret_val);
36879 call_tests++;
36880 des_int(n_code, code, 0);
36881 xmlResetLastError();
36882 if (mem_base != xmlMemBlocks()) {
36883 printf("Leak of %d blocks found in xmlUCSIsKanbun",
36884 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036885 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036886 printf(" %d", n_code);
36887 printf("\n");
36888 }
36889 }
36890#endif
36891
36892 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036893 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036894}
36895
36896
36897static int
36898test_xmlUCSIsKangxiRadicals(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036899 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036900
36901#ifdef LIBXML_UNICODE_ENABLED
36902 int mem_base;
36903 int ret_val;
36904 int code; /* UCS code point */
36905 int n_code;
36906
36907 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36908 mem_base = xmlMemBlocks();
36909 code = gen_int(n_code, 0);
36910
36911 ret_val = xmlUCSIsKangxiRadicals(code);
36912 desret_int(ret_val);
36913 call_tests++;
36914 des_int(n_code, code, 0);
36915 xmlResetLastError();
36916 if (mem_base != xmlMemBlocks()) {
36917 printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
36918 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036919 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036920 printf(" %d", n_code);
36921 printf("\n");
36922 }
36923 }
36924#endif
36925
36926 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036927 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036928}
36929
36930
36931static int
36932test_xmlUCSIsKannada(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036933 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036934
36935#ifdef LIBXML_UNICODE_ENABLED
36936 int mem_base;
36937 int ret_val;
36938 int code; /* UCS code point */
36939 int n_code;
36940
36941 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36942 mem_base = xmlMemBlocks();
36943 code = gen_int(n_code, 0);
36944
36945 ret_val = xmlUCSIsKannada(code);
36946 desret_int(ret_val);
36947 call_tests++;
36948 des_int(n_code, code, 0);
36949 xmlResetLastError();
36950 if (mem_base != xmlMemBlocks()) {
36951 printf("Leak of %d blocks found in xmlUCSIsKannada",
36952 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036953 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036954 printf(" %d", n_code);
36955 printf("\n");
36956 }
36957 }
36958#endif
36959
36960 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036961 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036962}
36963
36964
36965static int
36966test_xmlUCSIsKatakana(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000036967 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036968
36969#ifdef LIBXML_UNICODE_ENABLED
36970 int mem_base;
36971 int ret_val;
36972 int code; /* UCS code point */
36973 int n_code;
36974
36975 for (n_code = 0;n_code < gen_nb_int;n_code++) {
36976 mem_base = xmlMemBlocks();
36977 code = gen_int(n_code, 0);
36978
36979 ret_val = xmlUCSIsKatakana(code);
36980 desret_int(ret_val);
36981 call_tests++;
36982 des_int(n_code, code, 0);
36983 xmlResetLastError();
36984 if (mem_base != xmlMemBlocks()) {
36985 printf("Leak of %d blocks found in xmlUCSIsKatakana",
36986 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000036987 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036988 printf(" %d", n_code);
36989 printf("\n");
36990 }
36991 }
36992#endif
36993
36994 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000036995 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000036996}
36997
36998
36999static int
37000test_xmlUCSIsKatakanaPhoneticExtensions(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037001 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037002
37003#ifdef LIBXML_UNICODE_ENABLED
37004 int mem_base;
37005 int ret_val;
37006 int code; /* UCS code point */
37007 int n_code;
37008
37009 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37010 mem_base = xmlMemBlocks();
37011 code = gen_int(n_code, 0);
37012
37013 ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
37014 desret_int(ret_val);
37015 call_tests++;
37016 des_int(n_code, code, 0);
37017 xmlResetLastError();
37018 if (mem_base != xmlMemBlocks()) {
37019 printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
37020 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037021 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037022 printf(" %d", n_code);
37023 printf("\n");
37024 }
37025 }
37026#endif
37027
37028 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037029 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037030}
37031
37032
37033static int
37034test_xmlUCSIsKhmer(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037035 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037036
37037#ifdef LIBXML_UNICODE_ENABLED
37038 int mem_base;
37039 int ret_val;
37040 int code; /* UCS code point */
37041 int n_code;
37042
37043 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37044 mem_base = xmlMemBlocks();
37045 code = gen_int(n_code, 0);
37046
37047 ret_val = xmlUCSIsKhmer(code);
37048 desret_int(ret_val);
37049 call_tests++;
37050 des_int(n_code, code, 0);
37051 xmlResetLastError();
37052 if (mem_base != xmlMemBlocks()) {
37053 printf("Leak of %d blocks found in xmlUCSIsKhmer",
37054 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037055 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037056 printf(" %d", n_code);
37057 printf("\n");
37058 }
37059 }
37060#endif
37061
37062 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037063 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037064}
37065
37066
37067static int
37068test_xmlUCSIsKhmerSymbols(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037069 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037070
37071#ifdef LIBXML_UNICODE_ENABLED
37072 int mem_base;
37073 int ret_val;
37074 int code; /* UCS code point */
37075 int n_code;
37076
37077 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37078 mem_base = xmlMemBlocks();
37079 code = gen_int(n_code, 0);
37080
37081 ret_val = xmlUCSIsKhmerSymbols(code);
37082 desret_int(ret_val);
37083 call_tests++;
37084 des_int(n_code, code, 0);
37085 xmlResetLastError();
37086 if (mem_base != xmlMemBlocks()) {
37087 printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
37088 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037089 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037090 printf(" %d", n_code);
37091 printf("\n");
37092 }
37093 }
37094#endif
37095
37096 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037097 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037098}
37099
37100
37101static int
37102test_xmlUCSIsLao(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037103 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037104
37105#ifdef LIBXML_UNICODE_ENABLED
37106 int mem_base;
37107 int ret_val;
37108 int code; /* UCS code point */
37109 int n_code;
37110
37111 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37112 mem_base = xmlMemBlocks();
37113 code = gen_int(n_code, 0);
37114
37115 ret_val = xmlUCSIsLao(code);
37116 desret_int(ret_val);
37117 call_tests++;
37118 des_int(n_code, code, 0);
37119 xmlResetLastError();
37120 if (mem_base != xmlMemBlocks()) {
37121 printf("Leak of %d blocks found in xmlUCSIsLao",
37122 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037123 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037124 printf(" %d", n_code);
37125 printf("\n");
37126 }
37127 }
37128#endif
37129
37130 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037131 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037132}
37133
37134
37135static int
37136test_xmlUCSIsLatin1Supplement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037137 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037138
37139#ifdef LIBXML_UNICODE_ENABLED
37140 int mem_base;
37141 int ret_val;
37142 int code; /* UCS code point */
37143 int n_code;
37144
37145 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37146 mem_base = xmlMemBlocks();
37147 code = gen_int(n_code, 0);
37148
37149 ret_val = xmlUCSIsLatin1Supplement(code);
37150 desret_int(ret_val);
37151 call_tests++;
37152 des_int(n_code, code, 0);
37153 xmlResetLastError();
37154 if (mem_base != xmlMemBlocks()) {
37155 printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
37156 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037157 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037158 printf(" %d", n_code);
37159 printf("\n");
37160 }
37161 }
37162#endif
37163
37164 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037165 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037166}
37167
37168
37169static int
37170test_xmlUCSIsLatinExtendedA(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037171 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037172
37173#ifdef LIBXML_UNICODE_ENABLED
37174 int mem_base;
37175 int ret_val;
37176 int code; /* UCS code point */
37177 int n_code;
37178
37179 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37180 mem_base = xmlMemBlocks();
37181 code = gen_int(n_code, 0);
37182
37183 ret_val = xmlUCSIsLatinExtendedA(code);
37184 desret_int(ret_val);
37185 call_tests++;
37186 des_int(n_code, code, 0);
37187 xmlResetLastError();
37188 if (mem_base != xmlMemBlocks()) {
37189 printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
37190 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037191 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037192 printf(" %d", n_code);
37193 printf("\n");
37194 }
37195 }
37196#endif
37197
37198 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037199 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037200}
37201
37202
37203static int
37204test_xmlUCSIsLatinExtendedAdditional(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037205 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037206
37207#ifdef LIBXML_UNICODE_ENABLED
37208 int mem_base;
37209 int ret_val;
37210 int code; /* UCS code point */
37211 int n_code;
37212
37213 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37214 mem_base = xmlMemBlocks();
37215 code = gen_int(n_code, 0);
37216
37217 ret_val = xmlUCSIsLatinExtendedAdditional(code);
37218 desret_int(ret_val);
37219 call_tests++;
37220 des_int(n_code, code, 0);
37221 xmlResetLastError();
37222 if (mem_base != xmlMemBlocks()) {
37223 printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
37224 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037225 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037226 printf(" %d", n_code);
37227 printf("\n");
37228 }
37229 }
37230#endif
37231
37232 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037233 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037234}
37235
37236
37237static int
37238test_xmlUCSIsLatinExtendedB(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037239 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037240
37241#ifdef LIBXML_UNICODE_ENABLED
37242 int mem_base;
37243 int ret_val;
37244 int code; /* UCS code point */
37245 int n_code;
37246
37247 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37248 mem_base = xmlMemBlocks();
37249 code = gen_int(n_code, 0);
37250
37251 ret_val = xmlUCSIsLatinExtendedB(code);
37252 desret_int(ret_val);
37253 call_tests++;
37254 des_int(n_code, code, 0);
37255 xmlResetLastError();
37256 if (mem_base != xmlMemBlocks()) {
37257 printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
37258 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037259 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037260 printf(" %d", n_code);
37261 printf("\n");
37262 }
37263 }
37264#endif
37265
37266 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037267 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037268}
37269
37270
37271static int
37272test_xmlUCSIsLetterlikeSymbols(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037273 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037274
37275#ifdef LIBXML_UNICODE_ENABLED
37276 int mem_base;
37277 int ret_val;
37278 int code; /* UCS code point */
37279 int n_code;
37280
37281 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37282 mem_base = xmlMemBlocks();
37283 code = gen_int(n_code, 0);
37284
37285 ret_val = xmlUCSIsLetterlikeSymbols(code);
37286 desret_int(ret_val);
37287 call_tests++;
37288 des_int(n_code, code, 0);
37289 xmlResetLastError();
37290 if (mem_base != xmlMemBlocks()) {
37291 printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
37292 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037293 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037294 printf(" %d", n_code);
37295 printf("\n");
37296 }
37297 }
37298#endif
37299
37300 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037301 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037302}
37303
37304
37305static int
37306test_xmlUCSIsLimbu(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037307 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037308
37309#ifdef LIBXML_UNICODE_ENABLED
37310 int mem_base;
37311 int ret_val;
37312 int code; /* UCS code point */
37313 int n_code;
37314
37315 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37316 mem_base = xmlMemBlocks();
37317 code = gen_int(n_code, 0);
37318
37319 ret_val = xmlUCSIsLimbu(code);
37320 desret_int(ret_val);
37321 call_tests++;
37322 des_int(n_code, code, 0);
37323 xmlResetLastError();
37324 if (mem_base != xmlMemBlocks()) {
37325 printf("Leak of %d blocks found in xmlUCSIsLimbu",
37326 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037327 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037328 printf(" %d", n_code);
37329 printf("\n");
37330 }
37331 }
37332#endif
37333
37334 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037335 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037336}
37337
37338
37339static int
37340test_xmlUCSIsLinearBIdeograms(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037341 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037342
37343#ifdef LIBXML_UNICODE_ENABLED
37344 int mem_base;
37345 int ret_val;
37346 int code; /* UCS code point */
37347 int n_code;
37348
37349 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37350 mem_base = xmlMemBlocks();
37351 code = gen_int(n_code, 0);
37352
37353 ret_val = xmlUCSIsLinearBIdeograms(code);
37354 desret_int(ret_val);
37355 call_tests++;
37356 des_int(n_code, code, 0);
37357 xmlResetLastError();
37358 if (mem_base != xmlMemBlocks()) {
37359 printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
37360 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037361 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037362 printf(" %d", n_code);
37363 printf("\n");
37364 }
37365 }
37366#endif
37367
37368 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037369 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037370}
37371
37372
37373static int
37374test_xmlUCSIsLinearBSyllabary(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037375 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037376
37377#ifdef LIBXML_UNICODE_ENABLED
37378 int mem_base;
37379 int ret_val;
37380 int code; /* UCS code point */
37381 int n_code;
37382
37383 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37384 mem_base = xmlMemBlocks();
37385 code = gen_int(n_code, 0);
37386
37387 ret_val = xmlUCSIsLinearBSyllabary(code);
37388 desret_int(ret_val);
37389 call_tests++;
37390 des_int(n_code, code, 0);
37391 xmlResetLastError();
37392 if (mem_base != xmlMemBlocks()) {
37393 printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
37394 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037395 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037396 printf(" %d", n_code);
37397 printf("\n");
37398 }
37399 }
37400#endif
37401
37402 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037403 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037404}
37405
37406
37407static int
37408test_xmlUCSIsLowSurrogates(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037409 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037410
37411#ifdef LIBXML_UNICODE_ENABLED
37412 int mem_base;
37413 int ret_val;
37414 int code; /* UCS code point */
37415 int n_code;
37416
37417 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37418 mem_base = xmlMemBlocks();
37419 code = gen_int(n_code, 0);
37420
37421 ret_val = xmlUCSIsLowSurrogates(code);
37422 desret_int(ret_val);
37423 call_tests++;
37424 des_int(n_code, code, 0);
37425 xmlResetLastError();
37426 if (mem_base != xmlMemBlocks()) {
37427 printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
37428 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037429 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037430 printf(" %d", n_code);
37431 printf("\n");
37432 }
37433 }
37434#endif
37435
37436 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037437 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037438}
37439
37440
37441static int
37442test_xmlUCSIsMalayalam(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037443 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037444
37445#ifdef LIBXML_UNICODE_ENABLED
37446 int mem_base;
37447 int ret_val;
37448 int code; /* UCS code point */
37449 int n_code;
37450
37451 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37452 mem_base = xmlMemBlocks();
37453 code = gen_int(n_code, 0);
37454
37455 ret_val = xmlUCSIsMalayalam(code);
37456 desret_int(ret_val);
37457 call_tests++;
37458 des_int(n_code, code, 0);
37459 xmlResetLastError();
37460 if (mem_base != xmlMemBlocks()) {
37461 printf("Leak of %d blocks found in xmlUCSIsMalayalam",
37462 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037463 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037464 printf(" %d", n_code);
37465 printf("\n");
37466 }
37467 }
37468#endif
37469
37470 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037471 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037472}
37473
37474
37475static int
37476test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037477 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037478
37479#ifdef LIBXML_UNICODE_ENABLED
37480 int mem_base;
37481 int ret_val;
37482 int code; /* UCS code point */
37483 int n_code;
37484
37485 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37486 mem_base = xmlMemBlocks();
37487 code = gen_int(n_code, 0);
37488
37489 ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
37490 desret_int(ret_val);
37491 call_tests++;
37492 des_int(n_code, code, 0);
37493 xmlResetLastError();
37494 if (mem_base != xmlMemBlocks()) {
37495 printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
37496 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037497 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037498 printf(" %d", n_code);
37499 printf("\n");
37500 }
37501 }
37502#endif
37503
37504 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037505 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037506}
37507
37508
37509static int
37510test_xmlUCSIsMathematicalOperators(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037511 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037512
37513#ifdef LIBXML_UNICODE_ENABLED
37514 int mem_base;
37515 int ret_val;
37516 int code; /* UCS code point */
37517 int n_code;
37518
37519 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37520 mem_base = xmlMemBlocks();
37521 code = gen_int(n_code, 0);
37522
37523 ret_val = xmlUCSIsMathematicalOperators(code);
37524 desret_int(ret_val);
37525 call_tests++;
37526 des_int(n_code, code, 0);
37527 xmlResetLastError();
37528 if (mem_base != xmlMemBlocks()) {
37529 printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
37530 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037531 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037532 printf(" %d", n_code);
37533 printf("\n");
37534 }
37535 }
37536#endif
37537
37538 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037539 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037540}
37541
37542
37543static int
37544test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037545 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037546
37547#ifdef LIBXML_UNICODE_ENABLED
37548 int mem_base;
37549 int ret_val;
37550 int code; /* UCS code point */
37551 int n_code;
37552
37553 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37554 mem_base = xmlMemBlocks();
37555 code = gen_int(n_code, 0);
37556
37557 ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
37558 desret_int(ret_val);
37559 call_tests++;
37560 des_int(n_code, code, 0);
37561 xmlResetLastError();
37562 if (mem_base != xmlMemBlocks()) {
37563 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
37564 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037565 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037566 printf(" %d", n_code);
37567 printf("\n");
37568 }
37569 }
37570#endif
37571
37572 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037573 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037574}
37575
37576
37577static int
37578test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037579 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037580
37581#ifdef LIBXML_UNICODE_ENABLED
37582 int mem_base;
37583 int ret_val;
37584 int code; /* UCS code point */
37585 int n_code;
37586
37587 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37588 mem_base = xmlMemBlocks();
37589 code = gen_int(n_code, 0);
37590
37591 ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
37592 desret_int(ret_val);
37593 call_tests++;
37594 des_int(n_code, code, 0);
37595 xmlResetLastError();
37596 if (mem_base != xmlMemBlocks()) {
37597 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
37598 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037599 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037600 printf(" %d", n_code);
37601 printf("\n");
37602 }
37603 }
37604#endif
37605
37606 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037607 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037608}
37609
37610
37611static int
37612test_xmlUCSIsMiscellaneousSymbols(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037613 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037614
37615#ifdef LIBXML_UNICODE_ENABLED
37616 int mem_base;
37617 int ret_val;
37618 int code; /* UCS code point */
37619 int n_code;
37620
37621 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37622 mem_base = xmlMemBlocks();
37623 code = gen_int(n_code, 0);
37624
37625 ret_val = xmlUCSIsMiscellaneousSymbols(code);
37626 desret_int(ret_val);
37627 call_tests++;
37628 des_int(n_code, code, 0);
37629 xmlResetLastError();
37630 if (mem_base != xmlMemBlocks()) {
37631 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
37632 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037633 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037634 printf(" %d", n_code);
37635 printf("\n");
37636 }
37637 }
37638#endif
37639
37640 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037641 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037642}
37643
37644
37645static int
37646test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037647 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037648
37649#ifdef LIBXML_UNICODE_ENABLED
37650 int mem_base;
37651 int ret_val;
37652 int code; /* UCS code point */
37653 int n_code;
37654
37655 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37656 mem_base = xmlMemBlocks();
37657 code = gen_int(n_code, 0);
37658
37659 ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
37660 desret_int(ret_val);
37661 call_tests++;
37662 des_int(n_code, code, 0);
37663 xmlResetLastError();
37664 if (mem_base != xmlMemBlocks()) {
37665 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
37666 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037667 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037668 printf(" %d", n_code);
37669 printf("\n");
37670 }
37671 }
37672#endif
37673
37674 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037675 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037676}
37677
37678
37679static int
37680test_xmlUCSIsMiscellaneousTechnical(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037681 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037682
37683#ifdef LIBXML_UNICODE_ENABLED
37684 int mem_base;
37685 int ret_val;
37686 int code; /* UCS code point */
37687 int n_code;
37688
37689 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37690 mem_base = xmlMemBlocks();
37691 code = gen_int(n_code, 0);
37692
37693 ret_val = xmlUCSIsMiscellaneousTechnical(code);
37694 desret_int(ret_val);
37695 call_tests++;
37696 des_int(n_code, code, 0);
37697 xmlResetLastError();
37698 if (mem_base != xmlMemBlocks()) {
37699 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
37700 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037701 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037702 printf(" %d", n_code);
37703 printf("\n");
37704 }
37705 }
37706#endif
37707
37708 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037709 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037710}
37711
37712
37713static int
37714test_xmlUCSIsMongolian(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037715 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037716
37717#ifdef LIBXML_UNICODE_ENABLED
37718 int mem_base;
37719 int ret_val;
37720 int code; /* UCS code point */
37721 int n_code;
37722
37723 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37724 mem_base = xmlMemBlocks();
37725 code = gen_int(n_code, 0);
37726
37727 ret_val = xmlUCSIsMongolian(code);
37728 desret_int(ret_val);
37729 call_tests++;
37730 des_int(n_code, code, 0);
37731 xmlResetLastError();
37732 if (mem_base != xmlMemBlocks()) {
37733 printf("Leak of %d blocks found in xmlUCSIsMongolian",
37734 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037735 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037736 printf(" %d", n_code);
37737 printf("\n");
37738 }
37739 }
37740#endif
37741
37742 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037743 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037744}
37745
37746
37747static int
37748test_xmlUCSIsMusicalSymbols(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037749 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037750
37751#ifdef LIBXML_UNICODE_ENABLED
37752 int mem_base;
37753 int ret_val;
37754 int code; /* UCS code point */
37755 int n_code;
37756
37757 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37758 mem_base = xmlMemBlocks();
37759 code = gen_int(n_code, 0);
37760
37761 ret_val = xmlUCSIsMusicalSymbols(code);
37762 desret_int(ret_val);
37763 call_tests++;
37764 des_int(n_code, code, 0);
37765 xmlResetLastError();
37766 if (mem_base != xmlMemBlocks()) {
37767 printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
37768 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037769 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037770 printf(" %d", n_code);
37771 printf("\n");
37772 }
37773 }
37774#endif
37775
37776 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037777 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037778}
37779
37780
37781static int
37782test_xmlUCSIsMyanmar(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037783 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037784
37785#ifdef LIBXML_UNICODE_ENABLED
37786 int mem_base;
37787 int ret_val;
37788 int code; /* UCS code point */
37789 int n_code;
37790
37791 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37792 mem_base = xmlMemBlocks();
37793 code = gen_int(n_code, 0);
37794
37795 ret_val = xmlUCSIsMyanmar(code);
37796 desret_int(ret_val);
37797 call_tests++;
37798 des_int(n_code, code, 0);
37799 xmlResetLastError();
37800 if (mem_base != xmlMemBlocks()) {
37801 printf("Leak of %d blocks found in xmlUCSIsMyanmar",
37802 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037803 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037804 printf(" %d", n_code);
37805 printf("\n");
37806 }
37807 }
37808#endif
37809
37810 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037811 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037812}
37813
37814
37815static int
37816test_xmlUCSIsNumberForms(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037817 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037818
37819#ifdef LIBXML_UNICODE_ENABLED
37820 int mem_base;
37821 int ret_val;
37822 int code; /* UCS code point */
37823 int n_code;
37824
37825 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37826 mem_base = xmlMemBlocks();
37827 code = gen_int(n_code, 0);
37828
37829 ret_val = xmlUCSIsNumberForms(code);
37830 desret_int(ret_val);
37831 call_tests++;
37832 des_int(n_code, code, 0);
37833 xmlResetLastError();
37834 if (mem_base != xmlMemBlocks()) {
37835 printf("Leak of %d blocks found in xmlUCSIsNumberForms",
37836 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037837 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037838 printf(" %d", n_code);
37839 printf("\n");
37840 }
37841 }
37842#endif
37843
37844 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037845 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037846}
37847
37848
37849static int
37850test_xmlUCSIsOgham(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037851 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037852
37853#ifdef LIBXML_UNICODE_ENABLED
37854 int mem_base;
37855 int ret_val;
37856 int code; /* UCS code point */
37857 int n_code;
37858
37859 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37860 mem_base = xmlMemBlocks();
37861 code = gen_int(n_code, 0);
37862
37863 ret_val = xmlUCSIsOgham(code);
37864 desret_int(ret_val);
37865 call_tests++;
37866 des_int(n_code, code, 0);
37867 xmlResetLastError();
37868 if (mem_base != xmlMemBlocks()) {
37869 printf("Leak of %d blocks found in xmlUCSIsOgham",
37870 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037871 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037872 printf(" %d", n_code);
37873 printf("\n");
37874 }
37875 }
37876#endif
37877
37878 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037879 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037880}
37881
37882
37883static int
37884test_xmlUCSIsOldItalic(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037885 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037886
37887#ifdef LIBXML_UNICODE_ENABLED
37888 int mem_base;
37889 int ret_val;
37890 int code; /* UCS code point */
37891 int n_code;
37892
37893 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37894 mem_base = xmlMemBlocks();
37895 code = gen_int(n_code, 0);
37896
37897 ret_val = xmlUCSIsOldItalic(code);
37898 desret_int(ret_val);
37899 call_tests++;
37900 des_int(n_code, code, 0);
37901 xmlResetLastError();
37902 if (mem_base != xmlMemBlocks()) {
37903 printf("Leak of %d blocks found in xmlUCSIsOldItalic",
37904 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037905 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037906 printf(" %d", n_code);
37907 printf("\n");
37908 }
37909 }
37910#endif
37911
37912 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037913 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037914}
37915
37916
37917static int
37918test_xmlUCSIsOpticalCharacterRecognition(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037919 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037920
37921#ifdef LIBXML_UNICODE_ENABLED
37922 int mem_base;
37923 int ret_val;
37924 int code; /* UCS code point */
37925 int n_code;
37926
37927 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37928 mem_base = xmlMemBlocks();
37929 code = gen_int(n_code, 0);
37930
37931 ret_val = xmlUCSIsOpticalCharacterRecognition(code);
37932 desret_int(ret_val);
37933 call_tests++;
37934 des_int(n_code, code, 0);
37935 xmlResetLastError();
37936 if (mem_base != xmlMemBlocks()) {
37937 printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
37938 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037939 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037940 printf(" %d", n_code);
37941 printf("\n");
37942 }
37943 }
37944#endif
37945
37946 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037947 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037948}
37949
37950
37951static int
37952test_xmlUCSIsOriya(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037953 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037954
37955#ifdef LIBXML_UNICODE_ENABLED
37956 int mem_base;
37957 int ret_val;
37958 int code; /* UCS code point */
37959 int n_code;
37960
37961 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37962 mem_base = xmlMemBlocks();
37963 code = gen_int(n_code, 0);
37964
37965 ret_val = xmlUCSIsOriya(code);
37966 desret_int(ret_val);
37967 call_tests++;
37968 des_int(n_code, code, 0);
37969 xmlResetLastError();
37970 if (mem_base != xmlMemBlocks()) {
37971 printf("Leak of %d blocks found in xmlUCSIsOriya",
37972 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000037973 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037974 printf(" %d", n_code);
37975 printf("\n");
37976 }
37977 }
37978#endif
37979
37980 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000037981 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037982}
37983
37984
37985static int
37986test_xmlUCSIsOsmanya(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000037987 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000037988
37989#ifdef LIBXML_UNICODE_ENABLED
37990 int mem_base;
37991 int ret_val;
37992 int code; /* UCS code point */
37993 int n_code;
37994
37995 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37996 mem_base = xmlMemBlocks();
37997 code = gen_int(n_code, 0);
37998
37999 ret_val = xmlUCSIsOsmanya(code);
38000 desret_int(ret_val);
38001 call_tests++;
38002 des_int(n_code, code, 0);
38003 xmlResetLastError();
38004 if (mem_base != xmlMemBlocks()) {
38005 printf("Leak of %d blocks found in xmlUCSIsOsmanya",
38006 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038007 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038008 printf(" %d", n_code);
38009 printf("\n");
38010 }
38011 }
38012#endif
38013
38014 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038015 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038016}
38017
38018
38019static int
38020test_xmlUCSIsPhoneticExtensions(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038021 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038022
38023#ifdef LIBXML_UNICODE_ENABLED
38024 int mem_base;
38025 int ret_val;
38026 int code; /* UCS code point */
38027 int n_code;
38028
38029 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38030 mem_base = xmlMemBlocks();
38031 code = gen_int(n_code, 0);
38032
38033 ret_val = xmlUCSIsPhoneticExtensions(code);
38034 desret_int(ret_val);
38035 call_tests++;
38036 des_int(n_code, code, 0);
38037 xmlResetLastError();
38038 if (mem_base != xmlMemBlocks()) {
38039 printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
38040 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038041 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038042 printf(" %d", n_code);
38043 printf("\n");
38044 }
38045 }
38046#endif
38047
38048 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038049 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038050}
38051
38052
38053static int
38054test_xmlUCSIsPrivateUse(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038055 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038056
38057#ifdef LIBXML_UNICODE_ENABLED
38058 int mem_base;
38059 int ret_val;
38060 int code; /* UCS code point */
38061 int n_code;
38062
38063 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38064 mem_base = xmlMemBlocks();
38065 code = gen_int(n_code, 0);
38066
38067 ret_val = xmlUCSIsPrivateUse(code);
38068 desret_int(ret_val);
38069 call_tests++;
38070 des_int(n_code, code, 0);
38071 xmlResetLastError();
38072 if (mem_base != xmlMemBlocks()) {
38073 printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
38074 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038075 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038076 printf(" %d", n_code);
38077 printf("\n");
38078 }
38079 }
38080#endif
38081
38082 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038083 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038084}
38085
38086
38087static int
38088test_xmlUCSIsPrivateUseArea(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038089 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038090
38091#ifdef LIBXML_UNICODE_ENABLED
38092 int mem_base;
38093 int ret_val;
38094 int code; /* UCS code point */
38095 int n_code;
38096
38097 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38098 mem_base = xmlMemBlocks();
38099 code = gen_int(n_code, 0);
38100
38101 ret_val = xmlUCSIsPrivateUseArea(code);
38102 desret_int(ret_val);
38103 call_tests++;
38104 des_int(n_code, code, 0);
38105 xmlResetLastError();
38106 if (mem_base != xmlMemBlocks()) {
38107 printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
38108 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038109 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038110 printf(" %d", n_code);
38111 printf("\n");
38112 }
38113 }
38114#endif
38115
38116 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038117 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038118}
38119
38120
38121static int
38122test_xmlUCSIsRunic(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038123 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038124
38125#ifdef LIBXML_UNICODE_ENABLED
38126 int mem_base;
38127 int ret_val;
38128 int code; /* UCS code point */
38129 int n_code;
38130
38131 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38132 mem_base = xmlMemBlocks();
38133 code = gen_int(n_code, 0);
38134
38135 ret_val = xmlUCSIsRunic(code);
38136 desret_int(ret_val);
38137 call_tests++;
38138 des_int(n_code, code, 0);
38139 xmlResetLastError();
38140 if (mem_base != xmlMemBlocks()) {
38141 printf("Leak of %d blocks found in xmlUCSIsRunic",
38142 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038143 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038144 printf(" %d", n_code);
38145 printf("\n");
38146 }
38147 }
38148#endif
38149
38150 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038151 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038152}
38153
38154
38155static int
38156test_xmlUCSIsShavian(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038157 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038158
38159#ifdef LIBXML_UNICODE_ENABLED
38160 int mem_base;
38161 int ret_val;
38162 int code; /* UCS code point */
38163 int n_code;
38164
38165 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38166 mem_base = xmlMemBlocks();
38167 code = gen_int(n_code, 0);
38168
38169 ret_val = xmlUCSIsShavian(code);
38170 desret_int(ret_val);
38171 call_tests++;
38172 des_int(n_code, code, 0);
38173 xmlResetLastError();
38174 if (mem_base != xmlMemBlocks()) {
38175 printf("Leak of %d blocks found in xmlUCSIsShavian",
38176 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038177 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038178 printf(" %d", n_code);
38179 printf("\n");
38180 }
38181 }
38182#endif
38183
38184 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038185 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038186}
38187
38188
38189static int
38190test_xmlUCSIsSinhala(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038191 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038192
38193#ifdef LIBXML_UNICODE_ENABLED
38194 int mem_base;
38195 int ret_val;
38196 int code; /* UCS code point */
38197 int n_code;
38198
38199 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38200 mem_base = xmlMemBlocks();
38201 code = gen_int(n_code, 0);
38202
38203 ret_val = xmlUCSIsSinhala(code);
38204 desret_int(ret_val);
38205 call_tests++;
38206 des_int(n_code, code, 0);
38207 xmlResetLastError();
38208 if (mem_base != xmlMemBlocks()) {
38209 printf("Leak of %d blocks found in xmlUCSIsSinhala",
38210 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038211 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038212 printf(" %d", n_code);
38213 printf("\n");
38214 }
38215 }
38216#endif
38217
38218 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038219 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038220}
38221
38222
38223static int
38224test_xmlUCSIsSmallFormVariants(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038225 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038226
38227#ifdef LIBXML_UNICODE_ENABLED
38228 int mem_base;
38229 int ret_val;
38230 int code; /* UCS code point */
38231 int n_code;
38232
38233 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38234 mem_base = xmlMemBlocks();
38235 code = gen_int(n_code, 0);
38236
38237 ret_val = xmlUCSIsSmallFormVariants(code);
38238 desret_int(ret_val);
38239 call_tests++;
38240 des_int(n_code, code, 0);
38241 xmlResetLastError();
38242 if (mem_base != xmlMemBlocks()) {
38243 printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
38244 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038245 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038246 printf(" %d", n_code);
38247 printf("\n");
38248 }
38249 }
38250#endif
38251
38252 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038253 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038254}
38255
38256
38257static int
38258test_xmlUCSIsSpacingModifierLetters(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038259 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038260
38261#ifdef LIBXML_UNICODE_ENABLED
38262 int mem_base;
38263 int ret_val;
38264 int code; /* UCS code point */
38265 int n_code;
38266
38267 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38268 mem_base = xmlMemBlocks();
38269 code = gen_int(n_code, 0);
38270
38271 ret_val = xmlUCSIsSpacingModifierLetters(code);
38272 desret_int(ret_val);
38273 call_tests++;
38274 des_int(n_code, code, 0);
38275 xmlResetLastError();
38276 if (mem_base != xmlMemBlocks()) {
38277 printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
38278 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038279 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038280 printf(" %d", n_code);
38281 printf("\n");
38282 }
38283 }
38284#endif
38285
38286 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038287 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038288}
38289
38290
38291static int
38292test_xmlUCSIsSpecials(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038293 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038294
38295#ifdef LIBXML_UNICODE_ENABLED
38296 int mem_base;
38297 int ret_val;
38298 int code; /* UCS code point */
38299 int n_code;
38300
38301 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38302 mem_base = xmlMemBlocks();
38303 code = gen_int(n_code, 0);
38304
38305 ret_val = xmlUCSIsSpecials(code);
38306 desret_int(ret_val);
38307 call_tests++;
38308 des_int(n_code, code, 0);
38309 xmlResetLastError();
38310 if (mem_base != xmlMemBlocks()) {
38311 printf("Leak of %d blocks found in xmlUCSIsSpecials",
38312 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038313 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038314 printf(" %d", n_code);
38315 printf("\n");
38316 }
38317 }
38318#endif
38319
38320 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038321 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038322}
38323
38324
38325static int
38326test_xmlUCSIsSuperscriptsandSubscripts(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038327 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038328
38329#ifdef LIBXML_UNICODE_ENABLED
38330 int mem_base;
38331 int ret_val;
38332 int code; /* UCS code point */
38333 int n_code;
38334
38335 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38336 mem_base = xmlMemBlocks();
38337 code = gen_int(n_code, 0);
38338
38339 ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
38340 desret_int(ret_val);
38341 call_tests++;
38342 des_int(n_code, code, 0);
38343 xmlResetLastError();
38344 if (mem_base != xmlMemBlocks()) {
38345 printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
38346 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038347 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038348 printf(" %d", n_code);
38349 printf("\n");
38350 }
38351 }
38352#endif
38353
38354 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038355 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038356}
38357
38358
38359static int
38360test_xmlUCSIsSupplementalArrowsA(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038361 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038362
38363#ifdef LIBXML_UNICODE_ENABLED
38364 int mem_base;
38365 int ret_val;
38366 int code; /* UCS code point */
38367 int n_code;
38368
38369 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38370 mem_base = xmlMemBlocks();
38371 code = gen_int(n_code, 0);
38372
38373 ret_val = xmlUCSIsSupplementalArrowsA(code);
38374 desret_int(ret_val);
38375 call_tests++;
38376 des_int(n_code, code, 0);
38377 xmlResetLastError();
38378 if (mem_base != xmlMemBlocks()) {
38379 printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
38380 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038381 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038382 printf(" %d", n_code);
38383 printf("\n");
38384 }
38385 }
38386#endif
38387
38388 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038389 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038390}
38391
38392
38393static int
38394test_xmlUCSIsSupplementalArrowsB(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038395 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038396
38397#ifdef LIBXML_UNICODE_ENABLED
38398 int mem_base;
38399 int ret_val;
38400 int code; /* UCS code point */
38401 int n_code;
38402
38403 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38404 mem_base = xmlMemBlocks();
38405 code = gen_int(n_code, 0);
38406
38407 ret_val = xmlUCSIsSupplementalArrowsB(code);
38408 desret_int(ret_val);
38409 call_tests++;
38410 des_int(n_code, code, 0);
38411 xmlResetLastError();
38412 if (mem_base != xmlMemBlocks()) {
38413 printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
38414 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038415 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038416 printf(" %d", n_code);
38417 printf("\n");
38418 }
38419 }
38420#endif
38421
38422 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038423 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038424}
38425
38426
38427static int
38428test_xmlUCSIsSupplementalMathematicalOperators(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038429 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038430
38431#ifdef LIBXML_UNICODE_ENABLED
38432 int mem_base;
38433 int ret_val;
38434 int code; /* UCS code point */
38435 int n_code;
38436
38437 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38438 mem_base = xmlMemBlocks();
38439 code = gen_int(n_code, 0);
38440
38441 ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
38442 desret_int(ret_val);
38443 call_tests++;
38444 des_int(n_code, code, 0);
38445 xmlResetLastError();
38446 if (mem_base != xmlMemBlocks()) {
38447 printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
38448 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038449 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038450 printf(" %d", n_code);
38451 printf("\n");
38452 }
38453 }
38454#endif
38455
38456 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038457 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038458}
38459
38460
38461static int
38462test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038463 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038464
38465#ifdef LIBXML_UNICODE_ENABLED
38466 int mem_base;
38467 int ret_val;
38468 int code; /* UCS code point */
38469 int n_code;
38470
38471 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38472 mem_base = xmlMemBlocks();
38473 code = gen_int(n_code, 0);
38474
38475 ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
38476 desret_int(ret_val);
38477 call_tests++;
38478 des_int(n_code, code, 0);
38479 xmlResetLastError();
38480 if (mem_base != xmlMemBlocks()) {
38481 printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
38482 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038483 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038484 printf(" %d", n_code);
38485 printf("\n");
38486 }
38487 }
38488#endif
38489
38490 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038491 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038492}
38493
38494
38495static int
38496test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038497 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038498
38499#ifdef LIBXML_UNICODE_ENABLED
38500 int mem_base;
38501 int ret_val;
38502 int code; /* UCS code point */
38503 int n_code;
38504
38505 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38506 mem_base = xmlMemBlocks();
38507 code = gen_int(n_code, 0);
38508
38509 ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
38510 desret_int(ret_val);
38511 call_tests++;
38512 des_int(n_code, code, 0);
38513 xmlResetLastError();
38514 if (mem_base != xmlMemBlocks()) {
38515 printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
38516 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038517 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038518 printf(" %d", n_code);
38519 printf("\n");
38520 }
38521 }
38522#endif
38523
38524 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038525 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038526}
38527
38528
38529static int
38530test_xmlUCSIsSyriac(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038531 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038532
38533#ifdef LIBXML_UNICODE_ENABLED
38534 int mem_base;
38535 int ret_val;
38536 int code; /* UCS code point */
38537 int n_code;
38538
38539 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38540 mem_base = xmlMemBlocks();
38541 code = gen_int(n_code, 0);
38542
38543 ret_val = xmlUCSIsSyriac(code);
38544 desret_int(ret_val);
38545 call_tests++;
38546 des_int(n_code, code, 0);
38547 xmlResetLastError();
38548 if (mem_base != xmlMemBlocks()) {
38549 printf("Leak of %d blocks found in xmlUCSIsSyriac",
38550 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038551 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038552 printf(" %d", n_code);
38553 printf("\n");
38554 }
38555 }
38556#endif
38557
38558 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038559 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038560}
38561
38562
38563static int
38564test_xmlUCSIsTagalog(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038565 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038566
38567#ifdef LIBXML_UNICODE_ENABLED
38568 int mem_base;
38569 int ret_val;
38570 int code; /* UCS code point */
38571 int n_code;
38572
38573 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38574 mem_base = xmlMemBlocks();
38575 code = gen_int(n_code, 0);
38576
38577 ret_val = xmlUCSIsTagalog(code);
38578 desret_int(ret_val);
38579 call_tests++;
38580 des_int(n_code, code, 0);
38581 xmlResetLastError();
38582 if (mem_base != xmlMemBlocks()) {
38583 printf("Leak of %d blocks found in xmlUCSIsTagalog",
38584 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038585 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038586 printf(" %d", n_code);
38587 printf("\n");
38588 }
38589 }
38590#endif
38591
38592 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038593 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038594}
38595
38596
38597static int
38598test_xmlUCSIsTagbanwa(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038599 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038600
38601#ifdef LIBXML_UNICODE_ENABLED
38602 int mem_base;
38603 int ret_val;
38604 int code; /* UCS code point */
38605 int n_code;
38606
38607 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38608 mem_base = xmlMemBlocks();
38609 code = gen_int(n_code, 0);
38610
38611 ret_val = xmlUCSIsTagbanwa(code);
38612 desret_int(ret_val);
38613 call_tests++;
38614 des_int(n_code, code, 0);
38615 xmlResetLastError();
38616 if (mem_base != xmlMemBlocks()) {
38617 printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
38618 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038619 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038620 printf(" %d", n_code);
38621 printf("\n");
38622 }
38623 }
38624#endif
38625
38626 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038627 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038628}
38629
38630
38631static int
38632test_xmlUCSIsTags(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038633 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038634
38635#ifdef LIBXML_UNICODE_ENABLED
38636 int mem_base;
38637 int ret_val;
38638 int code; /* UCS code point */
38639 int n_code;
38640
38641 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38642 mem_base = xmlMemBlocks();
38643 code = gen_int(n_code, 0);
38644
38645 ret_val = xmlUCSIsTags(code);
38646 desret_int(ret_val);
38647 call_tests++;
38648 des_int(n_code, code, 0);
38649 xmlResetLastError();
38650 if (mem_base != xmlMemBlocks()) {
38651 printf("Leak of %d blocks found in xmlUCSIsTags",
38652 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038653 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038654 printf(" %d", n_code);
38655 printf("\n");
38656 }
38657 }
38658#endif
38659
38660 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038661 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038662}
38663
38664
38665static int
38666test_xmlUCSIsTaiLe(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038667 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038668
38669#ifdef LIBXML_UNICODE_ENABLED
38670 int mem_base;
38671 int ret_val;
38672 int code; /* UCS code point */
38673 int n_code;
38674
38675 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38676 mem_base = xmlMemBlocks();
38677 code = gen_int(n_code, 0);
38678
38679 ret_val = xmlUCSIsTaiLe(code);
38680 desret_int(ret_val);
38681 call_tests++;
38682 des_int(n_code, code, 0);
38683 xmlResetLastError();
38684 if (mem_base != xmlMemBlocks()) {
38685 printf("Leak of %d blocks found in xmlUCSIsTaiLe",
38686 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038687 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038688 printf(" %d", n_code);
38689 printf("\n");
38690 }
38691 }
38692#endif
38693
38694 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038695 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038696}
38697
38698
38699static int
38700test_xmlUCSIsTaiXuanJingSymbols(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038701 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038702
38703#ifdef LIBXML_UNICODE_ENABLED
38704 int mem_base;
38705 int ret_val;
38706 int code; /* UCS code point */
38707 int n_code;
38708
38709 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38710 mem_base = xmlMemBlocks();
38711 code = gen_int(n_code, 0);
38712
38713 ret_val = xmlUCSIsTaiXuanJingSymbols(code);
38714 desret_int(ret_val);
38715 call_tests++;
38716 des_int(n_code, code, 0);
38717 xmlResetLastError();
38718 if (mem_base != xmlMemBlocks()) {
38719 printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
38720 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038721 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038722 printf(" %d", n_code);
38723 printf("\n");
38724 }
38725 }
38726#endif
38727
38728 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038729 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038730}
38731
38732
38733static int
38734test_xmlUCSIsTamil(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038735 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038736
38737#ifdef LIBXML_UNICODE_ENABLED
38738 int mem_base;
38739 int ret_val;
38740 int code; /* UCS code point */
38741 int n_code;
38742
38743 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38744 mem_base = xmlMemBlocks();
38745 code = gen_int(n_code, 0);
38746
38747 ret_val = xmlUCSIsTamil(code);
38748 desret_int(ret_val);
38749 call_tests++;
38750 des_int(n_code, code, 0);
38751 xmlResetLastError();
38752 if (mem_base != xmlMemBlocks()) {
38753 printf("Leak of %d blocks found in xmlUCSIsTamil",
38754 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038755 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038756 printf(" %d", n_code);
38757 printf("\n");
38758 }
38759 }
38760#endif
38761
38762 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038763 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038764}
38765
38766
38767static int
38768test_xmlUCSIsTelugu(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038769 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038770
38771#ifdef LIBXML_UNICODE_ENABLED
38772 int mem_base;
38773 int ret_val;
38774 int code; /* UCS code point */
38775 int n_code;
38776
38777 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38778 mem_base = xmlMemBlocks();
38779 code = gen_int(n_code, 0);
38780
38781 ret_val = xmlUCSIsTelugu(code);
38782 desret_int(ret_val);
38783 call_tests++;
38784 des_int(n_code, code, 0);
38785 xmlResetLastError();
38786 if (mem_base != xmlMemBlocks()) {
38787 printf("Leak of %d blocks found in xmlUCSIsTelugu",
38788 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038789 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038790 printf(" %d", n_code);
38791 printf("\n");
38792 }
38793 }
38794#endif
38795
38796 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038797 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038798}
38799
38800
38801static int
38802test_xmlUCSIsThaana(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038803 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038804
38805#ifdef LIBXML_UNICODE_ENABLED
38806 int mem_base;
38807 int ret_val;
38808 int code; /* UCS code point */
38809 int n_code;
38810
38811 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38812 mem_base = xmlMemBlocks();
38813 code = gen_int(n_code, 0);
38814
38815 ret_val = xmlUCSIsThaana(code);
38816 desret_int(ret_val);
38817 call_tests++;
38818 des_int(n_code, code, 0);
38819 xmlResetLastError();
38820 if (mem_base != xmlMemBlocks()) {
38821 printf("Leak of %d blocks found in xmlUCSIsThaana",
38822 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038823 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038824 printf(" %d", n_code);
38825 printf("\n");
38826 }
38827 }
38828#endif
38829
38830 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038831 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038832}
38833
38834
38835static int
38836test_xmlUCSIsThai(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038837 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038838
38839#ifdef LIBXML_UNICODE_ENABLED
38840 int mem_base;
38841 int ret_val;
38842 int code; /* UCS code point */
38843 int n_code;
38844
38845 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38846 mem_base = xmlMemBlocks();
38847 code = gen_int(n_code, 0);
38848
38849 ret_val = xmlUCSIsThai(code);
38850 desret_int(ret_val);
38851 call_tests++;
38852 des_int(n_code, code, 0);
38853 xmlResetLastError();
38854 if (mem_base != xmlMemBlocks()) {
38855 printf("Leak of %d blocks found in xmlUCSIsThai",
38856 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038857 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038858 printf(" %d", n_code);
38859 printf("\n");
38860 }
38861 }
38862#endif
38863
38864 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038865 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038866}
38867
38868
38869static int
38870test_xmlUCSIsTibetan(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038871 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038872
38873#ifdef LIBXML_UNICODE_ENABLED
38874 int mem_base;
38875 int ret_val;
38876 int code; /* UCS code point */
38877 int n_code;
38878
38879 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38880 mem_base = xmlMemBlocks();
38881 code = gen_int(n_code, 0);
38882
38883 ret_val = xmlUCSIsTibetan(code);
38884 desret_int(ret_val);
38885 call_tests++;
38886 des_int(n_code, code, 0);
38887 xmlResetLastError();
38888 if (mem_base != xmlMemBlocks()) {
38889 printf("Leak of %d blocks found in xmlUCSIsTibetan",
38890 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038891 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038892 printf(" %d", n_code);
38893 printf("\n");
38894 }
38895 }
38896#endif
38897
38898 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038899 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038900}
38901
38902
38903static int
38904test_xmlUCSIsUgaritic(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038905 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038906
38907#ifdef LIBXML_UNICODE_ENABLED
38908 int mem_base;
38909 int ret_val;
38910 int code; /* UCS code point */
38911 int n_code;
38912
38913 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38914 mem_base = xmlMemBlocks();
38915 code = gen_int(n_code, 0);
38916
38917 ret_val = xmlUCSIsUgaritic(code);
38918 desret_int(ret_val);
38919 call_tests++;
38920 des_int(n_code, code, 0);
38921 xmlResetLastError();
38922 if (mem_base != xmlMemBlocks()) {
38923 printf("Leak of %d blocks found in xmlUCSIsUgaritic",
38924 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038925 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038926 printf(" %d", n_code);
38927 printf("\n");
38928 }
38929 }
38930#endif
38931
38932 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038933 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038934}
38935
38936
38937static int
38938test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038939 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038940
38941#ifdef LIBXML_UNICODE_ENABLED
38942 int mem_base;
38943 int ret_val;
38944 int code; /* UCS code point */
38945 int n_code;
38946
38947 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38948 mem_base = xmlMemBlocks();
38949 code = gen_int(n_code, 0);
38950
38951 ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
38952 desret_int(ret_val);
38953 call_tests++;
38954 des_int(n_code, code, 0);
38955 xmlResetLastError();
38956 if (mem_base != xmlMemBlocks()) {
38957 printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
38958 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038959 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038960 printf(" %d", n_code);
38961 printf("\n");
38962 }
38963 }
38964#endif
38965
38966 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000038967 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038968}
38969
38970
38971static int
38972test_xmlUCSIsVariationSelectors(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000038973 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038974
38975#ifdef LIBXML_UNICODE_ENABLED
38976 int mem_base;
38977 int ret_val;
38978 int code; /* UCS code point */
38979 int n_code;
38980
38981 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38982 mem_base = xmlMemBlocks();
38983 code = gen_int(n_code, 0);
38984
38985 ret_val = xmlUCSIsVariationSelectors(code);
38986 desret_int(ret_val);
38987 call_tests++;
38988 des_int(n_code, code, 0);
38989 xmlResetLastError();
38990 if (mem_base != xmlMemBlocks()) {
38991 printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
38992 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000038993 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000038994 printf(" %d", n_code);
38995 printf("\n");
38996 }
38997 }
38998#endif
38999
39000 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039001 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000039002}
39003
39004
39005static int
39006test_xmlUCSIsVariationSelectorsSupplement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039007 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000039008
39009#ifdef LIBXML_UNICODE_ENABLED
39010 int mem_base;
39011 int ret_val;
39012 int code; /* UCS code point */
39013 int n_code;
39014
39015 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39016 mem_base = xmlMemBlocks();
39017 code = gen_int(n_code, 0);
39018
39019 ret_val = xmlUCSIsVariationSelectorsSupplement(code);
39020 desret_int(ret_val);
39021 call_tests++;
39022 des_int(n_code, code, 0);
39023 xmlResetLastError();
39024 if (mem_base != xmlMemBlocks()) {
39025 printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
39026 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039027 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000039028 printf(" %d", n_code);
39029 printf("\n");
39030 }
39031 }
39032#endif
39033
39034 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039035 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000039036}
39037
39038
39039static int
39040test_xmlUCSIsYiRadicals(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039041 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000039042
39043#ifdef LIBXML_UNICODE_ENABLED
39044 int mem_base;
39045 int ret_val;
39046 int code; /* UCS code point */
39047 int n_code;
39048
39049 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39050 mem_base = xmlMemBlocks();
39051 code = gen_int(n_code, 0);
39052
39053 ret_val = xmlUCSIsYiRadicals(code);
39054 desret_int(ret_val);
39055 call_tests++;
39056 des_int(n_code, code, 0);
39057 xmlResetLastError();
39058 if (mem_base != xmlMemBlocks()) {
39059 printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
39060 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039061 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000039062 printf(" %d", n_code);
39063 printf("\n");
39064 }
39065 }
39066#endif
39067
39068 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039069 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000039070}
39071
39072
39073static int
39074test_xmlUCSIsYiSyllables(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039075 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000039076
39077#ifdef LIBXML_UNICODE_ENABLED
39078 int mem_base;
39079 int ret_val;
39080 int code; /* UCS code point */
39081 int n_code;
39082
39083 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39084 mem_base = xmlMemBlocks();
39085 code = gen_int(n_code, 0);
39086
39087 ret_val = xmlUCSIsYiSyllables(code);
39088 desret_int(ret_val);
39089 call_tests++;
39090 des_int(n_code, code, 0);
39091 xmlResetLastError();
39092 if (mem_base != xmlMemBlocks()) {
39093 printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
39094 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039095 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000039096 printf(" %d", n_code);
39097 printf("\n");
39098 }
39099 }
39100#endif
39101
39102 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039103 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000039104}
39105
39106
39107static int
39108test_xmlUCSIsYijingHexagramSymbols(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039109 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000039110
39111#ifdef LIBXML_UNICODE_ENABLED
39112 int mem_base;
39113 int ret_val;
39114 int code; /* UCS code point */
39115 int n_code;
39116
39117 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39118 mem_base = xmlMemBlocks();
39119 code = gen_int(n_code, 0);
39120
39121 ret_val = xmlUCSIsYijingHexagramSymbols(code);
39122 desret_int(ret_val);
39123 call_tests++;
39124 des_int(n_code, code, 0);
39125 xmlResetLastError();
39126 if (mem_base != xmlMemBlocks()) {
39127 printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
39128 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039129 test_ret++;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000039130 printf(" %d", n_code);
39131 printf("\n");
39132 }
39133 }
39134#endif
39135
39136 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039137 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000039138}
39139
39140static int
39141test_xmlunicode(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039142 int test_ret = 0;
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000039143
39144 printf("Testing xmlunicode : 166 of 166 functions ...\n");
Daniel Veillard42595322004-11-08 10:52:06 +000039145 test_ret += test_xmlUCSIsAegeanNumbers();
39146 test_ret += test_xmlUCSIsAlphabeticPresentationForms();
39147 test_ret += test_xmlUCSIsArabic();
39148 test_ret += test_xmlUCSIsArabicPresentationFormsA();
39149 test_ret += test_xmlUCSIsArabicPresentationFormsB();
39150 test_ret += test_xmlUCSIsArmenian();
39151 test_ret += test_xmlUCSIsArrows();
39152 test_ret += test_xmlUCSIsBasicLatin();
39153 test_ret += test_xmlUCSIsBengali();
39154 test_ret += test_xmlUCSIsBlock();
39155 test_ret += test_xmlUCSIsBlockElements();
39156 test_ret += test_xmlUCSIsBopomofo();
39157 test_ret += test_xmlUCSIsBopomofoExtended();
39158 test_ret += test_xmlUCSIsBoxDrawing();
39159 test_ret += test_xmlUCSIsBraillePatterns();
39160 test_ret += test_xmlUCSIsBuhid();
39161 test_ret += test_xmlUCSIsByzantineMusicalSymbols();
39162 test_ret += test_xmlUCSIsCJKCompatibility();
39163 test_ret += test_xmlUCSIsCJKCompatibilityForms();
39164 test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
39165 test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
39166 test_ret += test_xmlUCSIsCJKRadicalsSupplement();
39167 test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
39168 test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
39169 test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
39170 test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
39171 test_ret += test_xmlUCSIsCat();
39172 test_ret += test_xmlUCSIsCatC();
39173 test_ret += test_xmlUCSIsCatCc();
39174 test_ret += test_xmlUCSIsCatCf();
39175 test_ret += test_xmlUCSIsCatCo();
39176 test_ret += test_xmlUCSIsCatCs();
39177 test_ret += test_xmlUCSIsCatL();
39178 test_ret += test_xmlUCSIsCatLl();
39179 test_ret += test_xmlUCSIsCatLm();
39180 test_ret += test_xmlUCSIsCatLo();
39181 test_ret += test_xmlUCSIsCatLt();
39182 test_ret += test_xmlUCSIsCatLu();
39183 test_ret += test_xmlUCSIsCatM();
39184 test_ret += test_xmlUCSIsCatMc();
39185 test_ret += test_xmlUCSIsCatMe();
39186 test_ret += test_xmlUCSIsCatMn();
39187 test_ret += test_xmlUCSIsCatN();
39188 test_ret += test_xmlUCSIsCatNd();
39189 test_ret += test_xmlUCSIsCatNl();
39190 test_ret += test_xmlUCSIsCatNo();
39191 test_ret += test_xmlUCSIsCatP();
39192 test_ret += test_xmlUCSIsCatPc();
39193 test_ret += test_xmlUCSIsCatPd();
39194 test_ret += test_xmlUCSIsCatPe();
39195 test_ret += test_xmlUCSIsCatPf();
39196 test_ret += test_xmlUCSIsCatPi();
39197 test_ret += test_xmlUCSIsCatPo();
39198 test_ret += test_xmlUCSIsCatPs();
39199 test_ret += test_xmlUCSIsCatS();
39200 test_ret += test_xmlUCSIsCatSc();
39201 test_ret += test_xmlUCSIsCatSk();
39202 test_ret += test_xmlUCSIsCatSm();
39203 test_ret += test_xmlUCSIsCatSo();
39204 test_ret += test_xmlUCSIsCatZ();
39205 test_ret += test_xmlUCSIsCatZl();
39206 test_ret += test_xmlUCSIsCatZp();
39207 test_ret += test_xmlUCSIsCatZs();
39208 test_ret += test_xmlUCSIsCherokee();
39209 test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
39210 test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
39211 test_ret += test_xmlUCSIsCombiningHalfMarks();
39212 test_ret += test_xmlUCSIsCombiningMarksforSymbols();
39213 test_ret += test_xmlUCSIsControlPictures();
39214 test_ret += test_xmlUCSIsCurrencySymbols();
39215 test_ret += test_xmlUCSIsCypriotSyllabary();
39216 test_ret += test_xmlUCSIsCyrillic();
39217 test_ret += test_xmlUCSIsCyrillicSupplement();
39218 test_ret += test_xmlUCSIsDeseret();
39219 test_ret += test_xmlUCSIsDevanagari();
39220 test_ret += test_xmlUCSIsDingbats();
39221 test_ret += test_xmlUCSIsEnclosedAlphanumerics();
39222 test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
39223 test_ret += test_xmlUCSIsEthiopic();
39224 test_ret += test_xmlUCSIsGeneralPunctuation();
39225 test_ret += test_xmlUCSIsGeometricShapes();
39226 test_ret += test_xmlUCSIsGeorgian();
39227 test_ret += test_xmlUCSIsGothic();
39228 test_ret += test_xmlUCSIsGreek();
39229 test_ret += test_xmlUCSIsGreekExtended();
39230 test_ret += test_xmlUCSIsGreekandCoptic();
39231 test_ret += test_xmlUCSIsGujarati();
39232 test_ret += test_xmlUCSIsGurmukhi();
39233 test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
39234 test_ret += test_xmlUCSIsHangulCompatibilityJamo();
39235 test_ret += test_xmlUCSIsHangulJamo();
39236 test_ret += test_xmlUCSIsHangulSyllables();
39237 test_ret += test_xmlUCSIsHanunoo();
39238 test_ret += test_xmlUCSIsHebrew();
39239 test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
39240 test_ret += test_xmlUCSIsHighSurrogates();
39241 test_ret += test_xmlUCSIsHiragana();
39242 test_ret += test_xmlUCSIsIPAExtensions();
39243 test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
39244 test_ret += test_xmlUCSIsKanbun();
39245 test_ret += test_xmlUCSIsKangxiRadicals();
39246 test_ret += test_xmlUCSIsKannada();
39247 test_ret += test_xmlUCSIsKatakana();
39248 test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
39249 test_ret += test_xmlUCSIsKhmer();
39250 test_ret += test_xmlUCSIsKhmerSymbols();
39251 test_ret += test_xmlUCSIsLao();
39252 test_ret += test_xmlUCSIsLatin1Supplement();
39253 test_ret += test_xmlUCSIsLatinExtendedA();
39254 test_ret += test_xmlUCSIsLatinExtendedAdditional();
39255 test_ret += test_xmlUCSIsLatinExtendedB();
39256 test_ret += test_xmlUCSIsLetterlikeSymbols();
39257 test_ret += test_xmlUCSIsLimbu();
39258 test_ret += test_xmlUCSIsLinearBIdeograms();
39259 test_ret += test_xmlUCSIsLinearBSyllabary();
39260 test_ret += test_xmlUCSIsLowSurrogates();
39261 test_ret += test_xmlUCSIsMalayalam();
39262 test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
39263 test_ret += test_xmlUCSIsMathematicalOperators();
39264 test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
39265 test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
39266 test_ret += test_xmlUCSIsMiscellaneousSymbols();
39267 test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
39268 test_ret += test_xmlUCSIsMiscellaneousTechnical();
39269 test_ret += test_xmlUCSIsMongolian();
39270 test_ret += test_xmlUCSIsMusicalSymbols();
39271 test_ret += test_xmlUCSIsMyanmar();
39272 test_ret += test_xmlUCSIsNumberForms();
39273 test_ret += test_xmlUCSIsOgham();
39274 test_ret += test_xmlUCSIsOldItalic();
39275 test_ret += test_xmlUCSIsOpticalCharacterRecognition();
39276 test_ret += test_xmlUCSIsOriya();
39277 test_ret += test_xmlUCSIsOsmanya();
39278 test_ret += test_xmlUCSIsPhoneticExtensions();
39279 test_ret += test_xmlUCSIsPrivateUse();
39280 test_ret += test_xmlUCSIsPrivateUseArea();
39281 test_ret += test_xmlUCSIsRunic();
39282 test_ret += test_xmlUCSIsShavian();
39283 test_ret += test_xmlUCSIsSinhala();
39284 test_ret += test_xmlUCSIsSmallFormVariants();
39285 test_ret += test_xmlUCSIsSpacingModifierLetters();
39286 test_ret += test_xmlUCSIsSpecials();
39287 test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
39288 test_ret += test_xmlUCSIsSupplementalArrowsA();
39289 test_ret += test_xmlUCSIsSupplementalArrowsB();
39290 test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
39291 test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
39292 test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
39293 test_ret += test_xmlUCSIsSyriac();
39294 test_ret += test_xmlUCSIsTagalog();
39295 test_ret += test_xmlUCSIsTagbanwa();
39296 test_ret += test_xmlUCSIsTags();
39297 test_ret += test_xmlUCSIsTaiLe();
39298 test_ret += test_xmlUCSIsTaiXuanJingSymbols();
39299 test_ret += test_xmlUCSIsTamil();
39300 test_ret += test_xmlUCSIsTelugu();
39301 test_ret += test_xmlUCSIsThaana();
39302 test_ret += test_xmlUCSIsThai();
39303 test_ret += test_xmlUCSIsTibetan();
39304 test_ret += test_xmlUCSIsUgaritic();
39305 test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
39306 test_ret += test_xmlUCSIsVariationSelectors();
39307 test_ret += test_xmlUCSIsVariationSelectorsSupplement();
39308 test_ret += test_xmlUCSIsYiRadicals();
39309 test_ret += test_xmlUCSIsYiSyllables();
39310 test_ret += test_xmlUCSIsYijingHexagramSymbols();
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000039311
Daniel Veillard42595322004-11-08 10:52:06 +000039312 if (test_ret != 0)
39313 printf("Module xmlunicode: %d errors\n", test_ret);
39314 return(test_ret);
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000039315}
39316
39317static int
Daniel Veillardd93f6252004-11-02 15:53:51 +000039318test_xmlNewTextWriter(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039319 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039320
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000039321#ifdef LIBXML_WRITER_ENABLED
39322 int mem_base;
39323 xmlTextWriterPtr ret_val;
39324 xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
39325 int n_out;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039326
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000039327 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
39328 mem_base = xmlMemBlocks();
39329 out = gen_xmlOutputBufferPtr(n_out, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000039330
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000039331 ret_val = xmlNewTextWriter(out);
39332 if (ret_val != NULL) out = NULL;
39333 desret_xmlTextWriterPtr(ret_val);
39334 call_tests++;
39335 des_xmlOutputBufferPtr(n_out, out, 0);
39336 xmlResetLastError();
39337 if (mem_base != xmlMemBlocks()) {
39338 printf("Leak of %d blocks found in xmlNewTextWriter",
39339 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039340 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000039341 printf(" %d", n_out);
39342 printf("\n");
39343 }
39344 }
39345#endif
Daniel Veillardd93f6252004-11-02 15:53:51 +000039346
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000039347 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039348 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000039349}
39350
39351
39352static int
39353test_xmlNewTextWriterFilename(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039354 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039355
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000039356#ifdef LIBXML_WRITER_ENABLED
39357 int mem_base;
39358 xmlTextWriterPtr ret_val;
39359 const char * uri; /* the URI of the resource for the output */
39360 int n_uri;
39361 int compression; /* compress the output? */
39362 int n_compression;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039363
Daniel Veillard42595322004-11-08 10:52:06 +000039364 for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000039365 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
39366 mem_base = xmlMemBlocks();
Daniel Veillard42595322004-11-08 10:52:06 +000039367 uri = gen_fileoutput(n_uri, 0);
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000039368 compression = gen_int(n_compression, 1);
39369
39370 ret_val = xmlNewTextWriterFilename(uri, compression);
39371 desret_xmlTextWriterPtr(ret_val);
39372 call_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039373 des_fileoutput(n_uri, uri, 0);
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000039374 des_int(n_compression, compression, 1);
39375 xmlResetLastError();
39376 if (mem_base != xmlMemBlocks()) {
39377 printf("Leak of %d blocks found in xmlNewTextWriterFilename",
39378 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039379 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000039380 printf(" %d", n_uri);
39381 printf(" %d", n_compression);
39382 printf("\n");
39383 }
39384 }
39385 }
39386#endif
39387
39388 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039389 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000039390}
39391
39392
39393static int
39394test_xmlNewTextWriterMemory(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039395 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039396
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000039397#ifdef LIBXML_WRITER_ENABLED
39398 int mem_base;
39399 xmlTextWriterPtr ret_val;
39400 xmlBufferPtr buf; /* xmlBufferPtr */
39401 int n_buf;
39402 int compression; /* compress the output? */
39403 int n_compression;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039404
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000039405 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
39406 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
39407 mem_base = xmlMemBlocks();
39408 buf = gen_xmlBufferPtr(n_buf, 0);
39409 compression = gen_int(n_compression, 1);
39410
39411 ret_val = xmlNewTextWriterMemory(buf, compression);
39412 desret_xmlTextWriterPtr(ret_val);
39413 call_tests++;
39414 des_xmlBufferPtr(n_buf, buf, 0);
39415 des_int(n_compression, compression, 1);
39416 xmlResetLastError();
39417 if (mem_base != xmlMemBlocks()) {
39418 printf("Leak of %d blocks found in xmlNewTextWriterMemory",
39419 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039420 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000039421 printf(" %d", n_buf);
39422 printf(" %d", n_compression);
39423 printf("\n");
39424 }
39425 }
39426 }
39427#endif
39428
39429 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039430 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000039431}
39432
39433
39434static int
39435test_xmlNewTextWriterPushParser(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039436 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039437
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000039438#ifdef LIBXML_WRITER_ENABLED
39439 int mem_base;
39440 xmlTextWriterPtr ret_val;
39441 xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
39442 int n_ctxt;
39443 int compression; /* compress the output? */
39444 int n_compression;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039445
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000039446 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
39447 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
39448 mem_base = xmlMemBlocks();
39449 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
39450 compression = gen_int(n_compression, 1);
39451
39452 ret_val = xmlNewTextWriterPushParser(ctxt, compression);
39453 if (ret_val != NULL) ctxt = NULL;
39454 desret_xmlTextWriterPtr(ret_val);
39455 call_tests++;
39456 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
39457 des_int(n_compression, compression, 1);
39458 xmlResetLastError();
39459 if (mem_base != xmlMemBlocks()) {
39460 printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
39461 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039462 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000039463 printf(" %d", n_ctxt);
39464 printf(" %d", n_compression);
39465 printf("\n");
39466 }
39467 }
39468 }
39469#endif
39470
39471 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039472 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000039473}
39474
39475
39476static int
39477test_xmlNewTextWriterTree(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039478 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039479
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000039480#ifdef LIBXML_WRITER_ENABLED
39481 int mem_base;
39482 xmlTextWriterPtr ret_val;
39483 xmlDocPtr doc; /* xmlDocPtr */
39484 int n_doc;
39485 xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
39486 int n_node;
39487 int compression; /* compress the output? */
39488 int n_compression;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039489
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000039490 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
39491 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
39492 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
39493 mem_base = xmlMemBlocks();
39494 doc = gen_xmlDocPtr(n_doc, 0);
39495 node = gen_xmlNodePtr(n_node, 1);
39496 compression = gen_int(n_compression, 2);
39497
39498 ret_val = xmlNewTextWriterTree(doc, node, compression);
39499 desret_xmlTextWriterPtr(ret_val);
39500 call_tests++;
39501 des_xmlDocPtr(n_doc, doc, 0);
39502 des_xmlNodePtr(n_node, node, 1);
39503 des_int(n_compression, compression, 2);
39504 xmlResetLastError();
39505 if (mem_base != xmlMemBlocks()) {
39506 printf("Leak of %d blocks found in xmlNewTextWriterTree",
39507 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039508 test_ret++;
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000039509 printf(" %d", n_doc);
39510 printf(" %d", n_node);
39511 printf(" %d", n_compression);
39512 printf("\n");
39513 }
39514 }
39515 }
39516 }
39517#endif
39518
39519 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039520 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000039521}
39522
39523
39524static int
39525test_xmlTextWriterEndAttribute(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039526 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039527
Daniel Veillarde43cc572004-11-03 11:50:29 +000039528#ifdef LIBXML_WRITER_ENABLED
39529 int mem_base;
39530 int ret_val;
39531 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
39532 int n_writer;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039533
Daniel Veillarde43cc572004-11-03 11:50:29 +000039534 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
39535 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000039536 writer = gen_xmlTextWriterPtr(n_writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039537
39538 ret_val = xmlTextWriterEndAttribute(writer);
39539 desret_int(ret_val);
39540 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000039541 des_xmlTextWriterPtr(n_writer, writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039542 xmlResetLastError();
39543 if (mem_base != xmlMemBlocks()) {
39544 printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
39545 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039546 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000039547 printf(" %d", n_writer);
39548 printf("\n");
39549 }
39550 }
39551#endif
39552
Daniel Veillard3d97e662004-11-04 10:49:00 +000039553 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039554 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000039555}
39556
39557
39558static int
39559test_xmlTextWriterEndCDATA(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039560 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039561
Daniel Veillarde43cc572004-11-03 11:50:29 +000039562#ifdef LIBXML_WRITER_ENABLED
39563 int mem_base;
39564 int ret_val;
39565 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
39566 int n_writer;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039567
Daniel Veillarde43cc572004-11-03 11:50:29 +000039568 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
39569 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000039570 writer = gen_xmlTextWriterPtr(n_writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039571
39572 ret_val = xmlTextWriterEndCDATA(writer);
39573 desret_int(ret_val);
39574 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000039575 des_xmlTextWriterPtr(n_writer, writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039576 xmlResetLastError();
39577 if (mem_base != xmlMemBlocks()) {
39578 printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
39579 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039580 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000039581 printf(" %d", n_writer);
39582 printf("\n");
39583 }
39584 }
39585#endif
39586
Daniel Veillard3d97e662004-11-04 10:49:00 +000039587 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039588 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000039589}
39590
39591
39592static int
39593test_xmlTextWriterEndComment(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039594 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039595
Daniel Veillarde43cc572004-11-03 11:50:29 +000039596#ifdef LIBXML_WRITER_ENABLED
39597 int mem_base;
39598 int ret_val;
39599 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
39600 int n_writer;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039601
Daniel Veillarde43cc572004-11-03 11:50:29 +000039602 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
39603 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000039604 writer = gen_xmlTextWriterPtr(n_writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039605
39606 ret_val = xmlTextWriterEndComment(writer);
39607 desret_int(ret_val);
39608 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000039609 des_xmlTextWriterPtr(n_writer, writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039610 xmlResetLastError();
39611 if (mem_base != xmlMemBlocks()) {
39612 printf("Leak of %d blocks found in xmlTextWriterEndComment",
39613 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039614 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000039615 printf(" %d", n_writer);
39616 printf("\n");
39617 }
39618 }
39619#endif
39620
Daniel Veillard3d97e662004-11-04 10:49:00 +000039621 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039622 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000039623}
39624
39625
39626static int
39627test_xmlTextWriterEndDTD(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039628 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039629
Daniel Veillarde43cc572004-11-03 11:50:29 +000039630#ifdef LIBXML_WRITER_ENABLED
39631 int mem_base;
39632 int ret_val;
39633 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
39634 int n_writer;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039635
Daniel Veillarde43cc572004-11-03 11:50:29 +000039636 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
39637 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000039638 writer = gen_xmlTextWriterPtr(n_writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039639
39640 ret_val = xmlTextWriterEndDTD(writer);
39641 desret_int(ret_val);
39642 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000039643 des_xmlTextWriterPtr(n_writer, writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039644 xmlResetLastError();
39645 if (mem_base != xmlMemBlocks()) {
39646 printf("Leak of %d blocks found in xmlTextWriterEndDTD",
39647 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039648 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000039649 printf(" %d", n_writer);
39650 printf("\n");
39651 }
39652 }
39653#endif
39654
Daniel Veillard3d97e662004-11-04 10:49:00 +000039655 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039656 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000039657}
39658
39659
39660static int
39661test_xmlTextWriterEndDTDAttlist(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039662 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039663
Daniel Veillarde43cc572004-11-03 11:50:29 +000039664#ifdef LIBXML_WRITER_ENABLED
39665 int mem_base;
39666 int ret_val;
39667 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
39668 int n_writer;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039669
Daniel Veillarde43cc572004-11-03 11:50:29 +000039670 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
39671 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000039672 writer = gen_xmlTextWriterPtr(n_writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039673
39674 ret_val = xmlTextWriterEndDTDAttlist(writer);
39675 desret_int(ret_val);
39676 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000039677 des_xmlTextWriterPtr(n_writer, writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039678 xmlResetLastError();
39679 if (mem_base != xmlMemBlocks()) {
39680 printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
39681 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039682 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000039683 printf(" %d", n_writer);
39684 printf("\n");
39685 }
39686 }
39687#endif
39688
Daniel Veillard3d97e662004-11-04 10:49:00 +000039689 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039690 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000039691}
39692
39693
39694static int
39695test_xmlTextWriterEndDTDElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039696 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039697
Daniel Veillarde43cc572004-11-03 11:50:29 +000039698#ifdef LIBXML_WRITER_ENABLED
39699 int mem_base;
39700 int ret_val;
39701 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
39702 int n_writer;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039703
Daniel Veillarde43cc572004-11-03 11:50:29 +000039704 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
39705 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000039706 writer = gen_xmlTextWriterPtr(n_writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039707
39708 ret_val = xmlTextWriterEndDTDElement(writer);
39709 desret_int(ret_val);
39710 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000039711 des_xmlTextWriterPtr(n_writer, writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039712 xmlResetLastError();
39713 if (mem_base != xmlMemBlocks()) {
39714 printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
39715 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039716 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000039717 printf(" %d", n_writer);
39718 printf("\n");
39719 }
39720 }
39721#endif
39722
Daniel Veillard3d97e662004-11-04 10:49:00 +000039723 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039724 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000039725}
39726
39727
39728static int
39729test_xmlTextWriterEndDTDEntity(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039730 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039731
Daniel Veillarde43cc572004-11-03 11:50:29 +000039732#ifdef LIBXML_WRITER_ENABLED
39733 int mem_base;
39734 int ret_val;
39735 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
39736 int n_writer;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039737
Daniel Veillarde43cc572004-11-03 11:50:29 +000039738 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
39739 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000039740 writer = gen_xmlTextWriterPtr(n_writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039741
39742 ret_val = xmlTextWriterEndDTDEntity(writer);
39743 desret_int(ret_val);
39744 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000039745 des_xmlTextWriterPtr(n_writer, writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039746 xmlResetLastError();
39747 if (mem_base != xmlMemBlocks()) {
39748 printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
39749 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039750 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000039751 printf(" %d", n_writer);
39752 printf("\n");
39753 }
39754 }
39755#endif
39756
Daniel Veillard3d97e662004-11-04 10:49:00 +000039757 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039758 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000039759}
39760
39761
39762static int
39763test_xmlTextWriterEndDocument(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039764 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039765
Daniel Veillarde43cc572004-11-03 11:50:29 +000039766#ifdef LIBXML_WRITER_ENABLED
39767 int mem_base;
39768 int ret_val;
39769 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
39770 int n_writer;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039771
Daniel Veillarde43cc572004-11-03 11:50:29 +000039772 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
39773 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000039774 writer = gen_xmlTextWriterPtr(n_writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039775
39776 ret_val = xmlTextWriterEndDocument(writer);
39777 desret_int(ret_val);
39778 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000039779 des_xmlTextWriterPtr(n_writer, writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039780 xmlResetLastError();
39781 if (mem_base != xmlMemBlocks()) {
39782 printf("Leak of %d blocks found in xmlTextWriterEndDocument",
39783 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039784 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000039785 printf(" %d", n_writer);
39786 printf("\n");
39787 }
39788 }
39789#endif
39790
Daniel Veillard3d97e662004-11-04 10:49:00 +000039791 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039792 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000039793}
39794
39795
39796static int
39797test_xmlTextWriterEndElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039798 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039799
Daniel Veillarde43cc572004-11-03 11:50:29 +000039800#ifdef LIBXML_WRITER_ENABLED
39801 int mem_base;
39802 int ret_val;
39803 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
39804 int n_writer;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039805
Daniel Veillarde43cc572004-11-03 11:50:29 +000039806 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
39807 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000039808 writer = gen_xmlTextWriterPtr(n_writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039809
39810 ret_val = xmlTextWriterEndElement(writer);
39811 desret_int(ret_val);
39812 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000039813 des_xmlTextWriterPtr(n_writer, writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039814 xmlResetLastError();
39815 if (mem_base != xmlMemBlocks()) {
39816 printf("Leak of %d blocks found in xmlTextWriterEndElement",
39817 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039818 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000039819 printf(" %d", n_writer);
39820 printf("\n");
39821 }
39822 }
39823#endif
39824
Daniel Veillard3d97e662004-11-04 10:49:00 +000039825 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039826 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000039827}
39828
39829
39830static int
39831test_xmlTextWriterEndPI(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039832 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039833
Daniel Veillarde43cc572004-11-03 11:50:29 +000039834#ifdef LIBXML_WRITER_ENABLED
39835 int mem_base;
39836 int ret_val;
39837 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
39838 int n_writer;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039839
Daniel Veillarde43cc572004-11-03 11:50:29 +000039840 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
39841 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000039842 writer = gen_xmlTextWriterPtr(n_writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039843
39844 ret_val = xmlTextWriterEndPI(writer);
39845 desret_int(ret_val);
39846 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000039847 des_xmlTextWriterPtr(n_writer, writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039848 xmlResetLastError();
39849 if (mem_base != xmlMemBlocks()) {
39850 printf("Leak of %d blocks found in xmlTextWriterEndPI",
39851 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039852 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000039853 printf(" %d", n_writer);
39854 printf("\n");
39855 }
39856 }
39857#endif
39858
Daniel Veillard3d97e662004-11-04 10:49:00 +000039859 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039860 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000039861}
39862
39863
39864static int
39865test_xmlTextWriterFlush(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039866 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039867
Daniel Veillarde43cc572004-11-03 11:50:29 +000039868#ifdef LIBXML_WRITER_ENABLED
39869 int mem_base;
39870 int ret_val;
39871 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
39872 int n_writer;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039873
Daniel Veillarde43cc572004-11-03 11:50:29 +000039874 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
39875 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000039876 writer = gen_xmlTextWriterPtr(n_writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039877
39878 ret_val = xmlTextWriterFlush(writer);
39879 desret_int(ret_val);
39880 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000039881 des_xmlTextWriterPtr(n_writer, writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039882 xmlResetLastError();
39883 if (mem_base != xmlMemBlocks()) {
39884 printf("Leak of %d blocks found in xmlTextWriterFlush",
39885 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039886 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000039887 printf(" %d", n_writer);
39888 printf("\n");
39889 }
39890 }
39891#endif
39892
Daniel Veillard3d97e662004-11-04 10:49:00 +000039893 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039894 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000039895}
39896
39897
39898static int
39899test_xmlTextWriterFullEndElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039900 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039901
Daniel Veillarde43cc572004-11-03 11:50:29 +000039902#ifdef LIBXML_WRITER_ENABLED
39903 int mem_base;
39904 int ret_val;
39905 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
39906 int n_writer;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039907
Daniel Veillarde43cc572004-11-03 11:50:29 +000039908 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
39909 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000039910 writer = gen_xmlTextWriterPtr(n_writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039911
39912 ret_val = xmlTextWriterFullEndElement(writer);
39913 desret_int(ret_val);
39914 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000039915 des_xmlTextWriterPtr(n_writer, writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039916 xmlResetLastError();
39917 if (mem_base != xmlMemBlocks()) {
39918 printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
39919 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039920 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000039921 printf(" %d", n_writer);
39922 printf("\n");
39923 }
39924 }
39925#endif
39926
Daniel Veillard3d97e662004-11-04 10:49:00 +000039927 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039928 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000039929}
39930
39931
39932static int
39933test_xmlTextWriterSetIndent(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039934 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039935
Daniel Veillarde43cc572004-11-03 11:50:29 +000039936#ifdef LIBXML_WRITER_ENABLED
39937 int mem_base;
39938 int ret_val;
39939 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
39940 int n_writer;
39941 int indent; /* do indentation? */
39942 int n_indent;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039943
Daniel Veillarde43cc572004-11-03 11:50:29 +000039944 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
39945 for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
39946 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000039947 writer = gen_xmlTextWriterPtr(n_writer, 0);
39948 indent = gen_int(n_indent, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039949
39950 ret_val = xmlTextWriterSetIndent(writer, indent);
39951 desret_int(ret_val);
39952 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000039953 des_xmlTextWriterPtr(n_writer, writer, 0);
39954 des_int(n_indent, indent, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039955 xmlResetLastError();
39956 if (mem_base != xmlMemBlocks()) {
39957 printf("Leak of %d blocks found in xmlTextWriterSetIndent",
39958 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000039959 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000039960 printf(" %d", n_writer);
39961 printf(" %d", n_indent);
39962 printf("\n");
39963 }
39964 }
39965 }
39966#endif
39967
Daniel Veillard3d97e662004-11-04 10:49:00 +000039968 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000039969 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000039970}
39971
39972
39973static int
39974test_xmlTextWriterSetIndentString(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000039975 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039976
Daniel Veillarde43cc572004-11-03 11:50:29 +000039977#ifdef LIBXML_WRITER_ENABLED
39978 int mem_base;
39979 int ret_val;
39980 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
39981 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000039982 xmlChar * str; /* the xmlChar string */
Daniel Veillarde43cc572004-11-03 11:50:29 +000039983 int n_str;
Daniel Veillardd93f6252004-11-02 15:53:51 +000039984
Daniel Veillarde43cc572004-11-03 11:50:29 +000039985 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
39986 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
39987 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000039988 writer = gen_xmlTextWriterPtr(n_writer, 0);
39989 str = gen_const_xmlChar_ptr(n_str, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039990
39991 ret_val = xmlTextWriterSetIndentString(writer, str);
39992 desret_int(ret_val);
39993 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000039994 des_xmlTextWriterPtr(n_writer, writer, 0);
39995 des_const_xmlChar_ptr(n_str, str, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000039996 xmlResetLastError();
39997 if (mem_base != xmlMemBlocks()) {
39998 printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
39999 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040000 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000040001 printf(" %d", n_writer);
40002 printf(" %d", n_str);
40003 printf("\n");
40004 }
40005 }
40006 }
40007#endif
40008
Daniel Veillard3d97e662004-11-04 10:49:00 +000040009 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000040010 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000040011}
40012
40013
40014static int
40015test_xmlTextWriterStartAttribute(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000040016 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040017
Daniel Veillarde43cc572004-11-03 11:50:29 +000040018#ifdef LIBXML_WRITER_ENABLED
40019 int mem_base;
40020 int ret_val;
40021 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40022 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040023 xmlChar * name; /* element name */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040024 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040025
Daniel Veillarde43cc572004-11-03 11:50:29 +000040026 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40027 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40028 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000040029 writer = gen_xmlTextWriterPtr(n_writer, 0);
40030 name = gen_const_xmlChar_ptr(n_name, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040031
40032 ret_val = xmlTextWriterStartAttribute(writer, name);
40033 desret_int(ret_val);
40034 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000040035 des_xmlTextWriterPtr(n_writer, writer, 0);
40036 des_const_xmlChar_ptr(n_name, name, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040037 xmlResetLastError();
40038 if (mem_base != xmlMemBlocks()) {
40039 printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
40040 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040041 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000040042 printf(" %d", n_writer);
40043 printf(" %d", n_name);
40044 printf("\n");
40045 }
40046 }
40047 }
40048#endif
40049
Daniel Veillard3d97e662004-11-04 10:49:00 +000040050 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000040051 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000040052}
40053
40054
40055static int
40056test_xmlTextWriterStartAttributeNS(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000040057 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040058
Daniel Veillarde43cc572004-11-03 11:50:29 +000040059#ifdef LIBXML_WRITER_ENABLED
40060 int mem_base;
40061 int ret_val;
40062 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40063 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040064 xmlChar * prefix; /* namespace prefix or NULL */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040065 int n_prefix;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040066 xmlChar * name; /* element local name */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040067 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040068 xmlChar * namespaceURI; /* namespace URI or NULL */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040069 int n_namespaceURI;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040070
Daniel Veillarde43cc572004-11-03 11:50:29 +000040071 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40072 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
40073 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40074 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
40075 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000040076 writer = gen_xmlTextWriterPtr(n_writer, 0);
40077 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
40078 name = gen_const_xmlChar_ptr(n_name, 2);
40079 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040080
40081 ret_val = xmlTextWriterStartAttributeNS(writer, prefix, name, namespaceURI);
40082 desret_int(ret_val);
40083 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000040084 des_xmlTextWriterPtr(n_writer, writer, 0);
40085 des_const_xmlChar_ptr(n_prefix, prefix, 1);
40086 des_const_xmlChar_ptr(n_name, name, 2);
40087 des_const_xmlChar_ptr(n_namespaceURI, namespaceURI, 3);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040088 xmlResetLastError();
40089 if (mem_base != xmlMemBlocks()) {
40090 printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
40091 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040092 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000040093 printf(" %d", n_writer);
40094 printf(" %d", n_prefix);
40095 printf(" %d", n_name);
40096 printf(" %d", n_namespaceURI);
40097 printf("\n");
40098 }
40099 }
40100 }
40101 }
40102 }
40103#endif
40104
Daniel Veillard3d97e662004-11-04 10:49:00 +000040105 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000040106 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000040107}
40108
40109
40110static int
40111test_xmlTextWriterStartCDATA(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000040112 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040113
Daniel Veillarde43cc572004-11-03 11:50:29 +000040114#ifdef LIBXML_WRITER_ENABLED
40115 int mem_base;
40116 int ret_val;
40117 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40118 int n_writer;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040119
Daniel Veillarde43cc572004-11-03 11:50:29 +000040120 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40121 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000040122 writer = gen_xmlTextWriterPtr(n_writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040123
40124 ret_val = xmlTextWriterStartCDATA(writer);
40125 desret_int(ret_val);
40126 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000040127 des_xmlTextWriterPtr(n_writer, writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040128 xmlResetLastError();
40129 if (mem_base != xmlMemBlocks()) {
40130 printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
40131 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040132 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000040133 printf(" %d", n_writer);
40134 printf("\n");
40135 }
40136 }
40137#endif
40138
Daniel Veillard3d97e662004-11-04 10:49:00 +000040139 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000040140 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000040141}
40142
40143
40144static int
40145test_xmlTextWriterStartComment(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000040146 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040147
Daniel Veillarde43cc572004-11-03 11:50:29 +000040148#ifdef LIBXML_WRITER_ENABLED
40149 int mem_base;
40150 int ret_val;
40151 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40152 int n_writer;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040153
Daniel Veillarde43cc572004-11-03 11:50:29 +000040154 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40155 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000040156 writer = gen_xmlTextWriterPtr(n_writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040157
40158 ret_val = xmlTextWriterStartComment(writer);
40159 desret_int(ret_val);
40160 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000040161 des_xmlTextWriterPtr(n_writer, writer, 0);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040162 xmlResetLastError();
40163 if (mem_base != xmlMemBlocks()) {
40164 printf("Leak of %d blocks found in xmlTextWriterStartComment",
40165 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040166 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000040167 printf(" %d", n_writer);
40168 printf("\n");
40169 }
40170 }
40171#endif
40172
Daniel Veillard3d97e662004-11-04 10:49:00 +000040173 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000040174 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000040175}
40176
40177
40178static int
40179test_xmlTextWriterStartDTD(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000040180 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040181
Daniel Veillarde43cc572004-11-03 11:50:29 +000040182#ifdef LIBXML_WRITER_ENABLED
40183 int mem_base;
40184 int ret_val;
40185 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40186 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040187 xmlChar * name; /* the name of the DTD */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040188 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040189 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040190 int n_pubid;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040191 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040192 int n_sysid;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040193
Daniel Veillarde43cc572004-11-03 11:50:29 +000040194 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40195 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40196 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
40197 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
40198 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000040199 writer = gen_xmlTextWriterPtr(n_writer, 0);
40200 name = gen_const_xmlChar_ptr(n_name, 1);
40201 pubid = gen_const_xmlChar_ptr(n_pubid, 2);
40202 sysid = gen_const_xmlChar_ptr(n_sysid, 3);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040203
40204 ret_val = xmlTextWriterStartDTD(writer, name, pubid, sysid);
40205 desret_int(ret_val);
40206 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000040207 des_xmlTextWriterPtr(n_writer, writer, 0);
40208 des_const_xmlChar_ptr(n_name, name, 1);
40209 des_const_xmlChar_ptr(n_pubid, pubid, 2);
40210 des_const_xmlChar_ptr(n_sysid, sysid, 3);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040211 xmlResetLastError();
40212 if (mem_base != xmlMemBlocks()) {
40213 printf("Leak of %d blocks found in xmlTextWriterStartDTD",
40214 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040215 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000040216 printf(" %d", n_writer);
40217 printf(" %d", n_name);
40218 printf(" %d", n_pubid);
40219 printf(" %d", n_sysid);
40220 printf("\n");
40221 }
40222 }
40223 }
40224 }
40225 }
40226#endif
40227
Daniel Veillard3d97e662004-11-04 10:49:00 +000040228 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000040229 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000040230}
40231
40232
40233static int
40234test_xmlTextWriterStartDTDAttlist(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000040235 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040236
Daniel Veillarde43cc572004-11-03 11:50:29 +000040237#ifdef LIBXML_WRITER_ENABLED
40238 int mem_base;
40239 int ret_val;
40240 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40241 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040242 xmlChar * name; /* the name of the DTD ATTLIST */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040243 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040244
Daniel Veillarde43cc572004-11-03 11:50:29 +000040245 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40246 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40247 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000040248 writer = gen_xmlTextWriterPtr(n_writer, 0);
40249 name = gen_const_xmlChar_ptr(n_name, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040250
40251 ret_val = xmlTextWriterStartDTDAttlist(writer, name);
40252 desret_int(ret_val);
40253 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000040254 des_xmlTextWriterPtr(n_writer, writer, 0);
40255 des_const_xmlChar_ptr(n_name, name, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040256 xmlResetLastError();
40257 if (mem_base != xmlMemBlocks()) {
40258 printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
40259 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040260 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000040261 printf(" %d", n_writer);
40262 printf(" %d", n_name);
40263 printf("\n");
40264 }
40265 }
40266 }
40267#endif
40268
Daniel Veillard3d97e662004-11-04 10:49:00 +000040269 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000040270 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000040271}
40272
40273
40274static int
40275test_xmlTextWriterStartDTDElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000040276 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040277
Daniel Veillarde43cc572004-11-03 11:50:29 +000040278#ifdef LIBXML_WRITER_ENABLED
40279 int mem_base;
40280 int ret_val;
40281 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40282 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040283 xmlChar * name; /* the name of the DTD element */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040284 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040285
Daniel Veillarde43cc572004-11-03 11:50:29 +000040286 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40287 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40288 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000040289 writer = gen_xmlTextWriterPtr(n_writer, 0);
40290 name = gen_const_xmlChar_ptr(n_name, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040291
40292 ret_val = xmlTextWriterStartDTDElement(writer, name);
40293 desret_int(ret_val);
40294 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000040295 des_xmlTextWriterPtr(n_writer, writer, 0);
40296 des_const_xmlChar_ptr(n_name, name, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040297 xmlResetLastError();
40298 if (mem_base != xmlMemBlocks()) {
40299 printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
40300 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040301 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000040302 printf(" %d", n_writer);
40303 printf(" %d", n_name);
40304 printf("\n");
40305 }
40306 }
40307 }
40308#endif
40309
Daniel Veillard3d97e662004-11-04 10:49:00 +000040310 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000040311 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000040312}
40313
40314
40315static int
40316test_xmlTextWriterStartDTDEntity(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000040317 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040318
Daniel Veillarde43cc572004-11-03 11:50:29 +000040319#ifdef LIBXML_WRITER_ENABLED
40320 int mem_base;
40321 int ret_val;
40322 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40323 int n_writer;
40324 int pe; /* TRUE if this is a parameter entity, FALSE if not */
40325 int n_pe;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040326 xmlChar * name; /* the name of the DTD ATTLIST */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040327 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040328
Daniel Veillarde43cc572004-11-03 11:50:29 +000040329 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40330 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
40331 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40332 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000040333 writer = gen_xmlTextWriterPtr(n_writer, 0);
40334 pe = gen_int(n_pe, 1);
40335 name = gen_const_xmlChar_ptr(n_name, 2);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040336
40337 ret_val = xmlTextWriterStartDTDEntity(writer, pe, name);
40338 desret_int(ret_val);
40339 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000040340 des_xmlTextWriterPtr(n_writer, writer, 0);
40341 des_int(n_pe, pe, 1);
40342 des_const_xmlChar_ptr(n_name, name, 2);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040343 xmlResetLastError();
40344 if (mem_base != xmlMemBlocks()) {
40345 printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
40346 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040347 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000040348 printf(" %d", n_writer);
40349 printf(" %d", n_pe);
40350 printf(" %d", n_name);
40351 printf("\n");
40352 }
40353 }
40354 }
40355 }
40356#endif
40357
Daniel Veillard3d97e662004-11-04 10:49:00 +000040358 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000040359 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000040360}
40361
40362
40363static int
40364test_xmlTextWriterStartDocument(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000040365 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040366
Daniel Veillarde43cc572004-11-03 11:50:29 +000040367#ifdef LIBXML_WRITER_ENABLED
40368 int mem_base;
40369 int ret_val;
40370 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40371 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040372 char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040373 int n_version;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040374 char * encoding; /* the encoding or NULL for default */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040375 int n_encoding;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040376 char * standalone; /* "yes" or "no" or NULL for default */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040377 int n_standalone;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040378
Daniel Veillarde43cc572004-11-03 11:50:29 +000040379 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40380 for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
40381 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
40382 for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
40383 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000040384 writer = gen_xmlTextWriterPtr(n_writer, 0);
40385 version = gen_const_char_ptr(n_version, 1);
40386 encoding = gen_const_char_ptr(n_encoding, 2);
40387 standalone = gen_const_char_ptr(n_standalone, 3);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040388
40389 ret_val = xmlTextWriterStartDocument(writer, version, encoding, standalone);
40390 desret_int(ret_val);
40391 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000040392 des_xmlTextWriterPtr(n_writer, writer, 0);
40393 des_const_char_ptr(n_version, version, 1);
40394 des_const_char_ptr(n_encoding, encoding, 2);
40395 des_const_char_ptr(n_standalone, standalone, 3);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040396 xmlResetLastError();
40397 if (mem_base != xmlMemBlocks()) {
40398 printf("Leak of %d blocks found in xmlTextWriterStartDocument",
40399 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040400 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000040401 printf(" %d", n_writer);
40402 printf(" %d", n_version);
40403 printf(" %d", n_encoding);
40404 printf(" %d", n_standalone);
40405 printf("\n");
40406 }
40407 }
40408 }
40409 }
40410 }
40411#endif
40412
Daniel Veillard3d97e662004-11-04 10:49:00 +000040413 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000040414 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000040415}
40416
40417
40418static int
40419test_xmlTextWriterStartElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000040420 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040421
Daniel Veillarde43cc572004-11-03 11:50:29 +000040422#ifdef LIBXML_WRITER_ENABLED
40423 int mem_base;
40424 int ret_val;
40425 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40426 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040427 xmlChar * name; /* element name */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040428 int n_name;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040429
Daniel Veillarde43cc572004-11-03 11:50:29 +000040430 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40431 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40432 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000040433 writer = gen_xmlTextWriterPtr(n_writer, 0);
40434 name = gen_const_xmlChar_ptr(n_name, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040435
40436 ret_val = xmlTextWriterStartElement(writer, name);
40437 desret_int(ret_val);
40438 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000040439 des_xmlTextWriterPtr(n_writer, writer, 0);
40440 des_const_xmlChar_ptr(n_name, name, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040441 xmlResetLastError();
40442 if (mem_base != xmlMemBlocks()) {
40443 printf("Leak of %d blocks found in xmlTextWriterStartElement",
40444 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040445 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000040446 printf(" %d", n_writer);
40447 printf(" %d", n_name);
40448 printf("\n");
40449 }
40450 }
40451 }
40452#endif
40453
Daniel Veillard3d97e662004-11-04 10:49:00 +000040454 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000040455 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000040456}
40457
40458
40459static int
40460test_xmlTextWriterStartElementNS(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000040461 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040462
Daniel Veillarde43cc572004-11-03 11:50:29 +000040463#ifdef LIBXML_WRITER_ENABLED
40464 int mem_base;
40465 int ret_val;
40466 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40467 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040468 xmlChar * prefix; /* namespace prefix or NULL */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040469 int n_prefix;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040470 xmlChar * name; /* element local name */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040471 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040472 xmlChar * namespaceURI; /* namespace URI or NULL */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040473 int n_namespaceURI;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040474
Daniel Veillarde43cc572004-11-03 11:50:29 +000040475 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40476 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
40477 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40478 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
40479 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000040480 writer = gen_xmlTextWriterPtr(n_writer, 0);
40481 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
40482 name = gen_const_xmlChar_ptr(n_name, 2);
40483 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040484
40485 ret_val = xmlTextWriterStartElementNS(writer, prefix, name, namespaceURI);
40486 desret_int(ret_val);
40487 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000040488 des_xmlTextWriterPtr(n_writer, writer, 0);
40489 des_const_xmlChar_ptr(n_prefix, prefix, 1);
40490 des_const_xmlChar_ptr(n_name, name, 2);
40491 des_const_xmlChar_ptr(n_namespaceURI, namespaceURI, 3);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040492 xmlResetLastError();
40493 if (mem_base != xmlMemBlocks()) {
40494 printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
40495 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040496 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000040497 printf(" %d", n_writer);
40498 printf(" %d", n_prefix);
40499 printf(" %d", n_name);
40500 printf(" %d", n_namespaceURI);
40501 printf("\n");
40502 }
40503 }
40504 }
40505 }
40506 }
40507#endif
40508
Daniel Veillard3d97e662004-11-04 10:49:00 +000040509 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000040510 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000040511}
40512
40513
40514static int
40515test_xmlTextWriterStartPI(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000040516 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040517
Daniel Veillarde43cc572004-11-03 11:50:29 +000040518#ifdef LIBXML_WRITER_ENABLED
40519 int mem_base;
40520 int ret_val;
40521 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40522 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040523 xmlChar * target; /* PI target */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040524 int n_target;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040525
Daniel Veillarde43cc572004-11-03 11:50:29 +000040526 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40527 for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
40528 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000040529 writer = gen_xmlTextWriterPtr(n_writer, 0);
40530 target = gen_const_xmlChar_ptr(n_target, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040531
40532 ret_val = xmlTextWriterStartPI(writer, target);
40533 desret_int(ret_val);
40534 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000040535 des_xmlTextWriterPtr(n_writer, writer, 0);
40536 des_const_xmlChar_ptr(n_target, target, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040537 xmlResetLastError();
40538 if (mem_base != xmlMemBlocks()) {
40539 printf("Leak of %d blocks found in xmlTextWriterStartPI",
40540 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040541 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000040542 printf(" %d", n_writer);
40543 printf(" %d", n_target);
40544 printf("\n");
40545 }
40546 }
40547 }
40548#endif
40549
Daniel Veillard3d97e662004-11-04 10:49:00 +000040550 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000040551 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000040552}
40553
40554
40555static int
40556test_xmlTextWriterWriteAttribute(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000040557 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040558
Daniel Veillarde43cc572004-11-03 11:50:29 +000040559#ifdef LIBXML_WRITER_ENABLED
40560 int mem_base;
40561 int ret_val;
40562 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40563 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040564 xmlChar * name; /* attribute name */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040565 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040566 xmlChar * content; /* attribute content */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040567 int n_content;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040568
Daniel Veillarde43cc572004-11-03 11:50:29 +000040569 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40570 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40571 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
40572 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000040573 writer = gen_xmlTextWriterPtr(n_writer, 0);
40574 name = gen_const_xmlChar_ptr(n_name, 1);
40575 content = gen_const_xmlChar_ptr(n_content, 2);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040576
40577 ret_val = xmlTextWriterWriteAttribute(writer, name, content);
40578 desret_int(ret_val);
40579 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000040580 des_xmlTextWriterPtr(n_writer, writer, 0);
40581 des_const_xmlChar_ptr(n_name, name, 1);
40582 des_const_xmlChar_ptr(n_content, content, 2);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040583 xmlResetLastError();
40584 if (mem_base != xmlMemBlocks()) {
40585 printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
40586 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040587 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000040588 printf(" %d", n_writer);
40589 printf(" %d", n_name);
40590 printf(" %d", n_content);
40591 printf("\n");
40592 }
40593 }
40594 }
40595 }
40596#endif
40597
Daniel Veillard3d97e662004-11-04 10:49:00 +000040598 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000040599 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000040600}
40601
40602
40603static int
40604test_xmlTextWriterWriteAttributeNS(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000040605 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040606
Daniel Veillarde43cc572004-11-03 11:50:29 +000040607#ifdef LIBXML_WRITER_ENABLED
40608 int mem_base;
40609 int ret_val;
40610 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40611 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040612 xmlChar * prefix; /* namespace prefix */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040613 int n_prefix;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040614 xmlChar * name; /* attribute local name */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040615 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040616 xmlChar * namespaceURI; /* namespace URI */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040617 int n_namespaceURI;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040618 xmlChar * content; /* attribute content */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040619 int n_content;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040620
Daniel Veillarde43cc572004-11-03 11:50:29 +000040621 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40622 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
40623 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40624 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
40625 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
40626 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000040627 writer = gen_xmlTextWriterPtr(n_writer, 0);
40628 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
40629 name = gen_const_xmlChar_ptr(n_name, 2);
40630 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
40631 content = gen_const_xmlChar_ptr(n_content, 4);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040632
40633 ret_val = xmlTextWriterWriteAttributeNS(writer, prefix, name, namespaceURI, content);
40634 desret_int(ret_val);
40635 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000040636 des_xmlTextWriterPtr(n_writer, writer, 0);
40637 des_const_xmlChar_ptr(n_prefix, prefix, 1);
40638 des_const_xmlChar_ptr(n_name, name, 2);
40639 des_const_xmlChar_ptr(n_namespaceURI, namespaceURI, 3);
40640 des_const_xmlChar_ptr(n_content, content, 4);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040641 xmlResetLastError();
40642 if (mem_base != xmlMemBlocks()) {
40643 printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
40644 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040645 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000040646 printf(" %d", n_writer);
40647 printf(" %d", n_prefix);
40648 printf(" %d", n_name);
40649 printf(" %d", n_namespaceURI);
40650 printf(" %d", n_content);
40651 printf("\n");
40652 }
40653 }
40654 }
40655 }
40656 }
40657 }
40658#endif
40659
Daniel Veillard3d97e662004-11-04 10:49:00 +000040660 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000040661 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000040662}
40663
40664
40665static int
40666test_xmlTextWriterWriteBase64(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000040667 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040668
Daniel Veillarde43cc572004-11-03 11:50:29 +000040669#ifdef LIBXML_WRITER_ENABLED
40670 int mem_base;
40671 int ret_val;
40672 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40673 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040674 char * data; /* binary data */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040675 int n_data;
40676 int start; /* the position within the data of the first byte to encode */
40677 int n_start;
40678 int len; /* the number of bytes to encode */
40679 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040680
Daniel Veillarde43cc572004-11-03 11:50:29 +000040681 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40682 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
40683 for (n_start = 0;n_start < gen_nb_int;n_start++) {
40684 for (n_len = 0;n_len < gen_nb_int;n_len++) {
40685 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000040686 writer = gen_xmlTextWriterPtr(n_writer, 0);
40687 data = gen_const_char_ptr(n_data, 1);
40688 start = gen_int(n_start, 2);
40689 len = gen_int(n_len, 3);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040690
40691 ret_val = xmlTextWriterWriteBase64(writer, data, start, len);
40692 desret_int(ret_val);
40693 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000040694 des_xmlTextWriterPtr(n_writer, writer, 0);
40695 des_const_char_ptr(n_data, data, 1);
40696 des_int(n_start, start, 2);
40697 des_int(n_len, len, 3);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040698 xmlResetLastError();
40699 if (mem_base != xmlMemBlocks()) {
40700 printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
40701 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040702 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000040703 printf(" %d", n_writer);
40704 printf(" %d", n_data);
40705 printf(" %d", n_start);
40706 printf(" %d", n_len);
40707 printf("\n");
40708 }
40709 }
40710 }
40711 }
40712 }
40713#endif
40714
Daniel Veillard3d97e662004-11-04 10:49:00 +000040715 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000040716 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000040717}
40718
40719
40720static int
40721test_xmlTextWriterWriteBinHex(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000040722 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040723
Daniel Veillarde43cc572004-11-03 11:50:29 +000040724#ifdef LIBXML_WRITER_ENABLED
40725 int mem_base;
40726 int ret_val;
40727 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40728 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040729 char * data; /* binary data */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040730 int n_data;
40731 int start; /* the position within the data of the first byte to encode */
40732 int n_start;
40733 int len; /* the number of bytes to encode */
40734 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040735
Daniel Veillarde43cc572004-11-03 11:50:29 +000040736 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40737 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
40738 for (n_start = 0;n_start < gen_nb_int;n_start++) {
40739 for (n_len = 0;n_len < gen_nb_int;n_len++) {
40740 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000040741 writer = gen_xmlTextWriterPtr(n_writer, 0);
40742 data = gen_const_char_ptr(n_data, 1);
40743 start = gen_int(n_start, 2);
40744 len = gen_int(n_len, 3);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040745
40746 ret_val = xmlTextWriterWriteBinHex(writer, data, start, len);
40747 desret_int(ret_val);
40748 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000040749 des_xmlTextWriterPtr(n_writer, writer, 0);
40750 des_const_char_ptr(n_data, data, 1);
40751 des_int(n_start, start, 2);
40752 des_int(n_len, len, 3);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040753 xmlResetLastError();
40754 if (mem_base != xmlMemBlocks()) {
40755 printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
40756 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040757 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000040758 printf(" %d", n_writer);
40759 printf(" %d", n_data);
40760 printf(" %d", n_start);
40761 printf(" %d", n_len);
40762 printf("\n");
40763 }
40764 }
40765 }
40766 }
40767 }
40768#endif
40769
Daniel Veillard3d97e662004-11-04 10:49:00 +000040770 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000040771 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000040772}
40773
40774
40775static int
40776test_xmlTextWriterWriteCDATA(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000040777 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040778
Daniel Veillarde43cc572004-11-03 11:50:29 +000040779#ifdef LIBXML_WRITER_ENABLED
40780 int mem_base;
40781 int ret_val;
40782 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40783 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040784 xmlChar * content; /* CDATA content */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040785 int n_content;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040786
Daniel Veillarde43cc572004-11-03 11:50:29 +000040787 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40788 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
40789 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000040790 writer = gen_xmlTextWriterPtr(n_writer, 0);
40791 content = gen_const_xmlChar_ptr(n_content, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040792
40793 ret_val = xmlTextWriterWriteCDATA(writer, content);
40794 desret_int(ret_val);
40795 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000040796 des_xmlTextWriterPtr(n_writer, writer, 0);
40797 des_const_xmlChar_ptr(n_content, content, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040798 xmlResetLastError();
40799 if (mem_base != xmlMemBlocks()) {
40800 printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
40801 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040802 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000040803 printf(" %d", n_writer);
40804 printf(" %d", n_content);
40805 printf("\n");
40806 }
40807 }
40808 }
40809#endif
40810
Daniel Veillard3d97e662004-11-04 10:49:00 +000040811 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000040812 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000040813}
40814
40815
40816static int
40817test_xmlTextWriterWriteComment(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000040818 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040819
Daniel Veillarde43cc572004-11-03 11:50:29 +000040820#ifdef LIBXML_WRITER_ENABLED
40821 int mem_base;
40822 int ret_val;
40823 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40824 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040825 xmlChar * content; /* comment string */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040826 int n_content;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040827
Daniel Veillarde43cc572004-11-03 11:50:29 +000040828 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40829 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
40830 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000040831 writer = gen_xmlTextWriterPtr(n_writer, 0);
40832 content = gen_const_xmlChar_ptr(n_content, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040833
40834 ret_val = xmlTextWriterWriteComment(writer, content);
40835 desret_int(ret_val);
40836 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000040837 des_xmlTextWriterPtr(n_writer, writer, 0);
40838 des_const_xmlChar_ptr(n_content, content, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040839 xmlResetLastError();
40840 if (mem_base != xmlMemBlocks()) {
40841 printf("Leak of %d blocks found in xmlTextWriterWriteComment",
40842 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040843 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000040844 printf(" %d", n_writer);
40845 printf(" %d", n_content);
40846 printf("\n");
40847 }
40848 }
40849 }
40850#endif
40851
Daniel Veillard3d97e662004-11-04 10:49:00 +000040852 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000040853 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000040854}
40855
40856
40857static int
40858test_xmlTextWriterWriteDTD(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000040859 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040860
Daniel Veillarde43cc572004-11-03 11:50:29 +000040861#ifdef LIBXML_WRITER_ENABLED
40862 int mem_base;
40863 int ret_val;
40864 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40865 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040866 xmlChar * name; /* the name of the DTD */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040867 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040868 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040869 int n_pubid;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040870 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040871 int n_sysid;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040872 xmlChar * subset; /* string content of the DTD */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040873 int n_subset;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040874
Daniel Veillarde43cc572004-11-03 11:50:29 +000040875 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40876 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40877 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
40878 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
40879 for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
40880 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000040881 writer = gen_xmlTextWriterPtr(n_writer, 0);
40882 name = gen_const_xmlChar_ptr(n_name, 1);
40883 pubid = gen_const_xmlChar_ptr(n_pubid, 2);
40884 sysid = gen_const_xmlChar_ptr(n_sysid, 3);
40885 subset = gen_const_xmlChar_ptr(n_subset, 4);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040886
40887 ret_val = xmlTextWriterWriteDTD(writer, name, pubid, sysid, subset);
40888 desret_int(ret_val);
40889 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000040890 des_xmlTextWriterPtr(n_writer, writer, 0);
40891 des_const_xmlChar_ptr(n_name, name, 1);
40892 des_const_xmlChar_ptr(n_pubid, pubid, 2);
40893 des_const_xmlChar_ptr(n_sysid, sysid, 3);
40894 des_const_xmlChar_ptr(n_subset, subset, 4);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040895 xmlResetLastError();
40896 if (mem_base != xmlMemBlocks()) {
40897 printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
40898 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040899 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000040900 printf(" %d", n_writer);
40901 printf(" %d", n_name);
40902 printf(" %d", n_pubid);
40903 printf(" %d", n_sysid);
40904 printf(" %d", n_subset);
40905 printf("\n");
40906 }
40907 }
40908 }
40909 }
40910 }
40911 }
40912#endif
40913
Daniel Veillard3d97e662004-11-04 10:49:00 +000040914 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000040915 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000040916}
40917
40918
40919static int
40920test_xmlTextWriterWriteDTDAttlist(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000040921 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040922
Daniel Veillarde43cc572004-11-03 11:50:29 +000040923#ifdef LIBXML_WRITER_ENABLED
40924 int mem_base;
40925 int ret_val;
40926 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40927 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040928 xmlChar * name; /* the name of the DTD ATTLIST */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040929 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040930 xmlChar * content; /* content of the ATTLIST */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040931 int n_content;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040932
Daniel Veillarde43cc572004-11-03 11:50:29 +000040933 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40934 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40935 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
40936 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000040937 writer = gen_xmlTextWriterPtr(n_writer, 0);
40938 name = gen_const_xmlChar_ptr(n_name, 1);
40939 content = gen_const_xmlChar_ptr(n_content, 2);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040940
40941 ret_val = xmlTextWriterWriteDTDAttlist(writer, name, content);
40942 desret_int(ret_val);
40943 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000040944 des_xmlTextWriterPtr(n_writer, writer, 0);
40945 des_const_xmlChar_ptr(n_name, name, 1);
40946 des_const_xmlChar_ptr(n_content, content, 2);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040947 xmlResetLastError();
40948 if (mem_base != xmlMemBlocks()) {
40949 printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
40950 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040951 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000040952 printf(" %d", n_writer);
40953 printf(" %d", n_name);
40954 printf(" %d", n_content);
40955 printf("\n");
40956 }
40957 }
40958 }
40959 }
40960#endif
40961
Daniel Veillard3d97e662004-11-04 10:49:00 +000040962 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000040963 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000040964}
40965
40966
40967static int
40968test_xmlTextWriterWriteDTDElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000040969 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040970
Daniel Veillarde43cc572004-11-03 11:50:29 +000040971#ifdef LIBXML_WRITER_ENABLED
40972 int mem_base;
40973 int ret_val;
40974 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40975 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040976 xmlChar * name; /* the name of the DTD element */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040977 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000040978 xmlChar * content; /* content of the element */
Daniel Veillarde43cc572004-11-03 11:50:29 +000040979 int n_content;
Daniel Veillardd93f6252004-11-02 15:53:51 +000040980
Daniel Veillarde43cc572004-11-03 11:50:29 +000040981 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40982 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40983 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
40984 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000040985 writer = gen_xmlTextWriterPtr(n_writer, 0);
40986 name = gen_const_xmlChar_ptr(n_name, 1);
40987 content = gen_const_xmlChar_ptr(n_content, 2);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040988
40989 ret_val = xmlTextWriterWriteDTDElement(writer, name, content);
40990 desret_int(ret_val);
40991 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000040992 des_xmlTextWriterPtr(n_writer, writer, 0);
40993 des_const_xmlChar_ptr(n_name, name, 1);
40994 des_const_xmlChar_ptr(n_content, content, 2);
Daniel Veillarde43cc572004-11-03 11:50:29 +000040995 xmlResetLastError();
40996 if (mem_base != xmlMemBlocks()) {
40997 printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
40998 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000040999 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000041000 printf(" %d", n_writer);
41001 printf(" %d", n_name);
41002 printf(" %d", n_content);
41003 printf("\n");
41004 }
41005 }
41006 }
41007 }
41008#endif
41009
Daniel Veillard3d97e662004-11-04 10:49:00 +000041010 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000041011 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041012}
41013
41014
41015static int
41016test_xmlTextWriterWriteDTDEntity(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041017 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041018
Daniel Veillarde43cc572004-11-03 11:50:29 +000041019#ifdef LIBXML_WRITER_ENABLED
41020 int mem_base;
41021 int ret_val;
41022 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41023 int n_writer;
41024 int pe; /* TRUE if this is a parameter entity, FALSE if not */
41025 int n_pe;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041026 xmlChar * name; /* the name of the DTD entity */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041027 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041028 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041029 int n_pubid;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041030 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041031 int n_sysid;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041032 xmlChar * ndataid; /* the xml notation name. */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041033 int n_ndataid;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041034 xmlChar * content; /* content of the entity */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041035 int n_content;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041036
Daniel Veillarde43cc572004-11-03 11:50:29 +000041037 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41038 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
41039 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41040 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
41041 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
41042 for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
41043 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41044 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000041045 writer = gen_xmlTextWriterPtr(n_writer, 0);
41046 pe = gen_int(n_pe, 1);
41047 name = gen_const_xmlChar_ptr(n_name, 2);
41048 pubid = gen_const_xmlChar_ptr(n_pubid, 3);
41049 sysid = gen_const_xmlChar_ptr(n_sysid, 4);
41050 ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
41051 content = gen_const_xmlChar_ptr(n_content, 6);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041052
41053 ret_val = xmlTextWriterWriteDTDEntity(writer, pe, name, pubid, sysid, ndataid, content);
41054 desret_int(ret_val);
41055 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000041056 des_xmlTextWriterPtr(n_writer, writer, 0);
41057 des_int(n_pe, pe, 1);
41058 des_const_xmlChar_ptr(n_name, name, 2);
41059 des_const_xmlChar_ptr(n_pubid, pubid, 3);
41060 des_const_xmlChar_ptr(n_sysid, sysid, 4);
41061 des_const_xmlChar_ptr(n_ndataid, ndataid, 5);
41062 des_const_xmlChar_ptr(n_content, content, 6);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041063 xmlResetLastError();
41064 if (mem_base != xmlMemBlocks()) {
41065 printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
41066 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000041067 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000041068 printf(" %d", n_writer);
41069 printf(" %d", n_pe);
41070 printf(" %d", n_name);
41071 printf(" %d", n_pubid);
41072 printf(" %d", n_sysid);
41073 printf(" %d", n_ndataid);
41074 printf(" %d", n_content);
41075 printf("\n");
41076 }
41077 }
41078 }
41079 }
41080 }
41081 }
41082 }
41083 }
41084#endif
41085
Daniel Veillard3d97e662004-11-04 10:49:00 +000041086 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000041087 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041088}
41089
41090
41091static int
41092test_xmlTextWriterWriteDTDExternalEntity(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041093 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041094
Daniel Veillarde43cc572004-11-03 11:50:29 +000041095#ifdef LIBXML_WRITER_ENABLED
41096 int mem_base;
41097 int ret_val;
41098 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41099 int n_writer;
41100 int pe; /* TRUE if this is a parameter entity, FALSE if not */
41101 int n_pe;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041102 xmlChar * name; /* the name of the DTD entity */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041103 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041104 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041105 int n_pubid;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041106 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041107 int n_sysid;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041108 xmlChar * ndataid; /* the xml notation name. */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041109 int n_ndataid;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041110
Daniel Veillarde43cc572004-11-03 11:50:29 +000041111 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41112 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
41113 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41114 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
41115 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
41116 for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
41117 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000041118 writer = gen_xmlTextWriterPtr(n_writer, 0);
41119 pe = gen_int(n_pe, 1);
41120 name = gen_const_xmlChar_ptr(n_name, 2);
41121 pubid = gen_const_xmlChar_ptr(n_pubid, 3);
41122 sysid = gen_const_xmlChar_ptr(n_sysid, 4);
41123 ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041124
41125 ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, name, pubid, sysid, ndataid);
41126 desret_int(ret_val);
41127 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000041128 des_xmlTextWriterPtr(n_writer, writer, 0);
41129 des_int(n_pe, pe, 1);
41130 des_const_xmlChar_ptr(n_name, name, 2);
41131 des_const_xmlChar_ptr(n_pubid, pubid, 3);
41132 des_const_xmlChar_ptr(n_sysid, sysid, 4);
41133 des_const_xmlChar_ptr(n_ndataid, ndataid, 5);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041134 xmlResetLastError();
41135 if (mem_base != xmlMemBlocks()) {
41136 printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
41137 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000041138 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000041139 printf(" %d", n_writer);
41140 printf(" %d", n_pe);
41141 printf(" %d", n_name);
41142 printf(" %d", n_pubid);
41143 printf(" %d", n_sysid);
41144 printf(" %d", n_ndataid);
41145 printf("\n");
41146 }
41147 }
41148 }
41149 }
41150 }
41151 }
41152 }
41153#endif
41154
Daniel Veillard3d97e662004-11-04 10:49:00 +000041155 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000041156 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041157}
41158
41159
41160static int
41161test_xmlTextWriterWriteDTDExternalEntityContents(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041162 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041163
Daniel Veillarde43cc572004-11-03 11:50:29 +000041164#ifdef LIBXML_WRITER_ENABLED
41165 int mem_base;
41166 int ret_val;
41167 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41168 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041169 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041170 int n_pubid;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041171 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041172 int n_sysid;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041173 xmlChar * ndataid; /* the xml notation name. */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041174 int n_ndataid;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041175
Daniel Veillarde43cc572004-11-03 11:50:29 +000041176 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41177 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
41178 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
41179 for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
41180 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000041181 writer = gen_xmlTextWriterPtr(n_writer, 0);
41182 pubid = gen_const_xmlChar_ptr(n_pubid, 1);
41183 sysid = gen_const_xmlChar_ptr(n_sysid, 2);
41184 ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041185
41186 ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, pubid, sysid, ndataid);
41187 desret_int(ret_val);
41188 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000041189 des_xmlTextWriterPtr(n_writer, writer, 0);
41190 des_const_xmlChar_ptr(n_pubid, pubid, 1);
41191 des_const_xmlChar_ptr(n_sysid, sysid, 2);
41192 des_const_xmlChar_ptr(n_ndataid, ndataid, 3);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041193 xmlResetLastError();
41194 if (mem_base != xmlMemBlocks()) {
41195 printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
41196 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000041197 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000041198 printf(" %d", n_writer);
41199 printf(" %d", n_pubid);
41200 printf(" %d", n_sysid);
41201 printf(" %d", n_ndataid);
41202 printf("\n");
41203 }
41204 }
41205 }
41206 }
41207 }
41208#endif
41209
Daniel Veillard3d97e662004-11-04 10:49:00 +000041210 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000041211 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041212}
41213
41214
41215static int
41216test_xmlTextWriterWriteDTDInternalEntity(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041217 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041218
Daniel Veillarde43cc572004-11-03 11:50:29 +000041219#ifdef LIBXML_WRITER_ENABLED
41220 int mem_base;
41221 int ret_val;
41222 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41223 int n_writer;
41224 int pe; /* TRUE if this is a parameter entity, FALSE if not */
41225 int n_pe;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041226 xmlChar * name; /* the name of the DTD entity */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041227 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041228 xmlChar * content; /* content of the entity */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041229 int n_content;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041230
Daniel Veillarde43cc572004-11-03 11:50:29 +000041231 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41232 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
41233 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41234 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41235 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000041236 writer = gen_xmlTextWriterPtr(n_writer, 0);
41237 pe = gen_int(n_pe, 1);
41238 name = gen_const_xmlChar_ptr(n_name, 2);
41239 content = gen_const_xmlChar_ptr(n_content, 3);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041240
41241 ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, name, content);
41242 desret_int(ret_val);
41243 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000041244 des_xmlTextWriterPtr(n_writer, writer, 0);
41245 des_int(n_pe, pe, 1);
41246 des_const_xmlChar_ptr(n_name, name, 2);
41247 des_const_xmlChar_ptr(n_content, content, 3);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041248 xmlResetLastError();
41249 if (mem_base != xmlMemBlocks()) {
41250 printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
41251 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000041252 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000041253 printf(" %d", n_writer);
41254 printf(" %d", n_pe);
41255 printf(" %d", n_name);
41256 printf(" %d", n_content);
41257 printf("\n");
41258 }
41259 }
41260 }
41261 }
41262 }
41263#endif
41264
Daniel Veillard3d97e662004-11-04 10:49:00 +000041265 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000041266 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041267}
41268
41269
41270static int
41271test_xmlTextWriterWriteDTDNotation(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041272 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041273
Daniel Veillarde43cc572004-11-03 11:50:29 +000041274#ifdef LIBXML_WRITER_ENABLED
41275 int mem_base;
41276 int ret_val;
41277 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41278 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041279 xmlChar * name; /* the name of the xml notation */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041280 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041281 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041282 int n_pubid;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041283 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041284 int n_sysid;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041285
Daniel Veillarde43cc572004-11-03 11:50:29 +000041286 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41287 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41288 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
41289 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
41290 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000041291 writer = gen_xmlTextWriterPtr(n_writer, 0);
41292 name = gen_const_xmlChar_ptr(n_name, 1);
41293 pubid = gen_const_xmlChar_ptr(n_pubid, 2);
41294 sysid = gen_const_xmlChar_ptr(n_sysid, 3);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041295
41296 ret_val = xmlTextWriterWriteDTDNotation(writer, name, pubid, sysid);
41297 desret_int(ret_val);
41298 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000041299 des_xmlTextWriterPtr(n_writer, writer, 0);
41300 des_const_xmlChar_ptr(n_name, name, 1);
41301 des_const_xmlChar_ptr(n_pubid, pubid, 2);
41302 des_const_xmlChar_ptr(n_sysid, sysid, 3);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041303 xmlResetLastError();
41304 if (mem_base != xmlMemBlocks()) {
41305 printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
41306 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000041307 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000041308 printf(" %d", n_writer);
41309 printf(" %d", n_name);
41310 printf(" %d", n_pubid);
41311 printf(" %d", n_sysid);
41312 printf("\n");
41313 }
41314 }
41315 }
41316 }
41317 }
41318#endif
41319
Daniel Veillard3d97e662004-11-04 10:49:00 +000041320 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000041321 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041322}
41323
41324
41325static int
41326test_xmlTextWriterWriteElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041327 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041328
Daniel Veillarde43cc572004-11-03 11:50:29 +000041329#ifdef LIBXML_WRITER_ENABLED
41330 int mem_base;
41331 int ret_val;
41332 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41333 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041334 xmlChar * name; /* element name */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041335 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041336 xmlChar * content; /* element content */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041337 int n_content;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041338
Daniel Veillarde43cc572004-11-03 11:50:29 +000041339 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41340 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41341 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41342 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000041343 writer = gen_xmlTextWriterPtr(n_writer, 0);
41344 name = gen_const_xmlChar_ptr(n_name, 1);
41345 content = gen_const_xmlChar_ptr(n_content, 2);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041346
41347 ret_val = xmlTextWriterWriteElement(writer, name, content);
41348 desret_int(ret_val);
41349 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000041350 des_xmlTextWriterPtr(n_writer, writer, 0);
41351 des_const_xmlChar_ptr(n_name, name, 1);
41352 des_const_xmlChar_ptr(n_content, content, 2);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041353 xmlResetLastError();
41354 if (mem_base != xmlMemBlocks()) {
41355 printf("Leak of %d blocks found in xmlTextWriterWriteElement",
41356 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000041357 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000041358 printf(" %d", n_writer);
41359 printf(" %d", n_name);
41360 printf(" %d", n_content);
41361 printf("\n");
41362 }
41363 }
41364 }
41365 }
41366#endif
41367
Daniel Veillard3d97e662004-11-04 10:49:00 +000041368 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000041369 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041370}
41371
41372
41373static int
41374test_xmlTextWriterWriteElementNS(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041375 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041376
Daniel Veillarde43cc572004-11-03 11:50:29 +000041377#ifdef LIBXML_WRITER_ENABLED
41378 int mem_base;
41379 int ret_val;
41380 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41381 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041382 xmlChar * prefix; /* namespace prefix */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041383 int n_prefix;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041384 xmlChar * name; /* element local name */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041385 int n_name;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041386 xmlChar * namespaceURI; /* namespace URI */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041387 int n_namespaceURI;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041388 xmlChar * content; /* element content */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041389 int n_content;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041390
Daniel Veillarde43cc572004-11-03 11:50:29 +000041391 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41392 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
41393 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41394 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
41395 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41396 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000041397 writer = gen_xmlTextWriterPtr(n_writer, 0);
41398 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
41399 name = gen_const_xmlChar_ptr(n_name, 2);
41400 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
41401 content = gen_const_xmlChar_ptr(n_content, 4);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041402
41403 ret_val = xmlTextWriterWriteElementNS(writer, prefix, name, namespaceURI, content);
41404 desret_int(ret_val);
41405 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000041406 des_xmlTextWriterPtr(n_writer, writer, 0);
41407 des_const_xmlChar_ptr(n_prefix, prefix, 1);
41408 des_const_xmlChar_ptr(n_name, name, 2);
41409 des_const_xmlChar_ptr(n_namespaceURI, namespaceURI, 3);
41410 des_const_xmlChar_ptr(n_content, content, 4);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041411 xmlResetLastError();
41412 if (mem_base != xmlMemBlocks()) {
41413 printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
41414 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000041415 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000041416 printf(" %d", n_writer);
41417 printf(" %d", n_prefix);
41418 printf(" %d", n_name);
41419 printf(" %d", n_namespaceURI);
41420 printf(" %d", n_content);
41421 printf("\n");
41422 }
41423 }
41424 }
41425 }
41426 }
41427 }
41428#endif
41429
Daniel Veillard3d97e662004-11-04 10:49:00 +000041430 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000041431 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041432}
41433
41434
41435static int
41436test_xmlTextWriterWriteFormatAttribute(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041437 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041438
41439
41440 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041441 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041442}
41443
41444
41445static int
41446test_xmlTextWriterWriteFormatAttributeNS(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041447 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041448
41449
41450 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041451 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041452}
41453
41454
41455static int
41456test_xmlTextWriterWriteFormatCDATA(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041457 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041458
41459
41460 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041461 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041462}
41463
41464
41465static int
41466test_xmlTextWriterWriteFormatComment(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041467 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041468
41469
41470 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041471 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041472}
41473
41474
41475static int
41476test_xmlTextWriterWriteFormatDTD(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041477 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041478
41479
41480 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041481 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041482}
41483
41484
41485static int
41486test_xmlTextWriterWriteFormatDTDAttlist(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041487 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041488
41489
41490 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041491 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041492}
41493
41494
41495static int
41496test_xmlTextWriterWriteFormatDTDElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041497 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041498
41499
41500 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041501 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041502}
41503
41504
41505static int
41506test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041507 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041508
41509
41510 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041511 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041512}
41513
41514
41515static int
41516test_xmlTextWriterWriteFormatElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041517 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041518
41519
41520 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041521 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041522}
41523
41524
41525static int
41526test_xmlTextWriterWriteFormatElementNS(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041527 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041528
41529
41530 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041531 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041532}
41533
41534
41535static int
41536test_xmlTextWriterWriteFormatPI(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041537 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041538
41539
41540 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041541 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041542}
41543
41544
41545static int
41546test_xmlTextWriterWriteFormatRaw(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041547 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041548
41549
41550 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041551 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041552}
41553
41554
41555static int
41556test_xmlTextWriterWriteFormatString(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041557 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041558
41559
41560 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041561 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041562}
41563
41564
41565static int
41566test_xmlTextWriterWritePI(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041567 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041568
Daniel Veillarde43cc572004-11-03 11:50:29 +000041569#ifdef LIBXML_WRITER_ENABLED
41570 int mem_base;
41571 int ret_val;
41572 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41573 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041574 xmlChar * target; /* PI target */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041575 int n_target;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041576 xmlChar * content; /* PI content */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041577 int n_content;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041578
Daniel Veillarde43cc572004-11-03 11:50:29 +000041579 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41580 for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
41581 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41582 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000041583 writer = gen_xmlTextWriterPtr(n_writer, 0);
41584 target = gen_const_xmlChar_ptr(n_target, 1);
41585 content = gen_const_xmlChar_ptr(n_content, 2);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041586
41587 ret_val = xmlTextWriterWritePI(writer, target, content);
41588 desret_int(ret_val);
41589 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000041590 des_xmlTextWriterPtr(n_writer, writer, 0);
41591 des_const_xmlChar_ptr(n_target, target, 1);
41592 des_const_xmlChar_ptr(n_content, content, 2);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041593 xmlResetLastError();
41594 if (mem_base != xmlMemBlocks()) {
41595 printf("Leak of %d blocks found in xmlTextWriterWritePI",
41596 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000041597 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000041598 printf(" %d", n_writer);
41599 printf(" %d", n_target);
41600 printf(" %d", n_content);
41601 printf("\n");
41602 }
41603 }
41604 }
41605 }
41606#endif
41607
Daniel Veillard3d97e662004-11-04 10:49:00 +000041608 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000041609 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041610}
41611
41612
41613static int
41614test_xmlTextWriterWriteRaw(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041615 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041616
Daniel Veillarde43cc572004-11-03 11:50:29 +000041617#ifdef LIBXML_WRITER_ENABLED
41618 int mem_base;
41619 int ret_val;
41620 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41621 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041622 xmlChar * content; /* text string */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041623 int n_content;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041624
Daniel Veillarde43cc572004-11-03 11:50:29 +000041625 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41626 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41627 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000041628 writer = gen_xmlTextWriterPtr(n_writer, 0);
41629 content = gen_const_xmlChar_ptr(n_content, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041630
41631 ret_val = xmlTextWriterWriteRaw(writer, content);
41632 desret_int(ret_val);
41633 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000041634 des_xmlTextWriterPtr(n_writer, writer, 0);
41635 des_const_xmlChar_ptr(n_content, content, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041636 xmlResetLastError();
41637 if (mem_base != xmlMemBlocks()) {
41638 printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
41639 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000041640 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000041641 printf(" %d", n_writer);
41642 printf(" %d", n_content);
41643 printf("\n");
41644 }
41645 }
41646 }
41647#endif
41648
Daniel Veillard3d97e662004-11-04 10:49:00 +000041649 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000041650 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041651}
41652
41653
41654static int
41655test_xmlTextWriterWriteRawLen(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041656 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041657
Daniel Veillarde43cc572004-11-03 11:50:29 +000041658#ifdef LIBXML_WRITER_ENABLED
41659 int mem_base;
41660 int ret_val;
41661 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41662 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041663 xmlChar * content; /* text string */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041664 int n_content;
41665 int len; /* length of the text string */
41666 int n_len;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041667
Daniel Veillarde43cc572004-11-03 11:50:29 +000041668 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41669 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41670 for (n_len = 0;n_len < gen_nb_int;n_len++) {
41671 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000041672 writer = gen_xmlTextWriterPtr(n_writer, 0);
41673 content = gen_const_xmlChar_ptr(n_content, 1);
41674 len = gen_int(n_len, 2);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041675
41676 ret_val = xmlTextWriterWriteRawLen(writer, content, len);
41677 desret_int(ret_val);
41678 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000041679 des_xmlTextWriterPtr(n_writer, writer, 0);
41680 des_const_xmlChar_ptr(n_content, content, 1);
41681 des_int(n_len, len, 2);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041682 xmlResetLastError();
41683 if (mem_base != xmlMemBlocks()) {
41684 printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
41685 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000041686 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000041687 printf(" %d", n_writer);
41688 printf(" %d", n_content);
41689 printf(" %d", n_len);
41690 printf("\n");
41691 }
41692 }
41693 }
41694 }
41695#endif
41696
Daniel Veillard3d97e662004-11-04 10:49:00 +000041697 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000041698 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041699}
41700
41701
41702static int
41703test_xmlTextWriterWriteString(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041704 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041705
Daniel Veillarde43cc572004-11-03 11:50:29 +000041706#ifdef LIBXML_WRITER_ENABLED
41707 int mem_base;
41708 int ret_val;
41709 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41710 int n_writer;
Daniel Veillardce682bc2004-11-05 17:22:25 +000041711 xmlChar * content; /* text string */
Daniel Veillarde43cc572004-11-03 11:50:29 +000041712 int n_content;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041713
Daniel Veillarde43cc572004-11-03 11:50:29 +000041714 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41715 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41716 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000041717 writer = gen_xmlTextWriterPtr(n_writer, 0);
41718 content = gen_const_xmlChar_ptr(n_content, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041719
41720 ret_val = xmlTextWriterWriteString(writer, content);
41721 desret_int(ret_val);
41722 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000041723 des_xmlTextWriterPtr(n_writer, writer, 0);
41724 des_const_xmlChar_ptr(n_content, content, 1);
Daniel Veillarde43cc572004-11-03 11:50:29 +000041725 xmlResetLastError();
41726 if (mem_base != xmlMemBlocks()) {
41727 printf("Leak of %d blocks found in xmlTextWriterWriteString",
41728 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000041729 test_ret++;
Daniel Veillarde43cc572004-11-03 11:50:29 +000041730 printf(" %d", n_writer);
41731 printf(" %d", n_content);
41732 printf("\n");
41733 }
41734 }
41735 }
41736#endif
41737
Daniel Veillard3d97e662004-11-04 10:49:00 +000041738 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000041739 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041740}
41741
41742
41743static int
41744test_xmlTextWriterWriteVFormatAttribute(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041745 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041746
41747
41748 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041749 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041750}
41751
41752
41753static int
41754test_xmlTextWriterWriteVFormatAttributeNS(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041755 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041756
41757
41758 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041759 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041760}
41761
41762
41763static int
41764test_xmlTextWriterWriteVFormatCDATA(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041765 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041766
41767
41768 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041769 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041770}
41771
41772
41773static int
41774test_xmlTextWriterWriteVFormatComment(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041775 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041776
41777
41778 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041779 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041780}
41781
41782
41783static int
41784test_xmlTextWriterWriteVFormatDTD(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041785 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041786
41787
41788 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041789 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041790}
41791
41792
41793static int
41794test_xmlTextWriterWriteVFormatDTDAttlist(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041795 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041796
41797
41798 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041799 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041800}
41801
41802
41803static int
41804test_xmlTextWriterWriteVFormatDTDElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041805 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041806
41807
41808 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041809 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041810}
41811
41812
41813static int
41814test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041815 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041816
41817
41818 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041819 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041820}
41821
41822
41823static int
41824test_xmlTextWriterWriteVFormatElement(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041825 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041826
41827
41828 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041829 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041830}
41831
41832
41833static int
41834test_xmlTextWriterWriteVFormatElementNS(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041835 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041836
41837
41838 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041839 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041840}
41841
41842
41843static int
41844test_xmlTextWriterWriteVFormatPI(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041845 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041846
41847
41848 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041849 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041850}
41851
41852
41853static int
41854test_xmlTextWriterWriteVFormatRaw(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041855 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041856
41857
41858 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041859 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041860}
41861
41862
41863static int
41864test_xmlTextWriterWriteVFormatString(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041865 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041866
41867
41868 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000041869 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041870}
41871
41872static int
41873test_xmlwriter(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041874 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041875
Daniel Veillardd5cc0f72004-11-06 19:24:28 +000041876 printf("Testing xmlwriter : 51 of 79 functions ...\n");
Daniel Veillard42595322004-11-08 10:52:06 +000041877 test_ret += test_xmlNewTextWriter();
41878 test_ret += test_xmlNewTextWriterFilename();
41879 test_ret += test_xmlNewTextWriterMemory();
41880 test_ret += test_xmlNewTextWriterPushParser();
41881 test_ret += test_xmlNewTextWriterTree();
41882 test_ret += test_xmlTextWriterEndAttribute();
41883 test_ret += test_xmlTextWriterEndCDATA();
41884 test_ret += test_xmlTextWriterEndComment();
41885 test_ret += test_xmlTextWriterEndDTD();
41886 test_ret += test_xmlTextWriterEndDTDAttlist();
41887 test_ret += test_xmlTextWriterEndDTDElement();
41888 test_ret += test_xmlTextWriterEndDTDEntity();
41889 test_ret += test_xmlTextWriterEndDocument();
41890 test_ret += test_xmlTextWriterEndElement();
41891 test_ret += test_xmlTextWriterEndPI();
41892 test_ret += test_xmlTextWriterFlush();
41893 test_ret += test_xmlTextWriterFullEndElement();
41894 test_ret += test_xmlTextWriterSetIndent();
41895 test_ret += test_xmlTextWriterSetIndentString();
41896 test_ret += test_xmlTextWriterStartAttribute();
41897 test_ret += test_xmlTextWriterStartAttributeNS();
41898 test_ret += test_xmlTextWriterStartCDATA();
41899 test_ret += test_xmlTextWriterStartComment();
41900 test_ret += test_xmlTextWriterStartDTD();
41901 test_ret += test_xmlTextWriterStartDTDAttlist();
41902 test_ret += test_xmlTextWriterStartDTDElement();
41903 test_ret += test_xmlTextWriterStartDTDEntity();
41904 test_ret += test_xmlTextWriterStartDocument();
41905 test_ret += test_xmlTextWriterStartElement();
41906 test_ret += test_xmlTextWriterStartElementNS();
41907 test_ret += test_xmlTextWriterStartPI();
41908 test_ret += test_xmlTextWriterWriteAttribute();
41909 test_ret += test_xmlTextWriterWriteAttributeNS();
41910 test_ret += test_xmlTextWriterWriteBase64();
41911 test_ret += test_xmlTextWriterWriteBinHex();
41912 test_ret += test_xmlTextWriterWriteCDATA();
41913 test_ret += test_xmlTextWriterWriteComment();
41914 test_ret += test_xmlTextWriterWriteDTD();
41915 test_ret += test_xmlTextWriterWriteDTDAttlist();
41916 test_ret += test_xmlTextWriterWriteDTDElement();
41917 test_ret += test_xmlTextWriterWriteDTDEntity();
41918 test_ret += test_xmlTextWriterWriteDTDExternalEntity();
41919 test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
41920 test_ret += test_xmlTextWriterWriteDTDInternalEntity();
41921 test_ret += test_xmlTextWriterWriteDTDNotation();
41922 test_ret += test_xmlTextWriterWriteElement();
41923 test_ret += test_xmlTextWriterWriteElementNS();
41924 test_ret += test_xmlTextWriterWriteFormatAttribute();
41925 test_ret += test_xmlTextWriterWriteFormatAttributeNS();
41926 test_ret += test_xmlTextWriterWriteFormatCDATA();
41927 test_ret += test_xmlTextWriterWriteFormatComment();
41928 test_ret += test_xmlTextWriterWriteFormatDTD();
41929 test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
41930 test_ret += test_xmlTextWriterWriteFormatDTDElement();
41931 test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
41932 test_ret += test_xmlTextWriterWriteFormatElement();
41933 test_ret += test_xmlTextWriterWriteFormatElementNS();
41934 test_ret += test_xmlTextWriterWriteFormatPI();
41935 test_ret += test_xmlTextWriterWriteFormatRaw();
41936 test_ret += test_xmlTextWriterWriteFormatString();
41937 test_ret += test_xmlTextWriterWritePI();
41938 test_ret += test_xmlTextWriterWriteRaw();
41939 test_ret += test_xmlTextWriterWriteRawLen();
41940 test_ret += test_xmlTextWriterWriteString();
41941 test_ret += test_xmlTextWriterWriteVFormatAttribute();
41942 test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
41943 test_ret += test_xmlTextWriterWriteVFormatCDATA();
41944 test_ret += test_xmlTextWriterWriteVFormatComment();
41945 test_ret += test_xmlTextWriterWriteVFormatDTD();
41946 test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
41947 test_ret += test_xmlTextWriterWriteVFormatDTDElement();
41948 test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
41949 test_ret += test_xmlTextWriterWriteVFormatElement();
41950 test_ret += test_xmlTextWriterWriteVFormatElementNS();
41951 test_ret += test_xmlTextWriterWriteVFormatPI();
41952 test_ret += test_xmlTextWriterWriteVFormatRaw();
41953 test_ret += test_xmlTextWriterWriteVFormatString();
Daniel Veillardd93f6252004-11-02 15:53:51 +000041954
Daniel Veillard42595322004-11-08 10:52:06 +000041955 if (test_ret != 0)
41956 printf("Module xmlwriter: %d errors\n", test_ret);
41957 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041958}
41959
41960static int
41961test_xmlXPathCastBooleanToNumber(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041962 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041963
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000041964#ifdef LIBXML_XPATH_ENABLED
41965 int mem_base;
41966 double ret_val;
41967 int val; /* a boolean */
41968 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041969
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000041970 for (n_val = 0;n_val < gen_nb_int;n_val++) {
41971 mem_base = xmlMemBlocks();
41972 val = gen_int(n_val, 0);
41973
41974 ret_val = xmlXPathCastBooleanToNumber(val);
41975 desret_double(ret_val);
41976 call_tests++;
41977 des_int(n_val, val, 0);
41978 xmlResetLastError();
41979 if (mem_base != xmlMemBlocks()) {
41980 printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
41981 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000041982 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000041983 printf(" %d", n_val);
41984 printf("\n");
41985 }
41986 }
41987#endif
41988
41989 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000041990 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000041991}
41992
41993
41994static int
41995test_xmlXPathCastBooleanToString(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000041996 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000041997
Daniel Veillard8a32fe42004-11-02 22:10:16 +000041998#ifdef LIBXML_XPATH_ENABLED
41999 int mem_base;
42000 xmlChar * ret_val;
42001 int val; /* a boolean */
42002 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042003
Daniel Veillard8a32fe42004-11-02 22:10:16 +000042004 for (n_val = 0;n_val < gen_nb_int;n_val++) {
42005 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000042006 val = gen_int(n_val, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000042007
42008 ret_val = xmlXPathCastBooleanToString(val);
42009 desret_xmlChar_ptr(ret_val);
42010 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000042011 des_int(n_val, val, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000042012 xmlResetLastError();
42013 if (mem_base != xmlMemBlocks()) {
42014 printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
42015 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042016 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000042017 printf(" %d", n_val);
42018 printf("\n");
42019 }
42020 }
42021#endif
42022
Daniel Veillard3d97e662004-11-04 10:49:00 +000042023 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042024 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042025}
42026
42027
42028static int
42029test_xmlXPathCastNodeSetToBoolean(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042030 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042031
Daniel Veillardce682bc2004-11-05 17:22:25 +000042032#ifdef LIBXML_XPATH_ENABLED
42033 int mem_base;
42034 int ret_val;
42035 xmlNodeSetPtr ns; /* a node-set */
42036 int n_ns;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042037
Daniel Veillardce682bc2004-11-05 17:22:25 +000042038 for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
42039 mem_base = xmlMemBlocks();
42040 ns = gen_xmlNodeSetPtr(n_ns, 0);
42041
42042 ret_val = xmlXPathCastNodeSetToBoolean(ns);
42043 desret_int(ret_val);
42044 call_tests++;
42045 des_xmlNodeSetPtr(n_ns, ns, 0);
42046 xmlResetLastError();
42047 if (mem_base != xmlMemBlocks()) {
42048 printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
42049 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042050 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000042051 printf(" %d", n_ns);
42052 printf("\n");
42053 }
42054 }
42055#endif
42056
42057 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042058 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042059}
42060
42061
42062static int
42063test_xmlXPathCastNodeSetToNumber(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042064 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042065
Daniel Veillardce682bc2004-11-05 17:22:25 +000042066#ifdef LIBXML_XPATH_ENABLED
42067 int mem_base;
42068 double ret_val;
42069 xmlNodeSetPtr ns; /* a node-set */
42070 int n_ns;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042071
Daniel Veillardce682bc2004-11-05 17:22:25 +000042072 for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
42073 mem_base = xmlMemBlocks();
42074 ns = gen_xmlNodeSetPtr(n_ns, 0);
42075
42076 ret_val = xmlXPathCastNodeSetToNumber(ns);
42077 desret_double(ret_val);
42078 call_tests++;
42079 des_xmlNodeSetPtr(n_ns, ns, 0);
42080 xmlResetLastError();
42081 if (mem_base != xmlMemBlocks()) {
42082 printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
42083 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042084 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000042085 printf(" %d", n_ns);
42086 printf("\n");
42087 }
42088 }
42089#endif
42090
42091 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042092 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042093}
42094
42095
42096static int
42097test_xmlXPathCastNodeSetToString(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042098 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042099
Daniel Veillardce682bc2004-11-05 17:22:25 +000042100#ifdef LIBXML_XPATH_ENABLED
42101 int mem_base;
42102 xmlChar * ret_val;
42103 xmlNodeSetPtr ns; /* a node-set */
42104 int n_ns;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042105
Daniel Veillardce682bc2004-11-05 17:22:25 +000042106 for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
42107 mem_base = xmlMemBlocks();
42108 ns = gen_xmlNodeSetPtr(n_ns, 0);
42109
42110 ret_val = xmlXPathCastNodeSetToString(ns);
42111 desret_xmlChar_ptr(ret_val);
42112 call_tests++;
42113 des_xmlNodeSetPtr(n_ns, ns, 0);
42114 xmlResetLastError();
42115 if (mem_base != xmlMemBlocks()) {
42116 printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
42117 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042118 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000042119 printf(" %d", n_ns);
42120 printf("\n");
42121 }
42122 }
42123#endif
42124
42125 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042126 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042127}
42128
42129
42130static int
42131test_xmlXPathCastNodeToNumber(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042132 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042133
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000042134#ifdef LIBXML_XPATH_ENABLED
42135 int mem_base;
42136 double ret_val;
42137 xmlNodePtr node; /* a node */
42138 int n_node;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042139
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000042140 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
42141 mem_base = xmlMemBlocks();
42142 node = gen_xmlNodePtr(n_node, 0);
42143
42144 ret_val = xmlXPathCastNodeToNumber(node);
42145 desret_double(ret_val);
42146 call_tests++;
42147 des_xmlNodePtr(n_node, node, 0);
42148 xmlResetLastError();
42149 if (mem_base != xmlMemBlocks()) {
42150 printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
42151 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042152 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000042153 printf(" %d", n_node);
42154 printf("\n");
42155 }
42156 }
42157#endif
42158
42159 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042160 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042161}
42162
42163
42164static int
42165test_xmlXPathCastNodeToString(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042166 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042167
Daniel Veillard8a32fe42004-11-02 22:10:16 +000042168#ifdef LIBXML_XPATH_ENABLED
42169 int mem_base;
42170 xmlChar * ret_val;
42171 xmlNodePtr node; /* a node */
42172 int n_node;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042173
Daniel Veillard8a32fe42004-11-02 22:10:16 +000042174 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
42175 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000042176 node = gen_xmlNodePtr(n_node, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000042177
42178 ret_val = xmlXPathCastNodeToString(node);
42179 desret_xmlChar_ptr(ret_val);
42180 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000042181 des_xmlNodePtr(n_node, node, 0);
Daniel Veillard8a32fe42004-11-02 22:10:16 +000042182 xmlResetLastError();
42183 if (mem_base != xmlMemBlocks()) {
42184 printf("Leak of %d blocks found in xmlXPathCastNodeToString",
42185 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042186 test_ret++;
Daniel Veillard8a32fe42004-11-02 22:10:16 +000042187 printf(" %d", n_node);
42188 printf("\n");
42189 }
42190 }
42191#endif
42192
Daniel Veillard3d97e662004-11-04 10:49:00 +000042193 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042194 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042195}
42196
42197
42198static int
42199test_xmlXPathCastNumberToBoolean(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042200 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042201
Daniel Veillard3d95c732004-11-06 22:25:14 +000042202#ifdef LIBXML_XPATH_ENABLED
42203 int mem_base;
42204 int ret_val;
42205 double val; /* a number */
42206 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042207
Daniel Veillard3d95c732004-11-06 22:25:14 +000042208 for (n_val = 0;n_val < gen_nb_double;n_val++) {
42209 mem_base = xmlMemBlocks();
42210 val = gen_double(n_val, 0);
42211
42212 ret_val = xmlXPathCastNumberToBoolean(val);
42213 desret_int(ret_val);
42214 call_tests++;
42215 des_double(n_val, val, 0);
42216 xmlResetLastError();
42217 if (mem_base != xmlMemBlocks()) {
42218 printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
42219 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042220 test_ret++;
Daniel Veillard3d95c732004-11-06 22:25:14 +000042221 printf(" %d", n_val);
42222 printf("\n");
42223 }
42224 }
42225#endif
42226
42227 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042228 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042229}
42230
42231
42232static int
42233test_xmlXPathCastNumberToString(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042234 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042235
Daniel Veillard3d95c732004-11-06 22:25:14 +000042236#ifdef LIBXML_XPATH_ENABLED
42237 int mem_base;
42238 xmlChar * ret_val;
42239 double val; /* a number */
42240 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042241
Daniel Veillard3d95c732004-11-06 22:25:14 +000042242 for (n_val = 0;n_val < gen_nb_double;n_val++) {
42243 mem_base = xmlMemBlocks();
42244 val = gen_double(n_val, 0);
42245
42246 ret_val = xmlXPathCastNumberToString(val);
42247 desret_xmlChar_ptr(ret_val);
42248 call_tests++;
42249 des_double(n_val, val, 0);
42250 xmlResetLastError();
42251 if (mem_base != xmlMemBlocks()) {
42252 printf("Leak of %d blocks found in xmlXPathCastNumberToString",
42253 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042254 test_ret++;
Daniel Veillard3d95c732004-11-06 22:25:14 +000042255 printf(" %d", n_val);
42256 printf("\n");
42257 }
42258 }
42259#endif
42260
42261 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042262 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042263}
42264
42265
42266static int
42267test_xmlXPathCastStringToBoolean(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042268 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042269
42270#ifdef LIBXML_XPATH_ENABLED
42271 int mem_base;
42272 int ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000042273 xmlChar * val; /* a string */
Daniel Veillardd93f6252004-11-02 15:53:51 +000042274 int n_val;
42275
42276 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
42277 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000042278 val = gen_const_xmlChar_ptr(n_val, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042279
42280 ret_val = xmlXPathCastStringToBoolean(val);
42281 desret_int(ret_val);
42282 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000042283 des_const_xmlChar_ptr(n_val, val, 0);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042284 xmlResetLastError();
42285 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000042286 printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
Daniel Veillardd93f6252004-11-02 15:53:51 +000042287 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042288 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000042289 printf(" %d", n_val);
42290 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000042291 }
42292 }
42293#endif
42294
Daniel Veillard3d97e662004-11-04 10:49:00 +000042295 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042296 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042297}
42298
42299
42300static int
42301test_xmlXPathCastStringToNumber(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042302 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042303
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000042304#ifdef LIBXML_XPATH_ENABLED
42305 int mem_base;
42306 double ret_val;
Daniel Veillardce682bc2004-11-05 17:22:25 +000042307 xmlChar * val; /* a string */
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000042308 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042309
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000042310 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
42311 mem_base = xmlMemBlocks();
42312 val = gen_const_xmlChar_ptr(n_val, 0);
42313
42314 ret_val = xmlXPathCastStringToNumber(val);
42315 desret_double(ret_val);
42316 call_tests++;
42317 des_const_xmlChar_ptr(n_val, val, 0);
42318 xmlResetLastError();
42319 if (mem_base != xmlMemBlocks()) {
42320 printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
42321 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042322 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000042323 printf(" %d", n_val);
42324 printf("\n");
42325 }
42326 }
42327#endif
42328
42329 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042330 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042331}
42332
42333
42334static int
42335test_xmlXPathCastToBoolean(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042336 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042337
Daniel Veillardd005b9e2004-11-03 17:07:05 +000042338#ifdef LIBXML_XPATH_ENABLED
42339 int mem_base;
42340 int ret_val;
42341 xmlXPathObjectPtr val; /* an XPath object */
42342 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042343
Daniel Veillardd005b9e2004-11-03 17:07:05 +000042344 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
42345 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000042346 val = gen_xmlXPathObjectPtr(n_val, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000042347
42348 ret_val = xmlXPathCastToBoolean(val);
42349 desret_int(ret_val);
42350 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000042351 des_xmlXPathObjectPtr(n_val, val, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000042352 xmlResetLastError();
42353 if (mem_base != xmlMemBlocks()) {
42354 printf("Leak of %d blocks found in xmlXPathCastToBoolean",
42355 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042356 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000042357 printf(" %d", n_val);
42358 printf("\n");
42359 }
42360 }
42361#endif
42362
Daniel Veillard3d97e662004-11-04 10:49:00 +000042363 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042364 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042365}
42366
42367
42368static int
42369test_xmlXPathCastToNumber(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042370 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042371
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000042372#ifdef LIBXML_XPATH_ENABLED
42373 int mem_base;
42374 double ret_val;
42375 xmlXPathObjectPtr val; /* an XPath object */
42376 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042377
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000042378 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
42379 mem_base = xmlMemBlocks();
42380 val = gen_xmlXPathObjectPtr(n_val, 0);
42381
42382 ret_val = xmlXPathCastToNumber(val);
42383 desret_double(ret_val);
42384 call_tests++;
42385 des_xmlXPathObjectPtr(n_val, val, 0);
42386 xmlResetLastError();
42387 if (mem_base != xmlMemBlocks()) {
42388 printf("Leak of %d blocks found in xmlXPathCastToNumber",
42389 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042390 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000042391 printf(" %d", n_val);
42392 printf("\n");
42393 }
42394 }
42395#endif
42396
42397 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042398 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042399}
42400
42401
42402static int
42403test_xmlXPathCastToString(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042404 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042405
Daniel Veillardd005b9e2004-11-03 17:07:05 +000042406#ifdef LIBXML_XPATH_ENABLED
42407 int mem_base;
42408 xmlChar * ret_val;
42409 xmlXPathObjectPtr val; /* an XPath object */
42410 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042411
Daniel Veillardd005b9e2004-11-03 17:07:05 +000042412 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
42413 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000042414 val = gen_xmlXPathObjectPtr(n_val, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000042415
42416 ret_val = xmlXPathCastToString(val);
42417 desret_xmlChar_ptr(ret_val);
42418 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000042419 des_xmlXPathObjectPtr(n_val, val, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000042420 xmlResetLastError();
42421 if (mem_base != xmlMemBlocks()) {
42422 printf("Leak of %d blocks found in xmlXPathCastToString",
42423 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042424 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000042425 printf(" %d", n_val);
42426 printf("\n");
42427 }
42428 }
42429#endif
42430
Daniel Veillard3d97e662004-11-04 10:49:00 +000042431 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042432 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042433}
42434
42435
42436static int
42437test_xmlXPathCmpNodes(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042438 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042439
42440#ifdef LIBXML_XPATH_ENABLED
42441 int mem_base;
42442 int ret_val;
42443 xmlNodePtr node1; /* the first node */
42444 int n_node1;
42445 xmlNodePtr node2; /* the second node */
42446 int n_node2;
42447
42448 for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
42449 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
42450 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000042451 node1 = gen_xmlNodePtr(n_node1, 0);
42452 node2 = gen_xmlNodePtr(n_node2, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042453
42454 ret_val = xmlXPathCmpNodes(node1, node2);
42455 desret_int(ret_val);
42456 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000042457 des_xmlNodePtr(n_node1, node1, 0);
42458 des_xmlNodePtr(n_node2, node2, 1);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042459 xmlResetLastError();
42460 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000042461 printf("Leak of %d blocks found in xmlXPathCmpNodes",
Daniel Veillardd93f6252004-11-02 15:53:51 +000042462 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042463 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000042464 printf(" %d", n_node1);
42465 printf(" %d", n_node2);
42466 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000042467 }
42468 }
42469 }
42470#endif
42471
Daniel Veillard3d97e662004-11-04 10:49:00 +000042472 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042473 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042474}
42475
42476
42477static int
42478test_xmlXPathCompile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042479 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042480
42481
42482 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000042483 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042484}
42485
42486
Daniel Veillardce682bc2004-11-05 17:22:25 +000042487#define gen_nb_xmlXPathCompExprPtr 1
42488static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
42489 return(NULL);
42490}
42491static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
42492}
42493
42494#define gen_nb_xmlXPathContextPtr 1
42495static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
42496 return(NULL);
42497}
42498static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
42499}
42500
Daniel Veillardd93f6252004-11-02 15:53:51 +000042501static int
42502test_xmlXPathCompiledEval(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042503 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042504
Daniel Veillardce682bc2004-11-05 17:22:25 +000042505#ifdef LIBXML_XPATH_ENABLED
42506 int mem_base;
42507 xmlXPathObjectPtr ret_val;
42508 xmlXPathCompExprPtr comp; /* the compiled XPath expression */
42509 int n_comp;
42510 xmlXPathContextPtr ctx; /* the XPath context */
42511 int n_ctx;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042512
Daniel Veillardce682bc2004-11-05 17:22:25 +000042513 for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
42514 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
42515 mem_base = xmlMemBlocks();
42516 comp = gen_xmlXPathCompExprPtr(n_comp, 0);
42517 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
42518
42519 ret_val = xmlXPathCompiledEval(comp, ctx);
42520 desret_xmlXPathObjectPtr(ret_val);
42521 call_tests++;
42522 des_xmlXPathCompExprPtr(n_comp, comp, 0);
42523 des_xmlXPathContextPtr(n_ctx, ctx, 1);
42524 xmlResetLastError();
42525 if (mem_base != xmlMemBlocks()) {
42526 printf("Leak of %d blocks found in xmlXPathCompiledEval",
42527 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042528 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000042529 printf(" %d", n_comp);
42530 printf(" %d", n_ctx);
42531 printf("\n");
42532 }
42533 }
42534 }
42535#endif
42536
42537 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042538 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042539}
42540
42541
42542static int
42543test_xmlXPathConvertBoolean(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042544 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042545
Daniel Veillard3d97e662004-11-04 10:49:00 +000042546#ifdef LIBXML_XPATH_ENABLED
42547 int mem_base;
42548 xmlXPathObjectPtr ret_val;
42549 xmlXPathObjectPtr val; /* an XPath object */
42550 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042551
Daniel Veillard3d97e662004-11-04 10:49:00 +000042552 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
42553 mem_base = xmlMemBlocks();
42554 val = gen_xmlXPathObjectPtr(n_val, 0);
42555
42556 ret_val = xmlXPathConvertBoolean(val);
42557 val = NULL;
42558 desret_xmlXPathObjectPtr(ret_val);
42559 call_tests++;
42560 des_xmlXPathObjectPtr(n_val, val, 0);
42561 xmlResetLastError();
42562 if (mem_base != xmlMemBlocks()) {
42563 printf("Leak of %d blocks found in xmlXPathConvertBoolean",
42564 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042565 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000042566 printf(" %d", n_val);
42567 printf("\n");
42568 }
42569 }
42570#endif
42571
42572 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042573 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042574}
42575
42576
42577static int
42578test_xmlXPathConvertNumber(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042579 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042580
Daniel Veillard3d97e662004-11-04 10:49:00 +000042581#ifdef LIBXML_XPATH_ENABLED
42582 int mem_base;
42583 xmlXPathObjectPtr ret_val;
42584 xmlXPathObjectPtr val; /* an XPath object */
42585 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042586
Daniel Veillard3d97e662004-11-04 10:49:00 +000042587 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
42588 mem_base = xmlMemBlocks();
42589 val = gen_xmlXPathObjectPtr(n_val, 0);
42590
42591 ret_val = xmlXPathConvertNumber(val);
42592 val = NULL;
42593 desret_xmlXPathObjectPtr(ret_val);
42594 call_tests++;
42595 des_xmlXPathObjectPtr(n_val, val, 0);
42596 xmlResetLastError();
42597 if (mem_base != xmlMemBlocks()) {
42598 printf("Leak of %d blocks found in xmlXPathConvertNumber",
42599 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042600 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000042601 printf(" %d", n_val);
42602 printf("\n");
42603 }
42604 }
42605#endif
42606
42607 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042608 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042609}
42610
42611
42612static int
42613test_xmlXPathConvertString(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042614 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042615
Daniel Veillard3d97e662004-11-04 10:49:00 +000042616#ifdef LIBXML_XPATH_ENABLED
42617 int mem_base;
42618 xmlXPathObjectPtr ret_val;
42619 xmlXPathObjectPtr val; /* an XPath object */
42620 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042621
Daniel Veillard3d97e662004-11-04 10:49:00 +000042622 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
42623 mem_base = xmlMemBlocks();
42624 val = gen_xmlXPathObjectPtr(n_val, 0);
42625
42626 ret_val = xmlXPathConvertString(val);
42627 val = NULL;
42628 desret_xmlXPathObjectPtr(ret_val);
42629 call_tests++;
42630 des_xmlXPathObjectPtr(n_val, val, 0);
42631 xmlResetLastError();
42632 if (mem_base != xmlMemBlocks()) {
42633 printf("Leak of %d blocks found in xmlXPathConvertString",
42634 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042635 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000042636 printf(" %d", n_val);
42637 printf("\n");
42638 }
42639 }
42640#endif
42641
42642 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042643 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042644}
42645
42646
42647static int
42648test_xmlXPathCtxtCompile(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042649 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042650
42651
42652 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000042653 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042654}
42655
42656
42657static int
42658test_xmlXPathEval(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042659 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042660
Daniel Veillardce682bc2004-11-05 17:22:25 +000042661#ifdef LIBXML_XPATH_ENABLED
42662 int mem_base;
42663 xmlXPathObjectPtr ret_val;
42664 xmlChar * str; /* the XPath expression */
42665 int n_str;
42666 xmlXPathContextPtr ctx; /* the XPath context */
42667 int n_ctx;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042668
Daniel Veillardce682bc2004-11-05 17:22:25 +000042669 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
42670 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
42671 mem_base = xmlMemBlocks();
42672 str = gen_const_xmlChar_ptr(n_str, 0);
42673 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
42674
42675 ret_val = xmlXPathEval(str, ctx);
42676 desret_xmlXPathObjectPtr(ret_val);
42677 call_tests++;
42678 des_const_xmlChar_ptr(n_str, str, 0);
42679 des_xmlXPathContextPtr(n_ctx, ctx, 1);
42680 xmlResetLastError();
42681 if (mem_base != xmlMemBlocks()) {
42682 printf("Leak of %d blocks found in xmlXPathEval",
42683 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042684 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000042685 printf(" %d", n_str);
42686 printf(" %d", n_ctx);
42687 printf("\n");
42688 }
42689 }
42690 }
42691#endif
42692
42693 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042694 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042695}
42696
42697
42698static int
42699test_xmlXPathEvalExpression(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042700 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042701
Daniel Veillardce682bc2004-11-05 17:22:25 +000042702#ifdef LIBXML_XPATH_ENABLED
42703 int mem_base;
42704 xmlXPathObjectPtr ret_val;
42705 xmlChar * str; /* the XPath expression */
42706 int n_str;
42707 xmlXPathContextPtr ctxt; /* the XPath context */
42708 int n_ctxt;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042709
Daniel Veillardce682bc2004-11-05 17:22:25 +000042710 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
42711 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
42712 mem_base = xmlMemBlocks();
42713 str = gen_const_xmlChar_ptr(n_str, 0);
42714 ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
42715
42716 ret_val = xmlXPathEvalExpression(str, ctxt);
42717 desret_xmlXPathObjectPtr(ret_val);
42718 call_tests++;
42719 des_const_xmlChar_ptr(n_str, str, 0);
42720 des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
42721 xmlResetLastError();
42722 if (mem_base != xmlMemBlocks()) {
42723 printf("Leak of %d blocks found in xmlXPathEvalExpression",
42724 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042725 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000042726 printf(" %d", n_str);
42727 printf(" %d", n_ctxt);
42728 printf("\n");
42729 }
42730 }
42731 }
42732#endif
42733
42734 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042735 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042736}
42737
42738
42739static int
42740test_xmlXPathEvalPredicate(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042741 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042742
Daniel Veillardce682bc2004-11-05 17:22:25 +000042743#ifdef LIBXML_XPATH_ENABLED
42744 int mem_base;
42745 int ret_val;
42746 xmlXPathContextPtr ctxt; /* the XPath context */
42747 int n_ctxt;
42748 xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
42749 int n_res;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042750
Daniel Veillardce682bc2004-11-05 17:22:25 +000042751 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
42752 for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
42753 mem_base = xmlMemBlocks();
42754 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
42755 res = gen_xmlXPathObjectPtr(n_res, 1);
42756
42757 ret_val = xmlXPathEvalPredicate(ctxt, res);
42758 desret_int(ret_val);
42759 call_tests++;
42760 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
42761 des_xmlXPathObjectPtr(n_res, res, 1);
42762 xmlResetLastError();
42763 if (mem_base != xmlMemBlocks()) {
42764 printf("Leak of %d blocks found in xmlXPathEvalPredicate",
42765 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042766 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000042767 printf(" %d", n_ctxt);
42768 printf(" %d", n_res);
42769 printf("\n");
42770 }
42771 }
42772 }
42773#endif
42774
42775 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042776 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042777}
42778
42779
42780static int
42781test_xmlXPathInit(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042782 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042783
42784#ifdef LIBXML_XPATH_ENABLED
42785 int mem_base;
42786
42787 mem_base = xmlMemBlocks();
42788
42789 xmlXPathInit();
42790 call_tests++;
42791 xmlResetLastError();
42792 if (mem_base != xmlMemBlocks()) {
Daniel Veillarda03e3652004-11-02 18:45:30 +000042793 printf("Leak of %d blocks found in xmlXPathInit",
Daniel Veillardd93f6252004-11-02 15:53:51 +000042794 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042795 test_ret++;
Daniel Veillarda03e3652004-11-02 18:45:30 +000042796 printf("\n");
Daniel Veillardd93f6252004-11-02 15:53:51 +000042797 }
42798#endif
42799
Daniel Veillard3d97e662004-11-04 10:49:00 +000042800 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042801 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042802}
42803
42804
42805static int
42806test_xmlXPathIsInf(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042807 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042808
Daniel Veillard3d95c732004-11-06 22:25:14 +000042809#ifdef LIBXML_XPATH_ENABLED
42810 int mem_base;
42811 int ret_val;
42812 double val; /* a double value */
42813 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042814
Daniel Veillard3d95c732004-11-06 22:25:14 +000042815 for (n_val = 0;n_val < gen_nb_double;n_val++) {
42816 mem_base = xmlMemBlocks();
42817 val = gen_double(n_val, 0);
42818
42819 ret_val = xmlXPathIsInf(val);
42820 desret_int(ret_val);
42821 call_tests++;
42822 des_double(n_val, val, 0);
42823 xmlResetLastError();
42824 if (mem_base != xmlMemBlocks()) {
42825 printf("Leak of %d blocks found in xmlXPathIsInf",
42826 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042827 test_ret++;
Daniel Veillard3d95c732004-11-06 22:25:14 +000042828 printf(" %d", n_val);
42829 printf("\n");
42830 }
42831 }
42832#endif
42833
42834 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042835 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042836}
42837
42838
42839static int
42840test_xmlXPathIsNaN(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042841 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042842
Daniel Veillard3d95c732004-11-06 22:25:14 +000042843#ifdef LIBXML_XPATH_ENABLED
42844 int mem_base;
42845 int ret_val;
42846 double val; /* a double value */
42847 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042848
Daniel Veillard3d95c732004-11-06 22:25:14 +000042849 for (n_val = 0;n_val < gen_nb_double;n_val++) {
42850 mem_base = xmlMemBlocks();
42851 val = gen_double(n_val, 0);
42852
42853 ret_val = xmlXPathIsNaN(val);
42854 desret_int(ret_val);
42855 call_tests++;
42856 des_double(n_val, val, 0);
42857 xmlResetLastError();
42858 if (mem_base != xmlMemBlocks()) {
42859 printf("Leak of %d blocks found in xmlXPathIsNaN",
42860 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042861 test_ret++;
Daniel Veillard3d95c732004-11-06 22:25:14 +000042862 printf(" %d", n_val);
42863 printf("\n");
42864 }
42865 }
42866#endif
42867
42868 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042869 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042870}
42871
42872
42873static int
42874test_xmlXPathNewContext(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042875 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042876
42877
42878 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000042879 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042880}
42881
42882
42883static int
42884test_xmlXPathNodeSetCreate(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042885 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042886
42887
42888 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000042889 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042890}
42891
42892
42893static int
42894test_xmlXPathObjectCopy(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042895 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042896
Daniel Veillard3d97e662004-11-04 10:49:00 +000042897#ifdef LIBXML_XPATH_ENABLED
42898 int mem_base;
42899 xmlXPathObjectPtr ret_val;
42900 xmlXPathObjectPtr val; /* the original object */
42901 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042902
Daniel Veillard3d97e662004-11-04 10:49:00 +000042903 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
42904 mem_base = xmlMemBlocks();
42905 val = gen_xmlXPathObjectPtr(n_val, 0);
42906
42907 ret_val = xmlXPathObjectCopy(val);
42908 desret_xmlXPathObjectPtr(ret_val);
42909 call_tests++;
42910 des_xmlXPathObjectPtr(n_val, val, 0);
42911 xmlResetLastError();
42912 if (mem_base != xmlMemBlocks()) {
42913 printf("Leak of %d blocks found in xmlXPathObjectCopy",
42914 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042915 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000042916 printf(" %d", n_val);
42917 printf("\n");
42918 }
42919 }
42920#endif
42921
42922 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042923 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042924}
42925
42926
42927static int
42928test_xmlXPathOrderDocElems(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042929 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042930
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000042931#ifdef LIBXML_XPATH_ENABLED
42932 int mem_base;
42933 long ret_val;
42934 xmlDocPtr doc; /* an input document */
42935 int n_doc;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042936
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000042937 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
42938 mem_base = xmlMemBlocks();
42939 doc = gen_xmlDocPtr(n_doc, 0);
42940
42941 ret_val = xmlXPathOrderDocElems(doc);
42942 desret_long(ret_val);
42943 call_tests++;
42944 des_xmlDocPtr(n_doc, doc, 0);
42945 xmlResetLastError();
42946 if (mem_base != xmlMemBlocks()) {
42947 printf("Leak of %d blocks found in xmlXPathOrderDocElems",
42948 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000042949 test_ret++;
Daniel Veillard1ba06bb2004-11-04 12:32:18 +000042950 printf(" %d", n_doc);
42951 printf("\n");
42952 }
42953 }
42954#endif
42955
42956 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000042957 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000042958}
42959
42960static int
42961test_xpath(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000042962 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000042963
Daniel Veillard3d95c732004-11-06 22:25:14 +000042964 printf("Testing xpath : 27 of 36 functions ...\n");
Daniel Veillard42595322004-11-08 10:52:06 +000042965 test_ret += test_xmlXPathCastBooleanToNumber();
42966 test_ret += test_xmlXPathCastBooleanToString();
42967 test_ret += test_xmlXPathCastNodeSetToBoolean();
42968 test_ret += test_xmlXPathCastNodeSetToNumber();
42969 test_ret += test_xmlXPathCastNodeSetToString();
42970 test_ret += test_xmlXPathCastNodeToNumber();
42971 test_ret += test_xmlXPathCastNodeToString();
42972 test_ret += test_xmlXPathCastNumberToBoolean();
42973 test_ret += test_xmlXPathCastNumberToString();
42974 test_ret += test_xmlXPathCastStringToBoolean();
42975 test_ret += test_xmlXPathCastStringToNumber();
42976 test_ret += test_xmlXPathCastToBoolean();
42977 test_ret += test_xmlXPathCastToNumber();
42978 test_ret += test_xmlXPathCastToString();
42979 test_ret += test_xmlXPathCmpNodes();
42980 test_ret += test_xmlXPathCompile();
42981 test_ret += test_xmlXPathCompiledEval();
42982 test_ret += test_xmlXPathConvertBoolean();
42983 test_ret += test_xmlXPathConvertNumber();
42984 test_ret += test_xmlXPathConvertString();
42985 test_ret += test_xmlXPathCtxtCompile();
42986 test_ret += test_xmlXPathEval();
42987 test_ret += test_xmlXPathEvalExpression();
42988 test_ret += test_xmlXPathEvalPredicate();
42989 test_ret += test_xmlXPathInit();
42990 test_ret += test_xmlXPathIsInf();
42991 test_ret += test_xmlXPathIsNaN();
42992 test_ret += test_xmlXPathNewContext();
42993 test_ret += test_xmlXPathNodeSetCreate();
42994 test_ret += test_xmlXPathObjectCopy();
42995 test_ret += test_xmlXPathOrderDocElems();
Daniel Veillardd93f6252004-11-02 15:53:51 +000042996
Daniel Veillard42595322004-11-08 10:52:06 +000042997 if (test_ret != 0)
42998 printf("Module xpath: %d errors\n", test_ret);
42999 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000043000}
43001
Daniel Veillarda82b1822004-11-08 16:24:57 +000043002#define gen_nb_xmlXPathParserContextPtr 1
43003static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
43004 return(NULL);
43005}
43006static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
43007}
43008
43009static int
43010test_valuePop(void) {
43011 int test_ret = 0;
43012
43013#ifdef LIBXML_XPATH_ENABLED
43014 int mem_base;
43015 xmlXPathObjectPtr ret_val;
43016 xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
43017 int n_ctxt;
43018
43019 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43020 mem_base = xmlMemBlocks();
43021 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43022
43023 ret_val = valuePop(ctxt);
43024 desret_xmlXPathObjectPtr(ret_val);
43025 call_tests++;
43026 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43027 xmlResetLastError();
43028 if (mem_base != xmlMemBlocks()) {
43029 printf("Leak of %d blocks found in valuePop",
43030 xmlMemBlocks() - mem_base);
43031 test_ret++;
43032 printf(" %d", n_ctxt);
43033 printf("\n");
43034 }
43035 }
43036#endif
43037
43038 function_tests++;
43039 return(test_ret);
43040}
43041
43042
43043static int
43044test_valuePush(void) {
43045 int test_ret = 0;
43046
43047#ifdef LIBXML_XPATH_ENABLED
43048 int mem_base;
43049 int ret_val;
43050 xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
43051 int n_ctxt;
43052 xmlXPathObjectPtr value; /* the XPath object */
43053 int n_value;
43054
43055 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43056 for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
43057 mem_base = xmlMemBlocks();
43058 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43059 value = gen_xmlXPathObjectPtr(n_value, 1);
43060
43061 ret_val = valuePush(ctxt, value);
43062 desret_int(ret_val);
43063 call_tests++;
43064 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43065 des_xmlXPathObjectPtr(n_value, value, 1);
43066 xmlResetLastError();
43067 if (mem_base != xmlMemBlocks()) {
43068 printf("Leak of %d blocks found in valuePush",
43069 xmlMemBlocks() - mem_base);
43070 test_ret++;
43071 printf(" %d", n_ctxt);
43072 printf(" %d", n_value);
43073 printf("\n");
43074 }
43075 }
43076 }
43077#endif
43078
43079 function_tests++;
43080 return(test_ret);
43081}
43082
43083
43084static int
43085test_xmlXPathAddValues(void) {
43086 int test_ret = 0;
43087
43088#ifdef LIBXML_XPATH_ENABLED
43089 int mem_base;
43090 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43091 int n_ctxt;
43092
43093 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43094 mem_base = xmlMemBlocks();
43095 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43096
43097 xmlXPathAddValues(ctxt);
43098 call_tests++;
43099 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43100 xmlResetLastError();
43101 if (mem_base != xmlMemBlocks()) {
43102 printf("Leak of %d blocks found in xmlXPathAddValues",
43103 xmlMemBlocks() - mem_base);
43104 test_ret++;
43105 printf(" %d", n_ctxt);
43106 printf("\n");
43107 }
43108 }
43109#endif
43110
43111 function_tests++;
43112 return(test_ret);
43113}
43114
43115
43116static int
43117test_xmlXPathBooleanFunction(void) {
43118 int test_ret = 0;
43119
43120#ifdef LIBXML_XPATH_ENABLED
43121 int mem_base;
43122 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43123 int n_ctxt;
43124 int nargs; /* the number of arguments */
43125 int n_nargs;
43126
43127 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43128 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
43129 mem_base = xmlMemBlocks();
43130 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43131 nargs = gen_int(n_nargs, 1);
43132
43133 xmlXPathBooleanFunction(ctxt, nargs);
43134 call_tests++;
43135 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43136 des_int(n_nargs, nargs, 1);
43137 xmlResetLastError();
43138 if (mem_base != xmlMemBlocks()) {
43139 printf("Leak of %d blocks found in xmlXPathBooleanFunction",
43140 xmlMemBlocks() - mem_base);
43141 test_ret++;
43142 printf(" %d", n_ctxt);
43143 printf(" %d", n_nargs);
43144 printf("\n");
43145 }
43146 }
43147 }
43148#endif
43149
43150 function_tests++;
43151 return(test_ret);
43152}
43153
43154
43155static int
43156test_xmlXPathCeilingFunction(void) {
43157 int test_ret = 0;
43158
43159#ifdef LIBXML_XPATH_ENABLED
43160 int mem_base;
43161 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43162 int n_ctxt;
43163 int nargs; /* the number of arguments */
43164 int n_nargs;
43165
43166 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43167 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
43168 mem_base = xmlMemBlocks();
43169 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43170 nargs = gen_int(n_nargs, 1);
43171
43172 xmlXPathCeilingFunction(ctxt, nargs);
43173 call_tests++;
43174 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43175 des_int(n_nargs, nargs, 1);
43176 xmlResetLastError();
43177 if (mem_base != xmlMemBlocks()) {
43178 printf("Leak of %d blocks found in xmlXPathCeilingFunction",
43179 xmlMemBlocks() - mem_base);
43180 test_ret++;
43181 printf(" %d", n_ctxt);
43182 printf(" %d", n_nargs);
43183 printf("\n");
43184 }
43185 }
43186 }
43187#endif
43188
43189 function_tests++;
43190 return(test_ret);
43191}
43192
43193
43194static int
43195test_xmlXPathCompareValues(void) {
43196 int test_ret = 0;
43197
43198#ifdef LIBXML_XPATH_ENABLED
43199 int mem_base;
43200 int ret_val;
43201 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43202 int n_ctxt;
43203 int inf; /* less than (1) or greater than (0) */
43204 int n_inf;
43205 int strict; /* is the comparison strict */
43206 int n_strict;
43207
43208 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43209 for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
43210 for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
43211 mem_base = xmlMemBlocks();
43212 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43213 inf = gen_int(n_inf, 1);
43214 strict = gen_int(n_strict, 2);
43215
43216 ret_val = xmlXPathCompareValues(ctxt, inf, strict);
43217 desret_int(ret_val);
43218 call_tests++;
43219 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43220 des_int(n_inf, inf, 1);
43221 des_int(n_strict, strict, 2);
43222 xmlResetLastError();
43223 if (mem_base != xmlMemBlocks()) {
43224 printf("Leak of %d blocks found in xmlXPathCompareValues",
43225 xmlMemBlocks() - mem_base);
43226 test_ret++;
43227 printf(" %d", n_ctxt);
43228 printf(" %d", n_inf);
43229 printf(" %d", n_strict);
43230 printf("\n");
43231 }
43232 }
43233 }
43234 }
43235#endif
43236
43237 function_tests++;
43238 return(test_ret);
43239}
43240
43241
43242static int
43243test_xmlXPathConcatFunction(void) {
43244 int test_ret = 0;
43245
43246#ifdef LIBXML_XPATH_ENABLED
43247 int mem_base;
43248 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43249 int n_ctxt;
43250 int nargs; /* the number of arguments */
43251 int n_nargs;
43252
43253 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43254 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
43255 mem_base = xmlMemBlocks();
43256 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43257 nargs = gen_int(n_nargs, 1);
43258
43259 xmlXPathConcatFunction(ctxt, nargs);
43260 call_tests++;
43261 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43262 des_int(n_nargs, nargs, 1);
43263 xmlResetLastError();
43264 if (mem_base != xmlMemBlocks()) {
43265 printf("Leak of %d blocks found in xmlXPathConcatFunction",
43266 xmlMemBlocks() - mem_base);
43267 test_ret++;
43268 printf(" %d", n_ctxt);
43269 printf(" %d", n_nargs);
43270 printf("\n");
43271 }
43272 }
43273 }
43274#endif
43275
43276 function_tests++;
43277 return(test_ret);
43278}
43279
43280
43281static int
43282test_xmlXPathContainsFunction(void) {
43283 int test_ret = 0;
43284
43285#ifdef LIBXML_XPATH_ENABLED
43286 int mem_base;
43287 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43288 int n_ctxt;
43289 int nargs; /* the number of arguments */
43290 int n_nargs;
43291
43292 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43293 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
43294 mem_base = xmlMemBlocks();
43295 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43296 nargs = gen_int(n_nargs, 1);
43297
43298 xmlXPathContainsFunction(ctxt, nargs);
43299 call_tests++;
43300 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43301 des_int(n_nargs, nargs, 1);
43302 xmlResetLastError();
43303 if (mem_base != xmlMemBlocks()) {
43304 printf("Leak of %d blocks found in xmlXPathContainsFunction",
43305 xmlMemBlocks() - mem_base);
43306 test_ret++;
43307 printf(" %d", n_ctxt);
43308 printf(" %d", n_nargs);
43309 printf("\n");
43310 }
43311 }
43312 }
43313#endif
43314
43315 function_tests++;
43316 return(test_ret);
43317}
43318
43319
43320static int
43321test_xmlXPathCountFunction(void) {
43322 int test_ret = 0;
43323
43324#ifdef LIBXML_XPATH_ENABLED
43325 int mem_base;
43326 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43327 int n_ctxt;
43328 int nargs; /* the number of arguments */
43329 int n_nargs;
43330
43331 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43332 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
43333 mem_base = xmlMemBlocks();
43334 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43335 nargs = gen_int(n_nargs, 1);
43336
43337 xmlXPathCountFunction(ctxt, nargs);
43338 call_tests++;
43339 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43340 des_int(n_nargs, nargs, 1);
43341 xmlResetLastError();
43342 if (mem_base != xmlMemBlocks()) {
43343 printf("Leak of %d blocks found in xmlXPathCountFunction",
43344 xmlMemBlocks() - mem_base);
43345 test_ret++;
43346 printf(" %d", n_ctxt);
43347 printf(" %d", n_nargs);
43348 printf("\n");
43349 }
43350 }
43351 }
43352#endif
43353
43354 function_tests++;
43355 return(test_ret);
43356}
43357
43358
43359static int
43360test_xmlXPathDebugDumpCompExpr(void) {
43361 int test_ret = 0;
43362
43363#ifdef LIBXML_XPATH_ENABLED
43364#ifdef LIBXML_DEBUG_ENABLED
43365 int mem_base;
43366 FILE * output; /* the FILE * for the output */
43367 int n_output;
43368 xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
43369 int n_comp;
43370 int depth; /* the indentation level. */
43371 int n_depth;
43372
43373 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
43374 for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
43375 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
43376 mem_base = xmlMemBlocks();
43377 output = gen_FILE_ptr(n_output, 0);
43378 comp = gen_xmlXPathCompExprPtr(n_comp, 1);
43379 depth = gen_int(n_depth, 2);
43380
43381 xmlXPathDebugDumpCompExpr(output, comp, depth);
43382 call_tests++;
43383 des_FILE_ptr(n_output, output, 0);
43384 des_xmlXPathCompExprPtr(n_comp, comp, 1);
43385 des_int(n_depth, depth, 2);
43386 xmlResetLastError();
43387 if (mem_base != xmlMemBlocks()) {
43388 printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
43389 xmlMemBlocks() - mem_base);
43390 test_ret++;
43391 printf(" %d", n_output);
43392 printf(" %d", n_comp);
43393 printf(" %d", n_depth);
43394 printf("\n");
43395 }
43396 }
43397 }
43398 }
43399#endif
43400#endif
43401
43402 function_tests++;
43403 return(test_ret);
43404}
43405
43406
43407static int
43408test_xmlXPathDebugDumpObject(void) {
43409 int test_ret = 0;
43410
43411#ifdef LIBXML_XPATH_ENABLED
43412#ifdef LIBXML_DEBUG_ENABLED
43413 int mem_base;
43414 FILE * output; /* the FILE * to dump the output */
43415 int n_output;
43416 xmlXPathObjectPtr cur; /* the object to inspect */
43417 int n_cur;
43418 int depth; /* indentation level */
43419 int n_depth;
43420
43421 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
43422 for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
43423 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
43424 mem_base = xmlMemBlocks();
43425 output = gen_FILE_ptr(n_output, 0);
43426 cur = gen_xmlXPathObjectPtr(n_cur, 1);
43427 depth = gen_int(n_depth, 2);
43428
43429 xmlXPathDebugDumpObject(output, cur, depth);
43430 call_tests++;
43431 des_FILE_ptr(n_output, output, 0);
43432 des_xmlXPathObjectPtr(n_cur, cur, 1);
43433 des_int(n_depth, depth, 2);
43434 xmlResetLastError();
43435 if (mem_base != xmlMemBlocks()) {
43436 printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
43437 xmlMemBlocks() - mem_base);
43438 test_ret++;
43439 printf(" %d", n_output);
43440 printf(" %d", n_cur);
43441 printf(" %d", n_depth);
43442 printf("\n");
43443 }
43444 }
43445 }
43446 }
43447#endif
43448#endif
43449
43450 function_tests++;
43451 return(test_ret);
43452}
43453
43454
43455static int
43456test_xmlXPathDifference(void) {
43457 int test_ret = 0;
43458
43459
43460 /* missing type support */
43461 return(test_ret);
43462}
43463
43464
43465static int
43466test_xmlXPathDistinct(void) {
43467 int test_ret = 0;
43468
43469
43470 /* missing type support */
43471 return(test_ret);
43472}
43473
43474
43475static int
43476test_xmlXPathDistinctSorted(void) {
43477 int test_ret = 0;
43478
43479
43480 /* missing type support */
43481 return(test_ret);
43482}
43483
43484
43485static int
43486test_xmlXPathDivValues(void) {
43487 int test_ret = 0;
43488
43489#ifdef LIBXML_XPATH_ENABLED
43490 int mem_base;
43491 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43492 int n_ctxt;
43493
43494 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43495 mem_base = xmlMemBlocks();
43496 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43497
43498 xmlXPathDivValues(ctxt);
43499 call_tests++;
43500 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43501 xmlResetLastError();
43502 if (mem_base != xmlMemBlocks()) {
43503 printf("Leak of %d blocks found in xmlXPathDivValues",
43504 xmlMemBlocks() - mem_base);
43505 test_ret++;
43506 printf(" %d", n_ctxt);
43507 printf("\n");
43508 }
43509 }
43510#endif
43511
43512 function_tests++;
43513 return(test_ret);
43514}
43515
43516
43517static int
43518test_xmlXPathEqualValues(void) {
43519 int test_ret = 0;
43520
43521#ifdef LIBXML_XPATH_ENABLED
43522 int mem_base;
43523 int ret_val;
43524 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43525 int n_ctxt;
43526
43527 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43528 mem_base = xmlMemBlocks();
43529 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43530
43531 ret_val = xmlXPathEqualValues(ctxt);
43532 desret_int(ret_val);
43533 call_tests++;
43534 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43535 xmlResetLastError();
43536 if (mem_base != xmlMemBlocks()) {
43537 printf("Leak of %d blocks found in xmlXPathEqualValues",
43538 xmlMemBlocks() - mem_base);
43539 test_ret++;
43540 printf(" %d", n_ctxt);
43541 printf("\n");
43542 }
43543 }
43544#endif
43545
43546 function_tests++;
43547 return(test_ret);
43548}
43549
43550
43551static int
43552test_xmlXPathErr(void) {
43553 int test_ret = 0;
43554
43555#ifdef LIBXML_XPATH_ENABLED
43556 int mem_base;
43557 xmlXPathParserContextPtr ctxt; /* a XPath parser context */
43558 int n_ctxt;
43559 int error; /* the error code */
43560 int n_error;
43561
43562 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43563 for (n_error = 0;n_error < gen_nb_int;n_error++) {
43564 mem_base = xmlMemBlocks();
43565 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43566 error = gen_int(n_error, 1);
43567
43568 xmlXPathErr(ctxt, error);
43569 call_tests++;
43570 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43571 des_int(n_error, error, 1);
43572 xmlResetLastError();
43573 if (mem_base != xmlMemBlocks()) {
43574 printf("Leak of %d blocks found in xmlXPathErr",
43575 xmlMemBlocks() - mem_base);
43576 test_ret++;
43577 printf(" %d", n_ctxt);
43578 printf(" %d", n_error);
43579 printf("\n");
43580 }
43581 }
43582 }
43583#endif
43584
43585 function_tests++;
43586 return(test_ret);
43587}
43588
43589
43590static int
43591test_xmlXPathEvalExpr(void) {
43592 int test_ret = 0;
43593
43594#ifdef LIBXML_XPATH_ENABLED
43595 int mem_base;
43596 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43597 int n_ctxt;
43598
43599 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43600 mem_base = xmlMemBlocks();
43601 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43602
43603 xmlXPathEvalExpr(ctxt);
43604 call_tests++;
43605 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43606 xmlResetLastError();
43607 if (mem_base != xmlMemBlocks()) {
43608 printf("Leak of %d blocks found in xmlXPathEvalExpr",
43609 xmlMemBlocks() - mem_base);
43610 test_ret++;
43611 printf(" %d", n_ctxt);
43612 printf("\n");
43613 }
43614 }
43615#endif
43616
43617 function_tests++;
43618 return(test_ret);
43619}
43620
43621
43622static int
43623test_xmlXPathEvaluatePredicateResult(void) {
43624 int test_ret = 0;
43625
43626#ifdef LIBXML_XPATH_ENABLED
43627 int mem_base;
43628 int ret_val;
43629 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43630 int n_ctxt;
43631 xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
43632 int n_res;
43633
43634 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43635 for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
43636 mem_base = xmlMemBlocks();
43637 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43638 res = gen_xmlXPathObjectPtr(n_res, 1);
43639
43640 ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
43641 desret_int(ret_val);
43642 call_tests++;
43643 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43644 des_xmlXPathObjectPtr(n_res, res, 1);
43645 xmlResetLastError();
43646 if (mem_base != xmlMemBlocks()) {
43647 printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
43648 xmlMemBlocks() - mem_base);
43649 test_ret++;
43650 printf(" %d", n_ctxt);
43651 printf(" %d", n_res);
43652 printf("\n");
43653 }
43654 }
43655 }
43656#endif
43657
43658 function_tests++;
43659 return(test_ret);
43660}
43661
43662
43663static int
43664test_xmlXPathFalseFunction(void) {
43665 int test_ret = 0;
43666
43667#ifdef LIBXML_XPATH_ENABLED
43668 int mem_base;
43669 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43670 int n_ctxt;
43671 int nargs; /* the number of arguments */
43672 int n_nargs;
43673
43674 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43675 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
43676 mem_base = xmlMemBlocks();
43677 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43678 nargs = gen_int(n_nargs, 1);
43679
43680 xmlXPathFalseFunction(ctxt, nargs);
43681 call_tests++;
43682 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43683 des_int(n_nargs, nargs, 1);
43684 xmlResetLastError();
43685 if (mem_base != xmlMemBlocks()) {
43686 printf("Leak of %d blocks found in xmlXPathFalseFunction",
43687 xmlMemBlocks() - mem_base);
43688 test_ret++;
43689 printf(" %d", n_ctxt);
43690 printf(" %d", n_nargs);
43691 printf("\n");
43692 }
43693 }
43694 }
43695#endif
43696
43697 function_tests++;
43698 return(test_ret);
43699}
43700
43701
43702static int
43703test_xmlXPathFloorFunction(void) {
43704 int test_ret = 0;
43705
43706#ifdef LIBXML_XPATH_ENABLED
43707 int mem_base;
43708 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43709 int n_ctxt;
43710 int nargs; /* the number of arguments */
43711 int n_nargs;
43712
43713 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43714 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
43715 mem_base = xmlMemBlocks();
43716 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43717 nargs = gen_int(n_nargs, 1);
43718
43719 xmlXPathFloorFunction(ctxt, nargs);
43720 call_tests++;
43721 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43722 des_int(n_nargs, nargs, 1);
43723 xmlResetLastError();
43724 if (mem_base != xmlMemBlocks()) {
43725 printf("Leak of %d blocks found in xmlXPathFloorFunction",
43726 xmlMemBlocks() - mem_base);
43727 test_ret++;
43728 printf(" %d", n_ctxt);
43729 printf(" %d", n_nargs);
43730 printf("\n");
43731 }
43732 }
43733 }
43734#endif
43735
43736 function_tests++;
43737 return(test_ret);
43738}
43739
43740
43741static int
43742test_xmlXPathFunctionLookup(void) {
43743 int test_ret = 0;
43744
43745
43746 /* missing type support */
43747 return(test_ret);
43748}
43749
43750
43751static int
43752test_xmlXPathFunctionLookupNS(void) {
43753 int test_ret = 0;
43754
43755
43756 /* missing type support */
43757 return(test_ret);
43758}
43759
43760
43761static int
43762test_xmlXPathHasSameNodes(void) {
43763 int test_ret = 0;
43764
43765#ifdef LIBXML_XPATH_ENABLED
43766 int mem_base;
43767 int ret_val;
43768 xmlNodeSetPtr nodes1; /* a node-set */
43769 int n_nodes1;
43770 xmlNodeSetPtr nodes2; /* a node-set */
43771 int n_nodes2;
43772
43773 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
43774 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
43775 mem_base = xmlMemBlocks();
43776 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
43777 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
43778
43779 ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
43780 desret_int(ret_val);
43781 call_tests++;
43782 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
43783 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
43784 xmlResetLastError();
43785 if (mem_base != xmlMemBlocks()) {
43786 printf("Leak of %d blocks found in xmlXPathHasSameNodes",
43787 xmlMemBlocks() - mem_base);
43788 test_ret++;
43789 printf(" %d", n_nodes1);
43790 printf(" %d", n_nodes2);
43791 printf("\n");
43792 }
43793 }
43794 }
43795#endif
43796
43797 function_tests++;
43798 return(test_ret);
43799}
43800
43801
43802static int
43803test_xmlXPathIdFunction(void) {
43804 int test_ret = 0;
43805
43806#ifdef LIBXML_XPATH_ENABLED
43807 int mem_base;
43808 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43809 int n_ctxt;
43810 int nargs; /* the number of arguments */
43811 int n_nargs;
43812
43813 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43814 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
43815 mem_base = xmlMemBlocks();
43816 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43817 nargs = gen_int(n_nargs, 1);
43818
43819 xmlXPathIdFunction(ctxt, nargs);
43820 call_tests++;
43821 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43822 des_int(n_nargs, nargs, 1);
43823 xmlResetLastError();
43824 if (mem_base != xmlMemBlocks()) {
43825 printf("Leak of %d blocks found in xmlXPathIdFunction",
43826 xmlMemBlocks() - mem_base);
43827 test_ret++;
43828 printf(" %d", n_ctxt);
43829 printf(" %d", n_nargs);
43830 printf("\n");
43831 }
43832 }
43833 }
43834#endif
43835
43836 function_tests++;
43837 return(test_ret);
43838}
43839
43840
43841static int
43842test_xmlXPathIntersection(void) {
43843 int test_ret = 0;
43844
43845
43846 /* missing type support */
43847 return(test_ret);
43848}
43849
43850
43851static int
43852test_xmlXPathIsNodeType(void) {
43853 int test_ret = 0;
43854
43855#ifdef LIBXML_XPATH_ENABLED
43856 int mem_base;
43857 int ret_val;
43858 xmlChar * name; /* a name string */
43859 int n_name;
43860
43861 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43862 mem_base = xmlMemBlocks();
43863 name = gen_const_xmlChar_ptr(n_name, 0);
43864
43865 ret_val = xmlXPathIsNodeType(name);
43866 desret_int(ret_val);
43867 call_tests++;
43868 des_const_xmlChar_ptr(n_name, name, 0);
43869 xmlResetLastError();
43870 if (mem_base != xmlMemBlocks()) {
43871 printf("Leak of %d blocks found in xmlXPathIsNodeType",
43872 xmlMemBlocks() - mem_base);
43873 test_ret++;
43874 printf(" %d", n_name);
43875 printf("\n");
43876 }
43877 }
43878#endif
43879
43880 function_tests++;
43881 return(test_ret);
43882}
43883
43884
43885static int
43886test_xmlXPathLangFunction(void) {
43887 int test_ret = 0;
43888
43889#ifdef LIBXML_XPATH_ENABLED
43890 int mem_base;
43891 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43892 int n_ctxt;
43893 int nargs; /* the number of arguments */
43894 int n_nargs;
43895
43896 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43897 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
43898 mem_base = xmlMemBlocks();
43899 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43900 nargs = gen_int(n_nargs, 1);
43901
43902 xmlXPathLangFunction(ctxt, nargs);
43903 call_tests++;
43904 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43905 des_int(n_nargs, nargs, 1);
43906 xmlResetLastError();
43907 if (mem_base != xmlMemBlocks()) {
43908 printf("Leak of %d blocks found in xmlXPathLangFunction",
43909 xmlMemBlocks() - mem_base);
43910 test_ret++;
43911 printf(" %d", n_ctxt);
43912 printf(" %d", n_nargs);
43913 printf("\n");
43914 }
43915 }
43916 }
43917#endif
43918
43919 function_tests++;
43920 return(test_ret);
43921}
43922
43923
43924static int
43925test_xmlXPathLastFunction(void) {
43926 int test_ret = 0;
43927
43928#ifdef LIBXML_XPATH_ENABLED
43929 int mem_base;
43930 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43931 int n_ctxt;
43932 int nargs; /* the number of arguments */
43933 int n_nargs;
43934
43935 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43936 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
43937 mem_base = xmlMemBlocks();
43938 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43939 nargs = gen_int(n_nargs, 1);
43940
43941 xmlXPathLastFunction(ctxt, nargs);
43942 call_tests++;
43943 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43944 des_int(n_nargs, nargs, 1);
43945 xmlResetLastError();
43946 if (mem_base != xmlMemBlocks()) {
43947 printf("Leak of %d blocks found in xmlXPathLastFunction",
43948 xmlMemBlocks() - mem_base);
43949 test_ret++;
43950 printf(" %d", n_ctxt);
43951 printf(" %d", n_nargs);
43952 printf("\n");
43953 }
43954 }
43955 }
43956#endif
43957
43958 function_tests++;
43959 return(test_ret);
43960}
43961
43962
43963static int
43964test_xmlXPathLeading(void) {
43965 int test_ret = 0;
43966
43967
43968 /* missing type support */
43969 return(test_ret);
43970}
43971
43972
43973static int
43974test_xmlXPathLeadingSorted(void) {
43975 int test_ret = 0;
43976
43977
43978 /* missing type support */
43979 return(test_ret);
43980}
43981
43982
43983static int
43984test_xmlXPathLocalNameFunction(void) {
43985 int test_ret = 0;
43986
43987#ifdef LIBXML_XPATH_ENABLED
43988 int mem_base;
43989 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43990 int n_ctxt;
43991 int nargs; /* the number of arguments */
43992 int n_nargs;
43993
43994 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43995 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
43996 mem_base = xmlMemBlocks();
43997 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43998 nargs = gen_int(n_nargs, 1);
43999
44000 xmlXPathLocalNameFunction(ctxt, nargs);
44001 call_tests++;
44002 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44003 des_int(n_nargs, nargs, 1);
44004 xmlResetLastError();
44005 if (mem_base != xmlMemBlocks()) {
44006 printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
44007 xmlMemBlocks() - mem_base);
44008 test_ret++;
44009 printf(" %d", n_ctxt);
44010 printf(" %d", n_nargs);
44011 printf("\n");
44012 }
44013 }
44014 }
44015#endif
44016
44017 function_tests++;
44018 return(test_ret);
44019}
44020
44021
44022static int
44023test_xmlXPathModValues(void) {
44024 int test_ret = 0;
44025
44026#ifdef LIBXML_XPATH_ENABLED
44027 int mem_base;
44028 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44029 int n_ctxt;
44030
44031 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44032 mem_base = xmlMemBlocks();
44033 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44034
44035 xmlXPathModValues(ctxt);
44036 call_tests++;
44037 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44038 xmlResetLastError();
44039 if (mem_base != xmlMemBlocks()) {
44040 printf("Leak of %d blocks found in xmlXPathModValues",
44041 xmlMemBlocks() - mem_base);
44042 test_ret++;
44043 printf(" %d", n_ctxt);
44044 printf("\n");
44045 }
44046 }
44047#endif
44048
44049 function_tests++;
44050 return(test_ret);
44051}
44052
44053
44054static int
44055test_xmlXPathMultValues(void) {
44056 int test_ret = 0;
44057
44058#ifdef LIBXML_XPATH_ENABLED
44059 int mem_base;
44060 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44061 int n_ctxt;
44062
44063 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44064 mem_base = xmlMemBlocks();
44065 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44066
44067 xmlXPathMultValues(ctxt);
44068 call_tests++;
44069 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44070 xmlResetLastError();
44071 if (mem_base != xmlMemBlocks()) {
44072 printf("Leak of %d blocks found in xmlXPathMultValues",
44073 xmlMemBlocks() - mem_base);
44074 test_ret++;
44075 printf(" %d", n_ctxt);
44076 printf("\n");
44077 }
44078 }
44079#endif
44080
44081 function_tests++;
44082 return(test_ret);
44083}
44084
44085
44086static int
44087test_xmlXPathNamespaceURIFunction(void) {
44088 int test_ret = 0;
44089
44090#ifdef LIBXML_XPATH_ENABLED
44091 int mem_base;
44092 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44093 int n_ctxt;
44094 int nargs; /* the number of arguments */
44095 int n_nargs;
44096
44097 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44098 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
44099 mem_base = xmlMemBlocks();
44100 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44101 nargs = gen_int(n_nargs, 1);
44102
44103 xmlXPathNamespaceURIFunction(ctxt, nargs);
44104 call_tests++;
44105 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44106 des_int(n_nargs, nargs, 1);
44107 xmlResetLastError();
44108 if (mem_base != xmlMemBlocks()) {
44109 printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
44110 xmlMemBlocks() - mem_base);
44111 test_ret++;
44112 printf(" %d", n_ctxt);
44113 printf(" %d", n_nargs);
44114 printf("\n");
44115 }
44116 }
44117 }
44118#endif
44119
44120 function_tests++;
44121 return(test_ret);
44122}
44123
44124
44125static int
44126test_xmlXPathNewBoolean(void) {
44127 int test_ret = 0;
44128
44129#ifdef LIBXML_XPATH_ENABLED
44130 int mem_base;
44131 xmlXPathObjectPtr ret_val;
44132 int val; /* the boolean value */
44133 int n_val;
44134
44135 for (n_val = 0;n_val < gen_nb_int;n_val++) {
44136 mem_base = xmlMemBlocks();
44137 val = gen_int(n_val, 0);
44138
44139 ret_val = xmlXPathNewBoolean(val);
44140 desret_xmlXPathObjectPtr(ret_val);
44141 call_tests++;
44142 des_int(n_val, val, 0);
44143 xmlResetLastError();
44144 if (mem_base != xmlMemBlocks()) {
44145 printf("Leak of %d blocks found in xmlXPathNewBoolean",
44146 xmlMemBlocks() - mem_base);
44147 test_ret++;
44148 printf(" %d", n_val);
44149 printf("\n");
44150 }
44151 }
44152#endif
44153
44154 function_tests++;
44155 return(test_ret);
44156}
44157
44158
44159static int
44160test_xmlXPathNewCString(void) {
44161 int test_ret = 0;
44162
44163#ifdef LIBXML_XPATH_ENABLED
44164 int mem_base;
44165 xmlXPathObjectPtr ret_val;
44166 char * val; /* the char * value */
44167 int n_val;
44168
44169 for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
44170 mem_base = xmlMemBlocks();
44171 val = gen_const_char_ptr(n_val, 0);
44172
44173 ret_val = xmlXPathNewCString(val);
44174 desret_xmlXPathObjectPtr(ret_val);
44175 call_tests++;
44176 des_const_char_ptr(n_val, val, 0);
44177 xmlResetLastError();
44178 if (mem_base != xmlMemBlocks()) {
44179 printf("Leak of %d blocks found in xmlXPathNewCString",
44180 xmlMemBlocks() - mem_base);
44181 test_ret++;
44182 printf(" %d", n_val);
44183 printf("\n");
44184 }
44185 }
44186#endif
44187
44188 function_tests++;
44189 return(test_ret);
44190}
44191
44192
44193static int
44194test_xmlXPathNewFloat(void) {
44195 int test_ret = 0;
44196
44197#ifdef LIBXML_XPATH_ENABLED
44198 int mem_base;
44199 xmlXPathObjectPtr ret_val;
44200 double val; /* the double value */
44201 int n_val;
44202
44203 for (n_val = 0;n_val < gen_nb_double;n_val++) {
44204 mem_base = xmlMemBlocks();
44205 val = gen_double(n_val, 0);
44206
44207 ret_val = xmlXPathNewFloat(val);
44208 desret_xmlXPathObjectPtr(ret_val);
44209 call_tests++;
44210 des_double(n_val, val, 0);
44211 xmlResetLastError();
44212 if (mem_base != xmlMemBlocks()) {
44213 printf("Leak of %d blocks found in xmlXPathNewFloat",
44214 xmlMemBlocks() - mem_base);
44215 test_ret++;
44216 printf(" %d", n_val);
44217 printf("\n");
44218 }
44219 }
44220#endif
44221
44222 function_tests++;
44223 return(test_ret);
44224}
44225
44226
44227static int
44228test_xmlXPathNewNodeSet(void) {
44229 int test_ret = 0;
44230
44231#ifdef LIBXML_XPATH_ENABLED
44232 int mem_base;
44233 xmlXPathObjectPtr ret_val;
44234 xmlNodePtr val; /* the NodePtr value */
44235 int n_val;
44236
44237 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
44238 mem_base = xmlMemBlocks();
44239 val = gen_xmlNodePtr(n_val, 0);
44240
44241 ret_val = xmlXPathNewNodeSet(val);
44242 desret_xmlXPathObjectPtr(ret_val);
44243 call_tests++;
44244 des_xmlNodePtr(n_val, val, 0);
44245 xmlResetLastError();
44246 if (mem_base != xmlMemBlocks()) {
44247 printf("Leak of %d blocks found in xmlXPathNewNodeSet",
44248 xmlMemBlocks() - mem_base);
44249 test_ret++;
44250 printf(" %d", n_val);
44251 printf("\n");
44252 }
44253 }
44254#endif
44255
44256 function_tests++;
44257 return(test_ret);
44258}
44259
44260
44261static int
44262test_xmlXPathNewNodeSetList(void) {
44263 int test_ret = 0;
44264
44265#ifdef LIBXML_XPATH_ENABLED
44266 int mem_base;
44267 xmlXPathObjectPtr ret_val;
44268 xmlNodeSetPtr val; /* an existing NodeSet */
44269 int n_val;
44270
44271 for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
44272 mem_base = xmlMemBlocks();
44273 val = gen_xmlNodeSetPtr(n_val, 0);
44274
44275 ret_val = xmlXPathNewNodeSetList(val);
44276 desret_xmlXPathObjectPtr(ret_val);
44277 call_tests++;
44278 des_xmlNodeSetPtr(n_val, val, 0);
44279 xmlResetLastError();
44280 if (mem_base != xmlMemBlocks()) {
44281 printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
44282 xmlMemBlocks() - mem_base);
44283 test_ret++;
44284 printf(" %d", n_val);
44285 printf("\n");
44286 }
44287 }
44288#endif
44289
44290 function_tests++;
44291 return(test_ret);
44292}
44293
44294
44295static int
44296test_xmlXPathNewParserContext(void) {
44297 int test_ret = 0;
44298
44299
44300 /* missing type support */
44301 return(test_ret);
44302}
44303
44304
44305static int
44306test_xmlXPathNewString(void) {
44307 int test_ret = 0;
44308
44309#ifdef LIBXML_XPATH_ENABLED
44310 int mem_base;
44311 xmlXPathObjectPtr ret_val;
44312 xmlChar * val; /* the xmlChar * value */
44313 int n_val;
44314
44315 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
44316 mem_base = xmlMemBlocks();
44317 val = gen_const_xmlChar_ptr(n_val, 0);
44318
44319 ret_val = xmlXPathNewString(val);
44320 desret_xmlXPathObjectPtr(ret_val);
44321 call_tests++;
44322 des_const_xmlChar_ptr(n_val, val, 0);
44323 xmlResetLastError();
44324 if (mem_base != xmlMemBlocks()) {
44325 printf("Leak of %d blocks found in xmlXPathNewString",
44326 xmlMemBlocks() - mem_base);
44327 test_ret++;
44328 printf(" %d", n_val);
44329 printf("\n");
44330 }
44331 }
44332#endif
44333
44334 function_tests++;
44335 return(test_ret);
44336}
44337
44338
44339static int
44340test_xmlXPathNextAncestor(void) {
44341 int test_ret = 0;
44342
44343#ifdef LIBXML_XPATH_ENABLED
44344 int mem_base;
44345 xmlNodePtr ret_val;
44346 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44347 int n_ctxt;
44348 xmlNodePtr cur; /* the current node in the traversal */
44349 int n_cur;
44350
44351 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44352 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
44353 mem_base = xmlMemBlocks();
44354 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44355 cur = gen_xmlNodePtr(n_cur, 1);
44356
44357 ret_val = xmlXPathNextAncestor(ctxt, cur);
44358 desret_xmlNodePtr(ret_val);
44359 call_tests++;
44360 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44361 des_xmlNodePtr(n_cur, cur, 1);
44362 xmlResetLastError();
44363 if (mem_base != xmlMemBlocks()) {
44364 printf("Leak of %d blocks found in xmlXPathNextAncestor",
44365 xmlMemBlocks() - mem_base);
44366 test_ret++;
44367 printf(" %d", n_ctxt);
44368 printf(" %d", n_cur);
44369 printf("\n");
44370 }
44371 }
44372 }
44373#endif
44374
44375 function_tests++;
44376 return(test_ret);
44377}
44378
44379
44380static int
44381test_xmlXPathNextAncestorOrSelf(void) {
44382 int test_ret = 0;
44383
44384#ifdef LIBXML_XPATH_ENABLED
44385 int mem_base;
44386 xmlNodePtr ret_val;
44387 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44388 int n_ctxt;
44389 xmlNodePtr cur; /* the current node in the traversal */
44390 int n_cur;
44391
44392 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44393 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
44394 mem_base = xmlMemBlocks();
44395 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44396 cur = gen_xmlNodePtr(n_cur, 1);
44397
44398 ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
44399 desret_xmlNodePtr(ret_val);
44400 call_tests++;
44401 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44402 des_xmlNodePtr(n_cur, cur, 1);
44403 xmlResetLastError();
44404 if (mem_base != xmlMemBlocks()) {
44405 printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
44406 xmlMemBlocks() - mem_base);
44407 test_ret++;
44408 printf(" %d", n_ctxt);
44409 printf(" %d", n_cur);
44410 printf("\n");
44411 }
44412 }
44413 }
44414#endif
44415
44416 function_tests++;
44417 return(test_ret);
44418}
44419
44420
44421static int
44422test_xmlXPathNextAttribute(void) {
44423 int test_ret = 0;
44424
44425#ifdef LIBXML_XPATH_ENABLED
44426 int mem_base;
44427 xmlNodePtr ret_val;
44428 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44429 int n_ctxt;
44430 xmlNodePtr cur; /* the current attribute in the traversal */
44431 int n_cur;
44432
44433 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44434 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
44435 mem_base = xmlMemBlocks();
44436 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44437 cur = gen_xmlNodePtr(n_cur, 1);
44438
44439 ret_val = xmlXPathNextAttribute(ctxt, cur);
44440 desret_xmlNodePtr(ret_val);
44441 call_tests++;
44442 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44443 des_xmlNodePtr(n_cur, cur, 1);
44444 xmlResetLastError();
44445 if (mem_base != xmlMemBlocks()) {
44446 printf("Leak of %d blocks found in xmlXPathNextAttribute",
44447 xmlMemBlocks() - mem_base);
44448 test_ret++;
44449 printf(" %d", n_ctxt);
44450 printf(" %d", n_cur);
44451 printf("\n");
44452 }
44453 }
44454 }
44455#endif
44456
44457 function_tests++;
44458 return(test_ret);
44459}
44460
44461
44462static int
44463test_xmlXPathNextChild(void) {
44464 int test_ret = 0;
44465
44466#ifdef LIBXML_XPATH_ENABLED
44467 int mem_base;
44468 xmlNodePtr ret_val;
44469 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44470 int n_ctxt;
44471 xmlNodePtr cur; /* the current node in the traversal */
44472 int n_cur;
44473
44474 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44475 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
44476 mem_base = xmlMemBlocks();
44477 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44478 cur = gen_xmlNodePtr(n_cur, 1);
44479
44480 ret_val = xmlXPathNextChild(ctxt, cur);
44481 desret_xmlNodePtr(ret_val);
44482 call_tests++;
44483 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44484 des_xmlNodePtr(n_cur, cur, 1);
44485 xmlResetLastError();
44486 if (mem_base != xmlMemBlocks()) {
44487 printf("Leak of %d blocks found in xmlXPathNextChild",
44488 xmlMemBlocks() - mem_base);
44489 test_ret++;
44490 printf(" %d", n_ctxt);
44491 printf(" %d", n_cur);
44492 printf("\n");
44493 }
44494 }
44495 }
44496#endif
44497
44498 function_tests++;
44499 return(test_ret);
44500}
44501
44502
44503static int
44504test_xmlXPathNextDescendant(void) {
44505 int test_ret = 0;
44506
44507#ifdef LIBXML_XPATH_ENABLED
44508 int mem_base;
44509 xmlNodePtr ret_val;
44510 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44511 int n_ctxt;
44512 xmlNodePtr cur; /* the current node in the traversal */
44513 int n_cur;
44514
44515 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44516 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
44517 mem_base = xmlMemBlocks();
44518 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44519 cur = gen_xmlNodePtr(n_cur, 1);
44520
44521 ret_val = xmlXPathNextDescendant(ctxt, cur);
44522 desret_xmlNodePtr(ret_val);
44523 call_tests++;
44524 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44525 des_xmlNodePtr(n_cur, cur, 1);
44526 xmlResetLastError();
44527 if (mem_base != xmlMemBlocks()) {
44528 printf("Leak of %d blocks found in xmlXPathNextDescendant",
44529 xmlMemBlocks() - mem_base);
44530 test_ret++;
44531 printf(" %d", n_ctxt);
44532 printf(" %d", n_cur);
44533 printf("\n");
44534 }
44535 }
44536 }
44537#endif
44538
44539 function_tests++;
44540 return(test_ret);
44541}
44542
44543
44544static int
44545test_xmlXPathNextDescendantOrSelf(void) {
44546 int test_ret = 0;
44547
44548#ifdef LIBXML_XPATH_ENABLED
44549 int mem_base;
44550 xmlNodePtr ret_val;
44551 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44552 int n_ctxt;
44553 xmlNodePtr cur; /* the current node in the traversal */
44554 int n_cur;
44555
44556 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44557 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
44558 mem_base = xmlMemBlocks();
44559 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44560 cur = gen_xmlNodePtr(n_cur, 1);
44561
44562 ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
44563 desret_xmlNodePtr(ret_val);
44564 call_tests++;
44565 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44566 des_xmlNodePtr(n_cur, cur, 1);
44567 xmlResetLastError();
44568 if (mem_base != xmlMemBlocks()) {
44569 printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
44570 xmlMemBlocks() - mem_base);
44571 test_ret++;
44572 printf(" %d", n_ctxt);
44573 printf(" %d", n_cur);
44574 printf("\n");
44575 }
44576 }
44577 }
44578#endif
44579
44580 function_tests++;
44581 return(test_ret);
44582}
44583
44584
44585static int
44586test_xmlXPathNextFollowing(void) {
44587 int test_ret = 0;
44588
44589#ifdef LIBXML_XPATH_ENABLED
44590 int mem_base;
44591 xmlNodePtr ret_val;
44592 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44593 int n_ctxt;
44594 xmlNodePtr cur; /* the current node in the traversal */
44595 int n_cur;
44596
44597 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44598 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
44599 mem_base = xmlMemBlocks();
44600 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44601 cur = gen_xmlNodePtr(n_cur, 1);
44602
44603 ret_val = xmlXPathNextFollowing(ctxt, cur);
44604 desret_xmlNodePtr(ret_val);
44605 call_tests++;
44606 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44607 des_xmlNodePtr(n_cur, cur, 1);
44608 xmlResetLastError();
44609 if (mem_base != xmlMemBlocks()) {
44610 printf("Leak of %d blocks found in xmlXPathNextFollowing",
44611 xmlMemBlocks() - mem_base);
44612 test_ret++;
44613 printf(" %d", n_ctxt);
44614 printf(" %d", n_cur);
44615 printf("\n");
44616 }
44617 }
44618 }
44619#endif
44620
44621 function_tests++;
44622 return(test_ret);
44623}
44624
44625
44626static int
44627test_xmlXPathNextFollowingSibling(void) {
44628 int test_ret = 0;
44629
44630#ifdef LIBXML_XPATH_ENABLED
44631 int mem_base;
44632 xmlNodePtr ret_val;
44633 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44634 int n_ctxt;
44635 xmlNodePtr cur; /* the current node in the traversal */
44636 int n_cur;
44637
44638 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44639 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
44640 mem_base = xmlMemBlocks();
44641 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44642 cur = gen_xmlNodePtr(n_cur, 1);
44643
44644 ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
44645 desret_xmlNodePtr(ret_val);
44646 call_tests++;
44647 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44648 des_xmlNodePtr(n_cur, cur, 1);
44649 xmlResetLastError();
44650 if (mem_base != xmlMemBlocks()) {
44651 printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
44652 xmlMemBlocks() - mem_base);
44653 test_ret++;
44654 printf(" %d", n_ctxt);
44655 printf(" %d", n_cur);
44656 printf("\n");
44657 }
44658 }
44659 }
44660#endif
44661
44662 function_tests++;
44663 return(test_ret);
44664}
44665
44666
44667static int
44668test_xmlXPathNextNamespace(void) {
44669 int test_ret = 0;
44670
44671#ifdef LIBXML_XPATH_ENABLED
44672 int mem_base;
44673 xmlNodePtr ret_val;
44674 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44675 int n_ctxt;
44676 xmlNodePtr cur; /* the current attribute in the traversal */
44677 int n_cur;
44678
44679 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44680 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
44681 mem_base = xmlMemBlocks();
44682 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44683 cur = gen_xmlNodePtr(n_cur, 1);
44684
44685 ret_val = xmlXPathNextNamespace(ctxt, cur);
44686 desret_xmlNodePtr(ret_val);
44687 call_tests++;
44688 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44689 des_xmlNodePtr(n_cur, cur, 1);
44690 xmlResetLastError();
44691 if (mem_base != xmlMemBlocks()) {
44692 printf("Leak of %d blocks found in xmlXPathNextNamespace",
44693 xmlMemBlocks() - mem_base);
44694 test_ret++;
44695 printf(" %d", n_ctxt);
44696 printf(" %d", n_cur);
44697 printf("\n");
44698 }
44699 }
44700 }
44701#endif
44702
44703 function_tests++;
44704 return(test_ret);
44705}
44706
44707
44708static int
44709test_xmlXPathNextParent(void) {
44710 int test_ret = 0;
44711
44712#ifdef LIBXML_XPATH_ENABLED
44713 int mem_base;
44714 xmlNodePtr ret_val;
44715 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44716 int n_ctxt;
44717 xmlNodePtr cur; /* the current node in the traversal */
44718 int n_cur;
44719
44720 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44721 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
44722 mem_base = xmlMemBlocks();
44723 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44724 cur = gen_xmlNodePtr(n_cur, 1);
44725
44726 ret_val = xmlXPathNextParent(ctxt, cur);
44727 desret_xmlNodePtr(ret_val);
44728 call_tests++;
44729 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44730 des_xmlNodePtr(n_cur, cur, 1);
44731 xmlResetLastError();
44732 if (mem_base != xmlMemBlocks()) {
44733 printf("Leak of %d blocks found in xmlXPathNextParent",
44734 xmlMemBlocks() - mem_base);
44735 test_ret++;
44736 printf(" %d", n_ctxt);
44737 printf(" %d", n_cur);
44738 printf("\n");
44739 }
44740 }
44741 }
44742#endif
44743
44744 function_tests++;
44745 return(test_ret);
44746}
44747
44748
44749static int
44750test_xmlXPathNextPreceding(void) {
44751 int test_ret = 0;
44752
44753#ifdef LIBXML_XPATH_ENABLED
44754 int mem_base;
44755 xmlNodePtr ret_val;
44756 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44757 int n_ctxt;
44758 xmlNodePtr cur; /* the current node in the traversal */
44759 int n_cur;
44760
44761 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44762 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
44763 mem_base = xmlMemBlocks();
44764 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44765 cur = gen_xmlNodePtr(n_cur, 1);
44766
44767 ret_val = xmlXPathNextPreceding(ctxt, cur);
44768 desret_xmlNodePtr(ret_val);
44769 call_tests++;
44770 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44771 des_xmlNodePtr(n_cur, cur, 1);
44772 xmlResetLastError();
44773 if (mem_base != xmlMemBlocks()) {
44774 printf("Leak of %d blocks found in xmlXPathNextPreceding",
44775 xmlMemBlocks() - mem_base);
44776 test_ret++;
44777 printf(" %d", n_ctxt);
44778 printf(" %d", n_cur);
44779 printf("\n");
44780 }
44781 }
44782 }
44783#endif
44784
44785 function_tests++;
44786 return(test_ret);
44787}
44788
44789
44790static int
44791test_xmlXPathNextPrecedingSibling(void) {
44792 int test_ret = 0;
44793
44794#ifdef LIBXML_XPATH_ENABLED
44795 int mem_base;
44796 xmlNodePtr ret_val;
44797 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44798 int n_ctxt;
44799 xmlNodePtr cur; /* the current node in the traversal */
44800 int n_cur;
44801
44802 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44803 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
44804 mem_base = xmlMemBlocks();
44805 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44806 cur = gen_xmlNodePtr(n_cur, 1);
44807
44808 ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
44809 desret_xmlNodePtr(ret_val);
44810 call_tests++;
44811 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44812 des_xmlNodePtr(n_cur, cur, 1);
44813 xmlResetLastError();
44814 if (mem_base != xmlMemBlocks()) {
44815 printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
44816 xmlMemBlocks() - mem_base);
44817 test_ret++;
44818 printf(" %d", n_ctxt);
44819 printf(" %d", n_cur);
44820 printf("\n");
44821 }
44822 }
44823 }
44824#endif
44825
44826 function_tests++;
44827 return(test_ret);
44828}
44829
44830
44831static int
44832test_xmlXPathNextSelf(void) {
44833 int test_ret = 0;
44834
44835#ifdef LIBXML_XPATH_ENABLED
44836 int mem_base;
44837 xmlNodePtr ret_val;
44838 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44839 int n_ctxt;
44840 xmlNodePtr cur; /* the current node in the traversal */
44841 int n_cur;
44842
44843 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44844 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
44845 mem_base = xmlMemBlocks();
44846 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44847 cur = gen_xmlNodePtr(n_cur, 1);
44848
44849 ret_val = xmlXPathNextSelf(ctxt, cur);
44850 desret_xmlNodePtr(ret_val);
44851 call_tests++;
44852 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44853 des_xmlNodePtr(n_cur, cur, 1);
44854 xmlResetLastError();
44855 if (mem_base != xmlMemBlocks()) {
44856 printf("Leak of %d blocks found in xmlXPathNextSelf",
44857 xmlMemBlocks() - mem_base);
44858 test_ret++;
44859 printf(" %d", n_ctxt);
44860 printf(" %d", n_cur);
44861 printf("\n");
44862 }
44863 }
44864 }
44865#endif
44866
44867 function_tests++;
44868 return(test_ret);
44869}
44870
44871
44872static int
44873test_xmlXPathNodeLeading(void) {
44874 int test_ret = 0;
44875
44876
44877 /* missing type support */
44878 return(test_ret);
44879}
44880
44881
44882static int
44883test_xmlXPathNodeLeadingSorted(void) {
44884 int test_ret = 0;
44885
44886
44887 /* missing type support */
44888 return(test_ret);
44889}
44890
44891
44892static int
44893test_xmlXPathNodeSetAdd(void) {
44894 int test_ret = 0;
44895
44896#ifdef LIBXML_XPATH_ENABLED
44897 int mem_base;
44898 xmlNodeSetPtr cur; /* the initial node set */
44899 int n_cur;
44900 xmlNodePtr val; /* a new xmlNodePtr */
44901 int n_val;
44902
44903 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
44904 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
44905 mem_base = xmlMemBlocks();
44906 cur = gen_xmlNodeSetPtr(n_cur, 0);
44907 val = gen_xmlNodePtr(n_val, 1);
44908
44909 xmlXPathNodeSetAdd(cur, val);
44910 call_tests++;
44911 des_xmlNodeSetPtr(n_cur, cur, 0);
44912 des_xmlNodePtr(n_val, val, 1);
44913 xmlResetLastError();
44914 if (mem_base != xmlMemBlocks()) {
44915 printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
44916 xmlMemBlocks() - mem_base);
44917 test_ret++;
44918 printf(" %d", n_cur);
44919 printf(" %d", n_val);
44920 printf("\n");
44921 }
44922 }
44923 }
44924#endif
44925
44926 function_tests++;
44927 return(test_ret);
44928}
44929
44930
44931static int
44932test_xmlXPathNodeSetAddNs(void) {
44933 int test_ret = 0;
44934
44935#ifdef LIBXML_XPATH_ENABLED
44936 int mem_base;
44937 xmlNodeSetPtr cur; /* the initial node set */
44938 int n_cur;
44939 xmlNodePtr node; /* the hosting node */
44940 int n_node;
44941 xmlNsPtr ns; /* a the namespace node */
44942 int n_ns;
44943
44944 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
44945 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
44946 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
44947 mem_base = xmlMemBlocks();
44948 cur = gen_xmlNodeSetPtr(n_cur, 0);
44949 node = gen_xmlNodePtr(n_node, 1);
44950 ns = gen_xmlNsPtr(n_ns, 2);
44951
44952 xmlXPathNodeSetAddNs(cur, node, ns);
44953 call_tests++;
44954 des_xmlNodeSetPtr(n_cur, cur, 0);
44955 des_xmlNodePtr(n_node, node, 1);
44956 des_xmlNsPtr(n_ns, ns, 2);
44957 xmlResetLastError();
44958 if (mem_base != xmlMemBlocks()) {
44959 printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
44960 xmlMemBlocks() - mem_base);
44961 test_ret++;
44962 printf(" %d", n_cur);
44963 printf(" %d", n_node);
44964 printf(" %d", n_ns);
44965 printf("\n");
44966 }
44967 }
44968 }
44969 }
44970#endif
44971
44972 function_tests++;
44973 return(test_ret);
44974}
44975
44976
44977static int
44978test_xmlXPathNodeSetAddUnique(void) {
44979 int test_ret = 0;
44980
44981#ifdef LIBXML_XPATH_ENABLED
44982 int mem_base;
44983 xmlNodeSetPtr cur; /* the initial node set */
44984 int n_cur;
44985 xmlNodePtr val; /* a new xmlNodePtr */
44986 int n_val;
44987
44988 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
44989 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
44990 mem_base = xmlMemBlocks();
44991 cur = gen_xmlNodeSetPtr(n_cur, 0);
44992 val = gen_xmlNodePtr(n_val, 1);
44993
44994 xmlXPathNodeSetAddUnique(cur, val);
44995 call_tests++;
44996 des_xmlNodeSetPtr(n_cur, cur, 0);
44997 des_xmlNodePtr(n_val, val, 1);
44998 xmlResetLastError();
44999 if (mem_base != xmlMemBlocks()) {
45000 printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
45001 xmlMemBlocks() - mem_base);
45002 test_ret++;
45003 printf(" %d", n_cur);
45004 printf(" %d", n_val);
45005 printf("\n");
45006 }
45007 }
45008 }
45009#endif
45010
45011 function_tests++;
45012 return(test_ret);
45013}
45014
45015
45016static int
45017test_xmlXPathNodeSetContains(void) {
45018 int test_ret = 0;
45019
45020#ifdef LIBXML_XPATH_ENABLED
45021 int mem_base;
45022 int ret_val;
45023 xmlNodeSetPtr cur; /* the node-set */
45024 int n_cur;
45025 xmlNodePtr val; /* the node */
45026 int n_val;
45027
45028 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
45029 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
45030 mem_base = xmlMemBlocks();
45031 cur = gen_xmlNodeSetPtr(n_cur, 0);
45032 val = gen_xmlNodePtr(n_val, 1);
45033
45034 ret_val = xmlXPathNodeSetContains(cur, val);
45035 desret_int(ret_val);
45036 call_tests++;
45037 des_xmlNodeSetPtr(n_cur, cur, 0);
45038 des_xmlNodePtr(n_val, val, 1);
45039 xmlResetLastError();
45040 if (mem_base != xmlMemBlocks()) {
45041 printf("Leak of %d blocks found in xmlXPathNodeSetContains",
45042 xmlMemBlocks() - mem_base);
45043 test_ret++;
45044 printf(" %d", n_cur);
45045 printf(" %d", n_val);
45046 printf("\n");
45047 }
45048 }
45049 }
45050#endif
45051
45052 function_tests++;
45053 return(test_ret);
45054}
45055
45056
45057static int
45058test_xmlXPathNodeSetDel(void) {
45059 int test_ret = 0;
45060
45061#ifdef LIBXML_XPATH_ENABLED
45062 int mem_base;
45063 xmlNodeSetPtr cur; /* the initial node set */
45064 int n_cur;
45065 xmlNodePtr val; /* an xmlNodePtr */
45066 int n_val;
45067
45068 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
45069 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
45070 mem_base = xmlMemBlocks();
45071 cur = gen_xmlNodeSetPtr(n_cur, 0);
45072 val = gen_xmlNodePtr(n_val, 1);
45073
45074 xmlXPathNodeSetDel(cur, val);
45075 call_tests++;
45076 des_xmlNodeSetPtr(n_cur, cur, 0);
45077 des_xmlNodePtr(n_val, val, 1);
45078 xmlResetLastError();
45079 if (mem_base != xmlMemBlocks()) {
45080 printf("Leak of %d blocks found in xmlXPathNodeSetDel",
45081 xmlMemBlocks() - mem_base);
45082 test_ret++;
45083 printf(" %d", n_cur);
45084 printf(" %d", n_val);
45085 printf("\n");
45086 }
45087 }
45088 }
45089#endif
45090
45091 function_tests++;
45092 return(test_ret);
45093}
45094
45095
45096static int
45097test_xmlXPathNodeSetMerge(void) {
45098 int test_ret = 0;
45099
45100
45101 /* missing type support */
45102 return(test_ret);
45103}
45104
45105
45106static int
45107test_xmlXPathNodeSetRemove(void) {
45108 int test_ret = 0;
45109
45110#ifdef LIBXML_XPATH_ENABLED
45111 int mem_base;
45112 xmlNodeSetPtr cur; /* the initial node set */
45113 int n_cur;
45114 int val; /* the index to remove */
45115 int n_val;
45116
45117 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
45118 for (n_val = 0;n_val < gen_nb_int;n_val++) {
45119 mem_base = xmlMemBlocks();
45120 cur = gen_xmlNodeSetPtr(n_cur, 0);
45121 val = gen_int(n_val, 1);
45122
45123 xmlXPathNodeSetRemove(cur, val);
45124 call_tests++;
45125 des_xmlNodeSetPtr(n_cur, cur, 0);
45126 des_int(n_val, val, 1);
45127 xmlResetLastError();
45128 if (mem_base != xmlMemBlocks()) {
45129 printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
45130 xmlMemBlocks() - mem_base);
45131 test_ret++;
45132 printf(" %d", n_cur);
45133 printf(" %d", n_val);
45134 printf("\n");
45135 }
45136 }
45137 }
45138#endif
45139
45140 function_tests++;
45141 return(test_ret);
45142}
45143
45144
45145static int
45146test_xmlXPathNodeSetSort(void) {
45147 int test_ret = 0;
45148
45149#ifdef LIBXML_XPATH_ENABLED
45150 int mem_base;
45151 xmlNodeSetPtr set; /* the node set */
45152 int n_set;
45153
45154 for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
45155 mem_base = xmlMemBlocks();
45156 set = gen_xmlNodeSetPtr(n_set, 0);
45157
45158 xmlXPathNodeSetSort(set);
45159 call_tests++;
45160 des_xmlNodeSetPtr(n_set, set, 0);
45161 xmlResetLastError();
45162 if (mem_base != xmlMemBlocks()) {
45163 printf("Leak of %d blocks found in xmlXPathNodeSetSort",
45164 xmlMemBlocks() - mem_base);
45165 test_ret++;
45166 printf(" %d", n_set);
45167 printf("\n");
45168 }
45169 }
45170#endif
45171
45172 function_tests++;
45173 return(test_ret);
45174}
45175
45176
45177static int
45178test_xmlXPathNodeTrailing(void) {
45179 int test_ret = 0;
45180
45181
45182 /* missing type support */
45183 return(test_ret);
45184}
45185
45186
45187static int
45188test_xmlXPathNodeTrailingSorted(void) {
45189 int test_ret = 0;
45190
45191
45192 /* missing type support */
45193 return(test_ret);
45194}
45195
45196
45197static int
45198test_xmlXPathNormalizeFunction(void) {
45199 int test_ret = 0;
45200
45201#ifdef LIBXML_XPATH_ENABLED
45202 int mem_base;
45203 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45204 int n_ctxt;
45205 int nargs; /* the number of arguments */
45206 int n_nargs;
45207
45208 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45209 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45210 mem_base = xmlMemBlocks();
45211 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45212 nargs = gen_int(n_nargs, 1);
45213
45214 xmlXPathNormalizeFunction(ctxt, nargs);
45215 call_tests++;
45216 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45217 des_int(n_nargs, nargs, 1);
45218 xmlResetLastError();
45219 if (mem_base != xmlMemBlocks()) {
45220 printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
45221 xmlMemBlocks() - mem_base);
45222 test_ret++;
45223 printf(" %d", n_ctxt);
45224 printf(" %d", n_nargs);
45225 printf("\n");
45226 }
45227 }
45228 }
45229#endif
45230
45231 function_tests++;
45232 return(test_ret);
45233}
45234
45235
45236static int
45237test_xmlXPathNotEqualValues(void) {
45238 int test_ret = 0;
45239
45240#ifdef LIBXML_XPATH_ENABLED
45241 int mem_base;
45242 int ret_val;
45243 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45244 int n_ctxt;
45245
45246 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45247 mem_base = xmlMemBlocks();
45248 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45249
45250 ret_val = xmlXPathNotEqualValues(ctxt);
45251 desret_int(ret_val);
45252 call_tests++;
45253 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45254 xmlResetLastError();
45255 if (mem_base != xmlMemBlocks()) {
45256 printf("Leak of %d blocks found in xmlXPathNotEqualValues",
45257 xmlMemBlocks() - mem_base);
45258 test_ret++;
45259 printf(" %d", n_ctxt);
45260 printf("\n");
45261 }
45262 }
45263#endif
45264
45265 function_tests++;
45266 return(test_ret);
45267}
45268
45269
45270static int
45271test_xmlXPathNotFunction(void) {
45272 int test_ret = 0;
45273
45274#ifdef LIBXML_XPATH_ENABLED
45275 int mem_base;
45276 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45277 int n_ctxt;
45278 int nargs; /* the number of arguments */
45279 int n_nargs;
45280
45281 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45282 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45283 mem_base = xmlMemBlocks();
45284 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45285 nargs = gen_int(n_nargs, 1);
45286
45287 xmlXPathNotFunction(ctxt, nargs);
45288 call_tests++;
45289 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45290 des_int(n_nargs, nargs, 1);
45291 xmlResetLastError();
45292 if (mem_base != xmlMemBlocks()) {
45293 printf("Leak of %d blocks found in xmlXPathNotFunction",
45294 xmlMemBlocks() - mem_base);
45295 test_ret++;
45296 printf(" %d", n_ctxt);
45297 printf(" %d", n_nargs);
45298 printf("\n");
45299 }
45300 }
45301 }
45302#endif
45303
45304 function_tests++;
45305 return(test_ret);
45306}
45307
45308
45309static int
45310test_xmlXPathNsLookup(void) {
45311 int test_ret = 0;
45312
45313#ifdef LIBXML_XPATH_ENABLED
45314 int mem_base;
45315 const xmlChar * ret_val;
45316 xmlXPathContextPtr ctxt; /* the XPath context */
45317 int n_ctxt;
45318 xmlChar * prefix; /* the namespace prefix value */
45319 int n_prefix;
45320
45321 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45322 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
45323 mem_base = xmlMemBlocks();
45324 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
45325 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
45326
45327 ret_val = xmlXPathNsLookup(ctxt, prefix);
45328 desret_const_xmlChar_ptr(ret_val);
45329 call_tests++;
45330 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
45331 des_const_xmlChar_ptr(n_prefix, prefix, 1);
45332 xmlResetLastError();
45333 if (mem_base != xmlMemBlocks()) {
45334 printf("Leak of %d blocks found in xmlXPathNsLookup",
45335 xmlMemBlocks() - mem_base);
45336 test_ret++;
45337 printf(" %d", n_ctxt);
45338 printf(" %d", n_prefix);
45339 printf("\n");
45340 }
45341 }
45342 }
45343#endif
45344
45345 function_tests++;
45346 return(test_ret);
45347}
45348
45349
45350static int
45351test_xmlXPathNumberFunction(void) {
45352 int test_ret = 0;
45353
45354#ifdef LIBXML_XPATH_ENABLED
45355 int mem_base;
45356 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45357 int n_ctxt;
45358 int nargs; /* the number of arguments */
45359 int n_nargs;
45360
45361 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45362 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45363 mem_base = xmlMemBlocks();
45364 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45365 nargs = gen_int(n_nargs, 1);
45366
45367 xmlXPathNumberFunction(ctxt, nargs);
45368 call_tests++;
45369 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45370 des_int(n_nargs, nargs, 1);
45371 xmlResetLastError();
45372 if (mem_base != xmlMemBlocks()) {
45373 printf("Leak of %d blocks found in xmlXPathNumberFunction",
45374 xmlMemBlocks() - mem_base);
45375 test_ret++;
45376 printf(" %d", n_ctxt);
45377 printf(" %d", n_nargs);
45378 printf("\n");
45379 }
45380 }
45381 }
45382#endif
45383
45384 function_tests++;
45385 return(test_ret);
45386}
45387
45388
45389static int
45390test_xmlXPathParseNCName(void) {
45391 int test_ret = 0;
45392
45393#ifdef LIBXML_XPATH_ENABLED
45394 int mem_base;
45395 xmlChar * ret_val;
45396 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45397 int n_ctxt;
45398
45399 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45400 mem_base = xmlMemBlocks();
45401 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45402
45403 ret_val = xmlXPathParseNCName(ctxt);
45404 desret_xmlChar_ptr(ret_val);
45405 call_tests++;
45406 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45407 xmlResetLastError();
45408 if (mem_base != xmlMemBlocks()) {
45409 printf("Leak of %d blocks found in xmlXPathParseNCName",
45410 xmlMemBlocks() - mem_base);
45411 test_ret++;
45412 printf(" %d", n_ctxt);
45413 printf("\n");
45414 }
45415 }
45416#endif
45417
45418 function_tests++;
45419 return(test_ret);
45420}
45421
45422
45423static int
45424test_xmlXPathParseName(void) {
45425 int test_ret = 0;
45426
45427#ifdef LIBXML_XPATH_ENABLED
45428 int mem_base;
45429 xmlChar * ret_val;
45430 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45431 int n_ctxt;
45432
45433 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45434 mem_base = xmlMemBlocks();
45435 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45436
45437 ret_val = xmlXPathParseName(ctxt);
45438 desret_xmlChar_ptr(ret_val);
45439 call_tests++;
45440 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45441 xmlResetLastError();
45442 if (mem_base != xmlMemBlocks()) {
45443 printf("Leak of %d blocks found in xmlXPathParseName",
45444 xmlMemBlocks() - mem_base);
45445 test_ret++;
45446 printf(" %d", n_ctxt);
45447 printf("\n");
45448 }
45449 }
45450#endif
45451
45452 function_tests++;
45453 return(test_ret);
45454}
45455
45456
45457static int
45458test_xmlXPathPopBoolean(void) {
45459 int test_ret = 0;
45460
45461#ifdef LIBXML_XPATH_ENABLED
45462 int mem_base;
45463 int ret_val;
45464 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
45465 int n_ctxt;
45466
45467 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45468 mem_base = xmlMemBlocks();
45469 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45470
45471 ret_val = xmlXPathPopBoolean(ctxt);
45472 desret_int(ret_val);
45473 call_tests++;
45474 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45475 xmlResetLastError();
45476 if (mem_base != xmlMemBlocks()) {
45477 printf("Leak of %d blocks found in xmlXPathPopBoolean",
45478 xmlMemBlocks() - mem_base);
45479 test_ret++;
45480 printf(" %d", n_ctxt);
45481 printf("\n");
45482 }
45483 }
45484#endif
45485
45486 function_tests++;
45487 return(test_ret);
45488}
45489
45490
45491static int
45492test_xmlXPathPopExternal(void) {
45493 int test_ret = 0;
45494
45495#ifdef LIBXML_XPATH_ENABLED
45496 int mem_base;
45497 void * ret_val;
45498 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
45499 int n_ctxt;
45500
45501 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45502 mem_base = xmlMemBlocks();
45503 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45504
45505 ret_val = xmlXPathPopExternal(ctxt);
45506 desret_void_ptr(ret_val);
45507 call_tests++;
45508 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45509 xmlResetLastError();
45510 if (mem_base != xmlMemBlocks()) {
45511 printf("Leak of %d blocks found in xmlXPathPopExternal",
45512 xmlMemBlocks() - mem_base);
45513 test_ret++;
45514 printf(" %d", n_ctxt);
45515 printf("\n");
45516 }
45517 }
45518#endif
45519
45520 function_tests++;
45521 return(test_ret);
45522}
45523
45524
45525static int
45526test_xmlXPathPopNodeSet(void) {
45527 int test_ret = 0;
45528
45529
45530 /* missing type support */
45531 return(test_ret);
45532}
45533
45534
45535static int
45536test_xmlXPathPopNumber(void) {
45537 int test_ret = 0;
45538
45539#ifdef LIBXML_XPATH_ENABLED
45540 int mem_base;
45541 double ret_val;
45542 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
45543 int n_ctxt;
45544
45545 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45546 mem_base = xmlMemBlocks();
45547 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45548
45549 ret_val = xmlXPathPopNumber(ctxt);
45550 desret_double(ret_val);
45551 call_tests++;
45552 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45553 xmlResetLastError();
45554 if (mem_base != xmlMemBlocks()) {
45555 printf("Leak of %d blocks found in xmlXPathPopNumber",
45556 xmlMemBlocks() - mem_base);
45557 test_ret++;
45558 printf(" %d", n_ctxt);
45559 printf("\n");
45560 }
45561 }
45562#endif
45563
45564 function_tests++;
45565 return(test_ret);
45566}
45567
45568
45569static int
45570test_xmlXPathPopString(void) {
45571 int test_ret = 0;
45572
45573#ifdef LIBXML_XPATH_ENABLED
45574 int mem_base;
45575 xmlChar * ret_val;
45576 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
45577 int n_ctxt;
45578
45579 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45580 mem_base = xmlMemBlocks();
45581 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45582
45583 ret_val = xmlXPathPopString(ctxt);
45584 desret_xmlChar_ptr(ret_val);
45585 call_tests++;
45586 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45587 xmlResetLastError();
45588 if (mem_base != xmlMemBlocks()) {
45589 printf("Leak of %d blocks found in xmlXPathPopString",
45590 xmlMemBlocks() - mem_base);
45591 test_ret++;
45592 printf(" %d", n_ctxt);
45593 printf("\n");
45594 }
45595 }
45596#endif
45597
45598 function_tests++;
45599 return(test_ret);
45600}
45601
45602
45603static int
45604test_xmlXPathPositionFunction(void) {
45605 int test_ret = 0;
45606
45607#ifdef LIBXML_XPATH_ENABLED
45608 int mem_base;
45609 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45610 int n_ctxt;
45611 int nargs; /* the number of arguments */
45612 int n_nargs;
45613
45614 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45615 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45616 mem_base = xmlMemBlocks();
45617 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45618 nargs = gen_int(n_nargs, 1);
45619
45620 xmlXPathPositionFunction(ctxt, nargs);
45621 call_tests++;
45622 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45623 des_int(n_nargs, nargs, 1);
45624 xmlResetLastError();
45625 if (mem_base != xmlMemBlocks()) {
45626 printf("Leak of %d blocks found in xmlXPathPositionFunction",
45627 xmlMemBlocks() - mem_base);
45628 test_ret++;
45629 printf(" %d", n_ctxt);
45630 printf(" %d", n_nargs);
45631 printf("\n");
45632 }
45633 }
45634 }
45635#endif
45636
45637 function_tests++;
45638 return(test_ret);
45639}
45640
45641
45642static int
45643test_xmlXPathRegisterAllFunctions(void) {
45644 int test_ret = 0;
45645
45646#ifdef LIBXML_XPATH_ENABLED
45647 int mem_base;
45648 xmlXPathContextPtr ctxt; /* the XPath context */
45649 int n_ctxt;
45650
45651 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45652 mem_base = xmlMemBlocks();
45653 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
45654
45655 xmlXPathRegisterAllFunctions(ctxt);
45656 call_tests++;
45657 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
45658 xmlResetLastError();
45659 if (mem_base != xmlMemBlocks()) {
45660 printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
45661 xmlMemBlocks() - mem_base);
45662 test_ret++;
45663 printf(" %d", n_ctxt);
45664 printf("\n");
45665 }
45666 }
45667#endif
45668
45669 function_tests++;
45670 return(test_ret);
45671}
45672
45673
45674static int
45675test_xmlXPathRegisterFunc(void) {
45676 int test_ret = 0;
45677
45678
45679 /* missing type support */
45680 return(test_ret);
45681}
45682
45683
45684static int
45685test_xmlXPathRegisterFuncLookup(void) {
45686 int test_ret = 0;
45687
45688
45689 /* missing type support */
45690 return(test_ret);
45691}
45692
45693
45694static int
45695test_xmlXPathRegisterFuncNS(void) {
45696 int test_ret = 0;
45697
45698
45699 /* missing type support */
45700 return(test_ret);
45701}
45702
45703
45704static int
45705test_xmlXPathRegisterNs(void) {
45706 int test_ret = 0;
45707
45708#ifdef LIBXML_XPATH_ENABLED
45709 int mem_base;
45710 int ret_val;
45711 xmlXPathContextPtr ctxt; /* the XPath context */
45712 int n_ctxt;
45713 xmlChar * prefix; /* the namespace prefix */
45714 int n_prefix;
45715 xmlChar * ns_uri; /* the namespace name */
45716 int n_ns_uri;
45717
45718 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45719 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
45720 for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
45721 mem_base = xmlMemBlocks();
45722 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
45723 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
45724 ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
45725
45726 ret_val = xmlXPathRegisterNs(ctxt, prefix, ns_uri);
45727 desret_int(ret_val);
45728 call_tests++;
45729 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
45730 des_const_xmlChar_ptr(n_prefix, prefix, 1);
45731 des_const_xmlChar_ptr(n_ns_uri, ns_uri, 2);
45732 xmlResetLastError();
45733 if (mem_base != xmlMemBlocks()) {
45734 printf("Leak of %d blocks found in xmlXPathRegisterNs",
45735 xmlMemBlocks() - mem_base);
45736 test_ret++;
45737 printf(" %d", n_ctxt);
45738 printf(" %d", n_prefix);
45739 printf(" %d", n_ns_uri);
45740 printf("\n");
45741 }
45742 }
45743 }
45744 }
45745#endif
45746
45747 function_tests++;
45748 return(test_ret);
45749}
45750
45751
45752static int
45753test_xmlXPathRegisterVariable(void) {
45754 int test_ret = 0;
45755
45756#ifdef LIBXML_XPATH_ENABLED
45757 int mem_base;
45758 int ret_val;
45759 xmlXPathContextPtr ctxt; /* the XPath context */
45760 int n_ctxt;
45761 xmlChar * name; /* the variable name */
45762 int n_name;
45763 xmlXPathObjectPtr value; /* the variable value or NULL */
45764 int n_value;
45765
45766 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45767 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45768 for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
45769 mem_base = xmlMemBlocks();
45770 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
45771 name = gen_const_xmlChar_ptr(n_name, 1);
45772 value = gen_xmlXPathObjectPtr(n_value, 2);
45773
45774 ret_val = xmlXPathRegisterVariable(ctxt, name, value);
45775 desret_int(ret_val);
45776 call_tests++;
45777 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
45778 des_const_xmlChar_ptr(n_name, name, 1);
45779 des_xmlXPathObjectPtr(n_value, value, 2);
45780 xmlResetLastError();
45781 if (mem_base != xmlMemBlocks()) {
45782 printf("Leak of %d blocks found in xmlXPathRegisterVariable",
45783 xmlMemBlocks() - mem_base);
45784 test_ret++;
45785 printf(" %d", n_ctxt);
45786 printf(" %d", n_name);
45787 printf(" %d", n_value);
45788 printf("\n");
45789 }
45790 }
45791 }
45792 }
45793#endif
45794
45795 function_tests++;
45796 return(test_ret);
45797}
45798
45799
45800static int
45801test_xmlXPathRegisterVariableLookup(void) {
45802 int test_ret = 0;
45803
45804
45805 /* missing type support */
45806 return(test_ret);
45807}
45808
45809
45810static int
45811test_xmlXPathRegisterVariableNS(void) {
45812 int test_ret = 0;
45813
45814#ifdef LIBXML_XPATH_ENABLED
45815 int mem_base;
45816 int ret_val;
45817 xmlXPathContextPtr ctxt; /* the XPath context */
45818 int n_ctxt;
45819 xmlChar * name; /* the variable name */
45820 int n_name;
45821 xmlChar * ns_uri; /* the variable namespace URI */
45822 int n_ns_uri;
45823 xmlXPathObjectPtr value; /* the variable value or NULL */
45824 int n_value;
45825
45826 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45827 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45828 for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
45829 for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
45830 mem_base = xmlMemBlocks();
45831 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
45832 name = gen_const_xmlChar_ptr(n_name, 1);
45833 ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
45834 value = gen_xmlXPathObjectPtr(n_value, 3);
45835
45836 ret_val = xmlXPathRegisterVariableNS(ctxt, name, ns_uri, value);
45837 desret_int(ret_val);
45838 call_tests++;
45839 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
45840 des_const_xmlChar_ptr(n_name, name, 1);
45841 des_const_xmlChar_ptr(n_ns_uri, ns_uri, 2);
45842 des_xmlXPathObjectPtr(n_value, value, 3);
45843 xmlResetLastError();
45844 if (mem_base != xmlMemBlocks()) {
45845 printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
45846 xmlMemBlocks() - mem_base);
45847 test_ret++;
45848 printf(" %d", n_ctxt);
45849 printf(" %d", n_name);
45850 printf(" %d", n_ns_uri);
45851 printf(" %d", n_value);
45852 printf("\n");
45853 }
45854 }
45855 }
45856 }
45857 }
45858#endif
45859
45860 function_tests++;
45861 return(test_ret);
45862}
45863
45864
45865static int
45866test_xmlXPathRegisteredFuncsCleanup(void) {
45867 int test_ret = 0;
45868
45869#ifdef LIBXML_XPATH_ENABLED
45870 int mem_base;
45871 xmlXPathContextPtr ctxt; /* the XPath context */
45872 int n_ctxt;
45873
45874 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45875 mem_base = xmlMemBlocks();
45876 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
45877
45878 xmlXPathRegisteredFuncsCleanup(ctxt);
45879 call_tests++;
45880 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
45881 xmlResetLastError();
45882 if (mem_base != xmlMemBlocks()) {
45883 printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
45884 xmlMemBlocks() - mem_base);
45885 test_ret++;
45886 printf(" %d", n_ctxt);
45887 printf("\n");
45888 }
45889 }
45890#endif
45891
45892 function_tests++;
45893 return(test_ret);
45894}
45895
45896
45897static int
45898test_xmlXPathRegisteredNsCleanup(void) {
45899 int test_ret = 0;
45900
45901#ifdef LIBXML_XPATH_ENABLED
45902 int mem_base;
45903 xmlXPathContextPtr ctxt; /* the XPath context */
45904 int n_ctxt;
45905
45906 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45907 mem_base = xmlMemBlocks();
45908 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
45909
45910 xmlXPathRegisteredNsCleanup(ctxt);
45911 call_tests++;
45912 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
45913 xmlResetLastError();
45914 if (mem_base != xmlMemBlocks()) {
45915 printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
45916 xmlMemBlocks() - mem_base);
45917 test_ret++;
45918 printf(" %d", n_ctxt);
45919 printf("\n");
45920 }
45921 }
45922#endif
45923
45924 function_tests++;
45925 return(test_ret);
45926}
45927
45928
45929static int
45930test_xmlXPathRegisteredVariablesCleanup(void) {
45931 int test_ret = 0;
45932
45933#ifdef LIBXML_XPATH_ENABLED
45934 int mem_base;
45935 xmlXPathContextPtr ctxt; /* the XPath context */
45936 int n_ctxt;
45937
45938 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45939 mem_base = xmlMemBlocks();
45940 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
45941
45942 xmlXPathRegisteredVariablesCleanup(ctxt);
45943 call_tests++;
45944 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
45945 xmlResetLastError();
45946 if (mem_base != xmlMemBlocks()) {
45947 printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
45948 xmlMemBlocks() - mem_base);
45949 test_ret++;
45950 printf(" %d", n_ctxt);
45951 printf("\n");
45952 }
45953 }
45954#endif
45955
45956 function_tests++;
45957 return(test_ret);
45958}
45959
45960
45961static int
45962test_xmlXPathRoot(void) {
45963 int test_ret = 0;
45964
45965#ifdef LIBXML_XPATH_ENABLED
45966 int mem_base;
45967 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45968 int n_ctxt;
45969
45970 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45971 mem_base = xmlMemBlocks();
45972 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45973
45974 xmlXPathRoot(ctxt);
45975 call_tests++;
45976 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45977 xmlResetLastError();
45978 if (mem_base != xmlMemBlocks()) {
45979 printf("Leak of %d blocks found in xmlXPathRoot",
45980 xmlMemBlocks() - mem_base);
45981 test_ret++;
45982 printf(" %d", n_ctxt);
45983 printf("\n");
45984 }
45985 }
45986#endif
45987
45988 function_tests++;
45989 return(test_ret);
45990}
45991
45992
45993static int
45994test_xmlXPathRoundFunction(void) {
45995 int test_ret = 0;
45996
45997#ifdef LIBXML_XPATH_ENABLED
45998 int mem_base;
45999 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46000 int n_ctxt;
46001 int nargs; /* the number of arguments */
46002 int n_nargs;
46003
46004 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46005 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46006 mem_base = xmlMemBlocks();
46007 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46008 nargs = gen_int(n_nargs, 1);
46009
46010 xmlXPathRoundFunction(ctxt, nargs);
46011 call_tests++;
46012 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46013 des_int(n_nargs, nargs, 1);
46014 xmlResetLastError();
46015 if (mem_base != xmlMemBlocks()) {
46016 printf("Leak of %d blocks found in xmlXPathRoundFunction",
46017 xmlMemBlocks() - mem_base);
46018 test_ret++;
46019 printf(" %d", n_ctxt);
46020 printf(" %d", n_nargs);
46021 printf("\n");
46022 }
46023 }
46024 }
46025#endif
46026
46027 function_tests++;
46028 return(test_ret);
46029}
46030
46031
46032static int
46033test_xmlXPathStartsWithFunction(void) {
46034 int test_ret = 0;
46035
46036#ifdef LIBXML_XPATH_ENABLED
46037 int mem_base;
46038 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46039 int n_ctxt;
46040 int nargs; /* the number of arguments */
46041 int n_nargs;
46042
46043 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46044 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46045 mem_base = xmlMemBlocks();
46046 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46047 nargs = gen_int(n_nargs, 1);
46048
46049 xmlXPathStartsWithFunction(ctxt, nargs);
46050 call_tests++;
46051 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46052 des_int(n_nargs, nargs, 1);
46053 xmlResetLastError();
46054 if (mem_base != xmlMemBlocks()) {
46055 printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
46056 xmlMemBlocks() - mem_base);
46057 test_ret++;
46058 printf(" %d", n_ctxt);
46059 printf(" %d", n_nargs);
46060 printf("\n");
46061 }
46062 }
46063 }
46064#endif
46065
46066 function_tests++;
46067 return(test_ret);
46068}
46069
46070
46071static int
46072test_xmlXPathStringEvalNumber(void) {
46073 int test_ret = 0;
46074
46075#ifdef LIBXML_XPATH_ENABLED
46076 int mem_base;
46077 double ret_val;
46078 xmlChar * str; /* A string to scan */
46079 int n_str;
46080
46081 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46082 mem_base = xmlMemBlocks();
46083 str = gen_const_xmlChar_ptr(n_str, 0);
46084
46085 ret_val = xmlXPathStringEvalNumber(str);
46086 desret_double(ret_val);
46087 call_tests++;
46088 des_const_xmlChar_ptr(n_str, str, 0);
46089 xmlResetLastError();
46090 if (mem_base != xmlMemBlocks()) {
46091 printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
46092 xmlMemBlocks() - mem_base);
46093 test_ret++;
46094 printf(" %d", n_str);
46095 printf("\n");
46096 }
46097 }
46098#endif
46099
46100 function_tests++;
46101 return(test_ret);
46102}
46103
46104
46105static int
46106test_xmlXPathStringFunction(void) {
46107 int test_ret = 0;
46108
46109#ifdef LIBXML_XPATH_ENABLED
46110 int mem_base;
46111 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46112 int n_ctxt;
46113 int nargs; /* the number of arguments */
46114 int n_nargs;
46115
46116 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46117 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46118 mem_base = xmlMemBlocks();
46119 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46120 nargs = gen_int(n_nargs, 1);
46121
46122 xmlXPathStringFunction(ctxt, nargs);
46123 call_tests++;
46124 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46125 des_int(n_nargs, nargs, 1);
46126 xmlResetLastError();
46127 if (mem_base != xmlMemBlocks()) {
46128 printf("Leak of %d blocks found in xmlXPathStringFunction",
46129 xmlMemBlocks() - mem_base);
46130 test_ret++;
46131 printf(" %d", n_ctxt);
46132 printf(" %d", n_nargs);
46133 printf("\n");
46134 }
46135 }
46136 }
46137#endif
46138
46139 function_tests++;
46140 return(test_ret);
46141}
46142
46143
46144static int
46145test_xmlXPathStringLengthFunction(void) {
46146 int test_ret = 0;
46147
46148#ifdef LIBXML_XPATH_ENABLED
46149 int mem_base;
46150 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46151 int n_ctxt;
46152 int nargs; /* the number of arguments */
46153 int n_nargs;
46154
46155 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46156 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46157 mem_base = xmlMemBlocks();
46158 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46159 nargs = gen_int(n_nargs, 1);
46160
46161 xmlXPathStringLengthFunction(ctxt, nargs);
46162 call_tests++;
46163 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46164 des_int(n_nargs, nargs, 1);
46165 xmlResetLastError();
46166 if (mem_base != xmlMemBlocks()) {
46167 printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
46168 xmlMemBlocks() - mem_base);
46169 test_ret++;
46170 printf(" %d", n_ctxt);
46171 printf(" %d", n_nargs);
46172 printf("\n");
46173 }
46174 }
46175 }
46176#endif
46177
46178 function_tests++;
46179 return(test_ret);
46180}
46181
46182
46183static int
46184test_xmlXPathSubValues(void) {
46185 int test_ret = 0;
46186
46187#ifdef LIBXML_XPATH_ENABLED
46188 int mem_base;
46189 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46190 int n_ctxt;
46191
46192 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46193 mem_base = xmlMemBlocks();
46194 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46195
46196 xmlXPathSubValues(ctxt);
46197 call_tests++;
46198 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46199 xmlResetLastError();
46200 if (mem_base != xmlMemBlocks()) {
46201 printf("Leak of %d blocks found in xmlXPathSubValues",
46202 xmlMemBlocks() - mem_base);
46203 test_ret++;
46204 printf(" %d", n_ctxt);
46205 printf("\n");
46206 }
46207 }
46208#endif
46209
46210 function_tests++;
46211 return(test_ret);
46212}
46213
46214
46215static int
46216test_xmlXPathSubstringAfterFunction(void) {
46217 int test_ret = 0;
46218
46219#ifdef LIBXML_XPATH_ENABLED
46220 int mem_base;
46221 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46222 int n_ctxt;
46223 int nargs; /* the number of arguments */
46224 int n_nargs;
46225
46226 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46227 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46228 mem_base = xmlMemBlocks();
46229 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46230 nargs = gen_int(n_nargs, 1);
46231
46232 xmlXPathSubstringAfterFunction(ctxt, nargs);
46233 call_tests++;
46234 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46235 des_int(n_nargs, nargs, 1);
46236 xmlResetLastError();
46237 if (mem_base != xmlMemBlocks()) {
46238 printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
46239 xmlMemBlocks() - mem_base);
46240 test_ret++;
46241 printf(" %d", n_ctxt);
46242 printf(" %d", n_nargs);
46243 printf("\n");
46244 }
46245 }
46246 }
46247#endif
46248
46249 function_tests++;
46250 return(test_ret);
46251}
46252
46253
46254static int
46255test_xmlXPathSubstringBeforeFunction(void) {
46256 int test_ret = 0;
46257
46258#ifdef LIBXML_XPATH_ENABLED
46259 int mem_base;
46260 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46261 int n_ctxt;
46262 int nargs; /* the number of arguments */
46263 int n_nargs;
46264
46265 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46266 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46267 mem_base = xmlMemBlocks();
46268 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46269 nargs = gen_int(n_nargs, 1);
46270
46271 xmlXPathSubstringBeforeFunction(ctxt, nargs);
46272 call_tests++;
46273 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46274 des_int(n_nargs, nargs, 1);
46275 xmlResetLastError();
46276 if (mem_base != xmlMemBlocks()) {
46277 printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
46278 xmlMemBlocks() - mem_base);
46279 test_ret++;
46280 printf(" %d", n_ctxt);
46281 printf(" %d", n_nargs);
46282 printf("\n");
46283 }
46284 }
46285 }
46286#endif
46287
46288 function_tests++;
46289 return(test_ret);
46290}
46291
46292
46293static int
46294test_xmlXPathSubstringFunction(void) {
46295 int test_ret = 0;
46296
46297#ifdef LIBXML_XPATH_ENABLED
46298 int mem_base;
46299 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46300 int n_ctxt;
46301 int nargs; /* the number of arguments */
46302 int n_nargs;
46303
46304 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46305 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46306 mem_base = xmlMemBlocks();
46307 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46308 nargs = gen_int(n_nargs, 1);
46309
46310 xmlXPathSubstringFunction(ctxt, nargs);
46311 call_tests++;
46312 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46313 des_int(n_nargs, nargs, 1);
46314 xmlResetLastError();
46315 if (mem_base != xmlMemBlocks()) {
46316 printf("Leak of %d blocks found in xmlXPathSubstringFunction",
46317 xmlMemBlocks() - mem_base);
46318 test_ret++;
46319 printf(" %d", n_ctxt);
46320 printf(" %d", n_nargs);
46321 printf("\n");
46322 }
46323 }
46324 }
46325#endif
46326
46327 function_tests++;
46328 return(test_ret);
46329}
46330
46331
46332static int
46333test_xmlXPathSumFunction(void) {
46334 int test_ret = 0;
46335
46336#ifdef LIBXML_XPATH_ENABLED
46337 int mem_base;
46338 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46339 int n_ctxt;
46340 int nargs; /* the number of arguments */
46341 int n_nargs;
46342
46343 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46344 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46345 mem_base = xmlMemBlocks();
46346 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46347 nargs = gen_int(n_nargs, 1);
46348
46349 xmlXPathSumFunction(ctxt, nargs);
46350 call_tests++;
46351 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46352 des_int(n_nargs, nargs, 1);
46353 xmlResetLastError();
46354 if (mem_base != xmlMemBlocks()) {
46355 printf("Leak of %d blocks found in xmlXPathSumFunction",
46356 xmlMemBlocks() - mem_base);
46357 test_ret++;
46358 printf(" %d", n_ctxt);
46359 printf(" %d", n_nargs);
46360 printf("\n");
46361 }
46362 }
46363 }
46364#endif
46365
46366 function_tests++;
46367 return(test_ret);
46368}
46369
46370
46371static int
46372test_xmlXPathTrailing(void) {
46373 int test_ret = 0;
46374
46375
46376 /* missing type support */
46377 return(test_ret);
46378}
46379
46380
46381static int
46382test_xmlXPathTrailingSorted(void) {
46383 int test_ret = 0;
46384
46385
46386 /* missing type support */
46387 return(test_ret);
46388}
46389
46390
46391static int
46392test_xmlXPathTranslateFunction(void) {
46393 int test_ret = 0;
46394
46395#ifdef LIBXML_XPATH_ENABLED
46396 int mem_base;
46397 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46398 int n_ctxt;
46399 int nargs; /* the number of arguments */
46400 int n_nargs;
46401
46402 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46403 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46404 mem_base = xmlMemBlocks();
46405 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46406 nargs = gen_int(n_nargs, 1);
46407
46408 xmlXPathTranslateFunction(ctxt, nargs);
46409 call_tests++;
46410 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46411 des_int(n_nargs, nargs, 1);
46412 xmlResetLastError();
46413 if (mem_base != xmlMemBlocks()) {
46414 printf("Leak of %d blocks found in xmlXPathTranslateFunction",
46415 xmlMemBlocks() - mem_base);
46416 test_ret++;
46417 printf(" %d", n_ctxt);
46418 printf(" %d", n_nargs);
46419 printf("\n");
46420 }
46421 }
46422 }
46423#endif
46424
46425 function_tests++;
46426 return(test_ret);
46427}
46428
46429
46430static int
46431test_xmlXPathTrueFunction(void) {
46432 int test_ret = 0;
46433
46434#ifdef LIBXML_XPATH_ENABLED
46435 int mem_base;
46436 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46437 int n_ctxt;
46438 int nargs; /* the number of arguments */
46439 int n_nargs;
46440
46441 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46442 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46443 mem_base = xmlMemBlocks();
46444 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46445 nargs = gen_int(n_nargs, 1);
46446
46447 xmlXPathTrueFunction(ctxt, nargs);
46448 call_tests++;
46449 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46450 des_int(n_nargs, nargs, 1);
46451 xmlResetLastError();
46452 if (mem_base != xmlMemBlocks()) {
46453 printf("Leak of %d blocks found in xmlXPathTrueFunction",
46454 xmlMemBlocks() - mem_base);
46455 test_ret++;
46456 printf(" %d", n_ctxt);
46457 printf(" %d", n_nargs);
46458 printf("\n");
46459 }
46460 }
46461 }
46462#endif
46463
46464 function_tests++;
46465 return(test_ret);
46466}
46467
46468
46469static int
46470test_xmlXPathValueFlipSign(void) {
46471 int test_ret = 0;
46472
46473#ifdef LIBXML_XPATH_ENABLED
46474 int mem_base;
46475 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46476 int n_ctxt;
46477
46478 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46479 mem_base = xmlMemBlocks();
46480 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46481
46482 xmlXPathValueFlipSign(ctxt);
46483 call_tests++;
46484 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46485 xmlResetLastError();
46486 if (mem_base != xmlMemBlocks()) {
46487 printf("Leak of %d blocks found in xmlXPathValueFlipSign",
46488 xmlMemBlocks() - mem_base);
46489 test_ret++;
46490 printf(" %d", n_ctxt);
46491 printf("\n");
46492 }
46493 }
46494#endif
46495
46496 function_tests++;
46497 return(test_ret);
46498}
46499
46500
46501static int
46502test_xmlXPathVariableLookup(void) {
46503 int test_ret = 0;
46504
46505#ifdef LIBXML_XPATH_ENABLED
46506 int mem_base;
46507 xmlXPathObjectPtr ret_val;
46508 xmlXPathContextPtr ctxt; /* the XPath context */
46509 int n_ctxt;
46510 xmlChar * name; /* the variable name */
46511 int n_name;
46512
46513 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46514 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46515 mem_base = xmlMemBlocks();
46516 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46517 name = gen_const_xmlChar_ptr(n_name, 1);
46518
46519 ret_val = xmlXPathVariableLookup(ctxt, name);
46520 desret_xmlXPathObjectPtr(ret_val);
46521 call_tests++;
46522 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46523 des_const_xmlChar_ptr(n_name, name, 1);
46524 xmlResetLastError();
46525 if (mem_base != xmlMemBlocks()) {
46526 printf("Leak of %d blocks found in xmlXPathVariableLookup",
46527 xmlMemBlocks() - mem_base);
46528 test_ret++;
46529 printf(" %d", n_ctxt);
46530 printf(" %d", n_name);
46531 printf("\n");
46532 }
46533 }
46534 }
46535#endif
46536
46537 function_tests++;
46538 return(test_ret);
46539}
46540
46541
46542static int
46543test_xmlXPathVariableLookupNS(void) {
46544 int test_ret = 0;
46545
46546#ifdef LIBXML_XPATH_ENABLED
46547 int mem_base;
46548 xmlXPathObjectPtr ret_val;
46549 xmlXPathContextPtr ctxt; /* the XPath context */
46550 int n_ctxt;
46551 xmlChar * name; /* the variable name */
46552 int n_name;
46553 xmlChar * ns_uri; /* the variable namespace URI */
46554 int n_ns_uri;
46555
46556 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46557 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46558 for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
46559 mem_base = xmlMemBlocks();
46560 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46561 name = gen_const_xmlChar_ptr(n_name, 1);
46562 ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
46563
46564 ret_val = xmlXPathVariableLookupNS(ctxt, name, ns_uri);
46565 desret_xmlXPathObjectPtr(ret_val);
46566 call_tests++;
46567 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46568 des_const_xmlChar_ptr(n_name, name, 1);
46569 des_const_xmlChar_ptr(n_ns_uri, ns_uri, 2);
46570 xmlResetLastError();
46571 if (mem_base != xmlMemBlocks()) {
46572 printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
46573 xmlMemBlocks() - mem_base);
46574 test_ret++;
46575 printf(" %d", n_ctxt);
46576 printf(" %d", n_name);
46577 printf(" %d", n_ns_uri);
46578 printf("\n");
46579 }
46580 }
46581 }
46582 }
46583#endif
46584
46585 function_tests++;
46586 return(test_ret);
46587}
46588
46589
46590static int
46591test_xmlXPathWrapCString(void) {
46592 int test_ret = 0;
46593
46594#ifdef LIBXML_XPATH_ENABLED
46595 int mem_base;
46596 xmlXPathObjectPtr ret_val;
46597 char * val; /* the char * value */
46598 int n_val;
46599
46600 for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
46601 mem_base = xmlMemBlocks();
46602 val = gen_char_ptr(n_val, 0);
46603
46604 ret_val = xmlXPathWrapCString(val);
46605 desret_xmlXPathObjectPtr(ret_val);
46606 call_tests++;
46607 des_char_ptr(n_val, val, 0);
46608 xmlResetLastError();
46609 if (mem_base != xmlMemBlocks()) {
46610 printf("Leak of %d blocks found in xmlXPathWrapCString",
46611 xmlMemBlocks() - mem_base);
46612 test_ret++;
46613 printf(" %d", n_val);
46614 printf("\n");
46615 }
46616 }
46617#endif
46618
46619 function_tests++;
46620 return(test_ret);
46621}
46622
46623
46624static int
46625test_xmlXPathWrapExternal(void) {
46626 int test_ret = 0;
46627
46628#ifdef LIBXML_XPATH_ENABLED
46629 int mem_base;
46630 xmlXPathObjectPtr ret_val;
46631 void * val; /* the user data */
46632 int n_val;
46633
46634 for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
46635 mem_base = xmlMemBlocks();
46636 val = gen_void_ptr(n_val, 0);
46637
46638 ret_val = xmlXPathWrapExternal(val);
46639 desret_xmlXPathObjectPtr(ret_val);
46640 call_tests++;
46641 des_void_ptr(n_val, val, 0);
46642 xmlResetLastError();
46643 if (mem_base != xmlMemBlocks()) {
46644 printf("Leak of %d blocks found in xmlXPathWrapExternal",
46645 xmlMemBlocks() - mem_base);
46646 test_ret++;
46647 printf(" %d", n_val);
46648 printf("\n");
46649 }
46650 }
46651#endif
46652
46653 function_tests++;
46654 return(test_ret);
46655}
46656
46657
46658static int
46659test_xmlXPathWrapNodeSet(void) {
46660 int test_ret = 0;
46661
46662#ifdef LIBXML_XPATH_ENABLED
46663 int mem_base;
46664 xmlXPathObjectPtr ret_val;
46665 xmlNodeSetPtr val; /* the NodePtr value */
46666 int n_val;
46667
46668 for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
46669 mem_base = xmlMemBlocks();
46670 val = gen_xmlNodeSetPtr(n_val, 0);
46671
46672 ret_val = xmlXPathWrapNodeSet(val);
46673 desret_xmlXPathObjectPtr(ret_val);
46674 call_tests++;
46675 des_xmlNodeSetPtr(n_val, val, 0);
46676 xmlResetLastError();
46677 if (mem_base != xmlMemBlocks()) {
46678 printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
46679 xmlMemBlocks() - mem_base);
46680 test_ret++;
46681 printf(" %d", n_val);
46682 printf("\n");
46683 }
46684 }
46685#endif
46686
46687 function_tests++;
46688 return(test_ret);
46689}
46690
46691
46692static int
46693test_xmlXPatherror(void) {
46694 int test_ret = 0;
46695
46696#ifdef LIBXML_XPATH_ENABLED
46697 int mem_base;
46698 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46699 int n_ctxt;
46700 const char * file; /* the file name */
46701 int n_file;
46702 int line; /* the line number */
46703 int n_line;
46704 int no; /* the error number */
46705 int n_no;
46706
46707 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46708 for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
46709 for (n_line = 0;n_line < gen_nb_int;n_line++) {
46710 for (n_no = 0;n_no < gen_nb_int;n_no++) {
46711 mem_base = xmlMemBlocks();
46712 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46713 file = gen_filepath(n_file, 1);
46714 line = gen_int(n_line, 2);
46715 no = gen_int(n_no, 3);
46716
46717 xmlXPatherror(ctxt, file, line, no);
46718 call_tests++;
46719 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46720 des_filepath(n_file, file, 1);
46721 des_int(n_line, line, 2);
46722 des_int(n_no, no, 3);
46723 xmlResetLastError();
46724 if (mem_base != xmlMemBlocks()) {
46725 printf("Leak of %d blocks found in xmlXPatherror",
46726 xmlMemBlocks() - mem_base);
46727 test_ret++;
46728 printf(" %d", n_ctxt);
46729 printf(" %d", n_file);
46730 printf(" %d", n_line);
46731 printf(" %d", n_no);
46732 printf("\n");
46733 }
46734 }
46735 }
46736 }
46737 }
46738#endif
46739
46740 function_tests++;
46741 return(test_ret);
46742}
46743
46744static int
46745test_xpathInternals(void) {
46746 int test_ret = 0;
46747
46748 printf("Testing xpathInternals : 92 of 117 functions ...\n");
46749 test_ret += test_valuePop();
46750 test_ret += test_valuePush();
46751 test_ret += test_xmlXPathAddValues();
46752 test_ret += test_xmlXPathBooleanFunction();
46753 test_ret += test_xmlXPathCeilingFunction();
46754 test_ret += test_xmlXPathCompareValues();
46755 test_ret += test_xmlXPathConcatFunction();
46756 test_ret += test_xmlXPathContainsFunction();
46757 test_ret += test_xmlXPathCountFunction();
46758 test_ret += test_xmlXPathDebugDumpCompExpr();
46759 test_ret += test_xmlXPathDebugDumpObject();
46760 test_ret += test_xmlXPathDifference();
46761 test_ret += test_xmlXPathDistinct();
46762 test_ret += test_xmlXPathDistinctSorted();
46763 test_ret += test_xmlXPathDivValues();
46764 test_ret += test_xmlXPathEqualValues();
46765 test_ret += test_xmlXPathErr();
46766 test_ret += test_xmlXPathEvalExpr();
46767 test_ret += test_xmlXPathEvaluatePredicateResult();
46768 test_ret += test_xmlXPathFalseFunction();
46769 test_ret += test_xmlXPathFloorFunction();
46770 test_ret += test_xmlXPathFunctionLookup();
46771 test_ret += test_xmlXPathFunctionLookupNS();
46772 test_ret += test_xmlXPathHasSameNodes();
46773 test_ret += test_xmlXPathIdFunction();
46774 test_ret += test_xmlXPathIntersection();
46775 test_ret += test_xmlXPathIsNodeType();
46776 test_ret += test_xmlXPathLangFunction();
46777 test_ret += test_xmlXPathLastFunction();
46778 test_ret += test_xmlXPathLeading();
46779 test_ret += test_xmlXPathLeadingSorted();
46780 test_ret += test_xmlXPathLocalNameFunction();
46781 test_ret += test_xmlXPathModValues();
46782 test_ret += test_xmlXPathMultValues();
46783 test_ret += test_xmlXPathNamespaceURIFunction();
46784 test_ret += test_xmlXPathNewBoolean();
46785 test_ret += test_xmlXPathNewCString();
46786 test_ret += test_xmlXPathNewFloat();
46787 test_ret += test_xmlXPathNewNodeSet();
46788 test_ret += test_xmlXPathNewNodeSetList();
46789 test_ret += test_xmlXPathNewParserContext();
46790 test_ret += test_xmlXPathNewString();
46791 test_ret += test_xmlXPathNextAncestor();
46792 test_ret += test_xmlXPathNextAncestorOrSelf();
46793 test_ret += test_xmlXPathNextAttribute();
46794 test_ret += test_xmlXPathNextChild();
46795 test_ret += test_xmlXPathNextDescendant();
46796 test_ret += test_xmlXPathNextDescendantOrSelf();
46797 test_ret += test_xmlXPathNextFollowing();
46798 test_ret += test_xmlXPathNextFollowingSibling();
46799 test_ret += test_xmlXPathNextNamespace();
46800 test_ret += test_xmlXPathNextParent();
46801 test_ret += test_xmlXPathNextPreceding();
46802 test_ret += test_xmlXPathNextPrecedingSibling();
46803 test_ret += test_xmlXPathNextSelf();
46804 test_ret += test_xmlXPathNodeLeading();
46805 test_ret += test_xmlXPathNodeLeadingSorted();
46806 test_ret += test_xmlXPathNodeSetAdd();
46807 test_ret += test_xmlXPathNodeSetAddNs();
46808 test_ret += test_xmlXPathNodeSetAddUnique();
46809 test_ret += test_xmlXPathNodeSetContains();
46810 test_ret += test_xmlXPathNodeSetDel();
46811 test_ret += test_xmlXPathNodeSetMerge();
46812 test_ret += test_xmlXPathNodeSetRemove();
46813 test_ret += test_xmlXPathNodeSetSort();
46814 test_ret += test_xmlXPathNodeTrailing();
46815 test_ret += test_xmlXPathNodeTrailingSorted();
46816 test_ret += test_xmlXPathNormalizeFunction();
46817 test_ret += test_xmlXPathNotEqualValues();
46818 test_ret += test_xmlXPathNotFunction();
46819 test_ret += test_xmlXPathNsLookup();
46820 test_ret += test_xmlXPathNumberFunction();
46821 test_ret += test_xmlXPathParseNCName();
46822 test_ret += test_xmlXPathParseName();
46823 test_ret += test_xmlXPathPopBoolean();
46824 test_ret += test_xmlXPathPopExternal();
46825 test_ret += test_xmlXPathPopNodeSet();
46826 test_ret += test_xmlXPathPopNumber();
46827 test_ret += test_xmlXPathPopString();
46828 test_ret += test_xmlXPathPositionFunction();
46829 test_ret += test_xmlXPathRegisterAllFunctions();
46830 test_ret += test_xmlXPathRegisterFunc();
46831 test_ret += test_xmlXPathRegisterFuncLookup();
46832 test_ret += test_xmlXPathRegisterFuncNS();
46833 test_ret += test_xmlXPathRegisterNs();
46834 test_ret += test_xmlXPathRegisterVariable();
46835 test_ret += test_xmlXPathRegisterVariableLookup();
46836 test_ret += test_xmlXPathRegisterVariableNS();
46837 test_ret += test_xmlXPathRegisteredFuncsCleanup();
46838 test_ret += test_xmlXPathRegisteredNsCleanup();
46839 test_ret += test_xmlXPathRegisteredVariablesCleanup();
46840 test_ret += test_xmlXPathRoot();
46841 test_ret += test_xmlXPathRoundFunction();
46842 test_ret += test_xmlXPathStartsWithFunction();
46843 test_ret += test_xmlXPathStringEvalNumber();
46844 test_ret += test_xmlXPathStringFunction();
46845 test_ret += test_xmlXPathStringLengthFunction();
46846 test_ret += test_xmlXPathSubValues();
46847 test_ret += test_xmlXPathSubstringAfterFunction();
46848 test_ret += test_xmlXPathSubstringBeforeFunction();
46849 test_ret += test_xmlXPathSubstringFunction();
46850 test_ret += test_xmlXPathSumFunction();
46851 test_ret += test_xmlXPathTrailing();
46852 test_ret += test_xmlXPathTrailingSorted();
46853 test_ret += test_xmlXPathTranslateFunction();
46854 test_ret += test_xmlXPathTrueFunction();
46855 test_ret += test_xmlXPathValueFlipSign();
46856 test_ret += test_xmlXPathVariableLookup();
46857 test_ret += test_xmlXPathVariableLookupNS();
46858 test_ret += test_xmlXPathWrapCString();
46859 test_ret += test_xmlXPathWrapExternal();
46860 test_ret += test_xmlXPathWrapNodeSet();
46861 test_ret += test_xmlXPatherror();
46862
46863 if (test_ret != 0)
46864 printf("Module xpathInternals: %d errors\n", test_ret);
46865 return(test_ret);
46866}
46867
Daniel Veillardd93f6252004-11-02 15:53:51 +000046868static int
46869test_xmlXPtrBuildNodeList(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000046870 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000046871
Daniel Veillardd005b9e2004-11-03 17:07:05 +000046872#ifdef LIBXML_XPTR_ENABLED
46873 int mem_base;
46874 xmlNodePtr ret_val;
46875 xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
46876 int n_obj;
Daniel Veillardd93f6252004-11-02 15:53:51 +000046877
Daniel Veillardd005b9e2004-11-03 17:07:05 +000046878 for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
46879 mem_base = xmlMemBlocks();
Daniel Veillard3d97e662004-11-04 10:49:00 +000046880 obj = gen_xmlXPathObjectPtr(n_obj, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000046881
46882 ret_val = xmlXPtrBuildNodeList(obj);
46883 desret_xmlNodePtr(ret_val);
46884 call_tests++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000046885 des_xmlXPathObjectPtr(n_obj, obj, 0);
Daniel Veillardd005b9e2004-11-03 17:07:05 +000046886 xmlResetLastError();
46887 if (mem_base != xmlMemBlocks()) {
46888 printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
46889 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000046890 test_ret++;
Daniel Veillardd005b9e2004-11-03 17:07:05 +000046891 printf(" %d", n_obj);
46892 printf("\n");
46893 }
46894 }
46895#endif
46896
Daniel Veillard3d97e662004-11-04 10:49:00 +000046897 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000046898 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000046899}
46900
46901
46902static int
46903test_xmlXPtrEval(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000046904 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000046905
Daniel Veillardce682bc2004-11-05 17:22:25 +000046906#ifdef LIBXML_XPTR_ENABLED
46907 int mem_base;
46908 xmlXPathObjectPtr ret_val;
46909 xmlChar * str; /* the XPointer expression */
46910 int n_str;
46911 xmlXPathContextPtr ctx; /* the XPointer context */
46912 int n_ctx;
Daniel Veillardd93f6252004-11-02 15:53:51 +000046913
Daniel Veillardce682bc2004-11-05 17:22:25 +000046914 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46915 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46916 mem_base = xmlMemBlocks();
46917 str = gen_const_xmlChar_ptr(n_str, 0);
46918 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46919
46920 ret_val = xmlXPtrEval(str, ctx);
46921 desret_xmlXPathObjectPtr(ret_val);
46922 call_tests++;
46923 des_const_xmlChar_ptr(n_str, str, 0);
46924 des_xmlXPathContextPtr(n_ctx, ctx, 1);
46925 xmlResetLastError();
46926 if (mem_base != xmlMemBlocks()) {
46927 printf("Leak of %d blocks found in xmlXPtrEval",
46928 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000046929 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000046930 printf(" %d", n_str);
46931 printf(" %d", n_ctx);
46932 printf("\n");
46933 }
46934 }
46935 }
46936#endif
46937
46938 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000046939 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000046940}
46941
46942
46943static int
46944test_xmlXPtrEvalRangePredicate(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000046945 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000046946
Daniel Veillardce682bc2004-11-05 17:22:25 +000046947#ifdef LIBXML_XPTR_ENABLED
46948 int mem_base;
46949 xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
46950 int n_ctxt;
Daniel Veillardd93f6252004-11-02 15:53:51 +000046951
Daniel Veillardce682bc2004-11-05 17:22:25 +000046952 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46953 mem_base = xmlMemBlocks();
46954 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46955
46956 xmlXPtrEvalRangePredicate(ctxt);
46957 call_tests++;
46958 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46959 xmlResetLastError();
46960 if (mem_base != xmlMemBlocks()) {
46961 printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
46962 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000046963 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000046964 printf(" %d", n_ctxt);
46965 printf("\n");
46966 }
46967 }
46968#endif
46969
46970 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000046971 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000046972}
46973
46974
Daniel Veillardce682bc2004-11-05 17:22:25 +000046975#define gen_nb_xmlLocationSetPtr 1
46976static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46977 return(NULL);
46978}
46979static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46980}
46981
Daniel Veillardd93f6252004-11-02 15:53:51 +000046982static int
46983test_xmlXPtrLocationSetAdd(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000046984 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000046985
Daniel Veillardce682bc2004-11-05 17:22:25 +000046986#ifdef LIBXML_XPTR_ENABLED
46987 int mem_base;
46988 xmlLocationSetPtr cur; /* the initial range set */
46989 int n_cur;
46990 xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
46991 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000046992
Daniel Veillardce682bc2004-11-05 17:22:25 +000046993 for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
46994 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46995 mem_base = xmlMemBlocks();
46996 cur = gen_xmlLocationSetPtr(n_cur, 0);
46997 val = gen_xmlXPathObjectPtr(n_val, 1);
46998
46999 xmlXPtrLocationSetAdd(cur, val);
47000 call_tests++;
47001 des_xmlLocationSetPtr(n_cur, cur, 0);
47002 des_xmlXPathObjectPtr(n_val, val, 1);
47003 xmlResetLastError();
47004 if (mem_base != xmlMemBlocks()) {
47005 printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
47006 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000047007 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000047008 printf(" %d", n_cur);
47009 printf(" %d", n_val);
47010 printf("\n");
47011 }
47012 }
47013 }
47014#endif
47015
47016 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000047017 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000047018}
47019
47020
47021static int
47022test_xmlXPtrLocationSetCreate(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000047023 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047024
47025
47026 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000047027 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000047028}
47029
47030
47031static int
47032test_xmlXPtrLocationSetDel(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000047033 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047034
Daniel Veillardce682bc2004-11-05 17:22:25 +000047035#ifdef LIBXML_XPTR_ENABLED
47036 int mem_base;
47037 xmlLocationSetPtr cur; /* the initial range set */
47038 int n_cur;
47039 xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
47040 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047041
Daniel Veillardce682bc2004-11-05 17:22:25 +000047042 for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
47043 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
47044 mem_base = xmlMemBlocks();
47045 cur = gen_xmlLocationSetPtr(n_cur, 0);
47046 val = gen_xmlXPathObjectPtr(n_val, 1);
47047
47048 xmlXPtrLocationSetDel(cur, val);
47049 call_tests++;
47050 des_xmlLocationSetPtr(n_cur, cur, 0);
47051 des_xmlXPathObjectPtr(n_val, val, 1);
47052 xmlResetLastError();
47053 if (mem_base != xmlMemBlocks()) {
47054 printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
47055 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000047056 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000047057 printf(" %d", n_cur);
47058 printf(" %d", n_val);
47059 printf("\n");
47060 }
47061 }
47062 }
47063#endif
47064
47065 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000047066 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000047067}
47068
47069
47070static int
47071test_xmlXPtrLocationSetMerge(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000047072 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047073
47074
47075 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000047076 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000047077}
47078
47079
47080static int
47081test_xmlXPtrLocationSetRemove(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000047082 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047083
Daniel Veillardce682bc2004-11-05 17:22:25 +000047084#ifdef LIBXML_XPTR_ENABLED
47085 int mem_base;
47086 xmlLocationSetPtr cur; /* the initial range set */
47087 int n_cur;
47088 int val; /* the index to remove */
47089 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047090
Daniel Veillardce682bc2004-11-05 17:22:25 +000047091 for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
47092 for (n_val = 0;n_val < gen_nb_int;n_val++) {
47093 mem_base = xmlMemBlocks();
47094 cur = gen_xmlLocationSetPtr(n_cur, 0);
47095 val = gen_int(n_val, 1);
47096
47097 xmlXPtrLocationSetRemove(cur, val);
47098 call_tests++;
47099 des_xmlLocationSetPtr(n_cur, cur, 0);
47100 des_int(n_val, val, 1);
47101 xmlResetLastError();
47102 if (mem_base != xmlMemBlocks()) {
47103 printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
47104 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000047105 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000047106 printf(" %d", n_cur);
47107 printf(" %d", n_val);
47108 printf("\n");
47109 }
47110 }
47111 }
47112#endif
47113
47114 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000047115 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000047116}
47117
47118
47119static int
47120test_xmlXPtrNewCollapsedRange(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000047121 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047122
Daniel Veillard3d97e662004-11-04 10:49:00 +000047123#ifdef LIBXML_XPTR_ENABLED
47124 int mem_base;
47125 xmlXPathObjectPtr ret_val;
47126 xmlNodePtr start; /* the starting and ending node */
47127 int n_start;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047128
Daniel Veillard3d97e662004-11-04 10:49:00 +000047129 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
47130 mem_base = xmlMemBlocks();
47131 start = gen_xmlNodePtr(n_start, 0);
47132
47133 ret_val = xmlXPtrNewCollapsedRange(start);
47134 desret_xmlXPathObjectPtr(ret_val);
47135 call_tests++;
47136 des_xmlNodePtr(n_start, start, 0);
47137 xmlResetLastError();
47138 if (mem_base != xmlMemBlocks()) {
47139 printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
47140 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000047141 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000047142 printf(" %d", n_start);
47143 printf("\n");
47144 }
47145 }
47146#endif
47147
47148 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000047149 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000047150}
47151
47152
47153static int
47154test_xmlXPtrNewContext(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000047155 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047156
47157
47158 /* missing type support */
Daniel Veillard42595322004-11-08 10:52:06 +000047159 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000047160}
47161
47162
47163static int
47164test_xmlXPtrNewLocationSetNodeSet(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000047165 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047166
Daniel Veillardce682bc2004-11-05 17:22:25 +000047167#ifdef LIBXML_XPTR_ENABLED
47168 int mem_base;
47169 xmlXPathObjectPtr ret_val;
47170 xmlNodeSetPtr set; /* a node set */
47171 int n_set;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047172
Daniel Veillardce682bc2004-11-05 17:22:25 +000047173 for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
47174 mem_base = xmlMemBlocks();
47175 set = gen_xmlNodeSetPtr(n_set, 0);
47176
47177 ret_val = xmlXPtrNewLocationSetNodeSet(set);
47178 desret_xmlXPathObjectPtr(ret_val);
47179 call_tests++;
47180 des_xmlNodeSetPtr(n_set, set, 0);
47181 xmlResetLastError();
47182 if (mem_base != xmlMemBlocks()) {
47183 printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
47184 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000047185 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000047186 printf(" %d", n_set);
47187 printf("\n");
47188 }
47189 }
47190#endif
47191
47192 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000047193 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000047194}
47195
47196
47197static int
47198test_xmlXPtrNewLocationSetNodes(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000047199 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047200
Daniel Veillard3d97e662004-11-04 10:49:00 +000047201#ifdef LIBXML_XPTR_ENABLED
47202 int mem_base;
47203 xmlXPathObjectPtr ret_val;
47204 xmlNodePtr start; /* the start NodePtr value */
47205 int n_start;
47206 xmlNodePtr end; /* the end NodePtr value or NULL */
47207 int n_end;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047208
Daniel Veillard3d97e662004-11-04 10:49:00 +000047209 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
47210 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
47211 mem_base = xmlMemBlocks();
47212 start = gen_xmlNodePtr(n_start, 0);
47213 end = gen_xmlNodePtr(n_end, 1);
47214
47215 ret_val = xmlXPtrNewLocationSetNodes(start, end);
47216 desret_xmlXPathObjectPtr(ret_val);
47217 call_tests++;
47218 des_xmlNodePtr(n_start, start, 0);
47219 des_xmlNodePtr(n_end, end, 1);
47220 xmlResetLastError();
47221 if (mem_base != xmlMemBlocks()) {
47222 printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
47223 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000047224 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000047225 printf(" %d", n_start);
47226 printf(" %d", n_end);
47227 printf("\n");
47228 }
47229 }
47230 }
47231#endif
47232
47233 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000047234 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000047235}
47236
47237
47238static int
47239test_xmlXPtrNewRange(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000047240 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047241
Daniel Veillard3d97e662004-11-04 10:49:00 +000047242#ifdef LIBXML_XPTR_ENABLED
47243 int mem_base;
47244 xmlXPathObjectPtr ret_val;
47245 xmlNodePtr start; /* the starting node */
47246 int n_start;
47247 int startindex; /* the start index */
47248 int n_startindex;
47249 xmlNodePtr end; /* the ending point */
47250 int n_end;
47251 int endindex; /* the ending index */
47252 int n_endindex;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047253
Daniel Veillard3d97e662004-11-04 10:49:00 +000047254 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
47255 for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
47256 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
47257 for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
47258 mem_base = xmlMemBlocks();
47259 start = gen_xmlNodePtr(n_start, 0);
47260 startindex = gen_int(n_startindex, 1);
47261 end = gen_xmlNodePtr(n_end, 2);
47262 endindex = gen_int(n_endindex, 3);
47263
47264 ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
47265 desret_xmlXPathObjectPtr(ret_val);
47266 call_tests++;
47267 des_xmlNodePtr(n_start, start, 0);
47268 des_int(n_startindex, startindex, 1);
47269 des_xmlNodePtr(n_end, end, 2);
47270 des_int(n_endindex, endindex, 3);
47271 xmlResetLastError();
47272 if (mem_base != xmlMemBlocks()) {
47273 printf("Leak of %d blocks found in xmlXPtrNewRange",
47274 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000047275 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000047276 printf(" %d", n_start);
47277 printf(" %d", n_startindex);
47278 printf(" %d", n_end);
47279 printf(" %d", n_endindex);
47280 printf("\n");
47281 }
47282 }
47283 }
47284 }
47285 }
47286#endif
47287
47288 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000047289 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000047290}
47291
47292
47293static int
47294test_xmlXPtrNewRangeNodeObject(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000047295 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047296
Daniel Veillard3d97e662004-11-04 10:49:00 +000047297#ifdef LIBXML_XPTR_ENABLED
47298 int mem_base;
47299 xmlXPathObjectPtr ret_val;
47300 xmlNodePtr start; /* the starting node */
47301 int n_start;
47302 xmlXPathObjectPtr end; /* the ending object */
47303 int n_end;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047304
Daniel Veillard3d97e662004-11-04 10:49:00 +000047305 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
47306 for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
47307 mem_base = xmlMemBlocks();
47308 start = gen_xmlNodePtr(n_start, 0);
47309 end = gen_xmlXPathObjectPtr(n_end, 1);
47310
47311 ret_val = xmlXPtrNewRangeNodeObject(start, end);
47312 desret_xmlXPathObjectPtr(ret_val);
47313 call_tests++;
47314 des_xmlNodePtr(n_start, start, 0);
47315 des_xmlXPathObjectPtr(n_end, end, 1);
47316 xmlResetLastError();
47317 if (mem_base != xmlMemBlocks()) {
47318 printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
47319 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000047320 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000047321 printf(" %d", n_start);
47322 printf(" %d", n_end);
47323 printf("\n");
47324 }
47325 }
47326 }
47327#endif
47328
47329 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000047330 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000047331}
47332
47333
47334static int
47335test_xmlXPtrNewRangeNodePoint(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000047336 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047337
Daniel Veillard3d97e662004-11-04 10:49:00 +000047338#ifdef LIBXML_XPTR_ENABLED
47339 int mem_base;
47340 xmlXPathObjectPtr ret_val;
47341 xmlNodePtr start; /* the starting node */
47342 int n_start;
47343 xmlXPathObjectPtr end; /* the ending point */
47344 int n_end;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047345
Daniel Veillard3d97e662004-11-04 10:49:00 +000047346 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
47347 for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
47348 mem_base = xmlMemBlocks();
47349 start = gen_xmlNodePtr(n_start, 0);
47350 end = gen_xmlXPathObjectPtr(n_end, 1);
47351
47352 ret_val = xmlXPtrNewRangeNodePoint(start, end);
47353 desret_xmlXPathObjectPtr(ret_val);
47354 call_tests++;
47355 des_xmlNodePtr(n_start, start, 0);
47356 des_xmlXPathObjectPtr(n_end, end, 1);
47357 xmlResetLastError();
47358 if (mem_base != xmlMemBlocks()) {
47359 printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
47360 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000047361 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000047362 printf(" %d", n_start);
47363 printf(" %d", n_end);
47364 printf("\n");
47365 }
47366 }
47367 }
47368#endif
47369
47370 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000047371 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000047372}
47373
47374
47375static int
47376test_xmlXPtrNewRangeNodes(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000047377 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047378
Daniel Veillard3d97e662004-11-04 10:49:00 +000047379#ifdef LIBXML_XPTR_ENABLED
47380 int mem_base;
47381 xmlXPathObjectPtr ret_val;
47382 xmlNodePtr start; /* the starting node */
47383 int n_start;
47384 xmlNodePtr end; /* the ending node */
47385 int n_end;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047386
Daniel Veillard3d97e662004-11-04 10:49:00 +000047387 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
47388 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
47389 mem_base = xmlMemBlocks();
47390 start = gen_xmlNodePtr(n_start, 0);
47391 end = gen_xmlNodePtr(n_end, 1);
47392
47393 ret_val = xmlXPtrNewRangeNodes(start, end);
47394 desret_xmlXPathObjectPtr(ret_val);
47395 call_tests++;
47396 des_xmlNodePtr(n_start, start, 0);
47397 des_xmlNodePtr(n_end, end, 1);
47398 xmlResetLastError();
47399 if (mem_base != xmlMemBlocks()) {
47400 printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
47401 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000047402 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000047403 printf(" %d", n_start);
47404 printf(" %d", n_end);
47405 printf("\n");
47406 }
47407 }
47408 }
47409#endif
47410
47411 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000047412 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000047413}
47414
47415
47416static int
47417test_xmlXPtrNewRangePointNode(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000047418 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047419
Daniel Veillard3d97e662004-11-04 10:49:00 +000047420#ifdef LIBXML_XPTR_ENABLED
47421 int mem_base;
47422 xmlXPathObjectPtr ret_val;
47423 xmlXPathObjectPtr start; /* the starting point */
47424 int n_start;
47425 xmlNodePtr end; /* the ending node */
47426 int n_end;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047427
Daniel Veillard3d97e662004-11-04 10:49:00 +000047428 for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
47429 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
47430 mem_base = xmlMemBlocks();
47431 start = gen_xmlXPathObjectPtr(n_start, 0);
47432 end = gen_xmlNodePtr(n_end, 1);
47433
47434 ret_val = xmlXPtrNewRangePointNode(start, end);
47435 desret_xmlXPathObjectPtr(ret_val);
47436 call_tests++;
47437 des_xmlXPathObjectPtr(n_start, start, 0);
47438 des_xmlNodePtr(n_end, end, 1);
47439 xmlResetLastError();
47440 if (mem_base != xmlMemBlocks()) {
47441 printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
47442 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000047443 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000047444 printf(" %d", n_start);
47445 printf(" %d", n_end);
47446 printf("\n");
47447 }
47448 }
47449 }
47450#endif
47451
47452 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000047453 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000047454}
47455
47456
47457static int
47458test_xmlXPtrNewRangePoints(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000047459 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047460
Daniel Veillard3d97e662004-11-04 10:49:00 +000047461#ifdef LIBXML_XPTR_ENABLED
47462 int mem_base;
47463 xmlXPathObjectPtr ret_val;
47464 xmlXPathObjectPtr start; /* the starting point */
47465 int n_start;
47466 xmlXPathObjectPtr end; /* the ending point */
47467 int n_end;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047468
Daniel Veillard3d97e662004-11-04 10:49:00 +000047469 for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
47470 for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
47471 mem_base = xmlMemBlocks();
47472 start = gen_xmlXPathObjectPtr(n_start, 0);
47473 end = gen_xmlXPathObjectPtr(n_end, 1);
47474
47475 ret_val = xmlXPtrNewRangePoints(start, end);
47476 desret_xmlXPathObjectPtr(ret_val);
47477 call_tests++;
47478 des_xmlXPathObjectPtr(n_start, start, 0);
47479 des_xmlXPathObjectPtr(n_end, end, 1);
47480 xmlResetLastError();
47481 if (mem_base != xmlMemBlocks()) {
47482 printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
47483 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000047484 test_ret++;
Daniel Veillard3d97e662004-11-04 10:49:00 +000047485 printf(" %d", n_start);
47486 printf(" %d", n_end);
47487 printf("\n");
47488 }
47489 }
47490 }
47491#endif
47492
47493 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000047494 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000047495}
47496
47497
47498static int
47499test_xmlXPtrRangeToFunction(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000047500 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047501
Daniel Veillardce682bc2004-11-05 17:22:25 +000047502#ifdef LIBXML_XPTR_ENABLED
47503 int mem_base;
47504 xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
47505 int n_ctxt;
47506 int nargs; /* the number of args */
47507 int n_nargs;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047508
Daniel Veillardce682bc2004-11-05 17:22:25 +000047509 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47510 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47511 mem_base = xmlMemBlocks();
47512 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47513 nargs = gen_int(n_nargs, 1);
47514
47515 xmlXPtrRangeToFunction(ctxt, nargs);
47516 call_tests++;
47517 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47518 des_int(n_nargs, nargs, 1);
47519 xmlResetLastError();
47520 if (mem_base != xmlMemBlocks()) {
47521 printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
47522 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000047523 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000047524 printf(" %d", n_ctxt);
47525 printf(" %d", n_nargs);
47526 printf("\n");
47527 }
47528 }
47529 }
47530#endif
47531
47532 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000047533 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000047534}
47535
47536
47537static int
47538test_xmlXPtrWrapLocationSet(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000047539 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047540
Daniel Veillardce682bc2004-11-05 17:22:25 +000047541#ifdef LIBXML_XPTR_ENABLED
47542 int mem_base;
47543 xmlXPathObjectPtr ret_val;
47544 xmlLocationSetPtr val; /* the LocationSet value */
47545 int n_val;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047546
Daniel Veillardce682bc2004-11-05 17:22:25 +000047547 for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
47548 mem_base = xmlMemBlocks();
47549 val = gen_xmlLocationSetPtr(n_val, 0);
47550
47551 ret_val = xmlXPtrWrapLocationSet(val);
47552 desret_xmlXPathObjectPtr(ret_val);
47553 call_tests++;
47554 des_xmlLocationSetPtr(n_val, val, 0);
47555 xmlResetLastError();
47556 if (mem_base != xmlMemBlocks()) {
47557 printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
47558 xmlMemBlocks() - mem_base);
Daniel Veillard42595322004-11-08 10:52:06 +000047559 test_ret++;
Daniel Veillardce682bc2004-11-05 17:22:25 +000047560 printf(" %d", n_val);
47561 printf("\n");
47562 }
47563 }
47564#endif
47565
47566 function_tests++;
Daniel Veillard42595322004-11-08 10:52:06 +000047567 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000047568}
47569
47570static int
47571test_xpointer(void) {
Daniel Veillard42595322004-11-08 10:52:06 +000047572 int test_ret = 0;
Daniel Veillardd93f6252004-11-02 15:53:51 +000047573
Daniel Veillardce682bc2004-11-05 17:22:25 +000047574 printf("Testing xpointer : 17 of 21 functions ...\n");
Daniel Veillard42595322004-11-08 10:52:06 +000047575 test_ret += test_xmlXPtrBuildNodeList();
47576 test_ret += test_xmlXPtrEval();
47577 test_ret += test_xmlXPtrEvalRangePredicate();
47578 test_ret += test_xmlXPtrLocationSetAdd();
47579 test_ret += test_xmlXPtrLocationSetCreate();
47580 test_ret += test_xmlXPtrLocationSetDel();
47581 test_ret += test_xmlXPtrLocationSetMerge();
47582 test_ret += test_xmlXPtrLocationSetRemove();
47583 test_ret += test_xmlXPtrNewCollapsedRange();
47584 test_ret += test_xmlXPtrNewContext();
47585 test_ret += test_xmlXPtrNewLocationSetNodeSet();
47586 test_ret += test_xmlXPtrNewLocationSetNodes();
47587 test_ret += test_xmlXPtrNewRange();
47588 test_ret += test_xmlXPtrNewRangeNodeObject();
47589 test_ret += test_xmlXPtrNewRangeNodePoint();
47590 test_ret += test_xmlXPtrNewRangeNodes();
47591 test_ret += test_xmlXPtrNewRangePointNode();
47592 test_ret += test_xmlXPtrNewRangePoints();
47593 test_ret += test_xmlXPtrRangeToFunction();
47594 test_ret += test_xmlXPtrWrapLocationSet();
Daniel Veillardd93f6252004-11-02 15:53:51 +000047595
Daniel Veillard42595322004-11-08 10:52:06 +000047596 if (test_ret != 0)
47597 printf("Module xpointer: %d errors\n", test_ret);
47598 return(test_ret);
Daniel Veillardd93f6252004-11-02 15:53:51 +000047599}
Daniel Veillardce244ad2004-11-05 10:03:46 +000047600static int
47601test_module(const char *module) {
47602 if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
47603 if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
Daniel Veillard2a4fb5a2004-11-08 14:02:18 +000047604 if (!strcmp(module, "SAX2")) return(test_SAX2());
Daniel Veillarda82b1822004-11-08 16:24:57 +000047605 if (!strcmp(module, "c14n")) return(test_c14n());
Daniel Veillardce244ad2004-11-05 10:03:46 +000047606 if (!strcmp(module, "catalog")) return(test_catalog());
47607 if (!strcmp(module, "chvalid")) return(test_chvalid());
Daniel Veillarda82b1822004-11-08 16:24:57 +000047608 if (!strcmp(module, "debugXML")) return(test_debugXML());
Daniel Veillardce244ad2004-11-05 10:03:46 +000047609 if (!strcmp(module, "dict")) return(test_dict());
47610 if (!strcmp(module, "encoding")) return(test_encoding());
47611 if (!strcmp(module, "entities")) return(test_entities());
47612 if (!strcmp(module, "hash")) return(test_hash());
47613 if (!strcmp(module, "list")) return(test_list());
47614 if (!strcmp(module, "nanoftp")) return(test_nanoftp());
47615 if (!strcmp(module, "nanohttp")) return(test_nanohttp());
47616 if (!strcmp(module, "parser")) return(test_parser());
Daniel Veillard2a4fb5a2004-11-08 14:02:18 +000047617 if (!strcmp(module, "parserInternals")) return(test_parserInternals());
Daniel Veillardce244ad2004-11-05 10:03:46 +000047618 if (!strcmp(module, "pattern")) return(test_pattern());
47619 if (!strcmp(module, "relaxng")) return(test_relaxng());
47620 if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
47621 if (!strcmp(module, "tree")) return(test_tree());
47622 if (!strcmp(module, "uri")) return(test_uri());
47623 if (!strcmp(module, "valid")) return(test_valid());
47624 if (!strcmp(module, "xinclude")) return(test_xinclude());
47625 if (!strcmp(module, "xmlIO")) return(test_xmlIO());
Daniel Veillarda82b1822004-11-08 16:24:57 +000047626 if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
Daniel Veillardce244ad2004-11-05 10:03:46 +000047627 if (!strcmp(module, "xmlerror")) return(test_xmlerror());
47628 if (!strcmp(module, "xmlreader")) return(test_xmlreader());
Daniel Veillarda82b1822004-11-08 16:24:57 +000047629 if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
Daniel Veillardce244ad2004-11-05 10:03:46 +000047630 if (!strcmp(module, "xmlsave")) return(test_xmlsave());
47631 if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
47632 if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
47633 if (!strcmp(module, "xmlstring")) return(test_xmlstring());
Daniel Veillard0ea9c9f2004-11-05 14:30:41 +000047634 if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
Daniel Veillardce244ad2004-11-05 10:03:46 +000047635 if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
47636 if (!strcmp(module, "xpath")) return(test_xpath());
Daniel Veillarda82b1822004-11-08 16:24:57 +000047637 if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
Daniel Veillardce244ad2004-11-05 10:03:46 +000047638 if (!strcmp(module, "xpointer")) return(test_xpointer());
47639 return(0);
47640}