Imported Upstream version 2.9.5
[platform/upstream/libxml2.git] / testapi.c
1 /*
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 "libxml.h"
12 #include <stdio.h>
13
14 #include <stdlib.h> /* for putenv() */
15 #include <string.h>
16 #include <libxml/xmlerror.h>
17 #include <libxml/relaxng.h>
18
19
20 static int testlibxml2(void);
21 static int test_module(const char *module);
22
23 static int generic_errors = 0;
24 static int call_tests = 0;
25 static int function_tests = 0;
26
27 static xmlChar chartab[1024];
28 static int inttab[1024];
29 static unsigned long longtab[1024];
30
31 static xmlDocPtr api_doc = NULL;
32 static xmlDtdPtr api_dtd = NULL;
33 static xmlNodePtr api_root = NULL;
34 static xmlAttrPtr api_attr = NULL;
35 static xmlNsPtr api_ns = NULL;
36
37 static void
38 structured_errors(void *userData ATTRIBUTE_UNUSED,
39                   xmlErrorPtr error ATTRIBUTE_UNUSED) {
40     generic_errors++;
41 }
42
43 static void
44 free_api_doc(void) {
45     xmlFreeDoc(api_doc);
46     api_doc = NULL;
47     api_dtd = NULL;
48     api_root = NULL;
49     api_attr = NULL;
50     api_ns = NULL;
51 }
52
53 static xmlDocPtr
54 get_api_doc(void) {
55     if (api_doc == NULL) {
56         api_doc = xmlReadMemory("<!DOCTYPE root [<!ELEMENT root EMPTY>]><root xmlns:h='http://example.com/' h:foo='bar'/>", 88, "root_test", NULL, 0);
57         api_root = NULL;
58         api_attr = NULL;
59     }
60     return(api_doc);
61 }
62
63 static xmlDtdPtr
64 get_api_dtd(void) {
65     if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) {
66         get_api_doc();
67         if ((api_doc != NULL) && (api_doc->children != NULL) &&
68             (api_doc->children->type == XML_DTD_NODE))
69             api_dtd = (xmlDtdPtr) api_doc->children;
70     }
71     return(api_dtd);
72 }
73
74 static xmlNodePtr
75 get_api_root(void) {
76     if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
77         get_api_doc();
78         if ((api_doc != NULL) && (api_doc->children != NULL) &&
79             (api_doc->children->next != NULL) &&
80             (api_doc->children->next->type == XML_ELEMENT_NODE))
81             api_root = api_doc->children->next;
82     }
83     return(api_root);
84 }
85
86 static xmlNsPtr
87 get_api_ns(void) {
88     get_api_root();
89     if (api_root != NULL)
90         api_ns = api_root->nsDef;
91     return(api_ns);
92 }
93
94 static xmlAttrPtr
95 get_api_attr(void) {
96 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
97     static int nr = 0;
98     xmlChar name[20];
99 #endif
100
101     if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
102         get_api_root();
103     }
104     if (api_root == NULL)
105         return(NULL);
106     if (api_root->properties != NULL) {
107         api_attr = api_root->properties;
108         return(api_root->properties);
109     }
110     api_attr = NULL;
111 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
112     snprintf((char *) name, 20, "foo%d", nr++);
113     api_attr = xmlSetProp(api_root, name, (const xmlChar *) "bar");
114 #endif
115     return(api_attr);
116 }
117
118 static int quiet = 0;
119
120 int main(int argc, char **argv) {
121     int ret;
122     int blocks, mem;
123
124 #ifdef HAVE_PUTENV
125     /* access to the proxy can slow up regression tests a lot */
126     putenv((char *) "http_proxy=");
127 #endif
128
129     memset(chartab, 0, sizeof(chartab));
130     strncpy((char *) chartab, "  chartab\n", 20);
131     memset(inttab, 0, sizeof(inttab));
132     memset(longtab, 0, sizeof(longtab));
133
134     xmlInitParser();
135 #ifdef LIBXML_SCHEMAS_ENABLED
136     xmlRelaxNGInitTypes();
137 #endif
138
139     LIBXML_TEST_VERSION
140
141     xmlSetStructuredErrorFunc(NULL, structured_errors);
142
143     if (argc >= 2) {
144         if (!strcmp(argv[1], "-q")) {
145             quiet = 1;
146             if (argc >= 3)
147                 ret = test_module(argv[2]);
148             else
149                 ret = testlibxml2();
150         } else {
151            ret = test_module(argv[1]);
152         }
153     } else
154         ret = testlibxml2();
155
156     xmlCleanupParser();
157     blocks = xmlMemBlocks();
158     mem = xmlMemUsed();
159     if ((blocks != 0) || (mem != 0)) {
160         printf("testapi leaked %d bytes in %d blocks\n", mem, blocks);
161     }
162     xmlMemoryDump();
163
164     return (ret != 0);
165 }
166
167 #include <libxml/HTMLparser.h>
168 #include <libxml/HTMLtree.h>
169 #include <libxml/catalog.h>
170 #include <libxml/chvalid.h>
171 #include <libxml/dict.h>
172 #include <libxml/encoding.h>
173 #include <libxml/entities.h>
174 #include <libxml/hash.h>
175 #include <libxml/list.h>
176 #include <libxml/nanoftp.h>
177 #include <libxml/nanohttp.h>
178 #include <libxml/parser.h>
179 #include <libxml/parserInternals.h>
180 #include <libxml/pattern.h>
181 #include <libxml/relaxng.h>
182 #include <libxml/schemasInternals.h>
183 #include <libxml/schematron.h>
184 #include <libxml/tree.h>
185 #include <libxml/uri.h>
186 #include <libxml/valid.h>
187 #include <libxml/xinclude.h>
188 #include <libxml/xmlIO.h>
189 #include <libxml/xmlerror.h>
190 #include <libxml/xmlreader.h>
191 #include <libxml/xmlsave.h>
192 #include <libxml/xmlschemas.h>
193 #include <libxml/xmlschemastypes.h>
194 #include <libxml/xmlstring.h>
195 #include <libxml/xmlwriter.h>
196 #include <libxml/xpath.h>
197 #include <libxml/xpointer.h>
198 #include <libxml/debugXML.h>
199
200 /*
201   We manually define xmlErrMemory because it's normal declaration
202   is "hidden" by #ifdef IN_LIBXML
203 */
204 void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra);
205
206 /*
207  We need some "remote" addresses, but want to avoid getting into
208  name resolution delays, so we use these
209 */
210 #define REMOTE1GOOD     "http://localhost/"
211 #define REMOTE1BAD      "http:http://http"
212 #define REMOTE2GOOD     "ftp://localhost/foo"
213
214 #define gen_nb_void_ptr 2
215
216 static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
217     return(NULL);
218 }
219 static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
220 }
221
222 #if 0
223 #define gen_nb_const_void_ptr 2
224
225 static const void *gen_const_void_ptr(int no, int nr ATTRIBUTE_UNUSED) {
226     if (no == 0) return((const void *) "immutable string");
227     return(NULL);
228 }
229 static void des_const_void_ptr(int no ATTRIBUTE_UNUSED, const void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
230 }
231 #endif
232
233 #define gen_nb_userdata 3
234
235 static void *gen_userdata(int no, int nr ATTRIBUTE_UNUSED) {
236     if (no == 0) return((void *) &call_tests);
237     if (no == 1) return((void *) -1);
238     return(NULL);
239 }
240 static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
241 }
242
243
244 #define gen_nb_int 4
245
246 static int gen_int(int no, int nr ATTRIBUTE_UNUSED) {
247     if (no == 0) return(0);
248     if (no == 1) return(1);
249     if (no == 2) return(-1);
250     if (no == 3) return(122);
251     return(-1);
252 }
253
254 static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
255 }
256
257 #define gen_nb_parseroptions 5
258
259 static int gen_parseroptions(int no, int nr ATTRIBUTE_UNUSED) {
260     if (no == 0) return(XML_PARSE_NOBLANKS | XML_PARSE_RECOVER);
261     if (no == 1) return(XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_DTDVALID | XML_PARSE_NOCDATA);
262     if (no == 2) return(XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE | XML_PARSE_NSCLEAN);
263     if (no == 3) return(XML_PARSE_XINCLUDE | XML_PARSE_NODICT);
264     return(XML_PARSE_SAX1);
265 }
266
267 static void des_parseroptions(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
268 }
269
270 #if 0
271 #define gen_nb_long 5
272
273 static long gen_long(int no, int nr ATTRIBUTE_UNUSED) {
274     if (no == 0) return(0);
275     if (no == 1) return(1);
276     if (no == 2) return(-1);
277     if (no == 3) return(122);
278     return(-1);
279 }
280
281 static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
282 }
283 #endif
284
285 #define gen_nb_xmlChar 4
286
287 static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) {
288     if (no == 0) return('a');
289     if (no == 1) return(' ');
290     if (no == 2) return((xmlChar) '\xf8');
291     return(0);
292 }
293
294 static void des_xmlChar(int no ATTRIBUTE_UNUSED, xmlChar val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
295 }
296
297 #define gen_nb_unsigned_int 3
298
299 static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) {
300     if (no == 0) return(0);
301     if (no == 1) return(1);
302     if (no == 2) return(122);
303     return((unsigned int) -1);
304 }
305
306 static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
307 }
308
309 #define gen_nb_unsigned_long 4
310
311 static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) {
312     if (no == 0) return(0);
313     if (no == 1) return(1);
314     if (no == 2) return(122);
315     return((unsigned long) -1);
316 }
317
318 static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
319 }
320
321 #define gen_nb_double 4
322
323 static double gen_double(int no, int nr ATTRIBUTE_UNUSED) {
324     if (no == 0) return(0);
325     if (no == 1) return(-1.1);
326 #if defined(LIBXML_XPATH_ENABLED)
327     if (no == 2) return(xmlXPathNAN);
328 #endif
329     return(-1);
330 }
331
332 static void des_double(int no ATTRIBUTE_UNUSED, double val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
333 }
334
335 #define gen_nb_unsigned_long_ptr 2
336
337 static unsigned long *gen_unsigned_long_ptr(int no, int nr) {
338     if (no == 0) return(&longtab[nr]);
339     return(NULL);
340 }
341
342 static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
343 }
344
345 #define gen_nb_int_ptr 2
346
347 static int *gen_int_ptr(int no, int nr) {
348     if (no == 0) return(&inttab[nr]);
349     return(NULL);
350 }
351
352 static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
353 }
354
355 #define gen_nb_const_char_ptr 4
356
357 static char *gen_const_char_ptr(int no, int nr ATTRIBUTE_UNUSED) {
358     if (no == 0) return((char *) "foo");
359     if (no == 1) return((char *) "<foo/>");
360     if (no == 2) return((char *) "test/ent2");
361     return(NULL);
362 }
363 static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
364 }
365
366 #define gen_nb_xmlChar_ptr 2
367
368 static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
369     if (no == 0) return(&chartab[0]);
370     return(NULL);
371 }
372 static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
373 }
374
375 #define gen_nb_FILE_ptr 2
376
377 static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) {
378     if (no == 0) return(fopen("test.out", "a+"));
379     return(NULL);
380 }
381 static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
382     if (val != NULL) fclose(val);
383 }
384
385 #define gen_nb_debug_FILE_ptr 2
386 static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
387     return(fopen("test.out", "a+"));
388 }
389 static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
390     if (val != NULL) fclose(val);
391 }
392
393 #define gen_nb_const_xmlChar_ptr 5
394
395 static xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
396     if (no == 0) return((xmlChar *) "foo");
397     if (no == 1) return((xmlChar *) "<foo/>");
398     if (no == 2) return((xmlChar *) "n" "\xf8" "ne");
399     if (no == 3) return((xmlChar *) " 2ab ");
400     return(NULL);
401 }
402 static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
403 }
404
405 #define gen_nb_filepath 8
406
407 static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) {
408     if (no == 0) return("missing.xml");
409     if (no == 1) return("<foo/>");
410     if (no == 2) return("test/ent2");
411     if (no == 3) return("test/valid/REC-xml-19980210.xml");
412     if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd");
413     if (no == 5) return(REMOTE1GOOD);
414     if (no == 6) return(REMOTE1BAD);
415     return(NULL);
416 }
417 static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
418 }
419
420 #define gen_nb_eaten_name 2
421
422 static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) {
423     if (no == 0) return(xmlStrdup(BAD_CAST "eaten"));
424     return(NULL);
425 }
426 static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
427 }
428
429 #define gen_nb_fileoutput 6
430
431 static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) {
432     if (no == 0) return("/missing.xml");
433     if (no == 1) return("<foo/>");
434     if (no == 2) return(REMOTE2GOOD);
435     if (no == 3) return(REMOTE1GOOD);
436     if (no == 4) return(REMOTE1BAD);
437     return(NULL);
438 }
439 static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
440 }
441
442 #define gen_nb_xmlParserCtxtPtr 3
443 static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
444     if (no == 0) return(xmlNewParserCtxt());
445     if (no == 1) return(xmlCreateMemoryParserCtxt("<doc/>", 6));
446     return(NULL);
447 }
448 static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
449     if (val != NULL)
450         xmlFreeParserCtxt(val);
451 }
452
453 #define gen_nb_xmlSAXHandlerPtr 2
454 static xmlSAXHandlerPtr gen_xmlSAXHandlerPtr(int no, int nr ATTRIBUTE_UNUSED) {
455 #ifdef LIBXML_SAX1_ENABLED
456     if (no == 0) return((xmlSAXHandlerPtr) &xmlDefaultSAXHandler);
457 #endif
458     return(NULL);
459 }
460 static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
461 }
462
463 #define gen_nb_xmlValidCtxtPtr 2
464 static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
465 #ifdef LIBXML_VALID_ENABLED
466     if (no == 0) return(xmlNewValidCtxt());
467 #endif
468     return(NULL);
469 }
470 static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
471 #ifdef LIBXML_VALID_ENABLED
472     if (val != NULL)
473         xmlFreeValidCtxt(val);
474 #endif
475 }
476
477 #define gen_nb_xmlParserInputBufferPtr 8
478
479 static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
480     if (no == 0) return(xmlParserInputBufferCreateFilename("missing.xml", XML_CHAR_ENCODING_NONE));
481     if (no == 1) return(xmlParserInputBufferCreateFilename("<foo/>", XML_CHAR_ENCODING_NONE));
482     if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE));
483     if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE));
484     if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE));
485     if (no == 5) return(xmlParserInputBufferCreateFilename(REMOTE1GOOD, XML_CHAR_ENCODING_NONE));
486     if (no == 6) return(xmlParserInputBufferCreateFilename(REMOTE1BAD, XML_CHAR_ENCODING_NONE));
487     return(NULL);
488 }
489 static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
490     xmlFreeParserInputBuffer(val);
491 }
492
493 #define gen_nb_xmlDocPtr 4
494 static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) {
495     if (no == 0) return(xmlNewDoc(BAD_CAST "1.0"));
496     if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0));
497     if (no == 2) return(xmlReadMemory("<!DOCTYPE foo []> <foo/>", 24, "test", NULL, 0));
498     return(NULL);
499 }
500 static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) {
501     if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
502         xmlFreeDoc(val);
503 }
504
505 #define gen_nb_xmlAttrPtr 2
506 static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) {
507     if (no == 0) return(get_api_attr());
508     return(NULL);
509 }
510 static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
511     if (no == 0) free_api_doc();
512 }
513
514 #define gen_nb_xmlDictPtr 2
515 static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) {
516     if (no == 0) return(xmlDictCreate());
517     return(NULL);
518 }
519 static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) {
520     if (val != NULL)
521         xmlDictFree(val);
522 }
523
524 #define gen_nb_xmlNodePtr 3
525 static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) {
526     if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
527     if (no == 1) return(get_api_root());
528     return(NULL);
529 /*     if (no == 2) return((xmlNodePtr) get_api_doc()); */
530 }
531 static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) {
532     if (no == 1) {
533         free_api_doc();
534     } else if (val != NULL) {
535         xmlUnlinkNode(val);
536         xmlFreeNode(val);
537     }
538 }
539
540 #define gen_nb_xmlDtdPtr 3
541 static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) {
542     if (no == 0)
543         return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar"));
544     if (no == 1) return(get_api_dtd());
545     return(NULL);
546 }
547 static void des_xmlDtdPtr(int no, xmlDtdPtr val, int nr ATTRIBUTE_UNUSED) {
548     if (no == 1) free_api_doc();
549     else if (val != NULL) {
550         xmlUnlinkNode((xmlNodePtr) val);
551         xmlFreeNode((xmlNodePtr) val);
552     }
553 }
554
555 #define gen_nb_xmlNsPtr 2
556 static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) {
557     if (no == 0) return(get_api_ns());
558     return(NULL);
559 }
560 static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
561     if (no == 0) free_api_doc();
562 }
563
564 #define gen_nb_xmlNodePtr_in 3
565 static xmlNodePtr gen_xmlNodePtr_in(int no, int nr ATTRIBUTE_UNUSED) {
566     if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
567     if (no == 0) return(xmlNewText(BAD_CAST "text"));
568     return(NULL);
569 }
570 static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
571 }
572
573 #ifdef LIBXML_WRITER_ENABLED
574 #define gen_nb_xmlTextWriterPtr 2
575 static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) {
576     if (no == 0) return(xmlNewTextWriterFilename("test.out", 0));
577     return(NULL);
578 }
579 static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) {
580     if (val != NULL) xmlFreeTextWriter(val);
581 }
582 #endif
583
584 #ifdef LIBXML_READER_ENABLED
585 #define gen_nb_xmlTextReaderPtr 4
586 static xmlTextReaderPtr gen_xmlTextReaderPtr(int no, int nr ATTRIBUTE_UNUSED) {
587     if (no == 0) return(xmlNewTextReaderFilename("test/ent2"));
588     if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml"));
589     if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd"));
590     return(NULL);
591 }
592 static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) {
593     if (val != NULL) xmlFreeTextReader(val);
594 }
595 #endif
596
597 #define gen_nb_xmlBufferPtr 3
598 static const xmlChar *static_buf_content = (xmlChar *)"a static buffer";
599 static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
600     if (no == 0) return(xmlBufferCreate());
601     if (no == 1) return(xmlBufferCreateStatic((void *)static_buf_content, 13));
602     return(NULL);
603 }
604 static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) {
605     if (val != NULL) {
606         xmlBufferFree(val);
607     }
608 }
609
610 #define gen_nb_xmlListPtr 2
611 static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) {
612     if (no == 0) return(xmlListCreate(NULL, NULL));
613     return(NULL);
614 }
615 static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) {
616     if (val != NULL) {
617         xmlListDelete(val);
618     }
619 }
620
621 #define gen_nb_xmlHashTablePtr 2
622 static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
623     if (no == 0) return(xmlHashCreate(10));
624     return(NULL);
625 }
626 static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) {
627     if (val != NULL) {
628         xmlHashFree(val, NULL);
629     }
630 }
631
632 #include <libxml/xpathInternals.h>
633
634 #ifdef LIBXML_XPATH_ENABLED
635 #define gen_nb_xmlXPathObjectPtr 5
636 static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) {
637     if (no == 0) return(xmlXPathNewString(BAD_CAST "string object"));
638     if (no == 1) return(xmlXPathNewFloat(1.1));
639     if (no == 2) return(xmlXPathNewBoolean(1));
640     if (no == 3) return(xmlXPathNewNodeSet(NULL));
641     return(NULL);
642 }
643 static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) {
644     if (val != NULL) {
645         xmlXPathFreeObject(val);
646     }
647 }
648 #endif
649
650 #ifdef LIBXML_OUTPUT_ENABLED
651 #define gen_nb_xmlOutputBufferPtr 2
652 static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
653     if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0));
654     return(NULL);
655 }
656 static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
657     if (val != NULL) {
658         xmlOutputBufferClose(val);
659     }
660 }
661 #endif
662
663 #ifdef LIBXML_FTP_ENABLED
664 #define gen_nb_xmlNanoFTPCtxtPtr 4
665 static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
666     if (no == 0) return(xmlNanoFTPNewCtxt(REMOTE2GOOD));
667     if (no == 1) return(xmlNanoFTPNewCtxt(REMOTE1GOOD));
668     if (no == 2) return(xmlNanoFTPNewCtxt("foo"));
669     return(NULL);
670 }
671 static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
672     if (val != NULL) {
673         xmlNanoFTPFreeCtxt(val);
674     }
675 }
676 #endif
677
678 #ifdef LIBXML_HTTP_ENABLED
679 #define gen_nb_xmlNanoHTTPCtxtPtr 1
680 static void *gen_xmlNanoHTTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
681     if (no == 0) return(xmlNanoHTTPOpen(REMOTE1GOOD, NULL));
682     if (no == 1) return(xmlNanoHTTPOpen(REMOTE2GOOD, NULL));
683     if (no == 2) return(xmlNanoHTTPOpen(REMOTE1BAD, NULL));
684     return(NULL);
685 }
686 static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
687     if (val != NULL) {
688         xmlNanoHTTPClose(val);
689     }
690 }
691 #endif
692
693 #define gen_nb_xmlCharEncoding 4
694 static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) {
695     if (no == 0) return(XML_CHAR_ENCODING_UTF8);
696     if (no == 1) return(XML_CHAR_ENCODING_NONE);
697     if (no == 2) return(XML_CHAR_ENCODING_8859_1);
698     return(XML_CHAR_ENCODING_ERROR);
699 }
700 static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
701 }
702
703 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
704
705 #define gen_nb_xmlExpCtxtPtr 1
706 static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
707     return(NULL);
708 }
709 static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
710 }
711
712 #define gen_nb_xmlExpNodePtr 1
713 static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
714     return(NULL);
715 }
716 static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
717 }
718
719 #endif
720
721 #if defined(LIBXML_SCHEMAS_ENABLED)
722 #define gen_nb_xmlSchemaPtr 1
723 static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
724     return(NULL);
725 }
726 static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
727 }
728
729 #define gen_nb_xmlSchemaValidCtxtPtr 1
730 static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
731     return(NULL);
732 }
733 static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
734 }
735
736 #endif /* LIBXML_SCHEMAS_ENABLED */
737
738 #define gen_nb_xmlHashDeallocator 2
739 static void
740 test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) {
741 }
742
743 static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) {
744     if (no == 0) return(test_xmlHashDeallocator);
745     return(NULL);
746 }
747 static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
748 }
749
750
751 static void desret_int(int val ATTRIBUTE_UNUSED) {
752 }
753 static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) {
754 }
755 static void desret_long(long val ATTRIBUTE_UNUSED) {
756 }
757 static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) {
758 }
759 static void desret_double(double val ATTRIBUTE_UNUSED) {
760 }
761 static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) {
762 }
763 #if 0
764 static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) {
765 }
766 #endif
767 static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
768 }
769 static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
770 }
771 static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
772 }
773 static void desret_xmlChar_ptr(xmlChar *val) {
774     if (val != NULL)
775         xmlFree(val);
776 }
777 static void desret_xmlDocPtr(xmlDocPtr val) {
778     if (val != api_doc)
779         xmlFreeDoc(val);
780 }
781 static void desret_xmlDictPtr(xmlDictPtr val) {
782     xmlDictFree(val);
783 }
784 #ifdef LIBXML_OUTPUT_ENABLED
785 static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) {
786     xmlOutputBufferClose(val);
787 }
788 #endif
789 #ifdef LIBXML_READER_ENABLED
790 static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
791     xmlFreeTextReader(val);
792 }
793 #endif
794 static void desret_xmlNodePtr(xmlNodePtr val) {
795     if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) {
796         xmlUnlinkNode(val);
797         xmlFreeNode(val);
798     }
799 }
800 static void desret_xmlAttrPtr(xmlAttrPtr val) {
801     if (val != NULL) {
802         xmlUnlinkNode((xmlNodePtr) val);
803         xmlFreeNode((xmlNodePtr) val);
804     }
805 }
806 static void desret_xmlEntityPtr(xmlEntityPtr val) {
807     if (val != NULL) {
808         xmlUnlinkNode((xmlNodePtr) val);
809         xmlFreeNode((xmlNodePtr) val);
810     }
811 }
812 static void desret_xmlElementPtr(xmlElementPtr val) {
813     if (val != NULL) {
814         xmlUnlinkNode((xmlNodePtr) val);
815     }
816 }
817 static void desret_xmlAttributePtr(xmlAttributePtr val) {
818     if (val != NULL) {
819         xmlUnlinkNode((xmlNodePtr) val);
820     }
821 }
822 static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) {
823 }
824 static void desret_xmlDtdPtr(xmlDtdPtr val) {
825     desret_xmlNodePtr((xmlNodePtr)val);
826 }
827 #ifdef LIBXML_XPATH_ENABLED
828 static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
829     xmlXPathFreeObject(val);
830 }
831 static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) {
832     xmlXPathFreeNodeSet(val);
833 }
834 #endif
835 static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
836     xmlFreeParserCtxt(val);
837 }
838 static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) {
839     xmlFreeParserInputBuffer(val);
840 }
841 static void desret_xmlParserInputPtr(xmlParserInputPtr val) {
842     xmlFreeInputStream(val);
843 }
844 #ifdef LIBXML_WRITER_ENABLED
845 static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) {
846     xmlFreeTextWriter(val);
847 }
848 #endif
849 static void desret_xmlBufferPtr(xmlBufferPtr val) {
850     xmlBufferFree(val);
851 }
852 #ifdef LIBXML_SCHEMAS_ENABLED
853 static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) {
854     xmlSchemaFreeParserCtxt(val);
855 }
856 static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) {
857 }
858 static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) {
859     xmlRelaxNGFreeParserCtxt(val);
860 }
861 #endif
862 #ifdef LIBXML_HTML_ENABLED
863 static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) {
864 }
865 #endif
866 #ifdef LIBXML_HTTP_ENABLED
867 static void desret_xmlNanoHTTPCtxtPtr(void *val) {
868     xmlNanoHTTPClose(val);
869 }
870 #endif
871 #ifdef LIBXML_FTP_ENABLED
872 static void desret_xmlNanoFTPCtxtPtr(void *val) {
873     xmlNanoFTPClose(val);
874 }
875 #endif
876 /* cut and pasted from autogenerated to avoid troubles */
877 #define gen_nb_const_xmlChar_ptr_ptr 1
878 static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
879     return(NULL);
880 }
881 static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
882 }
883
884 #define gen_nb_unsigned_char_ptr 1
885 static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
886     return(NULL);
887 }
888 static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
889 }
890
891 #define gen_nb_const_unsigned_char_ptr 1
892 static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
893     return(NULL);
894 }
895 static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
896 }
897
898 #ifdef LIBXML_HTML_ENABLED
899 #define gen_nb_const_htmlNodePtr 1
900 static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
901     return(NULL);
902 }
903 static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
904 }
905 #endif
906
907 #ifdef LIBXML_HTML_ENABLED
908 #define gen_nb_htmlDocPtr 3
909 static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
910     if (no == 0) return(htmlNewDoc(NULL, NULL));
911     if (no == 1) return(htmlReadMemory("<html/>", 7, "test", NULL, 0));
912     return(NULL);
913 }
914 static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
915     if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
916         xmlFreeDoc(val);
917 }
918 static void desret_htmlDocPtr(htmlDocPtr val) {
919     if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
920         xmlFreeDoc(val);
921 }
922 #define gen_nb_htmlParserCtxtPtr 3
923 static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
924     if (no == 0) return(xmlNewParserCtxt());
925     if (no == 1) return(htmlCreateMemoryParserCtxt("<html/>", 7));
926     return(NULL);
927 }
928 static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
929     if (val != NULL)
930         htmlFreeParserCtxt(val);
931 }
932 static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) {
933     if (val != NULL)
934         htmlFreeParserCtxt(val);
935 }
936 #endif
937
938 #ifdef LIBXML_XPATH_ENABLED
939 #define gen_nb_xmlNodeSetPtr 1
940 static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
941     return(NULL);
942 }
943 static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
944 }
945 #endif
946
947 #ifdef LIBXML_DEBUG_ENABLED
948 #ifdef LIBXML_XPATH_ENABLED
949 #define gen_nb_xmlShellCtxtPtr 1
950 static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
951     return(NULL);
952 }
953 static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
954 }
955 #endif
956 #endif
957
958 #ifdef LIBXML_PATTERN_ENABLED
959 #define gen_nb_xmlPatternPtr 1
960 static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
961     return(NULL);
962 }
963 static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
964 }
965 #endif
966
967 #define gen_nb_xmlElementContentPtr 1
968 static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
969     return(NULL);
970 }
971 static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) {
972     if (val != NULL)
973         xmlFreeElementContent(val);
974 }
975 static void desret_xmlElementContentPtr(xmlElementContentPtr val) {
976     if (val != NULL)
977         xmlFreeElementContent(val);
978 }
979
980 #define gen_nb_xmlParserNodeInfoSeqPtr 1
981 static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
982     return(NULL);
983 }
984 static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
985 }
986
987 static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) {
988 }
989
990 #define gen_nb_void_ptr_ptr 1
991 static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
992     return(NULL);
993 }
994 static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
995 }
996
997 /************************************************************************
998  *                                                                      *
999  *   WARNING: end of the manually maintained part of the test code      *
1000  *            do not remove or alter the CUT HERE line                  *
1001  *                                                                      *
1002  ************************************************************************/
1003
1004 /* CUT HERE: everything below that line is generated */
1005 #ifdef LIBXML_HTML_ENABLED
1006 static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
1007 }
1008
1009 #endif
1010
1011 #define gen_nb_xmlAttributeDefault 4
1012 static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) {
1013     if (no == 1) return(XML_ATTRIBUTE_FIXED);
1014     if (no == 2) return(XML_ATTRIBUTE_IMPLIED);
1015     if (no == 3) return(XML_ATTRIBUTE_NONE);
1016     if (no == 4) return(XML_ATTRIBUTE_REQUIRED);
1017     return(0);
1018 }
1019
1020 static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1021 }
1022
1023 #define gen_nb_xmlAttributeType 4
1024 static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
1025     if (no == 1) return(XML_ATTRIBUTE_CDATA);
1026     if (no == 2) return(XML_ATTRIBUTE_ENTITIES);
1027     if (no == 3) return(XML_ATTRIBUTE_ENTITY);
1028     if (no == 4) return(XML_ATTRIBUTE_ENUMERATION);
1029     return(0);
1030 }
1031
1032 static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1033 }
1034
1035 #define gen_nb_xmlBufferAllocationScheme 4
1036 static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
1037     if (no == 1) return(XML_BUFFER_ALLOC_BOUNDED);
1038     if (no == 2) return(XML_BUFFER_ALLOC_DOUBLEIT);
1039     if (no == 3) return(XML_BUFFER_ALLOC_EXACT);
1040     if (no == 4) return(XML_BUFFER_ALLOC_HYBRID);
1041     return(0);
1042 }
1043
1044 static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1045 }
1046
1047 static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
1048 }
1049
1050 #ifdef LIBXML_CATALOG_ENABLED
1051 #define gen_nb_xmlCatalogAllow 4
1052 static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
1053     if (no == 1) return(XML_CATA_ALLOW_ALL);
1054     if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
1055     if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
1056     if (no == 4) return(XML_CATA_ALLOW_NONE);
1057     return(0);
1058 }
1059
1060 static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1061 }
1062
1063 static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
1064 }
1065
1066 #endif
1067
1068 #ifdef LIBXML_CATALOG_ENABLED
1069 #define gen_nb_xmlCatalogPrefer 3
1070 static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
1071     if (no == 1) return(XML_CATA_PREFER_NONE);
1072     if (no == 2) return(XML_CATA_PREFER_PUBLIC);
1073     if (no == 3) return(XML_CATA_PREFER_SYSTEM);
1074     return(0);
1075 }
1076
1077 static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1078 }
1079
1080 static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
1081 }
1082
1083 #endif
1084
1085 #define gen_nb_xmlElementContentType 4
1086 static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
1087     if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
1088     if (no == 2) return(XML_ELEMENT_CONTENT_OR);
1089     if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
1090     if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
1091     return(0);
1092 }
1093
1094 static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1095 }
1096
1097 #define gen_nb_xmlElementTypeVal 4
1098 static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
1099     if (no == 1) return(XML_ELEMENT_TYPE_ANY);
1100     if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
1101     if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
1102     if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
1103     return(0);
1104 }
1105
1106 static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1107 }
1108
1109 #define gen_nb_xmlFeature 4
1110 static xmlFeature gen_xmlFeature(int no, int nr ATTRIBUTE_UNUSED) {
1111     if (no == 1) return(XML_WITH_AUTOMATA);
1112     if (no == 2) return(XML_WITH_C14N);
1113     if (no == 3) return(XML_WITH_CATALOG);
1114     if (no == 4) return(XML_WITH_DEBUG);
1115     return(0);
1116 }
1117
1118 static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1119 }
1120
1121 static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
1122 }
1123
1124 #ifdef LIBXML_SCHEMAS_ENABLED
1125 #define gen_nb_xmlSchemaValType 4
1126 static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
1127     if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
1128     if (no == 2) return(XML_SCHEMAS_ANYTYPE);
1129     if (no == 3) return(XML_SCHEMAS_ANYURI);
1130     if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
1131     return(0);
1132 }
1133
1134 static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1135 }
1136
1137 static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
1138 }
1139
1140 #endif
1141
1142 #ifdef LIBXML_SCHEMAS_ENABLED
1143 #define gen_nb_xmlSchemaWhitespaceValueType 4
1144 static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) {
1145     if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE);
1146     if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE);
1147     if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE);
1148     if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN);
1149     return(0);
1150 }
1151
1152 static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1153 }
1154
1155 #endif
1156
1157 #include <libxml/HTMLparser.h>
1158 #include <libxml/HTMLtree.h>
1159 #include <libxml/SAX2.h>
1160 #include <libxml/c14n.h>
1161 #include <libxml/catalog.h>
1162 #include <libxml/chvalid.h>
1163 #include <libxml/debugXML.h>
1164 #include <libxml/dict.h>
1165 #include <libxml/encoding.h>
1166 #include <libxml/entities.h>
1167 #include <libxml/hash.h>
1168 #include <libxml/list.h>
1169 #include <libxml/nanoftp.h>
1170 #include <libxml/nanohttp.h>
1171 #include <libxml/parser.h>
1172 #include <libxml/parserInternals.h>
1173 #include <libxml/pattern.h>
1174 #include <libxml/relaxng.h>
1175 #include <libxml/schemasInternals.h>
1176 #include <libxml/schematron.h>
1177 #include <libxml/tree.h>
1178 #include <libxml/uri.h>
1179 #include <libxml/valid.h>
1180 #include <libxml/xinclude.h>
1181 #include <libxml/xmlIO.h>
1182 #include <libxml/xmlautomata.h>
1183 #include <libxml/xmlerror.h>
1184 #include <libxml/xmlmodule.h>
1185 #include <libxml/xmlreader.h>
1186 #include <libxml/xmlregexp.h>
1187 #include <libxml/xmlsave.h>
1188 #include <libxml/xmlschemas.h>
1189 #include <libxml/xmlschemastypes.h>
1190 #include <libxml/xmlstring.h>
1191 #include <libxml/xmlunicode.h>
1192 #include <libxml/xmlwriter.h>
1193 #include <libxml/xpath.h>
1194 #include <libxml/xpathInternals.h>
1195 #include <libxml/xpointer.h>
1196 static int test_HTMLparser(void);
1197 static int test_HTMLtree(void);
1198 static int test_SAX2(void);
1199 static int test_c14n(void);
1200 static int test_catalog(void);
1201 static int test_chvalid(void);
1202 static int test_debugXML(void);
1203 static int test_dict(void);
1204 static int test_encoding(void);
1205 static int test_entities(void);
1206 static int test_hash(void);
1207 static int test_list(void);
1208 static int test_nanoftp(void);
1209 static int test_nanohttp(void);
1210 static int test_parser(void);
1211 static int test_parserInternals(void);
1212 static int test_pattern(void);
1213 static int test_relaxng(void);
1214 static int test_schemasInternals(void);
1215 static int test_schematron(void);
1216 static int test_tree(void);
1217 static int test_uri(void);
1218 static int test_valid(void);
1219 static int test_xinclude(void);
1220 static int test_xmlIO(void);
1221 static int test_xmlautomata(void);
1222 static int test_xmlerror(void);
1223 static int test_xmlmodule(void);
1224 static int test_xmlreader(void);
1225 static int test_xmlregexp(void);
1226 static int test_xmlsave(void);
1227 static int test_xmlschemas(void);
1228 static int test_xmlschemastypes(void);
1229 static int test_xmlstring(void);
1230 static int test_xmlunicode(void);
1231 static int test_xmlwriter(void);
1232 static int test_xpath(void);
1233 static int test_xpathInternals(void);
1234 static int test_xpointer(void);
1235
1236 /**
1237  * testlibxml2:
1238  *
1239  * Main entry point of the tester for the full libxml2 module,
1240  * it calls all the tester entry point for each module.
1241  *
1242  * Returns the number of error found
1243  */
1244 static int
1245 testlibxml2(void)
1246 {
1247     int test_ret = 0;
1248
1249     test_ret += test_HTMLparser();
1250     test_ret += test_HTMLtree();
1251     test_ret += test_SAX2();
1252     test_ret += test_c14n();
1253     test_ret += test_catalog();
1254     test_ret += test_chvalid();
1255     test_ret += test_debugXML();
1256     test_ret += test_dict();
1257     test_ret += test_encoding();
1258     test_ret += test_entities();
1259     test_ret += test_hash();
1260     test_ret += test_list();
1261     test_ret += test_nanoftp();
1262     test_ret += test_nanohttp();
1263     test_ret += test_parser();
1264     test_ret += test_parserInternals();
1265     test_ret += test_pattern();
1266     test_ret += test_relaxng();
1267     test_ret += test_schemasInternals();
1268     test_ret += test_schematron();
1269     test_ret += test_tree();
1270     test_ret += test_uri();
1271     test_ret += test_valid();
1272     test_ret += test_xinclude();
1273     test_ret += test_xmlIO();
1274     test_ret += test_xmlautomata();
1275     test_ret += test_xmlerror();
1276     test_ret += test_xmlmodule();
1277     test_ret += test_xmlreader();
1278     test_ret += test_xmlregexp();
1279     test_ret += test_xmlsave();
1280     test_ret += test_xmlschemas();
1281     test_ret += test_xmlschemastypes();
1282     test_ret += test_xmlstring();
1283     test_ret += test_xmlunicode();
1284     test_ret += test_xmlwriter();
1285     test_ret += test_xpath();
1286     test_ret += test_xpathInternals();
1287     test_ret += test_xpointer();
1288
1289     printf("Total: %d functions, %d tests, %d errors\n",
1290            function_tests, call_tests, test_ret);
1291     return(test_ret);
1292 }
1293
1294
1295 static int
1296 test_UTF8ToHtml(void) {
1297     int test_ret = 0;
1298
1299 #if defined(LIBXML_HTML_ENABLED)
1300     int mem_base;
1301     int ret_val;
1302     unsigned char * out; /* a pointer to an array of bytes to store the result */
1303     int n_out;
1304     int * outlen; /* the length of @out */
1305     int n_outlen;
1306     unsigned char * in; /* a pointer to an array of UTF-8 chars */
1307     int n_in;
1308     int * inlen; /* the length of @in */
1309     int n_inlen;
1310
1311     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1312     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1313     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1314     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1315         mem_base = xmlMemBlocks();
1316         out = gen_unsigned_char_ptr(n_out, 0);
1317         outlen = gen_int_ptr(n_outlen, 1);
1318         in = gen_const_unsigned_char_ptr(n_in, 2);
1319         inlen = gen_int_ptr(n_inlen, 3);
1320
1321         ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen);
1322         desret_int(ret_val);
1323         call_tests++;
1324         des_unsigned_char_ptr(n_out, out, 0);
1325         des_int_ptr(n_outlen, outlen, 1);
1326         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1327         des_int_ptr(n_inlen, inlen, 3);
1328         xmlResetLastError();
1329         if (mem_base != xmlMemBlocks()) {
1330             printf("Leak of %d blocks found in UTF8ToHtml",
1331                    xmlMemBlocks() - mem_base);
1332             test_ret++;
1333             printf(" %d", n_out);
1334             printf(" %d", n_outlen);
1335             printf(" %d", n_in);
1336             printf(" %d", n_inlen);
1337             printf("\n");
1338         }
1339     }
1340     }
1341     }
1342     }
1343     function_tests++;
1344 #endif
1345
1346     return(test_ret);
1347 }
1348
1349 #ifdef LIBXML_HTML_ENABLED
1350
1351 #define gen_nb_const_htmlElemDesc_ptr 1
1352 static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1353     return(NULL);
1354 }
1355 static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1356 }
1357 #endif
1358
1359
1360 static int
1361 test_htmlAttrAllowed(void) {
1362     int test_ret = 0;
1363
1364 #if defined(LIBXML_HTML_ENABLED)
1365     int mem_base;
1366     htmlStatus ret_val;
1367     htmlElemDesc * elt; /* HTML element */
1368     int n_elt;
1369     xmlChar * attr; /* HTML attribute */
1370     int n_attr;
1371     int legacy; /* whether to allow deprecated attributes */
1372     int n_legacy;
1373
1374     for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1375     for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
1376     for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
1377         mem_base = xmlMemBlocks();
1378         elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
1379         attr = gen_const_xmlChar_ptr(n_attr, 1);
1380         legacy = gen_int(n_legacy, 2);
1381
1382         ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy);
1383         desret_htmlStatus(ret_val);
1384         call_tests++;
1385         des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0);
1386         des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1);
1387         des_int(n_legacy, legacy, 2);
1388         xmlResetLastError();
1389         if (mem_base != xmlMemBlocks()) {
1390             printf("Leak of %d blocks found in htmlAttrAllowed",
1391                    xmlMemBlocks() - mem_base);
1392             test_ret++;
1393             printf(" %d", n_elt);
1394             printf(" %d", n_attr);
1395             printf(" %d", n_legacy);
1396             printf("\n");
1397         }
1398     }
1399     }
1400     }
1401     function_tests++;
1402 #endif
1403
1404     return(test_ret);
1405 }
1406
1407 #ifdef LIBXML_HTML_ENABLED
1408
1409 #define gen_nb_htmlNodePtr 1
1410 static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1411     return(NULL);
1412 }
1413 static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1414 }
1415 #endif
1416
1417
1418 static int
1419 test_htmlAutoCloseTag(void) {
1420     int test_ret = 0;
1421
1422 #if defined(LIBXML_HTML_ENABLED)
1423     int mem_base;
1424     int ret_val;
1425     htmlDocPtr doc; /* the HTML document */
1426     int n_doc;
1427     xmlChar * name; /* The tag name */
1428     int n_name;
1429     htmlNodePtr elem; /* the HTML element */
1430     int n_elem;
1431
1432     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
1433     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1434     for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
1435         mem_base = xmlMemBlocks();
1436         doc = gen_htmlDocPtr(n_doc, 0);
1437         name = gen_const_xmlChar_ptr(n_name, 1);
1438         elem = gen_htmlNodePtr(n_elem, 2);
1439
1440         ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem);
1441         desret_int(ret_val);
1442         call_tests++;
1443         des_htmlDocPtr(n_doc, doc, 0);
1444         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
1445         des_htmlNodePtr(n_elem, elem, 2);
1446         xmlResetLastError();
1447         if (mem_base != xmlMemBlocks()) {
1448             printf("Leak of %d blocks found in htmlAutoCloseTag",
1449                    xmlMemBlocks() - mem_base);
1450             test_ret++;
1451             printf(" %d", n_doc);
1452             printf(" %d", n_name);
1453             printf(" %d", n_elem);
1454             printf("\n");
1455         }
1456     }
1457     }
1458     }
1459     function_tests++;
1460 #endif
1461
1462     return(test_ret);
1463 }
1464
1465
1466 static int
1467 test_htmlCreateMemoryParserCtxt(void) {
1468     int test_ret = 0;
1469
1470 #if defined(LIBXML_HTML_ENABLED)
1471     int mem_base;
1472     htmlParserCtxtPtr ret_val;
1473     char * buffer; /* a pointer to a char array */
1474     int n_buffer;
1475     int size; /* the size of the array */
1476     int n_size;
1477
1478     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1479     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1480         mem_base = xmlMemBlocks();
1481         buffer = gen_const_char_ptr(n_buffer, 0);
1482         size = gen_int(n_size, 1);
1483         if ((buffer != NULL) &&
1484             (size > (int) strlen((const char *) buffer) + 1))
1485             continue;
1486
1487         ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
1488         desret_htmlParserCtxtPtr(ret_val);
1489         call_tests++;
1490         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
1491         des_int(n_size, size, 1);
1492         xmlResetLastError();
1493         if (mem_base != xmlMemBlocks()) {
1494             printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1495                    xmlMemBlocks() - mem_base);
1496             test_ret++;
1497             printf(" %d", n_buffer);
1498             printf(" %d", n_size);
1499             printf("\n");
1500         }
1501     }
1502     }
1503     function_tests++;
1504 #endif
1505
1506     return(test_ret);
1507 }
1508
1509 #ifdef LIBXML_HTML_ENABLED
1510
1511 #define gen_nb_htmlSAXHandlerPtr 1
1512 static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1513     return(NULL);
1514 }
1515 static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1516 }
1517 #endif
1518
1519
1520 static int
1521 test_htmlCreatePushParserCtxt(void) {
1522     int test_ret = 0;
1523
1524 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
1525     int mem_base;
1526     htmlParserCtxtPtr ret_val;
1527     htmlSAXHandlerPtr sax; /* a SAX handler */
1528     int n_sax;
1529     void * user_data; /* The user data returned on SAX callbacks */
1530     int n_user_data;
1531     char * chunk; /* a pointer to an array of chars */
1532     int n_chunk;
1533     int size; /* number of chars in the array */
1534     int n_size;
1535     const char * filename; /* an optional file name or URI */
1536     int n_filename;
1537     xmlCharEncoding enc; /* an optional encoding */
1538     int n_enc;
1539
1540     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1541     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1542     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1543     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1544     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1545     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1546         mem_base = xmlMemBlocks();
1547         sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1548         user_data = gen_userdata(n_user_data, 1);
1549         chunk = gen_const_char_ptr(n_chunk, 2);
1550         size = gen_int(n_size, 3);
1551         filename = gen_fileoutput(n_filename, 4);
1552         enc = gen_xmlCharEncoding(n_enc, 5);
1553         if ((chunk != NULL) &&
1554             (size > (int) strlen((const char *) chunk) + 1))
1555             continue;
1556
1557         ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
1558         desret_htmlParserCtxtPtr(ret_val);
1559         call_tests++;
1560         des_htmlSAXHandlerPtr(n_sax, sax, 0);
1561         des_userdata(n_user_data, user_data, 1);
1562         des_const_char_ptr(n_chunk, (const char *)chunk, 2);
1563         des_int(n_size, size, 3);
1564         des_fileoutput(n_filename, filename, 4);
1565         des_xmlCharEncoding(n_enc, enc, 5);
1566         xmlResetLastError();
1567         if (mem_base != xmlMemBlocks()) {
1568             printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1569                    xmlMemBlocks() - mem_base);
1570             test_ret++;
1571             printf(" %d", n_sax);
1572             printf(" %d", n_user_data);
1573             printf(" %d", n_chunk);
1574             printf(" %d", n_size);
1575             printf(" %d", n_filename);
1576             printf(" %d", n_enc);
1577             printf("\n");
1578         }
1579     }
1580     }
1581     }
1582     }
1583     }
1584     }
1585     function_tests++;
1586 #endif
1587
1588     return(test_ret);
1589 }
1590
1591
1592 static int
1593 test_htmlCtxtReadDoc(void) {
1594     int test_ret = 0;
1595
1596 #if defined(LIBXML_HTML_ENABLED)
1597     int mem_base;
1598     htmlDocPtr ret_val;
1599     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1600     int n_ctxt;
1601     xmlChar * cur; /* a pointer to a zero terminated string */
1602     int n_cur;
1603     const char * URL; /* the base URL to use for the document */
1604     int n_URL;
1605     char * encoding; /* the document encoding, or NULL */
1606     int n_encoding;
1607     int options; /* a combination of htmlParserOption(s) */
1608     int n_options;
1609
1610     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1611     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1612     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1613     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1614     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1615         mem_base = xmlMemBlocks();
1616         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1617         cur = gen_const_xmlChar_ptr(n_cur, 1);
1618         URL = gen_filepath(n_URL, 2);
1619         encoding = gen_const_char_ptr(n_encoding, 3);
1620         options = gen_int(n_options, 4);
1621
1622         ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
1623         desret_htmlDocPtr(ret_val);
1624         call_tests++;
1625         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1626         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
1627         des_filepath(n_URL, URL, 2);
1628         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
1629         des_int(n_options, options, 4);
1630         xmlResetLastError();
1631         if (mem_base != xmlMemBlocks()) {
1632             printf("Leak of %d blocks found in htmlCtxtReadDoc",
1633                    xmlMemBlocks() - mem_base);
1634             test_ret++;
1635             printf(" %d", n_ctxt);
1636             printf(" %d", n_cur);
1637             printf(" %d", n_URL);
1638             printf(" %d", n_encoding);
1639             printf(" %d", n_options);
1640             printf("\n");
1641         }
1642     }
1643     }
1644     }
1645     }
1646     }
1647     function_tests++;
1648 #endif
1649
1650     return(test_ret);
1651 }
1652
1653
1654 static int
1655 test_htmlCtxtReadFile(void) {
1656     int test_ret = 0;
1657
1658 #if defined(LIBXML_HTML_ENABLED)
1659     htmlDocPtr ret_val;
1660     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1661     int n_ctxt;
1662     const char * filename; /* a file or URL */
1663     int n_filename;
1664     char * encoding; /* the document encoding, or NULL */
1665     int n_encoding;
1666     int options; /* a combination of htmlParserOption(s) */
1667     int n_options;
1668
1669     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1670     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1671     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1672     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1673         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1674         filename = gen_filepath(n_filename, 1);
1675         encoding = gen_const_char_ptr(n_encoding, 2);
1676         options = gen_int(n_options, 3);
1677
1678         ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
1679         desret_htmlDocPtr(ret_val);
1680         call_tests++;
1681         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1682         des_filepath(n_filename, filename, 1);
1683         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
1684         des_int(n_options, options, 3);
1685         xmlResetLastError();
1686     }
1687     }
1688     }
1689     }
1690     function_tests++;
1691 #endif
1692
1693     return(test_ret);
1694 }
1695
1696
1697 static int
1698 test_htmlCtxtReadMemory(void) {
1699     int test_ret = 0;
1700
1701 #if defined(LIBXML_HTML_ENABLED)
1702     int mem_base;
1703     htmlDocPtr ret_val;
1704     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1705     int n_ctxt;
1706     char * buffer; /* a pointer to a char array */
1707     int n_buffer;
1708     int size; /* the size of the array */
1709     int n_size;
1710     const char * URL; /* the base URL to use for the document */
1711     int n_URL;
1712     char * encoding; /* the document encoding, or NULL */
1713     int n_encoding;
1714     int options; /* a combination of htmlParserOption(s) */
1715     int n_options;
1716
1717     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1718     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1719     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1720     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1721     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1722     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1723         mem_base = xmlMemBlocks();
1724         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1725         buffer = gen_const_char_ptr(n_buffer, 1);
1726         size = gen_int(n_size, 2);
1727         URL = gen_filepath(n_URL, 3);
1728         encoding = gen_const_char_ptr(n_encoding, 4);
1729         options = gen_int(n_options, 5);
1730         if ((buffer != NULL) &&
1731             (size > (int) strlen((const char *) buffer) + 1))
1732             continue;
1733
1734         ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
1735         desret_htmlDocPtr(ret_val);
1736         call_tests++;
1737         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1738         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
1739         des_int(n_size, size, 2);
1740         des_filepath(n_URL, URL, 3);
1741         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
1742         des_int(n_options, options, 5);
1743         xmlResetLastError();
1744         if (mem_base != xmlMemBlocks()) {
1745             printf("Leak of %d blocks found in htmlCtxtReadMemory",
1746                    xmlMemBlocks() - mem_base);
1747             test_ret++;
1748             printf(" %d", n_ctxt);
1749             printf(" %d", n_buffer);
1750             printf(" %d", n_size);
1751             printf(" %d", n_URL);
1752             printf(" %d", n_encoding);
1753             printf(" %d", n_options);
1754             printf("\n");
1755         }
1756     }
1757     }
1758     }
1759     }
1760     }
1761     }
1762     function_tests++;
1763 #endif
1764
1765     return(test_ret);
1766 }
1767
1768
1769 static int
1770 test_htmlCtxtReset(void) {
1771     int test_ret = 0;
1772
1773 #if defined(LIBXML_HTML_ENABLED)
1774     int mem_base;
1775     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1776     int n_ctxt;
1777
1778     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1779         mem_base = xmlMemBlocks();
1780         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1781
1782         htmlCtxtReset(ctxt);
1783         call_tests++;
1784         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1785         xmlResetLastError();
1786         if (mem_base != xmlMemBlocks()) {
1787             printf("Leak of %d blocks found in htmlCtxtReset",
1788                    xmlMemBlocks() - mem_base);
1789             test_ret++;
1790             printf(" %d", n_ctxt);
1791             printf("\n");
1792         }
1793     }
1794     function_tests++;
1795 #endif
1796
1797     return(test_ret);
1798 }
1799
1800
1801 static int
1802 test_htmlCtxtUseOptions(void) {
1803     int test_ret = 0;
1804
1805 #if defined(LIBXML_HTML_ENABLED)
1806     int mem_base;
1807     int ret_val;
1808     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1809     int n_ctxt;
1810     int options; /* a combination of htmlParserOption(s) */
1811     int n_options;
1812
1813     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1814     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1815         mem_base = xmlMemBlocks();
1816         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1817         options = gen_int(n_options, 1);
1818
1819         ret_val = htmlCtxtUseOptions(ctxt, options);
1820         desret_int(ret_val);
1821         call_tests++;
1822         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1823         des_int(n_options, options, 1);
1824         xmlResetLastError();
1825         if (mem_base != xmlMemBlocks()) {
1826             printf("Leak of %d blocks found in htmlCtxtUseOptions",
1827                    xmlMemBlocks() - mem_base);
1828             test_ret++;
1829             printf(" %d", n_ctxt);
1830             printf(" %d", n_options);
1831             printf("\n");
1832         }
1833     }
1834     }
1835     function_tests++;
1836 #endif
1837
1838     return(test_ret);
1839 }
1840
1841
1842 static int
1843 test_htmlElementAllowedHere(void) {
1844     int test_ret = 0;
1845
1846 #if defined(LIBXML_HTML_ENABLED)
1847     int mem_base;
1848     int ret_val;
1849     htmlElemDesc * parent; /* HTML parent element */
1850     int n_parent;
1851     xmlChar * elt; /* HTML element */
1852     int n_elt;
1853
1854     for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1855     for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1856         mem_base = xmlMemBlocks();
1857         parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1858         elt = gen_const_xmlChar_ptr(n_elt, 1);
1859
1860         ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
1861         desret_int(ret_val);
1862         call_tests++;
1863         des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1864         des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1);
1865         xmlResetLastError();
1866         if (mem_base != xmlMemBlocks()) {
1867             printf("Leak of %d blocks found in htmlElementAllowedHere",
1868                    xmlMemBlocks() - mem_base);
1869             test_ret++;
1870             printf(" %d", n_parent);
1871             printf(" %d", n_elt);
1872             printf("\n");
1873         }
1874     }
1875     }
1876     function_tests++;
1877 #endif
1878
1879     return(test_ret);
1880 }
1881
1882
1883 static int
1884 test_htmlElementStatusHere(void) {
1885     int test_ret = 0;
1886
1887 #if defined(LIBXML_HTML_ENABLED)
1888     int mem_base;
1889     htmlStatus ret_val;
1890     htmlElemDesc * parent; /* HTML parent element */
1891     int n_parent;
1892     htmlElemDesc * elt; /* HTML element */
1893     int n_elt;
1894
1895     for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1896     for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1897         mem_base = xmlMemBlocks();
1898         parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1899         elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1900
1901         ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
1902         desret_htmlStatus(ret_val);
1903         call_tests++;
1904         des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1905         des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1);
1906         xmlResetLastError();
1907         if (mem_base != xmlMemBlocks()) {
1908             printf("Leak of %d blocks found in htmlElementStatusHere",
1909                    xmlMemBlocks() - mem_base);
1910             test_ret++;
1911             printf(" %d", n_parent);
1912             printf(" %d", n_elt);
1913             printf("\n");
1914         }
1915     }
1916     }
1917     function_tests++;
1918 #endif
1919
1920     return(test_ret);
1921 }
1922
1923
1924 static int
1925 test_htmlEncodeEntities(void) {
1926     int test_ret = 0;
1927
1928 #if defined(LIBXML_HTML_ENABLED)
1929     int mem_base;
1930     int ret_val;
1931     unsigned char * out; /* a pointer to an array of bytes to store the result */
1932     int n_out;
1933     int * outlen; /* the length of @out */
1934     int n_outlen;
1935     unsigned char * in; /* a pointer to an array of UTF-8 chars */
1936     int n_in;
1937     int * inlen; /* the length of @in */
1938     int n_inlen;
1939     int quoteChar; /* the quote character to escape (' or ") or zero. */
1940     int n_quoteChar;
1941
1942     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1943     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1944     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1945     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1946     for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1947         mem_base = xmlMemBlocks();
1948         out = gen_unsigned_char_ptr(n_out, 0);
1949         outlen = gen_int_ptr(n_outlen, 1);
1950         in = gen_const_unsigned_char_ptr(n_in, 2);
1951         inlen = gen_int_ptr(n_inlen, 3);
1952         quoteChar = gen_int(n_quoteChar, 4);
1953
1954         ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
1955         desret_int(ret_val);
1956         call_tests++;
1957         des_unsigned_char_ptr(n_out, out, 0);
1958         des_int_ptr(n_outlen, outlen, 1);
1959         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1960         des_int_ptr(n_inlen, inlen, 3);
1961         des_int(n_quoteChar, quoteChar, 4);
1962         xmlResetLastError();
1963         if (mem_base != xmlMemBlocks()) {
1964             printf("Leak of %d blocks found in htmlEncodeEntities",
1965                    xmlMemBlocks() - mem_base);
1966             test_ret++;
1967             printf(" %d", n_out);
1968             printf(" %d", n_outlen);
1969             printf(" %d", n_in);
1970             printf(" %d", n_inlen);
1971             printf(" %d", n_quoteChar);
1972             printf("\n");
1973         }
1974     }
1975     }
1976     }
1977     }
1978     }
1979     function_tests++;
1980 #endif
1981
1982     return(test_ret);
1983 }
1984
1985
1986 static int
1987 test_htmlEntityLookup(void) {
1988     int test_ret = 0;
1989
1990 #if defined(LIBXML_HTML_ENABLED)
1991     int mem_base;
1992     const htmlEntityDesc * ret_val;
1993     xmlChar * name; /* the entity name */
1994     int n_name;
1995
1996     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1997         mem_base = xmlMemBlocks();
1998         name = gen_const_xmlChar_ptr(n_name, 0);
1999
2000         ret_val = htmlEntityLookup((const xmlChar *)name);
2001         desret_const_htmlEntityDesc_ptr(ret_val);
2002         call_tests++;
2003         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2004         xmlResetLastError();
2005         if (mem_base != xmlMemBlocks()) {
2006             printf("Leak of %d blocks found in htmlEntityLookup",
2007                    xmlMemBlocks() - mem_base);
2008             test_ret++;
2009             printf(" %d", n_name);
2010             printf("\n");
2011         }
2012     }
2013     function_tests++;
2014 #endif
2015
2016     return(test_ret);
2017 }
2018
2019
2020 static int
2021 test_htmlEntityValueLookup(void) {
2022     int test_ret = 0;
2023
2024 #if defined(LIBXML_HTML_ENABLED)
2025     int mem_base;
2026     const htmlEntityDesc * ret_val;
2027     unsigned int value; /* the entity's unicode value */
2028     int n_value;
2029
2030     for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
2031         mem_base = xmlMemBlocks();
2032         value = gen_unsigned_int(n_value, 0);
2033
2034         ret_val = htmlEntityValueLookup(value);
2035         desret_const_htmlEntityDesc_ptr(ret_val);
2036         call_tests++;
2037         des_unsigned_int(n_value, value, 0);
2038         xmlResetLastError();
2039         if (mem_base != xmlMemBlocks()) {
2040             printf("Leak of %d blocks found in htmlEntityValueLookup",
2041                    xmlMemBlocks() - mem_base);
2042             test_ret++;
2043             printf(" %d", n_value);
2044             printf("\n");
2045         }
2046     }
2047     function_tests++;
2048 #endif
2049
2050     return(test_ret);
2051 }
2052
2053
2054 static int
2055 test_htmlHandleOmittedElem(void) {
2056     int test_ret = 0;
2057
2058 #if defined(LIBXML_HTML_ENABLED)
2059     int mem_base;
2060     int ret_val;
2061     int val; /* int 0 or 1 */
2062     int n_val;
2063
2064     for (n_val = 0;n_val < gen_nb_int;n_val++) {
2065         mem_base = xmlMemBlocks();
2066         val = gen_int(n_val, 0);
2067
2068         ret_val = htmlHandleOmittedElem(val);
2069         desret_int(ret_val);
2070         call_tests++;
2071         des_int(n_val, val, 0);
2072         xmlResetLastError();
2073         if (mem_base != xmlMemBlocks()) {
2074             printf("Leak of %d blocks found in htmlHandleOmittedElem",
2075                    xmlMemBlocks() - mem_base);
2076             test_ret++;
2077             printf(" %d", n_val);
2078             printf("\n");
2079         }
2080     }
2081     function_tests++;
2082 #endif
2083
2084     return(test_ret);
2085 }
2086
2087
2088 static int
2089 test_htmlIsAutoClosed(void) {
2090     int test_ret = 0;
2091
2092 #if defined(LIBXML_HTML_ENABLED)
2093     int mem_base;
2094     int ret_val;
2095     htmlDocPtr doc; /* the HTML document */
2096     int n_doc;
2097     htmlNodePtr elem; /* the HTML element */
2098     int n_elem;
2099
2100     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2101     for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
2102         mem_base = xmlMemBlocks();
2103         doc = gen_htmlDocPtr(n_doc, 0);
2104         elem = gen_htmlNodePtr(n_elem, 1);
2105
2106         ret_val = htmlIsAutoClosed(doc, elem);
2107         desret_int(ret_val);
2108         call_tests++;
2109         des_htmlDocPtr(n_doc, doc, 0);
2110         des_htmlNodePtr(n_elem, elem, 1);
2111         xmlResetLastError();
2112         if (mem_base != xmlMemBlocks()) {
2113             printf("Leak of %d blocks found in htmlIsAutoClosed",
2114                    xmlMemBlocks() - mem_base);
2115             test_ret++;
2116             printf(" %d", n_doc);
2117             printf(" %d", n_elem);
2118             printf("\n");
2119         }
2120     }
2121     }
2122     function_tests++;
2123 #endif
2124
2125     return(test_ret);
2126 }
2127
2128
2129 static int
2130 test_htmlIsScriptAttribute(void) {
2131     int test_ret = 0;
2132
2133 #if defined(LIBXML_HTML_ENABLED)
2134     int mem_base;
2135     int ret_val;
2136     xmlChar * name; /* an attribute name */
2137     int n_name;
2138
2139     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2140         mem_base = xmlMemBlocks();
2141         name = gen_const_xmlChar_ptr(n_name, 0);
2142
2143         ret_val = htmlIsScriptAttribute((const xmlChar *)name);
2144         desret_int(ret_val);
2145         call_tests++;
2146         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2147         xmlResetLastError();
2148         if (mem_base != xmlMemBlocks()) {
2149             printf("Leak of %d blocks found in htmlIsScriptAttribute",
2150                    xmlMemBlocks() - mem_base);
2151             test_ret++;
2152             printf(" %d", n_name);
2153             printf("\n");
2154         }
2155     }
2156     function_tests++;
2157 #endif
2158
2159     return(test_ret);
2160 }
2161
2162
2163 static int
2164 test_htmlNewParserCtxt(void) {
2165     int test_ret = 0;
2166
2167 #if defined(LIBXML_HTML_ENABLED)
2168     int mem_base;
2169     htmlParserCtxtPtr ret_val;
2170
2171         mem_base = xmlMemBlocks();
2172
2173         ret_val = htmlNewParserCtxt();
2174         desret_htmlParserCtxtPtr(ret_val);
2175         call_tests++;
2176         xmlResetLastError();
2177         if (mem_base != xmlMemBlocks()) {
2178             printf("Leak of %d blocks found in htmlNewParserCtxt",
2179                    xmlMemBlocks() - mem_base);
2180             test_ret++;
2181             printf("\n");
2182         }
2183     function_tests++;
2184 #endif
2185
2186     return(test_ret);
2187 }
2188
2189
2190 static int
2191 test_htmlNodeStatus(void) {
2192     int test_ret = 0;
2193
2194 #if defined(LIBXML_HTML_ENABLED)
2195     int mem_base;
2196     htmlStatus ret_val;
2197     htmlNodePtr node; /* an htmlNodePtr in a tree */
2198     int n_node;
2199     int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2200     int n_legacy;
2201
2202     for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
2203     for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2204         mem_base = xmlMemBlocks();
2205         node = gen_const_htmlNodePtr(n_node, 0);
2206         legacy = gen_int(n_legacy, 1);
2207
2208         ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
2209         desret_htmlStatus(ret_val);
2210         call_tests++;
2211         des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0);
2212         des_int(n_legacy, legacy, 1);
2213         xmlResetLastError();
2214         if (mem_base != xmlMemBlocks()) {
2215             printf("Leak of %d blocks found in htmlNodeStatus",
2216                    xmlMemBlocks() - mem_base);
2217             test_ret++;
2218             printf(" %d", n_node);
2219             printf(" %d", n_legacy);
2220             printf("\n");
2221         }
2222     }
2223     }
2224     function_tests++;
2225 #endif
2226
2227     return(test_ret);
2228 }
2229
2230
2231 static int
2232 test_htmlParseCharRef(void) {
2233     int test_ret = 0;
2234
2235 #if defined(LIBXML_HTML_ENABLED)
2236     int mem_base;
2237     int ret_val;
2238     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2239     int n_ctxt;
2240
2241     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2242         mem_base = xmlMemBlocks();
2243         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2244
2245         ret_val = htmlParseCharRef(ctxt);
2246         desret_int(ret_val);
2247         call_tests++;
2248         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2249         xmlResetLastError();
2250         if (mem_base != xmlMemBlocks()) {
2251             printf("Leak of %d blocks found in htmlParseCharRef",
2252                    xmlMemBlocks() - mem_base);
2253             test_ret++;
2254             printf(" %d", n_ctxt);
2255             printf("\n");
2256         }
2257     }
2258     function_tests++;
2259 #endif
2260
2261     return(test_ret);
2262 }
2263
2264
2265 static int
2266 test_htmlParseChunk(void) {
2267     int test_ret = 0;
2268
2269 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
2270     int mem_base;
2271     int ret_val;
2272     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2273     int n_ctxt;
2274     char * chunk; /* an char array */
2275     int n_chunk;
2276     int size; /* the size in byte of the chunk */
2277     int n_size;
2278     int terminate; /* last chunk indicator */
2279     int n_terminate;
2280
2281     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2282     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2283     for (n_size = 0;n_size < gen_nb_int;n_size++) {
2284     for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2285         mem_base = xmlMemBlocks();
2286         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2287         chunk = gen_const_char_ptr(n_chunk, 1);
2288         size = gen_int(n_size, 2);
2289         terminate = gen_int(n_terminate, 3);
2290         if ((chunk != NULL) &&
2291             (size > (int) strlen((const char *) chunk) + 1))
2292             continue;
2293
2294         ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate);
2295         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2296         desret_int(ret_val);
2297         call_tests++;
2298         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2299         des_const_char_ptr(n_chunk, (const char *)chunk, 1);
2300         des_int(n_size, size, 2);
2301         des_int(n_terminate, terminate, 3);
2302         xmlResetLastError();
2303         if (mem_base != xmlMemBlocks()) {
2304             printf("Leak of %d blocks found in htmlParseChunk",
2305                    xmlMemBlocks() - mem_base);
2306             test_ret++;
2307             printf(" %d", n_ctxt);
2308             printf(" %d", n_chunk);
2309             printf(" %d", n_size);
2310             printf(" %d", n_terminate);
2311             printf("\n");
2312         }
2313     }
2314     }
2315     }
2316     }
2317     function_tests++;
2318 #endif
2319
2320     return(test_ret);
2321 }
2322
2323
2324 static int
2325 test_htmlParseDoc(void) {
2326     int test_ret = 0;
2327
2328 #if defined(LIBXML_HTML_ENABLED)
2329     int mem_base;
2330     htmlDocPtr ret_val;
2331     xmlChar * cur; /* a pointer to an array of xmlChar */
2332     int n_cur;
2333     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2334     int n_encoding;
2335
2336     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2337     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2338         mem_base = xmlMemBlocks();
2339         cur = gen_const_xmlChar_ptr(n_cur, 0);
2340         encoding = gen_const_char_ptr(n_encoding, 1);
2341
2342         ret_val = htmlParseDoc((const xmlChar *)cur, (const char *)encoding);
2343         desret_htmlDocPtr(ret_val);
2344         call_tests++;
2345         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2346         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2347         xmlResetLastError();
2348         if (mem_base != xmlMemBlocks()) {
2349             printf("Leak of %d blocks found in htmlParseDoc",
2350                    xmlMemBlocks() - mem_base);
2351             test_ret++;
2352             printf(" %d", n_cur);
2353             printf(" %d", n_encoding);
2354             printf("\n");
2355         }
2356     }
2357     }
2358     function_tests++;
2359 #endif
2360
2361     return(test_ret);
2362 }
2363
2364
2365 static int
2366 test_htmlParseDocument(void) {
2367     int test_ret = 0;
2368
2369 #if defined(LIBXML_HTML_ENABLED)
2370     int mem_base;
2371     int ret_val;
2372     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2373     int n_ctxt;
2374
2375     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2376         mem_base = xmlMemBlocks();
2377         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2378
2379         ret_val = htmlParseDocument(ctxt);
2380         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2381         desret_int(ret_val);
2382         call_tests++;
2383         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2384         xmlResetLastError();
2385         if (mem_base != xmlMemBlocks()) {
2386             printf("Leak of %d blocks found in htmlParseDocument",
2387                    xmlMemBlocks() - mem_base);
2388             test_ret++;
2389             printf(" %d", n_ctxt);
2390             printf("\n");
2391         }
2392     }
2393     function_tests++;
2394 #endif
2395
2396     return(test_ret);
2397 }
2398
2399
2400 static int
2401 test_htmlParseElement(void) {
2402     int test_ret = 0;
2403
2404 #if defined(LIBXML_HTML_ENABLED)
2405     int mem_base;
2406     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2407     int n_ctxt;
2408
2409     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2410         mem_base = xmlMemBlocks();
2411         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2412
2413         htmlParseElement(ctxt);
2414         call_tests++;
2415         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2416         xmlResetLastError();
2417         if (mem_base != xmlMemBlocks()) {
2418             printf("Leak of %d blocks found in htmlParseElement",
2419                    xmlMemBlocks() - mem_base);
2420             test_ret++;
2421             printf(" %d", n_ctxt);
2422             printf("\n");
2423         }
2424     }
2425     function_tests++;
2426 #endif
2427
2428     return(test_ret);
2429 }
2430
2431
2432 static int
2433 test_htmlParseEntityRef(void) {
2434     int test_ret = 0;
2435
2436 #if defined(LIBXML_HTML_ENABLED)
2437     int mem_base;
2438     const htmlEntityDesc * ret_val;
2439     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2440     int n_ctxt;
2441     xmlChar ** str; /* location to store the entity name */
2442     int n_str;
2443
2444     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2445     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2446         mem_base = xmlMemBlocks();
2447         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2448         str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2449
2450         ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
2451         desret_const_htmlEntityDesc_ptr(ret_val);
2452         call_tests++;
2453         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2454         des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1);
2455         xmlResetLastError();
2456         if (mem_base != xmlMemBlocks()) {
2457             printf("Leak of %d blocks found in htmlParseEntityRef",
2458                    xmlMemBlocks() - mem_base);
2459             test_ret++;
2460             printf(" %d", n_ctxt);
2461             printf(" %d", n_str);
2462             printf("\n");
2463         }
2464     }
2465     }
2466     function_tests++;
2467 #endif
2468
2469     return(test_ret);
2470 }
2471
2472
2473 static int
2474 test_htmlParseFile(void) {
2475     int test_ret = 0;
2476
2477 #if defined(LIBXML_HTML_ENABLED)
2478     htmlDocPtr ret_val;
2479     const char * filename; /* the filename */
2480     int n_filename;
2481     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2482     int n_encoding;
2483
2484     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2485     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2486         filename = gen_filepath(n_filename, 0);
2487         encoding = gen_const_char_ptr(n_encoding, 1);
2488
2489         ret_val = htmlParseFile(filename, (const char *)encoding);
2490         desret_htmlDocPtr(ret_val);
2491         call_tests++;
2492         des_filepath(n_filename, filename, 0);
2493         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2494         xmlResetLastError();
2495     }
2496     }
2497     function_tests++;
2498 #endif
2499
2500     return(test_ret);
2501 }
2502
2503
2504 static int
2505 test_htmlReadDoc(void) {
2506     int test_ret = 0;
2507
2508 #if defined(LIBXML_HTML_ENABLED)
2509     int mem_base;
2510     htmlDocPtr ret_val;
2511     xmlChar * cur; /* a pointer to a zero terminated string */
2512     int n_cur;
2513     const char * URL; /* the base URL to use for the document */
2514     int n_URL;
2515     char * encoding; /* the document encoding, or NULL */
2516     int n_encoding;
2517     int options; /* a combination of htmlParserOption(s) */
2518     int n_options;
2519
2520     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2521     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2522     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2523     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2524         mem_base = xmlMemBlocks();
2525         cur = gen_const_xmlChar_ptr(n_cur, 0);
2526         URL = gen_filepath(n_URL, 1);
2527         encoding = gen_const_char_ptr(n_encoding, 2);
2528         options = gen_int(n_options, 3);
2529
2530         ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
2531         desret_htmlDocPtr(ret_val);
2532         call_tests++;
2533         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2534         des_filepath(n_URL, URL, 1);
2535         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2536         des_int(n_options, options, 3);
2537         xmlResetLastError();
2538         if (mem_base != xmlMemBlocks()) {
2539             printf("Leak of %d blocks found in htmlReadDoc",
2540                    xmlMemBlocks() - mem_base);
2541             test_ret++;
2542             printf(" %d", n_cur);
2543             printf(" %d", n_URL);
2544             printf(" %d", n_encoding);
2545             printf(" %d", n_options);
2546             printf("\n");
2547         }
2548     }
2549     }
2550     }
2551     }
2552     function_tests++;
2553 #endif
2554
2555     return(test_ret);
2556 }
2557
2558
2559 static int
2560 test_htmlReadFile(void) {
2561     int test_ret = 0;
2562
2563 #if defined(LIBXML_HTML_ENABLED)
2564     int mem_base;
2565     htmlDocPtr ret_val;
2566     const char * filename; /* a file or URL */
2567     int n_filename;
2568     char * encoding; /* the document encoding, or NULL */
2569     int n_encoding;
2570     int options; /* a combination of htmlParserOption(s) */
2571     int n_options;
2572
2573     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2574     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2575     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2576         mem_base = xmlMemBlocks();
2577         filename = gen_filepath(n_filename, 0);
2578         encoding = gen_const_char_ptr(n_encoding, 1);
2579         options = gen_int(n_options, 2);
2580
2581         ret_val = htmlReadFile(filename, (const char *)encoding, options);
2582         desret_htmlDocPtr(ret_val);
2583         call_tests++;
2584         des_filepath(n_filename, filename, 0);
2585         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2586         des_int(n_options, options, 2);
2587         xmlResetLastError();
2588         if (mem_base != xmlMemBlocks()) {
2589             printf("Leak of %d blocks found in htmlReadFile",
2590                    xmlMemBlocks() - mem_base);
2591             test_ret++;
2592             printf(" %d", n_filename);
2593             printf(" %d", n_encoding);
2594             printf(" %d", n_options);
2595             printf("\n");
2596         }
2597     }
2598     }
2599     }
2600     function_tests++;
2601 #endif
2602
2603     return(test_ret);
2604 }
2605
2606
2607 static int
2608 test_htmlReadMemory(void) {
2609     int test_ret = 0;
2610
2611 #if defined(LIBXML_HTML_ENABLED)
2612     int mem_base;
2613     htmlDocPtr ret_val;
2614     char * buffer; /* a pointer to a char array */
2615     int n_buffer;
2616     int size; /* the size of the array */
2617     int n_size;
2618     const char * URL; /* the base URL to use for the document */
2619     int n_URL;
2620     char * encoding; /* the document encoding, or NULL */
2621     int n_encoding;
2622     int options; /* a combination of htmlParserOption(s) */
2623     int n_options;
2624
2625     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2626     for (n_size = 0;n_size < gen_nb_int;n_size++) {
2627     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2628     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2629     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2630         mem_base = xmlMemBlocks();
2631         buffer = gen_const_char_ptr(n_buffer, 0);
2632         size = gen_int(n_size, 1);
2633         URL = gen_filepath(n_URL, 2);
2634         encoding = gen_const_char_ptr(n_encoding, 3);
2635         options = gen_int(n_options, 4);
2636         if ((buffer != NULL) &&
2637             (size > (int) strlen((const char *) buffer) + 1))
2638             continue;
2639
2640         ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
2641         desret_htmlDocPtr(ret_val);
2642         call_tests++;
2643         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
2644         des_int(n_size, size, 1);
2645         des_filepath(n_URL, URL, 2);
2646         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
2647         des_int(n_options, options, 4);
2648         xmlResetLastError();
2649         if (mem_base != xmlMemBlocks()) {
2650             printf("Leak of %d blocks found in htmlReadMemory",
2651                    xmlMemBlocks() - mem_base);
2652             test_ret++;
2653             printf(" %d", n_buffer);
2654             printf(" %d", n_size);
2655             printf(" %d", n_URL);
2656             printf(" %d", n_encoding);
2657             printf(" %d", n_options);
2658             printf("\n");
2659         }
2660     }
2661     }
2662     }
2663     }
2664     }
2665     function_tests++;
2666 #endif
2667
2668     return(test_ret);
2669 }
2670
2671
2672 static int
2673 test_htmlSAXParseDoc(void) {
2674     int test_ret = 0;
2675
2676 #if defined(LIBXML_HTML_ENABLED)
2677     int mem_base;
2678     htmlDocPtr ret_val;
2679     xmlChar * cur; /* a pointer to an array of xmlChar */
2680     int n_cur;
2681     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2682     int n_encoding;
2683     htmlSAXHandlerPtr sax; /* the SAX handler block */
2684     int n_sax;
2685     void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2686     int n_userData;
2687
2688     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2689     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2690     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2691     for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2692         mem_base = xmlMemBlocks();
2693         cur = gen_const_xmlChar_ptr(n_cur, 0);
2694         encoding = gen_const_char_ptr(n_encoding, 1);
2695         sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2696         userData = gen_userdata(n_userData, 3);
2697
2698         ret_val = htmlSAXParseDoc((const xmlChar *)cur, (const char *)encoding, sax, userData);
2699         desret_htmlDocPtr(ret_val);
2700         call_tests++;
2701         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2702         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2703         des_htmlSAXHandlerPtr(n_sax, sax, 2);
2704         des_userdata(n_userData, userData, 3);
2705         xmlResetLastError();
2706         if (mem_base != xmlMemBlocks()) {
2707             printf("Leak of %d blocks found in htmlSAXParseDoc",
2708                    xmlMemBlocks() - mem_base);
2709             test_ret++;
2710             printf(" %d", n_cur);
2711             printf(" %d", n_encoding);
2712             printf(" %d", n_sax);
2713             printf(" %d", n_userData);
2714             printf("\n");
2715         }
2716     }
2717     }
2718     }
2719     }
2720     function_tests++;
2721 #endif
2722
2723     return(test_ret);
2724 }
2725
2726
2727 static int
2728 test_htmlSAXParseFile(void) {
2729     int test_ret = 0;
2730
2731 #if defined(LIBXML_HTML_ENABLED)
2732     int mem_base;
2733     htmlDocPtr ret_val;
2734     const char * filename; /* the filename */
2735     int n_filename;
2736     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2737     int n_encoding;
2738     htmlSAXHandlerPtr sax; /* the SAX handler block */
2739     int n_sax;
2740     void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2741     int n_userData;
2742
2743     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2744     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2745     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2746     for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2747         mem_base = xmlMemBlocks();
2748         filename = gen_filepath(n_filename, 0);
2749         encoding = gen_const_char_ptr(n_encoding, 1);
2750         sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2751         userData = gen_userdata(n_userData, 3);
2752
2753         ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
2754         desret_htmlDocPtr(ret_val);
2755         call_tests++;
2756         des_filepath(n_filename, filename, 0);
2757         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2758         des_htmlSAXHandlerPtr(n_sax, sax, 2);
2759         des_userdata(n_userData, userData, 3);
2760         xmlResetLastError();
2761         if (mem_base != xmlMemBlocks()) {
2762             printf("Leak of %d blocks found in htmlSAXParseFile",
2763                    xmlMemBlocks() - mem_base);
2764             test_ret++;
2765             printf(" %d", n_filename);
2766             printf(" %d", n_encoding);
2767             printf(" %d", n_sax);
2768             printf(" %d", n_userData);
2769             printf("\n");
2770         }
2771     }
2772     }
2773     }
2774     }
2775     function_tests++;
2776 #endif
2777
2778     return(test_ret);
2779 }
2780
2781
2782 static int
2783 test_htmlTagLookup(void) {
2784     int test_ret = 0;
2785
2786
2787     /* missing type support */
2788     return(test_ret);
2789 }
2790
2791 static int
2792 test_HTMLparser(void) {
2793     int test_ret = 0;
2794
2795     if (quiet == 0) printf("Testing HTMLparser : 32 of 38 functions ...\n");
2796     test_ret += test_UTF8ToHtml();
2797     test_ret += test_htmlAttrAllowed();
2798     test_ret += test_htmlAutoCloseTag();
2799     test_ret += test_htmlCreateMemoryParserCtxt();
2800     test_ret += test_htmlCreatePushParserCtxt();
2801     test_ret += test_htmlCtxtReadDoc();
2802     test_ret += test_htmlCtxtReadFile();
2803     test_ret += test_htmlCtxtReadMemory();
2804     test_ret += test_htmlCtxtReset();
2805     test_ret += test_htmlCtxtUseOptions();
2806     test_ret += test_htmlElementAllowedHere();
2807     test_ret += test_htmlElementStatusHere();
2808     test_ret += test_htmlEncodeEntities();
2809     test_ret += test_htmlEntityLookup();
2810     test_ret += test_htmlEntityValueLookup();
2811     test_ret += test_htmlHandleOmittedElem();
2812     test_ret += test_htmlIsAutoClosed();
2813     test_ret += test_htmlIsScriptAttribute();
2814     test_ret += test_htmlNewParserCtxt();
2815     test_ret += test_htmlNodeStatus();
2816     test_ret += test_htmlParseCharRef();
2817     test_ret += test_htmlParseChunk();
2818     test_ret += test_htmlParseDoc();
2819     test_ret += test_htmlParseDocument();
2820     test_ret += test_htmlParseElement();
2821     test_ret += test_htmlParseEntityRef();
2822     test_ret += test_htmlParseFile();
2823     test_ret += test_htmlReadDoc();
2824     test_ret += test_htmlReadFile();
2825     test_ret += test_htmlReadMemory();
2826     test_ret += test_htmlSAXParseDoc();
2827     test_ret += test_htmlSAXParseFile();
2828     test_ret += test_htmlTagLookup();
2829
2830     if (test_ret != 0)
2831         printf("Module HTMLparser: %d errors\n", test_ret);
2832     return(test_ret);
2833 }
2834
2835 static int
2836 test_htmlDocContentDumpFormatOutput(void) {
2837     int test_ret = 0;
2838
2839 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2840     int mem_base;
2841     xmlOutputBufferPtr buf; /* the HTML buffer output */
2842     int n_buf;
2843     xmlDocPtr cur; /* the document */
2844     int n_cur;
2845     char * encoding; /* the encoding string */
2846     int n_encoding;
2847     int format; /* should formatting spaces been added */
2848     int n_format;
2849
2850     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2851     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2852     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2853     for (n_format = 0;n_format < gen_nb_int;n_format++) {
2854         mem_base = xmlMemBlocks();
2855         buf = gen_xmlOutputBufferPtr(n_buf, 0);
2856         cur = gen_xmlDocPtr(n_cur, 1);
2857         encoding = gen_const_char_ptr(n_encoding, 2);
2858         format = gen_int(n_format, 3);
2859
2860         htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
2861         call_tests++;
2862         des_xmlOutputBufferPtr(n_buf, buf, 0);
2863         des_xmlDocPtr(n_cur, cur, 1);
2864         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2865         des_int(n_format, format, 3);
2866         xmlResetLastError();
2867         if (mem_base != xmlMemBlocks()) {
2868             printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2869                    xmlMemBlocks() - mem_base);
2870             test_ret++;
2871             printf(" %d", n_buf);
2872             printf(" %d", n_cur);
2873             printf(" %d", n_encoding);
2874             printf(" %d", n_format);
2875             printf("\n");
2876         }
2877     }
2878     }
2879     }
2880     }
2881     function_tests++;
2882 #endif
2883
2884     return(test_ret);
2885 }
2886
2887
2888 static int
2889 test_htmlDocContentDumpOutput(void) {
2890     int test_ret = 0;
2891
2892 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2893     int mem_base;
2894     xmlOutputBufferPtr buf; /* the HTML buffer output */
2895     int n_buf;
2896     xmlDocPtr cur; /* the document */
2897     int n_cur;
2898     char * encoding; /* the encoding string */
2899     int n_encoding;
2900
2901     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2902     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2903     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2904         mem_base = xmlMemBlocks();
2905         buf = gen_xmlOutputBufferPtr(n_buf, 0);
2906         cur = gen_xmlDocPtr(n_cur, 1);
2907         encoding = gen_const_char_ptr(n_encoding, 2);
2908
2909         htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
2910         call_tests++;
2911         des_xmlOutputBufferPtr(n_buf, buf, 0);
2912         des_xmlDocPtr(n_cur, cur, 1);
2913         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2914         xmlResetLastError();
2915         if (mem_base != xmlMemBlocks()) {
2916             printf("Leak of %d blocks found in htmlDocContentDumpOutput",
2917                    xmlMemBlocks() - mem_base);
2918             test_ret++;
2919             printf(" %d", n_buf);
2920             printf(" %d", n_cur);
2921             printf(" %d", n_encoding);
2922             printf("\n");
2923         }
2924     }
2925     }
2926     }
2927     function_tests++;
2928 #endif
2929
2930     return(test_ret);
2931 }
2932
2933
2934 static int
2935 test_htmlDocDump(void) {
2936     int test_ret = 0;
2937
2938 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2939     int mem_base;
2940     int ret_val;
2941     FILE * f; /* the FILE* */
2942     int n_f;
2943     xmlDocPtr cur; /* the document */
2944     int n_cur;
2945
2946     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
2947     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2948         mem_base = xmlMemBlocks();
2949         f = gen_FILE_ptr(n_f, 0);
2950         cur = gen_xmlDocPtr(n_cur, 1);
2951
2952         ret_val = htmlDocDump(f, cur);
2953         desret_int(ret_val);
2954         call_tests++;
2955         des_FILE_ptr(n_f, f, 0);
2956         des_xmlDocPtr(n_cur, cur, 1);
2957         xmlResetLastError();
2958         if (mem_base != xmlMemBlocks()) {
2959             printf("Leak of %d blocks found in htmlDocDump",
2960                    xmlMemBlocks() - mem_base);
2961             test_ret++;
2962             printf(" %d", n_f);
2963             printf(" %d", n_cur);
2964             printf("\n");
2965         }
2966     }
2967     }
2968     function_tests++;
2969 #endif
2970
2971     return(test_ret);
2972 }
2973
2974
2975 #define gen_nb_xmlChar_ptr_ptr 1
2976 static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2977     return(NULL);
2978 }
2979 static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2980 }
2981
2982 static int
2983 test_htmlDocDumpMemory(void) {
2984     int test_ret = 0;
2985
2986 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2987     int mem_base;
2988     xmlDocPtr cur; /* the document */
2989     int n_cur;
2990     xmlChar ** mem; /* OUT: the memory pointer */
2991     int n_mem;
2992     int * size; /* OUT: the memory length */
2993     int n_size;
2994
2995     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2996     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
2997     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
2998         mem_base = xmlMemBlocks();
2999         cur = gen_xmlDocPtr(n_cur, 0);
3000         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3001         size = gen_int_ptr(n_size, 2);
3002
3003         htmlDocDumpMemory(cur, mem, size);
3004         call_tests++;
3005         des_xmlDocPtr(n_cur, cur, 0);
3006         des_xmlChar_ptr_ptr(n_mem, mem, 1);
3007         des_int_ptr(n_size, size, 2);
3008         xmlResetLastError();
3009         if (mem_base != xmlMemBlocks()) {
3010             printf("Leak of %d blocks found in htmlDocDumpMemory",
3011                    xmlMemBlocks() - mem_base);
3012             test_ret++;
3013             printf(" %d", n_cur);
3014             printf(" %d", n_mem);
3015             printf(" %d", n_size);
3016             printf("\n");
3017         }
3018     }
3019     }
3020     }
3021     function_tests++;
3022 #endif
3023
3024     return(test_ret);
3025 }
3026
3027
3028 static int
3029 test_htmlDocDumpMemoryFormat(void) {
3030     int test_ret = 0;
3031
3032 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3033     int mem_base;
3034     xmlDocPtr cur; /* the document */
3035     int n_cur;
3036     xmlChar ** mem; /* OUT: the memory pointer */
3037     int n_mem;
3038     int * size; /* OUT: the memory length */
3039     int n_size;
3040     int format; /* should formatting spaces been added */
3041     int n_format;
3042
3043     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3044     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
3045     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
3046     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3047         mem_base = xmlMemBlocks();
3048         cur = gen_xmlDocPtr(n_cur, 0);
3049         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3050         size = gen_int_ptr(n_size, 2);
3051         format = gen_int(n_format, 3);
3052
3053         htmlDocDumpMemoryFormat(cur, mem, size, format);
3054         call_tests++;
3055         des_xmlDocPtr(n_cur, cur, 0);
3056         des_xmlChar_ptr_ptr(n_mem, mem, 1);
3057         des_int_ptr(n_size, size, 2);
3058         des_int(n_format, format, 3);
3059         xmlResetLastError();
3060         if (mem_base != xmlMemBlocks()) {
3061             printf("Leak of %d blocks found in htmlDocDumpMemoryFormat",
3062                    xmlMemBlocks() - mem_base);
3063             test_ret++;
3064             printf(" %d", n_cur);
3065             printf(" %d", n_mem);
3066             printf(" %d", n_size);
3067             printf(" %d", n_format);
3068             printf("\n");
3069         }
3070     }
3071     }
3072     }
3073     }
3074     function_tests++;
3075 #endif
3076
3077     return(test_ret);
3078 }
3079
3080
3081 static int
3082 test_htmlGetMetaEncoding(void) {
3083     int test_ret = 0;
3084
3085 #if defined(LIBXML_HTML_ENABLED)
3086     int mem_base;
3087     const xmlChar * ret_val;
3088     htmlDocPtr doc; /* the document */
3089     int n_doc;
3090
3091     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3092         mem_base = xmlMemBlocks();
3093         doc = gen_htmlDocPtr(n_doc, 0);
3094
3095         ret_val = htmlGetMetaEncoding(doc);
3096         desret_const_xmlChar_ptr(ret_val);
3097         call_tests++;
3098         des_htmlDocPtr(n_doc, doc, 0);
3099         xmlResetLastError();
3100         if (mem_base != xmlMemBlocks()) {
3101             printf("Leak of %d blocks found in htmlGetMetaEncoding",
3102                    xmlMemBlocks() - mem_base);
3103             test_ret++;
3104             printf(" %d", n_doc);
3105             printf("\n");
3106         }
3107     }
3108     function_tests++;
3109 #endif
3110
3111     return(test_ret);
3112 }
3113
3114
3115 static int
3116 test_htmlIsBooleanAttr(void) {
3117     int test_ret = 0;
3118
3119 #if defined(LIBXML_HTML_ENABLED)
3120     int mem_base;
3121     int ret_val;
3122     xmlChar * name; /* the name of the attribute to check */
3123     int n_name;
3124
3125     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3126         mem_base = xmlMemBlocks();
3127         name = gen_const_xmlChar_ptr(n_name, 0);
3128
3129         ret_val = htmlIsBooleanAttr((const xmlChar *)name);
3130         desret_int(ret_val);
3131         call_tests++;
3132         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
3133         xmlResetLastError();
3134         if (mem_base != xmlMemBlocks()) {
3135             printf("Leak of %d blocks found in htmlIsBooleanAttr",
3136                    xmlMemBlocks() - mem_base);
3137             test_ret++;
3138             printf(" %d", n_name);
3139             printf("\n");
3140         }
3141     }
3142     function_tests++;
3143 #endif
3144
3145     return(test_ret);
3146 }
3147
3148
3149 static int
3150 test_htmlNewDoc(void) {
3151     int test_ret = 0;
3152
3153 #if defined(LIBXML_HTML_ENABLED)
3154     int mem_base;
3155     htmlDocPtr ret_val;
3156     xmlChar * URI; /* URI for the dtd, or NULL */
3157     int n_URI;
3158     xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3159     int n_ExternalID;
3160
3161     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3162     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3163         mem_base = xmlMemBlocks();
3164         URI = gen_const_xmlChar_ptr(n_URI, 0);
3165         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3166
3167         ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
3168         desret_htmlDocPtr(ret_val);
3169         call_tests++;
3170         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3171         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3172         xmlResetLastError();
3173         if (mem_base != xmlMemBlocks()) {
3174             printf("Leak of %d blocks found in htmlNewDoc",
3175                    xmlMemBlocks() - mem_base);
3176             test_ret++;
3177             printf(" %d", n_URI);
3178             printf(" %d", n_ExternalID);
3179             printf("\n");
3180         }
3181     }
3182     }
3183     function_tests++;
3184 #endif
3185
3186     return(test_ret);
3187 }
3188
3189
3190 static int
3191 test_htmlNewDocNoDtD(void) {
3192     int test_ret = 0;
3193
3194 #if defined(LIBXML_HTML_ENABLED)
3195     int mem_base;
3196     htmlDocPtr ret_val;
3197     xmlChar * URI; /* URI for the dtd, or NULL */
3198     int n_URI;
3199     xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3200     int n_ExternalID;
3201
3202     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3203     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3204         mem_base = xmlMemBlocks();
3205         URI = gen_const_xmlChar_ptr(n_URI, 0);
3206         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3207
3208         ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
3209         desret_htmlDocPtr(ret_val);
3210         call_tests++;
3211         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3212         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3213         xmlResetLastError();
3214         if (mem_base != xmlMemBlocks()) {
3215             printf("Leak of %d blocks found in htmlNewDocNoDtD",
3216                    xmlMemBlocks() - mem_base);
3217             test_ret++;
3218             printf(" %d", n_URI);
3219             printf(" %d", n_ExternalID);
3220             printf("\n");
3221         }
3222     }
3223     }
3224     function_tests++;
3225 #endif
3226
3227     return(test_ret);
3228 }
3229
3230
3231 static int
3232 test_htmlNodeDump(void) {
3233     int test_ret = 0;
3234
3235 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3236     int mem_base;
3237     int ret_val;
3238     xmlBufferPtr buf; /* the HTML buffer output */
3239     int n_buf;
3240     xmlDocPtr doc; /* the document */
3241     int n_doc;
3242     xmlNodePtr cur; /* the current node */
3243     int n_cur;
3244
3245     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3246     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3247     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3248         mem_base = xmlMemBlocks();
3249         buf = gen_xmlBufferPtr(n_buf, 0);
3250         doc = gen_xmlDocPtr(n_doc, 1);
3251         cur = gen_xmlNodePtr(n_cur, 2);
3252
3253         ret_val = htmlNodeDump(buf, doc, cur);
3254         desret_int(ret_val);
3255         call_tests++;
3256         des_xmlBufferPtr(n_buf, buf, 0);
3257         des_xmlDocPtr(n_doc, doc, 1);
3258         des_xmlNodePtr(n_cur, cur, 2);
3259         xmlResetLastError();
3260         if (mem_base != xmlMemBlocks()) {
3261             printf("Leak of %d blocks found in htmlNodeDump",
3262                    xmlMemBlocks() - mem_base);
3263             test_ret++;
3264             printf(" %d", n_buf);
3265             printf(" %d", n_doc);
3266             printf(" %d", n_cur);
3267             printf("\n");
3268         }
3269     }
3270     }
3271     }
3272     function_tests++;
3273 #endif
3274
3275     return(test_ret);
3276 }
3277
3278
3279 static int
3280 test_htmlNodeDumpFile(void) {
3281     int test_ret = 0;
3282
3283 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3284     int mem_base;
3285     FILE * out; /* the FILE pointer */
3286     int n_out;
3287     xmlDocPtr doc; /* the document */
3288     int n_doc;
3289     xmlNodePtr cur; /* the current node */
3290     int n_cur;
3291
3292     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3293     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3294     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3295         mem_base = xmlMemBlocks();
3296         out = gen_FILE_ptr(n_out, 0);
3297         doc = gen_xmlDocPtr(n_doc, 1);
3298         cur = gen_xmlNodePtr(n_cur, 2);
3299
3300         htmlNodeDumpFile(out, doc, cur);
3301         call_tests++;
3302         des_FILE_ptr(n_out, out, 0);
3303         des_xmlDocPtr(n_doc, doc, 1);
3304         des_xmlNodePtr(n_cur, cur, 2);
3305         xmlResetLastError();
3306         if (mem_base != xmlMemBlocks()) {
3307             printf("Leak of %d blocks found in htmlNodeDumpFile",
3308                    xmlMemBlocks() - mem_base);
3309             test_ret++;
3310             printf(" %d", n_out);
3311             printf(" %d", n_doc);
3312             printf(" %d", n_cur);
3313             printf("\n");
3314         }
3315     }
3316     }
3317     }
3318     function_tests++;
3319 #endif
3320
3321     return(test_ret);
3322 }
3323
3324
3325 static int
3326 test_htmlNodeDumpFileFormat(void) {
3327     int test_ret = 0;
3328
3329 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3330     int mem_base;
3331     int ret_val;
3332     FILE * out; /* the FILE pointer */
3333     int n_out;
3334     xmlDocPtr doc; /* the document */
3335     int n_doc;
3336     xmlNodePtr cur; /* the current node */
3337     int n_cur;
3338     char * encoding; /* the document encoding */
3339     int n_encoding;
3340     int format; /* should formatting spaces been added */
3341     int n_format;
3342
3343     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3344     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3345     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3346     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3347     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3348         mem_base = xmlMemBlocks();
3349         out = gen_FILE_ptr(n_out, 0);
3350         doc = gen_xmlDocPtr(n_doc, 1);
3351         cur = gen_xmlNodePtr(n_cur, 2);
3352         encoding = gen_const_char_ptr(n_encoding, 3);
3353         format = gen_int(n_format, 4);
3354
3355         ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
3356         desret_int(ret_val);
3357         call_tests++;
3358         des_FILE_ptr(n_out, out, 0);
3359         des_xmlDocPtr(n_doc, doc, 1);
3360         des_xmlNodePtr(n_cur, cur, 2);
3361         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3362         des_int(n_format, format, 4);
3363         xmlResetLastError();
3364         if (mem_base != xmlMemBlocks()) {
3365             printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3366                    xmlMemBlocks() - mem_base);
3367             test_ret++;
3368             printf(" %d", n_out);
3369             printf(" %d", n_doc);
3370             printf(" %d", n_cur);
3371             printf(" %d", n_encoding);
3372             printf(" %d", n_format);
3373             printf("\n");
3374         }
3375     }
3376     }
3377     }
3378     }
3379     }
3380     function_tests++;
3381 #endif
3382
3383     return(test_ret);
3384 }
3385
3386
3387 static int
3388 test_htmlNodeDumpFormatOutput(void) {
3389     int test_ret = 0;
3390
3391 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3392     int mem_base;
3393     xmlOutputBufferPtr buf; /* the HTML buffer output */
3394     int n_buf;
3395     xmlDocPtr doc; /* the document */
3396     int n_doc;
3397     xmlNodePtr cur; /* the current node */
3398     int n_cur;
3399     char * encoding; /* the encoding string */
3400     int n_encoding;
3401     int format; /* should formatting spaces been added */
3402     int n_format;
3403
3404     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3405     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3406     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3407     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3408     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3409         mem_base = xmlMemBlocks();
3410         buf = gen_xmlOutputBufferPtr(n_buf, 0);
3411         doc = gen_xmlDocPtr(n_doc, 1);
3412         cur = gen_xmlNodePtr(n_cur, 2);
3413         encoding = gen_const_char_ptr(n_encoding, 3);
3414         format = gen_int(n_format, 4);
3415
3416         htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
3417         call_tests++;
3418         des_xmlOutputBufferPtr(n_buf, buf, 0);
3419         des_xmlDocPtr(n_doc, doc, 1);
3420         des_xmlNodePtr(n_cur, cur, 2);
3421         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3422         des_int(n_format, format, 4);
3423         xmlResetLastError();
3424         if (mem_base != xmlMemBlocks()) {
3425             printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3426                    xmlMemBlocks() - mem_base);
3427             test_ret++;
3428             printf(" %d", n_buf);
3429             printf(" %d", n_doc);
3430             printf(" %d", n_cur);
3431             printf(" %d", n_encoding);
3432             printf(" %d", n_format);
3433             printf("\n");
3434         }
3435     }
3436     }
3437     }
3438     }
3439     }
3440     function_tests++;
3441 #endif
3442
3443     return(test_ret);
3444 }
3445
3446
3447 static int
3448 test_htmlNodeDumpOutput(void) {
3449     int test_ret = 0;
3450
3451 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3452     int mem_base;
3453     xmlOutputBufferPtr buf; /* the HTML buffer output */
3454     int n_buf;
3455     xmlDocPtr doc; /* the document */
3456     int n_doc;
3457     xmlNodePtr cur; /* the current node */
3458     int n_cur;
3459     char * encoding; /* the encoding string */
3460     int n_encoding;
3461
3462     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3463     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3464     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3465     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3466         mem_base = xmlMemBlocks();
3467         buf = gen_xmlOutputBufferPtr(n_buf, 0);
3468         doc = gen_xmlDocPtr(n_doc, 1);
3469         cur = gen_xmlNodePtr(n_cur, 2);
3470         encoding = gen_const_char_ptr(n_encoding, 3);
3471
3472         htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
3473         call_tests++;
3474         des_xmlOutputBufferPtr(n_buf, buf, 0);
3475         des_xmlDocPtr(n_doc, doc, 1);
3476         des_xmlNodePtr(n_cur, cur, 2);
3477         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3478         xmlResetLastError();
3479         if (mem_base != xmlMemBlocks()) {
3480             printf("Leak of %d blocks found in htmlNodeDumpOutput",
3481                    xmlMemBlocks() - mem_base);
3482             test_ret++;
3483             printf(" %d", n_buf);
3484             printf(" %d", n_doc);
3485             printf(" %d", n_cur);
3486             printf(" %d", n_encoding);
3487             printf("\n");
3488         }
3489     }
3490     }
3491     }
3492     }
3493     function_tests++;
3494 #endif
3495
3496     return(test_ret);
3497 }
3498
3499
3500 static int
3501 test_htmlSaveFile(void) {
3502     int test_ret = 0;
3503
3504 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3505     int mem_base;
3506     int ret_val;
3507     const char * filename; /* the filename (or URL) */
3508     int n_filename;
3509     xmlDocPtr cur; /* the document */
3510     int n_cur;
3511
3512     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3513     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3514         mem_base = xmlMemBlocks();
3515         filename = gen_fileoutput(n_filename, 0);
3516         cur = gen_xmlDocPtr(n_cur, 1);
3517
3518         ret_val = htmlSaveFile(filename, cur);
3519         desret_int(ret_val);
3520         call_tests++;
3521         des_fileoutput(n_filename, filename, 0);
3522         des_xmlDocPtr(n_cur, cur, 1);
3523         xmlResetLastError();
3524         if (mem_base != xmlMemBlocks()) {
3525             printf("Leak of %d blocks found in htmlSaveFile",
3526                    xmlMemBlocks() - mem_base);
3527             test_ret++;
3528             printf(" %d", n_filename);
3529             printf(" %d", n_cur);
3530             printf("\n");
3531         }
3532     }
3533     }
3534     function_tests++;
3535 #endif
3536
3537     return(test_ret);
3538 }
3539
3540
3541 static int
3542 test_htmlSaveFileEnc(void) {
3543     int test_ret = 0;
3544
3545 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3546     int mem_base;
3547     int ret_val;
3548     const char * filename; /* the filename */
3549     int n_filename;
3550     xmlDocPtr cur; /* the document */
3551     int n_cur;
3552     char * encoding; /* the document encoding */
3553     int n_encoding;
3554
3555     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3556     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3557     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3558         mem_base = xmlMemBlocks();
3559         filename = gen_fileoutput(n_filename, 0);
3560         cur = gen_xmlDocPtr(n_cur, 1);
3561         encoding = gen_const_char_ptr(n_encoding, 2);
3562
3563         ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
3564         desret_int(ret_val);
3565         call_tests++;
3566         des_fileoutput(n_filename, filename, 0);
3567         des_xmlDocPtr(n_cur, cur, 1);
3568         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3569         xmlResetLastError();
3570         if (mem_base != xmlMemBlocks()) {
3571             printf("Leak of %d blocks found in htmlSaveFileEnc",
3572                    xmlMemBlocks() - mem_base);
3573             test_ret++;
3574             printf(" %d", n_filename);
3575             printf(" %d", n_cur);
3576             printf(" %d", n_encoding);
3577             printf("\n");
3578         }
3579     }
3580     }
3581     }
3582     function_tests++;
3583 #endif
3584
3585     return(test_ret);
3586 }
3587
3588
3589 static int
3590 test_htmlSaveFileFormat(void) {
3591     int test_ret = 0;
3592
3593 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3594     int mem_base;
3595     int ret_val;
3596     const char * filename; /* the filename */
3597     int n_filename;
3598     xmlDocPtr cur; /* the document */
3599     int n_cur;
3600     char * encoding; /* the document encoding */
3601     int n_encoding;
3602     int format; /* should formatting spaces been added */
3603     int n_format;
3604
3605     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3606     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3607     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3608     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3609         mem_base = xmlMemBlocks();
3610         filename = gen_fileoutput(n_filename, 0);
3611         cur = gen_xmlDocPtr(n_cur, 1);
3612         encoding = gen_const_char_ptr(n_encoding, 2);
3613         format = gen_int(n_format, 3);
3614
3615         ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
3616         desret_int(ret_val);
3617         call_tests++;
3618         des_fileoutput(n_filename, filename, 0);
3619         des_xmlDocPtr(n_cur, cur, 1);
3620         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3621         des_int(n_format, format, 3);
3622         xmlResetLastError();
3623         if (mem_base != xmlMemBlocks()) {
3624             printf("Leak of %d blocks found in htmlSaveFileFormat",
3625                    xmlMemBlocks() - mem_base);
3626             test_ret++;
3627             printf(" %d", n_filename);
3628             printf(" %d", n_cur);
3629             printf(" %d", n_encoding);
3630             printf(" %d", n_format);
3631             printf("\n");
3632         }
3633     }
3634     }
3635     }
3636     }
3637     function_tests++;
3638 #endif
3639
3640     return(test_ret);
3641 }
3642
3643
3644 static int
3645 test_htmlSetMetaEncoding(void) {
3646     int test_ret = 0;
3647
3648 #if defined(LIBXML_HTML_ENABLED)
3649     int mem_base;
3650     int ret_val;
3651     htmlDocPtr doc; /* the document */
3652     int n_doc;
3653     xmlChar * encoding; /* the encoding string */
3654     int n_encoding;
3655
3656     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3657     for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3658         mem_base = xmlMemBlocks();
3659         doc = gen_htmlDocPtr(n_doc, 0);
3660         encoding = gen_const_xmlChar_ptr(n_encoding, 1);
3661
3662         ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
3663         desret_int(ret_val);
3664         call_tests++;
3665         des_htmlDocPtr(n_doc, doc, 0);
3666         des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1);
3667         xmlResetLastError();
3668         if (mem_base != xmlMemBlocks()) {
3669             printf("Leak of %d blocks found in htmlSetMetaEncoding",
3670                    xmlMemBlocks() - mem_base);
3671             test_ret++;
3672             printf(" %d", n_doc);
3673             printf(" %d", n_encoding);
3674             printf("\n");
3675         }
3676     }
3677     }
3678     function_tests++;
3679 #endif
3680
3681     return(test_ret);
3682 }
3683
3684 static int
3685 test_HTMLtree(void) {
3686     int test_ret = 0;
3687
3688     if (quiet == 0) printf("Testing HTMLtree : 18 of 18 functions ...\n");
3689     test_ret += test_htmlDocContentDumpFormatOutput();
3690     test_ret += test_htmlDocContentDumpOutput();
3691     test_ret += test_htmlDocDump();
3692     test_ret += test_htmlDocDumpMemory();
3693     test_ret += test_htmlDocDumpMemoryFormat();
3694     test_ret += test_htmlGetMetaEncoding();
3695     test_ret += test_htmlIsBooleanAttr();
3696     test_ret += test_htmlNewDoc();
3697     test_ret += test_htmlNewDocNoDtD();
3698     test_ret += test_htmlNodeDump();
3699     test_ret += test_htmlNodeDumpFile();
3700     test_ret += test_htmlNodeDumpFileFormat();
3701     test_ret += test_htmlNodeDumpFormatOutput();
3702     test_ret += test_htmlNodeDumpOutput();
3703     test_ret += test_htmlSaveFile();
3704     test_ret += test_htmlSaveFileEnc();
3705     test_ret += test_htmlSaveFileFormat();
3706     test_ret += test_htmlSetMetaEncoding();
3707
3708     if (test_ret != 0)
3709         printf("Module HTMLtree: %d errors\n", test_ret);
3710     return(test_ret);
3711 }
3712
3713 static int
3714 test_docbDefaultSAXHandlerInit(void) {
3715     int test_ret = 0;
3716
3717 #if defined(LIBXML_DOCB_ENABLED)
3718 #ifdef LIBXML_DOCB_ENABLED
3719     int mem_base;
3720
3721         mem_base = xmlMemBlocks();
3722
3723         docbDefaultSAXHandlerInit();
3724         call_tests++;
3725         xmlResetLastError();
3726         if (mem_base != xmlMemBlocks()) {
3727             printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3728                    xmlMemBlocks() - mem_base);
3729             test_ret++;
3730             printf("\n");
3731         }
3732     function_tests++;
3733 #endif
3734 #endif
3735
3736     return(test_ret);
3737 }
3738
3739
3740 static int
3741 test_htmlDefaultSAXHandlerInit(void) {
3742     int test_ret = 0;
3743
3744 #if defined(LIBXML_HTML_ENABLED)
3745 #ifdef LIBXML_HTML_ENABLED
3746     int mem_base;
3747
3748         mem_base = xmlMemBlocks();
3749
3750         htmlDefaultSAXHandlerInit();
3751         call_tests++;
3752         xmlResetLastError();
3753         if (mem_base != xmlMemBlocks()) {
3754             printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3755                    xmlMemBlocks() - mem_base);
3756             test_ret++;
3757             printf("\n");
3758         }
3759     function_tests++;
3760 #endif
3761 #endif
3762
3763     return(test_ret);
3764 }
3765
3766
3767 static int
3768 test_xmlDefaultSAXHandlerInit(void) {
3769     int test_ret = 0;
3770
3771     int mem_base;
3772
3773         mem_base = xmlMemBlocks();
3774
3775         xmlDefaultSAXHandlerInit();
3776         call_tests++;
3777         xmlResetLastError();
3778         if (mem_base != xmlMemBlocks()) {
3779             printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3780                    xmlMemBlocks() - mem_base);
3781             test_ret++;
3782             printf("\n");
3783         }
3784     function_tests++;
3785
3786     return(test_ret);
3787 }
3788
3789
3790 #define gen_nb_xmlEnumerationPtr 1
3791 static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3792     return(NULL);
3793 }
3794 static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3795 }
3796
3797 static int
3798 test_xmlSAX2AttributeDecl(void) {
3799     int test_ret = 0;
3800
3801     int mem_base;
3802     void * ctx; /* the user data (XML parser context) */
3803     int n_ctx;
3804     xmlChar * elem; /* the name of the element */
3805     int n_elem;
3806     xmlChar * fullname; /* the attribute name */
3807     int n_fullname;
3808     int type; /* the attribute type */
3809     int n_type;
3810     int def; /* the type of default value */
3811     int n_def;
3812     xmlChar * defaultValue; /* the attribute default value */
3813     int n_defaultValue;
3814     xmlEnumerationPtr tree; /* the tree of enumerated value set */
3815     int n_tree;
3816
3817     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3818     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3819     for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3820     for (n_type = 0;n_type < gen_nb_int;n_type++) {
3821     for (n_def = 0;n_def < gen_nb_int;n_def++) {
3822     for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3823     for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3824         mem_base = xmlMemBlocks();
3825         ctx = gen_void_ptr(n_ctx, 0);
3826         elem = gen_const_xmlChar_ptr(n_elem, 1);
3827         fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3828         type = gen_int(n_type, 3);
3829         def = gen_int(n_def, 4);
3830         defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3831         tree = gen_xmlEnumerationPtr(n_tree, 6);
3832
3833         xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
3834         call_tests++;
3835         des_void_ptr(n_ctx, ctx, 0);
3836         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
3837         des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2);
3838         des_int(n_type, type, 3);
3839         des_int(n_def, def, 4);
3840         des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5);
3841         des_xmlEnumerationPtr(n_tree, tree, 6);
3842         xmlResetLastError();
3843         if (mem_base != xmlMemBlocks()) {
3844             printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3845                    xmlMemBlocks() - mem_base);
3846             test_ret++;
3847             printf(" %d", n_ctx);
3848             printf(" %d", n_elem);
3849             printf(" %d", n_fullname);
3850             printf(" %d", n_type);
3851             printf(" %d", n_def);
3852             printf(" %d", n_defaultValue);
3853             printf(" %d", n_tree);
3854             printf("\n");
3855         }
3856     }
3857     }
3858     }
3859     }
3860     }
3861     }
3862     }
3863     function_tests++;
3864
3865     return(test_ret);
3866 }
3867
3868
3869 static int
3870 test_xmlSAX2CDataBlock(void) {
3871     int test_ret = 0;
3872
3873     int mem_base;
3874     void * ctx; /* the user data (XML parser context) */
3875     int n_ctx;
3876     xmlChar * value; /* The pcdata content */
3877     int n_value;
3878     int len; /* the block length */
3879     int n_len;
3880
3881     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3882     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3883     for (n_len = 0;n_len < gen_nb_int;n_len++) {
3884         mem_base = xmlMemBlocks();
3885         ctx = gen_void_ptr(n_ctx, 0);
3886         value = gen_const_xmlChar_ptr(n_value, 1);
3887         len = gen_int(n_len, 2);
3888         if ((value != NULL) &&
3889             (len > (int) strlen((const char *) value) + 1))
3890             continue;
3891
3892         xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
3893         call_tests++;
3894         des_void_ptr(n_ctx, ctx, 0);
3895         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3896         des_int(n_len, len, 2);
3897         xmlResetLastError();
3898         if (mem_base != xmlMemBlocks()) {
3899             printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3900                    xmlMemBlocks() - mem_base);
3901             test_ret++;
3902             printf(" %d", n_ctx);
3903             printf(" %d", n_value);
3904             printf(" %d", n_len);
3905             printf("\n");
3906         }
3907     }
3908     }
3909     }
3910     function_tests++;
3911
3912     return(test_ret);
3913 }
3914
3915
3916 static int
3917 test_xmlSAX2Characters(void) {
3918     int test_ret = 0;
3919
3920     int mem_base;
3921     void * ctx; /* the user data (XML parser context) */
3922     int n_ctx;
3923     xmlChar * ch; /* a xmlChar string */
3924     int n_ch;
3925     int len; /* the number of xmlChar */
3926     int n_len;
3927
3928     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3929     for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3930     for (n_len = 0;n_len < gen_nb_int;n_len++) {
3931         mem_base = xmlMemBlocks();
3932         ctx = gen_void_ptr(n_ctx, 0);
3933         ch = gen_const_xmlChar_ptr(n_ch, 1);
3934         len = gen_int(n_len, 2);
3935         if ((ch != NULL) &&
3936             (len > (int) strlen((const char *) ch) + 1))
3937             continue;
3938
3939         xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
3940         call_tests++;
3941         des_void_ptr(n_ctx, ctx, 0);
3942         des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
3943         des_int(n_len, len, 2);
3944         xmlResetLastError();
3945         if (mem_base != xmlMemBlocks()) {
3946             printf("Leak of %d blocks found in xmlSAX2Characters",
3947                    xmlMemBlocks() - mem_base);
3948             test_ret++;
3949             printf(" %d", n_ctx);
3950             printf(" %d", n_ch);
3951             printf(" %d", n_len);
3952             printf("\n");
3953         }
3954     }
3955     }
3956     }
3957     function_tests++;
3958
3959     return(test_ret);
3960 }
3961
3962
3963 static int
3964 test_xmlSAX2Comment(void) {
3965     int test_ret = 0;
3966
3967     int mem_base;
3968     void * ctx; /* the user data (XML parser context) */
3969     int n_ctx;
3970     xmlChar * value; /* the xmlSAX2Comment content */
3971     int n_value;
3972
3973     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3974     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3975         mem_base = xmlMemBlocks();
3976         ctx = gen_void_ptr(n_ctx, 0);
3977         value = gen_const_xmlChar_ptr(n_value, 1);
3978
3979         xmlSAX2Comment(ctx, (const xmlChar *)value);
3980         call_tests++;
3981         des_void_ptr(n_ctx, ctx, 0);
3982         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3983         xmlResetLastError();
3984         if (mem_base != xmlMemBlocks()) {
3985             printf("Leak of %d blocks found in xmlSAX2Comment",
3986                    xmlMemBlocks() - mem_base);
3987             test_ret++;
3988             printf(" %d", n_ctx);
3989             printf(" %d", n_value);
3990             printf("\n");
3991         }
3992     }
3993     }
3994     function_tests++;
3995
3996     return(test_ret);
3997 }
3998
3999
4000 static int
4001 test_xmlSAX2ElementDecl(void) {
4002     int test_ret = 0;
4003
4004     int mem_base;
4005     void * ctx; /* the user data (XML parser context) */
4006     int n_ctx;
4007     xmlChar * name; /* the element name */
4008     int n_name;
4009     int type; /* the element type */
4010     int n_type;
4011     xmlElementContentPtr content; /* the element value tree */
4012     int n_content;
4013
4014     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4015     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4016     for (n_type = 0;n_type < gen_nb_int;n_type++) {
4017     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
4018         mem_base = xmlMemBlocks();
4019         ctx = gen_void_ptr(n_ctx, 0);
4020         name = gen_const_xmlChar_ptr(n_name, 1);
4021         type = gen_int(n_type, 2);
4022         content = gen_xmlElementContentPtr(n_content, 3);
4023
4024         xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
4025         call_tests++;
4026         des_void_ptr(n_ctx, ctx, 0);
4027         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4028         des_int(n_type, type, 2);
4029         des_xmlElementContentPtr(n_content, content, 3);
4030         xmlResetLastError();
4031         if (mem_base != xmlMemBlocks()) {
4032             printf("Leak of %d blocks found in xmlSAX2ElementDecl",
4033                    xmlMemBlocks() - mem_base);
4034             test_ret++;
4035             printf(" %d", n_ctx);
4036             printf(" %d", n_name);
4037             printf(" %d", n_type);
4038             printf(" %d", n_content);
4039             printf("\n");
4040         }
4041     }
4042     }
4043     }
4044     }
4045     function_tests++;
4046
4047     return(test_ret);
4048 }
4049
4050
4051 static int
4052 test_xmlSAX2EndDocument(void) {
4053     int test_ret = 0;
4054
4055     int mem_base;
4056     void * ctx; /* the user data (XML parser context) */
4057     int n_ctx;
4058
4059     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4060         mem_base = xmlMemBlocks();
4061         ctx = gen_void_ptr(n_ctx, 0);
4062
4063         xmlSAX2EndDocument(ctx);
4064         call_tests++;
4065         des_void_ptr(n_ctx, ctx, 0);
4066         xmlResetLastError();
4067         if (mem_base != xmlMemBlocks()) {
4068             printf("Leak of %d blocks found in xmlSAX2EndDocument",
4069                    xmlMemBlocks() - mem_base);
4070             test_ret++;
4071             printf(" %d", n_ctx);
4072             printf("\n");
4073         }
4074     }
4075     function_tests++;
4076
4077     return(test_ret);
4078 }
4079
4080
4081 static int
4082 test_xmlSAX2EndElement(void) {
4083     int test_ret = 0;
4084
4085 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
4086 #ifdef LIBXML_SAX1_ENABLED
4087     int mem_base;
4088     void * ctx; /* the user data (XML parser context) */
4089     int n_ctx;
4090     xmlChar * name; /* The element name */
4091     int n_name;
4092
4093     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4094     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4095         mem_base = xmlMemBlocks();
4096         ctx = gen_void_ptr(n_ctx, 0);
4097         name = gen_const_xmlChar_ptr(n_name, 1);
4098
4099         xmlSAX2EndElement(ctx, (const xmlChar *)name);
4100         call_tests++;
4101         des_void_ptr(n_ctx, ctx, 0);
4102         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4103         xmlResetLastError();
4104         if (mem_base != xmlMemBlocks()) {
4105             printf("Leak of %d blocks found in xmlSAX2EndElement",
4106                    xmlMemBlocks() - mem_base);
4107             test_ret++;
4108             printf(" %d", n_ctx);
4109             printf(" %d", n_name);
4110             printf("\n");
4111         }
4112     }
4113     }
4114     function_tests++;
4115 #endif
4116 #endif
4117
4118     return(test_ret);
4119 }
4120
4121
4122 static int
4123 test_xmlSAX2EndElementNs(void) {
4124     int test_ret = 0;
4125
4126     int mem_base;
4127     void * ctx; /* the user data (XML parser context) */
4128     int n_ctx;
4129     xmlChar * localname; /* the local name of the element */
4130     int n_localname;
4131     xmlChar * prefix; /* the element namespace prefix if available */
4132     int n_prefix;
4133     xmlChar * URI; /* the element namespace name if available */
4134     int n_URI;
4135
4136     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4137     for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4138     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4139     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4140         mem_base = xmlMemBlocks();
4141         ctx = gen_void_ptr(n_ctx, 0);
4142         localname = gen_const_xmlChar_ptr(n_localname, 1);
4143         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4144         URI = gen_const_xmlChar_ptr(n_URI, 3);
4145
4146         xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
4147         call_tests++;
4148         des_void_ptr(n_ctx, ctx, 0);
4149         des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
4150         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
4151         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
4152         xmlResetLastError();
4153         if (mem_base != xmlMemBlocks()) {
4154             printf("Leak of %d blocks found in xmlSAX2EndElementNs",
4155                    xmlMemBlocks() - mem_base);
4156             test_ret++;
4157             printf(" %d", n_ctx);
4158             printf(" %d", n_localname);
4159             printf(" %d", n_prefix);
4160             printf(" %d", n_URI);
4161             printf("\n");
4162         }
4163     }
4164     }
4165     }
4166     }
4167     function_tests++;
4168
4169     return(test_ret);
4170 }
4171
4172
4173 static int
4174 test_xmlSAX2EntityDecl(void) {
4175     int test_ret = 0;
4176
4177     int mem_base;
4178     void * ctx; /* the user data (XML parser context) */
4179     int n_ctx;
4180     xmlChar * name; /* the entity name */
4181     int n_name;
4182     int type; /* the entity type */
4183     int n_type;
4184     xmlChar * publicId; /* The public ID of the entity */
4185     int n_publicId;
4186     xmlChar * systemId; /* The system ID of the entity */
4187     int n_systemId;
4188     xmlChar * content; /* the entity value (without processing). */
4189     int n_content;
4190
4191     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4192     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4193     for (n_type = 0;n_type < gen_nb_int;n_type++) {
4194     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4195     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4196     for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4197         mem_base = xmlMemBlocks();
4198         ctx = gen_void_ptr(n_ctx, 0);
4199         name = gen_const_xmlChar_ptr(n_name, 1);
4200         type = gen_int(n_type, 2);
4201         publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4202         systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4203         content = gen_xmlChar_ptr(n_content, 5);
4204
4205         xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
4206         call_tests++;
4207         des_void_ptr(n_ctx, ctx, 0);
4208         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4209         des_int(n_type, type, 2);
4210         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3);
4211         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4);
4212         des_xmlChar_ptr(n_content, content, 5);
4213         xmlResetLastError();
4214         if (mem_base != xmlMemBlocks()) {
4215             printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4216                    xmlMemBlocks() - mem_base);
4217             test_ret++;
4218             printf(" %d", n_ctx);
4219             printf(" %d", n_name);
4220             printf(" %d", n_type);
4221             printf(" %d", n_publicId);
4222             printf(" %d", n_systemId);
4223             printf(" %d", n_content);
4224             printf("\n");
4225         }
4226     }
4227     }
4228     }
4229     }
4230     }
4231     }
4232     function_tests++;
4233
4234     return(test_ret);
4235 }
4236
4237
4238 static int
4239 test_xmlSAX2ExternalSubset(void) {
4240     int test_ret = 0;
4241
4242     int mem_base;
4243     void * ctx; /* the user data (XML parser context) */
4244     int n_ctx;
4245     xmlChar * name; /* the root element name */
4246     int n_name;
4247     xmlChar * ExternalID; /* the external ID */
4248     int n_ExternalID;
4249     xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4250     int n_SystemID;
4251
4252     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4253     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4254     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4255     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4256         mem_base = xmlMemBlocks();
4257         ctx = gen_void_ptr(n_ctx, 0);
4258         name = gen_const_xmlChar_ptr(n_name, 1);
4259         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4260         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4261
4262         xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4263         call_tests++;
4264         des_void_ptr(n_ctx, ctx, 0);
4265         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4266         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4267         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4268         xmlResetLastError();
4269         if (mem_base != xmlMemBlocks()) {
4270             printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4271                    xmlMemBlocks() - mem_base);
4272             test_ret++;
4273             printf(" %d", n_ctx);
4274             printf(" %d", n_name);
4275             printf(" %d", n_ExternalID);
4276             printf(" %d", n_SystemID);
4277             printf("\n");
4278         }
4279     }
4280     }
4281     }
4282     }
4283     function_tests++;
4284
4285     return(test_ret);
4286 }
4287
4288
4289 static int
4290 test_xmlSAX2GetColumnNumber(void) {
4291     int test_ret = 0;
4292
4293     int mem_base;
4294     int ret_val;
4295     void * ctx; /* the user data (XML parser context) */
4296     int n_ctx;
4297
4298     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4299         mem_base = xmlMemBlocks();
4300         ctx = gen_void_ptr(n_ctx, 0);
4301
4302         ret_val = xmlSAX2GetColumnNumber(ctx);
4303         desret_int(ret_val);
4304         call_tests++;
4305         des_void_ptr(n_ctx, ctx, 0);
4306         xmlResetLastError();
4307         if (mem_base != xmlMemBlocks()) {
4308             printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4309                    xmlMemBlocks() - mem_base);
4310             test_ret++;
4311             printf(" %d", n_ctx);
4312             printf("\n");
4313         }
4314     }
4315     function_tests++;
4316
4317     return(test_ret);
4318 }
4319
4320
4321 static int
4322 test_xmlSAX2GetEntity(void) {
4323     int test_ret = 0;
4324
4325     int mem_base;
4326     xmlEntityPtr ret_val;
4327     void * ctx; /* the user data (XML parser context) */
4328     int n_ctx;
4329     xmlChar * name; /* The entity name */
4330     int n_name;
4331
4332     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4333     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4334         mem_base = xmlMemBlocks();
4335         ctx = gen_void_ptr(n_ctx, 0);
4336         name = gen_const_xmlChar_ptr(n_name, 1);
4337
4338         ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
4339         desret_xmlEntityPtr(ret_val);
4340         call_tests++;
4341         des_void_ptr(n_ctx, ctx, 0);
4342         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4343         xmlResetLastError();
4344         if (mem_base != xmlMemBlocks()) {
4345             printf("Leak of %d blocks found in xmlSAX2GetEntity",
4346                    xmlMemBlocks() - mem_base);
4347             test_ret++;
4348             printf(" %d", n_ctx);
4349             printf(" %d", n_name);
4350             printf("\n");
4351         }
4352     }
4353     }
4354     function_tests++;
4355
4356     return(test_ret);
4357 }
4358
4359
4360 static int
4361 test_xmlSAX2GetLineNumber(void) {
4362     int test_ret = 0;
4363
4364     int mem_base;
4365     int ret_val;
4366     void * ctx; /* the user data (XML parser context) */
4367     int n_ctx;
4368
4369     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4370         mem_base = xmlMemBlocks();
4371         ctx = gen_void_ptr(n_ctx, 0);
4372
4373         ret_val = xmlSAX2GetLineNumber(ctx);
4374         desret_int(ret_val);
4375         call_tests++;
4376         des_void_ptr(n_ctx, ctx, 0);
4377         xmlResetLastError();
4378         if (mem_base != xmlMemBlocks()) {
4379             printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4380                    xmlMemBlocks() - mem_base);
4381             test_ret++;
4382             printf(" %d", n_ctx);
4383             printf("\n");
4384         }
4385     }
4386     function_tests++;
4387
4388     return(test_ret);
4389 }
4390
4391
4392 static int
4393 test_xmlSAX2GetParameterEntity(void) {
4394     int test_ret = 0;
4395
4396     int mem_base;
4397     xmlEntityPtr ret_val;
4398     void * ctx; /* the user data (XML parser context) */
4399     int n_ctx;
4400     xmlChar * name; /* The entity name */
4401     int n_name;
4402
4403     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4404     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4405         mem_base = xmlMemBlocks();
4406         ctx = gen_void_ptr(n_ctx, 0);
4407         name = gen_const_xmlChar_ptr(n_name, 1);
4408
4409         ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
4410         desret_xmlEntityPtr(ret_val);
4411         call_tests++;
4412         des_void_ptr(n_ctx, ctx, 0);
4413         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4414         xmlResetLastError();
4415         if (mem_base != xmlMemBlocks()) {
4416             printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4417                    xmlMemBlocks() - mem_base);
4418             test_ret++;
4419             printf(" %d", n_ctx);
4420             printf(" %d", n_name);
4421             printf("\n");
4422         }
4423     }
4424     }
4425     function_tests++;
4426
4427     return(test_ret);
4428 }
4429
4430
4431 static int
4432 test_xmlSAX2GetPublicId(void) {
4433     int test_ret = 0;
4434
4435     int mem_base;
4436     const xmlChar * ret_val;
4437     void * ctx; /* the user data (XML parser context) */
4438     int n_ctx;
4439
4440     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4441         mem_base = xmlMemBlocks();
4442         ctx = gen_void_ptr(n_ctx, 0);
4443
4444         ret_val = xmlSAX2GetPublicId(ctx);
4445         desret_const_xmlChar_ptr(ret_val);
4446         call_tests++;
4447         des_void_ptr(n_ctx, ctx, 0);
4448         xmlResetLastError();
4449         if (mem_base != xmlMemBlocks()) {
4450             printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4451                    xmlMemBlocks() - mem_base);
4452             test_ret++;
4453             printf(" %d", n_ctx);
4454             printf("\n");
4455         }
4456     }
4457     function_tests++;
4458
4459     return(test_ret);
4460 }
4461
4462
4463 static int
4464 test_xmlSAX2GetSystemId(void) {
4465     int test_ret = 0;
4466
4467     int mem_base;
4468     const xmlChar * ret_val;
4469     void * ctx; /* the user data (XML parser context) */
4470     int n_ctx;
4471
4472     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4473         mem_base = xmlMemBlocks();
4474         ctx = gen_void_ptr(n_ctx, 0);
4475
4476         ret_val = xmlSAX2GetSystemId(ctx);
4477         desret_const_xmlChar_ptr(ret_val);
4478         call_tests++;
4479         des_void_ptr(n_ctx, ctx, 0);
4480         xmlResetLastError();
4481         if (mem_base != xmlMemBlocks()) {
4482             printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4483                    xmlMemBlocks() - mem_base);
4484             test_ret++;
4485             printf(" %d", n_ctx);
4486             printf("\n");
4487         }
4488     }
4489     function_tests++;
4490
4491     return(test_ret);
4492 }
4493
4494
4495 static int
4496 test_xmlSAX2HasExternalSubset(void) {
4497     int test_ret = 0;
4498
4499     int mem_base;
4500     int ret_val;
4501     void * ctx; /* the user data (XML parser context) */
4502     int n_ctx;
4503
4504     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4505         mem_base = xmlMemBlocks();
4506         ctx = gen_void_ptr(n_ctx, 0);
4507
4508         ret_val = xmlSAX2HasExternalSubset(ctx);
4509         desret_int(ret_val);
4510         call_tests++;
4511         des_void_ptr(n_ctx, ctx, 0);
4512         xmlResetLastError();
4513         if (mem_base != xmlMemBlocks()) {
4514             printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4515                    xmlMemBlocks() - mem_base);
4516             test_ret++;
4517             printf(" %d", n_ctx);
4518             printf("\n");
4519         }
4520     }
4521     function_tests++;
4522
4523     return(test_ret);
4524 }
4525
4526
4527 static int
4528 test_xmlSAX2HasInternalSubset(void) {
4529     int test_ret = 0;
4530
4531     int mem_base;
4532     int ret_val;
4533     void * ctx; /* the user data (XML parser context) */
4534     int n_ctx;
4535
4536     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4537         mem_base = xmlMemBlocks();
4538         ctx = gen_void_ptr(n_ctx, 0);
4539
4540         ret_val = xmlSAX2HasInternalSubset(ctx);
4541         desret_int(ret_val);
4542         call_tests++;
4543         des_void_ptr(n_ctx, ctx, 0);
4544         xmlResetLastError();
4545         if (mem_base != xmlMemBlocks()) {
4546             printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4547                    xmlMemBlocks() - mem_base);
4548             test_ret++;
4549             printf(" %d", n_ctx);
4550             printf("\n");
4551         }
4552     }
4553     function_tests++;
4554
4555     return(test_ret);
4556 }
4557
4558
4559 static int
4560 test_xmlSAX2IgnorableWhitespace(void) {
4561     int test_ret = 0;
4562
4563     int mem_base;
4564     void * ctx; /* the user data (XML parser context) */
4565     int n_ctx;
4566     xmlChar * ch; /* a xmlChar string */
4567     int n_ch;
4568     int len; /* the number of xmlChar */
4569     int n_len;
4570
4571     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4572     for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4573     for (n_len = 0;n_len < gen_nb_int;n_len++) {
4574         mem_base = xmlMemBlocks();
4575         ctx = gen_void_ptr(n_ctx, 0);
4576         ch = gen_const_xmlChar_ptr(n_ch, 1);
4577         len = gen_int(n_len, 2);
4578         if ((ch != NULL) &&
4579             (len > (int) strlen((const char *) ch) + 1))
4580             continue;
4581
4582         xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
4583         call_tests++;
4584         des_void_ptr(n_ctx, ctx, 0);
4585         des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
4586         des_int(n_len, len, 2);
4587         xmlResetLastError();
4588         if (mem_base != xmlMemBlocks()) {
4589             printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4590                    xmlMemBlocks() - mem_base);
4591             test_ret++;
4592             printf(" %d", n_ctx);
4593             printf(" %d", n_ch);
4594             printf(" %d", n_len);
4595             printf("\n");
4596         }
4597     }
4598     }
4599     }
4600     function_tests++;
4601
4602     return(test_ret);
4603 }
4604
4605
4606 #define gen_nb_xmlSAXHandler_ptr 1
4607 static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4608     return(NULL);
4609 }
4610 static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4611 }
4612
4613 static int
4614 test_xmlSAX2InitDefaultSAXHandler(void) {
4615     int test_ret = 0;
4616
4617     int mem_base;
4618     xmlSAXHandler * hdlr; /* the SAX handler */
4619     int n_hdlr;
4620     int warning; /* flag if non-zero sets the handler warning procedure */
4621     int n_warning;
4622
4623     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4624     for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4625         mem_base = xmlMemBlocks();
4626         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4627         warning = gen_int(n_warning, 1);
4628
4629         xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4630         call_tests++;
4631         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4632         des_int(n_warning, warning, 1);
4633         xmlResetLastError();
4634         if (mem_base != xmlMemBlocks()) {
4635             printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4636                    xmlMemBlocks() - mem_base);
4637             test_ret++;
4638             printf(" %d", n_hdlr);
4639             printf(" %d", n_warning);
4640             printf("\n");
4641         }
4642     }
4643     }
4644     function_tests++;
4645
4646     return(test_ret);
4647 }
4648
4649
4650 static int
4651 test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4652     int test_ret = 0;
4653
4654 #if defined(LIBXML_DOCB_ENABLED)
4655     int mem_base;
4656     xmlSAXHandler * hdlr; /* the SAX handler */
4657     int n_hdlr;
4658
4659     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4660         mem_base = xmlMemBlocks();
4661         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4662
4663         xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4664         call_tests++;
4665         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4666         xmlResetLastError();
4667         if (mem_base != xmlMemBlocks()) {
4668             printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
4669                    xmlMemBlocks() - mem_base);
4670             test_ret++;
4671             printf(" %d", n_hdlr);
4672             printf("\n");
4673         }
4674     }
4675     function_tests++;
4676 #endif
4677
4678     return(test_ret);
4679 }
4680
4681
4682 static int
4683 test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4684     int test_ret = 0;
4685
4686 #if defined(LIBXML_HTML_ENABLED)
4687     int mem_base;
4688     xmlSAXHandler * hdlr; /* the SAX handler */
4689     int n_hdlr;
4690
4691     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4692         mem_base = xmlMemBlocks();
4693         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4694
4695         xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4696         call_tests++;
4697         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4698         xmlResetLastError();
4699         if (mem_base != xmlMemBlocks()) {
4700             printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4701                    xmlMemBlocks() - mem_base);
4702             test_ret++;
4703             printf(" %d", n_hdlr);
4704             printf("\n");
4705         }
4706     }
4707     function_tests++;
4708 #endif
4709
4710     return(test_ret);
4711 }
4712
4713
4714 static int
4715 test_xmlSAX2InternalSubset(void) {
4716     int test_ret = 0;
4717
4718     int mem_base;
4719     void * ctx; /* the user data (XML parser context) */
4720     int n_ctx;
4721     xmlChar * name; /* the root element name */
4722     int n_name;
4723     xmlChar * ExternalID; /* the external ID */
4724     int n_ExternalID;
4725     xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4726     int n_SystemID;
4727
4728     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4729     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4730     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4731     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4732         mem_base = xmlMemBlocks();
4733         ctx = gen_void_ptr(n_ctx, 0);
4734         name = gen_const_xmlChar_ptr(n_name, 1);
4735         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4736         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4737
4738         xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4739         call_tests++;
4740         des_void_ptr(n_ctx, ctx, 0);
4741         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4742         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4743         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4744         xmlResetLastError();
4745         if (mem_base != xmlMemBlocks()) {
4746             printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4747                    xmlMemBlocks() - mem_base);
4748             test_ret++;
4749             printf(" %d", n_ctx);
4750             printf(" %d", n_name);
4751             printf(" %d", n_ExternalID);
4752             printf(" %d", n_SystemID);
4753             printf("\n");
4754         }
4755     }
4756     }
4757     }
4758     }
4759     function_tests++;
4760
4761     return(test_ret);
4762 }
4763
4764
4765 static int
4766 test_xmlSAX2IsStandalone(void) {
4767     int test_ret = 0;
4768
4769     int mem_base;
4770     int ret_val;
4771     void * ctx; /* the user data (XML parser context) */
4772     int n_ctx;
4773
4774     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4775         mem_base = xmlMemBlocks();
4776         ctx = gen_void_ptr(n_ctx, 0);
4777
4778         ret_val = xmlSAX2IsStandalone(ctx);
4779         desret_int(ret_val);
4780         call_tests++;
4781         des_void_ptr(n_ctx, ctx, 0);
4782         xmlResetLastError();
4783         if (mem_base != xmlMemBlocks()) {
4784             printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4785                    xmlMemBlocks() - mem_base);
4786             test_ret++;
4787             printf(" %d", n_ctx);
4788             printf("\n");
4789         }
4790     }
4791     function_tests++;
4792
4793     return(test_ret);
4794 }
4795
4796
4797 static int
4798 test_xmlSAX2NotationDecl(void) {
4799     int test_ret = 0;
4800
4801     int mem_base;
4802     void * ctx; /* the user data (XML parser context) */
4803     int n_ctx;
4804     xmlChar * name; /* The name of the notation */
4805     int n_name;
4806     xmlChar * publicId; /* The public ID of the entity */
4807     int n_publicId;
4808     xmlChar * systemId; /* The system ID of the entity */
4809     int n_systemId;
4810
4811     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4812     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4813     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4814     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4815         mem_base = xmlMemBlocks();
4816         ctx = gen_void_ptr(n_ctx, 0);
4817         name = gen_const_xmlChar_ptr(n_name, 1);
4818         publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4819         systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4820
4821         xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
4822         call_tests++;
4823         des_void_ptr(n_ctx, ctx, 0);
4824         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4825         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
4826         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
4827         xmlResetLastError();
4828         if (mem_base != xmlMemBlocks()) {
4829             printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4830                    xmlMemBlocks() - mem_base);
4831             test_ret++;
4832             printf(" %d", n_ctx);
4833             printf(" %d", n_name);
4834             printf(" %d", n_publicId);
4835             printf(" %d", n_systemId);
4836             printf("\n");
4837         }
4838     }
4839     }
4840     }
4841     }
4842     function_tests++;
4843
4844     return(test_ret);
4845 }
4846
4847
4848 static int
4849 test_xmlSAX2ProcessingInstruction(void) {
4850     int test_ret = 0;
4851
4852     int mem_base;
4853     void * ctx; /* the user data (XML parser context) */
4854     int n_ctx;
4855     xmlChar * target; /* the target name */
4856     int n_target;
4857     xmlChar * data; /* the PI data's */
4858     int n_data;
4859
4860     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4861     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4862     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4863         mem_base = xmlMemBlocks();
4864         ctx = gen_void_ptr(n_ctx, 0);
4865         target = gen_const_xmlChar_ptr(n_target, 1);
4866         data = gen_const_xmlChar_ptr(n_data, 2);
4867
4868         xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
4869         call_tests++;
4870         des_void_ptr(n_ctx, ctx, 0);
4871         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
4872         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2);
4873         xmlResetLastError();
4874         if (mem_base != xmlMemBlocks()) {
4875             printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4876                    xmlMemBlocks() - mem_base);
4877             test_ret++;
4878             printf(" %d", n_ctx);
4879             printf(" %d", n_target);
4880             printf(" %d", n_data);
4881             printf("\n");
4882         }
4883     }
4884     }
4885     }
4886     function_tests++;
4887
4888     return(test_ret);
4889 }
4890
4891
4892 static int
4893 test_xmlSAX2Reference(void) {
4894     int test_ret = 0;
4895
4896     int mem_base;
4897     void * ctx; /* the user data (XML parser context) */
4898     int n_ctx;
4899     xmlChar * name; /* The entity name */
4900     int n_name;
4901
4902     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4903     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4904         mem_base = xmlMemBlocks();
4905         ctx = gen_void_ptr(n_ctx, 0);
4906         name = gen_const_xmlChar_ptr(n_name, 1);
4907
4908         xmlSAX2Reference(ctx, (const xmlChar *)name);
4909         call_tests++;
4910         des_void_ptr(n_ctx, ctx, 0);
4911         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4912         xmlResetLastError();
4913         if (mem_base != xmlMemBlocks()) {
4914             printf("Leak of %d blocks found in xmlSAX2Reference",
4915                    xmlMemBlocks() - mem_base);
4916             test_ret++;
4917             printf(" %d", n_ctx);
4918             printf(" %d", n_name);
4919             printf("\n");
4920         }
4921     }
4922     }
4923     function_tests++;
4924
4925     return(test_ret);
4926 }
4927
4928
4929 static int
4930 test_xmlSAX2ResolveEntity(void) {
4931     int test_ret = 0;
4932
4933     int mem_base;
4934     xmlParserInputPtr ret_val;
4935     void * ctx; /* the user data (XML parser context) */
4936     int n_ctx;
4937     xmlChar * publicId; /* The public ID of the entity */
4938     int n_publicId;
4939     xmlChar * systemId; /* The system ID of the entity */
4940     int n_systemId;
4941
4942     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4943     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4944     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4945         mem_base = xmlMemBlocks();
4946         ctx = gen_void_ptr(n_ctx, 0);
4947         publicId = gen_const_xmlChar_ptr(n_publicId, 1);
4948         systemId = gen_const_xmlChar_ptr(n_systemId, 2);
4949
4950         ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
4951         desret_xmlParserInputPtr(ret_val);
4952         call_tests++;
4953         des_void_ptr(n_ctx, ctx, 0);
4954         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1);
4955         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2);
4956         xmlResetLastError();
4957         if (mem_base != xmlMemBlocks()) {
4958             printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
4959                    xmlMemBlocks() - mem_base);
4960             test_ret++;
4961             printf(" %d", n_ctx);
4962             printf(" %d", n_publicId);
4963             printf(" %d", n_systemId);
4964             printf("\n");
4965         }
4966     }
4967     }
4968     }
4969     function_tests++;
4970
4971     return(test_ret);
4972 }
4973
4974
4975 #define gen_nb_xmlSAXLocatorPtr 1
4976 static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4977     return(NULL);
4978 }
4979 static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4980 }
4981
4982 static int
4983 test_xmlSAX2SetDocumentLocator(void) {
4984     int test_ret = 0;
4985
4986     int mem_base;
4987     void * ctx; /* the user data (XML parser context) */
4988     int n_ctx;
4989     xmlSAXLocatorPtr loc; /* A SAX Locator */
4990     int n_loc;
4991
4992     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4993     for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
4994         mem_base = xmlMemBlocks();
4995         ctx = gen_void_ptr(n_ctx, 0);
4996         loc = gen_xmlSAXLocatorPtr(n_loc, 1);
4997
4998         xmlSAX2SetDocumentLocator(ctx, loc);
4999         call_tests++;
5000         des_void_ptr(n_ctx, ctx, 0);
5001         des_xmlSAXLocatorPtr(n_loc, loc, 1);
5002         xmlResetLastError();
5003         if (mem_base != xmlMemBlocks()) {
5004             printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
5005                    xmlMemBlocks() - mem_base);
5006             test_ret++;
5007             printf(" %d", n_ctx);
5008             printf(" %d", n_loc);
5009             printf("\n");
5010         }
5011     }
5012     }
5013     function_tests++;
5014
5015     return(test_ret);
5016 }
5017
5018
5019 static int
5020 test_xmlSAX2StartDocument(void) {
5021     int test_ret = 0;
5022
5023     int mem_base;
5024     void * ctx; /* the user data (XML parser context) */
5025     int n_ctx;
5026
5027     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5028         mem_base = xmlMemBlocks();
5029         ctx = gen_void_ptr(n_ctx, 0);
5030
5031         xmlSAX2StartDocument(ctx);
5032         call_tests++;
5033         des_void_ptr(n_ctx, ctx, 0);
5034         xmlResetLastError();
5035         if (mem_base != xmlMemBlocks()) {
5036             printf("Leak of %d blocks found in xmlSAX2StartDocument",
5037                    xmlMemBlocks() - mem_base);
5038             test_ret++;
5039             printf(" %d", n_ctx);
5040             printf("\n");
5041         }
5042     }
5043     function_tests++;
5044
5045     return(test_ret);
5046 }
5047
5048
5049 static int
5050 test_xmlSAX2StartElement(void) {
5051     int test_ret = 0;
5052
5053 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
5054 #ifdef LIBXML_SAX1_ENABLED
5055     int mem_base;
5056     void * ctx; /* the user data (XML parser context) */
5057     int n_ctx;
5058     xmlChar * fullname; /* The element name, including namespace prefix */
5059     int n_fullname;
5060     xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
5061     int n_atts;
5062
5063     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5064     for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
5065     for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
5066         mem_base = xmlMemBlocks();
5067         ctx = gen_void_ptr(n_ctx, 0);
5068         fullname = gen_const_xmlChar_ptr(n_fullname, 1);
5069         atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
5070
5071         xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
5072         call_tests++;
5073         des_void_ptr(n_ctx, ctx, 0);
5074         des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1);
5075         des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2);
5076         xmlResetLastError();
5077         if (mem_base != xmlMemBlocks()) {
5078             printf("Leak of %d blocks found in xmlSAX2StartElement",
5079                    xmlMemBlocks() - mem_base);
5080             test_ret++;
5081             printf(" %d", n_ctx);
5082             printf(" %d", n_fullname);
5083             printf(" %d", n_atts);
5084             printf("\n");
5085         }
5086     }
5087     }
5088     }
5089     function_tests++;
5090 #endif
5091 #endif
5092
5093     return(test_ret);
5094 }
5095
5096
5097 static int
5098 test_xmlSAX2StartElementNs(void) {
5099     int test_ret = 0;
5100
5101     int mem_base;
5102     void * ctx; /* the user data (XML parser context) */
5103     int n_ctx;
5104     xmlChar * localname; /* the local name of the element */
5105     int n_localname;
5106     xmlChar * prefix; /* the element namespace prefix if available */
5107     int n_prefix;
5108     xmlChar * URI; /* the element namespace name if available */
5109     int n_URI;
5110     int nb_namespaces; /* number of namespace definitions on that node */
5111     int n_nb_namespaces;
5112     xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
5113     int n_namespaces;
5114     int nb_attributes; /* the number of attributes on that node */
5115     int n_nb_attributes;
5116     int nb_defaulted; /* the number of defaulted attributes. */
5117     int n_nb_defaulted;
5118     xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
5119     int n_attributes;
5120
5121     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5122     for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
5123     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
5124     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5125     for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
5126     for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
5127     for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
5128     for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
5129     for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
5130         mem_base = xmlMemBlocks();
5131         ctx = gen_void_ptr(n_ctx, 0);
5132         localname = gen_const_xmlChar_ptr(n_localname, 1);
5133         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
5134         URI = gen_const_xmlChar_ptr(n_URI, 3);
5135         nb_namespaces = gen_int(n_nb_namespaces, 4);
5136         namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
5137         nb_attributes = gen_int(n_nb_attributes, 6);
5138         nb_defaulted = gen_int(n_nb_defaulted, 7);
5139         attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
5140
5141         xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
5142         call_tests++;
5143         des_void_ptr(n_ctx, ctx, 0);
5144         des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
5145         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
5146         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
5147         des_int(n_nb_namespaces, nb_namespaces, 4);
5148         des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5);
5149         des_int(n_nb_attributes, nb_attributes, 6);
5150         des_int(n_nb_defaulted, nb_defaulted, 7);
5151         des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8);
5152         xmlResetLastError();
5153         if (mem_base != xmlMemBlocks()) {
5154             printf("Leak of %d blocks found in xmlSAX2StartElementNs",
5155                    xmlMemBlocks() - mem_base);
5156             test_ret++;
5157             printf(" %d", n_ctx);
5158             printf(" %d", n_localname);
5159             printf(" %d", n_prefix);
5160             printf(" %d", n_URI);
5161             printf(" %d", n_nb_namespaces);
5162             printf(" %d", n_namespaces);
5163             printf(" %d", n_nb_attributes);
5164             printf(" %d", n_nb_defaulted);
5165             printf(" %d", n_attributes);
5166             printf("\n");
5167         }
5168     }
5169     }
5170     }
5171     }
5172     }
5173     }
5174     }
5175     }
5176     }
5177     function_tests++;
5178
5179     return(test_ret);
5180 }
5181
5182
5183 static int
5184 test_xmlSAX2UnparsedEntityDecl(void) {
5185     int test_ret = 0;
5186
5187     int mem_base;
5188     void * ctx; /* the user data (XML parser context) */
5189     int n_ctx;
5190     xmlChar * name; /* The name of the entity */
5191     int n_name;
5192     xmlChar * publicId; /* The public ID of the entity */
5193     int n_publicId;
5194     xmlChar * systemId; /* The system ID of the entity */
5195     int n_systemId;
5196     xmlChar * notationName; /* the name of the notation */
5197     int n_notationName;
5198
5199     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5200     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5201     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5202     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5203     for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5204         mem_base = xmlMemBlocks();
5205         ctx = gen_void_ptr(n_ctx, 0);
5206         name = gen_const_xmlChar_ptr(n_name, 1);
5207         publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5208         systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5209         notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5210
5211         xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
5212         call_tests++;
5213         des_void_ptr(n_ctx, ctx, 0);
5214         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
5215         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
5216         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
5217         des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4);
5218         xmlResetLastError();
5219         if (mem_base != xmlMemBlocks()) {
5220             printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5221                    xmlMemBlocks() - mem_base);
5222             test_ret++;
5223             printf(" %d", n_ctx);
5224             printf(" %d", n_name);
5225             printf(" %d", n_publicId);
5226             printf(" %d", n_systemId);
5227             printf(" %d", n_notationName);
5228             printf("\n");
5229         }
5230     }
5231     }
5232     }
5233     }
5234     }
5235     function_tests++;
5236
5237     return(test_ret);
5238 }
5239
5240
5241 static int
5242 test_xmlSAXDefaultVersion(void) {
5243     int test_ret = 0;
5244
5245 #if defined(LIBXML_SAX1_ENABLED)
5246 #ifdef LIBXML_SAX1_ENABLED
5247     int mem_base;
5248     int ret_val;
5249     int version; /* the version, 1 or 2 */
5250     int n_version;
5251
5252     for (n_version = 0;n_version < gen_nb_int;n_version++) {
5253         mem_base = xmlMemBlocks();
5254         version = gen_int(n_version, 0);
5255
5256         ret_val = xmlSAXDefaultVersion(version);
5257         desret_int(ret_val);
5258         call_tests++;
5259         des_int(n_version, version, 0);
5260         xmlResetLastError();
5261         if (mem_base != xmlMemBlocks()) {
5262             printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5263                    xmlMemBlocks() - mem_base);
5264             test_ret++;
5265             printf(" %d", n_version);
5266             printf("\n");
5267         }
5268     }
5269     function_tests++;
5270 #endif
5271 #endif
5272
5273     return(test_ret);
5274 }
5275
5276
5277 static int
5278 test_xmlSAXVersion(void) {
5279     int test_ret = 0;
5280
5281     int mem_base;
5282     int ret_val;
5283     xmlSAXHandler * hdlr; /* the SAX handler */
5284     int n_hdlr;
5285     int version; /* the version, 1 or 2 */
5286     int n_version;
5287
5288     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5289     for (n_version = 0;n_version < gen_nb_int;n_version++) {
5290         mem_base = xmlMemBlocks();
5291         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5292         version = gen_int(n_version, 1);
5293
5294         ret_val = xmlSAXVersion(hdlr, version);
5295         desret_int(ret_val);
5296         call_tests++;
5297         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5298         des_int(n_version, version, 1);
5299         xmlResetLastError();
5300         if (mem_base != xmlMemBlocks()) {
5301             printf("Leak of %d blocks found in xmlSAXVersion",
5302                    xmlMemBlocks() - mem_base);
5303             test_ret++;
5304             printf(" %d", n_hdlr);
5305             printf(" %d", n_version);
5306             printf("\n");
5307         }
5308     }
5309     }
5310     function_tests++;
5311
5312     return(test_ret);
5313 }
5314
5315 static int
5316 test_SAX2(void) {
5317     int test_ret = 0;
5318
5319     if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
5320     test_ret += test_docbDefaultSAXHandlerInit();
5321     test_ret += test_htmlDefaultSAXHandlerInit();
5322     test_ret += test_xmlDefaultSAXHandlerInit();
5323     test_ret += test_xmlSAX2AttributeDecl();
5324     test_ret += test_xmlSAX2CDataBlock();
5325     test_ret += test_xmlSAX2Characters();
5326     test_ret += test_xmlSAX2Comment();
5327     test_ret += test_xmlSAX2ElementDecl();
5328     test_ret += test_xmlSAX2EndDocument();
5329     test_ret += test_xmlSAX2EndElement();
5330     test_ret += test_xmlSAX2EndElementNs();
5331     test_ret += test_xmlSAX2EntityDecl();
5332     test_ret += test_xmlSAX2ExternalSubset();
5333     test_ret += test_xmlSAX2GetColumnNumber();
5334     test_ret += test_xmlSAX2GetEntity();
5335     test_ret += test_xmlSAX2GetLineNumber();
5336     test_ret += test_xmlSAX2GetParameterEntity();
5337     test_ret += test_xmlSAX2GetPublicId();
5338     test_ret += test_xmlSAX2GetSystemId();
5339     test_ret += test_xmlSAX2HasExternalSubset();
5340     test_ret += test_xmlSAX2HasInternalSubset();
5341     test_ret += test_xmlSAX2IgnorableWhitespace();
5342     test_ret += test_xmlSAX2InitDefaultSAXHandler();
5343     test_ret += test_xmlSAX2InitDocbDefaultSAXHandler();
5344     test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
5345     test_ret += test_xmlSAX2InternalSubset();
5346     test_ret += test_xmlSAX2IsStandalone();
5347     test_ret += test_xmlSAX2NotationDecl();
5348     test_ret += test_xmlSAX2ProcessingInstruction();
5349     test_ret += test_xmlSAX2Reference();
5350     test_ret += test_xmlSAX2ResolveEntity();
5351     test_ret += test_xmlSAX2SetDocumentLocator();
5352     test_ret += test_xmlSAX2StartDocument();
5353     test_ret += test_xmlSAX2StartElement();
5354     test_ret += test_xmlSAX2StartElementNs();
5355     test_ret += test_xmlSAX2UnparsedEntityDecl();
5356     test_ret += test_xmlSAXDefaultVersion();
5357     test_ret += test_xmlSAXVersion();
5358
5359     if (test_ret != 0)
5360         printf("Module SAX2: %d errors\n", test_ret);
5361     return(test_ret);
5362 }
5363
5364 static int
5365 test_xmlC14NDocDumpMemory(void) {
5366     int test_ret = 0;
5367
5368 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5369     int mem_base;
5370     int ret_val;
5371     xmlDocPtr doc; /* the XML document for canonization */
5372     int n_doc;
5373     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5374     int n_nodes;
5375     int mode; /* the c14n mode (see @xmlC14NMode) */
5376     int n_mode;
5377     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) */
5378     int n_inclusive_ns_prefixes;
5379     int with_comments; /* include comments in the result (!=0) or not (==0) */
5380     int n_with_comments;
5381     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 */
5382     int n_doc_txt_ptr;
5383
5384     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5385     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5386     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5387     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5388     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5389     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5390         mem_base = xmlMemBlocks();
5391         doc = gen_xmlDocPtr(n_doc, 0);
5392         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5393         mode = gen_int(n_mode, 2);
5394         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5395         with_comments = gen_int(n_with_comments, 4);
5396         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5397
5398         ret_val = xmlC14NDocDumpMemory(doc, nodes, mode, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5399         desret_int(ret_val);
5400         call_tests++;
5401         des_xmlDocPtr(n_doc, doc, 0);
5402         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5403         des_int(n_mode, mode, 2);
5404         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5405         des_int(n_with_comments, with_comments, 4);
5406         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5407         xmlResetLastError();
5408         if (mem_base != xmlMemBlocks()) {
5409             printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5410                    xmlMemBlocks() - mem_base);
5411             test_ret++;
5412             printf(" %d", n_doc);
5413             printf(" %d", n_nodes);
5414             printf(" %d", n_mode);
5415             printf(" %d", n_inclusive_ns_prefixes);
5416             printf(" %d", n_with_comments);
5417             printf(" %d", n_doc_txt_ptr);
5418             printf("\n");
5419         }
5420     }
5421     }
5422     }
5423     }
5424     }
5425     }
5426     function_tests++;
5427 #endif
5428
5429     return(test_ret);
5430 }
5431
5432
5433 static int
5434 test_xmlC14NDocSave(void) {
5435     int test_ret = 0;
5436
5437 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5438     int mem_base;
5439     int ret_val;
5440     xmlDocPtr doc; /* the XML document for canonization */
5441     int n_doc;
5442     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5443     int n_nodes;
5444     int mode; /* the c14n mode (see @xmlC14NMode) */
5445     int n_mode;
5446     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) */
5447     int n_inclusive_ns_prefixes;
5448     int with_comments; /* include comments in the result (!=0) or not (==0) */
5449     int n_with_comments;
5450     const char * filename; /* the filename to store canonical XML image */
5451     int n_filename;
5452     int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5453     int n_compression;
5454
5455     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5456     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5457     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5458     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5459     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5460     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5461     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5462         mem_base = xmlMemBlocks();
5463         doc = gen_xmlDocPtr(n_doc, 0);
5464         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5465         mode = gen_int(n_mode, 2);
5466         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5467         with_comments = gen_int(n_with_comments, 4);
5468         filename = gen_fileoutput(n_filename, 5);
5469         compression = gen_int(n_compression, 6);
5470
5471         ret_val = xmlC14NDocSave(doc, nodes, mode, inclusive_ns_prefixes, with_comments, filename, compression);
5472         desret_int(ret_val);
5473         call_tests++;
5474         des_xmlDocPtr(n_doc, doc, 0);
5475         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5476         des_int(n_mode, mode, 2);
5477         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5478         des_int(n_with_comments, with_comments, 4);
5479         des_fileoutput(n_filename, filename, 5);
5480         des_int(n_compression, compression, 6);
5481         xmlResetLastError();
5482         if (mem_base != xmlMemBlocks()) {
5483             printf("Leak of %d blocks found in xmlC14NDocSave",
5484                    xmlMemBlocks() - mem_base);
5485             test_ret++;
5486             printf(" %d", n_doc);
5487             printf(" %d", n_nodes);
5488             printf(" %d", n_mode);
5489             printf(" %d", n_inclusive_ns_prefixes);
5490             printf(" %d", n_with_comments);
5491             printf(" %d", n_filename);
5492             printf(" %d", n_compression);
5493             printf("\n");
5494         }
5495     }
5496     }
5497     }
5498     }
5499     }
5500     }
5501     }
5502     function_tests++;
5503 #endif
5504
5505     return(test_ret);
5506 }
5507
5508
5509 static int
5510 test_xmlC14NDocSaveTo(void) {
5511     int test_ret = 0;
5512
5513 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5514     int mem_base;
5515     int ret_val;
5516     xmlDocPtr doc; /* the XML document for canonization */
5517     int n_doc;
5518     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5519     int n_nodes;
5520     int mode; /* the c14n mode (see @xmlC14NMode) */
5521     int n_mode;
5522     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) */
5523     int n_inclusive_ns_prefixes;
5524     int with_comments; /* include comments in the result (!=0) or not (==0) */
5525     int n_with_comments;
5526     xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5527     int n_buf;
5528
5529     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5530     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5531     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5532     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5533     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5534     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5535         mem_base = xmlMemBlocks();
5536         doc = gen_xmlDocPtr(n_doc, 0);
5537         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5538         mode = gen_int(n_mode, 2);
5539         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5540         with_comments = gen_int(n_with_comments, 4);
5541         buf = gen_xmlOutputBufferPtr(n_buf, 5);
5542
5543         ret_val = xmlC14NDocSaveTo(doc, nodes, mode, inclusive_ns_prefixes, with_comments, buf);
5544         desret_int(ret_val);
5545         call_tests++;
5546         des_xmlDocPtr(n_doc, doc, 0);
5547         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5548         des_int(n_mode, mode, 2);
5549         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5550         des_int(n_with_comments, with_comments, 4);
5551         des_xmlOutputBufferPtr(n_buf, buf, 5);
5552         xmlResetLastError();
5553         if (mem_base != xmlMemBlocks()) {
5554             printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5555                    xmlMemBlocks() - mem_base);
5556             test_ret++;
5557             printf(" %d", n_doc);
5558             printf(" %d", n_nodes);
5559             printf(" %d", n_mode);
5560             printf(" %d", n_inclusive_ns_prefixes);
5561             printf(" %d", n_with_comments);
5562             printf(" %d", n_buf);
5563             printf("\n");
5564         }
5565     }
5566     }
5567     }
5568     }
5569     }
5570     }
5571     function_tests++;
5572 #endif
5573
5574     return(test_ret);
5575 }
5576
5577
5578 static int
5579 test_xmlC14NExecute(void) {
5580     int test_ret = 0;
5581
5582
5583     /* missing type support */
5584     return(test_ret);
5585 }
5586
5587 static int
5588 test_c14n(void) {
5589     int test_ret = 0;
5590
5591     if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
5592     test_ret += test_xmlC14NDocDumpMemory();
5593     test_ret += test_xmlC14NDocSave();
5594     test_ret += test_xmlC14NDocSaveTo();
5595     test_ret += test_xmlC14NExecute();
5596
5597     if (test_ret != 0)
5598         printf("Module c14n: %d errors\n", test_ret);
5599     return(test_ret);
5600 }
5601 #ifdef LIBXML_CATALOG_ENABLED
5602
5603 #define gen_nb_xmlCatalogPtr 1
5604 static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5605     return(NULL);
5606 }
5607 static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5608 }
5609 #endif
5610
5611
5612 static int
5613 test_xmlACatalogAdd(void) {
5614     int test_ret = 0;
5615
5616 #if defined(LIBXML_CATALOG_ENABLED)
5617     int mem_base;
5618     int ret_val;
5619     xmlCatalogPtr catal; /* a Catalog */
5620     int n_catal;
5621     xmlChar * type; /* the type of record to add to the catalog */
5622     int n_type;
5623     xmlChar * orig; /* the system, public or prefix to match */
5624     int n_orig;
5625     xmlChar * replace; /* the replacement value for the match */
5626     int n_replace;
5627
5628     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5629     for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5630     for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5631     for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5632         mem_base = xmlMemBlocks();
5633         catal = gen_xmlCatalogPtr(n_catal, 0);
5634         type = gen_const_xmlChar_ptr(n_type, 1);
5635         orig = gen_const_xmlChar_ptr(n_orig, 2);
5636         replace = gen_const_xmlChar_ptr(n_replace, 3);
5637
5638         ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5639         desret_int(ret_val);
5640         call_tests++;
5641         des_xmlCatalogPtr(n_catal, catal, 0);
5642         des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1);
5643         des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2);
5644         des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3);
5645         xmlResetLastError();
5646         if (mem_base != xmlMemBlocks()) {
5647             printf("Leak of %d blocks found in xmlACatalogAdd",
5648                    xmlMemBlocks() - mem_base);
5649             test_ret++;
5650             printf(" %d", n_catal);
5651             printf(" %d", n_type);
5652             printf(" %d", n_orig);
5653             printf(" %d", n_replace);
5654             printf("\n");
5655         }
5656     }
5657     }
5658     }
5659     }
5660     function_tests++;
5661 #endif
5662
5663     return(test_ret);
5664 }
5665
5666
5667 static int
5668 test_xmlACatalogDump(void) {
5669     int test_ret = 0;
5670
5671 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5672     int mem_base;
5673     xmlCatalogPtr catal; /* a Catalog */
5674     int n_catal;
5675     FILE * out; /* the file. */
5676     int n_out;
5677
5678     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5679     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5680         mem_base = xmlMemBlocks();
5681         catal = gen_xmlCatalogPtr(n_catal, 0);
5682         out = gen_FILE_ptr(n_out, 1);
5683
5684         xmlACatalogDump(catal, out);
5685         call_tests++;
5686         des_xmlCatalogPtr(n_catal, catal, 0);
5687         des_FILE_ptr(n_out, out, 1);
5688         xmlResetLastError();
5689         if (mem_base != xmlMemBlocks()) {
5690             printf("Leak of %d blocks found in xmlACatalogDump",
5691                    xmlMemBlocks() - mem_base);
5692             test_ret++;
5693             printf(" %d", n_catal);
5694             printf(" %d", n_out);
5695             printf("\n");
5696         }
5697     }
5698     }
5699     function_tests++;
5700 #endif
5701
5702     return(test_ret);
5703 }
5704
5705
5706 static int
5707 test_xmlACatalogRemove(void) {
5708     int test_ret = 0;
5709
5710 #if defined(LIBXML_CATALOG_ENABLED)
5711     int mem_base;
5712     int ret_val;
5713     xmlCatalogPtr catal; /* a Catalog */
5714     int n_catal;
5715     xmlChar * value; /* the value to remove */
5716     int n_value;
5717
5718     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5719     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5720         mem_base = xmlMemBlocks();
5721         catal = gen_xmlCatalogPtr(n_catal, 0);
5722         value = gen_const_xmlChar_ptr(n_value, 1);
5723
5724         ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
5725         desret_int(ret_val);
5726         call_tests++;
5727         des_xmlCatalogPtr(n_catal, catal, 0);
5728         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
5729         xmlResetLastError();
5730         if (mem_base != xmlMemBlocks()) {
5731             printf("Leak of %d blocks found in xmlACatalogRemove",
5732                    xmlMemBlocks() - mem_base);
5733             test_ret++;
5734             printf(" %d", n_catal);
5735             printf(" %d", n_value);
5736             printf("\n");
5737         }
5738     }
5739     }
5740     function_tests++;
5741 #endif
5742
5743     return(test_ret);
5744 }
5745
5746
5747 static int
5748 test_xmlACatalogResolve(void) {
5749     int test_ret = 0;
5750
5751 #if defined(LIBXML_CATALOG_ENABLED)
5752     int mem_base;
5753     xmlChar * ret_val;
5754     xmlCatalogPtr catal; /* a Catalog */
5755     int n_catal;
5756     xmlChar * pubID; /* the public ID string */
5757     int n_pubID;
5758     xmlChar * sysID; /* the system ID string */
5759     int n_sysID;
5760
5761     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5762     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5763     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5764         mem_base = xmlMemBlocks();
5765         catal = gen_xmlCatalogPtr(n_catal, 0);
5766         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5767         sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5768
5769         ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
5770         desret_xmlChar_ptr(ret_val);
5771         call_tests++;
5772         des_xmlCatalogPtr(n_catal, catal, 0);
5773         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5774         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5775         xmlResetLastError();
5776         if (mem_base != xmlMemBlocks()) {
5777             printf("Leak of %d blocks found in xmlACatalogResolve",
5778                    xmlMemBlocks() - mem_base);
5779             test_ret++;
5780             printf(" %d", n_catal);
5781             printf(" %d", n_pubID);
5782             printf(" %d", n_sysID);
5783             printf("\n");
5784         }
5785     }
5786     }
5787     }
5788     function_tests++;
5789 #endif
5790
5791     return(test_ret);
5792 }
5793
5794
5795 static int
5796 test_xmlACatalogResolvePublic(void) {
5797     int test_ret = 0;
5798
5799 #if defined(LIBXML_CATALOG_ENABLED)
5800     int mem_base;
5801     xmlChar * ret_val;
5802     xmlCatalogPtr catal; /* a Catalog */
5803     int n_catal;
5804     xmlChar * pubID; /* the public ID string */
5805     int n_pubID;
5806
5807     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5808     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5809         mem_base = xmlMemBlocks();
5810         catal = gen_xmlCatalogPtr(n_catal, 0);
5811         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5812
5813         ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
5814         desret_xmlChar_ptr(ret_val);
5815         call_tests++;
5816         des_xmlCatalogPtr(n_catal, catal, 0);
5817         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5818         xmlResetLastError();
5819         if (mem_base != xmlMemBlocks()) {
5820             printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5821                    xmlMemBlocks() - mem_base);
5822             test_ret++;
5823             printf(" %d", n_catal);
5824             printf(" %d", n_pubID);
5825             printf("\n");
5826         }
5827     }
5828     }
5829     function_tests++;
5830 #endif
5831
5832     return(test_ret);
5833 }
5834
5835
5836 static int
5837 test_xmlACatalogResolveSystem(void) {
5838     int test_ret = 0;
5839
5840 #if defined(LIBXML_CATALOG_ENABLED)
5841     int mem_base;
5842     xmlChar * ret_val;
5843     xmlCatalogPtr catal; /* a Catalog */
5844     int n_catal;
5845     xmlChar * sysID; /* the system ID string */
5846     int n_sysID;
5847
5848     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5849     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5850         mem_base = xmlMemBlocks();
5851         catal = gen_xmlCatalogPtr(n_catal, 0);
5852         sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5853
5854         ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
5855         desret_xmlChar_ptr(ret_val);
5856         call_tests++;
5857         des_xmlCatalogPtr(n_catal, catal, 0);
5858         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
5859         xmlResetLastError();
5860         if (mem_base != xmlMemBlocks()) {
5861             printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5862                    xmlMemBlocks() - mem_base);
5863             test_ret++;
5864             printf(" %d", n_catal);
5865             printf(" %d", n_sysID);
5866             printf("\n");
5867         }
5868     }
5869     }
5870     function_tests++;
5871 #endif
5872
5873     return(test_ret);
5874 }
5875
5876
5877 static int
5878 test_xmlACatalogResolveURI(void) {
5879     int test_ret = 0;
5880
5881 #if defined(LIBXML_CATALOG_ENABLED)
5882     int mem_base;
5883     xmlChar * ret_val;
5884     xmlCatalogPtr catal; /* a Catalog */
5885     int n_catal;
5886     xmlChar * URI; /* the URI */
5887     int n_URI;
5888
5889     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5890     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5891         mem_base = xmlMemBlocks();
5892         catal = gen_xmlCatalogPtr(n_catal, 0);
5893         URI = gen_const_xmlChar_ptr(n_URI, 1);
5894
5895         ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
5896         desret_xmlChar_ptr(ret_val);
5897         call_tests++;
5898         des_xmlCatalogPtr(n_catal, catal, 0);
5899         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5900         xmlResetLastError();
5901         if (mem_base != xmlMemBlocks()) {
5902             printf("Leak of %d blocks found in xmlACatalogResolveURI",
5903                    xmlMemBlocks() - mem_base);
5904             test_ret++;
5905             printf(" %d", n_catal);
5906             printf(" %d", n_URI);
5907             printf("\n");
5908         }
5909     }
5910     }
5911     function_tests++;
5912 #endif
5913
5914     return(test_ret);
5915 }
5916
5917
5918 static int
5919 test_xmlCatalogAdd(void) {
5920     int test_ret = 0;
5921
5922 #if defined(LIBXML_CATALOG_ENABLED)
5923     int mem_base;
5924     int ret_val;
5925     xmlChar * type; /* the type of record to add to the catalog */
5926     int n_type;
5927     xmlChar * orig; /* the system, public or prefix to match */
5928     int n_orig;
5929     xmlChar * replace; /* the replacement value for the match */
5930     int n_replace;
5931
5932     for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5933     for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5934     for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5935         mem_base = xmlMemBlocks();
5936         type = gen_const_xmlChar_ptr(n_type, 0);
5937         orig = gen_const_xmlChar_ptr(n_orig, 1);
5938         replace = gen_const_xmlChar_ptr(n_replace, 2);
5939
5940         ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5941         desret_int(ret_val);
5942         call_tests++;
5943         des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0);
5944         des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1);
5945         des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2);
5946         xmlResetLastError();
5947         if (mem_base != xmlMemBlocks()) {
5948             printf("Leak of %d blocks found in xmlCatalogAdd",
5949                    xmlMemBlocks() - mem_base);
5950             test_ret++;
5951             printf(" %d", n_type);
5952             printf(" %d", n_orig);
5953             printf(" %d", n_replace);
5954             printf("\n");
5955         }
5956     }
5957     }
5958     }
5959     function_tests++;
5960 #endif
5961
5962     return(test_ret);
5963 }
5964
5965
5966 static int
5967 test_xmlCatalogCleanup(void) {
5968     int test_ret = 0;
5969
5970 #if defined(LIBXML_CATALOG_ENABLED)
5971
5972
5973         xmlCatalogCleanup();
5974         call_tests++;
5975         xmlResetLastError();
5976     function_tests++;
5977 #endif
5978
5979     return(test_ret);
5980 }
5981
5982
5983 static int
5984 test_xmlCatalogConvert(void) {
5985     int test_ret = 0;
5986
5987 #if defined(LIBXML_CATALOG_ENABLED)
5988     int ret_val;
5989
5990
5991         ret_val = xmlCatalogConvert();
5992         desret_int(ret_val);
5993         call_tests++;
5994         xmlResetLastError();
5995     function_tests++;
5996 #endif
5997
5998     return(test_ret);
5999 }
6000
6001
6002 static int
6003 test_xmlCatalogDump(void) {
6004     int test_ret = 0;
6005
6006 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
6007     int mem_base;
6008     FILE * out; /* the file. */
6009     int n_out;
6010
6011     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
6012         mem_base = xmlMemBlocks();
6013         out = gen_FILE_ptr(n_out, 0);
6014
6015         xmlCatalogDump(out);
6016         call_tests++;
6017         des_FILE_ptr(n_out, out, 0);
6018         xmlResetLastError();
6019         if (mem_base != xmlMemBlocks()) {
6020             printf("Leak of %d blocks found in xmlCatalogDump",
6021                    xmlMemBlocks() - mem_base);
6022             test_ret++;
6023             printf(" %d", n_out);
6024             printf("\n");
6025         }
6026     }
6027     function_tests++;
6028 #endif
6029
6030     return(test_ret);
6031 }
6032
6033
6034 static int
6035 test_xmlCatalogGetDefaults(void) {
6036     int test_ret = 0;
6037
6038 #if defined(LIBXML_CATALOG_ENABLED)
6039     int mem_base;
6040     xmlCatalogAllow ret_val;
6041
6042         mem_base = xmlMemBlocks();
6043
6044         ret_val = xmlCatalogGetDefaults();
6045         desret_xmlCatalogAllow(ret_val);
6046         call_tests++;
6047         xmlResetLastError();
6048         if (mem_base != xmlMemBlocks()) {
6049             printf("Leak of %d blocks found in xmlCatalogGetDefaults",
6050                    xmlMemBlocks() - mem_base);
6051             test_ret++;
6052             printf("\n");
6053         }
6054     function_tests++;
6055 #endif
6056
6057     return(test_ret);
6058 }
6059
6060
6061 static int
6062 test_xmlCatalogIsEmpty(void) {
6063     int test_ret = 0;
6064
6065 #if defined(LIBXML_CATALOG_ENABLED)
6066     int mem_base;
6067     int ret_val;
6068     xmlCatalogPtr catal; /* should this create an SGML catalog */
6069     int n_catal;
6070
6071     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6072         mem_base = xmlMemBlocks();
6073         catal = gen_xmlCatalogPtr(n_catal, 0);
6074
6075         ret_val = xmlCatalogIsEmpty(catal);
6076         desret_int(ret_val);
6077         call_tests++;
6078         des_xmlCatalogPtr(n_catal, catal, 0);
6079         xmlResetLastError();
6080         if (mem_base != xmlMemBlocks()) {
6081             printf("Leak of %d blocks found in xmlCatalogIsEmpty",
6082                    xmlMemBlocks() - mem_base);
6083             test_ret++;
6084             printf(" %d", n_catal);
6085             printf("\n");
6086         }
6087     }
6088     function_tests++;
6089 #endif
6090
6091     return(test_ret);
6092 }
6093
6094
6095 static int
6096 test_xmlCatalogLocalResolve(void) {
6097     int test_ret = 0;
6098
6099 #if defined(LIBXML_CATALOG_ENABLED)
6100     int mem_base;
6101     xmlChar * ret_val;
6102     void * catalogs; /* a document's list of catalogs */
6103     int n_catalogs;
6104     xmlChar * pubID; /* the public ID string */
6105     int n_pubID;
6106     xmlChar * sysID; /* the system ID string */
6107     int n_sysID;
6108
6109     for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6110     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6111     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6112         mem_base = xmlMemBlocks();
6113         catalogs = gen_void_ptr(n_catalogs, 0);
6114         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
6115         sysID = gen_const_xmlChar_ptr(n_sysID, 2);
6116
6117         ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
6118         desret_xmlChar_ptr(ret_val);
6119         call_tests++;
6120         des_void_ptr(n_catalogs, catalogs, 0);
6121         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
6122         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
6123         xmlResetLastError();
6124         if (mem_base != xmlMemBlocks()) {
6125             printf("Leak of %d blocks found in xmlCatalogLocalResolve",
6126                    xmlMemBlocks() - mem_base);
6127             test_ret++;
6128             printf(" %d", n_catalogs);
6129             printf(" %d", n_pubID);
6130             printf(" %d", n_sysID);
6131             printf("\n");
6132         }
6133     }
6134     }
6135     }
6136     function_tests++;
6137 #endif
6138
6139     return(test_ret);
6140 }
6141
6142
6143 static int
6144 test_xmlCatalogLocalResolveURI(void) {
6145     int test_ret = 0;
6146
6147 #if defined(LIBXML_CATALOG_ENABLED)
6148     int mem_base;
6149     xmlChar * ret_val;
6150     void * catalogs; /* a document's list of catalogs */
6151     int n_catalogs;
6152     xmlChar * URI; /* the URI */
6153     int n_URI;
6154
6155     for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6156     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6157         mem_base = xmlMemBlocks();
6158         catalogs = gen_void_ptr(n_catalogs, 0);
6159         URI = gen_const_xmlChar_ptr(n_URI, 1);
6160
6161         ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
6162         desret_xmlChar_ptr(ret_val);
6163         call_tests++;
6164         des_void_ptr(n_catalogs, catalogs, 0);
6165         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
6166         xmlResetLastError();
6167         if (mem_base != xmlMemBlocks()) {
6168             printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
6169                    xmlMemBlocks() - mem_base);
6170             test_ret++;
6171             printf(" %d", n_catalogs);
6172             printf(" %d", n_URI);
6173             printf("\n");
6174         }
6175     }
6176     }
6177     function_tests++;
6178 #endif
6179
6180     return(test_ret);
6181 }
6182
6183
6184 static int
6185 test_xmlCatalogRemove(void) {
6186     int test_ret = 0;
6187
6188 #if defined(LIBXML_CATALOG_ENABLED)
6189     int ret_val;
6190     xmlChar * value; /* the value to remove */
6191     int n_value;
6192
6193     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6194         value = gen_const_xmlChar_ptr(n_value, 0);
6195
6196         ret_val = xmlCatalogRemove((const xmlChar *)value);
6197         desret_int(ret_val);
6198         call_tests++;
6199         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
6200         xmlResetLastError();
6201     }
6202     function_tests++;
6203 #endif
6204
6205     return(test_ret);
6206 }
6207
6208
6209 static int
6210 test_xmlCatalogResolve(void) {
6211     int test_ret = 0;
6212
6213 #if defined(LIBXML_CATALOG_ENABLED)
6214     xmlChar * ret_val;
6215     xmlChar * pubID; /* the public ID string */
6216     int n_pubID;
6217     xmlChar * sysID; /* the system ID string */
6218     int n_sysID;
6219
6220     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6221     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6222         pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6223         sysID = gen_const_xmlChar_ptr(n_sysID, 1);
6224
6225         ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
6226         desret_xmlChar_ptr(ret_val);
6227         call_tests++;
6228         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6229         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
6230         xmlResetLastError();
6231     }
6232     }
6233     function_tests++;
6234 #endif
6235
6236     return(test_ret);
6237 }
6238
6239
6240 static int
6241 test_xmlCatalogResolvePublic(void) {
6242     int test_ret = 0;
6243
6244 #if defined(LIBXML_CATALOG_ENABLED)
6245     int mem_base;
6246     xmlChar * ret_val;
6247     xmlChar * pubID; /* the public ID string */
6248     int n_pubID;
6249
6250     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6251         mem_base = xmlMemBlocks();
6252         pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6253
6254         ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
6255         desret_xmlChar_ptr(ret_val);
6256         call_tests++;
6257         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6258         xmlResetLastError();
6259         if (mem_base != xmlMemBlocks()) {
6260             printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6261                    xmlMemBlocks() - mem_base);
6262             test_ret++;
6263             printf(" %d", n_pubID);
6264             printf("\n");
6265         }
6266     }
6267     function_tests++;
6268 #endif
6269
6270     return(test_ret);
6271 }
6272
6273
6274 static int
6275 test_xmlCatalogResolveSystem(void) {
6276     int test_ret = 0;
6277
6278 #if defined(LIBXML_CATALOG_ENABLED)
6279     int mem_base;
6280     xmlChar * ret_val;
6281     xmlChar * sysID; /* the system ID string */
6282     int n_sysID;
6283
6284     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6285         mem_base = xmlMemBlocks();
6286         sysID = gen_const_xmlChar_ptr(n_sysID, 0);
6287
6288         ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
6289         desret_xmlChar_ptr(ret_val);
6290         call_tests++;
6291         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0);
6292         xmlResetLastError();
6293         if (mem_base != xmlMemBlocks()) {
6294             printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6295                    xmlMemBlocks() - mem_base);
6296             test_ret++;
6297             printf(" %d", n_sysID);
6298             printf("\n");
6299         }
6300     }
6301     function_tests++;
6302 #endif
6303
6304     return(test_ret);
6305 }
6306
6307
6308 static int
6309 test_xmlCatalogResolveURI(void) {
6310     int test_ret = 0;
6311
6312 #if defined(LIBXML_CATALOG_ENABLED)
6313     int mem_base;
6314     xmlChar * ret_val;
6315     xmlChar * URI; /* the URI */
6316     int n_URI;
6317
6318     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6319         mem_base = xmlMemBlocks();
6320         URI = gen_const_xmlChar_ptr(n_URI, 0);
6321
6322         ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
6323         desret_xmlChar_ptr(ret_val);
6324         call_tests++;
6325         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
6326         xmlResetLastError();
6327         if (mem_base != xmlMemBlocks()) {
6328             printf("Leak of %d blocks found in xmlCatalogResolveURI",
6329                    xmlMemBlocks() - mem_base);
6330             test_ret++;
6331             printf(" %d", n_URI);
6332             printf("\n");
6333         }
6334     }
6335     function_tests++;
6336 #endif
6337
6338     return(test_ret);
6339 }
6340
6341
6342 static int
6343 test_xmlCatalogSetDefaultPrefer(void) {
6344     int test_ret = 0;
6345
6346 #if defined(LIBXML_CATALOG_ENABLED)
6347     int mem_base;
6348     xmlCatalogPrefer ret_val;
6349     xmlCatalogPrefer prefer; /* the default preference for delegation */
6350     int n_prefer;
6351
6352     for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6353         mem_base = xmlMemBlocks();
6354         prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6355
6356         ret_val = xmlCatalogSetDefaultPrefer(prefer);
6357         desret_xmlCatalogPrefer(ret_val);
6358         call_tests++;
6359         des_xmlCatalogPrefer(n_prefer, prefer, 0);
6360         xmlResetLastError();
6361         if (mem_base != xmlMemBlocks()) {
6362             printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6363                    xmlMemBlocks() - mem_base);
6364             test_ret++;
6365             printf(" %d", n_prefer);
6366             printf("\n");
6367         }
6368     }
6369     function_tests++;
6370 #endif
6371
6372     return(test_ret);
6373 }
6374
6375
6376 static int
6377 test_xmlCatalogSetDefaults(void) {
6378     int test_ret = 0;
6379
6380 #if defined(LIBXML_CATALOG_ENABLED)
6381     int mem_base;
6382     xmlCatalogAllow allow; /* what catalogs should be accepted */
6383     int n_allow;
6384
6385     for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6386         mem_base = xmlMemBlocks();
6387         allow = gen_xmlCatalogAllow(n_allow, 0);
6388
6389         xmlCatalogSetDefaults(allow);
6390         call_tests++;
6391         des_xmlCatalogAllow(n_allow, allow, 0);
6392         xmlResetLastError();
6393         if (mem_base != xmlMemBlocks()) {
6394             printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6395                    xmlMemBlocks() - mem_base);
6396             test_ret++;
6397             printf(" %d", n_allow);
6398             printf("\n");
6399         }
6400     }
6401     function_tests++;
6402 #endif
6403
6404     return(test_ret);
6405 }
6406
6407
6408 static int
6409 test_xmlConvertSGMLCatalog(void) {
6410     int test_ret = 0;
6411
6412 #if defined(LIBXML_CATALOG_ENABLED)
6413     int mem_base;
6414     int ret_val;
6415     xmlCatalogPtr catal; /* the catalog */
6416     int n_catal;
6417
6418     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6419         mem_base = xmlMemBlocks();
6420         catal = gen_xmlCatalogPtr(n_catal, 0);
6421
6422         ret_val = xmlConvertSGMLCatalog(catal);
6423         desret_int(ret_val);
6424         call_tests++;
6425         des_xmlCatalogPtr(n_catal, catal, 0);
6426         xmlResetLastError();
6427         if (mem_base != xmlMemBlocks()) {
6428             printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6429                    xmlMemBlocks() - mem_base);
6430             test_ret++;
6431             printf(" %d", n_catal);
6432             printf("\n");
6433         }
6434     }
6435     function_tests++;
6436 #endif
6437
6438     return(test_ret);
6439 }
6440
6441
6442 static int
6443 test_xmlInitializeCatalog(void) {
6444     int test_ret = 0;
6445
6446 #if defined(LIBXML_CATALOG_ENABLED)
6447     int mem_base;
6448
6449         mem_base = xmlMemBlocks();
6450
6451         xmlInitializeCatalog();
6452         call_tests++;
6453         xmlResetLastError();
6454         if (mem_base != xmlMemBlocks()) {
6455             printf("Leak of %d blocks found in xmlInitializeCatalog",
6456                    xmlMemBlocks() - mem_base);
6457             test_ret++;
6458             printf("\n");
6459         }
6460     function_tests++;
6461 #endif
6462
6463     return(test_ret);
6464 }
6465
6466
6467 static int
6468 test_xmlLoadACatalog(void) {
6469     int test_ret = 0;
6470
6471
6472     /* missing type support */
6473     return(test_ret);
6474 }
6475
6476
6477 static int
6478 test_xmlLoadCatalog(void) {
6479     int test_ret = 0;
6480
6481 #if defined(LIBXML_CATALOG_ENABLED)
6482     int ret_val;
6483     const char * filename; /* a file path */
6484     int n_filename;
6485
6486     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6487         filename = gen_filepath(n_filename, 0);
6488
6489         ret_val = xmlLoadCatalog(filename);
6490         desret_int(ret_val);
6491         call_tests++;
6492         des_filepath(n_filename, filename, 0);
6493         xmlResetLastError();
6494     }
6495     function_tests++;
6496 #endif
6497
6498     return(test_ret);
6499 }
6500
6501
6502 static int
6503 test_xmlLoadCatalogs(void) {
6504     int test_ret = 0;
6505
6506 #if defined(LIBXML_CATALOG_ENABLED)
6507     char * pathss; /* a list of directories separated by a colon or a space. */
6508     int n_pathss;
6509
6510     for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6511         pathss = gen_const_char_ptr(n_pathss, 0);
6512
6513         xmlLoadCatalogs((const char *)pathss);
6514         call_tests++;
6515         des_const_char_ptr(n_pathss, (const char *)pathss, 0);
6516         xmlResetLastError();
6517     }
6518     function_tests++;
6519 #endif
6520
6521     return(test_ret);
6522 }
6523
6524
6525 static int
6526 test_xmlLoadSGMLSuperCatalog(void) {
6527     int test_ret = 0;
6528
6529
6530     /* missing type support */
6531     return(test_ret);
6532 }
6533
6534
6535 static int
6536 test_xmlNewCatalog(void) {
6537     int test_ret = 0;
6538
6539
6540     /* missing type support */
6541     return(test_ret);
6542 }
6543
6544
6545 static int
6546 test_xmlParseCatalogFile(void) {
6547     int test_ret = 0;
6548
6549 #if defined(LIBXML_CATALOG_ENABLED)
6550     int mem_base;
6551     xmlDocPtr ret_val;
6552     const char * filename; /* the filename */
6553     int n_filename;
6554
6555     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6556         mem_base = xmlMemBlocks();
6557         filename = gen_filepath(n_filename, 0);
6558
6559         ret_val = xmlParseCatalogFile(filename);
6560         desret_xmlDocPtr(ret_val);
6561         call_tests++;
6562         des_filepath(n_filename, filename, 0);
6563         xmlResetLastError();
6564         if (mem_base != xmlMemBlocks()) {
6565             printf("Leak of %d blocks found in xmlParseCatalogFile",
6566                    xmlMemBlocks() - mem_base);
6567             test_ret++;
6568             printf(" %d", n_filename);
6569             printf("\n");
6570         }
6571     }
6572     function_tests++;
6573 #endif
6574
6575     return(test_ret);
6576 }
6577
6578 static int
6579 test_catalog(void) {
6580     int test_ret = 0;
6581
6582     if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
6583     test_ret += test_xmlACatalogAdd();
6584     test_ret += test_xmlACatalogDump();
6585     test_ret += test_xmlACatalogRemove();
6586     test_ret += test_xmlACatalogResolve();
6587     test_ret += test_xmlACatalogResolvePublic();
6588     test_ret += test_xmlACatalogResolveSystem();
6589     test_ret += test_xmlACatalogResolveURI();
6590     test_ret += test_xmlCatalogAdd();
6591     test_ret += test_xmlCatalogCleanup();
6592     test_ret += test_xmlCatalogConvert();
6593     test_ret += test_xmlCatalogDump();
6594     test_ret += test_xmlCatalogGetDefaults();
6595     test_ret += test_xmlCatalogIsEmpty();
6596     test_ret += test_xmlCatalogLocalResolve();
6597     test_ret += test_xmlCatalogLocalResolveURI();
6598     test_ret += test_xmlCatalogRemove();
6599     test_ret += test_xmlCatalogResolve();
6600     test_ret += test_xmlCatalogResolvePublic();
6601     test_ret += test_xmlCatalogResolveSystem();
6602     test_ret += test_xmlCatalogResolveURI();
6603     test_ret += test_xmlCatalogSetDefaultPrefer();
6604     test_ret += test_xmlCatalogSetDefaults();
6605     test_ret += test_xmlConvertSGMLCatalog();
6606     test_ret += test_xmlInitializeCatalog();
6607     test_ret += test_xmlLoadACatalog();
6608     test_ret += test_xmlLoadCatalog();
6609     test_ret += test_xmlLoadCatalogs();
6610     test_ret += test_xmlLoadSGMLSuperCatalog();
6611     test_ret += test_xmlNewCatalog();
6612     test_ret += test_xmlParseCatalogFile();
6613
6614     if (test_ret != 0)
6615         printf("Module catalog: %d errors\n", test_ret);
6616     return(test_ret);
6617 }
6618
6619 #define gen_nb_const_xmlChRangeGroup_ptr 1
6620 static xmlChRangeGroup * gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6621     return(NULL);
6622 }
6623 static void des_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroup * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6624 }
6625
6626 static int
6627 test_xmlCharInRange(void) {
6628     int test_ret = 0;
6629
6630     int mem_base;
6631     int ret_val;
6632     unsigned int val; /* character to be validated */
6633     int n_val;
6634     xmlChRangeGroup * rptr; /* pointer to range to be used to validate */
6635     int n_rptr;
6636
6637     for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6638     for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroup_ptr;n_rptr++) {
6639         mem_base = xmlMemBlocks();
6640         val = gen_unsigned_int(n_val, 0);
6641         rptr = gen_const_xmlChRangeGroup_ptr(n_rptr, 1);
6642
6643         ret_val = xmlCharInRange(val, (const xmlChRangeGroup *)rptr);
6644         desret_int(ret_val);
6645         call_tests++;
6646         des_unsigned_int(n_val, val, 0);
6647         des_const_xmlChRangeGroup_ptr(n_rptr, (const xmlChRangeGroup *)rptr, 1);
6648         xmlResetLastError();
6649         if (mem_base != xmlMemBlocks()) {
6650             printf("Leak of %d blocks found in xmlCharInRange",
6651                    xmlMemBlocks() - mem_base);
6652             test_ret++;
6653             printf(" %d", n_val);
6654             printf(" %d", n_rptr);
6655             printf("\n");
6656         }
6657     }
6658     }
6659     function_tests++;
6660
6661     return(test_ret);
6662 }
6663
6664
6665 static int
6666 test_xmlIsBaseChar(void) {
6667     int test_ret = 0;
6668
6669     int mem_base;
6670     int ret_val;
6671     unsigned int ch; /* character to validate */
6672     int n_ch;
6673
6674     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6675         mem_base = xmlMemBlocks();
6676         ch = gen_unsigned_int(n_ch, 0);
6677
6678         ret_val = xmlIsBaseChar(ch);
6679         desret_int(ret_val);
6680         call_tests++;
6681         des_unsigned_int(n_ch, ch, 0);
6682         xmlResetLastError();
6683         if (mem_base != xmlMemBlocks()) {
6684             printf("Leak of %d blocks found in xmlIsBaseChar",
6685                    xmlMemBlocks() - mem_base);
6686             test_ret++;
6687             printf(" %d", n_ch);
6688             printf("\n");
6689         }
6690     }
6691     function_tests++;
6692
6693     return(test_ret);
6694 }
6695
6696
6697 static int
6698 test_xmlIsBlank(void) {
6699     int test_ret = 0;
6700
6701     int mem_base;
6702     int ret_val;
6703     unsigned int ch; /* character to validate */
6704     int n_ch;
6705
6706     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6707         mem_base = xmlMemBlocks();
6708         ch = gen_unsigned_int(n_ch, 0);
6709
6710         ret_val = xmlIsBlank(ch);
6711         desret_int(ret_val);
6712         call_tests++;
6713         des_unsigned_int(n_ch, ch, 0);
6714         xmlResetLastError();
6715         if (mem_base != xmlMemBlocks()) {
6716             printf("Leak of %d blocks found in xmlIsBlank",
6717                    xmlMemBlocks() - mem_base);
6718             test_ret++;
6719             printf(" %d", n_ch);
6720             printf("\n");
6721         }
6722     }
6723     function_tests++;
6724
6725     return(test_ret);
6726 }
6727
6728
6729 static int
6730 test_xmlIsChar(void) {
6731     int test_ret = 0;
6732
6733     int mem_base;
6734     int ret_val;
6735     unsigned int ch; /* character to validate */
6736     int n_ch;
6737
6738     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6739         mem_base = xmlMemBlocks();
6740         ch = gen_unsigned_int(n_ch, 0);
6741
6742         ret_val = xmlIsChar(ch);
6743         desret_int(ret_val);
6744         call_tests++;
6745         des_unsigned_int(n_ch, ch, 0);
6746         xmlResetLastError();
6747         if (mem_base != xmlMemBlocks()) {
6748             printf("Leak of %d blocks found in xmlIsChar",
6749                    xmlMemBlocks() - mem_base);
6750             test_ret++;
6751             printf(" %d", n_ch);
6752             printf("\n");
6753         }
6754     }
6755     function_tests++;
6756
6757     return(test_ret);
6758 }
6759
6760
6761 static int
6762 test_xmlIsCombining(void) {
6763     int test_ret = 0;
6764
6765     int mem_base;
6766     int ret_val;
6767     unsigned int ch; /* character to validate */
6768     int n_ch;
6769
6770     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6771         mem_base = xmlMemBlocks();
6772         ch = gen_unsigned_int(n_ch, 0);
6773
6774         ret_val = xmlIsCombining(ch);
6775         desret_int(ret_val);
6776         call_tests++;
6777         des_unsigned_int(n_ch, ch, 0);
6778         xmlResetLastError();
6779         if (mem_base != xmlMemBlocks()) {
6780             printf("Leak of %d blocks found in xmlIsCombining",
6781                    xmlMemBlocks() - mem_base);
6782             test_ret++;
6783             printf(" %d", n_ch);
6784             printf("\n");
6785         }
6786     }
6787     function_tests++;
6788
6789     return(test_ret);
6790 }
6791
6792
6793 static int
6794 test_xmlIsDigit(void) {
6795     int test_ret = 0;
6796
6797     int mem_base;
6798     int ret_val;
6799     unsigned int ch; /* character to validate */
6800     int n_ch;
6801
6802     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6803         mem_base = xmlMemBlocks();
6804         ch = gen_unsigned_int(n_ch, 0);
6805
6806         ret_val = xmlIsDigit(ch);
6807         desret_int(ret_val);
6808         call_tests++;
6809         des_unsigned_int(n_ch, ch, 0);
6810         xmlResetLastError();
6811         if (mem_base != xmlMemBlocks()) {
6812             printf("Leak of %d blocks found in xmlIsDigit",
6813                    xmlMemBlocks() - mem_base);
6814             test_ret++;
6815             printf(" %d", n_ch);
6816             printf("\n");
6817         }
6818     }
6819     function_tests++;
6820
6821     return(test_ret);
6822 }
6823
6824
6825 static int
6826 test_xmlIsExtender(void) {
6827     int test_ret = 0;
6828
6829     int mem_base;
6830     int ret_val;
6831     unsigned int ch; /* character to validate */
6832     int n_ch;
6833
6834     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6835         mem_base = xmlMemBlocks();
6836         ch = gen_unsigned_int(n_ch, 0);
6837
6838         ret_val = xmlIsExtender(ch);
6839         desret_int(ret_val);
6840         call_tests++;
6841         des_unsigned_int(n_ch, ch, 0);
6842         xmlResetLastError();
6843         if (mem_base != xmlMemBlocks()) {
6844             printf("Leak of %d blocks found in xmlIsExtender",
6845                    xmlMemBlocks() - mem_base);
6846             test_ret++;
6847             printf(" %d", n_ch);
6848             printf("\n");
6849         }
6850     }
6851     function_tests++;
6852
6853     return(test_ret);
6854 }
6855
6856
6857 static int
6858 test_xmlIsIdeographic(void) {
6859     int test_ret = 0;
6860
6861     int mem_base;
6862     int ret_val;
6863     unsigned int ch; /* character to validate */
6864     int n_ch;
6865
6866     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6867         mem_base = xmlMemBlocks();
6868         ch = gen_unsigned_int(n_ch, 0);
6869
6870         ret_val = xmlIsIdeographic(ch);
6871         desret_int(ret_val);
6872         call_tests++;
6873         des_unsigned_int(n_ch, ch, 0);
6874         xmlResetLastError();
6875         if (mem_base != xmlMemBlocks()) {
6876             printf("Leak of %d blocks found in xmlIsIdeographic",
6877                    xmlMemBlocks() - mem_base);
6878             test_ret++;
6879             printf(" %d", n_ch);
6880             printf("\n");
6881         }
6882     }
6883     function_tests++;
6884
6885     return(test_ret);
6886 }
6887
6888
6889 static int
6890 test_xmlIsPubidChar(void) {
6891     int test_ret = 0;
6892
6893     int mem_base;
6894     int ret_val;
6895     unsigned int ch; /* character to validate */
6896     int n_ch;
6897
6898     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6899         mem_base = xmlMemBlocks();
6900         ch = gen_unsigned_int(n_ch, 0);
6901
6902         ret_val = xmlIsPubidChar(ch);
6903         desret_int(ret_val);
6904         call_tests++;
6905         des_unsigned_int(n_ch, ch, 0);
6906         xmlResetLastError();
6907         if (mem_base != xmlMemBlocks()) {
6908             printf("Leak of %d blocks found in xmlIsPubidChar",
6909                    xmlMemBlocks() - mem_base);
6910             test_ret++;
6911             printf(" %d", n_ch);
6912             printf("\n");
6913         }
6914     }
6915     function_tests++;
6916
6917     return(test_ret);
6918 }
6919
6920 static int
6921 test_chvalid(void) {
6922     int test_ret = 0;
6923
6924     if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
6925     test_ret += test_xmlCharInRange();
6926     test_ret += test_xmlIsBaseChar();
6927     test_ret += test_xmlIsBlank();
6928     test_ret += test_xmlIsChar();
6929     test_ret += test_xmlIsCombining();
6930     test_ret += test_xmlIsDigit();
6931     test_ret += test_xmlIsExtender();
6932     test_ret += test_xmlIsIdeographic();
6933     test_ret += test_xmlIsPubidChar();
6934
6935     if (test_ret != 0)
6936         printf("Module chvalid: %d errors\n", test_ret);
6937     return(test_ret);
6938 }
6939
6940 static int
6941 test_xmlBoolToText(void) {
6942     int test_ret = 0;
6943
6944 #if defined(LIBXML_DEBUG_ENABLED)
6945     int mem_base;
6946     const char * ret_val;
6947     int boolval; /* a bool to turn into text */
6948     int n_boolval;
6949
6950     for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
6951         mem_base = xmlMemBlocks();
6952         boolval = gen_int(n_boolval, 0);
6953
6954         ret_val = xmlBoolToText(boolval);
6955         desret_const_char_ptr(ret_val);
6956         call_tests++;
6957         des_int(n_boolval, boolval, 0);
6958         xmlResetLastError();
6959         if (mem_base != xmlMemBlocks()) {
6960             printf("Leak of %d blocks found in xmlBoolToText",
6961                    xmlMemBlocks() - mem_base);
6962             test_ret++;
6963             printf(" %d", n_boolval);
6964             printf("\n");
6965         }
6966     }
6967     function_tests++;
6968 #endif
6969
6970     return(test_ret);
6971 }
6972
6973
6974 static int
6975 test_xmlDebugCheckDocument(void) {
6976     int test_ret = 0;
6977
6978 #if defined(LIBXML_DEBUG_ENABLED)
6979     int mem_base;
6980     int ret_val;
6981     FILE * output; /* the FILE * for the output */
6982     int n_output;
6983     xmlDocPtr doc; /* the document */
6984     int n_doc;
6985
6986     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6987     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6988         mem_base = xmlMemBlocks();
6989         output = gen_debug_FILE_ptr(n_output, 0);
6990         doc = gen_xmlDocPtr(n_doc, 1);
6991
6992         ret_val = xmlDebugCheckDocument(output, doc);
6993         desret_int(ret_val);
6994         call_tests++;
6995         des_debug_FILE_ptr(n_output, output, 0);
6996         des_xmlDocPtr(n_doc, doc, 1);
6997         xmlResetLastError();
6998         if (mem_base != xmlMemBlocks()) {
6999             printf("Leak of %d blocks found in xmlDebugCheckDocument",
7000                    xmlMemBlocks() - mem_base);
7001             test_ret++;
7002             printf(" %d", n_output);
7003             printf(" %d", n_doc);
7004             printf("\n");
7005         }
7006     }
7007     }
7008     function_tests++;
7009 #endif
7010
7011     return(test_ret);
7012 }
7013
7014
7015 static int
7016 test_xmlDebugDumpAttr(void) {
7017     int test_ret = 0;
7018
7019 #if defined(LIBXML_DEBUG_ENABLED)
7020     int mem_base;
7021     FILE * output; /* the FILE * for the output */
7022     int n_output;
7023     xmlAttrPtr attr; /* the attribute */
7024     int n_attr;
7025     int depth; /* the indentation level. */
7026     int n_depth;
7027
7028     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7029     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7030     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7031         mem_base = xmlMemBlocks();
7032         output = gen_debug_FILE_ptr(n_output, 0);
7033         attr = gen_xmlAttrPtr(n_attr, 1);
7034         depth = gen_int(n_depth, 2);
7035
7036         xmlDebugDumpAttr(output, attr, depth);
7037         call_tests++;
7038         des_debug_FILE_ptr(n_output, output, 0);
7039         des_xmlAttrPtr(n_attr, attr, 1);
7040         des_int(n_depth, depth, 2);
7041         xmlResetLastError();
7042         if (mem_base != xmlMemBlocks()) {
7043             printf("Leak of %d blocks found in xmlDebugDumpAttr",
7044                    xmlMemBlocks() - mem_base);
7045             test_ret++;
7046             printf(" %d", n_output);
7047             printf(" %d", n_attr);
7048             printf(" %d", n_depth);
7049             printf("\n");
7050         }
7051     }
7052     }
7053     }
7054     function_tests++;
7055 #endif
7056
7057     return(test_ret);
7058 }
7059
7060
7061 static int
7062 test_xmlDebugDumpAttrList(void) {
7063     int test_ret = 0;
7064
7065 #if defined(LIBXML_DEBUG_ENABLED)
7066     int mem_base;
7067     FILE * output; /* the FILE * for the output */
7068     int n_output;
7069     xmlAttrPtr attr; /* the attribute list */
7070     int n_attr;
7071     int depth; /* the indentation level. */
7072     int n_depth;
7073
7074     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7075     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7076     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7077         mem_base = xmlMemBlocks();
7078         output = gen_debug_FILE_ptr(n_output, 0);
7079         attr = gen_xmlAttrPtr(n_attr, 1);
7080         depth = gen_int(n_depth, 2);
7081
7082         xmlDebugDumpAttrList(output, attr, depth);
7083         call_tests++;
7084         des_debug_FILE_ptr(n_output, output, 0);
7085         des_xmlAttrPtr(n_attr, attr, 1);
7086         des_int(n_depth, depth, 2);
7087         xmlResetLastError();
7088         if (mem_base != xmlMemBlocks()) {
7089             printf("Leak of %d blocks found in xmlDebugDumpAttrList",
7090                    xmlMemBlocks() - mem_base);
7091             test_ret++;
7092             printf(" %d", n_output);
7093             printf(" %d", n_attr);
7094             printf(" %d", n_depth);
7095             printf("\n");
7096         }
7097     }
7098     }
7099     }
7100     function_tests++;
7101 #endif
7102
7103     return(test_ret);
7104 }
7105
7106
7107 static int
7108 test_xmlDebugDumpDTD(void) {
7109     int test_ret = 0;
7110
7111 #if defined(LIBXML_DEBUG_ENABLED)
7112     int mem_base;
7113     FILE * output; /* the FILE * for the output */
7114     int n_output;
7115     xmlDtdPtr dtd; /* the DTD */
7116     int n_dtd;
7117
7118     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7119     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
7120         mem_base = xmlMemBlocks();
7121         output = gen_debug_FILE_ptr(n_output, 0);
7122         dtd = gen_xmlDtdPtr(n_dtd, 1);
7123
7124         xmlDebugDumpDTD(output, dtd);
7125         call_tests++;
7126         des_debug_FILE_ptr(n_output, output, 0);
7127         des_xmlDtdPtr(n_dtd, dtd, 1);
7128         xmlResetLastError();
7129         if (mem_base != xmlMemBlocks()) {
7130             printf("Leak of %d blocks found in xmlDebugDumpDTD",
7131                    xmlMemBlocks() - mem_base);
7132             test_ret++;
7133             printf(" %d", n_output);
7134             printf(" %d", n_dtd);
7135             printf("\n");
7136         }
7137     }
7138     }
7139     function_tests++;
7140 #endif
7141
7142     return(test_ret);
7143 }
7144
7145
7146 static int
7147 test_xmlDebugDumpDocument(void) {
7148     int test_ret = 0;
7149
7150 #if defined(LIBXML_DEBUG_ENABLED)
7151     int mem_base;
7152     FILE * output; /* the FILE * for the output */
7153     int n_output;
7154     xmlDocPtr doc; /* the document */
7155     int n_doc;
7156
7157     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7158     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7159         mem_base = xmlMemBlocks();
7160         output = gen_debug_FILE_ptr(n_output, 0);
7161         doc = gen_xmlDocPtr(n_doc, 1);
7162
7163         xmlDebugDumpDocument(output, doc);
7164         call_tests++;
7165         des_debug_FILE_ptr(n_output, output, 0);
7166         des_xmlDocPtr(n_doc, doc, 1);
7167         xmlResetLastError();
7168         if (mem_base != xmlMemBlocks()) {
7169             printf("Leak of %d blocks found in xmlDebugDumpDocument",
7170                    xmlMemBlocks() - mem_base);
7171             test_ret++;
7172             printf(" %d", n_output);
7173             printf(" %d", n_doc);
7174             printf("\n");
7175         }
7176     }
7177     }
7178     function_tests++;
7179 #endif
7180
7181     return(test_ret);
7182 }
7183
7184
7185 static int
7186 test_xmlDebugDumpDocumentHead(void) {
7187     int test_ret = 0;
7188
7189 #if defined(LIBXML_DEBUG_ENABLED)
7190     int mem_base;
7191     FILE * output; /* the FILE * for the output */
7192     int n_output;
7193     xmlDocPtr doc; /* the document */
7194     int n_doc;
7195
7196     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7197     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7198         mem_base = xmlMemBlocks();
7199         output = gen_debug_FILE_ptr(n_output, 0);
7200         doc = gen_xmlDocPtr(n_doc, 1);
7201
7202         xmlDebugDumpDocumentHead(output, doc);
7203         call_tests++;
7204         des_debug_FILE_ptr(n_output, output, 0);
7205         des_xmlDocPtr(n_doc, doc, 1);
7206         xmlResetLastError();
7207         if (mem_base != xmlMemBlocks()) {
7208             printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7209                    xmlMemBlocks() - mem_base);
7210             test_ret++;
7211             printf(" %d", n_output);
7212             printf(" %d", n_doc);
7213             printf("\n");
7214         }
7215     }
7216     }
7217     function_tests++;
7218 #endif
7219
7220     return(test_ret);
7221 }
7222
7223
7224 static int
7225 test_xmlDebugDumpEntities(void) {
7226     int test_ret = 0;
7227
7228 #if defined(LIBXML_DEBUG_ENABLED)
7229     int mem_base;
7230     FILE * output; /* the FILE * for the output */
7231     int n_output;
7232     xmlDocPtr doc; /* the document */
7233     int n_doc;
7234
7235     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7236     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7237         mem_base = xmlMemBlocks();
7238         output = gen_debug_FILE_ptr(n_output, 0);
7239         doc = gen_xmlDocPtr(n_doc, 1);
7240
7241         xmlDebugDumpEntities(output, doc);
7242         call_tests++;
7243         des_debug_FILE_ptr(n_output, output, 0);
7244         des_xmlDocPtr(n_doc, doc, 1);
7245         xmlResetLastError();
7246         if (mem_base != xmlMemBlocks()) {
7247             printf("Leak of %d blocks found in xmlDebugDumpEntities",
7248                    xmlMemBlocks() - mem_base);
7249             test_ret++;
7250             printf(" %d", n_output);
7251             printf(" %d", n_doc);
7252             printf("\n");
7253         }
7254     }
7255     }
7256     function_tests++;
7257 #endif
7258
7259     return(test_ret);
7260 }
7261
7262
7263 static int
7264 test_xmlDebugDumpNode(void) {
7265     int test_ret = 0;
7266
7267 #if defined(LIBXML_DEBUG_ENABLED)
7268     int mem_base;
7269     FILE * output; /* the FILE * for the output */
7270     int n_output;
7271     xmlNodePtr node; /* the node */
7272     int n_node;
7273     int depth; /* the indentation level. */
7274     int n_depth;
7275
7276     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7277     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7278     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7279         mem_base = xmlMemBlocks();
7280         output = gen_debug_FILE_ptr(n_output, 0);
7281         node = gen_xmlNodePtr(n_node, 1);
7282         depth = gen_int(n_depth, 2);
7283
7284         xmlDebugDumpNode(output, node, depth);
7285         call_tests++;
7286         des_debug_FILE_ptr(n_output, output, 0);
7287         des_xmlNodePtr(n_node, node, 1);
7288         des_int(n_depth, depth, 2);
7289         xmlResetLastError();
7290         if (mem_base != xmlMemBlocks()) {
7291             printf("Leak of %d blocks found in xmlDebugDumpNode",
7292                    xmlMemBlocks() - mem_base);
7293             test_ret++;
7294             printf(" %d", n_output);
7295             printf(" %d", n_node);
7296             printf(" %d", n_depth);
7297             printf("\n");
7298         }
7299     }
7300     }
7301     }
7302     function_tests++;
7303 #endif
7304
7305     return(test_ret);
7306 }
7307
7308
7309 static int
7310 test_xmlDebugDumpNodeList(void) {
7311     int test_ret = 0;
7312
7313 #if defined(LIBXML_DEBUG_ENABLED)
7314     int mem_base;
7315     FILE * output; /* the FILE * for the output */
7316     int n_output;
7317     xmlNodePtr node; /* the node list */
7318     int n_node;
7319     int depth; /* the indentation level. */
7320     int n_depth;
7321
7322     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7323     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7324     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7325         mem_base = xmlMemBlocks();
7326         output = gen_debug_FILE_ptr(n_output, 0);
7327         node = gen_xmlNodePtr(n_node, 1);
7328         depth = gen_int(n_depth, 2);
7329
7330         xmlDebugDumpNodeList(output, node, depth);
7331         call_tests++;
7332         des_debug_FILE_ptr(n_output, output, 0);
7333         des_xmlNodePtr(n_node, node, 1);
7334         des_int(n_depth, depth, 2);
7335         xmlResetLastError();
7336         if (mem_base != xmlMemBlocks()) {
7337             printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7338                    xmlMemBlocks() - mem_base);
7339             test_ret++;
7340             printf(" %d", n_output);
7341             printf(" %d", n_node);
7342             printf(" %d", n_depth);
7343             printf("\n");
7344         }
7345     }
7346     }
7347     }
7348     function_tests++;
7349 #endif
7350
7351     return(test_ret);
7352 }
7353
7354
7355 static int
7356 test_xmlDebugDumpOneNode(void) {
7357     int test_ret = 0;
7358
7359 #if defined(LIBXML_DEBUG_ENABLED)
7360     int mem_base;
7361     FILE * output; /* the FILE * for the output */
7362     int n_output;
7363     xmlNodePtr node; /* the node */
7364     int n_node;
7365     int depth; /* the indentation level. */
7366     int n_depth;
7367
7368     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7369     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7370     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7371         mem_base = xmlMemBlocks();
7372         output = gen_debug_FILE_ptr(n_output, 0);
7373         node = gen_xmlNodePtr(n_node, 1);
7374         depth = gen_int(n_depth, 2);
7375
7376         xmlDebugDumpOneNode(output, node, depth);
7377         call_tests++;
7378         des_debug_FILE_ptr(n_output, output, 0);
7379         des_xmlNodePtr(n_node, node, 1);
7380         des_int(n_depth, depth, 2);
7381         xmlResetLastError();
7382         if (mem_base != xmlMemBlocks()) {
7383             printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7384                    xmlMemBlocks() - mem_base);
7385             test_ret++;
7386             printf(" %d", n_output);
7387             printf(" %d", n_node);
7388             printf(" %d", n_depth);
7389             printf("\n");
7390         }
7391     }
7392     }
7393     }
7394     function_tests++;
7395 #endif
7396
7397     return(test_ret);
7398 }
7399
7400
7401 static int
7402 test_xmlDebugDumpString(void) {
7403     int test_ret = 0;
7404
7405 #if defined(LIBXML_DEBUG_ENABLED)
7406     int mem_base;
7407     FILE * output; /* the FILE * for the output */
7408     int n_output;
7409     xmlChar * str; /* the string */
7410     int n_str;
7411
7412     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7413     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7414         mem_base = xmlMemBlocks();
7415         output = gen_debug_FILE_ptr(n_output, 0);
7416         str = gen_const_xmlChar_ptr(n_str, 1);
7417
7418         xmlDebugDumpString(output, (const xmlChar *)str);
7419         call_tests++;
7420         des_debug_FILE_ptr(n_output, output, 0);
7421         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
7422         xmlResetLastError();
7423         if (mem_base != xmlMemBlocks()) {
7424             printf("Leak of %d blocks found in xmlDebugDumpString",
7425                    xmlMemBlocks() - mem_base);
7426             test_ret++;
7427             printf(" %d", n_output);
7428             printf(" %d", n_str);
7429             printf("\n");
7430         }
7431     }
7432     }
7433     function_tests++;
7434 #endif
7435
7436     return(test_ret);
7437 }
7438
7439
7440 static int
7441 test_xmlLsCountNode(void) {
7442     int test_ret = 0;
7443
7444 #if defined(LIBXML_DEBUG_ENABLED)
7445     int mem_base;
7446     int ret_val;
7447     xmlNodePtr node; /* the node to count */
7448     int n_node;
7449
7450     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7451         mem_base = xmlMemBlocks();
7452         node = gen_xmlNodePtr(n_node, 0);
7453
7454         ret_val = xmlLsCountNode(node);
7455         desret_int(ret_val);
7456         call_tests++;
7457         des_xmlNodePtr(n_node, node, 0);
7458         xmlResetLastError();
7459         if (mem_base != xmlMemBlocks()) {
7460             printf("Leak of %d blocks found in xmlLsCountNode",
7461                    xmlMemBlocks() - mem_base);
7462             test_ret++;
7463             printf(" %d", n_node);
7464             printf("\n");
7465         }
7466     }
7467     function_tests++;
7468 #endif
7469
7470     return(test_ret);
7471 }
7472
7473
7474 static int
7475 test_xmlLsOneNode(void) {
7476     int test_ret = 0;
7477
7478 #if defined(LIBXML_DEBUG_ENABLED)
7479     int mem_base;
7480     FILE * output; /* the FILE * for the output */
7481     int n_output;
7482     xmlNodePtr node; /* the node to dump */
7483     int n_node;
7484
7485     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7486     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7487         mem_base = xmlMemBlocks();
7488         output = gen_debug_FILE_ptr(n_output, 0);
7489         node = gen_xmlNodePtr(n_node, 1);
7490
7491         xmlLsOneNode(output, node);
7492         call_tests++;
7493         des_debug_FILE_ptr(n_output, output, 0);
7494         des_xmlNodePtr(n_node, node, 1);
7495         xmlResetLastError();
7496         if (mem_base != xmlMemBlocks()) {
7497             printf("Leak of %d blocks found in xmlLsOneNode",
7498                    xmlMemBlocks() - mem_base);
7499             test_ret++;
7500             printf(" %d", n_output);
7501             printf(" %d", n_node);
7502             printf("\n");
7503         }
7504     }
7505     }
7506     function_tests++;
7507 #endif
7508
7509     return(test_ret);
7510 }
7511
7512
7513 #define gen_nb_char_ptr 1
7514 static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7515     return(NULL);
7516 }
7517 static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7518 }
7519
7520 static int
7521 test_xmlShell(void) {
7522     int test_ret = 0;
7523
7524
7525     /* missing type support */
7526     return(test_ret);
7527 }
7528
7529
7530 static int
7531 test_xmlShellBase(void) {
7532     int test_ret = 0;
7533
7534 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7535     int mem_base;
7536     int ret_val;
7537     xmlShellCtxtPtr ctxt; /* the shell context */
7538     int n_ctxt;
7539     char * arg; /* unused */
7540     int n_arg;
7541     xmlNodePtr node; /* a node */
7542     int n_node;
7543     xmlNodePtr node2; /* unused */
7544     int n_node2;
7545
7546     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7547     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7548     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7549     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7550         mem_base = xmlMemBlocks();
7551         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7552         arg = gen_char_ptr(n_arg, 1);
7553         node = gen_xmlNodePtr(n_node, 2);
7554         node2 = gen_xmlNodePtr(n_node2, 3);
7555
7556         ret_val = xmlShellBase(ctxt, arg, node, node2);
7557         desret_int(ret_val);
7558         call_tests++;
7559         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7560         des_char_ptr(n_arg, arg, 1);
7561         des_xmlNodePtr(n_node, node, 2);
7562         des_xmlNodePtr(n_node2, node2, 3);
7563         xmlResetLastError();
7564         if (mem_base != xmlMemBlocks()) {
7565             printf("Leak of %d blocks found in xmlShellBase",
7566                    xmlMemBlocks() - mem_base);
7567             test_ret++;
7568             printf(" %d", n_ctxt);
7569             printf(" %d", n_arg);
7570             printf(" %d", n_node);
7571             printf(" %d", n_node2);
7572             printf("\n");
7573         }
7574     }
7575     }
7576     }
7577     }
7578     function_tests++;
7579 #endif
7580
7581     return(test_ret);
7582 }
7583
7584
7585 static int
7586 test_xmlShellCat(void) {
7587     int test_ret = 0;
7588
7589 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7590     int mem_base;
7591     int ret_val;
7592     xmlShellCtxtPtr ctxt; /* the shell context */
7593     int n_ctxt;
7594     char * arg; /* unused */
7595     int n_arg;
7596     xmlNodePtr node; /* a node */
7597     int n_node;
7598     xmlNodePtr node2; /* unused */
7599     int n_node2;
7600
7601     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7602     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7603     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7604     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7605         mem_base = xmlMemBlocks();
7606         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7607         arg = gen_char_ptr(n_arg, 1);
7608         node = gen_xmlNodePtr(n_node, 2);
7609         node2 = gen_xmlNodePtr(n_node2, 3);
7610
7611         ret_val = xmlShellCat(ctxt, arg, node, node2);
7612         desret_int(ret_val);
7613         call_tests++;
7614         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7615         des_char_ptr(n_arg, arg, 1);
7616         des_xmlNodePtr(n_node, node, 2);
7617         des_xmlNodePtr(n_node2, node2, 3);
7618         xmlResetLastError();
7619         if (mem_base != xmlMemBlocks()) {
7620             printf("Leak of %d blocks found in xmlShellCat",
7621                    xmlMemBlocks() - mem_base);
7622             test_ret++;
7623             printf(" %d", n_ctxt);
7624             printf(" %d", n_arg);
7625             printf(" %d", n_node);
7626             printf(" %d", n_node2);
7627             printf("\n");
7628         }
7629     }
7630     }
7631     }
7632     }
7633     function_tests++;
7634 #endif
7635
7636     return(test_ret);
7637 }
7638
7639
7640 static int
7641 test_xmlShellDir(void) {
7642     int test_ret = 0;
7643
7644 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7645     int mem_base;
7646     int ret_val;
7647     xmlShellCtxtPtr ctxt; /* the shell context */
7648     int n_ctxt;
7649     char * arg; /* unused */
7650     int n_arg;
7651     xmlNodePtr node; /* a node */
7652     int n_node;
7653     xmlNodePtr node2; /* unused */
7654     int n_node2;
7655
7656     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7657     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7658     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7659     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7660         mem_base = xmlMemBlocks();
7661         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7662         arg = gen_char_ptr(n_arg, 1);
7663         node = gen_xmlNodePtr(n_node, 2);
7664         node2 = gen_xmlNodePtr(n_node2, 3);
7665
7666         ret_val = xmlShellDir(ctxt, arg, node, node2);
7667         desret_int(ret_val);
7668         call_tests++;
7669         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7670         des_char_ptr(n_arg, arg, 1);
7671         des_xmlNodePtr(n_node, node, 2);
7672         des_xmlNodePtr(n_node2, node2, 3);
7673         xmlResetLastError();
7674         if (mem_base != xmlMemBlocks()) {
7675             printf("Leak of %d blocks found in xmlShellDir",
7676                    xmlMemBlocks() - mem_base);
7677             test_ret++;
7678             printf(" %d", n_ctxt);
7679             printf(" %d", n_arg);
7680             printf(" %d", n_node);
7681             printf(" %d", n_node2);
7682             printf("\n");
7683         }
7684     }
7685     }
7686     }
7687     }
7688     function_tests++;
7689 #endif
7690
7691     return(test_ret);
7692 }
7693
7694
7695 static int
7696 test_xmlShellDu(void) {
7697     int test_ret = 0;
7698
7699 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7700     int mem_base;
7701     int ret_val;
7702     xmlShellCtxtPtr ctxt; /* the shell context */
7703     int n_ctxt;
7704     char * arg; /* unused */
7705     int n_arg;
7706     xmlNodePtr tree; /* a node defining a subtree */
7707     int n_tree;
7708     xmlNodePtr node2; /* unused */
7709     int n_node2;
7710
7711     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7712     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7713     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
7714     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7715         mem_base = xmlMemBlocks();
7716         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7717         arg = gen_char_ptr(n_arg, 1);
7718         tree = gen_xmlNodePtr(n_tree, 2);
7719         node2 = gen_xmlNodePtr(n_node2, 3);
7720
7721         ret_val = xmlShellDu(ctxt, arg, tree, node2);
7722         desret_int(ret_val);
7723         call_tests++;
7724         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7725         des_char_ptr(n_arg, arg, 1);
7726         des_xmlNodePtr(n_tree, tree, 2);
7727         des_xmlNodePtr(n_node2, node2, 3);
7728         xmlResetLastError();
7729         if (mem_base != xmlMemBlocks()) {
7730             printf("Leak of %d blocks found in xmlShellDu",
7731                    xmlMemBlocks() - mem_base);
7732             test_ret++;
7733             printf(" %d", n_ctxt);
7734             printf(" %d", n_arg);
7735             printf(" %d", n_tree);
7736             printf(" %d", n_node2);
7737             printf("\n");
7738         }
7739     }
7740     }
7741     }
7742     }
7743     function_tests++;
7744 #endif
7745
7746     return(test_ret);
7747 }
7748
7749
7750 static int
7751 test_xmlShellList(void) {
7752     int test_ret = 0;
7753
7754 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7755     int mem_base;
7756     int ret_val;
7757     xmlShellCtxtPtr ctxt; /* the shell context */
7758     int n_ctxt;
7759     char * arg; /* unused */
7760     int n_arg;
7761     xmlNodePtr node; /* a node */
7762     int n_node;
7763     xmlNodePtr node2; /* unused */
7764     int n_node2;
7765
7766     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7767     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7768     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7769     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7770         mem_base = xmlMemBlocks();
7771         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7772         arg = gen_char_ptr(n_arg, 1);
7773         node = gen_xmlNodePtr(n_node, 2);
7774         node2 = gen_xmlNodePtr(n_node2, 3);
7775
7776         ret_val = xmlShellList(ctxt, arg, node, node2);
7777         desret_int(ret_val);
7778         call_tests++;
7779         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7780         des_char_ptr(n_arg, arg, 1);
7781         des_xmlNodePtr(n_node, node, 2);
7782         des_xmlNodePtr(n_node2, node2, 3);
7783         xmlResetLastError();
7784         if (mem_base != xmlMemBlocks()) {
7785             printf("Leak of %d blocks found in xmlShellList",
7786                    xmlMemBlocks() - mem_base);
7787             test_ret++;
7788             printf(" %d", n_ctxt);
7789             printf(" %d", n_arg);
7790             printf(" %d", n_node);
7791             printf(" %d", n_node2);
7792             printf("\n");
7793         }
7794     }
7795     }
7796     }
7797     }
7798     function_tests++;
7799 #endif
7800
7801     return(test_ret);
7802 }
7803
7804
7805 static int
7806 test_xmlShellLoad(void) {
7807     int test_ret = 0;
7808
7809 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7810     int mem_base;
7811     int ret_val;
7812     xmlShellCtxtPtr ctxt; /* the shell context */
7813     int n_ctxt;
7814     char * filename; /* the file name */
7815     int n_filename;
7816     xmlNodePtr node; /* unused */
7817     int n_node;
7818     xmlNodePtr node2; /* unused */
7819     int n_node2;
7820
7821     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7822     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7823     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7824     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7825         mem_base = xmlMemBlocks();
7826         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7827         filename = gen_char_ptr(n_filename, 1);
7828         node = gen_xmlNodePtr(n_node, 2);
7829         node2 = gen_xmlNodePtr(n_node2, 3);
7830
7831         ret_val = xmlShellLoad(ctxt, filename, node, node2);
7832         desret_int(ret_val);
7833         call_tests++;
7834         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7835         des_char_ptr(n_filename, filename, 1);
7836         des_xmlNodePtr(n_node, node, 2);
7837         des_xmlNodePtr(n_node2, node2, 3);
7838         xmlResetLastError();
7839         if (mem_base != xmlMemBlocks()) {
7840             printf("Leak of %d blocks found in xmlShellLoad",
7841                    xmlMemBlocks() - mem_base);
7842             test_ret++;
7843             printf(" %d", n_ctxt);
7844             printf(" %d", n_filename);
7845             printf(" %d", n_node);
7846             printf(" %d", n_node2);
7847             printf("\n");
7848         }
7849     }
7850     }
7851     }
7852     }
7853     function_tests++;
7854 #endif
7855
7856     return(test_ret);
7857 }
7858
7859
7860 static int
7861 test_xmlShellPrintXPathResult(void) {
7862     int test_ret = 0;
7863
7864 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7865     int mem_base;
7866     xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7867     int n_list;
7868
7869     for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7870         mem_base = xmlMemBlocks();
7871         list = gen_xmlXPathObjectPtr(n_list, 0);
7872
7873         xmlShellPrintXPathResult(list);
7874         call_tests++;
7875         des_xmlXPathObjectPtr(n_list, list, 0);
7876         xmlResetLastError();
7877         if (mem_base != xmlMemBlocks()) {
7878             printf("Leak of %d blocks found in xmlShellPrintXPathResult",
7879                    xmlMemBlocks() - mem_base);
7880             test_ret++;
7881             printf(" %d", n_list);
7882             printf("\n");
7883         }
7884     }
7885     function_tests++;
7886 #endif
7887
7888     return(test_ret);
7889 }
7890
7891
7892 static int
7893 test_xmlShellPwd(void) {
7894     int test_ret = 0;
7895
7896 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7897     int mem_base;
7898     int ret_val;
7899     xmlShellCtxtPtr ctxt; /* the shell context */
7900     int n_ctxt;
7901     char * buffer; /* the output buffer */
7902     int n_buffer;
7903     xmlNodePtr node; /* a node */
7904     int n_node;
7905     xmlNodePtr node2; /* unused */
7906     int n_node2;
7907
7908     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7909     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
7910     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7911     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7912         mem_base = xmlMemBlocks();
7913         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7914         buffer = gen_char_ptr(n_buffer, 1);
7915         node = gen_xmlNodePtr(n_node, 2);
7916         node2 = gen_xmlNodePtr(n_node2, 3);
7917
7918         ret_val = xmlShellPwd(ctxt, buffer, node, node2);
7919         desret_int(ret_val);
7920         call_tests++;
7921         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7922         des_char_ptr(n_buffer, buffer, 1);
7923         des_xmlNodePtr(n_node, node, 2);
7924         des_xmlNodePtr(n_node2, node2, 3);
7925         xmlResetLastError();
7926         if (mem_base != xmlMemBlocks()) {
7927             printf("Leak of %d blocks found in xmlShellPwd",
7928                    xmlMemBlocks() - mem_base);
7929             test_ret++;
7930             printf(" %d", n_ctxt);
7931             printf(" %d", n_buffer);
7932             printf(" %d", n_node);
7933             printf(" %d", n_node2);
7934             printf("\n");
7935         }
7936     }
7937     }
7938     }
7939     }
7940     function_tests++;
7941 #endif
7942
7943     return(test_ret);
7944 }
7945
7946
7947 static int
7948 test_xmlShellSave(void) {
7949     int test_ret = 0;
7950
7951 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7952     int mem_base;
7953     int ret_val;
7954     xmlShellCtxtPtr ctxt; /* the shell context */
7955     int n_ctxt;
7956     char * filename; /* the file name (optional) */
7957     int n_filename;
7958     xmlNodePtr node; /* unused */
7959     int n_node;
7960     xmlNodePtr node2; /* unused */
7961     int n_node2;
7962
7963     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7964     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7965     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7966     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7967         mem_base = xmlMemBlocks();
7968         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7969         filename = gen_char_ptr(n_filename, 1);
7970         node = gen_xmlNodePtr(n_node, 2);
7971         node2 = gen_xmlNodePtr(n_node2, 3);
7972
7973         ret_val = xmlShellSave(ctxt, filename, node, node2);
7974         desret_int(ret_val);
7975         call_tests++;
7976         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7977         des_char_ptr(n_filename, filename, 1);
7978         des_xmlNodePtr(n_node, node, 2);
7979         des_xmlNodePtr(n_node2, node2, 3);
7980         xmlResetLastError();
7981         if (mem_base != xmlMemBlocks()) {
7982             printf("Leak of %d blocks found in xmlShellSave",
7983                    xmlMemBlocks() - mem_base);
7984             test_ret++;
7985             printf(" %d", n_ctxt);
7986             printf(" %d", n_filename);
7987             printf(" %d", n_node);
7988             printf(" %d", n_node2);
7989             printf("\n");
7990         }
7991     }
7992     }
7993     }
7994     }
7995     function_tests++;
7996 #endif
7997
7998     return(test_ret);
7999 }
8000
8001
8002 static int
8003 test_xmlShellValidate(void) {
8004     int test_ret = 0;
8005
8006 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
8007     int mem_base;
8008     int ret_val;
8009     xmlShellCtxtPtr ctxt; /* the shell context */
8010     int n_ctxt;
8011     char * dtd; /* the DTD URI (optional) */
8012     int n_dtd;
8013     xmlNodePtr node; /* unused */
8014     int n_node;
8015     xmlNodePtr node2; /* unused */
8016     int n_node2;
8017
8018     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8019     for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
8020     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8021     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8022         mem_base = xmlMemBlocks();
8023         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8024         dtd = gen_char_ptr(n_dtd, 1);
8025         node = gen_xmlNodePtr(n_node, 2);
8026         node2 = gen_xmlNodePtr(n_node2, 3);
8027
8028         ret_val = xmlShellValidate(ctxt, dtd, node, node2);
8029         desret_int(ret_val);
8030         call_tests++;
8031         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8032         des_char_ptr(n_dtd, dtd, 1);
8033         des_xmlNodePtr(n_node, node, 2);
8034         des_xmlNodePtr(n_node2, node2, 3);
8035         xmlResetLastError();
8036         if (mem_base != xmlMemBlocks()) {
8037             printf("Leak of %d blocks found in xmlShellValidate",
8038                    xmlMemBlocks() - mem_base);
8039             test_ret++;
8040             printf(" %d", n_ctxt);
8041             printf(" %d", n_dtd);
8042             printf(" %d", n_node);
8043             printf(" %d", n_node2);
8044             printf("\n");
8045         }
8046     }
8047     }
8048     }
8049     }
8050     function_tests++;
8051 #endif
8052
8053     return(test_ret);
8054 }
8055
8056
8057 static int
8058 test_xmlShellWrite(void) {
8059     int test_ret = 0;
8060
8061 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
8062     int mem_base;
8063     int ret_val;
8064     xmlShellCtxtPtr ctxt; /* the shell context */
8065     int n_ctxt;
8066     char * filename; /* the file name */
8067     int n_filename;
8068     xmlNodePtr node; /* a node in the tree */
8069     int n_node;
8070     xmlNodePtr node2; /* unused */
8071     int n_node2;
8072
8073     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8074     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
8075     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8076     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8077         mem_base = xmlMemBlocks();
8078         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8079         filename = gen_char_ptr(n_filename, 1);
8080         node = gen_xmlNodePtr(n_node, 2);
8081         node2 = gen_xmlNodePtr(n_node2, 3);
8082
8083         ret_val = xmlShellWrite(ctxt, filename, node, node2);
8084         desret_int(ret_val);
8085         call_tests++;
8086         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8087         des_char_ptr(n_filename, filename, 1);
8088         des_xmlNodePtr(n_node, node, 2);
8089         des_xmlNodePtr(n_node2, node2, 3);
8090         xmlResetLastError();
8091         if (mem_base != xmlMemBlocks()) {
8092             printf("Leak of %d blocks found in xmlShellWrite",
8093                    xmlMemBlocks() - mem_base);
8094             test_ret++;
8095             printf(" %d", n_ctxt);
8096             printf(" %d", n_filename);
8097             printf(" %d", n_node);
8098             printf(" %d", n_node2);
8099             printf("\n");
8100         }
8101     }
8102     }
8103     }
8104     }
8105     function_tests++;
8106 #endif
8107
8108     return(test_ret);
8109 }
8110
8111 static int
8112 test_debugXML(void) {
8113     int test_ret = 0;
8114
8115     if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
8116     test_ret += test_xmlBoolToText();
8117     test_ret += test_xmlDebugCheckDocument();
8118     test_ret += test_xmlDebugDumpAttr();
8119     test_ret += test_xmlDebugDumpAttrList();
8120     test_ret += test_xmlDebugDumpDTD();
8121     test_ret += test_xmlDebugDumpDocument();
8122     test_ret += test_xmlDebugDumpDocumentHead();
8123     test_ret += test_xmlDebugDumpEntities();
8124     test_ret += test_xmlDebugDumpNode();
8125     test_ret += test_xmlDebugDumpNodeList();
8126     test_ret += test_xmlDebugDumpOneNode();
8127     test_ret += test_xmlDebugDumpString();
8128     test_ret += test_xmlLsCountNode();
8129     test_ret += test_xmlLsOneNode();
8130     test_ret += test_xmlShell();
8131     test_ret += test_xmlShellBase();
8132     test_ret += test_xmlShellCat();
8133     test_ret += test_xmlShellDir();
8134     test_ret += test_xmlShellDu();
8135     test_ret += test_xmlShellList();
8136     test_ret += test_xmlShellLoad();
8137     test_ret += test_xmlShellPrintXPathResult();
8138     test_ret += test_xmlShellPwd();
8139     test_ret += test_xmlShellSave();
8140     test_ret += test_xmlShellValidate();
8141     test_ret += test_xmlShellWrite();
8142
8143     if (test_ret != 0)
8144         printf("Module debugXML: %d errors\n", test_ret);
8145     return(test_ret);
8146 }
8147
8148 static int
8149 test_xmlDictCleanup(void) {
8150     int test_ret = 0;
8151
8152     int mem_base;
8153
8154         mem_base = xmlMemBlocks();
8155
8156         xmlDictCleanup();
8157         call_tests++;
8158         xmlResetLastError();
8159         if (mem_base != xmlMemBlocks()) {
8160             printf("Leak of %d blocks found in xmlDictCleanup",
8161                    xmlMemBlocks() - mem_base);
8162             test_ret++;
8163             printf("\n");
8164         }
8165     function_tests++;
8166
8167     return(test_ret);
8168 }
8169
8170
8171 static int
8172 test_xmlDictCreate(void) {
8173     int test_ret = 0;
8174
8175     int mem_base;
8176     xmlDictPtr ret_val;
8177
8178         mem_base = xmlMemBlocks();
8179
8180         ret_val = xmlDictCreate();
8181         desret_xmlDictPtr(ret_val);
8182         call_tests++;
8183         xmlResetLastError();
8184         if (mem_base != xmlMemBlocks()) {
8185             printf("Leak of %d blocks found in xmlDictCreate",
8186                    xmlMemBlocks() - mem_base);
8187             test_ret++;
8188             printf("\n");
8189         }
8190     function_tests++;
8191
8192     return(test_ret);
8193 }
8194
8195
8196 static int
8197 test_xmlDictCreateSub(void) {
8198     int test_ret = 0;
8199
8200     int mem_base;
8201     xmlDictPtr ret_val;
8202     xmlDictPtr sub; /* an existing dictionary */
8203     int n_sub;
8204
8205     for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8206         mem_base = xmlMemBlocks();
8207         sub = gen_xmlDictPtr(n_sub, 0);
8208
8209         ret_val = xmlDictCreateSub(sub);
8210         desret_xmlDictPtr(ret_val);
8211         call_tests++;
8212         des_xmlDictPtr(n_sub, sub, 0);
8213         xmlResetLastError();
8214         if (mem_base != xmlMemBlocks()) {
8215             printf("Leak of %d blocks found in xmlDictCreateSub",
8216                    xmlMemBlocks() - mem_base);
8217             test_ret++;
8218             printf(" %d", n_sub);
8219             printf("\n");
8220         }
8221     }
8222     function_tests++;
8223
8224     return(test_ret);
8225 }
8226
8227
8228 static int
8229 test_xmlDictExists(void) {
8230     int test_ret = 0;
8231
8232     int mem_base;
8233     const xmlChar * ret_val;
8234     xmlDictPtr dict; /* the dictionary */
8235     int n_dict;
8236     xmlChar * name; /* the name of the userdata */
8237     int n_name;
8238     int len; /* the length of the name, if -1 it is recomputed */
8239     int n_len;
8240
8241     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8242     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8243     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8244         mem_base = xmlMemBlocks();
8245         dict = gen_xmlDictPtr(n_dict, 0);
8246         name = gen_const_xmlChar_ptr(n_name, 1);
8247         len = gen_int(n_len, 2);
8248         if ((name != NULL) &&
8249             (len > (int) strlen((const char *) name) + 1))
8250             continue;
8251
8252         ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
8253         desret_const_xmlChar_ptr(ret_val);
8254         call_tests++;
8255         des_xmlDictPtr(n_dict, dict, 0);
8256         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8257         des_int(n_len, len, 2);
8258         xmlResetLastError();
8259         if (mem_base != xmlMemBlocks()) {
8260             printf("Leak of %d blocks found in xmlDictExists",
8261                    xmlMemBlocks() - mem_base);
8262             test_ret++;
8263             printf(" %d", n_dict);
8264             printf(" %d", n_name);
8265             printf(" %d", n_len);
8266             printf("\n");
8267         }
8268     }
8269     }
8270     }
8271     function_tests++;
8272
8273     return(test_ret);
8274 }
8275
8276
8277 static int
8278 test_xmlDictGetUsage(void) {
8279     int test_ret = 0;
8280
8281
8282     /* missing type support */
8283     return(test_ret);
8284 }
8285
8286
8287 static int
8288 test_xmlDictLookup(void) {
8289     int test_ret = 0;
8290
8291     int mem_base;
8292     const xmlChar * ret_val;
8293     xmlDictPtr dict; /* the dictionary */
8294     int n_dict;
8295     xmlChar * name; /* the name of the userdata */
8296     int n_name;
8297     int len; /* the length of the name, if -1 it is recomputed */
8298     int n_len;
8299
8300     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8301     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8302     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8303         mem_base = xmlMemBlocks();
8304         dict = gen_xmlDictPtr(n_dict, 0);
8305         name = gen_const_xmlChar_ptr(n_name, 1);
8306         len = gen_int(n_len, 2);
8307         if ((name != NULL) &&
8308             (len > (int) strlen((const char *) name) + 1))
8309             continue;
8310
8311         ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
8312         desret_const_xmlChar_ptr(ret_val);
8313         call_tests++;
8314         des_xmlDictPtr(n_dict, dict, 0);
8315         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8316         des_int(n_len, len, 2);
8317         xmlResetLastError();
8318         if (mem_base != xmlMemBlocks()) {
8319             printf("Leak of %d blocks found in xmlDictLookup",
8320                    xmlMemBlocks() - mem_base);
8321             test_ret++;
8322             printf(" %d", n_dict);
8323             printf(" %d", n_name);
8324             printf(" %d", n_len);
8325             printf("\n");
8326         }
8327     }
8328     }
8329     }
8330     function_tests++;
8331
8332     return(test_ret);
8333 }
8334
8335
8336 static int
8337 test_xmlDictOwns(void) {
8338     int test_ret = 0;
8339
8340     int mem_base;
8341     int ret_val;
8342     xmlDictPtr dict; /* the dictionary */
8343     int n_dict;
8344     xmlChar * str; /* the string */
8345     int n_str;
8346
8347     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8348     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8349         mem_base = xmlMemBlocks();
8350         dict = gen_xmlDictPtr(n_dict, 0);
8351         str = gen_const_xmlChar_ptr(n_str, 1);
8352
8353         ret_val = xmlDictOwns(dict, (const xmlChar *)str);
8354         desret_int(ret_val);
8355         call_tests++;
8356         des_xmlDictPtr(n_dict, dict, 0);
8357         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
8358         xmlResetLastError();
8359         if (mem_base != xmlMemBlocks()) {
8360             printf("Leak of %d blocks found in xmlDictOwns",
8361                    xmlMemBlocks() - mem_base);
8362             test_ret++;
8363             printf(" %d", n_dict);
8364             printf(" %d", n_str);
8365             printf("\n");
8366         }
8367     }
8368     }
8369     function_tests++;
8370
8371     return(test_ret);
8372 }
8373
8374
8375 static int
8376 test_xmlDictQLookup(void) {
8377     int test_ret = 0;
8378
8379     int mem_base;
8380     const xmlChar * ret_val;
8381     xmlDictPtr dict; /* the dictionary */
8382     int n_dict;
8383     xmlChar * prefix; /* the prefix */
8384     int n_prefix;
8385     xmlChar * name; /* the name */
8386     int n_name;
8387
8388     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8389     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8390     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8391         mem_base = xmlMemBlocks();
8392         dict = gen_xmlDictPtr(n_dict, 0);
8393         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8394         name = gen_const_xmlChar_ptr(n_name, 2);
8395
8396         ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
8397         desret_const_xmlChar_ptr(ret_val);
8398         call_tests++;
8399         des_xmlDictPtr(n_dict, dict, 0);
8400         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
8401         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
8402         xmlResetLastError();
8403         if (mem_base != xmlMemBlocks()) {
8404             printf("Leak of %d blocks found in xmlDictQLookup",
8405                    xmlMemBlocks() - mem_base);
8406             test_ret++;
8407             printf(" %d", n_dict);
8408             printf(" %d", n_prefix);
8409             printf(" %d", n_name);
8410             printf("\n");
8411         }
8412     }
8413     }
8414     }
8415     function_tests++;
8416
8417     return(test_ret);
8418 }
8419
8420
8421 static int
8422 test_xmlDictReference(void) {
8423     int test_ret = 0;
8424
8425     int mem_base;
8426     int ret_val;
8427     xmlDictPtr dict; /* the dictionary */
8428     int n_dict;
8429
8430     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8431         mem_base = xmlMemBlocks();
8432         dict = gen_xmlDictPtr(n_dict, 0);
8433
8434         ret_val = xmlDictReference(dict);
8435         xmlDictFree(dict);
8436         desret_int(ret_val);
8437         call_tests++;
8438         des_xmlDictPtr(n_dict, dict, 0);
8439         xmlResetLastError();
8440         if (mem_base != xmlMemBlocks()) {
8441             printf("Leak of %d blocks found in xmlDictReference",
8442                    xmlMemBlocks() - mem_base);
8443             test_ret++;
8444             printf(" %d", n_dict);
8445             printf("\n");
8446         }
8447     }
8448     function_tests++;
8449
8450     return(test_ret);
8451 }
8452
8453
8454 static int
8455 test_xmlDictSetLimit(void) {
8456     int test_ret = 0;
8457
8458
8459     /* missing type support */
8460     return(test_ret);
8461 }
8462
8463
8464 static int
8465 test_xmlDictSize(void) {
8466     int test_ret = 0;
8467
8468     int mem_base;
8469     int ret_val;
8470     xmlDictPtr dict; /* the dictionary */
8471     int n_dict;
8472
8473     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8474         mem_base = xmlMemBlocks();
8475         dict = gen_xmlDictPtr(n_dict, 0);
8476
8477         ret_val = xmlDictSize(dict);
8478         desret_int(ret_val);
8479         call_tests++;
8480         des_xmlDictPtr(n_dict, dict, 0);
8481         xmlResetLastError();
8482         if (mem_base != xmlMemBlocks()) {
8483             printf("Leak of %d blocks found in xmlDictSize",
8484                    xmlMemBlocks() - mem_base);
8485             test_ret++;
8486             printf(" %d", n_dict);
8487             printf("\n");
8488         }
8489     }
8490     function_tests++;
8491
8492     return(test_ret);
8493 }
8494
8495
8496 static int
8497 test_xmlInitializeDict(void) {
8498     int test_ret = 0;
8499
8500     int mem_base;
8501     int ret_val;
8502
8503         mem_base = xmlMemBlocks();
8504
8505         ret_val = xmlInitializeDict();
8506         desret_int(ret_val);
8507         call_tests++;
8508         xmlResetLastError();
8509         if (mem_base != xmlMemBlocks()) {
8510             printf("Leak of %d blocks found in xmlInitializeDict",
8511                    xmlMemBlocks() - mem_base);
8512             test_ret++;
8513             printf("\n");
8514         }
8515     function_tests++;
8516
8517     return(test_ret);
8518 }
8519
8520 static int
8521 test_dict(void) {
8522     int test_ret = 0;
8523
8524     if (quiet == 0) printf("Testing dict : 10 of 13 functions ...\n");
8525     test_ret += test_xmlDictCleanup();
8526     test_ret += test_xmlDictCreate();
8527     test_ret += test_xmlDictCreateSub();
8528     test_ret += test_xmlDictExists();
8529     test_ret += test_xmlDictGetUsage();
8530     test_ret += test_xmlDictLookup();
8531     test_ret += test_xmlDictOwns();
8532     test_ret += test_xmlDictQLookup();
8533     test_ret += test_xmlDictReference();
8534     test_ret += test_xmlDictSetLimit();
8535     test_ret += test_xmlDictSize();
8536     test_ret += test_xmlInitializeDict();
8537
8538     if (test_ret != 0)
8539         printf("Module dict: %d errors\n", test_ret);
8540     return(test_ret);
8541 }
8542
8543 static int
8544 test_UTF8Toisolat1(void) {
8545     int test_ret = 0;
8546
8547 #if defined(LIBXML_OUTPUT_ENABLED)
8548 #ifdef LIBXML_OUTPUT_ENABLED
8549     int mem_base;
8550     int ret_val;
8551     unsigned char * out; /* a pointer to an array of bytes to store the result */
8552     int n_out;
8553     int * outlen; /* the length of @out */
8554     int n_outlen;
8555     unsigned char * in; /* a pointer to an array of UTF-8 chars */
8556     int n_in;
8557     int * inlen; /* the length of @in */
8558     int n_inlen;
8559
8560     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8561     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8562     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8563     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8564         mem_base = xmlMemBlocks();
8565         out = gen_unsigned_char_ptr(n_out, 0);
8566         outlen = gen_int_ptr(n_outlen, 1);
8567         in = gen_const_unsigned_char_ptr(n_in, 2);
8568         inlen = gen_int_ptr(n_inlen, 3);
8569
8570         ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8571         desret_int(ret_val);
8572         call_tests++;
8573         des_unsigned_char_ptr(n_out, out, 0);
8574         des_int_ptr(n_outlen, outlen, 1);
8575         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8576         des_int_ptr(n_inlen, inlen, 3);
8577         xmlResetLastError();
8578         if (mem_base != xmlMemBlocks()) {
8579             printf("Leak of %d blocks found in UTF8Toisolat1",
8580                    xmlMemBlocks() - mem_base);
8581             test_ret++;
8582             printf(" %d", n_out);
8583             printf(" %d", n_outlen);
8584             printf(" %d", n_in);
8585             printf(" %d", n_inlen);
8586             printf("\n");
8587         }
8588     }
8589     }
8590     }
8591     }
8592     function_tests++;
8593 #endif
8594 #endif
8595
8596     return(test_ret);
8597 }
8598
8599
8600 static int
8601 test_isolat1ToUTF8(void) {
8602     int test_ret = 0;
8603
8604     int mem_base;
8605     int ret_val;
8606     unsigned char * out; /* a pointer to an array of bytes to store the result */
8607     int n_out;
8608     int * outlen; /* the length of @out */
8609     int n_outlen;
8610     unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8611     int n_in;
8612     int * inlen; /* the length of @in */
8613     int n_inlen;
8614
8615     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8616     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8617     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8618     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8619         mem_base = xmlMemBlocks();
8620         out = gen_unsigned_char_ptr(n_out, 0);
8621         outlen = gen_int_ptr(n_outlen, 1);
8622         in = gen_const_unsigned_char_ptr(n_in, 2);
8623         inlen = gen_int_ptr(n_inlen, 3);
8624
8625         ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8626         desret_int(ret_val);
8627         call_tests++;
8628         des_unsigned_char_ptr(n_out, out, 0);
8629         des_int_ptr(n_outlen, outlen, 1);
8630         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8631         des_int_ptr(n_inlen, inlen, 3);
8632         xmlResetLastError();
8633         if (mem_base != xmlMemBlocks()) {
8634             printf("Leak of %d blocks found in isolat1ToUTF8",
8635                    xmlMemBlocks() - mem_base);
8636             test_ret++;
8637             printf(" %d", n_out);
8638             printf(" %d", n_outlen);
8639             printf(" %d", n_in);
8640             printf(" %d", n_inlen);
8641             printf("\n");
8642         }
8643     }
8644     }
8645     }
8646     }
8647     function_tests++;
8648
8649     return(test_ret);
8650 }
8651
8652
8653 static int
8654 test_xmlAddEncodingAlias(void) {
8655     int test_ret = 0;
8656
8657     int ret_val;
8658     char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8659     int n_name;
8660     char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8661     int n_alias;
8662
8663     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8664     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8665         name = gen_const_char_ptr(n_name, 0);
8666         alias = gen_const_char_ptr(n_alias, 1);
8667
8668         ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8669         desret_int(ret_val);
8670         call_tests++;
8671         des_const_char_ptr(n_name, (const char *)name, 0);
8672         des_const_char_ptr(n_alias, (const char *)alias, 1);
8673         xmlResetLastError();
8674     }
8675     }
8676     function_tests++;
8677
8678     return(test_ret);
8679 }
8680
8681
8682 #define gen_nb_xmlCharEncodingHandler_ptr 1
8683 static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8684     return(NULL);
8685 }
8686 static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8687 }
8688
8689 static int
8690 test_xmlCharEncCloseFunc(void) {
8691     int test_ret = 0;
8692
8693     int mem_base;
8694     int ret_val;
8695     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8696     int n_handler;
8697
8698     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8699         mem_base = xmlMemBlocks();
8700         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8701
8702         ret_val = xmlCharEncCloseFunc(handler);
8703         desret_int(ret_val);
8704         call_tests++;
8705         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8706         xmlResetLastError();
8707         if (mem_base != xmlMemBlocks()) {
8708             printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8709                    xmlMemBlocks() - mem_base);
8710             test_ret++;
8711             printf(" %d", n_handler);
8712             printf("\n");
8713         }
8714     }
8715     function_tests++;
8716
8717     return(test_ret);
8718 }
8719
8720
8721 static int
8722 test_xmlCharEncFirstLine(void) {
8723     int test_ret = 0;
8724
8725     int mem_base;
8726     int ret_val;
8727     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8728     int n_handler;
8729     xmlBufferPtr out; /* an xmlBuffer for the output. */
8730     int n_out;
8731     xmlBufferPtr in; /* an xmlBuffer for the input */
8732     int n_in;
8733
8734     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8735     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8736     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8737         mem_base = xmlMemBlocks();
8738         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8739         out = gen_xmlBufferPtr(n_out, 1);
8740         in = gen_xmlBufferPtr(n_in, 2);
8741
8742         ret_val = xmlCharEncFirstLine(handler, out, in);
8743         desret_int(ret_val);
8744         call_tests++;
8745         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8746         des_xmlBufferPtr(n_out, out, 1);
8747         des_xmlBufferPtr(n_in, in, 2);
8748         xmlResetLastError();
8749         if (mem_base != xmlMemBlocks()) {
8750             printf("Leak of %d blocks found in xmlCharEncFirstLine",
8751                    xmlMemBlocks() - mem_base);
8752             test_ret++;
8753             printf(" %d", n_handler);
8754             printf(" %d", n_out);
8755             printf(" %d", n_in);
8756             printf("\n");
8757         }
8758     }
8759     }
8760     }
8761     function_tests++;
8762
8763     return(test_ret);
8764 }
8765
8766
8767 static int
8768 test_xmlCharEncInFunc(void) {
8769     int test_ret = 0;
8770
8771     int mem_base;
8772     int ret_val;
8773     xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8774     int n_handler;
8775     xmlBufferPtr out; /* an xmlBuffer for the output. */
8776     int n_out;
8777     xmlBufferPtr in; /* an xmlBuffer for the input */
8778     int n_in;
8779
8780     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8781     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8782     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8783         mem_base = xmlMemBlocks();
8784         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8785         out = gen_xmlBufferPtr(n_out, 1);
8786         in = gen_xmlBufferPtr(n_in, 2);
8787
8788         ret_val = xmlCharEncInFunc(handler, out, in);
8789         desret_int(ret_val);
8790         call_tests++;
8791         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8792         des_xmlBufferPtr(n_out, out, 1);
8793         des_xmlBufferPtr(n_in, in, 2);
8794         xmlResetLastError();
8795         if (mem_base != xmlMemBlocks()) {
8796             printf("Leak of %d blocks found in xmlCharEncInFunc",
8797                    xmlMemBlocks() - mem_base);
8798             test_ret++;
8799             printf(" %d", n_handler);
8800             printf(" %d", n_out);
8801             printf(" %d", n_in);
8802             printf("\n");
8803         }
8804     }
8805     }
8806     }
8807     function_tests++;
8808
8809     return(test_ret);
8810 }
8811
8812
8813 static int
8814 test_xmlCharEncOutFunc(void) {
8815     int test_ret = 0;
8816
8817     int mem_base;
8818     int ret_val;
8819     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8820     int n_handler;
8821     xmlBufferPtr out; /* an xmlBuffer for the output. */
8822     int n_out;
8823     xmlBufferPtr in; /* an xmlBuffer for the input */
8824     int n_in;
8825
8826     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8827     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8828     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8829         mem_base = xmlMemBlocks();
8830         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8831         out = gen_xmlBufferPtr(n_out, 1);
8832         in = gen_xmlBufferPtr(n_in, 2);
8833
8834         ret_val = xmlCharEncOutFunc(handler, out, in);
8835         desret_int(ret_val);
8836         call_tests++;
8837         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8838         des_xmlBufferPtr(n_out, out, 1);
8839         des_xmlBufferPtr(n_in, in, 2);
8840         xmlResetLastError();
8841         if (mem_base != xmlMemBlocks()) {
8842             printf("Leak of %d blocks found in xmlCharEncOutFunc",
8843                    xmlMemBlocks() - mem_base);
8844             test_ret++;
8845             printf(" %d", n_handler);
8846             printf(" %d", n_out);
8847             printf(" %d", n_in);
8848             printf("\n");
8849         }
8850     }
8851     }
8852     }
8853     function_tests++;
8854
8855     return(test_ret);
8856 }
8857
8858
8859 static int
8860 test_xmlCleanupCharEncodingHandlers(void) {
8861     int test_ret = 0;
8862
8863
8864
8865         xmlCleanupCharEncodingHandlers();
8866         call_tests++;
8867         xmlResetLastError();
8868     function_tests++;
8869
8870     return(test_ret);
8871 }
8872
8873
8874 static int
8875 test_xmlCleanupEncodingAliases(void) {
8876     int test_ret = 0;
8877
8878     int mem_base;
8879
8880         mem_base = xmlMemBlocks();
8881
8882         xmlCleanupEncodingAliases();
8883         call_tests++;
8884         xmlResetLastError();
8885         if (mem_base != xmlMemBlocks()) {
8886             printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
8887                    xmlMemBlocks() - mem_base);
8888             test_ret++;
8889             printf("\n");
8890         }
8891     function_tests++;
8892
8893     return(test_ret);
8894 }
8895
8896
8897 static int
8898 test_xmlDelEncodingAlias(void) {
8899     int test_ret = 0;
8900
8901     int mem_base;
8902     int ret_val;
8903     char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8904     int n_alias;
8905
8906     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8907         mem_base = xmlMemBlocks();
8908         alias = gen_const_char_ptr(n_alias, 0);
8909
8910         ret_val = xmlDelEncodingAlias((const char *)alias);
8911         desret_int(ret_val);
8912         call_tests++;
8913         des_const_char_ptr(n_alias, (const char *)alias, 0);
8914         xmlResetLastError();
8915         if (mem_base != xmlMemBlocks()) {
8916             printf("Leak of %d blocks found in xmlDelEncodingAlias",
8917                    xmlMemBlocks() - mem_base);
8918             test_ret++;
8919             printf(" %d", n_alias);
8920             printf("\n");
8921         }
8922     }
8923     function_tests++;
8924
8925     return(test_ret);
8926 }
8927
8928
8929 static int
8930 test_xmlDetectCharEncoding(void) {
8931     int test_ret = 0;
8932
8933     int mem_base;
8934     xmlCharEncoding ret_val;
8935     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). */
8936     int n_in;
8937     int len; /* pointer to the length of the buffer */
8938     int n_len;
8939
8940     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8941     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8942         mem_base = xmlMemBlocks();
8943         in = gen_const_unsigned_char_ptr(n_in, 0);
8944         len = gen_int(n_len, 1);
8945
8946         ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
8947         desret_xmlCharEncoding(ret_val);
8948         call_tests++;
8949         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
8950         des_int(n_len, len, 1);
8951         xmlResetLastError();
8952         if (mem_base != xmlMemBlocks()) {
8953             printf("Leak of %d blocks found in xmlDetectCharEncoding",
8954                    xmlMemBlocks() - mem_base);
8955             test_ret++;
8956             printf(" %d", n_in);
8957             printf(" %d", n_len);
8958             printf("\n");
8959         }
8960     }
8961     }
8962     function_tests++;
8963
8964     return(test_ret);
8965 }
8966
8967
8968 static int
8969 test_xmlFindCharEncodingHandler(void) {
8970     int test_ret = 0;
8971
8972
8973     /* missing type support */
8974     return(test_ret);
8975 }
8976
8977
8978 static int
8979 test_xmlGetCharEncodingHandler(void) {
8980     int test_ret = 0;
8981
8982
8983     /* missing type support */
8984     return(test_ret);
8985 }
8986
8987
8988 static int
8989 test_xmlGetCharEncodingName(void) {
8990     int test_ret = 0;
8991
8992     int mem_base;
8993     const char * ret_val;
8994     xmlCharEncoding enc; /* the encoding */
8995     int n_enc;
8996
8997     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
8998         mem_base = xmlMemBlocks();
8999         enc = gen_xmlCharEncoding(n_enc, 0);
9000
9001         ret_val = xmlGetCharEncodingName(enc);
9002         desret_const_char_ptr(ret_val);
9003         call_tests++;
9004         des_xmlCharEncoding(n_enc, enc, 0);
9005         xmlResetLastError();
9006         if (mem_base != xmlMemBlocks()) {
9007             printf("Leak of %d blocks found in xmlGetCharEncodingName",
9008                    xmlMemBlocks() - mem_base);
9009             test_ret++;
9010             printf(" %d", n_enc);
9011             printf("\n");
9012         }
9013     }
9014     function_tests++;
9015
9016     return(test_ret);
9017 }
9018
9019
9020 static int
9021 test_xmlGetEncodingAlias(void) {
9022     int test_ret = 0;
9023
9024     int mem_base;
9025     const char * ret_val;
9026     char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
9027     int n_alias;
9028
9029     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
9030         mem_base = xmlMemBlocks();
9031         alias = gen_const_char_ptr(n_alias, 0);
9032
9033         ret_val = xmlGetEncodingAlias((const char *)alias);
9034         desret_const_char_ptr(ret_val);
9035         call_tests++;
9036         des_const_char_ptr(n_alias, (const char *)alias, 0);
9037         xmlResetLastError();
9038         if (mem_base != xmlMemBlocks()) {
9039             printf("Leak of %d blocks found in xmlGetEncodingAlias",
9040                    xmlMemBlocks() - mem_base);
9041             test_ret++;
9042             printf(" %d", n_alias);
9043             printf("\n");
9044         }
9045     }
9046     function_tests++;
9047
9048     return(test_ret);
9049 }
9050
9051
9052 static int
9053 test_xmlInitCharEncodingHandlers(void) {
9054     int test_ret = 0;
9055
9056
9057
9058         xmlInitCharEncodingHandlers();
9059         call_tests++;
9060         xmlResetLastError();
9061     function_tests++;
9062
9063     return(test_ret);
9064 }
9065
9066
9067 static int
9068 test_xmlNewCharEncodingHandler(void) {
9069     int test_ret = 0;
9070
9071
9072     /* missing type support */
9073     return(test_ret);
9074 }
9075
9076
9077 static int
9078 test_xmlParseCharEncoding(void) {
9079     int test_ret = 0;
9080
9081     int mem_base;
9082     xmlCharEncoding ret_val;
9083     char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
9084     int n_name;
9085
9086     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
9087         mem_base = xmlMemBlocks();
9088         name = gen_const_char_ptr(n_name, 0);
9089
9090         ret_val = xmlParseCharEncoding((const char *)name);
9091         desret_xmlCharEncoding(ret_val);
9092         call_tests++;
9093         des_const_char_ptr(n_name, (const char *)name, 0);
9094         xmlResetLastError();
9095         if (mem_base != xmlMemBlocks()) {
9096             printf("Leak of %d blocks found in xmlParseCharEncoding",
9097                    xmlMemBlocks() - mem_base);
9098             test_ret++;
9099             printf(" %d", n_name);
9100             printf("\n");
9101         }
9102     }
9103     function_tests++;
9104
9105     return(test_ret);
9106 }
9107
9108
9109 #define gen_nb_xmlCharEncodingHandlerPtr 1
9110 static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9111     return(NULL);
9112 }
9113 static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9114 }
9115
9116 static int
9117 test_xmlRegisterCharEncodingHandler(void) {
9118     int test_ret = 0;
9119
9120     int mem_base;
9121     xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
9122     int n_handler;
9123
9124     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
9125         mem_base = xmlMemBlocks();
9126         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
9127
9128         xmlRegisterCharEncodingHandler(handler);
9129         call_tests++;
9130         des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
9131         xmlResetLastError();
9132         if (mem_base != xmlMemBlocks()) {
9133             printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
9134                    xmlMemBlocks() - mem_base);
9135             test_ret++;
9136             printf(" %d", n_handler);
9137             printf("\n");
9138         }
9139     }
9140     function_tests++;
9141
9142     return(test_ret);
9143 }
9144
9145 static int
9146 test_encoding(void) {
9147     int test_ret = 0;
9148
9149     if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
9150     test_ret += test_UTF8Toisolat1();
9151     test_ret += test_isolat1ToUTF8();
9152     test_ret += test_xmlAddEncodingAlias();
9153     test_ret += test_xmlCharEncCloseFunc();
9154     test_ret += test_xmlCharEncFirstLine();
9155     test_ret += test_xmlCharEncInFunc();
9156     test_ret += test_xmlCharEncOutFunc();
9157     test_ret += test_xmlCleanupCharEncodingHandlers();
9158     test_ret += test_xmlCleanupEncodingAliases();
9159     test_ret += test_xmlDelEncodingAlias();
9160     test_ret += test_xmlDetectCharEncoding();
9161     test_ret += test_xmlFindCharEncodingHandler();
9162     test_ret += test_xmlGetCharEncodingHandler();
9163     test_ret += test_xmlGetCharEncodingName();
9164     test_ret += test_xmlGetEncodingAlias();
9165     test_ret += test_xmlInitCharEncodingHandlers();
9166     test_ret += test_xmlNewCharEncodingHandler();
9167     test_ret += test_xmlParseCharEncoding();
9168     test_ret += test_xmlRegisterCharEncodingHandler();
9169
9170     if (test_ret != 0)
9171         printf("Module encoding: %d errors\n", test_ret);
9172     return(test_ret);
9173 }
9174
9175 static int
9176 test_xmlAddDocEntity(void) {
9177     int test_ret = 0;
9178
9179     int mem_base;
9180     xmlEntityPtr ret_val;
9181     xmlDocPtr doc; /* the document */
9182     int n_doc;
9183     xmlChar * name; /* the entity name */
9184     int n_name;
9185     int type; /* the entity type XML_xxx_yyy_ENTITY */
9186     int n_type;
9187     xmlChar * ExternalID; /* the entity external ID if available */
9188     int n_ExternalID;
9189     xmlChar * SystemID; /* the entity system ID if available */
9190     int n_SystemID;
9191     xmlChar * content; /* the entity content */
9192     int n_content;
9193
9194     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9195     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9196     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9197     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9198     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9199     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9200         mem_base = xmlMemBlocks();
9201         doc = gen_xmlDocPtr(n_doc, 0);
9202         name = gen_const_xmlChar_ptr(n_name, 1);
9203         type = gen_int(n_type, 2);
9204         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9205         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9206         content = gen_const_xmlChar_ptr(n_content, 5);
9207
9208         ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9209         desret_xmlEntityPtr(ret_val);
9210         call_tests++;
9211         des_xmlDocPtr(n_doc, doc, 0);
9212         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9213         des_int(n_type, type, 2);
9214         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9215         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9216         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9217         xmlResetLastError();
9218         if (mem_base != xmlMemBlocks()) {
9219             printf("Leak of %d blocks found in xmlAddDocEntity",
9220                    xmlMemBlocks() - mem_base);
9221             test_ret++;
9222             printf(" %d", n_doc);
9223             printf(" %d", n_name);
9224             printf(" %d", n_type);
9225             printf(" %d", n_ExternalID);
9226             printf(" %d", n_SystemID);
9227             printf(" %d", n_content);
9228             printf("\n");
9229         }
9230     }
9231     }
9232     }
9233     }
9234     }
9235     }
9236     function_tests++;
9237
9238     return(test_ret);
9239 }
9240
9241
9242 static int
9243 test_xmlAddDtdEntity(void) {
9244     int test_ret = 0;
9245
9246     int mem_base;
9247     xmlEntityPtr ret_val;
9248     xmlDocPtr doc; /* the document */
9249     int n_doc;
9250     xmlChar * name; /* the entity name */
9251     int n_name;
9252     int type; /* the entity type XML_xxx_yyy_ENTITY */
9253     int n_type;
9254     xmlChar * ExternalID; /* the entity external ID if available */
9255     int n_ExternalID;
9256     xmlChar * SystemID; /* the entity system ID if available */
9257     int n_SystemID;
9258     xmlChar * content; /* the entity content */
9259     int n_content;
9260
9261     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9262     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9263     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9264     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9265     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9266     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9267         mem_base = xmlMemBlocks();
9268         doc = gen_xmlDocPtr(n_doc, 0);
9269         name = gen_const_xmlChar_ptr(n_name, 1);
9270         type = gen_int(n_type, 2);
9271         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9272         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9273         content = gen_const_xmlChar_ptr(n_content, 5);
9274
9275         ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9276         desret_xmlEntityPtr(ret_val);
9277         call_tests++;
9278         des_xmlDocPtr(n_doc, doc, 0);
9279         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9280         des_int(n_type, type, 2);
9281         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9282         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9283         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9284         xmlResetLastError();
9285         if (mem_base != xmlMemBlocks()) {
9286             printf("Leak of %d blocks found in xmlAddDtdEntity",
9287                    xmlMemBlocks() - mem_base);
9288             test_ret++;
9289             printf(" %d", n_doc);
9290             printf(" %d", n_name);
9291             printf(" %d", n_type);
9292             printf(" %d", n_ExternalID);
9293             printf(" %d", n_SystemID);
9294             printf(" %d", n_content);
9295             printf("\n");
9296         }
9297     }
9298     }
9299     }
9300     }
9301     }
9302     }
9303     function_tests++;
9304
9305     return(test_ret);
9306 }
9307
9308
9309 static int
9310 test_xmlCleanupPredefinedEntities(void) {
9311     int test_ret = 0;
9312
9313 #if defined(LIBXML_LEGACY_ENABLED)
9314 #ifdef LIBXML_LEGACY_ENABLED
9315     int mem_base;
9316
9317         mem_base = xmlMemBlocks();
9318
9319         xmlCleanupPredefinedEntities();
9320         call_tests++;
9321         xmlResetLastError();
9322         if (mem_base != xmlMemBlocks()) {
9323             printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9324                    xmlMemBlocks() - mem_base);
9325             test_ret++;
9326             printf("\n");
9327         }
9328     function_tests++;
9329 #endif
9330 #endif
9331
9332     return(test_ret);
9333 }
9334
9335
9336 #define gen_nb_xmlEntitiesTablePtr 1
9337 static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9338     return(NULL);
9339 }
9340 static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9341 }
9342
9343 static int
9344 test_xmlCopyEntitiesTable(void) {
9345     int test_ret = 0;
9346
9347
9348     /* missing type support */
9349     return(test_ret);
9350 }
9351
9352
9353 static int
9354 test_xmlCreateEntitiesTable(void) {
9355     int test_ret = 0;
9356
9357
9358     /* missing type support */
9359     return(test_ret);
9360 }
9361
9362
9363 static int
9364 test_xmlDumpEntitiesTable(void) {
9365     int test_ret = 0;
9366
9367 #if defined(LIBXML_OUTPUT_ENABLED)
9368     int mem_base;
9369     xmlBufferPtr buf; /* An XML buffer. */
9370     int n_buf;
9371     xmlEntitiesTablePtr table; /* An entity table */
9372     int n_table;
9373
9374     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9375     for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9376         mem_base = xmlMemBlocks();
9377         buf = gen_xmlBufferPtr(n_buf, 0);
9378         table = gen_xmlEntitiesTablePtr(n_table, 1);
9379
9380         xmlDumpEntitiesTable(buf, table);
9381         call_tests++;
9382         des_xmlBufferPtr(n_buf, buf, 0);
9383         des_xmlEntitiesTablePtr(n_table, table, 1);
9384         xmlResetLastError();
9385         if (mem_base != xmlMemBlocks()) {
9386             printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9387                    xmlMemBlocks() - mem_base);
9388             test_ret++;
9389             printf(" %d", n_buf);
9390             printf(" %d", n_table);
9391             printf("\n");
9392         }
9393     }
9394     }
9395     function_tests++;
9396 #endif
9397
9398     return(test_ret);
9399 }
9400
9401
9402 #define gen_nb_xmlEntityPtr 1
9403 static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9404     return(NULL);
9405 }
9406 static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9407 }
9408
9409 static int
9410 test_xmlDumpEntityDecl(void) {
9411     int test_ret = 0;
9412
9413 #if defined(LIBXML_OUTPUT_ENABLED)
9414     int mem_base;
9415     xmlBufferPtr buf; /* An XML buffer. */
9416     int n_buf;
9417     xmlEntityPtr ent; /* An entity table */
9418     int n_ent;
9419
9420     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9421     for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9422         mem_base = xmlMemBlocks();
9423         buf = gen_xmlBufferPtr(n_buf, 0);
9424         ent = gen_xmlEntityPtr(n_ent, 1);
9425
9426         xmlDumpEntityDecl(buf, ent);
9427         call_tests++;
9428         des_xmlBufferPtr(n_buf, buf, 0);
9429         des_xmlEntityPtr(n_ent, ent, 1);
9430         xmlResetLastError();
9431         if (mem_base != xmlMemBlocks()) {
9432             printf("Leak of %d blocks found in xmlDumpEntityDecl",
9433                    xmlMemBlocks() - mem_base);
9434             test_ret++;
9435             printf(" %d", n_buf);
9436             printf(" %d", n_ent);
9437             printf("\n");
9438         }
9439     }
9440     }
9441     function_tests++;
9442 #endif
9443
9444     return(test_ret);
9445 }
9446
9447
9448 static int
9449 test_xmlEncodeEntitiesReentrant(void) {
9450     int test_ret = 0;
9451
9452     int mem_base;
9453     xmlChar * ret_val;
9454     xmlDocPtr doc; /* the document containing the string */
9455     int n_doc;
9456     xmlChar * input; /* A string to convert to XML. */
9457     int n_input;
9458
9459     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9460     for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9461         mem_base = xmlMemBlocks();
9462         doc = gen_xmlDocPtr(n_doc, 0);
9463         input = gen_const_xmlChar_ptr(n_input, 1);
9464
9465         ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9466         desret_xmlChar_ptr(ret_val);
9467         call_tests++;
9468         des_xmlDocPtr(n_doc, doc, 0);
9469         des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9470         xmlResetLastError();
9471         if (mem_base != xmlMemBlocks()) {
9472             printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9473                    xmlMemBlocks() - mem_base);
9474             test_ret++;
9475             printf(" %d", n_doc);
9476             printf(" %d", n_input);
9477             printf("\n");
9478         }
9479     }
9480     }
9481     function_tests++;
9482
9483     return(test_ret);
9484 }
9485
9486
9487 #define gen_nb_const_xmlDoc_ptr 1
9488 static xmlDoc * gen_const_xmlDoc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9489     return(NULL);
9490 }
9491 static void des_const_xmlDoc_ptr(int no ATTRIBUTE_UNUSED, const xmlDoc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9492 }
9493
9494 static int
9495 test_xmlEncodeSpecialChars(void) {
9496     int test_ret = 0;
9497
9498     int mem_base;
9499     xmlChar * ret_val;
9500     xmlDoc * doc; /* the document containing the string */
9501     int n_doc;
9502     xmlChar * input; /* A string to convert to XML. */
9503     int n_input;
9504
9505     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
9506     for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9507         mem_base = xmlMemBlocks();
9508         doc = gen_const_xmlDoc_ptr(n_doc, 0);
9509         input = gen_const_xmlChar_ptr(n_input, 1);
9510
9511         ret_val = xmlEncodeSpecialChars((const xmlDoc *)doc, (const xmlChar *)input);
9512         desret_xmlChar_ptr(ret_val);
9513         call_tests++;
9514         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
9515         des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9516         xmlResetLastError();
9517         if (mem_base != xmlMemBlocks()) {
9518             printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9519                    xmlMemBlocks() - mem_base);
9520             test_ret++;
9521             printf(" %d", n_doc);
9522             printf(" %d", n_input);
9523             printf("\n");
9524         }
9525     }
9526     }
9527     function_tests++;
9528
9529     return(test_ret);
9530 }
9531
9532
9533 static int
9534 test_xmlGetDocEntity(void) {
9535     int test_ret = 0;
9536
9537     int mem_base;
9538     xmlEntityPtr ret_val;
9539     xmlDoc * doc; /* the document referencing the entity */
9540     int n_doc;
9541     xmlChar * name; /* the entity name */
9542     int n_name;
9543
9544     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
9545     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9546         mem_base = xmlMemBlocks();
9547         doc = gen_const_xmlDoc_ptr(n_doc, 0);
9548         name = gen_const_xmlChar_ptr(n_name, 1);
9549
9550         ret_val = xmlGetDocEntity((const xmlDoc *)doc, (const xmlChar *)name);
9551         desret_xmlEntityPtr(ret_val);
9552         call_tests++;
9553         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
9554         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9555         xmlResetLastError();
9556         if (mem_base != xmlMemBlocks()) {
9557             printf("Leak of %d blocks found in xmlGetDocEntity",
9558                    xmlMemBlocks() - mem_base);
9559             test_ret++;
9560             printf(" %d", n_doc);
9561             printf(" %d", n_name);
9562             printf("\n");
9563         }
9564     }
9565     }
9566     function_tests++;
9567
9568     return(test_ret);
9569 }
9570
9571
9572 static int
9573 test_xmlGetDtdEntity(void) {
9574     int test_ret = 0;
9575
9576     int mem_base;
9577     xmlEntityPtr ret_val;
9578     xmlDocPtr doc; /* the document referencing the entity */
9579     int n_doc;
9580     xmlChar * name; /* the entity name */
9581     int n_name;
9582
9583     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9584     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9585         mem_base = xmlMemBlocks();
9586         doc = gen_xmlDocPtr(n_doc, 0);
9587         name = gen_const_xmlChar_ptr(n_name, 1);
9588
9589         ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9590         desret_xmlEntityPtr(ret_val);
9591         call_tests++;
9592         des_xmlDocPtr(n_doc, doc, 0);
9593         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9594         xmlResetLastError();
9595         if (mem_base != xmlMemBlocks()) {
9596             printf("Leak of %d blocks found in xmlGetDtdEntity",
9597                    xmlMemBlocks() - mem_base);
9598             test_ret++;
9599             printf(" %d", n_doc);
9600             printf(" %d", n_name);
9601             printf("\n");
9602         }
9603     }
9604     }
9605     function_tests++;
9606
9607     return(test_ret);
9608 }
9609
9610
9611 static int
9612 test_xmlGetParameterEntity(void) {
9613     int test_ret = 0;
9614
9615     int mem_base;
9616     xmlEntityPtr ret_val;
9617     xmlDocPtr doc; /* the document referencing the entity */
9618     int n_doc;
9619     xmlChar * name; /* the entity name */
9620     int n_name;
9621
9622     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9623     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9624         mem_base = xmlMemBlocks();
9625         doc = gen_xmlDocPtr(n_doc, 0);
9626         name = gen_const_xmlChar_ptr(n_name, 1);
9627
9628         ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9629         desret_xmlEntityPtr(ret_val);
9630         call_tests++;
9631         des_xmlDocPtr(n_doc, doc, 0);
9632         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9633         xmlResetLastError();
9634         if (mem_base != xmlMemBlocks()) {
9635             printf("Leak of %d blocks found in xmlGetParameterEntity",
9636                    xmlMemBlocks() - mem_base);
9637             test_ret++;
9638             printf(" %d", n_doc);
9639             printf(" %d", n_name);
9640             printf("\n");
9641         }
9642     }
9643     }
9644     function_tests++;
9645
9646     return(test_ret);
9647 }
9648
9649
9650 static int
9651 test_xmlGetPredefinedEntity(void) {
9652     int test_ret = 0;
9653
9654     int mem_base;
9655     xmlEntityPtr ret_val;
9656     xmlChar * name; /* the entity name */
9657     int n_name;
9658
9659     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9660         mem_base = xmlMemBlocks();
9661         name = gen_const_xmlChar_ptr(n_name, 0);
9662
9663         ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9664         desret_xmlEntityPtr(ret_val);
9665         call_tests++;
9666         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9667         xmlResetLastError();
9668         if (mem_base != xmlMemBlocks()) {
9669             printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9670                    xmlMemBlocks() - mem_base);
9671             test_ret++;
9672             printf(" %d", n_name);
9673             printf("\n");
9674         }
9675     }
9676     function_tests++;
9677
9678     return(test_ret);
9679 }
9680
9681
9682 static int
9683 test_xmlInitializePredefinedEntities(void) {
9684     int test_ret = 0;
9685
9686 #if defined(LIBXML_LEGACY_ENABLED)
9687 #ifdef LIBXML_LEGACY_ENABLED
9688     int mem_base;
9689
9690         mem_base = xmlMemBlocks();
9691
9692         xmlInitializePredefinedEntities();
9693         call_tests++;
9694         xmlResetLastError();
9695         if (mem_base != xmlMemBlocks()) {
9696             printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9697                    xmlMemBlocks() - mem_base);
9698             test_ret++;
9699             printf("\n");
9700         }
9701     function_tests++;
9702 #endif
9703 #endif
9704
9705     return(test_ret);
9706 }
9707
9708
9709 static int
9710 test_xmlNewEntity(void) {
9711     int test_ret = 0;
9712
9713     int mem_base;
9714     xmlEntityPtr ret_val;
9715     xmlDocPtr doc; /* the document */
9716     int n_doc;
9717     xmlChar * name; /* the entity name */
9718     int n_name;
9719     int type; /* the entity type XML_xxx_yyy_ENTITY */
9720     int n_type;
9721     xmlChar * ExternalID; /* the entity external ID if available */
9722     int n_ExternalID;
9723     xmlChar * SystemID; /* the entity system ID if available */
9724     int n_SystemID;
9725     xmlChar * content; /* the entity content */
9726     int n_content;
9727
9728     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9729     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9730     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9731     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9732     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9733     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9734         mem_base = xmlMemBlocks();
9735         doc = gen_xmlDocPtr(n_doc, 0);
9736         name = gen_const_xmlChar_ptr(n_name, 1);
9737         type = gen_int(n_type, 2);
9738         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9739         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9740         content = gen_const_xmlChar_ptr(n_content, 5);
9741
9742         ret_val = xmlNewEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9743         desret_xmlEntityPtr(ret_val);
9744         call_tests++;
9745         des_xmlDocPtr(n_doc, doc, 0);
9746         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9747         des_int(n_type, type, 2);
9748         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9749         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9750         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9751         xmlResetLastError();
9752         if (mem_base != xmlMemBlocks()) {
9753             printf("Leak of %d blocks found in xmlNewEntity",
9754                    xmlMemBlocks() - mem_base);
9755             test_ret++;
9756             printf(" %d", n_doc);
9757             printf(" %d", n_name);
9758             printf(" %d", n_type);
9759             printf(" %d", n_ExternalID);
9760             printf(" %d", n_SystemID);
9761             printf(" %d", n_content);
9762             printf("\n");
9763         }
9764     }
9765     }
9766     }
9767     }
9768     }
9769     }
9770     function_tests++;
9771
9772     return(test_ret);
9773 }
9774
9775 static int
9776 test_entities(void) {
9777     int test_ret = 0;
9778
9779     if (quiet == 0) printf("Testing entities : 13 of 17 functions ...\n");
9780     test_ret += test_xmlAddDocEntity();
9781     test_ret += test_xmlAddDtdEntity();
9782     test_ret += test_xmlCleanupPredefinedEntities();
9783     test_ret += test_xmlCopyEntitiesTable();
9784     test_ret += test_xmlCreateEntitiesTable();
9785     test_ret += test_xmlDumpEntitiesTable();
9786     test_ret += test_xmlDumpEntityDecl();
9787     test_ret += test_xmlEncodeEntitiesReentrant();
9788     test_ret += test_xmlEncodeSpecialChars();
9789     test_ret += test_xmlGetDocEntity();
9790     test_ret += test_xmlGetDtdEntity();
9791     test_ret += test_xmlGetParameterEntity();
9792     test_ret += test_xmlGetPredefinedEntity();
9793     test_ret += test_xmlInitializePredefinedEntities();
9794     test_ret += test_xmlNewEntity();
9795
9796     if (test_ret != 0)
9797         printf("Module entities: %d errors\n", test_ret);
9798     return(test_ret);
9799 }
9800
9801 static int
9802 test_xmlHashAddEntry(void) {
9803     int test_ret = 0;
9804
9805     int mem_base;
9806     int ret_val;
9807     xmlHashTablePtr table; /* the hash table */
9808     int n_table;
9809     xmlChar * name; /* the name of the userdata */
9810     int n_name;
9811     void * userdata; /* a pointer to the userdata */
9812     int n_userdata;
9813
9814     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9815     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9816     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9817         mem_base = xmlMemBlocks();
9818         table = gen_xmlHashTablePtr(n_table, 0);
9819         name = gen_const_xmlChar_ptr(n_name, 1);
9820         userdata = gen_userdata(n_userdata, 2);
9821
9822         ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
9823         desret_int(ret_val);
9824         call_tests++;
9825         des_xmlHashTablePtr(n_table, table, 0);
9826         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9827         des_userdata(n_userdata, userdata, 2);
9828         xmlResetLastError();
9829         if (mem_base != xmlMemBlocks()) {
9830             printf("Leak of %d blocks found in xmlHashAddEntry",
9831                    xmlMemBlocks() - mem_base);
9832             test_ret++;
9833             printf(" %d", n_table);
9834             printf(" %d", n_name);
9835             printf(" %d", n_userdata);
9836             printf("\n");
9837         }
9838     }
9839     }
9840     }
9841     function_tests++;
9842
9843     return(test_ret);
9844 }
9845
9846
9847 static int
9848 test_xmlHashAddEntry2(void) {
9849     int test_ret = 0;
9850
9851     int mem_base;
9852     int ret_val;
9853     xmlHashTablePtr table; /* the hash table */
9854     int n_table;
9855     xmlChar * name; /* the name of the userdata */
9856     int n_name;
9857     xmlChar * name2; /* a second name of the userdata */
9858     int n_name2;
9859     void * userdata; /* a pointer to the userdata */
9860     int n_userdata;
9861
9862     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9863     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9864     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9865     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9866         mem_base = xmlMemBlocks();
9867         table = gen_xmlHashTablePtr(n_table, 0);
9868         name = gen_const_xmlChar_ptr(n_name, 1);
9869         name2 = gen_const_xmlChar_ptr(n_name2, 2);
9870         userdata = gen_userdata(n_userdata, 3);
9871
9872         ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
9873         desret_int(ret_val);
9874         call_tests++;
9875         des_xmlHashTablePtr(n_table, table, 0);
9876         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9877         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9878         des_userdata(n_userdata, userdata, 3);
9879         xmlResetLastError();
9880         if (mem_base != xmlMemBlocks()) {
9881             printf("Leak of %d blocks found in xmlHashAddEntry2",
9882                    xmlMemBlocks() - mem_base);
9883             test_ret++;
9884             printf(" %d", n_table);
9885             printf(" %d", n_name);
9886             printf(" %d", n_name2);
9887             printf(" %d", n_userdata);
9888             printf("\n");
9889         }
9890     }
9891     }
9892     }
9893     }
9894     function_tests++;
9895
9896     return(test_ret);
9897 }
9898
9899
9900 static int
9901 test_xmlHashAddEntry3(void) {
9902     int test_ret = 0;
9903
9904     int mem_base;
9905     int ret_val;
9906     xmlHashTablePtr table; /* the hash table */
9907     int n_table;
9908     xmlChar * name; /* the name of the userdata */
9909     int n_name;
9910     xmlChar * name2; /* a second name of the userdata */
9911     int n_name2;
9912     xmlChar * name3; /* a third name of the userdata */
9913     int n_name3;
9914     void * userdata; /* a pointer to the userdata */
9915     int n_userdata;
9916
9917     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9918     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9919     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9920     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9921     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9922         mem_base = xmlMemBlocks();
9923         table = gen_xmlHashTablePtr(n_table, 0);
9924         name = gen_const_xmlChar_ptr(n_name, 1);
9925         name2 = gen_const_xmlChar_ptr(n_name2, 2);
9926         name3 = gen_const_xmlChar_ptr(n_name3, 3);
9927         userdata = gen_userdata(n_userdata, 4);
9928
9929         ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
9930         desret_int(ret_val);
9931         call_tests++;
9932         des_xmlHashTablePtr(n_table, table, 0);
9933         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9934         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9935         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9936         des_userdata(n_userdata, userdata, 4);
9937         xmlResetLastError();
9938         if (mem_base != xmlMemBlocks()) {
9939             printf("Leak of %d blocks found in xmlHashAddEntry3",
9940                    xmlMemBlocks() - mem_base);
9941             test_ret++;
9942             printf(" %d", n_table);
9943             printf(" %d", n_name);
9944             printf(" %d", n_name2);
9945             printf(" %d", n_name3);
9946             printf(" %d", n_userdata);
9947             printf("\n");
9948         }
9949     }
9950     }
9951     }
9952     }
9953     }
9954     function_tests++;
9955
9956     return(test_ret);
9957 }
9958
9959
9960 static int
9961 test_xmlHashCopy(void) {
9962     int test_ret = 0;
9963
9964
9965     /* missing type support */
9966     return(test_ret);
9967 }
9968
9969
9970 static int
9971 test_xmlHashCreate(void) {
9972     int test_ret = 0;
9973
9974
9975     /* missing type support */
9976     return(test_ret);
9977 }
9978
9979
9980 static int
9981 test_xmlHashCreateDict(void) {
9982     int test_ret = 0;
9983
9984
9985     /* missing type support */
9986     return(test_ret);
9987 }
9988
9989
9990 static int
9991 test_xmlHashLookup(void) {
9992     int test_ret = 0;
9993
9994     int mem_base;
9995     void * ret_val;
9996     xmlHashTablePtr table; /* the hash table */
9997     int n_table;
9998     xmlChar * name; /* the name of the userdata */
9999     int n_name;
10000
10001     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10002     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10003         mem_base = xmlMemBlocks();
10004         table = gen_xmlHashTablePtr(n_table, 0);
10005         name = gen_const_xmlChar_ptr(n_name, 1);
10006
10007         ret_val = xmlHashLookup(table, (const xmlChar *)name);
10008         desret_void_ptr(ret_val);
10009         call_tests++;
10010         des_xmlHashTablePtr(n_table, table, 0);
10011         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10012         xmlResetLastError();
10013         if (mem_base != xmlMemBlocks()) {
10014             printf("Leak of %d blocks found in xmlHashLookup",
10015                    xmlMemBlocks() - mem_base);
10016             test_ret++;
10017             printf(" %d", n_table);
10018             printf(" %d", n_name);
10019             printf("\n");
10020         }
10021     }
10022     }
10023     function_tests++;
10024
10025     return(test_ret);
10026 }
10027
10028
10029 static int
10030 test_xmlHashLookup2(void) {
10031     int test_ret = 0;
10032
10033     int mem_base;
10034     void * ret_val;
10035     xmlHashTablePtr table; /* the hash table */
10036     int n_table;
10037     xmlChar * name; /* the name of the userdata */
10038     int n_name;
10039     xmlChar * name2; /* a second name of the userdata */
10040     int n_name2;
10041
10042     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10043     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10044     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10045         mem_base = xmlMemBlocks();
10046         table = gen_xmlHashTablePtr(n_table, 0);
10047         name = gen_const_xmlChar_ptr(n_name, 1);
10048         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10049
10050         ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
10051         desret_void_ptr(ret_val);
10052         call_tests++;
10053         des_xmlHashTablePtr(n_table, table, 0);
10054         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10055         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10056         xmlResetLastError();
10057         if (mem_base != xmlMemBlocks()) {
10058             printf("Leak of %d blocks found in xmlHashLookup2",
10059                    xmlMemBlocks() - mem_base);
10060             test_ret++;
10061             printf(" %d", n_table);
10062             printf(" %d", n_name);
10063             printf(" %d", n_name2);
10064             printf("\n");
10065         }
10066     }
10067     }
10068     }
10069     function_tests++;
10070
10071     return(test_ret);
10072 }
10073
10074
10075 static int
10076 test_xmlHashLookup3(void) {
10077     int test_ret = 0;
10078
10079     int mem_base;
10080     void * ret_val;
10081     xmlHashTablePtr table; /* the hash table */
10082     int n_table;
10083     xmlChar * name; /* the name of the userdata */
10084     int n_name;
10085     xmlChar * name2; /* a second name of the userdata */
10086     int n_name2;
10087     xmlChar * name3; /* a third name of the userdata */
10088     int n_name3;
10089
10090     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10091     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10092     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10093     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10094         mem_base = xmlMemBlocks();
10095         table = gen_xmlHashTablePtr(n_table, 0);
10096         name = gen_const_xmlChar_ptr(n_name, 1);
10097         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10098         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10099
10100         ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
10101         desret_void_ptr(ret_val);
10102         call_tests++;
10103         des_xmlHashTablePtr(n_table, table, 0);
10104         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10105         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10106         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10107         xmlResetLastError();
10108         if (mem_base != xmlMemBlocks()) {
10109             printf("Leak of %d blocks found in xmlHashLookup3",
10110                    xmlMemBlocks() - mem_base);
10111             test_ret++;
10112             printf(" %d", n_table);
10113             printf(" %d", n_name);
10114             printf(" %d", n_name2);
10115             printf(" %d", n_name3);
10116             printf("\n");
10117         }
10118     }
10119     }
10120     }
10121     }
10122     function_tests++;
10123
10124     return(test_ret);
10125 }
10126
10127
10128 static int
10129 test_xmlHashQLookup(void) {
10130     int test_ret = 0;
10131
10132     int mem_base;
10133     void * ret_val;
10134     xmlHashTablePtr table; /* the hash table */
10135     int n_table;
10136     xmlChar * prefix; /* the prefix of the userdata */
10137     int n_prefix;
10138     xmlChar * name; /* the name of the userdata */
10139     int n_name;
10140
10141     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10142     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10143     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10144         mem_base = xmlMemBlocks();
10145         table = gen_xmlHashTablePtr(n_table, 0);
10146         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10147         name = gen_const_xmlChar_ptr(n_name, 2);
10148
10149         ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
10150         desret_void_ptr(ret_val);
10151         call_tests++;
10152         des_xmlHashTablePtr(n_table, table, 0);
10153         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10154         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10155         xmlResetLastError();
10156         if (mem_base != xmlMemBlocks()) {
10157             printf("Leak of %d blocks found in xmlHashQLookup",
10158                    xmlMemBlocks() - mem_base);
10159             test_ret++;
10160             printf(" %d", n_table);
10161             printf(" %d", n_prefix);
10162             printf(" %d", n_name);
10163             printf("\n");
10164         }
10165     }
10166     }
10167     }
10168     function_tests++;
10169
10170     return(test_ret);
10171 }
10172
10173
10174 static int
10175 test_xmlHashQLookup2(void) {
10176     int test_ret = 0;
10177
10178     int mem_base;
10179     void * ret_val;
10180     xmlHashTablePtr table; /* the hash table */
10181     int n_table;
10182     xmlChar * prefix; /* the prefix of the userdata */
10183     int n_prefix;
10184     xmlChar * name; /* the name of the userdata */
10185     int n_name;
10186     xmlChar * prefix2; /* the second prefix of the userdata */
10187     int n_prefix2;
10188     xmlChar * name2; /* a second name of the userdata */
10189     int n_name2;
10190
10191     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10192     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10193     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10194     for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10195     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10196         mem_base = xmlMemBlocks();
10197         table = gen_xmlHashTablePtr(n_table, 0);
10198         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10199         name = gen_const_xmlChar_ptr(n_name, 2);
10200         prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10201         name2 = gen_const_xmlChar_ptr(n_name2, 4);
10202
10203         ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
10204         desret_void_ptr(ret_val);
10205         call_tests++;
10206         des_xmlHashTablePtr(n_table, table, 0);
10207         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10208         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10209         des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10210         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10211         xmlResetLastError();
10212         if (mem_base != xmlMemBlocks()) {
10213             printf("Leak of %d blocks found in xmlHashQLookup2",
10214                    xmlMemBlocks() - mem_base);
10215             test_ret++;
10216             printf(" %d", n_table);
10217             printf(" %d", n_prefix);
10218             printf(" %d", n_name);
10219             printf(" %d", n_prefix2);
10220             printf(" %d", n_name2);
10221             printf("\n");
10222         }
10223     }
10224     }
10225     }
10226     }
10227     }
10228     function_tests++;
10229
10230     return(test_ret);
10231 }
10232
10233
10234 static int
10235 test_xmlHashQLookup3(void) {
10236     int test_ret = 0;
10237
10238     int mem_base;
10239     void * ret_val;
10240     xmlHashTablePtr table; /* the hash table */
10241     int n_table;
10242     xmlChar * prefix; /* the prefix of the userdata */
10243     int n_prefix;
10244     xmlChar * name; /* the name of the userdata */
10245     int n_name;
10246     xmlChar * prefix2; /* the second prefix of the userdata */
10247     int n_prefix2;
10248     xmlChar * name2; /* a second name of the userdata */
10249     int n_name2;
10250     xmlChar * prefix3; /* the third prefix of the userdata */
10251     int n_prefix3;
10252     xmlChar * name3; /* a third name of the userdata */
10253     int n_name3;
10254
10255     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10256     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10257     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10258     for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10259     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10260     for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
10261     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10262         mem_base = xmlMemBlocks();
10263         table = gen_xmlHashTablePtr(n_table, 0);
10264         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10265         name = gen_const_xmlChar_ptr(n_name, 2);
10266         prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10267         name2 = gen_const_xmlChar_ptr(n_name2, 4);
10268         prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
10269         name3 = gen_const_xmlChar_ptr(n_name3, 6);
10270
10271         ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
10272         desret_void_ptr(ret_val);
10273         call_tests++;
10274         des_xmlHashTablePtr(n_table, table, 0);
10275         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10276         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10277         des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10278         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10279         des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
10280         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
10281         xmlResetLastError();
10282         if (mem_base != xmlMemBlocks()) {
10283             printf("Leak of %d blocks found in xmlHashQLookup3",
10284                    xmlMemBlocks() - mem_base);
10285             test_ret++;
10286             printf(" %d", n_table);
10287             printf(" %d", n_prefix);
10288             printf(" %d", n_name);
10289             printf(" %d", n_prefix2);
10290             printf(" %d", n_name2);
10291             printf(" %d", n_prefix3);
10292             printf(" %d", n_name3);
10293             printf("\n");
10294         }
10295     }
10296     }
10297     }
10298     }
10299     }
10300     }
10301     }
10302     function_tests++;
10303
10304     return(test_ret);
10305 }
10306
10307
10308 static int
10309 test_xmlHashRemoveEntry(void) {
10310     int test_ret = 0;
10311
10312     int mem_base;
10313     int ret_val;
10314     xmlHashTablePtr table; /* the hash table */
10315     int n_table;
10316     xmlChar * name; /* the name of the userdata */
10317     int n_name;
10318     xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10319     int n_f;
10320
10321     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10322     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10323     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10324         mem_base = xmlMemBlocks();
10325         table = gen_xmlHashTablePtr(n_table, 0);
10326         name = gen_const_xmlChar_ptr(n_name, 1);
10327         f = gen_xmlHashDeallocator(n_f, 2);
10328
10329         ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10330         desret_int(ret_val);
10331         call_tests++;
10332         des_xmlHashTablePtr(n_table, table, 0);
10333         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10334         des_xmlHashDeallocator(n_f, f, 2);
10335         xmlResetLastError();
10336         if (mem_base != xmlMemBlocks()) {
10337             printf("Leak of %d blocks found in xmlHashRemoveEntry",
10338                    xmlMemBlocks() - mem_base);
10339             test_ret++;
10340             printf(" %d", n_table);
10341             printf(" %d", n_name);
10342             printf(" %d", n_f);
10343             printf("\n");
10344         }
10345     }
10346     }
10347     }
10348     function_tests++;
10349
10350     return(test_ret);
10351 }
10352
10353
10354 static int
10355 test_xmlHashRemoveEntry2(void) {
10356     int test_ret = 0;
10357
10358     int mem_base;
10359     int ret_val;
10360     xmlHashTablePtr table; /* the hash table */
10361     int n_table;
10362     xmlChar * name; /* the name of the userdata */
10363     int n_name;
10364     xmlChar * name2; /* a second name of the userdata */
10365     int n_name2;
10366     xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10367     int n_f;
10368
10369     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10370     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10371     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10372     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10373         mem_base = xmlMemBlocks();
10374         table = gen_xmlHashTablePtr(n_table, 0);
10375         name = gen_const_xmlChar_ptr(n_name, 1);
10376         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10377         f = gen_xmlHashDeallocator(n_f, 3);
10378
10379         ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10380         desret_int(ret_val);
10381         call_tests++;
10382         des_xmlHashTablePtr(n_table, table, 0);
10383         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10384         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10385         des_xmlHashDeallocator(n_f, f, 3);
10386         xmlResetLastError();
10387         if (mem_base != xmlMemBlocks()) {
10388             printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10389                    xmlMemBlocks() - mem_base);
10390             test_ret++;
10391             printf(" %d", n_table);
10392             printf(" %d", n_name);
10393             printf(" %d", n_name2);
10394             printf(" %d", n_f);
10395             printf("\n");
10396         }
10397     }
10398     }
10399     }
10400     }
10401     function_tests++;
10402
10403     return(test_ret);
10404 }
10405
10406
10407 static int
10408 test_xmlHashRemoveEntry3(void) {
10409     int test_ret = 0;
10410
10411     int mem_base;
10412     int ret_val;
10413     xmlHashTablePtr table; /* the hash table */
10414     int n_table;
10415     xmlChar * name; /* the name of the userdata */
10416     int n_name;
10417     xmlChar * name2; /* a second name of the userdata */
10418     int n_name2;
10419     xmlChar * name3; /* a third name of the userdata */
10420     int n_name3;
10421     xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10422     int n_f;
10423
10424     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10425     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10426     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10427     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10428     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10429         mem_base = xmlMemBlocks();
10430         table = gen_xmlHashTablePtr(n_table, 0);
10431         name = gen_const_xmlChar_ptr(n_name, 1);
10432         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10433         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10434         f = gen_xmlHashDeallocator(n_f, 4);
10435
10436         ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10437         desret_int(ret_val);
10438         call_tests++;
10439         des_xmlHashTablePtr(n_table, table, 0);
10440         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10441         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10442         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10443         des_xmlHashDeallocator(n_f, f, 4);
10444         xmlResetLastError();
10445         if (mem_base != xmlMemBlocks()) {
10446             printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10447                    xmlMemBlocks() - mem_base);
10448             test_ret++;
10449             printf(" %d", n_table);
10450             printf(" %d", n_name);
10451             printf(" %d", n_name2);
10452             printf(" %d", n_name3);
10453             printf(" %d", n_f);
10454             printf("\n");
10455         }
10456     }
10457     }
10458     }
10459     }
10460     }
10461     function_tests++;
10462
10463     return(test_ret);
10464 }
10465
10466
10467 static int
10468 test_xmlHashScan(void) {
10469     int test_ret = 0;
10470
10471
10472     /* missing type support */
10473     return(test_ret);
10474 }
10475
10476
10477 static int
10478 test_xmlHashScan3(void) {
10479     int test_ret = 0;
10480
10481
10482     /* missing type support */
10483     return(test_ret);
10484 }
10485
10486
10487 static int
10488 test_xmlHashScanFull(void) {
10489     int test_ret = 0;
10490
10491
10492     /* missing type support */
10493     return(test_ret);
10494 }
10495
10496
10497 static int
10498 test_xmlHashScanFull3(void) {
10499     int test_ret = 0;
10500
10501
10502     /* missing type support */
10503     return(test_ret);
10504 }
10505
10506
10507 static int
10508 test_xmlHashSize(void) {
10509     int test_ret = 0;
10510
10511     int mem_base;
10512     int ret_val;
10513     xmlHashTablePtr table; /* the hash table */
10514     int n_table;
10515
10516     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10517         mem_base = xmlMemBlocks();
10518         table = gen_xmlHashTablePtr(n_table, 0);
10519
10520         ret_val = xmlHashSize(table);
10521         desret_int(ret_val);
10522         call_tests++;
10523         des_xmlHashTablePtr(n_table, table, 0);
10524         xmlResetLastError();
10525         if (mem_base != xmlMemBlocks()) {
10526             printf("Leak of %d blocks found in xmlHashSize",
10527                    xmlMemBlocks() - mem_base);
10528             test_ret++;
10529             printf(" %d", n_table);
10530             printf("\n");
10531         }
10532     }
10533     function_tests++;
10534
10535     return(test_ret);
10536 }
10537
10538
10539 static int
10540 test_xmlHashUpdateEntry(void) {
10541     int test_ret = 0;
10542
10543     int mem_base;
10544     int ret_val;
10545     xmlHashTablePtr table; /* the hash table */
10546     int n_table;
10547     xmlChar * name; /* the name of the userdata */
10548     int n_name;
10549     void * userdata; /* a pointer to the userdata */
10550     int n_userdata;
10551     xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10552     int n_f;
10553
10554     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10555     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10556     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10557     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10558         mem_base = xmlMemBlocks();
10559         table = gen_xmlHashTablePtr(n_table, 0);
10560         name = gen_const_xmlChar_ptr(n_name, 1);
10561         userdata = gen_userdata(n_userdata, 2);
10562         f = gen_xmlHashDeallocator(n_f, 3);
10563
10564         ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10565         desret_int(ret_val);
10566         call_tests++;
10567         des_xmlHashTablePtr(n_table, table, 0);
10568         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10569         des_userdata(n_userdata, userdata, 2);
10570         des_xmlHashDeallocator(n_f, f, 3);
10571         xmlResetLastError();
10572         if (mem_base != xmlMemBlocks()) {
10573             printf("Leak of %d blocks found in xmlHashUpdateEntry",
10574                    xmlMemBlocks() - mem_base);
10575             test_ret++;
10576             printf(" %d", n_table);
10577             printf(" %d", n_name);
10578             printf(" %d", n_userdata);
10579             printf(" %d", n_f);
10580             printf("\n");
10581         }
10582     }
10583     }
10584     }
10585     }
10586     function_tests++;
10587
10588     return(test_ret);
10589 }
10590
10591
10592 static int
10593 test_xmlHashUpdateEntry2(void) {
10594     int test_ret = 0;
10595
10596     int mem_base;
10597     int ret_val;
10598     xmlHashTablePtr table; /* the hash table */
10599     int n_table;
10600     xmlChar * name; /* the name of the userdata */
10601     int n_name;
10602     xmlChar * name2; /* a second name of the userdata */
10603     int n_name2;
10604     void * userdata; /* a pointer to the userdata */
10605     int n_userdata;
10606     xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10607     int n_f;
10608
10609     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10610     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10611     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10612     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10613     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10614         mem_base = xmlMemBlocks();
10615         table = gen_xmlHashTablePtr(n_table, 0);
10616         name = gen_const_xmlChar_ptr(n_name, 1);
10617         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10618         userdata = gen_userdata(n_userdata, 3);
10619         f = gen_xmlHashDeallocator(n_f, 4);
10620
10621         ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10622         desret_int(ret_val);
10623         call_tests++;
10624         des_xmlHashTablePtr(n_table, table, 0);
10625         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10626         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10627         des_userdata(n_userdata, userdata, 3);
10628         des_xmlHashDeallocator(n_f, f, 4);
10629         xmlResetLastError();
10630         if (mem_base != xmlMemBlocks()) {
10631             printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10632                    xmlMemBlocks() - mem_base);
10633             test_ret++;
10634             printf(" %d", n_table);
10635             printf(" %d", n_name);
10636             printf(" %d", n_name2);
10637             printf(" %d", n_userdata);
10638             printf(" %d", n_f);
10639             printf("\n");
10640         }
10641     }
10642     }
10643     }
10644     }
10645     }
10646     function_tests++;
10647
10648     return(test_ret);
10649 }
10650
10651
10652 static int
10653 test_xmlHashUpdateEntry3(void) {
10654     int test_ret = 0;
10655
10656     int mem_base;
10657     int ret_val;
10658     xmlHashTablePtr table; /* the hash table */
10659     int n_table;
10660     xmlChar * name; /* the name of the userdata */
10661     int n_name;
10662     xmlChar * name2; /* a second name of the userdata */
10663     int n_name2;
10664     xmlChar * name3; /* a third name of the userdata */
10665     int n_name3;
10666     void * userdata; /* a pointer to the userdata */
10667     int n_userdata;
10668     xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10669     int n_f;
10670
10671     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10672     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10673     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10674     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10675     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10676     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10677         mem_base = xmlMemBlocks();
10678         table = gen_xmlHashTablePtr(n_table, 0);
10679         name = gen_const_xmlChar_ptr(n_name, 1);
10680         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10681         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10682         userdata = gen_userdata(n_userdata, 4);
10683         f = gen_xmlHashDeallocator(n_f, 5);
10684
10685         ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10686         desret_int(ret_val);
10687         call_tests++;
10688         des_xmlHashTablePtr(n_table, table, 0);
10689         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10690         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10691         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10692         des_userdata(n_userdata, userdata, 4);
10693         des_xmlHashDeallocator(n_f, f, 5);
10694         xmlResetLastError();
10695         if (mem_base != xmlMemBlocks()) {
10696             printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10697                    xmlMemBlocks() - mem_base);
10698             test_ret++;
10699             printf(" %d", n_table);
10700             printf(" %d", n_name);
10701             printf(" %d", n_name2);
10702             printf(" %d", n_name3);
10703             printf(" %d", n_userdata);
10704             printf(" %d", n_f);
10705             printf("\n");
10706         }
10707     }
10708     }
10709     }
10710     }
10711     }
10712     }
10713     function_tests++;
10714
10715     return(test_ret);
10716 }
10717
10718 static int
10719 test_hash(void) {
10720     int test_ret = 0;
10721
10722     if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
10723     test_ret += test_xmlHashAddEntry();
10724     test_ret += test_xmlHashAddEntry2();
10725     test_ret += test_xmlHashAddEntry3();
10726     test_ret += test_xmlHashCopy();
10727     test_ret += test_xmlHashCreate();
10728     test_ret += test_xmlHashCreateDict();
10729     test_ret += test_xmlHashLookup();
10730     test_ret += test_xmlHashLookup2();
10731     test_ret += test_xmlHashLookup3();
10732     test_ret += test_xmlHashQLookup();
10733     test_ret += test_xmlHashQLookup2();
10734     test_ret += test_xmlHashQLookup3();
10735     test_ret += test_xmlHashRemoveEntry();
10736     test_ret += test_xmlHashRemoveEntry2();
10737     test_ret += test_xmlHashRemoveEntry3();
10738     test_ret += test_xmlHashScan();
10739     test_ret += test_xmlHashScan3();
10740     test_ret += test_xmlHashScanFull();
10741     test_ret += test_xmlHashScanFull3();
10742     test_ret += test_xmlHashSize();
10743     test_ret += test_xmlHashUpdateEntry();
10744     test_ret += test_xmlHashUpdateEntry2();
10745     test_ret += test_xmlHashUpdateEntry3();
10746
10747     if (test_ret != 0)
10748         printf("Module hash: %d errors\n", test_ret);
10749     return(test_ret);
10750 }
10751
10752 #define gen_nb_xmlLinkPtr 1
10753 static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10754     return(NULL);
10755 }
10756 static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10757 }
10758
10759 static int
10760 test_xmlLinkGetData(void) {
10761     int test_ret = 0;
10762
10763     int mem_base;
10764     void * ret_val;
10765     xmlLinkPtr lk; /* a link */
10766     int n_lk;
10767
10768     for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10769         mem_base = xmlMemBlocks();
10770         lk = gen_xmlLinkPtr(n_lk, 0);
10771
10772         ret_val = xmlLinkGetData(lk);
10773         desret_void_ptr(ret_val);
10774         call_tests++;
10775         des_xmlLinkPtr(n_lk, lk, 0);
10776         xmlResetLastError();
10777         if (mem_base != xmlMemBlocks()) {
10778             printf("Leak of %d blocks found in xmlLinkGetData",
10779                    xmlMemBlocks() - mem_base);
10780             test_ret++;
10781             printf(" %d", n_lk);
10782             printf("\n");
10783         }
10784     }
10785     function_tests++;
10786
10787     return(test_ret);
10788 }
10789
10790
10791 static int
10792 test_xmlListAppend(void) {
10793     int test_ret = 0;
10794
10795     int mem_base;
10796     int ret_val;
10797     xmlListPtr l; /* a list */
10798     int n_l;
10799     void * data; /* the data */
10800     int n_data;
10801
10802     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10803     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10804         mem_base = xmlMemBlocks();
10805         l = gen_xmlListPtr(n_l, 0);
10806         data = gen_userdata(n_data, 1);
10807
10808         ret_val = xmlListAppend(l, data);
10809         desret_int(ret_val);
10810         call_tests++;
10811         des_xmlListPtr(n_l, l, 0);
10812         des_userdata(n_data, data, 1);
10813         xmlResetLastError();
10814         if (mem_base != xmlMemBlocks()) {
10815             printf("Leak of %d blocks found in xmlListAppend",
10816                    xmlMemBlocks() - mem_base);
10817             test_ret++;
10818             printf(" %d", n_l);
10819             printf(" %d", n_data);
10820             printf("\n");
10821         }
10822     }
10823     }
10824     function_tests++;
10825
10826     return(test_ret);
10827 }
10828
10829
10830 static int
10831 test_xmlListClear(void) {
10832     int test_ret = 0;
10833
10834     int mem_base;
10835     xmlListPtr l; /* a list */
10836     int n_l;
10837
10838     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10839         mem_base = xmlMemBlocks();
10840         l = gen_xmlListPtr(n_l, 0);
10841
10842         xmlListClear(l);
10843         call_tests++;
10844         des_xmlListPtr(n_l, l, 0);
10845         xmlResetLastError();
10846         if (mem_base != xmlMemBlocks()) {
10847             printf("Leak of %d blocks found in xmlListClear",
10848                    xmlMemBlocks() - mem_base);
10849             test_ret++;
10850             printf(" %d", n_l);
10851             printf("\n");
10852         }
10853     }
10854     function_tests++;
10855
10856     return(test_ret);
10857 }
10858
10859
10860 #define gen_nb_const_xmlListPtr 1
10861 static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10862     return(NULL);
10863 }
10864 static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10865 }
10866
10867 static int
10868 test_xmlListCopy(void) {
10869     int test_ret = 0;
10870
10871     int mem_base;
10872     int ret_val;
10873     xmlListPtr cur; /* the new list */
10874     int n_cur;
10875     xmlListPtr old; /* the old list */
10876     int n_old;
10877
10878     for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10879     for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10880         mem_base = xmlMemBlocks();
10881         cur = gen_xmlListPtr(n_cur, 0);
10882         old = gen_const_xmlListPtr(n_old, 1);
10883
10884         ret_val = xmlListCopy(cur, (const xmlListPtr)old);
10885         desret_int(ret_val);
10886         call_tests++;
10887         des_xmlListPtr(n_cur, cur, 0);
10888         des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
10889         xmlResetLastError();
10890         if (mem_base != xmlMemBlocks()) {
10891             printf("Leak of %d blocks found in xmlListCopy",
10892                    xmlMemBlocks() - mem_base);
10893             test_ret++;
10894             printf(" %d", n_cur);
10895             printf(" %d", n_old);
10896             printf("\n");
10897         }
10898     }
10899     }
10900     function_tests++;
10901
10902     return(test_ret);
10903 }
10904
10905
10906 static int
10907 test_xmlListCreate(void) {
10908     int test_ret = 0;
10909
10910
10911     /* missing type support */
10912     return(test_ret);
10913 }
10914
10915
10916 static int
10917 test_xmlListDup(void) {
10918     int test_ret = 0;
10919
10920
10921     /* missing type support */
10922     return(test_ret);
10923 }
10924
10925
10926 static int
10927 test_xmlListEmpty(void) {
10928     int test_ret = 0;
10929
10930     int mem_base;
10931     int ret_val;
10932     xmlListPtr l; /* a list */
10933     int n_l;
10934
10935     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10936         mem_base = xmlMemBlocks();
10937         l = gen_xmlListPtr(n_l, 0);
10938
10939         ret_val = xmlListEmpty(l);
10940         desret_int(ret_val);
10941         call_tests++;
10942         des_xmlListPtr(n_l, l, 0);
10943         xmlResetLastError();
10944         if (mem_base != xmlMemBlocks()) {
10945             printf("Leak of %d blocks found in xmlListEmpty",
10946                    xmlMemBlocks() - mem_base);
10947             test_ret++;
10948             printf(" %d", n_l);
10949             printf("\n");
10950         }
10951     }
10952     function_tests++;
10953
10954     return(test_ret);
10955 }
10956
10957
10958 static int
10959 test_xmlListEnd(void) {
10960     int test_ret = 0;
10961
10962
10963     /* missing type support */
10964     return(test_ret);
10965 }
10966
10967
10968 static int
10969 test_xmlListFront(void) {
10970     int test_ret = 0;
10971
10972
10973     /* missing type support */
10974     return(test_ret);
10975 }
10976
10977
10978 static int
10979 test_xmlListInsert(void) {
10980     int test_ret = 0;
10981
10982     int mem_base;
10983     int ret_val;
10984     xmlListPtr l; /* a list */
10985     int n_l;
10986     void * data; /* the data */
10987     int n_data;
10988
10989     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();
10992         l = gen_xmlListPtr(n_l, 0);
10993         data = gen_userdata(n_data, 1);
10994
10995         ret_val = xmlListInsert(l, data);
10996         desret_int(ret_val);
10997         call_tests++;
10998         des_xmlListPtr(n_l, l, 0);
10999         des_userdata(n_data, data, 1);
11000         xmlResetLastError();
11001         if (mem_base != xmlMemBlocks()) {
11002             printf("Leak of %d blocks found in xmlListInsert",
11003                    xmlMemBlocks() - mem_base);
11004             test_ret++;
11005             printf(" %d", n_l);
11006             printf(" %d", n_data);
11007             printf("\n");
11008         }
11009     }
11010     }
11011     function_tests++;
11012
11013     return(test_ret);
11014 }
11015
11016
11017 static int
11018 test_xmlListMerge(void) {
11019     int test_ret = 0;
11020
11021     int mem_base;
11022     xmlListPtr l1; /* the original list */
11023     int n_l1;
11024     xmlListPtr l2; /* the new list */
11025     int n_l2;
11026
11027     for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
11028     for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
11029         mem_base = xmlMemBlocks();
11030         l1 = gen_xmlListPtr(n_l1, 0);
11031         l2 = gen_xmlListPtr(n_l2, 1);
11032
11033         xmlListMerge(l1, l2);
11034         call_tests++;
11035         des_xmlListPtr(n_l1, l1, 0);
11036         des_xmlListPtr(n_l2, l2, 1);
11037         xmlResetLastError();
11038         if (mem_base != xmlMemBlocks()) {
11039             printf("Leak of %d blocks found in xmlListMerge",
11040                    xmlMemBlocks() - mem_base);
11041             test_ret++;
11042             printf(" %d", n_l1);
11043             printf(" %d", n_l2);
11044             printf("\n");
11045         }
11046     }
11047     }
11048     function_tests++;
11049
11050     return(test_ret);
11051 }
11052
11053
11054 static int
11055 test_xmlListPopBack(void) {
11056     int test_ret = 0;
11057
11058     int mem_base;
11059     xmlListPtr l; /* a list */
11060     int n_l;
11061
11062     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11063         mem_base = xmlMemBlocks();
11064         l = gen_xmlListPtr(n_l, 0);
11065
11066         xmlListPopBack(l);
11067         call_tests++;
11068         des_xmlListPtr(n_l, l, 0);
11069         xmlResetLastError();
11070         if (mem_base != xmlMemBlocks()) {
11071             printf("Leak of %d blocks found in xmlListPopBack",
11072                    xmlMemBlocks() - mem_base);
11073             test_ret++;
11074             printf(" %d", n_l);
11075             printf("\n");
11076         }
11077     }
11078     function_tests++;
11079
11080     return(test_ret);
11081 }
11082
11083
11084 static int
11085 test_xmlListPopFront(void) {
11086     int test_ret = 0;
11087
11088     int mem_base;
11089     xmlListPtr l; /* a list */
11090     int n_l;
11091
11092     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11093         mem_base = xmlMemBlocks();
11094         l = gen_xmlListPtr(n_l, 0);
11095
11096         xmlListPopFront(l);
11097         call_tests++;
11098         des_xmlListPtr(n_l, l, 0);
11099         xmlResetLastError();
11100         if (mem_base != xmlMemBlocks()) {
11101             printf("Leak of %d blocks found in xmlListPopFront",
11102                    xmlMemBlocks() - mem_base);
11103             test_ret++;
11104             printf(" %d", n_l);
11105             printf("\n");
11106         }
11107     }
11108     function_tests++;
11109
11110     return(test_ret);
11111 }
11112
11113
11114 static int
11115 test_xmlListPushBack(void) {
11116     int test_ret = 0;
11117
11118     int mem_base;
11119     int ret_val;
11120     xmlListPtr l; /* a list */
11121     int n_l;
11122     void * data; /* new data */
11123     int n_data;
11124
11125     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11126     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11127         mem_base = xmlMemBlocks();
11128         l = gen_xmlListPtr(n_l, 0);
11129         data = gen_userdata(n_data, 1);
11130
11131         ret_val = xmlListPushBack(l, data);
11132         desret_int(ret_val);
11133         call_tests++;
11134         des_xmlListPtr(n_l, l, 0);
11135         des_userdata(n_data, data, 1);
11136         xmlResetLastError();
11137         if (mem_base != xmlMemBlocks()) {
11138             printf("Leak of %d blocks found in xmlListPushBack",
11139                    xmlMemBlocks() - mem_base);
11140             test_ret++;
11141             printf(" %d", n_l);
11142             printf(" %d", n_data);
11143             printf("\n");
11144         }
11145     }
11146     }
11147     function_tests++;
11148
11149     return(test_ret);
11150 }
11151
11152
11153 static int
11154 test_xmlListPushFront(void) {
11155     int test_ret = 0;
11156
11157     int mem_base;
11158     int ret_val;
11159     xmlListPtr l; /* a list */
11160     int n_l;
11161     void * data; /* new data */
11162     int n_data;
11163
11164     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11165     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11166         mem_base = xmlMemBlocks();
11167         l = gen_xmlListPtr(n_l, 0);
11168         data = gen_userdata(n_data, 1);
11169
11170         ret_val = xmlListPushFront(l, data);
11171         desret_int(ret_val);
11172         call_tests++;
11173         des_xmlListPtr(n_l, l, 0);
11174         des_userdata(n_data, data, 1);
11175         xmlResetLastError();
11176         if (mem_base != xmlMemBlocks()) {
11177             printf("Leak of %d blocks found in xmlListPushFront",
11178                    xmlMemBlocks() - mem_base);
11179             test_ret++;
11180             printf(" %d", n_l);
11181             printf(" %d", n_data);
11182             printf("\n");
11183         }
11184     }
11185     }
11186     function_tests++;
11187
11188     return(test_ret);
11189 }
11190
11191
11192 static int
11193 test_xmlListRemoveAll(void) {
11194     int test_ret = 0;
11195
11196     int mem_base;
11197     int ret_val;
11198     xmlListPtr l; /* a list */
11199     int n_l;
11200     void * data; /* list data */
11201     int n_data;
11202
11203     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11204     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11205         mem_base = xmlMemBlocks();
11206         l = gen_xmlListPtr(n_l, 0);
11207         data = gen_userdata(n_data, 1);
11208
11209         ret_val = xmlListRemoveAll(l, data);
11210         desret_int(ret_val);
11211         call_tests++;
11212         des_xmlListPtr(n_l, l, 0);
11213         des_userdata(n_data, data, 1);
11214         xmlResetLastError();
11215         if (mem_base != xmlMemBlocks()) {
11216             printf("Leak of %d blocks found in xmlListRemoveAll",
11217                    xmlMemBlocks() - mem_base);
11218             test_ret++;
11219             printf(" %d", n_l);
11220             printf(" %d", n_data);
11221             printf("\n");
11222         }
11223     }
11224     }
11225     function_tests++;
11226
11227     return(test_ret);
11228 }
11229
11230
11231 static int
11232 test_xmlListRemoveFirst(void) {
11233     int test_ret = 0;
11234
11235     int mem_base;
11236     int ret_val;
11237     xmlListPtr l; /* a list */
11238     int n_l;
11239     void * data; /* list data */
11240     int n_data;
11241
11242     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11243     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11244         mem_base = xmlMemBlocks();
11245         l = gen_xmlListPtr(n_l, 0);
11246         data = gen_userdata(n_data, 1);
11247
11248         ret_val = xmlListRemoveFirst(l, data);
11249         desret_int(ret_val);
11250         call_tests++;
11251         des_xmlListPtr(n_l, l, 0);
11252         des_userdata(n_data, data, 1);
11253         xmlResetLastError();
11254         if (mem_base != xmlMemBlocks()) {
11255             printf("Leak of %d blocks found in xmlListRemoveFirst",
11256                    xmlMemBlocks() - mem_base);
11257             test_ret++;
11258             printf(" %d", n_l);
11259             printf(" %d", n_data);
11260             printf("\n");
11261         }
11262     }
11263     }
11264     function_tests++;
11265
11266     return(test_ret);
11267 }
11268
11269
11270 static int
11271 test_xmlListRemoveLast(void) {
11272     int test_ret = 0;
11273
11274     int mem_base;
11275     int ret_val;
11276     xmlListPtr l; /* a list */
11277     int n_l;
11278     void * data; /* list data */
11279     int n_data;
11280
11281     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11282     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11283         mem_base = xmlMemBlocks();
11284         l = gen_xmlListPtr(n_l, 0);
11285         data = gen_userdata(n_data, 1);
11286
11287         ret_val = xmlListRemoveLast(l, data);
11288         desret_int(ret_val);
11289         call_tests++;
11290         des_xmlListPtr(n_l, l, 0);
11291         des_userdata(n_data, data, 1);
11292         xmlResetLastError();
11293         if (mem_base != xmlMemBlocks()) {
11294             printf("Leak of %d blocks found in xmlListRemoveLast",
11295                    xmlMemBlocks() - mem_base);
11296             test_ret++;
11297             printf(" %d", n_l);
11298             printf(" %d", n_data);
11299             printf("\n");
11300         }
11301     }
11302     }
11303     function_tests++;
11304
11305     return(test_ret);
11306 }
11307
11308
11309 static int
11310 test_xmlListReverse(void) {
11311     int test_ret = 0;
11312
11313     int mem_base;
11314     xmlListPtr l; /* a list */
11315     int n_l;
11316
11317     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11318         mem_base = xmlMemBlocks();
11319         l = gen_xmlListPtr(n_l, 0);
11320
11321         xmlListReverse(l);
11322         call_tests++;
11323         des_xmlListPtr(n_l, l, 0);
11324         xmlResetLastError();
11325         if (mem_base != xmlMemBlocks()) {
11326             printf("Leak of %d blocks found in xmlListReverse",
11327                    xmlMemBlocks() - mem_base);
11328             test_ret++;
11329             printf(" %d", n_l);
11330             printf("\n");
11331         }
11332     }
11333     function_tests++;
11334
11335     return(test_ret);
11336 }
11337
11338
11339 static int
11340 test_xmlListReverseSearch(void) {
11341     int test_ret = 0;
11342
11343     int mem_base;
11344     void * ret_val;
11345     xmlListPtr l; /* a list */
11346     int n_l;
11347     void * data; /* a search value */
11348     int n_data;
11349
11350     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11351     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11352         mem_base = xmlMemBlocks();
11353         l = gen_xmlListPtr(n_l, 0);
11354         data = gen_userdata(n_data, 1);
11355
11356         ret_val = xmlListReverseSearch(l, data);
11357         desret_void_ptr(ret_val);
11358         call_tests++;
11359         des_xmlListPtr(n_l, l, 0);
11360         des_userdata(n_data, data, 1);
11361         xmlResetLastError();
11362         if (mem_base != xmlMemBlocks()) {
11363             printf("Leak of %d blocks found in xmlListReverseSearch",
11364                    xmlMemBlocks() - mem_base);
11365             test_ret++;
11366             printf(" %d", n_l);
11367             printf(" %d", n_data);
11368             printf("\n");
11369         }
11370     }
11371     }
11372     function_tests++;
11373
11374     return(test_ret);
11375 }
11376
11377
11378 static int
11379 test_xmlListReverseWalk(void) {
11380     int test_ret = 0;
11381
11382
11383     /* missing type support */
11384     return(test_ret);
11385 }
11386
11387
11388 static int
11389 test_xmlListSearch(void) {
11390     int test_ret = 0;
11391
11392     int mem_base;
11393     void * ret_val;
11394     xmlListPtr l; /* a list */
11395     int n_l;
11396     void * data; /* a search value */
11397     int n_data;
11398
11399     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11400     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11401         mem_base = xmlMemBlocks();
11402         l = gen_xmlListPtr(n_l, 0);
11403         data = gen_userdata(n_data, 1);
11404
11405         ret_val = xmlListSearch(l, data);
11406         desret_void_ptr(ret_val);
11407         call_tests++;
11408         des_xmlListPtr(n_l, l, 0);
11409         des_userdata(n_data, data, 1);
11410         xmlResetLastError();
11411         if (mem_base != xmlMemBlocks()) {
11412             printf("Leak of %d blocks found in xmlListSearch",
11413                    xmlMemBlocks() - mem_base);
11414             test_ret++;
11415             printf(" %d", n_l);
11416             printf(" %d", n_data);
11417             printf("\n");
11418         }
11419     }
11420     }
11421     function_tests++;
11422
11423     return(test_ret);
11424 }
11425
11426
11427 static int
11428 test_xmlListSize(void) {
11429     int test_ret = 0;
11430
11431     int mem_base;
11432     int ret_val;
11433     xmlListPtr l; /* a list */
11434     int n_l;
11435
11436     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11437         mem_base = xmlMemBlocks();
11438         l = gen_xmlListPtr(n_l, 0);
11439
11440         ret_val = xmlListSize(l);
11441         desret_int(ret_val);
11442         call_tests++;
11443         des_xmlListPtr(n_l, l, 0);
11444         xmlResetLastError();
11445         if (mem_base != xmlMemBlocks()) {
11446             printf("Leak of %d blocks found in xmlListSize",
11447                    xmlMemBlocks() - mem_base);
11448             test_ret++;
11449             printf(" %d", n_l);
11450             printf("\n");
11451         }
11452     }
11453     function_tests++;
11454
11455     return(test_ret);
11456 }
11457
11458
11459 static int
11460 test_xmlListSort(void) {
11461     int test_ret = 0;
11462
11463     int mem_base;
11464     xmlListPtr l; /* a list */
11465     int n_l;
11466
11467     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11468         mem_base = xmlMemBlocks();
11469         l = gen_xmlListPtr(n_l, 0);
11470
11471         xmlListSort(l);
11472         call_tests++;
11473         des_xmlListPtr(n_l, l, 0);
11474         xmlResetLastError();
11475         if (mem_base != xmlMemBlocks()) {
11476             printf("Leak of %d blocks found in xmlListSort",
11477                    xmlMemBlocks() - mem_base);
11478             test_ret++;
11479             printf(" %d", n_l);
11480             printf("\n");
11481         }
11482     }
11483     function_tests++;
11484
11485     return(test_ret);
11486 }
11487
11488
11489 static int
11490 test_xmlListWalk(void) {
11491     int test_ret = 0;
11492
11493
11494     /* missing type support */
11495     return(test_ret);
11496 }
11497
11498 static int
11499 test_list(void) {
11500     int test_ret = 0;
11501
11502     if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11503     test_ret += test_xmlLinkGetData();
11504     test_ret += test_xmlListAppend();
11505     test_ret += test_xmlListClear();
11506     test_ret += test_xmlListCopy();
11507     test_ret += test_xmlListCreate();
11508     test_ret += test_xmlListDup();
11509     test_ret += test_xmlListEmpty();
11510     test_ret += test_xmlListEnd();
11511     test_ret += test_xmlListFront();
11512     test_ret += test_xmlListInsert();
11513     test_ret += test_xmlListMerge();
11514     test_ret += test_xmlListPopBack();
11515     test_ret += test_xmlListPopFront();
11516     test_ret += test_xmlListPushBack();
11517     test_ret += test_xmlListPushFront();
11518     test_ret += test_xmlListRemoveAll();
11519     test_ret += test_xmlListRemoveFirst();
11520     test_ret += test_xmlListRemoveLast();
11521     test_ret += test_xmlListReverse();
11522     test_ret += test_xmlListReverseSearch();
11523     test_ret += test_xmlListReverseWalk();
11524     test_ret += test_xmlListSearch();
11525     test_ret += test_xmlListSize();
11526     test_ret += test_xmlListSort();
11527     test_ret += test_xmlListWalk();
11528
11529     if (test_ret != 0)
11530         printf("Module list: %d errors\n", test_ret);
11531     return(test_ret);
11532 }
11533
11534 static int
11535 test_xmlNanoFTPCheckResponse(void) {
11536     int test_ret = 0;
11537
11538 #if defined(LIBXML_FTP_ENABLED)
11539     int mem_base;
11540     int ret_val;
11541     void * ctx; /* an FTP context */
11542     int n_ctx;
11543
11544     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11545         mem_base = xmlMemBlocks();
11546         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11547
11548         ret_val = xmlNanoFTPCheckResponse(ctx);
11549         desret_int(ret_val);
11550         call_tests++;
11551         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11552         xmlResetLastError();
11553         if (mem_base != xmlMemBlocks()) {
11554             printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11555                    xmlMemBlocks() - mem_base);
11556             test_ret++;
11557             printf(" %d", n_ctx);
11558             printf("\n");
11559         }
11560     }
11561     function_tests++;
11562 #endif
11563
11564     return(test_ret);
11565 }
11566
11567
11568 static int
11569 test_xmlNanoFTPCleanup(void) {
11570     int test_ret = 0;
11571
11572 #if defined(LIBXML_FTP_ENABLED)
11573     int mem_base;
11574
11575         mem_base = xmlMemBlocks();
11576
11577         xmlNanoFTPCleanup();
11578         call_tests++;
11579         xmlResetLastError();
11580         if (mem_base != xmlMemBlocks()) {
11581             printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11582                    xmlMemBlocks() - mem_base);
11583             test_ret++;
11584             printf("\n");
11585         }
11586     function_tests++;
11587 #endif
11588
11589     return(test_ret);
11590 }
11591
11592
11593 static int
11594 test_xmlNanoFTPCloseConnection(void) {
11595     int test_ret = 0;
11596
11597 #if defined(LIBXML_FTP_ENABLED)
11598     int mem_base;
11599     int ret_val;
11600     void * ctx; /* an FTP context */
11601     int n_ctx;
11602
11603     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11604         mem_base = xmlMemBlocks();
11605         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11606
11607         ret_val = xmlNanoFTPCloseConnection(ctx);
11608         desret_int(ret_val);
11609         call_tests++;
11610         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11611         xmlResetLastError();
11612         if (mem_base != xmlMemBlocks()) {
11613             printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11614                    xmlMemBlocks() - mem_base);
11615             test_ret++;
11616             printf(" %d", n_ctx);
11617             printf("\n");
11618         }
11619     }
11620     function_tests++;
11621 #endif
11622
11623     return(test_ret);
11624 }
11625
11626
11627 static int
11628 test_xmlNanoFTPCwd(void) {
11629     int test_ret = 0;
11630
11631 #if defined(LIBXML_FTP_ENABLED)
11632     int mem_base;
11633     int ret_val;
11634     void * ctx; /* an FTP context */
11635     int n_ctx;
11636     char * directory; /* a directory on the server */
11637     int n_directory;
11638
11639     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11640     for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11641         mem_base = xmlMemBlocks();
11642         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11643         directory = gen_const_char_ptr(n_directory, 1);
11644
11645         ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11646         desret_int(ret_val);
11647         call_tests++;
11648         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11649         des_const_char_ptr(n_directory, (const char *)directory, 1);
11650         xmlResetLastError();
11651         if (mem_base != xmlMemBlocks()) {
11652             printf("Leak of %d blocks found in xmlNanoFTPCwd",
11653                    xmlMemBlocks() - mem_base);
11654             test_ret++;
11655             printf(" %d", n_ctx);
11656             printf(" %d", n_directory);
11657             printf("\n");
11658         }
11659     }
11660     }
11661     function_tests++;
11662 #endif
11663
11664     return(test_ret);
11665 }
11666
11667
11668 static int
11669 test_xmlNanoFTPDele(void) {
11670     int test_ret = 0;
11671
11672 #if defined(LIBXML_FTP_ENABLED)
11673     int mem_base;
11674     int ret_val;
11675     void * ctx; /* an FTP context */
11676     int n_ctx;
11677     const char * file; /* a file or directory on the server */
11678     int n_file;
11679
11680     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11681     for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11682         mem_base = xmlMemBlocks();
11683         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11684         file = gen_filepath(n_file, 1);
11685
11686         ret_val = xmlNanoFTPDele(ctx, file);
11687         desret_int(ret_val);
11688         call_tests++;
11689         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11690         des_filepath(n_file, file, 1);
11691         xmlResetLastError();
11692         if (mem_base != xmlMemBlocks()) {
11693             printf("Leak of %d blocks found in xmlNanoFTPDele",
11694                    xmlMemBlocks() - mem_base);
11695             test_ret++;
11696             printf(" %d", n_ctx);
11697             printf(" %d", n_file);
11698             printf("\n");
11699         }
11700     }
11701     }
11702     function_tests++;
11703 #endif
11704
11705     return(test_ret);
11706 }
11707
11708
11709 static int
11710 test_xmlNanoFTPGet(void) {
11711     int test_ret = 0;
11712
11713
11714     /* missing type support */
11715     return(test_ret);
11716 }
11717
11718
11719 static int
11720 test_xmlNanoFTPGetConnection(void) {
11721     int test_ret = 0;
11722
11723
11724     /* missing type support */
11725     return(test_ret);
11726 }
11727
11728
11729 static int
11730 test_xmlNanoFTPGetResponse(void) {
11731     int test_ret = 0;
11732
11733 #if defined(LIBXML_FTP_ENABLED)
11734     int mem_base;
11735     int ret_val;
11736     void * ctx; /* an FTP context */
11737     int n_ctx;
11738
11739     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11740         mem_base = xmlMemBlocks();
11741         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11742
11743         ret_val = xmlNanoFTPGetResponse(ctx);
11744         desret_int(ret_val);
11745         call_tests++;
11746         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11747         xmlResetLastError();
11748         if (mem_base != xmlMemBlocks()) {
11749             printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11750                    xmlMemBlocks() - mem_base);
11751             test_ret++;
11752             printf(" %d", n_ctx);
11753             printf("\n");
11754         }
11755     }
11756     function_tests++;
11757 #endif
11758
11759     return(test_ret);
11760 }
11761
11762
11763 static int
11764 test_xmlNanoFTPGetSocket(void) {
11765     int test_ret = 0;
11766
11767
11768     /* missing type support */
11769     return(test_ret);
11770 }
11771
11772
11773 static int
11774 test_xmlNanoFTPInit(void) {
11775     int test_ret = 0;
11776
11777 #if defined(LIBXML_FTP_ENABLED)
11778     int mem_base;
11779
11780         mem_base = xmlMemBlocks();
11781
11782         xmlNanoFTPInit();
11783         call_tests++;
11784         xmlResetLastError();
11785         if (mem_base != xmlMemBlocks()) {
11786             printf("Leak of %d blocks found in xmlNanoFTPInit",
11787                    xmlMemBlocks() - mem_base);
11788             test_ret++;
11789             printf("\n");
11790         }
11791     function_tests++;
11792 #endif
11793
11794     return(test_ret);
11795 }
11796
11797
11798 static int
11799 test_xmlNanoFTPList(void) {
11800     int test_ret = 0;
11801
11802
11803     /* missing type support */
11804     return(test_ret);
11805 }
11806
11807
11808 static int
11809 test_xmlNanoFTPNewCtxt(void) {
11810     int test_ret = 0;
11811
11812 #if defined(LIBXML_FTP_ENABLED)
11813     int mem_base;
11814     void * ret_val;
11815     const char * URL; /* The URL used to initialize the context */
11816     int n_URL;
11817
11818     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11819         mem_base = xmlMemBlocks();
11820         URL = gen_filepath(n_URL, 0);
11821
11822         ret_val = xmlNanoFTPNewCtxt(URL);
11823         desret_xmlNanoFTPCtxtPtr(ret_val);
11824         call_tests++;
11825         des_filepath(n_URL, URL, 0);
11826         xmlResetLastError();
11827         if (mem_base != xmlMemBlocks()) {
11828             printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
11829                    xmlMemBlocks() - mem_base);
11830             test_ret++;
11831             printf(" %d", n_URL);
11832             printf("\n");
11833         }
11834     }
11835     function_tests++;
11836 #endif
11837
11838     return(test_ret);
11839 }
11840
11841
11842 static int
11843 test_xmlNanoFTPOpen(void) {
11844     int test_ret = 0;
11845
11846 #if defined(LIBXML_FTP_ENABLED)
11847     int mem_base;
11848     void * ret_val;
11849     const char * URL; /* the URL to the resource */
11850     int n_URL;
11851
11852     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11853         mem_base = xmlMemBlocks();
11854         URL = gen_filepath(n_URL, 0);
11855
11856         ret_val = xmlNanoFTPOpen(URL);
11857         desret_xmlNanoFTPCtxtPtr(ret_val);
11858         call_tests++;
11859         des_filepath(n_URL, URL, 0);
11860         xmlResetLastError();
11861         if (mem_base != xmlMemBlocks()) {
11862             printf("Leak of %d blocks found in xmlNanoFTPOpen",
11863                    xmlMemBlocks() - mem_base);
11864             test_ret++;
11865             printf(" %d", n_URL);
11866             printf("\n");
11867         }
11868     }
11869     function_tests++;
11870 #endif
11871
11872     return(test_ret);
11873 }
11874
11875
11876 static int
11877 test_xmlNanoFTPProxy(void) {
11878     int test_ret = 0;
11879
11880 #if defined(LIBXML_FTP_ENABLED)
11881     char * host; /* the proxy host name */
11882     int n_host;
11883     int port; /* the proxy port */
11884     int n_port;
11885     char * user; /* the proxy user name */
11886     int n_user;
11887     char * passwd; /* the proxy password */
11888     int n_passwd;
11889     int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11890     int n_type;
11891
11892     for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11893     for (n_port = 0;n_port < gen_nb_int;n_port++) {
11894     for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11895     for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11896     for (n_type = 0;n_type < gen_nb_int;n_type++) {
11897         host = gen_const_char_ptr(n_host, 0);
11898         port = gen_int(n_port, 1);
11899         user = gen_const_char_ptr(n_user, 2);
11900         passwd = gen_const_char_ptr(n_passwd, 3);
11901         type = gen_int(n_type, 4);
11902
11903         xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11904         call_tests++;
11905         des_const_char_ptr(n_host, (const char *)host, 0);
11906         des_int(n_port, port, 1);
11907         des_const_char_ptr(n_user, (const char *)user, 2);
11908         des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11909         des_int(n_type, type, 4);
11910         xmlResetLastError();
11911     }
11912     }
11913     }
11914     }
11915     }
11916     function_tests++;
11917 #endif
11918
11919     return(test_ret);
11920 }
11921
11922
11923 static int
11924 test_xmlNanoFTPQuit(void) {
11925     int test_ret = 0;
11926
11927 #if defined(LIBXML_FTP_ENABLED)
11928     int mem_base;
11929     int ret_val;
11930     void * ctx; /* an FTP context */
11931     int n_ctx;
11932
11933     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11934         mem_base = xmlMemBlocks();
11935         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11936
11937         ret_val = xmlNanoFTPQuit(ctx);
11938         desret_int(ret_val);
11939         call_tests++;
11940         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11941         xmlResetLastError();
11942         if (mem_base != xmlMemBlocks()) {
11943             printf("Leak of %d blocks found in xmlNanoFTPQuit",
11944                    xmlMemBlocks() - mem_base);
11945             test_ret++;
11946             printf(" %d", n_ctx);
11947             printf("\n");
11948         }
11949     }
11950     function_tests++;
11951 #endif
11952
11953     return(test_ret);
11954 }
11955
11956
11957 static int
11958 test_xmlNanoFTPRead(void) {
11959     int test_ret = 0;
11960
11961 #if defined(LIBXML_FTP_ENABLED)
11962     int mem_base;
11963     int ret_val;
11964     void * ctx; /* the FTP context */
11965     int n_ctx;
11966     void * dest; /* a buffer */
11967     int n_dest;
11968     int len; /* the buffer length */
11969     int n_len;
11970
11971     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11972     for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11973     for (n_len = 0;n_len < gen_nb_int;n_len++) {
11974         mem_base = xmlMemBlocks();
11975         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11976         dest = gen_void_ptr(n_dest, 1);
11977         len = gen_int(n_len, 2);
11978
11979         ret_val = xmlNanoFTPRead(ctx, dest, len);
11980         desret_int(ret_val);
11981         call_tests++;
11982         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11983         des_void_ptr(n_dest, dest, 1);
11984         des_int(n_len, len, 2);
11985         xmlResetLastError();
11986         if (mem_base != xmlMemBlocks()) {
11987             printf("Leak of %d blocks found in xmlNanoFTPRead",
11988                    xmlMemBlocks() - mem_base);
11989             test_ret++;
11990             printf(" %d", n_ctx);
11991             printf(" %d", n_dest);
11992             printf(" %d", n_len);
11993             printf("\n");
11994         }
11995     }
11996     }
11997     }
11998     function_tests++;
11999 #endif
12000
12001     return(test_ret);
12002 }
12003
12004
12005 static int
12006 test_xmlNanoFTPScanProxy(void) {
12007     int test_ret = 0;
12008
12009 #if defined(LIBXML_FTP_ENABLED)
12010     const char * URL; /* The proxy URL used to initialize the proxy context */
12011     int n_URL;
12012
12013     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12014         URL = gen_filepath(n_URL, 0);
12015
12016         xmlNanoFTPScanProxy(URL);
12017         call_tests++;
12018         des_filepath(n_URL, URL, 0);
12019         xmlResetLastError();
12020     }
12021     function_tests++;
12022 #endif
12023
12024     return(test_ret);
12025 }
12026
12027
12028 static int
12029 test_xmlNanoFTPUpdateURL(void) {
12030     int test_ret = 0;
12031
12032 #if defined(LIBXML_FTP_ENABLED)
12033     int mem_base;
12034     int ret_val;
12035     void * ctx; /* an FTP context */
12036     int n_ctx;
12037     const char * URL; /* The URL used to update the context */
12038     int n_URL;
12039
12040     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
12041     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12042         mem_base = xmlMemBlocks();
12043         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
12044         URL = gen_filepath(n_URL, 1);
12045
12046         ret_val = xmlNanoFTPUpdateURL(ctx, URL);
12047         desret_int(ret_val);
12048         call_tests++;
12049         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
12050         des_filepath(n_URL, URL, 1);
12051         xmlResetLastError();
12052         if (mem_base != xmlMemBlocks()) {
12053             printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
12054                    xmlMemBlocks() - mem_base);
12055             test_ret++;
12056             printf(" %d", n_ctx);
12057             printf(" %d", n_URL);
12058             printf("\n");
12059         }
12060     }
12061     }
12062     function_tests++;
12063 #endif
12064
12065     return(test_ret);
12066 }
12067
12068 static int
12069 test_nanoftp(void) {
12070     int test_ret = 0;
12071
12072     if (quiet == 0) printf("Testing nanoftp : 14 of 22 functions ...\n");
12073     test_ret += test_xmlNanoFTPCheckResponse();
12074     test_ret += test_xmlNanoFTPCleanup();
12075     test_ret += test_xmlNanoFTPCloseConnection();
12076     test_ret += test_xmlNanoFTPCwd();
12077     test_ret += test_xmlNanoFTPDele();
12078     test_ret += test_xmlNanoFTPGet();
12079     test_ret += test_xmlNanoFTPGetConnection();
12080     test_ret += test_xmlNanoFTPGetResponse();
12081     test_ret += test_xmlNanoFTPGetSocket();
12082     test_ret += test_xmlNanoFTPInit();
12083     test_ret += test_xmlNanoFTPList();
12084     test_ret += test_xmlNanoFTPNewCtxt();
12085     test_ret += test_xmlNanoFTPOpen();
12086     test_ret += test_xmlNanoFTPProxy();
12087     test_ret += test_xmlNanoFTPQuit();
12088     test_ret += test_xmlNanoFTPRead();
12089     test_ret += test_xmlNanoFTPScanProxy();
12090     test_ret += test_xmlNanoFTPUpdateURL();
12091
12092     if (test_ret != 0)
12093         printf("Module nanoftp: %d errors\n", test_ret);
12094     return(test_ret);
12095 }
12096
12097 static int
12098 test_xmlNanoHTTPAuthHeader(void) {
12099     int test_ret = 0;
12100
12101 #if defined(LIBXML_HTTP_ENABLED)
12102     int mem_base;
12103     const char * ret_val;
12104     void * ctx; /* the HTTP context */
12105     int n_ctx;
12106
12107     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12108         mem_base = xmlMemBlocks();
12109         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12110
12111         ret_val = xmlNanoHTTPAuthHeader(ctx);
12112         desret_const_char_ptr(ret_val);
12113         call_tests++;
12114         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12115         xmlResetLastError();
12116         if (mem_base != xmlMemBlocks()) {
12117             printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
12118                    xmlMemBlocks() - mem_base);
12119             test_ret++;
12120             printf(" %d", n_ctx);
12121             printf("\n");
12122         }
12123     }
12124     function_tests++;
12125 #endif
12126
12127     return(test_ret);
12128 }
12129
12130
12131 static int
12132 test_xmlNanoHTTPCleanup(void) {
12133     int test_ret = 0;
12134
12135 #if defined(LIBXML_HTTP_ENABLED)
12136     int mem_base;
12137
12138         mem_base = xmlMemBlocks();
12139
12140         xmlNanoHTTPCleanup();
12141         call_tests++;
12142         xmlResetLastError();
12143         if (mem_base != xmlMemBlocks()) {
12144             printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
12145                    xmlMemBlocks() - mem_base);
12146             test_ret++;
12147             printf("\n");
12148         }
12149     function_tests++;
12150 #endif
12151
12152     return(test_ret);
12153 }
12154
12155
12156 static int
12157 test_xmlNanoHTTPContentLength(void) {
12158     int test_ret = 0;
12159
12160 #if defined(LIBXML_HTTP_ENABLED)
12161     int mem_base;
12162     int ret_val;
12163     void * ctx; /* the HTTP context */
12164     int n_ctx;
12165
12166     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12167         mem_base = xmlMemBlocks();
12168         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12169
12170         ret_val = xmlNanoHTTPContentLength(ctx);
12171         desret_int(ret_val);
12172         call_tests++;
12173         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12174         xmlResetLastError();
12175         if (mem_base != xmlMemBlocks()) {
12176             printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
12177                    xmlMemBlocks() - mem_base);
12178             test_ret++;
12179             printf(" %d", n_ctx);
12180             printf("\n");
12181         }
12182     }
12183     function_tests++;
12184 #endif
12185
12186     return(test_ret);
12187 }
12188
12189
12190 static int
12191 test_xmlNanoHTTPEncoding(void) {
12192     int test_ret = 0;
12193
12194 #if defined(LIBXML_HTTP_ENABLED)
12195     int mem_base;
12196     const char * ret_val;
12197     void * ctx; /* the HTTP context */
12198     int n_ctx;
12199
12200     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12201         mem_base = xmlMemBlocks();
12202         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12203
12204         ret_val = xmlNanoHTTPEncoding(ctx);
12205         desret_const_char_ptr(ret_val);
12206         call_tests++;
12207         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12208         xmlResetLastError();
12209         if (mem_base != xmlMemBlocks()) {
12210             printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
12211                    xmlMemBlocks() - mem_base);
12212             test_ret++;
12213             printf(" %d", n_ctx);
12214             printf("\n");
12215         }
12216     }
12217     function_tests++;
12218 #endif
12219
12220     return(test_ret);
12221 }
12222
12223
12224 #define gen_nb_char_ptr_ptr 1
12225 static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12226     return(NULL);
12227 }
12228 static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12229 }
12230
12231 static int
12232 test_xmlNanoHTTPFetch(void) {
12233     int test_ret = 0;
12234
12235 #if defined(LIBXML_HTTP_ENABLED)
12236     int mem_base;
12237     int ret_val;
12238     const char * URL; /* The URL to load */
12239     int n_URL;
12240     const char * filename; /* the filename where the content should be saved */
12241     int n_filename;
12242     char ** contentType; /* if available the Content-Type information will be returned at that location */
12243     int n_contentType;
12244
12245     for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12246     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12247     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12248         mem_base = xmlMemBlocks();
12249         URL = gen_fileoutput(n_URL, 0);
12250         filename = gen_fileoutput(n_filename, 1);
12251         contentType = gen_char_ptr_ptr(n_contentType, 2);
12252
12253         ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12254         desret_int(ret_val);
12255         call_tests++;
12256         des_fileoutput(n_URL, URL, 0);
12257         des_fileoutput(n_filename, filename, 1);
12258         des_char_ptr_ptr(n_contentType, contentType, 2);
12259         xmlResetLastError();
12260         if (mem_base != xmlMemBlocks()) {
12261             printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12262                    xmlMemBlocks() - mem_base);
12263             test_ret++;
12264             printf(" %d", n_URL);
12265             printf(" %d", n_filename);
12266             printf(" %d", n_contentType);
12267             printf("\n");
12268         }
12269     }
12270     }
12271     }
12272     function_tests++;
12273 #endif
12274
12275     return(test_ret);
12276 }
12277
12278
12279 static int
12280 test_xmlNanoHTTPInit(void) {
12281     int test_ret = 0;
12282
12283 #if defined(LIBXML_HTTP_ENABLED)
12284     int mem_base;
12285
12286         mem_base = xmlMemBlocks();
12287
12288         xmlNanoHTTPInit();
12289         call_tests++;
12290         xmlResetLastError();
12291         if (mem_base != xmlMemBlocks()) {
12292             printf("Leak of %d blocks found in xmlNanoHTTPInit",
12293                    xmlMemBlocks() - mem_base);
12294             test_ret++;
12295             printf("\n");
12296         }
12297     function_tests++;
12298 #endif
12299
12300     return(test_ret);
12301 }
12302
12303
12304 static int
12305 test_xmlNanoHTTPMimeType(void) {
12306     int test_ret = 0;
12307
12308 #if defined(LIBXML_HTTP_ENABLED)
12309     int mem_base;
12310     const char * ret_val;
12311     void * ctx; /* the HTTP context */
12312     int n_ctx;
12313
12314     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12315         mem_base = xmlMemBlocks();
12316         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12317
12318         ret_val = xmlNanoHTTPMimeType(ctx);
12319         desret_const_char_ptr(ret_val);
12320         call_tests++;
12321         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12322         xmlResetLastError();
12323         if (mem_base != xmlMemBlocks()) {
12324             printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12325                    xmlMemBlocks() - mem_base);
12326             test_ret++;
12327             printf(" %d", n_ctx);
12328             printf("\n");
12329         }
12330     }
12331     function_tests++;
12332 #endif
12333
12334     return(test_ret);
12335 }
12336
12337
12338 static int
12339 test_xmlNanoHTTPOpen(void) {
12340     int test_ret = 0;
12341
12342 #if defined(LIBXML_HTTP_ENABLED)
12343     int mem_base;
12344     void * ret_val;
12345     const char * URL; /* The URL to load */
12346     int n_URL;
12347     char ** contentType; /* if available the Content-Type information will be returned at that location */
12348     int n_contentType;
12349
12350     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12351     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12352         mem_base = xmlMemBlocks();
12353         URL = gen_filepath(n_URL, 0);
12354         contentType = gen_char_ptr_ptr(n_contentType, 1);
12355
12356         ret_val = xmlNanoHTTPOpen(URL, contentType);
12357         desret_xmlNanoHTTPCtxtPtr(ret_val);
12358         call_tests++;
12359         des_filepath(n_URL, URL, 0);
12360         des_char_ptr_ptr(n_contentType, contentType, 1);
12361         xmlResetLastError();
12362         if (mem_base != xmlMemBlocks()) {
12363             printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12364                    xmlMemBlocks() - mem_base);
12365             test_ret++;
12366             printf(" %d", n_URL);
12367             printf(" %d", n_contentType);
12368             printf("\n");
12369         }
12370     }
12371     }
12372     function_tests++;
12373 #endif
12374
12375     return(test_ret);
12376 }
12377
12378
12379 static int
12380 test_xmlNanoHTTPOpenRedir(void) {
12381     int test_ret = 0;
12382
12383 #if defined(LIBXML_HTTP_ENABLED)
12384     int mem_base;
12385     void * ret_val;
12386     const char * URL; /* The URL to load */
12387     int n_URL;
12388     char ** contentType; /* if available the Content-Type information will be returned at that location */
12389     int n_contentType;
12390     char ** redir; /* if available the redirected URL will be returned */
12391     int n_redir;
12392
12393     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12394     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12395     for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12396         mem_base = xmlMemBlocks();
12397         URL = gen_filepath(n_URL, 0);
12398         contentType = gen_char_ptr_ptr(n_contentType, 1);
12399         redir = gen_char_ptr_ptr(n_redir, 2);
12400
12401         ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12402         desret_xmlNanoHTTPCtxtPtr(ret_val);
12403         call_tests++;
12404         des_filepath(n_URL, URL, 0);
12405         des_char_ptr_ptr(n_contentType, contentType, 1);
12406         des_char_ptr_ptr(n_redir, redir, 2);
12407         xmlResetLastError();
12408         if (mem_base != xmlMemBlocks()) {
12409             printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12410                    xmlMemBlocks() - mem_base);
12411             test_ret++;
12412             printf(" %d", n_URL);
12413             printf(" %d", n_contentType);
12414             printf(" %d", n_redir);
12415             printf("\n");
12416         }
12417     }
12418     }
12419     }
12420     function_tests++;
12421 #endif
12422
12423     return(test_ret);
12424 }
12425
12426
12427 static int
12428 test_xmlNanoHTTPRead(void) {
12429     int test_ret = 0;
12430
12431 #if defined(LIBXML_HTTP_ENABLED)
12432     int mem_base;
12433     int ret_val;
12434     void * ctx; /* the HTTP context */
12435     int n_ctx;
12436     void * dest; /* a buffer */
12437     int n_dest;
12438     int len; /* the buffer length */
12439     int n_len;
12440
12441     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12442     for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12443     for (n_len = 0;n_len < gen_nb_int;n_len++) {
12444         mem_base = xmlMemBlocks();
12445         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12446         dest = gen_void_ptr(n_dest, 1);
12447         len = gen_int(n_len, 2);
12448
12449         ret_val = xmlNanoHTTPRead(ctx, dest, len);
12450         desret_int(ret_val);
12451         call_tests++;
12452         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12453         des_void_ptr(n_dest, dest, 1);
12454         des_int(n_len, len, 2);
12455         xmlResetLastError();
12456         if (mem_base != xmlMemBlocks()) {
12457             printf("Leak of %d blocks found in xmlNanoHTTPRead",
12458                    xmlMemBlocks() - mem_base);
12459             test_ret++;
12460             printf(" %d", n_ctx);
12461             printf(" %d", n_dest);
12462             printf(" %d", n_len);
12463             printf("\n");
12464         }
12465     }
12466     }
12467     }
12468     function_tests++;
12469 #endif
12470
12471     return(test_ret);
12472 }
12473
12474
12475 static int
12476 test_xmlNanoHTTPRedir(void) {
12477     int test_ret = 0;
12478
12479
12480     /* missing type support */
12481     return(test_ret);
12482 }
12483
12484
12485 static int
12486 test_xmlNanoHTTPReturnCode(void) {
12487     int test_ret = 0;
12488
12489 #if defined(LIBXML_HTTP_ENABLED)
12490     int mem_base;
12491     int ret_val;
12492     void * ctx; /* the HTTP context */
12493     int n_ctx;
12494
12495     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12496         mem_base = xmlMemBlocks();
12497         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12498
12499         ret_val = xmlNanoHTTPReturnCode(ctx);
12500         desret_int(ret_val);
12501         call_tests++;
12502         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12503         xmlResetLastError();
12504         if (mem_base != xmlMemBlocks()) {
12505             printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12506                    xmlMemBlocks() - mem_base);
12507             test_ret++;
12508             printf(" %d", n_ctx);
12509             printf("\n");
12510         }
12511     }
12512     function_tests++;
12513 #endif
12514
12515     return(test_ret);
12516 }
12517
12518
12519 static int
12520 test_xmlNanoHTTPSave(void) {
12521     int test_ret = 0;
12522
12523 #if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12524     int mem_base;
12525     int ret_val;
12526     void * ctxt; /* the HTTP context */
12527     int n_ctxt;
12528     const char * filename; /* the filename where the content should be saved */
12529     int n_filename;
12530
12531     for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12532     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12533         mem_base = xmlMemBlocks();
12534         ctxt = gen_void_ptr(n_ctxt, 0);
12535         filename = gen_fileoutput(n_filename, 1);
12536
12537         ret_val = xmlNanoHTTPSave(ctxt, filename);
12538         desret_int(ret_val);
12539         call_tests++;
12540         des_void_ptr(n_ctxt, ctxt, 0);
12541         des_fileoutput(n_filename, filename, 1);
12542         xmlResetLastError();
12543         if (mem_base != xmlMemBlocks()) {
12544             printf("Leak of %d blocks found in xmlNanoHTTPSave",
12545                    xmlMemBlocks() - mem_base);
12546             test_ret++;
12547             printf(" %d", n_ctxt);
12548             printf(" %d", n_filename);
12549             printf("\n");
12550         }
12551     }
12552     }
12553     function_tests++;
12554 #endif
12555
12556     return(test_ret);
12557 }
12558
12559
12560 static int
12561 test_xmlNanoHTTPScanProxy(void) {
12562     int test_ret = 0;
12563
12564 #if defined(LIBXML_HTTP_ENABLED)
12565     const char * URL; /* The proxy URL used to initialize the proxy context */
12566     int n_URL;
12567
12568     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12569         URL = gen_filepath(n_URL, 0);
12570
12571         xmlNanoHTTPScanProxy(URL);
12572         call_tests++;
12573         des_filepath(n_URL, URL, 0);
12574         xmlResetLastError();
12575     }
12576     function_tests++;
12577 #endif
12578
12579     return(test_ret);
12580 }
12581
12582 static int
12583 test_nanohttp(void) {
12584     int test_ret = 0;
12585
12586     if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12587     test_ret += test_xmlNanoHTTPAuthHeader();
12588     test_ret += test_xmlNanoHTTPCleanup();
12589     test_ret += test_xmlNanoHTTPContentLength();
12590     test_ret += test_xmlNanoHTTPEncoding();
12591     test_ret += test_xmlNanoHTTPFetch();
12592     test_ret += test_xmlNanoHTTPInit();
12593     test_ret += test_xmlNanoHTTPMimeType();
12594     test_ret += test_xmlNanoHTTPOpen();
12595     test_ret += test_xmlNanoHTTPOpenRedir();
12596     test_ret += test_xmlNanoHTTPRead();
12597     test_ret += test_xmlNanoHTTPRedir();
12598     test_ret += test_xmlNanoHTTPReturnCode();
12599     test_ret += test_xmlNanoHTTPSave();
12600     test_ret += test_xmlNanoHTTPScanProxy();
12601
12602     if (test_ret != 0)
12603         printf("Module nanohttp: %d errors\n", test_ret);
12604     return(test_ret);
12605 }
12606
12607 static int
12608 test_xmlByteConsumed(void) {
12609     int test_ret = 0;
12610
12611     int mem_base;
12612     long ret_val;
12613     xmlParserCtxtPtr ctxt; /* an XML parser context */
12614     int n_ctxt;
12615
12616     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12617         mem_base = xmlMemBlocks();
12618         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12619
12620         ret_val = xmlByteConsumed(ctxt);
12621         desret_long(ret_val);
12622         call_tests++;
12623         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12624         xmlResetLastError();
12625         if (mem_base != xmlMemBlocks()) {
12626             printf("Leak of %d blocks found in xmlByteConsumed",
12627                    xmlMemBlocks() - mem_base);
12628             test_ret++;
12629             printf(" %d", n_ctxt);
12630             printf("\n");
12631         }
12632     }
12633     function_tests++;
12634
12635     return(test_ret);
12636 }
12637
12638
12639 static int
12640 test_xmlClearNodeInfoSeq(void) {
12641     int test_ret = 0;
12642
12643     int mem_base;
12644     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12645     int n_seq;
12646
12647     for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12648         mem_base = xmlMemBlocks();
12649         seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12650
12651         xmlClearNodeInfoSeq(seq);
12652         call_tests++;
12653         des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12654         xmlResetLastError();
12655         if (mem_base != xmlMemBlocks()) {
12656             printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12657                    xmlMemBlocks() - mem_base);
12658             test_ret++;
12659             printf(" %d", n_seq);
12660             printf("\n");
12661         }
12662     }
12663     function_tests++;
12664
12665     return(test_ret);
12666 }
12667
12668
12669 static int
12670 test_xmlClearParserCtxt(void) {
12671     int test_ret = 0;
12672
12673     int mem_base;
12674     xmlParserCtxtPtr ctxt; /* an XML parser context */
12675     int n_ctxt;
12676
12677     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12678         mem_base = xmlMemBlocks();
12679         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12680
12681         xmlClearParserCtxt(ctxt);
12682         call_tests++;
12683         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12684         xmlResetLastError();
12685         if (mem_base != xmlMemBlocks()) {
12686             printf("Leak of %d blocks found in xmlClearParserCtxt",
12687                    xmlMemBlocks() - mem_base);
12688             test_ret++;
12689             printf(" %d", n_ctxt);
12690             printf("\n");
12691         }
12692     }
12693     function_tests++;
12694
12695     return(test_ret);
12696 }
12697
12698
12699 static int
12700 test_xmlCreateDocParserCtxt(void) {
12701     int test_ret = 0;
12702
12703     int mem_base;
12704     xmlParserCtxtPtr ret_val;
12705     xmlChar * cur; /* a pointer to an array of xmlChar */
12706     int n_cur;
12707
12708     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12709         mem_base = xmlMemBlocks();
12710         cur = gen_const_xmlChar_ptr(n_cur, 0);
12711
12712         ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12713         desret_xmlParserCtxtPtr(ret_val);
12714         call_tests++;
12715         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12716         xmlResetLastError();
12717         if (mem_base != xmlMemBlocks()) {
12718             printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12719                    xmlMemBlocks() - mem_base);
12720             test_ret++;
12721             printf(" %d", n_cur);
12722             printf("\n");
12723         }
12724     }
12725     function_tests++;
12726
12727     return(test_ret);
12728 }
12729
12730
12731 static int
12732 test_xmlCreatePushParserCtxt(void) {
12733     int test_ret = 0;
12734
12735 #if defined(LIBXML_PUSH_ENABLED)
12736     int mem_base;
12737     xmlParserCtxtPtr ret_val;
12738     xmlSAXHandlerPtr sax; /* a SAX handler */
12739     int n_sax;
12740     void * user_data; /* The user data returned on SAX callbacks */
12741     int n_user_data;
12742     char * chunk; /* a pointer to an array of chars */
12743     int n_chunk;
12744     int size; /* number of chars in the array */
12745     int n_size;
12746     const char * filename; /* an optional file name or URI */
12747     int n_filename;
12748
12749     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12750     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12751     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12752     for (n_size = 0;n_size < gen_nb_int;n_size++) {
12753     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12754         mem_base = xmlMemBlocks();
12755         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12756         user_data = gen_userdata(n_user_data, 1);
12757         chunk = gen_const_char_ptr(n_chunk, 2);
12758         size = gen_int(n_size, 3);
12759         filename = gen_fileoutput(n_filename, 4);
12760         if ((chunk != NULL) &&
12761             (size > (int) strlen((const char *) chunk) + 1))
12762             continue;
12763
12764         ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12765         desret_xmlParserCtxtPtr(ret_val);
12766         call_tests++;
12767         des_xmlSAXHandlerPtr(n_sax, sax, 0);
12768         des_userdata(n_user_data, user_data, 1);
12769         des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12770         des_int(n_size, size, 3);
12771         des_fileoutput(n_filename, filename, 4);
12772         xmlResetLastError();
12773         if (mem_base != xmlMemBlocks()) {
12774             printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12775                    xmlMemBlocks() - mem_base);
12776             test_ret++;
12777             printf(" %d", n_sax);
12778             printf(" %d", n_user_data);
12779             printf(" %d", n_chunk);
12780             printf(" %d", n_size);
12781             printf(" %d", n_filename);
12782             printf("\n");
12783         }
12784     }
12785     }
12786     }
12787     }
12788     }
12789     function_tests++;
12790 #endif
12791
12792     return(test_ret);
12793 }
12794
12795
12796 static int
12797 test_xmlCtxtReadDoc(void) {
12798     int test_ret = 0;
12799
12800     int mem_base;
12801     xmlDocPtr ret_val;
12802     xmlParserCtxtPtr ctxt; /* an XML parser context */
12803     int n_ctxt;
12804     xmlChar * cur; /* a pointer to a zero terminated string */
12805     int n_cur;
12806     const char * URL; /* the base URL to use for the document */
12807     int n_URL;
12808     char * encoding; /* the document encoding, or NULL */
12809     int n_encoding;
12810     int options; /* a combination of xmlParserOption */
12811     int n_options;
12812
12813     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12814     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12815     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12816     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12817     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12818         mem_base = xmlMemBlocks();
12819         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12820         cur = gen_const_xmlChar_ptr(n_cur, 1);
12821         URL = gen_filepath(n_URL, 2);
12822         encoding = gen_const_char_ptr(n_encoding, 3);
12823         options = gen_parseroptions(n_options, 4);
12824
12825         ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12826         desret_xmlDocPtr(ret_val);
12827         call_tests++;
12828         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12829         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12830         des_filepath(n_URL, URL, 2);
12831         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12832         des_parseroptions(n_options, options, 4);
12833         xmlResetLastError();
12834         if (mem_base != xmlMemBlocks()) {
12835             printf("Leak of %d blocks found in xmlCtxtReadDoc",
12836                    xmlMemBlocks() - mem_base);
12837             test_ret++;
12838             printf(" %d", n_ctxt);
12839             printf(" %d", n_cur);
12840             printf(" %d", n_URL);
12841             printf(" %d", n_encoding);
12842             printf(" %d", n_options);
12843             printf("\n");
12844         }
12845     }
12846     }
12847     }
12848     }
12849     }
12850     function_tests++;
12851
12852     return(test_ret);
12853 }
12854
12855
12856 static int
12857 test_xmlCtxtReadFile(void) {
12858     int test_ret = 0;
12859
12860     int mem_base;
12861     xmlDocPtr ret_val;
12862     xmlParserCtxtPtr ctxt; /* an XML parser context */
12863     int n_ctxt;
12864     const char * filename; /* a file or URL */
12865     int n_filename;
12866     char * encoding; /* the document encoding, or NULL */
12867     int n_encoding;
12868     int options; /* a combination of xmlParserOption */
12869     int n_options;
12870
12871     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12872     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12873     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12874     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12875         mem_base = xmlMemBlocks();
12876         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12877         filename = gen_filepath(n_filename, 1);
12878         encoding = gen_const_char_ptr(n_encoding, 2);
12879         options = gen_parseroptions(n_options, 3);
12880
12881         ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12882         desret_xmlDocPtr(ret_val);
12883         call_tests++;
12884         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12885         des_filepath(n_filename, filename, 1);
12886         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12887         des_parseroptions(n_options, options, 3);
12888         xmlResetLastError();
12889         if (mem_base != xmlMemBlocks()) {
12890             printf("Leak of %d blocks found in xmlCtxtReadFile",
12891                    xmlMemBlocks() - mem_base);
12892             test_ret++;
12893             printf(" %d", n_ctxt);
12894             printf(" %d", n_filename);
12895             printf(" %d", n_encoding);
12896             printf(" %d", n_options);
12897             printf("\n");
12898         }
12899     }
12900     }
12901     }
12902     }
12903     function_tests++;
12904
12905     return(test_ret);
12906 }
12907
12908
12909 static int
12910 test_xmlCtxtReadMemory(void) {
12911     int test_ret = 0;
12912
12913     int mem_base;
12914     xmlDocPtr ret_val;
12915     xmlParserCtxtPtr ctxt; /* an XML parser context */
12916     int n_ctxt;
12917     char * buffer; /* a pointer to a char array */
12918     int n_buffer;
12919     int size; /* the size of the array */
12920     int n_size;
12921     const char * URL; /* the base URL to use for the document */
12922     int n_URL;
12923     char * encoding; /* the document encoding, or NULL */
12924     int n_encoding;
12925     int options; /* a combination of xmlParserOption */
12926     int n_options;
12927
12928     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12929     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12930     for (n_size = 0;n_size < gen_nb_int;n_size++) {
12931     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12932     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12933     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12934         mem_base = xmlMemBlocks();
12935         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12936         buffer = gen_const_char_ptr(n_buffer, 1);
12937         size = gen_int(n_size, 2);
12938         URL = gen_filepath(n_URL, 3);
12939         encoding = gen_const_char_ptr(n_encoding, 4);
12940         options = gen_parseroptions(n_options, 5);
12941         if ((buffer != NULL) &&
12942             (size > (int) strlen((const char *) buffer) + 1))
12943             continue;
12944
12945         ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12946         desret_xmlDocPtr(ret_val);
12947         call_tests++;
12948         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12949         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12950         des_int(n_size, size, 2);
12951         des_filepath(n_URL, URL, 3);
12952         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12953         des_parseroptions(n_options, options, 5);
12954         xmlResetLastError();
12955         if (mem_base != xmlMemBlocks()) {
12956             printf("Leak of %d blocks found in xmlCtxtReadMemory",
12957                    xmlMemBlocks() - mem_base);
12958             test_ret++;
12959             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");
12966         }
12967     }
12968     }
12969     }
12970     }
12971     }
12972     }
12973     function_tests++;
12974
12975     return(test_ret);
12976 }
12977
12978
12979 static int
12980 test_xmlCtxtReset(void) {
12981     int test_ret = 0;
12982
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();
12989         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12990
12991         xmlCtxtReset(ctxt);
12992         call_tests++;
12993         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12994         xmlResetLastError();
12995         if (mem_base != xmlMemBlocks()) {
12996             printf("Leak of %d blocks found in xmlCtxtReset",
12997                    xmlMemBlocks() - mem_base);
12998             test_ret++;
12999             printf(" %d", n_ctxt);
13000             printf("\n");
13001         }
13002     }
13003     function_tests++;
13004
13005     return(test_ret);
13006 }
13007
13008
13009 static int
13010 test_xmlCtxtResetPush(void) {
13011     int test_ret = 0;
13012
13013     int mem_base;
13014     int ret_val;
13015     xmlParserCtxtPtr ctxt; /* an XML parser context */
13016     int n_ctxt;
13017     char * chunk; /* a pointer to an array of chars */
13018     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;
13023     char * encoding; /* the document encoding, or NULL */
13024     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();
13032         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);
13037         if ((chunk != NULL) &&
13038             (size > (int) strlen((const char *) chunk) + 1))
13039             continue;
13040
13041         ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
13042         desret_int(ret_val);
13043         call_tests++;
13044         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13045         des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13046         des_int(n_size, size, 2);
13047         des_filepath(n_filename, filename, 3);
13048         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
13049         xmlResetLastError();
13050         if (mem_base != xmlMemBlocks()) {
13051             printf("Leak of %d blocks found in xmlCtxtResetPush",
13052                    xmlMemBlocks() - mem_base);
13053             test_ret++;
13054             printf(" %d", n_ctxt);
13055             printf(" %d", n_chunk);
13056             printf(" %d", n_size);
13057             printf(" %d", n_filename);
13058             printf(" %d", n_encoding);
13059             printf("\n");
13060         }
13061     }
13062     }
13063     }
13064     }
13065     }
13066     function_tests++;
13067
13068     return(test_ret);
13069 }
13070
13071
13072 static int
13073 test_xmlCtxtUseOptions(void) {
13074     int test_ret = 0;
13075
13076     int mem_base;
13077     int ret_val;
13078     xmlParserCtxtPtr ctxt; /* an XML parser context */
13079     int n_ctxt;
13080     int options; /* a combination of xmlParserOption */
13081     int n_options;
13082
13083     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13084     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13085         mem_base = xmlMemBlocks();
13086         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13087         options = gen_parseroptions(n_options, 1);
13088
13089         ret_val = xmlCtxtUseOptions(ctxt, options);
13090         desret_int(ret_val);
13091         call_tests++;
13092         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13093         des_parseroptions(n_options, options, 1);
13094         xmlResetLastError();
13095         if (mem_base != xmlMemBlocks()) {
13096             printf("Leak of %d blocks found in xmlCtxtUseOptions",
13097                    xmlMemBlocks() - mem_base);
13098             test_ret++;
13099             printf(" %d", n_ctxt);
13100             printf(" %d", n_options);
13101             printf("\n");
13102         }
13103     }
13104     }
13105     function_tests++;
13106
13107     return(test_ret);
13108 }
13109
13110
13111 static int
13112 test_xmlGetExternalEntityLoader(void) {
13113     int test_ret = 0;
13114
13115
13116     /* missing type support */
13117     return(test_ret);
13118 }
13119
13120
13121 static int
13122 test_xmlGetFeature(void) {
13123     int test_ret = 0;
13124
13125 #if defined(LIBXML_LEGACY_ENABLED)
13126 #ifdef LIBXML_LEGACY_ENABLED
13127     int mem_base;
13128     int ret_val;
13129     xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
13130     int n_ctxt;
13131     char * name; /* the feature name */
13132     int n_name;
13133     void * result; /* location to store the result */
13134     int n_result;
13135
13136     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13137     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
13138     for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
13139         mem_base = xmlMemBlocks();
13140         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13141         name = gen_const_char_ptr(n_name, 1);
13142         result = gen_void_ptr(n_result, 2);
13143
13144         ret_val = xmlGetFeature(ctxt, (const char *)name, result);
13145         desret_int(ret_val);
13146         call_tests++;
13147         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13148         des_const_char_ptr(n_name, (const char *)name, 1);
13149         des_void_ptr(n_result, result, 2);
13150         xmlResetLastError();
13151         if (mem_base != xmlMemBlocks()) {
13152             printf("Leak of %d blocks found in xmlGetFeature",
13153                    xmlMemBlocks() - mem_base);
13154             test_ret++;
13155             printf(" %d", n_ctxt);
13156             printf(" %d", n_name);
13157             printf(" %d", n_result);
13158             printf("\n");
13159         }
13160     }
13161     }
13162     }
13163     function_tests++;
13164 #endif
13165 #endif
13166
13167     return(test_ret);
13168 }
13169
13170
13171 #define gen_nb_const_char_ptr_ptr 1
13172 static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13173     return(NULL);
13174 }
13175 static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13176 }
13177
13178 static int
13179 test_xmlGetFeaturesList(void) {
13180     int test_ret = 0;
13181
13182 #if defined(LIBXML_LEGACY_ENABLED)
13183 #ifdef LIBXML_LEGACY_ENABLED
13184     int mem_base;
13185     int ret_val;
13186     int * len; /* the length of the features name array (input/output) */
13187     int n_len;
13188     char ** result; /* an array of string to be filled with the features name. */
13189     int n_result;
13190
13191     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13192     for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
13193         mem_base = xmlMemBlocks();
13194         len = gen_int_ptr(n_len, 0);
13195         result = gen_const_char_ptr_ptr(n_result, 1);
13196
13197         ret_val = xmlGetFeaturesList(len, (const char **)result);
13198         desret_int(ret_val);
13199         call_tests++;
13200         des_int_ptr(n_len, len, 0);
13201         des_const_char_ptr_ptr(n_result, (const char **)result, 1);
13202         xmlResetLastError();
13203         if (mem_base != xmlMemBlocks()) {
13204             printf("Leak of %d blocks found in xmlGetFeaturesList",
13205                    xmlMemBlocks() - mem_base);
13206             test_ret++;
13207             printf(" %d", n_len);
13208             printf(" %d", n_result);
13209             printf("\n");
13210         }
13211     }
13212     }
13213     function_tests++;
13214 #endif
13215 #endif
13216
13217     return(test_ret);
13218 }
13219
13220
13221 static int
13222 test_xmlHasFeature(void) {
13223     int test_ret = 0;
13224
13225     int mem_base;
13226     int ret_val;
13227     xmlFeature feature; /* the feature to be examined */
13228     int n_feature;
13229
13230     for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
13231         mem_base = xmlMemBlocks();
13232         feature = gen_xmlFeature(n_feature, 0);
13233
13234         ret_val = xmlHasFeature(feature);
13235         desret_int(ret_val);
13236         call_tests++;
13237         des_xmlFeature(n_feature, feature, 0);
13238         xmlResetLastError();
13239         if (mem_base != xmlMemBlocks()) {
13240             printf("Leak of %d blocks found in xmlHasFeature",
13241                    xmlMemBlocks() - mem_base);
13242             test_ret++;
13243             printf(" %d", n_feature);
13244             printf("\n");
13245         }
13246     }
13247     function_tests++;
13248
13249     return(test_ret);
13250 }
13251
13252
13253 static int
13254 test_xmlIOParseDTD(void) {
13255     int test_ret = 0;
13256
13257 #if defined(LIBXML_VALID_ENABLED)
13258 #ifdef LIBXML_VALID_ENABLED
13259     xmlDtdPtr ret_val;
13260     xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13261     int n_sax;
13262     xmlParserInputBufferPtr input; /* an Input Buffer */
13263     int n_input;
13264     xmlCharEncoding enc; /* the charset encoding if known */
13265     int n_enc;
13266
13267     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13268     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13269     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13270         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13271         input = gen_xmlParserInputBufferPtr(n_input, 1);
13272         enc = gen_xmlCharEncoding(n_enc, 2);
13273
13274         ret_val = xmlIOParseDTD(sax, input, enc);
13275         input = NULL;
13276         desret_xmlDtdPtr(ret_val);
13277         call_tests++;
13278         des_xmlSAXHandlerPtr(n_sax, sax, 0);
13279         des_xmlParserInputBufferPtr(n_input, input, 1);
13280         des_xmlCharEncoding(n_enc, enc, 2);
13281         xmlResetLastError();
13282     }
13283     }
13284     }
13285     function_tests++;
13286 #endif
13287 #endif
13288
13289     return(test_ret);
13290 }
13291
13292
13293 static int
13294 test_xmlInitNodeInfoSeq(void) {
13295     int test_ret = 0;
13296
13297     int mem_base;
13298     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13299     int n_seq;
13300
13301     for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13302         mem_base = xmlMemBlocks();
13303         seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13304
13305         xmlInitNodeInfoSeq(seq);
13306         call_tests++;
13307         des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13308         xmlResetLastError();
13309         if (mem_base != xmlMemBlocks()) {
13310             printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13311                    xmlMemBlocks() - mem_base);
13312             test_ret++;
13313             printf(" %d", n_seq);
13314             printf("\n");
13315         }
13316     }
13317     function_tests++;
13318
13319     return(test_ret);
13320 }
13321
13322
13323 static int
13324 test_xmlInitParser(void) {
13325     int test_ret = 0;
13326
13327     int mem_base;
13328
13329         mem_base = xmlMemBlocks();
13330
13331         xmlInitParser();
13332         call_tests++;
13333         xmlResetLastError();
13334         if (mem_base != xmlMemBlocks()) {
13335             printf("Leak of %d blocks found in xmlInitParser",
13336                    xmlMemBlocks() - mem_base);
13337             test_ret++;
13338             printf("\n");
13339         }
13340     function_tests++;
13341
13342     return(test_ret);
13343 }
13344
13345
13346 static int
13347 test_xmlInitParserCtxt(void) {
13348     int test_ret = 0;
13349
13350     int mem_base;
13351     int ret_val;
13352     xmlParserCtxtPtr ctxt; /* an XML parser context */
13353     int n_ctxt;
13354
13355     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13356         mem_base = xmlMemBlocks();
13357         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13358
13359         ret_val = xmlInitParserCtxt(ctxt);
13360         desret_int(ret_val);
13361         call_tests++;
13362         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13363         xmlResetLastError();
13364         if (mem_base != xmlMemBlocks()) {
13365             printf("Leak of %d blocks found in xmlInitParserCtxt",
13366                    xmlMemBlocks() - mem_base);
13367             test_ret++;
13368             printf(" %d", n_ctxt);
13369             printf("\n");
13370         }
13371     }
13372     function_tests++;
13373
13374     return(test_ret);
13375 }
13376
13377
13378 static int
13379 test_xmlKeepBlanksDefault(void) {
13380     int test_ret = 0;
13381
13382     int mem_base;
13383     int ret_val;
13384     int val; /* int 0 or 1 */
13385     int n_val;
13386
13387     for (n_val = 0;n_val < gen_nb_int;n_val++) {
13388         mem_base = xmlMemBlocks();
13389         val = gen_int(n_val, 0);
13390
13391         ret_val = xmlKeepBlanksDefault(val);
13392         desret_int(ret_val);
13393         call_tests++;
13394         des_int(n_val, val, 0);
13395         xmlResetLastError();
13396         if (mem_base != xmlMemBlocks()) {
13397             printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13398                    xmlMemBlocks() - mem_base);
13399             test_ret++;
13400             printf(" %d", n_val);
13401             printf("\n");
13402         }
13403     }
13404     function_tests++;
13405
13406     return(test_ret);
13407 }
13408
13409
13410 static int
13411 test_xmlLineNumbersDefault(void) {
13412     int test_ret = 0;
13413
13414     int mem_base;
13415     int ret_val;
13416     int val; /* int 0 or 1 */
13417     int n_val;
13418
13419     for (n_val = 0;n_val < gen_nb_int;n_val++) {
13420         mem_base = xmlMemBlocks();
13421         val = gen_int(n_val, 0);
13422
13423         ret_val = xmlLineNumbersDefault(val);
13424         desret_int(ret_val);
13425         call_tests++;
13426         des_int(n_val, val, 0);
13427         xmlResetLastError();
13428         if (mem_base != xmlMemBlocks()) {
13429             printf("Leak of %d blocks found in xmlLineNumbersDefault",
13430                    xmlMemBlocks() - mem_base);
13431             test_ret++;
13432             printf(" %d", n_val);
13433             printf("\n");
13434         }
13435     }
13436     function_tests++;
13437
13438     return(test_ret);
13439 }
13440
13441
13442 static int
13443 test_xmlLoadExternalEntity(void) {
13444     int test_ret = 0;
13445
13446     int mem_base;
13447     xmlParserInputPtr ret_val;
13448     const char * URL; /* the URL for the entity to load */
13449     int n_URL;
13450     char * ID; /* the Public ID for the entity to load */
13451     int n_ID;
13452     xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13453     int n_ctxt;
13454
13455     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13456     for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13457     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13458         mem_base = xmlMemBlocks();
13459         URL = gen_filepath(n_URL, 0);
13460         ID = gen_const_char_ptr(n_ID, 1);
13461         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13462
13463         ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13464         desret_xmlParserInputPtr(ret_val);
13465         call_tests++;
13466         des_filepath(n_URL, URL, 0);
13467         des_const_char_ptr(n_ID, (const char *)ID, 1);
13468         des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13469         xmlResetLastError();
13470         if (mem_base != xmlMemBlocks()) {
13471             printf("Leak of %d blocks found in xmlLoadExternalEntity",
13472                    xmlMemBlocks() - mem_base);
13473             test_ret++;
13474             printf(" %d", n_URL);
13475             printf(" %d", n_ID);
13476             printf(" %d", n_ctxt);
13477             printf("\n");
13478         }
13479     }
13480     }
13481     }
13482     function_tests++;
13483
13484     return(test_ret);
13485 }
13486
13487
13488 static int
13489 test_xmlNewIOInputStream(void) {
13490     int test_ret = 0;
13491
13492     int mem_base;
13493     xmlParserInputPtr ret_val;
13494     xmlParserCtxtPtr ctxt; /* an XML parser context */
13495     int n_ctxt;
13496     xmlParserInputBufferPtr input; /* an I/O Input */
13497     int n_input;
13498     xmlCharEncoding enc; /* the charset encoding if known */
13499     int n_enc;
13500
13501     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13502     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13503     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13504         mem_base = xmlMemBlocks();
13505         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13506         input = gen_xmlParserInputBufferPtr(n_input, 1);
13507         enc = gen_xmlCharEncoding(n_enc, 2);
13508
13509         ret_val = xmlNewIOInputStream(ctxt, input, enc);
13510         if (ret_val != NULL) input = NULL;
13511         desret_xmlParserInputPtr(ret_val);
13512         call_tests++;
13513         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13514         des_xmlParserInputBufferPtr(n_input, input, 1);
13515         des_xmlCharEncoding(n_enc, enc, 2);
13516         xmlResetLastError();
13517         if (mem_base != xmlMemBlocks()) {
13518             printf("Leak of %d blocks found in xmlNewIOInputStream",
13519                    xmlMemBlocks() - mem_base);
13520             test_ret++;
13521             printf(" %d", n_ctxt);
13522             printf(" %d", n_input);
13523             printf(" %d", n_enc);
13524             printf("\n");
13525         }
13526     }
13527     }
13528     }
13529     function_tests++;
13530
13531     return(test_ret);
13532 }
13533
13534
13535 static int
13536 test_xmlNewParserCtxt(void) {
13537     int test_ret = 0;
13538
13539     int mem_base;
13540     xmlParserCtxtPtr ret_val;
13541
13542         mem_base = xmlMemBlocks();
13543
13544         ret_val = xmlNewParserCtxt();
13545         desret_xmlParserCtxtPtr(ret_val);
13546         call_tests++;
13547         xmlResetLastError();
13548         if (mem_base != xmlMemBlocks()) {
13549             printf("Leak of %d blocks found in xmlNewParserCtxt",
13550                    xmlMemBlocks() - mem_base);
13551             test_ret++;
13552             printf("\n");
13553         }
13554     function_tests++;
13555
13556     return(test_ret);
13557 }
13558
13559
13560 #define gen_nb_xmlNodePtr_ptr 1
13561 static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13562     return(NULL);
13563 }
13564 static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13565 }
13566
13567 static int
13568 test_xmlParseBalancedChunkMemory(void) {
13569     int test_ret = 0;
13570
13571 #if defined(LIBXML_SAX1_ENABLED)
13572 #ifdef LIBXML_SAX1_ENABLED
13573     int mem_base;
13574     int ret_val;
13575     xmlDocPtr doc; /* the document the chunk pertains to */
13576     int n_doc;
13577     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13578     int n_sax;
13579     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13580     int n_user_data;
13581     int depth; /* Used for loop detection, use 0 */
13582     int n_depth;
13583     xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13584     int n_string;
13585     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13586     int n_lst;
13587
13588     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13589     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13590     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13591     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13592     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13593     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13594         mem_base = xmlMemBlocks();
13595         doc = gen_xmlDocPtr(n_doc, 0);
13596         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13597         user_data = gen_userdata(n_user_data, 2);
13598         depth = gen_int(n_depth, 3);
13599         string = gen_const_xmlChar_ptr(n_string, 4);
13600         lst = gen_xmlNodePtr_ptr(n_lst, 5);
13601         
13602 #ifdef LIBXML_SAX1_ENABLED
13603         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13604 #endif
13605
13606
13607         ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13608         desret_int(ret_val);
13609         call_tests++;
13610         des_xmlDocPtr(n_doc, doc, 0);
13611         des_xmlSAXHandlerPtr(n_sax, sax, 1);
13612         des_userdata(n_user_data, user_data, 2);
13613         des_int(n_depth, depth, 3);
13614         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13615         des_xmlNodePtr_ptr(n_lst, lst, 5);
13616         xmlResetLastError();
13617         if (mem_base != xmlMemBlocks()) {
13618             printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13619                    xmlMemBlocks() - mem_base);
13620             test_ret++;
13621             printf(" %d", n_doc);
13622             printf(" %d", n_sax);
13623             printf(" %d", n_user_data);
13624             printf(" %d", n_depth);
13625             printf(" %d", n_string);
13626             printf(" %d", n_lst);
13627             printf("\n");
13628         }
13629     }
13630     }
13631     }
13632     }
13633     }
13634     }
13635     function_tests++;
13636 #endif
13637 #endif
13638
13639     return(test_ret);
13640 }
13641
13642
13643 static int
13644 test_xmlParseBalancedChunkMemoryRecover(void) {
13645     int test_ret = 0;
13646
13647 #if defined(LIBXML_SAX1_ENABLED)
13648 #ifdef LIBXML_SAX1_ENABLED
13649     int mem_base;
13650     int ret_val;
13651     xmlDocPtr doc; /* the document the chunk pertains to */
13652     int n_doc;
13653     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13654     int n_sax;
13655     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13656     int n_user_data;
13657     int depth; /* Used for loop detection, use 0 */
13658     int n_depth;
13659     xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13660     int n_string;
13661     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13662     int n_lst;
13663     int recover; /* return nodes even if the data is broken (use 0) */
13664     int n_recover;
13665
13666     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13667     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13668     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13669     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13670     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13671     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13672     for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13673         mem_base = xmlMemBlocks();
13674         doc = gen_xmlDocPtr(n_doc, 0);
13675         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13676         user_data = gen_userdata(n_user_data, 2);
13677         depth = gen_int(n_depth, 3);
13678         string = gen_const_xmlChar_ptr(n_string, 4);
13679         lst = gen_xmlNodePtr_ptr(n_lst, 5);
13680         recover = gen_int(n_recover, 6);
13681         
13682 #ifdef LIBXML_SAX1_ENABLED
13683         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13684 #endif
13685
13686
13687         ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13688         desret_int(ret_val);
13689         call_tests++;
13690         des_xmlDocPtr(n_doc, doc, 0);
13691         des_xmlSAXHandlerPtr(n_sax, sax, 1);
13692         des_userdata(n_user_data, user_data, 2);
13693         des_int(n_depth, depth, 3);
13694         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13695         des_xmlNodePtr_ptr(n_lst, lst, 5);
13696         des_int(n_recover, recover, 6);
13697         xmlResetLastError();
13698         if (mem_base != xmlMemBlocks()) {
13699             printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13700                    xmlMemBlocks() - mem_base);
13701             test_ret++;
13702             printf(" %d", n_doc);
13703             printf(" %d", n_sax);
13704             printf(" %d", n_user_data);
13705             printf(" %d", n_depth);
13706             printf(" %d", n_string);
13707             printf(" %d", n_lst);
13708             printf(" %d", n_recover);
13709             printf("\n");
13710         }
13711     }
13712     }
13713     }
13714     }
13715     }
13716     }
13717     }
13718     function_tests++;
13719 #endif
13720 #endif
13721
13722     return(test_ret);
13723 }
13724
13725
13726 static int
13727 test_xmlParseChunk(void) {
13728     int test_ret = 0;
13729
13730 #if defined(LIBXML_PUSH_ENABLED)
13731     int mem_base;
13732     int ret_val;
13733     xmlParserCtxtPtr ctxt; /* an XML parser context */
13734     int n_ctxt;
13735     char * chunk; /* an char array */
13736     int n_chunk;
13737     int size; /* the size in byte of the chunk */
13738     int n_size;
13739     int terminate; /* last chunk indicator */
13740     int n_terminate;
13741
13742     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13743     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13744     for (n_size = 0;n_size < gen_nb_int;n_size++) {
13745     for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13746         mem_base = xmlMemBlocks();
13747         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13748         chunk = gen_const_char_ptr(n_chunk, 1);
13749         size = gen_int(n_size, 2);
13750         terminate = gen_int(n_terminate, 3);
13751         if ((chunk != NULL) &&
13752             (size > (int) strlen((const char *) chunk) + 1))
13753             continue;
13754
13755         ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13756         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13757         desret_int(ret_val);
13758         call_tests++;
13759         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13760         des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13761         des_int(n_size, size, 2);
13762         des_int(n_terminate, terminate, 3);
13763         xmlResetLastError();
13764         if (mem_base != xmlMemBlocks()) {
13765             printf("Leak of %d blocks found in xmlParseChunk",
13766                    xmlMemBlocks() - mem_base);
13767             test_ret++;
13768             printf(" %d", n_ctxt);
13769             printf(" %d", n_chunk);
13770             printf(" %d", n_size);
13771             printf(" %d", n_terminate);
13772             printf("\n");
13773         }
13774     }
13775     }
13776     }
13777     }
13778     function_tests++;
13779 #endif
13780
13781     return(test_ret);
13782 }
13783
13784
13785 static int
13786 test_xmlParseCtxtExternalEntity(void) {
13787     int test_ret = 0;
13788
13789     int mem_base;
13790     int ret_val;
13791     xmlParserCtxtPtr ctx; /* the existing parsing context */
13792     int n_ctx;
13793     xmlChar * URL; /* the URL for the entity to load */
13794     int n_URL;
13795     xmlChar * ID; /* the System ID for the entity to load */
13796     int n_ID;
13797     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13798     int n_lst;
13799
13800     for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13801     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13802     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13803     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13804         mem_base = xmlMemBlocks();
13805         ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13806         URL = gen_const_xmlChar_ptr(n_URL, 1);
13807         ID = gen_const_xmlChar_ptr(n_ID, 2);
13808         lst = gen_xmlNodePtr_ptr(n_lst, 3);
13809
13810         ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13811         desret_int(ret_val);
13812         call_tests++;
13813         des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13814         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13815         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13816         des_xmlNodePtr_ptr(n_lst, lst, 3);
13817         xmlResetLastError();
13818         if (mem_base != xmlMemBlocks()) {
13819             printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13820                    xmlMemBlocks() - mem_base);
13821             test_ret++;
13822             printf(" %d", n_ctx);
13823             printf(" %d", n_URL);
13824             printf(" %d", n_ID);
13825             printf(" %d", n_lst);
13826             printf("\n");
13827         }
13828     }
13829     }
13830     }
13831     }
13832     function_tests++;
13833
13834     return(test_ret);
13835 }
13836
13837
13838 static int
13839 test_xmlParseDTD(void) {
13840     int test_ret = 0;
13841
13842 #if defined(LIBXML_VALID_ENABLED)
13843 #ifdef LIBXML_VALID_ENABLED
13844     int mem_base;
13845     xmlDtdPtr ret_val;
13846     xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13847     int n_ExternalID;
13848     xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13849     int n_SystemID;
13850
13851     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13852     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13853         mem_base = xmlMemBlocks();
13854         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13855         SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13856
13857         ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13858         desret_xmlDtdPtr(ret_val);
13859         call_tests++;
13860         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13861         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13862         xmlResetLastError();
13863         if (mem_base != xmlMemBlocks()) {
13864             printf("Leak of %d blocks found in xmlParseDTD",
13865                    xmlMemBlocks() - mem_base);
13866             test_ret++;
13867             printf(" %d", n_ExternalID);
13868             printf(" %d", n_SystemID);
13869             printf("\n");
13870         }
13871     }
13872     }
13873     function_tests++;
13874 #endif
13875 #endif
13876
13877     return(test_ret);
13878 }
13879
13880
13881 static int
13882 test_xmlParseDoc(void) {
13883     int test_ret = 0;
13884
13885 #if defined(LIBXML_SAX1_ENABLED)
13886 #ifdef LIBXML_SAX1_ENABLED
13887     int mem_base;
13888     xmlDocPtr ret_val;
13889     xmlChar * cur; /* a pointer to an array of xmlChar */
13890     int n_cur;
13891
13892     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13893         mem_base = xmlMemBlocks();
13894         cur = gen_const_xmlChar_ptr(n_cur, 0);
13895
13896         ret_val = xmlParseDoc((const xmlChar *)cur);
13897         desret_xmlDocPtr(ret_val);
13898         call_tests++;
13899         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13900         xmlResetLastError();
13901         if (mem_base != xmlMemBlocks()) {
13902             printf("Leak of %d blocks found in xmlParseDoc",
13903                    xmlMemBlocks() - mem_base);
13904             test_ret++;
13905             printf(" %d", n_cur);
13906             printf("\n");
13907         }
13908     }
13909     function_tests++;
13910 #endif
13911 #endif
13912
13913     return(test_ret);
13914 }
13915
13916
13917 static int
13918 test_xmlParseDocument(void) {
13919     int test_ret = 0;
13920
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();
13928         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13929
13930         ret_val = xmlParseDocument(ctxt);
13931         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13932         desret_int(ret_val);
13933         call_tests++;
13934         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13935         xmlResetLastError();
13936         if (mem_base != xmlMemBlocks()) {
13937             printf("Leak of %d blocks found in xmlParseDocument",
13938                    xmlMemBlocks() - mem_base);
13939             test_ret++;
13940             printf(" %d", n_ctxt);
13941             printf("\n");
13942         }
13943     }
13944     function_tests++;
13945
13946     return(test_ret);
13947 }
13948
13949
13950 static int
13951 test_xmlParseEntity(void) {
13952     int test_ret = 0;
13953
13954 #if defined(LIBXML_SAX1_ENABLED)
13955 #ifdef LIBXML_SAX1_ENABLED
13956     int mem_base;
13957     xmlDocPtr ret_val;
13958     const char * filename; /* the filename */
13959     int n_filename;
13960
13961     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13962         mem_base = xmlMemBlocks();
13963         filename = gen_filepath(n_filename, 0);
13964
13965         ret_val = xmlParseEntity(filename);
13966         desret_xmlDocPtr(ret_val);
13967         call_tests++;
13968         des_filepath(n_filename, filename, 0);
13969         xmlResetLastError();
13970         if (mem_base != xmlMemBlocks()) {
13971             printf("Leak of %d blocks found in xmlParseEntity",
13972                    xmlMemBlocks() - mem_base);
13973             test_ret++;
13974             printf(" %d", n_filename);
13975             printf("\n");
13976         }
13977     }
13978     function_tests++;
13979 #endif
13980 #endif
13981
13982     return(test_ret);
13983 }
13984
13985
13986 static int
13987 test_xmlParseExtParsedEnt(void) {
13988     int test_ret = 0;
13989
13990     int mem_base;
13991     int ret_val;
13992     xmlParserCtxtPtr ctxt; /* an XML parser context */
13993     int n_ctxt;
13994
13995     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13996         mem_base = xmlMemBlocks();
13997         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13998
13999         ret_val = xmlParseExtParsedEnt(ctxt);
14000         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
14001         desret_int(ret_val);
14002         call_tests++;
14003         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14004         xmlResetLastError();
14005         if (mem_base != xmlMemBlocks()) {
14006             printf("Leak of %d blocks found in xmlParseExtParsedEnt",
14007                    xmlMemBlocks() - mem_base);
14008             test_ret++;
14009             printf(" %d", n_ctxt);
14010             printf("\n");
14011         }
14012     }
14013     function_tests++;
14014
14015     return(test_ret);
14016 }
14017
14018
14019 static int
14020 test_xmlParseExternalEntity(void) {
14021     int test_ret = 0;
14022
14023 #if defined(LIBXML_SAX1_ENABLED)
14024 #ifdef LIBXML_SAX1_ENABLED
14025     int mem_base;
14026     int ret_val;
14027     xmlDocPtr doc; /* the document the chunk pertains to */
14028     int n_doc;
14029     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
14030     int n_sax;
14031     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
14032     int n_user_data;
14033     int depth; /* Used for loop detection, use 0 */
14034     int n_depth;
14035     xmlChar * URL; /* the URL for the entity to load */
14036     int n_URL;
14037     xmlChar * ID; /* the System ID for the entity to load */
14038     int n_ID;
14039     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14040     int n_lst;
14041
14042     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
14043     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14044     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
14045     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
14046     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
14047     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
14048     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14049         mem_base = xmlMemBlocks();
14050         doc = gen_xmlDocPtr(n_doc, 0);
14051         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
14052         user_data = gen_userdata(n_user_data, 2);
14053         depth = gen_int(n_depth, 3);
14054         URL = gen_const_xmlChar_ptr(n_URL, 4);
14055         ID = gen_const_xmlChar_ptr(n_ID, 5);
14056         lst = gen_xmlNodePtr_ptr(n_lst, 6);
14057
14058         ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
14059         desret_int(ret_val);
14060         call_tests++;
14061         des_xmlDocPtr(n_doc, doc, 0);
14062         des_xmlSAXHandlerPtr(n_sax, sax, 1);
14063         des_userdata(n_user_data, user_data, 2);
14064         des_int(n_depth, depth, 3);
14065         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
14066         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
14067         des_xmlNodePtr_ptr(n_lst, lst, 6);
14068         xmlResetLastError();
14069         if (mem_base != xmlMemBlocks()) {
14070             printf("Leak of %d blocks found in xmlParseExternalEntity",
14071                    xmlMemBlocks() - mem_base);
14072             test_ret++;
14073             printf(" %d", n_doc);
14074             printf(" %d", n_sax);
14075             printf(" %d", n_user_data);
14076             printf(" %d", n_depth);
14077             printf(" %d", n_URL);
14078             printf(" %d", n_ID);
14079             printf(" %d", n_lst);
14080             printf("\n");
14081         }
14082     }
14083     }
14084     }
14085     }
14086     }
14087     }
14088     }
14089     function_tests++;
14090 #endif
14091 #endif
14092
14093     return(test_ret);
14094 }
14095
14096
14097 static int
14098 test_xmlParseFile(void) {
14099     int test_ret = 0;
14100
14101 #if defined(LIBXML_SAX1_ENABLED)
14102 #ifdef LIBXML_SAX1_ENABLED
14103     int mem_base;
14104     xmlDocPtr ret_val;
14105     const char * filename; /* the filename */
14106     int n_filename;
14107
14108     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14109         mem_base = xmlMemBlocks();
14110         filename = gen_filepath(n_filename, 0);
14111
14112         ret_val = xmlParseFile(filename);
14113         desret_xmlDocPtr(ret_val);
14114         call_tests++;
14115         des_filepath(n_filename, filename, 0);
14116         xmlResetLastError();
14117         if (mem_base != xmlMemBlocks()) {
14118             printf("Leak of %d blocks found in xmlParseFile",
14119                    xmlMemBlocks() - mem_base);
14120             test_ret++;
14121             printf(" %d", n_filename);
14122             printf("\n");
14123         }
14124     }
14125     function_tests++;
14126 #endif
14127 #endif
14128
14129     return(test_ret);
14130 }
14131
14132
14133 static int
14134 test_xmlParseInNodeContext(void) {
14135     int test_ret = 0;
14136
14137     int mem_base;
14138     xmlParserErrors ret_val;
14139     xmlNodePtr node; /* the context node */
14140     int n_node;
14141     char * data; /* the input string */
14142     int n_data;
14143     int datalen; /* the input string length in bytes */
14144     int n_datalen;
14145     int options; /* a combination of xmlParserOption */
14146     int n_options;
14147     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14148     int n_lst;
14149
14150     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
14151     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
14152     for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
14153     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14154     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14155         mem_base = xmlMemBlocks();
14156         node = gen_xmlNodePtr(n_node, 0);
14157         data = gen_const_char_ptr(n_data, 1);
14158         datalen = gen_int(n_datalen, 2);
14159         options = gen_parseroptions(n_options, 3);
14160         lst = gen_xmlNodePtr_ptr(n_lst, 4);
14161
14162         ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
14163         desret_xmlParserErrors(ret_val);
14164         call_tests++;
14165         des_xmlNodePtr(n_node, node, 0);
14166         des_const_char_ptr(n_data, (const char *)data, 1);
14167         des_int(n_datalen, datalen, 2);
14168         des_parseroptions(n_options, options, 3);
14169         des_xmlNodePtr_ptr(n_lst, lst, 4);
14170         xmlResetLastError();
14171         if (mem_base != xmlMemBlocks()) {
14172             printf("Leak of %d blocks found in xmlParseInNodeContext",
14173                    xmlMemBlocks() - mem_base);
14174             test_ret++;
14175             printf(" %d", n_node);
14176             printf(" %d", n_data);
14177             printf(" %d", n_datalen);
14178             printf(" %d", n_options);
14179             printf(" %d", n_lst);
14180             printf("\n");
14181         }
14182     }
14183     }
14184     }
14185     }
14186     }
14187     function_tests++;
14188
14189     return(test_ret);
14190 }
14191
14192
14193 static int
14194 test_xmlParseMemory(void) {
14195     int test_ret = 0;
14196
14197 #if defined(LIBXML_SAX1_ENABLED)
14198 #ifdef LIBXML_SAX1_ENABLED
14199     int mem_base;
14200     xmlDocPtr ret_val;
14201     char * buffer; /* an pointer to a char array */
14202     int n_buffer;
14203     int size; /* the size of the array */
14204     int n_size;
14205
14206     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14207     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14208         mem_base = xmlMemBlocks();
14209         buffer = gen_const_char_ptr(n_buffer, 0);
14210         size = gen_int(n_size, 1);
14211         if ((buffer != NULL) &&
14212             (size > (int) strlen((const char *) buffer) + 1))
14213             continue;
14214
14215         ret_val = xmlParseMemory((const char *)buffer, size);
14216         desret_xmlDocPtr(ret_val);
14217         call_tests++;
14218         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14219         des_int(n_size, size, 1);
14220         xmlResetLastError();
14221         if (mem_base != xmlMemBlocks()) {
14222             printf("Leak of %d blocks found in xmlParseMemory",
14223                    xmlMemBlocks() - mem_base);
14224             test_ret++;
14225             printf(" %d", n_buffer);
14226             printf(" %d", n_size);
14227             printf("\n");
14228         }
14229     }
14230     }
14231     function_tests++;
14232 #endif
14233 #endif
14234
14235     return(test_ret);
14236 }
14237
14238
14239 #define gen_nb_const_xmlParserNodeInfoPtr 1
14240 static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14241     return(NULL);
14242 }
14243 static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14244 }
14245
14246 static int
14247 test_xmlParserAddNodeInfo(void) {
14248     int test_ret = 0;
14249
14250     int mem_base;
14251     xmlParserCtxtPtr ctxt; /* an XML parser context */
14252     int n_ctxt;
14253     xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14254     int n_info;
14255
14256     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14257     for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14258         mem_base = xmlMemBlocks();
14259         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14260         info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14261
14262         xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
14263         call_tests++;
14264         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14265         des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
14266         xmlResetLastError();
14267         if (mem_base != xmlMemBlocks()) {
14268             printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14269                    xmlMemBlocks() - mem_base);
14270             test_ret++;
14271             printf(" %d", n_ctxt);
14272             printf(" %d", n_info);
14273             printf("\n");
14274         }
14275     }
14276     }
14277     function_tests++;
14278
14279     return(test_ret);
14280 }
14281
14282
14283 #define gen_nb_const_xmlParserCtxtPtr 1
14284 static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14285     return(NULL);
14286 }
14287 static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14288 }
14289
14290 #define gen_nb_const_xmlNodePtr 1
14291 static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14292     return(NULL);
14293 }
14294 static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14295 }
14296
14297 static int
14298 test_xmlParserFindNodeInfo(void) {
14299     int test_ret = 0;
14300
14301     int mem_base;
14302     const xmlParserNodeInfo * ret_val;
14303     xmlParserCtxtPtr ctx; /* an XML parser context */
14304     int n_ctx;
14305     xmlNodePtr node; /* an XML node within the tree */
14306     int n_node;
14307
14308     for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14309     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14310         mem_base = xmlMemBlocks();
14311         ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14312         node = gen_const_xmlNodePtr(n_node, 1);
14313
14314         ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14315         desret_const_xmlParserNodeInfo_ptr(ret_val);
14316         call_tests++;
14317         des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14318         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14319         xmlResetLastError();
14320         if (mem_base != xmlMemBlocks()) {
14321             printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14322                    xmlMemBlocks() - mem_base);
14323             test_ret++;
14324             printf(" %d", n_ctx);
14325             printf(" %d", n_node);
14326             printf("\n");
14327         }
14328     }
14329     }
14330     function_tests++;
14331
14332     return(test_ret);
14333 }
14334
14335
14336 #define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14337 static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14338     return(NULL);
14339 }
14340 static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14341 }
14342
14343 static int
14344 test_xmlParserFindNodeInfoIndex(void) {
14345     int test_ret = 0;
14346
14347     int mem_base;
14348     unsigned long ret_val;
14349     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14350     int n_seq;
14351     xmlNodePtr node; /* an XML node pointer */
14352     int n_node;
14353
14354     for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14355     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14356         mem_base = xmlMemBlocks();
14357         seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14358         node = gen_const_xmlNodePtr(n_node, 1);
14359
14360         ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14361         desret_unsigned_long(ret_val);
14362         call_tests++;
14363         des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14364         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14365         xmlResetLastError();
14366         if (mem_base != xmlMemBlocks()) {
14367             printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14368                    xmlMemBlocks() - mem_base);
14369             test_ret++;
14370             printf(" %d", n_seq);
14371             printf(" %d", n_node);
14372             printf("\n");
14373         }
14374     }
14375     }
14376     function_tests++;
14377
14378     return(test_ret);
14379 }
14380
14381
14382 #define gen_nb_xmlParserInputPtr 1
14383 static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14384     return(NULL);
14385 }
14386 static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14387 }
14388
14389 static int
14390 test_xmlParserInputGrow(void) {
14391     int test_ret = 0;
14392
14393     int mem_base;
14394     int ret_val;
14395     xmlParserInputPtr in; /* an XML parser input */
14396     int n_in;
14397     int len; /* an indicative size for the lookahead */
14398     int n_len;
14399
14400     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14401     for (n_len = 0;n_len < gen_nb_int;n_len++) {
14402         mem_base = xmlMemBlocks();
14403         in = gen_xmlParserInputPtr(n_in, 0);
14404         len = gen_int(n_len, 1);
14405
14406         ret_val = xmlParserInputGrow(in, len);
14407         desret_int(ret_val);
14408         call_tests++;
14409         des_xmlParserInputPtr(n_in, in, 0);
14410         des_int(n_len, len, 1);
14411         xmlResetLastError();
14412         if (mem_base != xmlMemBlocks()) {
14413             printf("Leak of %d blocks found in xmlParserInputGrow",
14414                    xmlMemBlocks() - mem_base);
14415             test_ret++;
14416             printf(" %d", n_in);
14417             printf(" %d", n_len);
14418             printf("\n");
14419         }
14420     }
14421     }
14422     function_tests++;
14423
14424     return(test_ret);
14425 }
14426
14427
14428 static int
14429 test_xmlParserInputRead(void) {
14430     int test_ret = 0;
14431
14432     int mem_base;
14433     int ret_val;
14434     xmlParserInputPtr in; /* an XML parser input */
14435     int n_in;
14436     int len; /* an indicative size for the lookahead */
14437     int n_len;
14438
14439     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14440     for (n_len = 0;n_len < gen_nb_int;n_len++) {
14441         mem_base = xmlMemBlocks();
14442         in = gen_xmlParserInputPtr(n_in, 0);
14443         len = gen_int(n_len, 1);
14444
14445         ret_val = xmlParserInputRead(in, len);
14446         desret_int(ret_val);
14447         call_tests++;
14448         des_xmlParserInputPtr(n_in, in, 0);
14449         des_int(n_len, len, 1);
14450         xmlResetLastError();
14451         if (mem_base != xmlMemBlocks()) {
14452             printf("Leak of %d blocks found in xmlParserInputRead",
14453                    xmlMemBlocks() - mem_base);
14454             test_ret++;
14455             printf(" %d", n_in);
14456             printf(" %d", n_len);
14457             printf("\n");
14458         }
14459     }
14460     }
14461     function_tests++;
14462
14463     return(test_ret);
14464 }
14465
14466
14467 static int
14468 test_xmlPedanticParserDefault(void) {
14469     int test_ret = 0;
14470
14471     int mem_base;
14472     int ret_val;
14473     int val; /* int 0 or 1 */
14474     int n_val;
14475
14476     for (n_val = 0;n_val < gen_nb_int;n_val++) {
14477         mem_base = xmlMemBlocks();
14478         val = gen_int(n_val, 0);
14479
14480         ret_val = xmlPedanticParserDefault(val);
14481         desret_int(ret_val);
14482         call_tests++;
14483         des_int(n_val, val, 0);
14484         xmlResetLastError();
14485         if (mem_base != xmlMemBlocks()) {
14486             printf("Leak of %d blocks found in xmlPedanticParserDefault",
14487                    xmlMemBlocks() - mem_base);
14488             test_ret++;
14489             printf(" %d", n_val);
14490             printf("\n");
14491         }
14492     }
14493     function_tests++;
14494
14495     return(test_ret);
14496 }
14497
14498
14499 static int
14500 test_xmlReadDoc(void) {
14501     int test_ret = 0;
14502
14503     int mem_base;
14504     xmlDocPtr ret_val;
14505     xmlChar * cur; /* a pointer to a zero terminated string */
14506     int n_cur;
14507     const char * URL; /* the base URL to use for the document */
14508     int n_URL;
14509     char * encoding; /* the document encoding, or NULL */
14510     int n_encoding;
14511     int options; /* a combination of xmlParserOption */
14512     int n_options;
14513
14514     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14515     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14516     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14517     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14518         mem_base = xmlMemBlocks();
14519         cur = gen_const_xmlChar_ptr(n_cur, 0);
14520         URL = gen_filepath(n_URL, 1);
14521         encoding = gen_const_char_ptr(n_encoding, 2);
14522         options = gen_parseroptions(n_options, 3);
14523
14524         ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14525         desret_xmlDocPtr(ret_val);
14526         call_tests++;
14527         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14528         des_filepath(n_URL, URL, 1);
14529         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14530         des_parseroptions(n_options, options, 3);
14531         xmlResetLastError();
14532         if (mem_base != xmlMemBlocks()) {
14533             printf("Leak of %d blocks found in xmlReadDoc",
14534                    xmlMemBlocks() - mem_base);
14535             test_ret++;
14536             printf(" %d", n_cur);
14537             printf(" %d", n_URL);
14538             printf(" %d", n_encoding);
14539             printf(" %d", n_options);
14540             printf("\n");
14541         }
14542     }
14543     }
14544     }
14545     }
14546     function_tests++;
14547
14548     return(test_ret);
14549 }
14550
14551
14552 static int
14553 test_xmlReadFile(void) {
14554     int test_ret = 0;
14555
14556     int mem_base;
14557     xmlDocPtr ret_val;
14558     const char * filename; /* a file or URL */
14559     int n_filename;
14560     char * encoding; /* the document encoding, or NULL */
14561     int n_encoding;
14562     int options; /* a combination of xmlParserOption */
14563     int n_options;
14564
14565     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14566     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14567     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14568         mem_base = xmlMemBlocks();
14569         filename = gen_filepath(n_filename, 0);
14570         encoding = gen_const_char_ptr(n_encoding, 1);
14571         options = gen_parseroptions(n_options, 2);
14572
14573         ret_val = xmlReadFile(filename, (const char *)encoding, options);
14574         desret_xmlDocPtr(ret_val);
14575         call_tests++;
14576         des_filepath(n_filename, filename, 0);
14577         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14578         des_parseroptions(n_options, options, 2);
14579         xmlResetLastError();
14580         if (mem_base != xmlMemBlocks()) {
14581             printf("Leak of %d blocks found in xmlReadFile",
14582                    xmlMemBlocks() - mem_base);
14583             test_ret++;
14584             printf(" %d", n_filename);
14585             printf(" %d", n_encoding);
14586             printf(" %d", n_options);
14587             printf("\n");
14588         }
14589     }
14590     }
14591     }
14592     function_tests++;
14593
14594     return(test_ret);
14595 }
14596
14597
14598 static int
14599 test_xmlReadMemory(void) {
14600     int test_ret = 0;
14601
14602     int mem_base;
14603     xmlDocPtr ret_val;
14604     char * buffer; /* a pointer to a char array */
14605     int n_buffer;
14606     int size; /* the size of the array */
14607     int n_size;
14608     const char * URL; /* the base URL to use for the document */
14609     int n_URL;
14610     char * encoding; /* the document encoding, or NULL */
14611     int n_encoding;
14612     int options; /* a combination of xmlParserOption */
14613     int n_options;
14614
14615     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14616     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14617     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14618     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14619     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14620         mem_base = xmlMemBlocks();
14621         buffer = gen_const_char_ptr(n_buffer, 0);
14622         size = gen_int(n_size, 1);
14623         URL = gen_filepath(n_URL, 2);
14624         encoding = gen_const_char_ptr(n_encoding, 3);
14625         options = gen_parseroptions(n_options, 4);
14626         if ((buffer != NULL) &&
14627             (size > (int) strlen((const char *) buffer) + 1))
14628             continue;
14629
14630         ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14631         desret_xmlDocPtr(ret_val);
14632         call_tests++;
14633         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14634         des_int(n_size, size, 1);
14635         des_filepath(n_URL, URL, 2);
14636         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14637         des_parseroptions(n_options, options, 4);
14638         xmlResetLastError();
14639         if (mem_base != xmlMemBlocks()) {
14640             printf("Leak of %d blocks found in xmlReadMemory",
14641                    xmlMemBlocks() - mem_base);
14642             test_ret++;
14643             printf(" %d", n_buffer);
14644             printf(" %d", n_size);
14645             printf(" %d", n_URL);
14646             printf(" %d", n_encoding);
14647             printf(" %d", n_options);
14648             printf("\n");
14649         }
14650     }
14651     }
14652     }
14653     }
14654     }
14655     function_tests++;
14656
14657     return(test_ret);
14658 }
14659
14660
14661 static int
14662 test_xmlRecoverDoc(void) {
14663     int test_ret = 0;
14664
14665 #if defined(LIBXML_SAX1_ENABLED)
14666 #ifdef LIBXML_SAX1_ENABLED
14667     int mem_base;
14668     xmlDocPtr ret_val;
14669     xmlChar * cur; /* a pointer to an array of xmlChar */
14670     int n_cur;
14671
14672     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14673         mem_base = xmlMemBlocks();
14674         cur = gen_const_xmlChar_ptr(n_cur, 0);
14675
14676         ret_val = xmlRecoverDoc((const xmlChar *)cur);
14677         desret_xmlDocPtr(ret_val);
14678         call_tests++;
14679         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14680         xmlResetLastError();
14681         if (mem_base != xmlMemBlocks()) {
14682             printf("Leak of %d blocks found in xmlRecoverDoc",
14683                    xmlMemBlocks() - mem_base);
14684             test_ret++;
14685             printf(" %d", n_cur);
14686             printf("\n");
14687         }
14688     }
14689     function_tests++;
14690 #endif
14691 #endif
14692
14693     return(test_ret);
14694 }
14695
14696
14697 static int
14698 test_xmlRecoverFile(void) {
14699     int test_ret = 0;
14700
14701 #if defined(LIBXML_SAX1_ENABLED)
14702 #ifdef LIBXML_SAX1_ENABLED
14703     int mem_base;
14704     xmlDocPtr ret_val;
14705     const char * filename; /* the filename */
14706     int n_filename;
14707
14708     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14709         mem_base = xmlMemBlocks();
14710         filename = gen_filepath(n_filename, 0);
14711
14712         ret_val = xmlRecoverFile(filename);
14713         desret_xmlDocPtr(ret_val);
14714         call_tests++;
14715         des_filepath(n_filename, filename, 0);
14716         xmlResetLastError();
14717         if (mem_base != xmlMemBlocks()) {
14718             printf("Leak of %d blocks found in xmlRecoverFile",
14719                    xmlMemBlocks() - mem_base);
14720             test_ret++;
14721             printf(" %d", n_filename);
14722             printf("\n");
14723         }
14724     }
14725     function_tests++;
14726 #endif
14727 #endif
14728
14729     return(test_ret);
14730 }
14731
14732
14733 static int
14734 test_xmlRecoverMemory(void) {
14735     int test_ret = 0;
14736
14737 #if defined(LIBXML_SAX1_ENABLED)
14738 #ifdef LIBXML_SAX1_ENABLED
14739     int mem_base;
14740     xmlDocPtr ret_val;
14741     char * buffer; /* an pointer to a char array */
14742     int n_buffer;
14743     int size; /* the size of the array */
14744     int n_size;
14745
14746     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14747     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14748         mem_base = xmlMemBlocks();
14749         buffer = gen_const_char_ptr(n_buffer, 0);
14750         size = gen_int(n_size, 1);
14751         if ((buffer != NULL) &&
14752             (size > (int) strlen((const char *) buffer) + 1))
14753             continue;
14754
14755         ret_val = xmlRecoverMemory((const char *)buffer, size);
14756         desret_xmlDocPtr(ret_val);
14757         call_tests++;
14758         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14759         des_int(n_size, size, 1);
14760         xmlResetLastError();
14761         if (mem_base != xmlMemBlocks()) {
14762             printf("Leak of %d blocks found in xmlRecoverMemory",
14763                    xmlMemBlocks() - mem_base);
14764             test_ret++;
14765             printf(" %d", n_buffer);
14766             printf(" %d", n_size);
14767             printf("\n");
14768         }
14769     }
14770     }
14771     function_tests++;
14772 #endif
14773 #endif
14774
14775     return(test_ret);
14776 }
14777
14778
14779 static int
14780 test_xmlSAXParseDTD(void) {
14781     int test_ret = 0;
14782
14783 #if defined(LIBXML_VALID_ENABLED)
14784 #ifdef LIBXML_SAX1_ENABLED
14785     int mem_base;
14786     xmlDtdPtr ret_val;
14787     xmlSAXHandlerPtr sax; /* the SAX handler block */
14788     int n_sax;
14789     xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14790     int n_ExternalID;
14791     xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14792     int n_SystemID;
14793
14794     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14795     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14796     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14797         mem_base = xmlMemBlocks();
14798         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14799         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14800         SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14801
14802         ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14803         desret_xmlDtdPtr(ret_val);
14804         call_tests++;
14805         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14806         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14807         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14808         xmlResetLastError();
14809         if (mem_base != xmlMemBlocks()) {
14810             printf("Leak of %d blocks found in xmlSAXParseDTD",
14811                    xmlMemBlocks() - mem_base);
14812             test_ret++;
14813             printf(" %d", n_sax);
14814             printf(" %d", n_ExternalID);
14815             printf(" %d", n_SystemID);
14816             printf("\n");
14817         }
14818     }
14819     }
14820     }
14821     function_tests++;
14822 #endif
14823 #endif
14824
14825     return(test_ret);
14826 }
14827
14828
14829 static int
14830 test_xmlSAXParseDoc(void) {
14831     int test_ret = 0;
14832
14833 #if defined(LIBXML_SAX1_ENABLED)
14834 #ifdef LIBXML_SAX1_ENABLED
14835     int mem_base;
14836     xmlDocPtr ret_val;
14837     xmlSAXHandlerPtr sax; /* the SAX handler block */
14838     int n_sax;
14839     xmlChar * cur; /* a pointer to an array of xmlChar */
14840     int n_cur;
14841     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14842     int n_recovery;
14843
14844     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14845     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14846     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14847         mem_base = xmlMemBlocks();
14848         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14849         cur = gen_const_xmlChar_ptr(n_cur, 1);
14850         recovery = gen_int(n_recovery, 2);
14851
14852         ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
14853         desret_xmlDocPtr(ret_val);
14854         call_tests++;
14855         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14856         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
14857         des_int(n_recovery, recovery, 2);
14858         xmlResetLastError();
14859         if (mem_base != xmlMemBlocks()) {
14860             printf("Leak of %d blocks found in xmlSAXParseDoc",
14861                    xmlMemBlocks() - mem_base);
14862             test_ret++;
14863             printf(" %d", n_sax);
14864             printf(" %d", n_cur);
14865             printf(" %d", n_recovery);
14866             printf("\n");
14867         }
14868     }
14869     }
14870     }
14871     function_tests++;
14872 #endif
14873 #endif
14874
14875     return(test_ret);
14876 }
14877
14878
14879 static int
14880 test_xmlSAXParseEntity(void) {
14881     int test_ret = 0;
14882
14883 #if defined(LIBXML_SAX1_ENABLED)
14884 #ifdef LIBXML_SAX1_ENABLED
14885     int mem_base;
14886     xmlDocPtr ret_val;
14887     xmlSAXHandlerPtr sax; /* the SAX handler block */
14888     int n_sax;
14889     const char * filename; /* the filename */
14890     int n_filename;
14891
14892     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14893     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14894         mem_base = xmlMemBlocks();
14895         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14896         filename = gen_filepath(n_filename, 1);
14897
14898         ret_val = xmlSAXParseEntity(sax, filename);
14899         desret_xmlDocPtr(ret_val);
14900         call_tests++;
14901         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14902         des_filepath(n_filename, filename, 1);
14903         xmlResetLastError();
14904         if (mem_base != xmlMemBlocks()) {
14905             printf("Leak of %d blocks found in xmlSAXParseEntity",
14906                    xmlMemBlocks() - mem_base);
14907             test_ret++;
14908             printf(" %d", n_sax);
14909             printf(" %d", n_filename);
14910             printf("\n");
14911         }
14912     }
14913     }
14914     function_tests++;
14915 #endif
14916 #endif
14917
14918     return(test_ret);
14919 }
14920
14921
14922 static int
14923 test_xmlSAXParseFile(void) {
14924     int test_ret = 0;
14925
14926 #if defined(LIBXML_SAX1_ENABLED)
14927 #ifdef LIBXML_SAX1_ENABLED
14928     int mem_base;
14929     xmlDocPtr ret_val;
14930     xmlSAXHandlerPtr sax; /* the SAX handler block */
14931     int n_sax;
14932     const char * filename; /* the filename */
14933     int n_filename;
14934     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14935     int n_recovery;
14936
14937     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14938     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14939     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14940         mem_base = xmlMemBlocks();
14941         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14942         filename = gen_filepath(n_filename, 1);
14943         recovery = gen_int(n_recovery, 2);
14944
14945         ret_val = xmlSAXParseFile(sax, filename, recovery);
14946         desret_xmlDocPtr(ret_val);
14947         call_tests++;
14948         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14949         des_filepath(n_filename, filename, 1);
14950         des_int(n_recovery, recovery, 2);
14951         xmlResetLastError();
14952         if (mem_base != xmlMemBlocks()) {
14953             printf("Leak of %d blocks found in xmlSAXParseFile",
14954                    xmlMemBlocks() - mem_base);
14955             test_ret++;
14956             printf(" %d", n_sax);
14957             printf(" %d", n_filename);
14958             printf(" %d", n_recovery);
14959             printf("\n");
14960         }
14961     }
14962     }
14963     }
14964     function_tests++;
14965 #endif
14966 #endif
14967
14968     return(test_ret);
14969 }
14970
14971
14972 static int
14973 test_xmlSAXParseFileWithData(void) {
14974     int test_ret = 0;
14975
14976 #if defined(LIBXML_SAX1_ENABLED)
14977 #ifdef LIBXML_SAX1_ENABLED
14978     int mem_base;
14979     xmlDocPtr ret_val;
14980     xmlSAXHandlerPtr sax; /* the SAX handler block */
14981     int n_sax;
14982     const char * filename; /* the filename */
14983     int n_filename;
14984     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14985     int n_recovery;
14986     void * data; /* the userdata */
14987     int n_data;
14988
14989     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14990     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14991     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14992     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14993         mem_base = xmlMemBlocks();
14994         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14995         filename = gen_filepath(n_filename, 1);
14996         recovery = gen_int(n_recovery, 2);
14997         data = gen_userdata(n_data, 3);
14998
14999         ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
15000         desret_xmlDocPtr(ret_val);
15001         call_tests++;
15002         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15003         des_filepath(n_filename, filename, 1);
15004         des_int(n_recovery, recovery, 2);
15005         des_userdata(n_data, data, 3);
15006         xmlResetLastError();
15007         if (mem_base != xmlMemBlocks()) {
15008             printf("Leak of %d blocks found in xmlSAXParseFileWithData",
15009                    xmlMemBlocks() - mem_base);
15010             test_ret++;
15011             printf(" %d", n_sax);
15012             printf(" %d", n_filename);
15013             printf(" %d", n_recovery);
15014             printf(" %d", n_data);
15015             printf("\n");
15016         }
15017     }
15018     }
15019     }
15020     }
15021     function_tests++;
15022 #endif
15023 #endif
15024
15025     return(test_ret);
15026 }
15027
15028
15029 static int
15030 test_xmlSAXParseMemory(void) {
15031     int test_ret = 0;
15032
15033 #if defined(LIBXML_SAX1_ENABLED)
15034 #ifdef LIBXML_SAX1_ENABLED
15035     int mem_base;
15036     xmlDocPtr ret_val;
15037     xmlSAXHandlerPtr sax; /* the SAX handler block */
15038     int n_sax;
15039     char * buffer; /* an pointer to a char array */
15040     int n_buffer;
15041     int size; /* the size of the array */
15042     int n_size;
15043     int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
15044     int n_recovery;
15045
15046     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15047     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15048     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15049     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15050         mem_base = xmlMemBlocks();
15051         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15052         buffer = gen_const_char_ptr(n_buffer, 1);
15053         size = gen_int(n_size, 2);
15054         recovery = gen_int(n_recovery, 3);
15055         if ((buffer != NULL) &&
15056             (size > (int) strlen((const char *) buffer) + 1))
15057             continue;
15058
15059         ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
15060         desret_xmlDocPtr(ret_val);
15061         call_tests++;
15062         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15063         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15064         des_int(n_size, size, 2);
15065         des_int(n_recovery, recovery, 3);
15066         xmlResetLastError();
15067         if (mem_base != xmlMemBlocks()) {
15068             printf("Leak of %d blocks found in xmlSAXParseMemory",
15069                    xmlMemBlocks() - mem_base);
15070             test_ret++;
15071             printf(" %d", n_sax);
15072             printf(" %d", n_buffer);
15073             printf(" %d", n_size);
15074             printf(" %d", n_recovery);
15075             printf("\n");
15076         }
15077     }
15078     }
15079     }
15080     }
15081     function_tests++;
15082 #endif
15083 #endif
15084
15085     return(test_ret);
15086 }
15087
15088
15089 static int
15090 test_xmlSAXParseMemoryWithData(void) {
15091     int test_ret = 0;
15092
15093 #if defined(LIBXML_SAX1_ENABLED)
15094 #ifdef LIBXML_SAX1_ENABLED
15095     int mem_base;
15096     xmlDocPtr ret_val;
15097     xmlSAXHandlerPtr sax; /* the SAX handler block */
15098     int n_sax;
15099     char * buffer; /* an pointer to a char array */
15100     int n_buffer;
15101     int size; /* the size of the array */
15102     int n_size;
15103     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15104     int n_recovery;
15105     void * data; /* the userdata */
15106     int n_data;
15107
15108     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15109     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15110     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15111     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15112     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
15113         mem_base = xmlMemBlocks();
15114         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15115         buffer = gen_const_char_ptr(n_buffer, 1);
15116         size = gen_int(n_size, 2);
15117         recovery = gen_int(n_recovery, 3);
15118         data = gen_userdata(n_data, 4);
15119         if ((buffer != NULL) &&
15120             (size > (int) strlen((const char *) buffer) + 1))
15121             continue;
15122
15123         ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
15124         desret_xmlDocPtr(ret_val);
15125         call_tests++;
15126         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15127         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15128         des_int(n_size, size, 2);
15129         des_int(n_recovery, recovery, 3);
15130         des_userdata(n_data, data, 4);
15131         xmlResetLastError();
15132         if (mem_base != xmlMemBlocks()) {
15133             printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
15134                    xmlMemBlocks() - mem_base);
15135             test_ret++;
15136             printf(" %d", n_sax);
15137             printf(" %d", n_buffer);
15138             printf(" %d", n_size);
15139             printf(" %d", n_recovery);
15140             printf(" %d", n_data);
15141             printf("\n");
15142         }
15143     }
15144     }
15145     }
15146     }
15147     }
15148     function_tests++;
15149 #endif
15150 #endif
15151
15152     return(test_ret);
15153 }
15154
15155
15156 static int
15157 test_xmlSAXUserParseFile(void) {
15158     int test_ret = 0;
15159
15160 #if defined(LIBXML_SAX1_ENABLED)
15161 #ifdef LIBXML_SAX1_ENABLED
15162     int mem_base;
15163     int ret_val;
15164     xmlSAXHandlerPtr sax; /* a SAX handler */
15165     int n_sax;
15166     void * user_data; /* The user data returned on SAX callbacks */
15167     int n_user_data;
15168     const char * filename; /* a file name */
15169     int n_filename;
15170
15171     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15172     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15173     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15174         mem_base = xmlMemBlocks();
15175         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15176         user_data = gen_userdata(n_user_data, 1);
15177         filename = gen_filepath(n_filename, 2);
15178         
15179 #ifdef LIBXML_SAX1_ENABLED
15180         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15181 #endif
15182
15183
15184         ret_val = xmlSAXUserParseFile(sax, user_data, filename);
15185         desret_int(ret_val);
15186         call_tests++;
15187         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15188         des_userdata(n_user_data, user_data, 1);
15189         des_filepath(n_filename, filename, 2);
15190         xmlResetLastError();
15191         if (mem_base != xmlMemBlocks()) {
15192             printf("Leak of %d blocks found in xmlSAXUserParseFile",
15193                    xmlMemBlocks() - mem_base);
15194             test_ret++;
15195             printf(" %d", n_sax);
15196             printf(" %d", n_user_data);
15197             printf(" %d", n_filename);
15198             printf("\n");
15199         }
15200     }
15201     }
15202     }
15203     function_tests++;
15204 #endif
15205 #endif
15206
15207     return(test_ret);
15208 }
15209
15210
15211 static int
15212 test_xmlSAXUserParseMemory(void) {
15213     int test_ret = 0;
15214
15215 #if defined(LIBXML_SAX1_ENABLED)
15216 #ifdef LIBXML_SAX1_ENABLED
15217     int mem_base;
15218     int ret_val;
15219     xmlSAXHandlerPtr sax; /* a SAX handler */
15220     int n_sax;
15221     void * user_data; /* The user data returned on SAX callbacks */
15222     int n_user_data;
15223     char * buffer; /* an in-memory XML document input */
15224     int n_buffer;
15225     int size; /* the length of the XML document in bytes */
15226     int n_size;
15227
15228     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15229     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15230     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15231     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15232         mem_base = xmlMemBlocks();
15233         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15234         user_data = gen_userdata(n_user_data, 1);
15235         buffer = gen_const_char_ptr(n_buffer, 2);
15236         size = gen_int(n_size, 3);
15237         if ((buffer != NULL) &&
15238             (size > (int) strlen((const char *) buffer) + 1))
15239             continue;
15240         
15241 #ifdef LIBXML_SAX1_ENABLED
15242         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15243 #endif
15244
15245
15246         ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
15247         desret_int(ret_val);
15248         call_tests++;
15249         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15250         des_userdata(n_user_data, user_data, 1);
15251         des_const_char_ptr(n_buffer, (const char *)buffer, 2);
15252         des_int(n_size, size, 3);
15253         xmlResetLastError();
15254         if (mem_base != xmlMemBlocks()) {
15255             printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15256                    xmlMemBlocks() - mem_base);
15257             test_ret++;
15258             printf(" %d", n_sax);
15259             printf(" %d", n_user_data);
15260             printf(" %d", n_buffer);
15261             printf(" %d", n_size);
15262             printf("\n");
15263         }
15264     }
15265     }
15266     }
15267     }
15268     function_tests++;
15269 #endif
15270 #endif
15271
15272     return(test_ret);
15273 }
15274
15275
15276 static int
15277 test_xmlSetExternalEntityLoader(void) {
15278     int test_ret = 0;
15279
15280
15281     /* missing type support */
15282     return(test_ret);
15283 }
15284
15285
15286 static int
15287 test_xmlSetFeature(void) {
15288     int test_ret = 0;
15289
15290 #if defined(LIBXML_LEGACY_ENABLED)
15291 #ifdef LIBXML_LEGACY_ENABLED
15292     int mem_base;
15293     int ret_val;
15294     xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15295     int n_ctxt;
15296     char * name; /* the feature name */
15297     int n_name;
15298     void * value; /* pointer to the location of the new value */
15299     int n_value;
15300
15301     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15302     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15303     for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15304         mem_base = xmlMemBlocks();
15305         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15306         name = gen_const_char_ptr(n_name, 1);
15307         value = gen_void_ptr(n_value, 2);
15308
15309         ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15310         desret_int(ret_val);
15311         call_tests++;
15312         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15313         des_const_char_ptr(n_name, (const char *)name, 1);
15314         des_void_ptr(n_value, value, 2);
15315         xmlResetLastError();
15316         if (mem_base != xmlMemBlocks()) {
15317             printf("Leak of %d blocks found in xmlSetFeature",
15318                    xmlMemBlocks() - mem_base);
15319             test_ret++;
15320             printf(" %d", n_ctxt);
15321             printf(" %d", n_name);
15322             printf(" %d", n_value);
15323             printf("\n");
15324         }
15325     }
15326     }
15327     }
15328     function_tests++;
15329 #endif
15330 #endif
15331
15332     return(test_ret);
15333 }
15334
15335
15336 static int
15337 test_xmlSetupParserForBuffer(void) {
15338     int test_ret = 0;
15339
15340 #if defined(LIBXML_SAX1_ENABLED)
15341 #ifdef LIBXML_SAX1_ENABLED
15342     int mem_base;
15343     xmlParserCtxtPtr ctxt; /* an XML parser context */
15344     int n_ctxt;
15345     xmlChar * buffer; /* a xmlChar * buffer */
15346     int n_buffer;
15347     const char * filename; /* a file name */
15348     int n_filename;
15349
15350     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15351     for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15352     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15353         mem_base = xmlMemBlocks();
15354         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15355         buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15356         filename = gen_filepath(n_filename, 2);
15357
15358         xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15359         call_tests++;
15360         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15361         des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15362         des_filepath(n_filename, filename, 2);
15363         xmlResetLastError();
15364         if (mem_base != xmlMemBlocks()) {
15365             printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15366                    xmlMemBlocks() - mem_base);
15367             test_ret++;
15368             printf(" %d", n_ctxt);
15369             printf(" %d", n_buffer);
15370             printf(" %d", n_filename);
15371             printf("\n");
15372         }
15373     }
15374     }
15375     }
15376     function_tests++;
15377 #endif
15378 #endif
15379
15380     return(test_ret);
15381 }
15382
15383
15384 static int
15385 test_xmlStopParser(void) {
15386     int test_ret = 0;
15387
15388 #ifdef LIBXML_PUSH_ENABLED
15389     int mem_base;
15390     xmlParserCtxtPtr ctxt; /* an XML parser context */
15391     int n_ctxt;
15392
15393     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15394         mem_base = xmlMemBlocks();
15395         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15396
15397         xmlStopParser(ctxt);
15398         call_tests++;
15399         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15400         xmlResetLastError();
15401         if (mem_base != xmlMemBlocks()) {
15402             printf("Leak of %d blocks found in xmlStopParser",
15403                    xmlMemBlocks() - mem_base);
15404             test_ret++;
15405             printf(" %d", n_ctxt);
15406             printf("\n");
15407         }
15408     }
15409     function_tests++;
15410 #endif
15411
15412     return(test_ret);
15413 }
15414
15415
15416 static int
15417 test_xmlSubstituteEntitiesDefault(void) {
15418     int test_ret = 0;
15419
15420     int mem_base;
15421     int ret_val;
15422     int val; /* int 0 or 1 */
15423     int n_val;
15424
15425     for (n_val = 0;n_val < gen_nb_int;n_val++) {
15426         mem_base = xmlMemBlocks();
15427         val = gen_int(n_val, 0);
15428
15429         ret_val = xmlSubstituteEntitiesDefault(val);
15430         desret_int(ret_val);
15431         call_tests++;
15432         des_int(n_val, val, 0);
15433         xmlResetLastError();
15434         if (mem_base != xmlMemBlocks()) {
15435             printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15436                    xmlMemBlocks() - mem_base);
15437             test_ret++;
15438             printf(" %d", n_val);
15439             printf("\n");
15440         }
15441     }
15442     function_tests++;
15443
15444     return(test_ret);
15445 }
15446
15447 static int
15448 test_parser(void) {
15449     int test_ret = 0;
15450
15451     if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n");
15452     test_ret += test_xmlByteConsumed();
15453     test_ret += test_xmlClearNodeInfoSeq();
15454     test_ret += test_xmlClearParserCtxt();
15455     test_ret += test_xmlCreateDocParserCtxt();
15456     test_ret += test_xmlCreatePushParserCtxt();
15457     test_ret += test_xmlCtxtReadDoc();
15458     test_ret += test_xmlCtxtReadFile();
15459     test_ret += test_xmlCtxtReadMemory();
15460     test_ret += test_xmlCtxtReset();
15461     test_ret += test_xmlCtxtResetPush();
15462     test_ret += test_xmlCtxtUseOptions();
15463     test_ret += test_xmlGetExternalEntityLoader();
15464     test_ret += test_xmlGetFeature();
15465     test_ret += test_xmlGetFeaturesList();
15466     test_ret += test_xmlHasFeature();
15467     test_ret += test_xmlIOParseDTD();
15468     test_ret += test_xmlInitNodeInfoSeq();
15469     test_ret += test_xmlInitParser();
15470     test_ret += test_xmlInitParserCtxt();
15471     test_ret += test_xmlKeepBlanksDefault();
15472     test_ret += test_xmlLineNumbersDefault();
15473     test_ret += test_xmlLoadExternalEntity();
15474     test_ret += test_xmlNewIOInputStream();
15475     test_ret += test_xmlNewParserCtxt();
15476     test_ret += test_xmlParseBalancedChunkMemory();
15477     test_ret += test_xmlParseBalancedChunkMemoryRecover();
15478     test_ret += test_xmlParseChunk();
15479     test_ret += test_xmlParseCtxtExternalEntity();
15480     test_ret += test_xmlParseDTD();
15481     test_ret += test_xmlParseDoc();
15482     test_ret += test_xmlParseDocument();
15483     test_ret += test_xmlParseEntity();
15484     test_ret += test_xmlParseExtParsedEnt();
15485     test_ret += test_xmlParseExternalEntity();
15486     test_ret += test_xmlParseFile();
15487     test_ret += test_xmlParseInNodeContext();
15488     test_ret += test_xmlParseMemory();
15489     test_ret += test_xmlParserAddNodeInfo();
15490     test_ret += test_xmlParserFindNodeInfo();
15491     test_ret += test_xmlParserFindNodeInfoIndex();
15492     test_ret += test_xmlParserInputGrow();
15493     test_ret += test_xmlParserInputRead();
15494     test_ret += test_xmlPedanticParserDefault();
15495     test_ret += test_xmlReadDoc();
15496     test_ret += test_xmlReadFile();
15497     test_ret += test_xmlReadMemory();
15498     test_ret += test_xmlRecoverDoc();
15499     test_ret += test_xmlRecoverFile();
15500     test_ret += test_xmlRecoverMemory();
15501     test_ret += test_xmlSAXParseDTD();
15502     test_ret += test_xmlSAXParseDoc();
15503     test_ret += test_xmlSAXParseEntity();
15504     test_ret += test_xmlSAXParseFile();
15505     test_ret += test_xmlSAXParseFileWithData();
15506     test_ret += test_xmlSAXParseMemory();
15507     test_ret += test_xmlSAXParseMemoryWithData();
15508     test_ret += test_xmlSAXUserParseFile();
15509     test_ret += test_xmlSAXUserParseMemory();
15510     test_ret += test_xmlSetExternalEntityLoader();
15511     test_ret += test_xmlSetFeature();
15512     test_ret += test_xmlSetupParserForBuffer();
15513     test_ret += test_xmlStopParser();
15514     test_ret += test_xmlSubstituteEntitiesDefault();
15515
15516     if (test_ret != 0)
15517         printf("Module parser: %d errors\n", test_ret);
15518     return(test_ret);
15519 }
15520
15521 static int
15522 test_htmlCreateFileParserCtxt(void) {
15523     int test_ret = 0;
15524
15525 #if defined(LIBXML_HTML_ENABLED)
15526     int mem_base;
15527     htmlParserCtxtPtr ret_val;
15528     const char * filename; /* the filename */
15529     int n_filename;
15530     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15531     int n_encoding;
15532
15533     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15534     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15535         mem_base = xmlMemBlocks();
15536         filename = gen_fileoutput(n_filename, 0);
15537         encoding = gen_const_char_ptr(n_encoding, 1);
15538
15539         ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15540         desret_htmlParserCtxtPtr(ret_val);
15541         call_tests++;
15542         des_fileoutput(n_filename, filename, 0);
15543         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15544         xmlResetLastError();
15545         if (mem_base != xmlMemBlocks()) {
15546             printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15547                    xmlMemBlocks() - mem_base);
15548             test_ret++;
15549             printf(" %d", n_filename);
15550             printf(" %d", n_encoding);
15551             printf("\n");
15552         }
15553     }
15554     }
15555     function_tests++;
15556 #endif
15557
15558     return(test_ret);
15559 }
15560
15561
15562 static int
15563 test_htmlInitAutoClose(void) {
15564     int test_ret = 0;
15565
15566 #if defined(LIBXML_HTML_ENABLED)
15567     int mem_base;
15568
15569         mem_base = xmlMemBlocks();
15570
15571         htmlInitAutoClose();
15572         call_tests++;
15573         xmlResetLastError();
15574         if (mem_base != xmlMemBlocks()) {
15575             printf("Leak of %d blocks found in htmlInitAutoClose",
15576                    xmlMemBlocks() - mem_base);
15577             test_ret++;
15578             printf("\n");
15579         }
15580     function_tests++;
15581 #endif
15582
15583     return(test_ret);
15584 }
15585
15586
15587 static int
15588 test_inputPop(void) {
15589     int test_ret = 0;
15590
15591     int mem_base;
15592     xmlParserInputPtr ret_val;
15593     xmlParserCtxtPtr ctxt; /* an XML parser context */
15594     int n_ctxt;
15595
15596     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15597         mem_base = xmlMemBlocks();
15598         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15599
15600         ret_val = inputPop(ctxt);
15601         desret_xmlParserInputPtr(ret_val);
15602         call_tests++;
15603         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15604         xmlResetLastError();
15605         if (mem_base != xmlMemBlocks()) {
15606             printf("Leak of %d blocks found in inputPop",
15607                    xmlMemBlocks() - mem_base);
15608             test_ret++;
15609             printf(" %d", n_ctxt);
15610             printf("\n");
15611         }
15612     }
15613     function_tests++;
15614
15615     return(test_ret);
15616 }
15617
15618
15619 static int
15620 test_inputPush(void) {
15621     int test_ret = 0;
15622
15623     int mem_base;
15624     int ret_val;
15625     xmlParserCtxtPtr ctxt; /* an XML parser context */
15626     int n_ctxt;
15627     xmlParserInputPtr value; /* the parser input */
15628     int n_value;
15629
15630     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15631     for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15632         mem_base = xmlMemBlocks();
15633         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15634         value = gen_xmlParserInputPtr(n_value, 1);
15635
15636         ret_val = inputPush(ctxt, value);
15637         desret_int(ret_val);
15638         call_tests++;
15639         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15640         des_xmlParserInputPtr(n_value, value, 1);
15641         xmlResetLastError();
15642         if (mem_base != xmlMemBlocks()) {
15643             printf("Leak of %d blocks found in inputPush",
15644                    xmlMemBlocks() - mem_base);
15645             test_ret++;
15646             printf(" %d", n_ctxt);
15647             printf(" %d", n_value);
15648             printf("\n");
15649         }
15650     }
15651     }
15652     function_tests++;
15653
15654     return(test_ret);
15655 }
15656
15657
15658 static int
15659 test_namePop(void) {
15660     int test_ret = 0;
15661
15662     int mem_base;
15663     const xmlChar * ret_val;
15664     xmlParserCtxtPtr ctxt; /* an XML parser context */
15665     int n_ctxt;
15666
15667     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15668         mem_base = xmlMemBlocks();
15669         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15670
15671         ret_val = namePop(ctxt);
15672         desret_const_xmlChar_ptr(ret_val);
15673         call_tests++;
15674         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15675         xmlResetLastError();
15676         if (mem_base != xmlMemBlocks()) {
15677             printf("Leak of %d blocks found in namePop",
15678                    xmlMemBlocks() - mem_base);
15679             test_ret++;
15680             printf(" %d", n_ctxt);
15681             printf("\n");
15682         }
15683     }
15684     function_tests++;
15685
15686     return(test_ret);
15687 }
15688
15689
15690 static int
15691 test_namePush(void) {
15692     int test_ret = 0;
15693
15694     int mem_base;
15695     int ret_val;
15696     xmlParserCtxtPtr ctxt; /* an XML parser context */
15697     int n_ctxt;
15698     xmlChar * value; /* the element name */
15699     int n_value;
15700
15701     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15702     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15703         mem_base = xmlMemBlocks();
15704         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15705         value = gen_const_xmlChar_ptr(n_value, 1);
15706
15707         ret_val = namePush(ctxt, (const xmlChar *)value);
15708         desret_int(ret_val);
15709         call_tests++;
15710         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15711         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15712         xmlResetLastError();
15713         if (mem_base != xmlMemBlocks()) {
15714             printf("Leak of %d blocks found in namePush",
15715                    xmlMemBlocks() - mem_base);
15716             test_ret++;
15717             printf(" %d", n_ctxt);
15718             printf(" %d", n_value);
15719             printf("\n");
15720         }
15721     }
15722     }
15723     function_tests++;
15724
15725     return(test_ret);
15726 }
15727
15728
15729 static int
15730 test_nodePop(void) {
15731     int test_ret = 0;
15732
15733     int mem_base;
15734     xmlNodePtr ret_val;
15735     xmlParserCtxtPtr ctxt; /* an XML parser context */
15736     int n_ctxt;
15737
15738     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15739         mem_base = xmlMemBlocks();
15740         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15741
15742         ret_val = nodePop(ctxt);
15743         desret_xmlNodePtr(ret_val);
15744         call_tests++;
15745         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15746         xmlResetLastError();
15747         if (mem_base != xmlMemBlocks()) {
15748             printf("Leak of %d blocks found in nodePop",
15749                    xmlMemBlocks() - mem_base);
15750             test_ret++;
15751             printf(" %d", n_ctxt);
15752             printf("\n");
15753         }
15754     }
15755     function_tests++;
15756
15757     return(test_ret);
15758 }
15759
15760
15761 static int
15762 test_nodePush(void) {
15763     int test_ret = 0;
15764
15765     int mem_base;
15766     int ret_val;
15767     xmlParserCtxtPtr ctxt; /* an XML parser context */
15768     int n_ctxt;
15769     xmlNodePtr value; /* the element node */
15770     int n_value;
15771
15772     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15773     for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15774         mem_base = xmlMemBlocks();
15775         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15776         value = gen_xmlNodePtr(n_value, 1);
15777
15778         ret_val = nodePush(ctxt, value);
15779         desret_int(ret_val);
15780         call_tests++;
15781         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15782         des_xmlNodePtr(n_value, value, 1);
15783         xmlResetLastError();
15784         if (mem_base != xmlMemBlocks()) {
15785             printf("Leak of %d blocks found in nodePush",
15786                    xmlMemBlocks() - mem_base);
15787             test_ret++;
15788             printf(" %d", n_ctxt);
15789             printf(" %d", n_value);
15790             printf("\n");
15791         }
15792     }
15793     }
15794     function_tests++;
15795
15796     return(test_ret);
15797 }
15798
15799
15800 static int
15801 test_xmlCheckLanguageID(void) {
15802     int test_ret = 0;
15803
15804     int mem_base;
15805     int ret_val;
15806     xmlChar * lang; /* pointer to the string value */
15807     int n_lang;
15808
15809     for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15810         mem_base = xmlMemBlocks();
15811         lang = gen_const_xmlChar_ptr(n_lang, 0);
15812
15813         ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15814         desret_int(ret_val);
15815         call_tests++;
15816         des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15817         xmlResetLastError();
15818         if (mem_base != xmlMemBlocks()) {
15819             printf("Leak of %d blocks found in xmlCheckLanguageID",
15820                    xmlMemBlocks() - mem_base);
15821             test_ret++;
15822             printf(" %d", n_lang);
15823             printf("\n");
15824         }
15825     }
15826     function_tests++;
15827
15828     return(test_ret);
15829 }
15830
15831
15832 static int
15833 test_xmlCopyChar(void) {
15834     int test_ret = 0;
15835
15836     int mem_base;
15837     int ret_val;
15838     int len; /* Ignored, compatibility */
15839     int n_len;
15840     xmlChar * out; /* pointer to an array of xmlChar */
15841     int n_out;
15842     int val; /* the char value */
15843     int n_val;
15844
15845     for (n_len = 0;n_len < gen_nb_int;n_len++) {
15846     for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15847     for (n_val = 0;n_val < gen_nb_int;n_val++) {
15848         mem_base = xmlMemBlocks();
15849         len = gen_int(n_len, 0);
15850         out = gen_xmlChar_ptr(n_out, 1);
15851         val = gen_int(n_val, 2);
15852
15853         ret_val = xmlCopyChar(len, out, val);
15854         desret_int(ret_val);
15855         call_tests++;
15856         des_int(n_len, len, 0);
15857         des_xmlChar_ptr(n_out, out, 1);
15858         des_int(n_val, val, 2);
15859         xmlResetLastError();
15860         if (mem_base != xmlMemBlocks()) {
15861             printf("Leak of %d blocks found in xmlCopyChar",
15862                    xmlMemBlocks() - mem_base);
15863             test_ret++;
15864             printf(" %d", n_len);
15865             printf(" %d", n_out);
15866             printf(" %d", n_val);
15867             printf("\n");
15868         }
15869     }
15870     }
15871     }
15872     function_tests++;
15873
15874     return(test_ret);
15875 }
15876
15877
15878 static int
15879 test_xmlCopyCharMultiByte(void) {
15880     int test_ret = 0;
15881
15882     int mem_base;
15883     int ret_val;
15884     xmlChar * out; /* pointer to an array of xmlChar */
15885     int n_out;
15886     int val; /* the char value */
15887     int n_val;
15888
15889     for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15890     for (n_val = 0;n_val < gen_nb_int;n_val++) {
15891         mem_base = xmlMemBlocks();
15892         out = gen_xmlChar_ptr(n_out, 0);
15893         val = gen_int(n_val, 1);
15894
15895         ret_val = xmlCopyCharMultiByte(out, val);
15896         desret_int(ret_val);
15897         call_tests++;
15898         des_xmlChar_ptr(n_out, out, 0);
15899         des_int(n_val, val, 1);
15900         xmlResetLastError();
15901         if (mem_base != xmlMemBlocks()) {
15902             printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15903                    xmlMemBlocks() - mem_base);
15904             test_ret++;
15905             printf(" %d", n_out);
15906             printf(" %d", n_val);
15907             printf("\n");
15908         }
15909     }
15910     }
15911     function_tests++;
15912
15913     return(test_ret);
15914 }
15915
15916
15917 static int
15918 test_xmlCreateEntityParserCtxt(void) {
15919     int test_ret = 0;
15920
15921     int mem_base;
15922     xmlParserCtxtPtr ret_val;
15923     xmlChar * URL; /* the entity URL */
15924     int n_URL;
15925     xmlChar * ID; /* the entity PUBLIC ID */
15926     int n_ID;
15927     xmlChar * base; /* a possible base for the target URI */
15928     int n_base;
15929
15930     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15931     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15932     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15933         mem_base = xmlMemBlocks();
15934         URL = gen_const_xmlChar_ptr(n_URL, 0);
15935         ID = gen_const_xmlChar_ptr(n_ID, 1);
15936         base = gen_const_xmlChar_ptr(n_base, 2);
15937
15938         ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15939         desret_xmlParserCtxtPtr(ret_val);
15940         call_tests++;
15941         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15942         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15943         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15944         xmlResetLastError();
15945         if (mem_base != xmlMemBlocks()) {
15946             printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15947                    xmlMemBlocks() - mem_base);
15948             test_ret++;
15949             printf(" %d", n_URL);
15950             printf(" %d", n_ID);
15951             printf(" %d", n_base);
15952             printf("\n");
15953         }
15954     }
15955     }
15956     }
15957     function_tests++;
15958
15959     return(test_ret);
15960 }
15961
15962
15963 static int
15964 test_xmlCreateFileParserCtxt(void) {
15965     int test_ret = 0;
15966
15967     int mem_base;
15968     xmlParserCtxtPtr ret_val;
15969     const char * filename; /* the filename */
15970     int n_filename;
15971
15972     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15973         mem_base = xmlMemBlocks();
15974         filename = gen_fileoutput(n_filename, 0);
15975
15976         ret_val = xmlCreateFileParserCtxt(filename);
15977         desret_xmlParserCtxtPtr(ret_val);
15978         call_tests++;
15979         des_fileoutput(n_filename, filename, 0);
15980         xmlResetLastError();
15981         if (mem_base != xmlMemBlocks()) {
15982             printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15983                    xmlMemBlocks() - mem_base);
15984             test_ret++;
15985             printf(" %d", n_filename);
15986             printf("\n");
15987         }
15988     }
15989     function_tests++;
15990
15991     return(test_ret);
15992 }
15993
15994
15995 static int
15996 test_xmlCreateMemoryParserCtxt(void) {
15997     int test_ret = 0;
15998
15999     int mem_base;
16000     xmlParserCtxtPtr ret_val;
16001     char * buffer; /* a pointer to a char array */
16002     int n_buffer;
16003     int size; /* the size of the array */
16004     int n_size;
16005
16006     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
16007     for (n_size = 0;n_size < gen_nb_int;n_size++) {
16008         mem_base = xmlMemBlocks();
16009         buffer = gen_const_char_ptr(n_buffer, 0);
16010         size = gen_int(n_size, 1);
16011         if ((buffer != NULL) &&
16012             (size > (int) strlen((const char *) buffer) + 1))
16013             continue;
16014
16015         ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
16016         desret_xmlParserCtxtPtr(ret_val);
16017         call_tests++;
16018         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
16019         des_int(n_size, size, 1);
16020         xmlResetLastError();
16021         if (mem_base != xmlMemBlocks()) {
16022             printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
16023                    xmlMemBlocks() - mem_base);
16024             test_ret++;
16025             printf(" %d", n_buffer);
16026             printf(" %d", n_size);
16027             printf("\n");
16028         }
16029     }
16030     }
16031     function_tests++;
16032
16033     return(test_ret);
16034 }
16035
16036
16037 static int
16038 test_xmlCreateURLParserCtxt(void) {
16039     int test_ret = 0;
16040
16041     int mem_base;
16042     xmlParserCtxtPtr ret_val;
16043     const char * filename; /* the filename or URL */
16044     int n_filename;
16045     int options; /* a combination of xmlParserOption */
16046     int n_options;
16047
16048     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
16049     for (n_options = 0;n_options < gen_nb_int;n_options++) {
16050         mem_base = xmlMemBlocks();
16051         filename = gen_fileoutput(n_filename, 0);
16052         options = gen_int(n_options, 1);
16053
16054         ret_val = xmlCreateURLParserCtxt(filename, options);
16055         desret_xmlParserCtxtPtr(ret_val);
16056         call_tests++;
16057         des_fileoutput(n_filename, filename, 0);
16058         des_int(n_options, options, 1);
16059         xmlResetLastError();
16060         if (mem_base != xmlMemBlocks()) {
16061             printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
16062                    xmlMemBlocks() - mem_base);
16063             test_ret++;
16064             printf(" %d", n_filename);
16065             printf(" %d", n_options);
16066             printf("\n");
16067         }
16068     }
16069     }
16070     function_tests++;
16071
16072     return(test_ret);
16073 }
16074
16075
16076 static int
16077 test_xmlCurrentChar(void) {
16078     int test_ret = 0;
16079
16080     int mem_base;
16081     int ret_val;
16082     xmlParserCtxtPtr ctxt; /* the XML parser context */
16083     int n_ctxt;
16084     int * len; /* pointer to the length of the char read */
16085     int n_len;
16086
16087     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16088     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16089         mem_base = xmlMemBlocks();
16090         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16091         len = gen_int_ptr(n_len, 1);
16092
16093         ret_val = xmlCurrentChar(ctxt, len);
16094         desret_int(ret_val);
16095         call_tests++;
16096         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16097         des_int_ptr(n_len, len, 1);
16098         xmlResetLastError();
16099         if (mem_base != xmlMemBlocks()) {
16100             printf("Leak of %d blocks found in xmlCurrentChar",
16101                    xmlMemBlocks() - mem_base);
16102             test_ret++;
16103             printf(" %d", n_ctxt);
16104             printf(" %d", n_len);
16105             printf("\n");
16106         }
16107     }
16108     }
16109     function_tests++;
16110
16111     return(test_ret);
16112 }
16113
16114
16115 static int
16116 test_xmlErrMemory(void) {
16117     int test_ret = 0;
16118
16119     int mem_base;
16120     xmlParserCtxtPtr ctxt; /* an XML parser context */
16121     int n_ctxt;
16122     char * extra; /* extra informations */
16123     int n_extra;
16124
16125     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16126     for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
16127         mem_base = xmlMemBlocks();
16128         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16129         extra = gen_const_char_ptr(n_extra, 1);
16130
16131         xmlErrMemory(ctxt, (const char *)extra);
16132         call_tests++;
16133         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16134         des_const_char_ptr(n_extra, (const char *)extra, 1);
16135         xmlResetLastError();
16136         if (mem_base != xmlMemBlocks()) {
16137             printf("Leak of %d blocks found in xmlErrMemory",
16138                    xmlMemBlocks() - mem_base);
16139             test_ret++;
16140             printf(" %d", n_ctxt);
16141             printf(" %d", n_extra);
16142             printf("\n");
16143         }
16144     }
16145     }
16146     function_tests++;
16147
16148     return(test_ret);
16149 }
16150
16151
16152 static int
16153 test_xmlIsLetter(void) {
16154     int test_ret = 0;
16155
16156     int mem_base;
16157     int ret_val;
16158     int c; /* an unicode character (int) */
16159     int n_c;
16160
16161     for (n_c = 0;n_c < gen_nb_int;n_c++) {
16162         mem_base = xmlMemBlocks();
16163         c = gen_int(n_c, 0);
16164
16165         ret_val = xmlIsLetter(c);
16166         desret_int(ret_val);
16167         call_tests++;
16168         des_int(n_c, c, 0);
16169         xmlResetLastError();
16170         if (mem_base != xmlMemBlocks()) {
16171             printf("Leak of %d blocks found in xmlIsLetter",
16172                    xmlMemBlocks() - mem_base);
16173             test_ret++;
16174             printf(" %d", n_c);
16175             printf("\n");
16176         }
16177     }
16178     function_tests++;
16179
16180     return(test_ret);
16181 }
16182
16183
16184 static int
16185 test_xmlNewEntityInputStream(void) {
16186     int test_ret = 0;
16187
16188     int mem_base;
16189     xmlParserInputPtr ret_val;
16190     xmlParserCtxtPtr ctxt; /* an XML parser context */
16191     int n_ctxt;
16192     xmlEntityPtr entity; /* an Entity pointer */
16193     int n_entity;
16194
16195     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16196     for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
16197         mem_base = xmlMemBlocks();
16198         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16199         entity = gen_xmlEntityPtr(n_entity, 1);
16200
16201         ret_val = xmlNewEntityInputStream(ctxt, entity);
16202         desret_xmlParserInputPtr(ret_val);
16203         call_tests++;
16204         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16205         des_xmlEntityPtr(n_entity, entity, 1);
16206         xmlResetLastError();
16207         if (mem_base != xmlMemBlocks()) {
16208             printf("Leak of %d blocks found in xmlNewEntityInputStream",
16209                    xmlMemBlocks() - mem_base);
16210             test_ret++;
16211             printf(" %d", n_ctxt);
16212             printf(" %d", n_entity);
16213             printf("\n");
16214         }
16215     }
16216     }
16217     function_tests++;
16218
16219     return(test_ret);
16220 }
16221
16222
16223 static int
16224 test_xmlNewInputFromFile(void) {
16225     int test_ret = 0;
16226
16227     int mem_base;
16228     xmlParserInputPtr ret_val;
16229     xmlParserCtxtPtr ctxt; /* an XML parser context */
16230     int n_ctxt;
16231     const char * filename; /* the filename to use as entity */
16232     int n_filename;
16233
16234     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16235     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16236         mem_base = xmlMemBlocks();
16237         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16238         filename = gen_filepath(n_filename, 1);
16239
16240         ret_val = xmlNewInputFromFile(ctxt, filename);
16241         desret_xmlParserInputPtr(ret_val);
16242         call_tests++;
16243         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16244         des_filepath(n_filename, filename, 1);
16245         xmlResetLastError();
16246         if (mem_base != xmlMemBlocks()) {
16247             printf("Leak of %d blocks found in xmlNewInputFromFile",
16248                    xmlMemBlocks() - mem_base);
16249             test_ret++;
16250             printf(" %d", n_ctxt);
16251             printf(" %d", n_filename);
16252             printf("\n");
16253         }
16254     }
16255     }
16256     function_tests++;
16257
16258     return(test_ret);
16259 }
16260
16261
16262 static int
16263 test_xmlNewInputStream(void) {
16264     int test_ret = 0;
16265
16266     int mem_base;
16267     xmlParserInputPtr ret_val;
16268     xmlParserCtxtPtr ctxt; /* an XML parser context */
16269     int n_ctxt;
16270
16271     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16272         mem_base = xmlMemBlocks();
16273         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16274
16275         ret_val = xmlNewInputStream(ctxt);
16276         desret_xmlParserInputPtr(ret_val);
16277         call_tests++;
16278         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16279         xmlResetLastError();
16280         if (mem_base != xmlMemBlocks()) {
16281             printf("Leak of %d blocks found in xmlNewInputStream",
16282                    xmlMemBlocks() - mem_base);
16283             test_ret++;
16284             printf(" %d", n_ctxt);
16285             printf("\n");
16286         }
16287     }
16288     function_tests++;
16289
16290     return(test_ret);
16291 }
16292
16293
16294 static int
16295 test_xmlNewStringInputStream(void) {
16296     int test_ret = 0;
16297
16298     int mem_base;
16299     xmlParserInputPtr ret_val;
16300     xmlParserCtxtPtr ctxt; /* an XML parser context */
16301     int n_ctxt;
16302     xmlChar * buffer; /* an memory buffer */
16303     int n_buffer;
16304
16305     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16306     for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16307         mem_base = xmlMemBlocks();
16308         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16309         buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16310
16311         ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16312         desret_xmlParserInputPtr(ret_val);
16313         call_tests++;
16314         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16315         des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16316         xmlResetLastError();
16317         if (mem_base != xmlMemBlocks()) {
16318             printf("Leak of %d blocks found in xmlNewStringInputStream",
16319                    xmlMemBlocks() - mem_base);
16320             test_ret++;
16321             printf(" %d", n_ctxt);
16322             printf(" %d", n_buffer);
16323             printf("\n");
16324         }
16325     }
16326     }
16327     function_tests++;
16328
16329     return(test_ret);
16330 }
16331
16332
16333 static int
16334 test_xmlNextChar(void) {
16335     int test_ret = 0;
16336
16337     int mem_base;
16338     xmlParserCtxtPtr ctxt; /* the XML parser context */
16339     int n_ctxt;
16340
16341     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16342         mem_base = xmlMemBlocks();
16343         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16344
16345         xmlNextChar(ctxt);
16346         call_tests++;
16347         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16348         xmlResetLastError();
16349         if (mem_base != xmlMemBlocks()) {
16350             printf("Leak of %d blocks found in xmlNextChar",
16351                    xmlMemBlocks() - mem_base);
16352             test_ret++;
16353             printf(" %d", n_ctxt);
16354             printf("\n");
16355         }
16356     }
16357     function_tests++;
16358
16359     return(test_ret);
16360 }
16361
16362
16363 static int
16364 test_xmlParserInputShrink(void) {
16365     int test_ret = 0;
16366
16367     int mem_base;
16368     xmlParserInputPtr in; /* an XML parser input */
16369     int n_in;
16370
16371     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16372         mem_base = xmlMemBlocks();
16373         in = gen_xmlParserInputPtr(n_in, 0);
16374
16375         xmlParserInputShrink(in);
16376         call_tests++;
16377         des_xmlParserInputPtr(n_in, in, 0);
16378         xmlResetLastError();
16379         if (mem_base != xmlMemBlocks()) {
16380             printf("Leak of %d blocks found in xmlParserInputShrink",
16381                    xmlMemBlocks() - mem_base);
16382             test_ret++;
16383             printf(" %d", n_in);
16384             printf("\n");
16385         }
16386     }
16387     function_tests++;
16388
16389     return(test_ret);
16390 }
16391
16392
16393 static int
16394 test_xmlPopInput(void) {
16395     int test_ret = 0;
16396
16397     int mem_base;
16398     xmlChar ret_val;
16399     xmlParserCtxtPtr ctxt; /* an XML parser context */
16400     int n_ctxt;
16401
16402     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16403         mem_base = xmlMemBlocks();
16404         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16405
16406         ret_val = xmlPopInput(ctxt);
16407         desret_xmlChar(ret_val);
16408         call_tests++;
16409         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16410         xmlResetLastError();
16411         if (mem_base != xmlMemBlocks()) {
16412             printf("Leak of %d blocks found in xmlPopInput",
16413                    xmlMemBlocks() - mem_base);
16414             test_ret++;
16415             printf(" %d", n_ctxt);
16416             printf("\n");
16417         }
16418     }
16419     function_tests++;
16420
16421     return(test_ret);
16422 }
16423
16424
16425 static int
16426 test_xmlPushInput(void) {
16427     int test_ret = 0;
16428
16429     int mem_base;
16430     int ret_val;
16431     xmlParserCtxtPtr ctxt; /* an XML parser context */
16432     int n_ctxt;
16433     xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16434     int n_input;
16435
16436     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16437     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16438         mem_base = xmlMemBlocks();
16439         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16440         input = gen_xmlParserInputPtr(n_input, 1);
16441
16442         ret_val = xmlPushInput(ctxt, input);
16443         desret_int(ret_val);
16444         call_tests++;
16445         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16446         des_xmlParserInputPtr(n_input, input, 1);
16447         xmlResetLastError();
16448         if (mem_base != xmlMemBlocks()) {
16449             printf("Leak of %d blocks found in xmlPushInput",
16450                    xmlMemBlocks() - mem_base);
16451             test_ret++;
16452             printf(" %d", n_ctxt);
16453             printf(" %d", n_input);
16454             printf("\n");
16455         }
16456     }
16457     }
16458     function_tests++;
16459
16460     return(test_ret);
16461 }
16462
16463
16464 static int
16465 test_xmlSetEntityReferenceFunc(void) {
16466     int test_ret = 0;
16467
16468
16469     /* missing type support */
16470     return(test_ret);
16471 }
16472
16473
16474 static int
16475 test_xmlSplitQName(void) {
16476     int test_ret = 0;
16477
16478     int mem_base;
16479     xmlChar * ret_val;
16480     xmlParserCtxtPtr ctxt; /* an XML parser context */
16481     int n_ctxt;
16482     xmlChar * name; /* an XML parser context */
16483     int n_name;
16484     xmlChar ** prefix; /* a xmlChar ** */
16485     int n_prefix;
16486
16487     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16488     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16489     for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16490         mem_base = xmlMemBlocks();
16491         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16492         name = gen_const_xmlChar_ptr(n_name, 1);
16493         prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16494
16495         ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16496         desret_xmlChar_ptr(ret_val);
16497         call_tests++;
16498         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16499         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16500         des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16501         xmlResetLastError();
16502         if (mem_base != xmlMemBlocks()) {
16503             printf("Leak of %d blocks found in xmlSplitQName",
16504                    xmlMemBlocks() - mem_base);
16505             test_ret++;
16506             printf(" %d", n_ctxt);
16507             printf(" %d", n_name);
16508             printf(" %d", n_prefix);
16509             printf("\n");
16510         }
16511     }
16512     }
16513     }
16514     function_tests++;
16515
16516     return(test_ret);
16517 }
16518
16519
16520 static int
16521 test_xmlStringCurrentChar(void) {
16522     int test_ret = 0;
16523
16524     int mem_base;
16525     int ret_val;
16526     xmlParserCtxtPtr ctxt; /* the XML parser context */
16527     int n_ctxt;
16528     xmlChar * cur; /* pointer to the beginning of the char */
16529     int n_cur;
16530     int * len; /* pointer to the length of the char read */
16531     int n_len;
16532
16533     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16534     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16535     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16536         mem_base = xmlMemBlocks();
16537         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16538         cur = gen_const_xmlChar_ptr(n_cur, 1);
16539         len = gen_int_ptr(n_len, 2);
16540
16541         ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16542         desret_int(ret_val);
16543         call_tests++;
16544         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16545         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16546         des_int_ptr(n_len, len, 2);
16547         xmlResetLastError();
16548         if (mem_base != xmlMemBlocks()) {
16549             printf("Leak of %d blocks found in xmlStringCurrentChar",
16550                    xmlMemBlocks() - mem_base);
16551             test_ret++;
16552             printf(" %d", n_ctxt);
16553             printf(" %d", n_cur);
16554             printf(" %d", n_len);
16555             printf("\n");
16556         }
16557     }
16558     }
16559     }
16560     function_tests++;
16561
16562     return(test_ret);
16563 }
16564
16565
16566 static int
16567 test_xmlStringDecodeEntities(void) {
16568     int test_ret = 0;
16569
16570     int mem_base;
16571     xmlChar * ret_val;
16572     xmlParserCtxtPtr ctxt; /* the parser context */
16573     int n_ctxt;
16574     xmlChar * str; /* the input string */
16575     int n_str;
16576     int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16577     int n_what;
16578     xmlChar end; /* an end marker xmlChar, 0 if none */
16579     int n_end;
16580     xmlChar end2; /* an end marker xmlChar, 0 if none */
16581     int n_end2;
16582     xmlChar end3; /* an end marker xmlChar, 0 if none */
16583     int n_end3;
16584
16585     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16586     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16587     for (n_what = 0;n_what < gen_nb_int;n_what++) {
16588     for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16589     for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16590     for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16591         mem_base = xmlMemBlocks();
16592         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16593         str = gen_const_xmlChar_ptr(n_str, 1);
16594         what = gen_int(n_what, 2);
16595         end = gen_xmlChar(n_end, 3);
16596         end2 = gen_xmlChar(n_end2, 4);
16597         end3 = gen_xmlChar(n_end3, 5);
16598
16599         ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16600         desret_xmlChar_ptr(ret_val);
16601         call_tests++;
16602         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16603         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16604         des_int(n_what, what, 2);
16605         des_xmlChar(n_end, end, 3);
16606         des_xmlChar(n_end2, end2, 4);
16607         des_xmlChar(n_end3, end3, 5);
16608         xmlResetLastError();
16609         if (mem_base != xmlMemBlocks()) {
16610             printf("Leak of %d blocks found in xmlStringDecodeEntities",
16611                    xmlMemBlocks() - mem_base);
16612             test_ret++;
16613             printf(" %d", n_ctxt);
16614             printf(" %d", n_str);
16615             printf(" %d", n_what);
16616             printf(" %d", n_end);
16617             printf(" %d", n_end2);
16618             printf(" %d", n_end3);
16619             printf("\n");
16620         }
16621     }
16622     }
16623     }
16624     }
16625     }
16626     }
16627     function_tests++;
16628
16629     return(test_ret);
16630 }
16631
16632
16633 static int
16634 test_xmlStringLenDecodeEntities(void) {
16635     int test_ret = 0;
16636
16637     int mem_base;
16638     xmlChar * ret_val;
16639     xmlParserCtxtPtr ctxt; /* the parser context */
16640     int n_ctxt;
16641     xmlChar * str; /* the input string */
16642     int n_str;
16643     int len; /* the string length */
16644     int n_len;
16645     int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16646     int n_what;
16647     xmlChar end; /* an end marker xmlChar, 0 if none */
16648     int n_end;
16649     xmlChar end2; /* an end marker xmlChar, 0 if none */
16650     int n_end2;
16651     xmlChar end3; /* an end marker xmlChar, 0 if none */
16652     int n_end3;
16653
16654     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16655     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16656     for (n_len = 0;n_len < gen_nb_int;n_len++) {
16657     for (n_what = 0;n_what < gen_nb_int;n_what++) {
16658     for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16659     for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16660     for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16661         mem_base = xmlMemBlocks();
16662         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16663         str = gen_const_xmlChar_ptr(n_str, 1);
16664         len = gen_int(n_len, 2);
16665         what = gen_int(n_what, 3);
16666         end = gen_xmlChar(n_end, 4);
16667         end2 = gen_xmlChar(n_end2, 5);
16668         end3 = gen_xmlChar(n_end3, 6);
16669         if ((str != NULL) &&
16670             (len > (int) strlen((const char *) str) + 1))
16671             continue;
16672
16673         ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16674         desret_xmlChar_ptr(ret_val);
16675         call_tests++;
16676         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16677         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16678         des_int(n_len, len, 2);
16679         des_int(n_what, what, 3);
16680         des_xmlChar(n_end, end, 4);
16681         des_xmlChar(n_end2, end2, 5);
16682         des_xmlChar(n_end3, end3, 6);
16683         xmlResetLastError();
16684         if (mem_base != xmlMemBlocks()) {
16685             printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16686                    xmlMemBlocks() - mem_base);
16687             test_ret++;
16688             printf(" %d", n_ctxt);
16689             printf(" %d", n_str);
16690             printf(" %d", n_len);
16691             printf(" %d", n_what);
16692             printf(" %d", n_end);
16693             printf(" %d", n_end2);
16694             printf(" %d", n_end3);
16695             printf("\n");
16696         }
16697     }
16698     }
16699     }
16700     }
16701     }
16702     }
16703     }
16704     function_tests++;
16705
16706     return(test_ret);
16707 }
16708
16709
16710 static int
16711 test_xmlSwitchEncoding(void) {
16712     int test_ret = 0;
16713
16714     int mem_base;
16715     int ret_val;
16716     xmlParserCtxtPtr ctxt; /* the parser context */
16717     int n_ctxt;
16718     xmlCharEncoding enc; /* the encoding value (number) */
16719     int n_enc;
16720
16721     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16722     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16723         mem_base = xmlMemBlocks();
16724         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16725         enc = gen_xmlCharEncoding(n_enc, 1);
16726
16727         ret_val = xmlSwitchEncoding(ctxt, enc);
16728         desret_int(ret_val);
16729         call_tests++;
16730         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16731         des_xmlCharEncoding(n_enc, enc, 1);
16732         xmlResetLastError();
16733         if (mem_base != xmlMemBlocks()) {
16734             printf("Leak of %d blocks found in xmlSwitchEncoding",
16735                    xmlMemBlocks() - mem_base);
16736             test_ret++;
16737             printf(" %d", n_ctxt);
16738             printf(" %d", n_enc);
16739             printf("\n");
16740         }
16741     }
16742     }
16743     function_tests++;
16744
16745     return(test_ret);
16746 }
16747
16748
16749 static int
16750 test_xmlSwitchInputEncoding(void) {
16751     int test_ret = 0;
16752
16753     int mem_base;
16754     int ret_val;
16755     xmlParserCtxtPtr ctxt; /* the parser context */
16756     int n_ctxt;
16757     xmlParserInputPtr input; /* the input stream */
16758     int n_input;
16759     xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16760     int n_handler;
16761
16762     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16763     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16764     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16765         mem_base = xmlMemBlocks();
16766         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16767         input = gen_xmlParserInputPtr(n_input, 1);
16768         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16769
16770         ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16771         desret_int(ret_val);
16772         call_tests++;
16773         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16774         des_xmlParserInputPtr(n_input, input, 1);
16775         des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16776         xmlResetLastError();
16777         if (mem_base != xmlMemBlocks()) {
16778             printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16779                    xmlMemBlocks() - mem_base);
16780             test_ret++;
16781             printf(" %d", n_ctxt);
16782             printf(" %d", n_input);
16783             printf(" %d", n_handler);
16784             printf("\n");
16785         }
16786     }
16787     }
16788     }
16789     function_tests++;
16790
16791     return(test_ret);
16792 }
16793
16794
16795 static int
16796 test_xmlSwitchToEncoding(void) {
16797     int test_ret = 0;
16798
16799     int mem_base;
16800     int ret_val;
16801     xmlParserCtxtPtr ctxt; /* the parser context */
16802     int n_ctxt;
16803     xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16804     int n_handler;
16805
16806     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16807     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16808         mem_base = xmlMemBlocks();
16809         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16810         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16811
16812         ret_val = xmlSwitchToEncoding(ctxt, handler);
16813         desret_int(ret_val);
16814         call_tests++;
16815         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16816         des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16817         xmlResetLastError();
16818         if (mem_base != xmlMemBlocks()) {
16819             printf("Leak of %d blocks found in xmlSwitchToEncoding",
16820                    xmlMemBlocks() - mem_base);
16821             test_ret++;
16822             printf(" %d", n_ctxt);
16823             printf(" %d", n_handler);
16824             printf("\n");
16825         }
16826     }
16827     }
16828     function_tests++;
16829
16830     return(test_ret);
16831 }
16832
16833 static int
16834 test_parserInternals(void) {
16835     int test_ret = 0;
16836
16837     if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16838     test_ret += test_htmlCreateFileParserCtxt();
16839     test_ret += test_htmlInitAutoClose();
16840     test_ret += test_inputPop();
16841     test_ret += test_inputPush();
16842     test_ret += test_namePop();
16843     test_ret += test_namePush();
16844     test_ret += test_nodePop();
16845     test_ret += test_nodePush();
16846     test_ret += test_xmlCheckLanguageID();
16847     test_ret += test_xmlCopyChar();
16848     test_ret += test_xmlCopyCharMultiByte();
16849     test_ret += test_xmlCreateEntityParserCtxt();
16850     test_ret += test_xmlCreateFileParserCtxt();
16851     test_ret += test_xmlCreateMemoryParserCtxt();
16852     test_ret += test_xmlCreateURLParserCtxt();
16853     test_ret += test_xmlCurrentChar();
16854     test_ret += test_xmlErrMemory();
16855     test_ret += test_xmlIsLetter();
16856     test_ret += test_xmlNewEntityInputStream();
16857     test_ret += test_xmlNewInputFromFile();
16858     test_ret += test_xmlNewInputStream();
16859     test_ret += test_xmlNewStringInputStream();
16860     test_ret += test_xmlNextChar();
16861     test_ret += test_xmlParserInputShrink();
16862     test_ret += test_xmlPopInput();
16863     test_ret += test_xmlPushInput();
16864     test_ret += test_xmlSetEntityReferenceFunc();
16865     test_ret += test_xmlSplitQName();
16866     test_ret += test_xmlStringCurrentChar();
16867     test_ret += test_xmlStringDecodeEntities();
16868     test_ret += test_xmlStringLenDecodeEntities();
16869     test_ret += test_xmlSwitchEncoding();
16870     test_ret += test_xmlSwitchInputEncoding();
16871     test_ret += test_xmlSwitchToEncoding();
16872
16873     if (test_ret != 0)
16874         printf("Module parserInternals: %d errors\n", test_ret);
16875     return(test_ret);
16876 }
16877
16878 static int
16879 test_xmlPatternFromRoot(void) {
16880     int test_ret = 0;
16881
16882 #if defined(LIBXML_PATTERN_ENABLED)
16883     int mem_base;
16884     int ret_val;
16885     xmlPatternPtr comp; /* the precompiled pattern */
16886     int n_comp;
16887
16888     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16889         mem_base = xmlMemBlocks();
16890         comp = gen_xmlPatternPtr(n_comp, 0);
16891
16892         ret_val = xmlPatternFromRoot(comp);
16893         desret_int(ret_val);
16894         call_tests++;
16895         des_xmlPatternPtr(n_comp, comp, 0);
16896         xmlResetLastError();
16897         if (mem_base != xmlMemBlocks()) {
16898             printf("Leak of %d blocks found in xmlPatternFromRoot",
16899                    xmlMemBlocks() - mem_base);
16900             test_ret++;
16901             printf(" %d", n_comp);
16902             printf("\n");
16903         }
16904     }
16905     function_tests++;
16906 #endif
16907
16908     return(test_ret);
16909 }
16910
16911
16912 static int
16913 test_xmlPatternGetStreamCtxt(void) {
16914     int test_ret = 0;
16915
16916
16917     /* missing type support */
16918     return(test_ret);
16919 }
16920
16921
16922 static int
16923 test_xmlPatternMatch(void) {
16924     int test_ret = 0;
16925
16926 #if defined(LIBXML_PATTERN_ENABLED)
16927     int mem_base;
16928     int ret_val;
16929     xmlPatternPtr comp; /* the precompiled pattern */
16930     int n_comp;
16931     xmlNodePtr node; /* a node */
16932     int n_node;
16933
16934     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16935     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16936         mem_base = xmlMemBlocks();
16937         comp = gen_xmlPatternPtr(n_comp, 0);
16938         node = gen_xmlNodePtr(n_node, 1);
16939
16940         ret_val = xmlPatternMatch(comp, node);
16941         desret_int(ret_val);
16942         call_tests++;
16943         des_xmlPatternPtr(n_comp, comp, 0);
16944         des_xmlNodePtr(n_node, node, 1);
16945         xmlResetLastError();
16946         if (mem_base != xmlMemBlocks()) {
16947             printf("Leak of %d blocks found in xmlPatternMatch",
16948                    xmlMemBlocks() - mem_base);
16949             test_ret++;
16950             printf(" %d", n_comp);
16951             printf(" %d", n_node);
16952             printf("\n");
16953         }
16954     }
16955     }
16956     function_tests++;
16957 #endif
16958
16959     return(test_ret);
16960 }
16961
16962
16963 static int
16964 test_xmlPatternMaxDepth(void) {
16965     int test_ret = 0;
16966
16967 #if defined(LIBXML_PATTERN_ENABLED)
16968     int mem_base;
16969     int ret_val;
16970     xmlPatternPtr comp; /* the precompiled pattern */
16971     int n_comp;
16972
16973     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16974         mem_base = xmlMemBlocks();
16975         comp = gen_xmlPatternPtr(n_comp, 0);
16976
16977         ret_val = xmlPatternMaxDepth(comp);
16978         desret_int(ret_val);
16979         call_tests++;
16980         des_xmlPatternPtr(n_comp, comp, 0);
16981         xmlResetLastError();
16982         if (mem_base != xmlMemBlocks()) {
16983             printf("Leak of %d blocks found in xmlPatternMaxDepth",
16984                    xmlMemBlocks() - mem_base);
16985             test_ret++;
16986             printf(" %d", n_comp);
16987             printf("\n");
16988         }
16989     }
16990     function_tests++;
16991 #endif
16992
16993     return(test_ret);
16994 }
16995
16996
16997 static int
16998 test_xmlPatternMinDepth(void) {
16999     int test_ret = 0;
17000
17001 #if defined(LIBXML_PATTERN_ENABLED)
17002     int mem_base;
17003     int ret_val;
17004     xmlPatternPtr comp; /* the precompiled pattern */
17005     int n_comp;
17006
17007     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
17008         mem_base = xmlMemBlocks();
17009         comp = gen_xmlPatternPtr(n_comp, 0);
17010
17011         ret_val = xmlPatternMinDepth(comp);
17012         desret_int(ret_val);
17013         call_tests++;
17014         des_xmlPatternPtr(n_comp, comp, 0);
17015         xmlResetLastError();
17016         if (mem_base != xmlMemBlocks()) {
17017             printf("Leak of %d blocks found in xmlPatternMinDepth",
17018                    xmlMemBlocks() - mem_base);
17019             test_ret++;
17020             printf(" %d", n_comp);
17021             printf("\n");
17022         }
17023     }
17024     function_tests++;
17025 #endif
17026
17027     return(test_ret);
17028 }
17029
17030
17031 static int
17032 test_xmlPatternStreamable(void) {
17033     int test_ret = 0;
17034
17035 #if defined(LIBXML_PATTERN_ENABLED)
17036     int mem_base;
17037     int ret_val;
17038     xmlPatternPtr comp; /* the precompiled pattern */
17039     int n_comp;
17040
17041     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
17042         mem_base = xmlMemBlocks();
17043         comp = gen_xmlPatternPtr(n_comp, 0);
17044
17045         ret_val = xmlPatternStreamable(comp);
17046         desret_int(ret_val);
17047         call_tests++;
17048         des_xmlPatternPtr(n_comp, comp, 0);
17049         xmlResetLastError();
17050         if (mem_base != xmlMemBlocks()) {
17051             printf("Leak of %d blocks found in xmlPatternStreamable",
17052                    xmlMemBlocks() - mem_base);
17053             test_ret++;
17054             printf(" %d", n_comp);
17055             printf("\n");
17056         }
17057     }
17058     function_tests++;
17059 #endif
17060
17061     return(test_ret);
17062 }
17063
17064
17065 static int
17066 test_xmlPatterncompile(void) {
17067     int test_ret = 0;
17068
17069
17070     /* missing type support */
17071     return(test_ret);
17072 }
17073
17074 #ifdef LIBXML_PATTERN_ENABLED
17075
17076 #define gen_nb_xmlStreamCtxtPtr 1
17077 static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17078     return(NULL);
17079 }
17080 static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17081 }
17082 #endif
17083
17084
17085 static int
17086 test_xmlStreamPop(void) {
17087     int test_ret = 0;
17088
17089 #if defined(LIBXML_PATTERN_ENABLED)
17090     int mem_base;
17091     int ret_val;
17092     xmlStreamCtxtPtr stream; /* the stream context */
17093     int n_stream;
17094
17095     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17096         mem_base = xmlMemBlocks();
17097         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17098
17099         ret_val = xmlStreamPop(stream);
17100         desret_int(ret_val);
17101         call_tests++;
17102         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17103         xmlResetLastError();
17104         if (mem_base != xmlMemBlocks()) {
17105             printf("Leak of %d blocks found in xmlStreamPop",
17106                    xmlMemBlocks() - mem_base);
17107             test_ret++;
17108             printf(" %d", n_stream);
17109             printf("\n");
17110         }
17111     }
17112     function_tests++;
17113 #endif
17114
17115     return(test_ret);
17116 }
17117
17118
17119 static int
17120 test_xmlStreamPush(void) {
17121     int test_ret = 0;
17122
17123 #if defined(LIBXML_PATTERN_ENABLED)
17124     int mem_base;
17125     int ret_val;
17126     xmlStreamCtxtPtr stream; /* the stream context */
17127     int n_stream;
17128     xmlChar * name; /* the current name */
17129     int n_name;
17130     xmlChar * ns; /* the namespace name */
17131     int n_ns;
17132
17133     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17134     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17135     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17136         mem_base = xmlMemBlocks();
17137         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17138         name = gen_const_xmlChar_ptr(n_name, 1);
17139         ns = gen_const_xmlChar_ptr(n_ns, 2);
17140
17141         ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
17142         desret_int(ret_val);
17143         call_tests++;
17144         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17145         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17146         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17147         xmlResetLastError();
17148         if (mem_base != xmlMemBlocks()) {
17149             printf("Leak of %d blocks found in xmlStreamPush",
17150                    xmlMemBlocks() - mem_base);
17151             test_ret++;
17152             printf(" %d", n_stream);
17153             printf(" %d", n_name);
17154             printf(" %d", n_ns);
17155             printf("\n");
17156         }
17157     }
17158     }
17159     }
17160     function_tests++;
17161 #endif
17162
17163     return(test_ret);
17164 }
17165
17166
17167 static int
17168 test_xmlStreamPushAttr(void) {
17169     int test_ret = 0;
17170
17171 #if defined(LIBXML_PATTERN_ENABLED)
17172     int mem_base;
17173     int ret_val;
17174     xmlStreamCtxtPtr stream; /* the stream context */
17175     int n_stream;
17176     xmlChar * name; /* the current name */
17177     int n_name;
17178     xmlChar * ns; /* the namespace name */
17179     int n_ns;
17180
17181     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17182     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17183     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17184         mem_base = xmlMemBlocks();
17185         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17186         name = gen_const_xmlChar_ptr(n_name, 1);
17187         ns = gen_const_xmlChar_ptr(n_ns, 2);
17188
17189         ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
17190         desret_int(ret_val);
17191         call_tests++;
17192         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17193         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17194         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17195         xmlResetLastError();
17196         if (mem_base != xmlMemBlocks()) {
17197             printf("Leak of %d blocks found in xmlStreamPushAttr",
17198                    xmlMemBlocks() - mem_base);
17199             test_ret++;
17200             printf(" %d", n_stream);
17201             printf(" %d", n_name);
17202             printf(" %d", n_ns);
17203             printf("\n");
17204         }
17205     }
17206     }
17207     }
17208     function_tests++;
17209 #endif
17210
17211     return(test_ret);
17212 }
17213
17214
17215 static int
17216 test_xmlStreamPushNode(void) {
17217     int test_ret = 0;
17218
17219 #if defined(LIBXML_PATTERN_ENABLED)
17220     int mem_base;
17221     int ret_val;
17222     xmlStreamCtxtPtr stream; /* the stream context */
17223     int n_stream;
17224     xmlChar * name; /* the current name */
17225     int n_name;
17226     xmlChar * ns; /* the namespace name */
17227     int n_ns;
17228     int nodeType; /* the type of the node being pushed */
17229     int n_nodeType;
17230
17231     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17232     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17233     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17234     for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
17235         mem_base = xmlMemBlocks();
17236         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17237         name = gen_const_xmlChar_ptr(n_name, 1);
17238         ns = gen_const_xmlChar_ptr(n_ns, 2);
17239         nodeType = gen_int(n_nodeType, 3);
17240
17241         ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType);
17242         desret_int(ret_val);
17243         call_tests++;
17244         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17245         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17246         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17247         des_int(n_nodeType, nodeType, 3);
17248         xmlResetLastError();
17249         if (mem_base != xmlMemBlocks()) {
17250             printf("Leak of %d blocks found in xmlStreamPushNode",
17251                    xmlMemBlocks() - mem_base);
17252             test_ret++;
17253             printf(" %d", n_stream);
17254             printf(" %d", n_name);
17255             printf(" %d", n_ns);
17256             printf(" %d", n_nodeType);
17257             printf("\n");
17258         }
17259     }
17260     }
17261     }
17262     }
17263     function_tests++;
17264 #endif
17265
17266     return(test_ret);
17267 }
17268
17269
17270 static int
17271 test_xmlStreamWantsAnyNode(void) {
17272     int test_ret = 0;
17273
17274 #if defined(LIBXML_PATTERN_ENABLED)
17275     int mem_base;
17276     int ret_val;
17277     xmlStreamCtxtPtr streamCtxt; /* the stream context */
17278     int n_streamCtxt;
17279
17280     for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
17281         mem_base = xmlMemBlocks();
17282         streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
17283
17284         ret_val = xmlStreamWantsAnyNode(streamCtxt);
17285         desret_int(ret_val);
17286         call_tests++;
17287         des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
17288         xmlResetLastError();
17289         if (mem_base != xmlMemBlocks()) {
17290             printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
17291                    xmlMemBlocks() - mem_base);
17292             test_ret++;
17293             printf(" %d", n_streamCtxt);
17294             printf("\n");
17295         }
17296     }
17297     function_tests++;
17298 #endif
17299
17300     return(test_ret);
17301 }
17302
17303 static int
17304 test_pattern(void) {
17305     int test_ret = 0;
17306
17307     if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
17308     test_ret += test_xmlPatternFromRoot();
17309     test_ret += test_xmlPatternGetStreamCtxt();
17310     test_ret += test_xmlPatternMatch();
17311     test_ret += test_xmlPatternMaxDepth();
17312     test_ret += test_xmlPatternMinDepth();
17313     test_ret += test_xmlPatternStreamable();
17314     test_ret += test_xmlPatterncompile();
17315     test_ret += test_xmlStreamPop();
17316     test_ret += test_xmlStreamPush();
17317     test_ret += test_xmlStreamPushAttr();
17318     test_ret += test_xmlStreamPushNode();
17319     test_ret += test_xmlStreamWantsAnyNode();
17320
17321     if (test_ret != 0)
17322         printf("Module pattern: %d errors\n", test_ret);
17323     return(test_ret);
17324 }
17325 #ifdef LIBXML_SCHEMAS_ENABLED
17326
17327 #define gen_nb_xmlRelaxNGPtr 1
17328 static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17329     return(NULL);
17330 }
17331 static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17332 }
17333 #endif
17334
17335
17336 static int
17337 test_xmlRelaxNGDump(void) {
17338     int test_ret = 0;
17339
17340 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17341     int mem_base;
17342     FILE * output; /* the file output */
17343     int n_output;
17344     xmlRelaxNGPtr schema; /* a schema structure */
17345     int n_schema;
17346
17347     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17348     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17349         mem_base = xmlMemBlocks();
17350         output = gen_FILE_ptr(n_output, 0);
17351         schema = gen_xmlRelaxNGPtr(n_schema, 1);
17352
17353         xmlRelaxNGDump(output, schema);
17354         call_tests++;
17355         des_FILE_ptr(n_output, output, 0);
17356         des_xmlRelaxNGPtr(n_schema, schema, 1);
17357         xmlResetLastError();
17358         if (mem_base != xmlMemBlocks()) {
17359             printf("Leak of %d blocks found in xmlRelaxNGDump",
17360                    xmlMemBlocks() - mem_base);
17361             test_ret++;
17362             printf(" %d", n_output);
17363             printf(" %d", n_schema);
17364             printf("\n");
17365         }
17366     }
17367     }
17368     function_tests++;
17369 #endif
17370
17371     return(test_ret);
17372 }
17373
17374
17375 static int
17376 test_xmlRelaxNGDumpTree(void) {
17377     int test_ret = 0;
17378
17379 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17380     int mem_base;
17381     FILE * output; /* the file output */
17382     int n_output;
17383     xmlRelaxNGPtr schema; /* a schema structure */
17384     int n_schema;
17385
17386     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17387     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17388         mem_base = xmlMemBlocks();
17389         output = gen_FILE_ptr(n_output, 0);
17390         schema = gen_xmlRelaxNGPtr(n_schema, 1);
17391
17392         xmlRelaxNGDumpTree(output, schema);
17393         call_tests++;
17394         des_FILE_ptr(n_output, output, 0);
17395         des_xmlRelaxNGPtr(n_schema, schema, 1);
17396         xmlResetLastError();
17397         if (mem_base != xmlMemBlocks()) {
17398             printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
17399                    xmlMemBlocks() - mem_base);
17400             test_ret++;
17401             printf(" %d", n_output);
17402             printf(" %d", n_schema);
17403             printf("\n");
17404         }
17405     }
17406     }
17407     function_tests++;
17408 #endif
17409
17410     return(test_ret);
17411 }
17412
17413 #ifdef LIBXML_SCHEMAS_ENABLED
17414
17415 #define gen_nb_xmlRelaxNGParserCtxtPtr 1
17416 static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17417     return(NULL);
17418 }
17419 static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17420 }
17421 #endif
17422
17423 #ifdef LIBXML_SCHEMAS_ENABLED
17424
17425 #define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
17426 static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17427     return(NULL);
17428 }
17429 static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17430 }
17431 #endif
17432
17433 #ifdef LIBXML_SCHEMAS_ENABLED
17434
17435 #define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17436 static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17437     return(NULL);
17438 }
17439 static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17440 }
17441 #endif
17442
17443
17444 static int
17445 test_xmlRelaxNGGetParserErrors(void) {
17446     int test_ret = 0;
17447
17448 #if defined(LIBXML_SCHEMAS_ENABLED)
17449     int mem_base;
17450     int ret_val;
17451     xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17452     int n_ctxt;
17453     xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17454     int n_err;
17455     xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17456     int n_warn;
17457     void ** ctx; /* contextual data for the callbacks result */
17458     int n_ctx;
17459
17460     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17461     for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17462     for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17463     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17464         mem_base = xmlMemBlocks();
17465         ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17466         err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17467         warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17468         ctx = gen_void_ptr_ptr(n_ctx, 3);
17469
17470         ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17471         desret_int(ret_val);
17472         call_tests++;
17473         des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17474         des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17475         des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17476         des_void_ptr_ptr(n_ctx, ctx, 3);
17477         xmlResetLastError();
17478         if (mem_base != xmlMemBlocks()) {
17479             printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17480                    xmlMemBlocks() - mem_base);
17481             test_ret++;
17482             printf(" %d", n_ctxt);
17483             printf(" %d", n_err);
17484             printf(" %d", n_warn);
17485             printf(" %d", n_ctx);
17486             printf("\n");
17487         }
17488     }
17489     }
17490     }
17491     }
17492     function_tests++;
17493 #endif
17494
17495     return(test_ret);
17496 }
17497
17498 #ifdef LIBXML_SCHEMAS_ENABLED
17499
17500 #define gen_nb_xmlRelaxNGValidCtxtPtr 1
17501 static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17502     return(NULL);
17503 }
17504 static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17505 }
17506 #endif
17507
17508
17509 static int
17510 test_xmlRelaxNGGetValidErrors(void) {
17511     int test_ret = 0;
17512
17513 #if defined(LIBXML_SCHEMAS_ENABLED)
17514     int mem_base;
17515     int ret_val;
17516     xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17517     int n_ctxt;
17518     xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17519     int n_err;
17520     xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17521     int n_warn;
17522     void ** ctx; /* the functions context result */
17523     int n_ctx;
17524
17525     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17526     for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17527     for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17528     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17529         mem_base = xmlMemBlocks();
17530         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17531         err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17532         warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17533         ctx = gen_void_ptr_ptr(n_ctx, 3);
17534
17535         ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17536         desret_int(ret_val);
17537         call_tests++;
17538         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17539         des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17540         des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17541         des_void_ptr_ptr(n_ctx, ctx, 3);
17542         xmlResetLastError();
17543         if (mem_base != xmlMemBlocks()) {
17544             printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17545                    xmlMemBlocks() - mem_base);
17546             test_ret++;
17547             printf(" %d", n_ctxt);
17548             printf(" %d", n_err);
17549             printf(" %d", n_warn);
17550             printf(" %d", n_ctx);
17551             printf("\n");
17552         }
17553     }
17554     }
17555     }
17556     }
17557     function_tests++;
17558 #endif
17559
17560     return(test_ret);
17561 }
17562
17563
17564 static int
17565 test_xmlRelaxNGInitTypes(void) {
17566     int test_ret = 0;
17567
17568 #if defined(LIBXML_SCHEMAS_ENABLED)
17569     int mem_base;
17570     int ret_val;
17571
17572         mem_base = xmlMemBlocks();
17573
17574         ret_val = xmlRelaxNGInitTypes();
17575         desret_int(ret_val);
17576         call_tests++;
17577         xmlResetLastError();
17578         if (mem_base != xmlMemBlocks()) {
17579             printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17580                    xmlMemBlocks() - mem_base);
17581             test_ret++;
17582             printf("\n");
17583         }
17584     function_tests++;
17585 #endif
17586
17587     return(test_ret);
17588 }
17589
17590
17591 static int
17592 test_xmlRelaxNGNewDocParserCtxt(void) {
17593     int test_ret = 0;
17594
17595 #if defined(LIBXML_SCHEMAS_ENABLED)
17596     int mem_base;
17597     xmlRelaxNGParserCtxtPtr ret_val;
17598     xmlDocPtr doc; /* a preparsed document tree */
17599     int n_doc;
17600
17601     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17602         mem_base = xmlMemBlocks();
17603         doc = gen_xmlDocPtr(n_doc, 0);
17604
17605         ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17606         desret_xmlRelaxNGParserCtxtPtr(ret_val);
17607         call_tests++;
17608         des_xmlDocPtr(n_doc, doc, 0);
17609         xmlResetLastError();
17610         if (mem_base != xmlMemBlocks()) {
17611             printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17612                    xmlMemBlocks() - mem_base);
17613             test_ret++;
17614             printf(" %d", n_doc);
17615             printf("\n");
17616         }
17617     }
17618     function_tests++;
17619 #endif
17620
17621     return(test_ret);
17622 }
17623
17624
17625 static int
17626 test_xmlRelaxNGNewMemParserCtxt(void) {
17627     int test_ret = 0;
17628
17629 #if defined(LIBXML_SCHEMAS_ENABLED)
17630     int mem_base;
17631     xmlRelaxNGParserCtxtPtr ret_val;
17632     char * buffer; /* a pointer to a char array containing the schemas */
17633     int n_buffer;
17634     int size; /* the size of the array */
17635     int n_size;
17636
17637     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17638     for (n_size = 0;n_size < gen_nb_int;n_size++) {
17639         mem_base = xmlMemBlocks();
17640         buffer = gen_const_char_ptr(n_buffer, 0);
17641         size = gen_int(n_size, 1);
17642         if ((buffer != NULL) &&
17643             (size > (int) strlen((const char *) buffer) + 1))
17644             continue;
17645
17646         ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17647         desret_xmlRelaxNGParserCtxtPtr(ret_val);
17648         call_tests++;
17649         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17650         des_int(n_size, size, 1);
17651         xmlResetLastError();
17652         if (mem_base != xmlMemBlocks()) {
17653             printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17654                    xmlMemBlocks() - mem_base);
17655             test_ret++;
17656             printf(" %d", n_buffer);
17657             printf(" %d", n_size);
17658             printf("\n");
17659         }
17660     }
17661     }
17662     function_tests++;
17663 #endif
17664
17665     return(test_ret);
17666 }
17667
17668
17669 static int
17670 test_xmlRelaxNGNewParserCtxt(void) {
17671     int test_ret = 0;
17672
17673 #if defined(LIBXML_SCHEMAS_ENABLED)
17674     int mem_base;
17675     xmlRelaxNGParserCtxtPtr ret_val;
17676     char * URL; /* the location of the schema */
17677     int n_URL;
17678
17679     for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17680         mem_base = xmlMemBlocks();
17681         URL = gen_const_char_ptr(n_URL, 0);
17682
17683         ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17684         desret_xmlRelaxNGParserCtxtPtr(ret_val);
17685         call_tests++;
17686         des_const_char_ptr(n_URL, (const char *)URL, 0);
17687         xmlResetLastError();
17688         if (mem_base != xmlMemBlocks()) {
17689             printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17690                    xmlMemBlocks() - mem_base);
17691             test_ret++;
17692             printf(" %d", n_URL);
17693             printf("\n");
17694         }
17695     }
17696     function_tests++;
17697 #endif
17698
17699     return(test_ret);
17700 }
17701
17702
17703 static int
17704 test_xmlRelaxNGNewValidCtxt(void) {
17705     int test_ret = 0;
17706
17707
17708     /* missing type support */
17709     return(test_ret);
17710 }
17711
17712
17713 static int
17714 test_xmlRelaxNGParse(void) {
17715     int test_ret = 0;
17716
17717
17718     /* missing type support */
17719     return(test_ret);
17720 }
17721
17722
17723 static int
17724 test_xmlRelaxNGSetParserErrors(void) {
17725     int test_ret = 0;
17726
17727
17728     /* missing type support */
17729     return(test_ret);
17730 }
17731
17732
17733 static int
17734 test_xmlRelaxNGSetParserStructuredErrors(void) {
17735     int test_ret = 0;
17736
17737
17738     /* missing type support */
17739     return(test_ret);
17740 }
17741
17742
17743 static int
17744 test_xmlRelaxNGSetValidErrors(void) {
17745     int test_ret = 0;
17746
17747
17748     /* missing type support */
17749     return(test_ret);
17750 }
17751
17752
17753 static int
17754 test_xmlRelaxNGSetValidStructuredErrors(void) {
17755     int test_ret = 0;
17756
17757
17758     /* missing type support */
17759     return(test_ret);
17760 }
17761
17762
17763 static int
17764 test_xmlRelaxNGValidateDoc(void) {
17765     int test_ret = 0;
17766
17767 #if defined(LIBXML_SCHEMAS_ENABLED)
17768     int mem_base;
17769     int ret_val;
17770     xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17771     int n_ctxt;
17772     xmlDocPtr doc; /* a parsed document tree */
17773     int n_doc;
17774
17775     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17776     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17777         mem_base = xmlMemBlocks();
17778         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17779         doc = gen_xmlDocPtr(n_doc, 1);
17780
17781         ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17782         desret_int(ret_val);
17783         call_tests++;
17784         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17785         des_xmlDocPtr(n_doc, doc, 1);
17786         xmlResetLastError();
17787         if (mem_base != xmlMemBlocks()) {
17788             printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17789                    xmlMemBlocks() - mem_base);
17790             test_ret++;
17791             printf(" %d", n_ctxt);
17792             printf(" %d", n_doc);
17793             printf("\n");
17794         }
17795     }
17796     }
17797     function_tests++;
17798 #endif
17799
17800     return(test_ret);
17801 }
17802
17803
17804 static int
17805 test_xmlRelaxNGValidateFullElement(void) {
17806     int test_ret = 0;
17807
17808 #if defined(LIBXML_SCHEMAS_ENABLED)
17809     int mem_base;
17810     int ret_val;
17811     xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17812     int n_ctxt;
17813     xmlDocPtr doc; /* a document instance */
17814     int n_doc;
17815     xmlNodePtr elem; /* an element instance */
17816     int n_elem;
17817
17818     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17819     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17820     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17821         mem_base = xmlMemBlocks();
17822         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17823         doc = gen_xmlDocPtr(n_doc, 1);
17824         elem = gen_xmlNodePtr(n_elem, 2);
17825
17826         ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17827         desret_int(ret_val);
17828         call_tests++;
17829         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17830         des_xmlDocPtr(n_doc, doc, 1);
17831         des_xmlNodePtr(n_elem, elem, 2);
17832         xmlResetLastError();
17833         if (mem_base != xmlMemBlocks()) {
17834             printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17835                    xmlMemBlocks() - mem_base);
17836             test_ret++;
17837             printf(" %d", n_ctxt);
17838             printf(" %d", n_doc);
17839             printf(" %d", n_elem);
17840             printf("\n");
17841         }
17842     }
17843     }
17844     }
17845     function_tests++;
17846 #endif
17847
17848     return(test_ret);
17849 }
17850
17851
17852 static int
17853 test_xmlRelaxNGValidatePopElement(void) {
17854     int test_ret = 0;
17855
17856 #if defined(LIBXML_SCHEMAS_ENABLED)
17857     int mem_base;
17858     int ret_val;
17859     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17860     int n_ctxt;
17861     xmlDocPtr doc; /* a document instance */
17862     int n_doc;
17863     xmlNodePtr elem; /* an element instance */
17864     int n_elem;
17865
17866     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17867     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17868     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17869         mem_base = xmlMemBlocks();
17870         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17871         doc = gen_xmlDocPtr(n_doc, 1);
17872         elem = gen_xmlNodePtr(n_elem, 2);
17873
17874         ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17875         desret_int(ret_val);
17876         call_tests++;
17877         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17878         des_xmlDocPtr(n_doc, doc, 1);
17879         des_xmlNodePtr(n_elem, elem, 2);
17880         xmlResetLastError();
17881         if (mem_base != xmlMemBlocks()) {
17882             printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17883                    xmlMemBlocks() - mem_base);
17884             test_ret++;
17885             printf(" %d", n_ctxt);
17886             printf(" %d", n_doc);
17887             printf(" %d", n_elem);
17888             printf("\n");
17889         }
17890     }
17891     }
17892     }
17893     function_tests++;
17894 #endif
17895
17896     return(test_ret);
17897 }
17898
17899
17900 static int
17901 test_xmlRelaxNGValidatePushCData(void) {
17902     int test_ret = 0;
17903
17904 #if defined(LIBXML_SCHEMAS_ENABLED)
17905     int mem_base;
17906     int ret_val;
17907     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17908     int n_ctxt;
17909     xmlChar * data; /* some character data read */
17910     int n_data;
17911     int len; /* the length of the data */
17912     int n_len;
17913
17914     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17915     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17916     for (n_len = 0;n_len < gen_nb_int;n_len++) {
17917         mem_base = xmlMemBlocks();
17918         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17919         data = gen_const_xmlChar_ptr(n_data, 1);
17920         len = gen_int(n_len, 2);
17921         if ((data != NULL) &&
17922             (len > (int) strlen((const char *) data) + 1))
17923             continue;
17924
17925         ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17926         desret_int(ret_val);
17927         call_tests++;
17928         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17929         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17930         des_int(n_len, len, 2);
17931         xmlResetLastError();
17932         if (mem_base != xmlMemBlocks()) {
17933             printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17934                    xmlMemBlocks() - mem_base);
17935             test_ret++;
17936             printf(" %d", n_ctxt);
17937             printf(" %d", n_data);
17938             printf(" %d", n_len);
17939             printf("\n");
17940         }
17941     }
17942     }
17943     }
17944     function_tests++;
17945 #endif
17946
17947     return(test_ret);
17948 }
17949
17950
17951 static int
17952 test_xmlRelaxNGValidatePushElement(void) {
17953     int test_ret = 0;
17954
17955 #if defined(LIBXML_SCHEMAS_ENABLED)
17956     int mem_base;
17957     int ret_val;
17958     xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17959     int n_ctxt;
17960     xmlDocPtr doc; /* a document instance */
17961     int n_doc;
17962     xmlNodePtr elem; /* an element instance */
17963     int n_elem;
17964
17965     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17966     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17967     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17968         mem_base = xmlMemBlocks();
17969         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17970         doc = gen_xmlDocPtr(n_doc, 1);
17971         elem = gen_xmlNodePtr(n_elem, 2);
17972
17973         ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17974         desret_int(ret_val);
17975         call_tests++;
17976         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17977         des_xmlDocPtr(n_doc, doc, 1);
17978         des_xmlNodePtr(n_elem, elem, 2);
17979         xmlResetLastError();
17980         if (mem_base != xmlMemBlocks()) {
17981             printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17982                    xmlMemBlocks() - mem_base);
17983             test_ret++;
17984             printf(" %d", n_ctxt);
17985             printf(" %d", n_doc);
17986             printf(" %d", n_elem);
17987             printf("\n");
17988         }
17989     }
17990     }
17991     }
17992     function_tests++;
17993 #endif
17994
17995     return(test_ret);
17996 }
17997
17998
17999 static int
18000 test_xmlRelaxParserSetFlag(void) {
18001     int test_ret = 0;
18002
18003 #if defined(LIBXML_SCHEMAS_ENABLED)
18004     int mem_base;
18005     int ret_val;
18006     xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
18007     int n_ctxt;
18008     int flags; /* a set of flags values */
18009     int n_flags;
18010
18011     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
18012     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
18013         mem_base = xmlMemBlocks();
18014         ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
18015         flags = gen_int(n_flags, 1);
18016
18017         ret_val = xmlRelaxParserSetFlag(ctxt, flags);
18018         desret_int(ret_val);
18019         call_tests++;
18020         des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
18021         des_int(n_flags, flags, 1);
18022         xmlResetLastError();
18023         if (mem_base != xmlMemBlocks()) {
18024             printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
18025                    xmlMemBlocks() - mem_base);
18026             test_ret++;
18027             printf(" %d", n_ctxt);
18028             printf(" %d", n_flags);
18029             printf("\n");
18030         }
18031     }
18032     }
18033     function_tests++;
18034 #endif
18035
18036     return(test_ret);
18037 }
18038
18039 static int
18040 test_relaxng(void) {
18041     int test_ret = 0;
18042
18043     if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
18044     test_ret += test_xmlRelaxNGDump();
18045     test_ret += test_xmlRelaxNGDumpTree();
18046     test_ret += test_xmlRelaxNGGetParserErrors();
18047     test_ret += test_xmlRelaxNGGetValidErrors();
18048     test_ret += test_xmlRelaxNGInitTypes();
18049     test_ret += test_xmlRelaxNGNewDocParserCtxt();
18050     test_ret += test_xmlRelaxNGNewMemParserCtxt();
18051     test_ret += test_xmlRelaxNGNewParserCtxt();
18052     test_ret += test_xmlRelaxNGNewValidCtxt();
18053     test_ret += test_xmlRelaxNGParse();
18054     test_ret += test_xmlRelaxNGSetParserErrors();
18055     test_ret += test_xmlRelaxNGSetParserStructuredErrors();
18056     test_ret += test_xmlRelaxNGSetValidErrors();
18057     test_ret += test_xmlRelaxNGSetValidStructuredErrors();
18058     test_ret += test_xmlRelaxNGValidateDoc();
18059     test_ret += test_xmlRelaxNGValidateFullElement();
18060     test_ret += test_xmlRelaxNGValidatePopElement();
18061     test_ret += test_xmlRelaxNGValidatePushCData();
18062     test_ret += test_xmlRelaxNGValidatePushElement();
18063     test_ret += test_xmlRelaxParserSetFlag();
18064
18065     if (test_ret != 0)
18066         printf("Module relaxng: %d errors\n", test_ret);
18067     return(test_ret);
18068 }
18069 static int
18070 test_schemasInternals(void) {
18071     int test_ret = 0;
18072
18073     if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
18074
18075     if (test_ret != 0)
18076         printf("Module schemasInternals: %d errors\n", test_ret);
18077     return(test_ret);
18078 }
18079
18080 static int
18081 test_xmlSchematronNewDocParserCtxt(void) {
18082     int test_ret = 0;
18083
18084
18085     /* missing type support */
18086     return(test_ret);
18087 }
18088
18089
18090 static int
18091 test_xmlSchematronNewMemParserCtxt(void) {
18092     int test_ret = 0;
18093
18094
18095     /* missing type support */
18096     return(test_ret);
18097 }
18098
18099
18100 static int
18101 test_xmlSchematronNewParserCtxt(void) {
18102     int test_ret = 0;
18103
18104
18105     /* missing type support */
18106     return(test_ret);
18107 }
18108
18109 #ifdef LIBXML_SCHEMATRON_ENABLED
18110
18111 #define gen_nb_xmlSchematronPtr 1
18112 static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18113     return(NULL);
18114 }
18115 static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18116 }
18117 #endif
18118
18119
18120 static int
18121 test_xmlSchematronNewValidCtxt(void) {
18122     int test_ret = 0;
18123
18124
18125     /* missing type support */
18126     return(test_ret);
18127 }
18128
18129 #ifdef LIBXML_SCHEMATRON_ENABLED
18130
18131 #define gen_nb_xmlSchematronParserCtxtPtr 1
18132 static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18133     return(NULL);
18134 }
18135 static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18136 }
18137 #endif
18138
18139
18140 static int
18141 test_xmlSchematronParse(void) {
18142     int test_ret = 0;
18143
18144
18145     /* missing type support */
18146     return(test_ret);
18147 }
18148
18149 #ifdef LIBXML_SCHEMATRON_ENABLED
18150
18151 #define gen_nb_xmlSchematronValidCtxtPtr 1
18152 static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18153     return(NULL);
18154 }
18155 static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18156 }
18157 #endif
18158
18159
18160 static int
18161 test_xmlSchematronSetValidStructuredErrors(void) {
18162     int test_ret = 0;
18163
18164
18165     /* missing type support */
18166     return(test_ret);
18167 }
18168
18169
18170 static int
18171 test_xmlSchematronValidateDoc(void) {
18172     int test_ret = 0;
18173
18174 #if defined(LIBXML_SCHEMATRON_ENABLED)
18175     int mem_base;
18176     int ret_val;
18177     xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
18178     int n_ctxt;
18179     xmlDocPtr instance; /* the document instace tree */
18180     int n_instance;
18181
18182     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
18183     for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
18184         mem_base = xmlMemBlocks();
18185         ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
18186         instance = gen_xmlDocPtr(n_instance, 1);
18187
18188         ret_val = xmlSchematronValidateDoc(ctxt, instance);
18189         desret_int(ret_val);
18190         call_tests++;
18191         des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
18192         des_xmlDocPtr(n_instance, instance, 1);
18193         xmlResetLastError();
18194         if (mem_base != xmlMemBlocks()) {
18195             printf("Leak of %d blocks found in xmlSchematronValidateDoc",
18196                    xmlMemBlocks() - mem_base);
18197             test_ret++;
18198             printf(" %d", n_ctxt);
18199             printf(" %d", n_instance);
18200             printf("\n");
18201         }
18202     }
18203     }
18204     function_tests++;
18205 #endif
18206
18207     return(test_ret);
18208 }
18209
18210 static int
18211 test_schematron(void) {
18212     int test_ret = 0;
18213
18214     if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
18215     test_ret += test_xmlSchematronNewDocParserCtxt();
18216     test_ret += test_xmlSchematronNewMemParserCtxt();
18217     test_ret += test_xmlSchematronNewParserCtxt();
18218     test_ret += test_xmlSchematronNewValidCtxt();
18219     test_ret += test_xmlSchematronParse();
18220     test_ret += test_xmlSchematronSetValidStructuredErrors();
18221     test_ret += test_xmlSchematronValidateDoc();
18222
18223     if (test_ret != 0)
18224         printf("Module schematron: %d errors\n", test_ret);
18225     return(test_ret);
18226 }
18227
18228 static int
18229 test_xmlAddChild(void) {
18230     int test_ret = 0;
18231
18232     int mem_base;
18233     xmlNodePtr ret_val;
18234     xmlNodePtr parent; /* the parent node */
18235     int n_parent;
18236     xmlNodePtr cur; /* the child node */
18237     int n_cur;
18238
18239     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18240     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18241         mem_base = xmlMemBlocks();
18242         parent = gen_xmlNodePtr(n_parent, 0);
18243         cur = gen_xmlNodePtr_in(n_cur, 1);
18244
18245         ret_val = xmlAddChild(parent, cur);
18246         if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
18247         desret_xmlNodePtr(ret_val);
18248         call_tests++;
18249         des_xmlNodePtr(n_parent, parent, 0);
18250         des_xmlNodePtr_in(n_cur, cur, 1);
18251         xmlResetLastError();
18252         if (mem_base != xmlMemBlocks()) {
18253             printf("Leak of %d blocks found in xmlAddChild",
18254                    xmlMemBlocks() - mem_base);
18255             test_ret++;
18256             printf(" %d", n_parent);
18257             printf(" %d", n_cur);
18258             printf("\n");
18259         }
18260     }
18261     }
18262     function_tests++;
18263
18264     return(test_ret);
18265 }
18266
18267
18268 static int
18269 test_xmlAddChildList(void) {
18270     int test_ret = 0;
18271
18272     int mem_base;
18273     xmlNodePtr ret_val;
18274     xmlNodePtr parent; /* the parent node */
18275     int n_parent;
18276     xmlNodePtr cur; /* the first node in the list */
18277     int n_cur;
18278
18279     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18280     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18281         mem_base = xmlMemBlocks();
18282         parent = gen_xmlNodePtr(n_parent, 0);
18283         cur = gen_xmlNodePtr_in(n_cur, 1);
18284
18285         ret_val = xmlAddChildList(parent, cur);
18286         if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
18287         desret_xmlNodePtr(ret_val);
18288         call_tests++;
18289         des_xmlNodePtr(n_parent, parent, 0);
18290         des_xmlNodePtr_in(n_cur, cur, 1);
18291         xmlResetLastError();
18292         if (mem_base != xmlMemBlocks()) {
18293             printf("Leak of %d blocks found in xmlAddChildList",
18294                    xmlMemBlocks() - mem_base);
18295             test_ret++;
18296             printf(" %d", n_parent);
18297             printf(" %d", n_cur);
18298             printf("\n");
18299         }
18300     }
18301     }
18302     function_tests++;
18303
18304     return(test_ret);
18305 }
18306
18307
18308 static int
18309 test_xmlAddNextSibling(void) {
18310     int test_ret = 0;
18311
18312     int mem_base;
18313     xmlNodePtr ret_val;
18314     xmlNodePtr cur; /* the child node */
18315     int n_cur;
18316     xmlNodePtr elem; /* the new node */
18317     int n_elem;
18318
18319     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18320     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18321         mem_base = xmlMemBlocks();
18322         cur = gen_xmlNodePtr(n_cur, 0);
18323         elem = gen_xmlNodePtr_in(n_elem, 1);
18324
18325         ret_val = xmlAddNextSibling(cur, elem);
18326         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18327         desret_xmlNodePtr(ret_val);
18328         call_tests++;
18329         des_xmlNodePtr(n_cur, cur, 0);
18330         des_xmlNodePtr_in(n_elem, elem, 1);
18331         xmlResetLastError();
18332         if (mem_base != xmlMemBlocks()) {
18333             printf("Leak of %d blocks found in xmlAddNextSibling",
18334                    xmlMemBlocks() - mem_base);
18335             test_ret++;
18336             printf(" %d", n_cur);
18337             printf(" %d", n_elem);
18338             printf("\n");
18339         }
18340     }
18341     }
18342     function_tests++;
18343
18344     return(test_ret);
18345 }
18346
18347
18348 static int
18349 test_xmlAddPrevSibling(void) {
18350     int test_ret = 0;
18351
18352 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
18353     int mem_base;
18354     xmlNodePtr ret_val;
18355     xmlNodePtr cur; /* the child node */
18356     int n_cur;
18357     xmlNodePtr elem; /* the new node */
18358     int n_elem;
18359
18360     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18361     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18362         mem_base = xmlMemBlocks();
18363         cur = gen_xmlNodePtr(n_cur, 0);
18364         elem = gen_xmlNodePtr_in(n_elem, 1);
18365
18366         ret_val = xmlAddPrevSibling(cur, elem);
18367         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18368         desret_xmlNodePtr(ret_val);
18369         call_tests++;
18370         des_xmlNodePtr(n_cur, cur, 0);
18371         des_xmlNodePtr_in(n_elem, elem, 1);
18372         xmlResetLastError();
18373         if (mem_base != xmlMemBlocks()) {
18374             printf("Leak of %d blocks found in xmlAddPrevSibling",
18375                    xmlMemBlocks() - mem_base);
18376             test_ret++;
18377             printf(" %d", n_cur);
18378             printf(" %d", n_elem);
18379             printf("\n");
18380         }
18381     }
18382     }
18383     function_tests++;
18384 #endif
18385
18386     return(test_ret);
18387 }
18388
18389
18390 static int
18391 test_xmlAddSibling(void) {
18392     int test_ret = 0;
18393
18394     int mem_base;
18395     xmlNodePtr ret_val;
18396     xmlNodePtr cur; /* the child node */
18397     int n_cur;
18398     xmlNodePtr elem; /* the new node */
18399     int n_elem;
18400
18401     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18402     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18403         mem_base = xmlMemBlocks();
18404         cur = gen_xmlNodePtr(n_cur, 0);
18405         elem = gen_xmlNodePtr_in(n_elem, 1);
18406
18407         ret_val = xmlAddSibling(cur, elem);
18408         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18409         desret_xmlNodePtr(ret_val);
18410         call_tests++;
18411         des_xmlNodePtr(n_cur, cur, 0);
18412         des_xmlNodePtr_in(n_elem, elem, 1);
18413         xmlResetLastError();
18414         if (mem_base != xmlMemBlocks()) {
18415             printf("Leak of %d blocks found in xmlAddSibling",
18416                    xmlMemBlocks() - mem_base);
18417             test_ret++;
18418             printf(" %d", n_cur);
18419             printf(" %d", n_elem);
18420             printf("\n");
18421         }
18422     }
18423     }
18424     function_tests++;
18425
18426     return(test_ret);
18427 }
18428
18429
18430 static int
18431 test_xmlAttrSerializeTxtContent(void) {
18432     int test_ret = 0;
18433
18434 #if defined(LIBXML_OUTPUT_ENABLED)
18435 #ifdef LIBXML_OUTPUT_ENABLED
18436     int mem_base;
18437     xmlBufferPtr buf; /* the XML buffer output */
18438     int n_buf;
18439     xmlDocPtr doc; /* the document */
18440     int n_doc;
18441     xmlAttrPtr attr; /* the attribute node */
18442     int n_attr;
18443     xmlChar * string; /* the text content */
18444     int n_string;
18445
18446     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18447     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18448     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18449     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18450         mem_base = xmlMemBlocks();
18451         buf = gen_xmlBufferPtr(n_buf, 0);
18452         doc = gen_xmlDocPtr(n_doc, 1);
18453         attr = gen_xmlAttrPtr(n_attr, 2);
18454         string = gen_const_xmlChar_ptr(n_string, 3);
18455
18456         xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18457         call_tests++;
18458         des_xmlBufferPtr(n_buf, buf, 0);
18459         des_xmlDocPtr(n_doc, doc, 1);
18460         des_xmlAttrPtr(n_attr, attr, 2);
18461         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18462         xmlResetLastError();
18463         if (mem_base != xmlMemBlocks()) {
18464             printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18465                    xmlMemBlocks() - mem_base);
18466             test_ret++;
18467             printf(" %d", n_buf);
18468             printf(" %d", n_doc);
18469             printf(" %d", n_attr);
18470             printf(" %d", n_string);
18471             printf("\n");
18472         }
18473     }
18474     }
18475     }
18476     }
18477     function_tests++;
18478 #endif
18479 #endif
18480
18481     return(test_ret);
18482 }
18483
18484
18485 #define gen_nb_const_xmlBuf_ptr 1
18486 static xmlBuf * gen_const_xmlBuf_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18487     return(NULL);
18488 }
18489 static void des_const_xmlBuf_ptr(int no ATTRIBUTE_UNUSED, const xmlBuf * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18490 }
18491
18492 static int
18493 test_xmlBufContent(void) {
18494     int test_ret = 0;
18495
18496     int mem_base;
18497     xmlChar * ret_val;
18498     xmlBuf * buf; /* the buffer */
18499     int n_buf;
18500
18501     for (n_buf = 0;n_buf < gen_nb_const_xmlBuf_ptr;n_buf++) {
18502         mem_base = xmlMemBlocks();
18503         buf = gen_const_xmlBuf_ptr(n_buf, 0);
18504
18505         ret_val = xmlBufContent((const xmlBuf *)buf);
18506         desret_xmlChar_ptr(ret_val);
18507         call_tests++;
18508         des_const_xmlBuf_ptr(n_buf, (const xmlBuf *)buf, 0);
18509         xmlResetLastError();
18510         if (mem_base != xmlMemBlocks()) {
18511             printf("Leak of %d blocks found in xmlBufContent",
18512                    xmlMemBlocks() - mem_base);
18513             test_ret++;
18514             printf(" %d", n_buf);
18515             printf("\n");
18516         }
18517     }
18518     function_tests++;
18519
18520     return(test_ret);
18521 }
18522
18523
18524 #define gen_nb_xmlBufPtr 1
18525 static xmlBufPtr gen_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18526     return(NULL);
18527 }
18528 static void des_xmlBufPtr(int no ATTRIBUTE_UNUSED, xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18529 }
18530
18531 static int
18532 test_xmlBufEnd(void) {
18533     int test_ret = 0;
18534
18535     int mem_base;
18536     xmlChar * ret_val;
18537     xmlBufPtr buf; /* the buffer */
18538     int n_buf;
18539
18540     for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
18541         mem_base = xmlMemBlocks();
18542         buf = gen_xmlBufPtr(n_buf, 0);
18543
18544         ret_val = xmlBufEnd(buf);
18545         desret_xmlChar_ptr(ret_val);
18546         call_tests++;
18547         des_xmlBufPtr(n_buf, buf, 0);
18548         xmlResetLastError();
18549         if (mem_base != xmlMemBlocks()) {
18550             printf("Leak of %d blocks found in xmlBufEnd",
18551                    xmlMemBlocks() - mem_base);
18552             test_ret++;
18553             printf(" %d", n_buf);
18554             printf("\n");
18555         }
18556     }
18557     function_tests++;
18558
18559     return(test_ret);
18560 }
18561
18562
18563 #define gen_nb_const_xmlNode_ptr 1
18564 static xmlNode * gen_const_xmlNode_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18565     return(NULL);
18566 }
18567 static void des_const_xmlNode_ptr(int no ATTRIBUTE_UNUSED, const xmlNode * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18568 }
18569
18570 static int
18571 test_xmlBufGetNodeContent(void) {
18572     int test_ret = 0;
18573
18574     int mem_base;
18575     int ret_val;
18576     xmlBufPtr buf; /* a buffer xmlBufPtr */
18577     int n_buf;
18578     xmlNode * cur; /* the node being read */
18579     int n_cur;
18580
18581     for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
18582     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
18583         mem_base = xmlMemBlocks();
18584         buf = gen_xmlBufPtr(n_buf, 0);
18585         cur = gen_const_xmlNode_ptr(n_cur, 1);
18586
18587         ret_val = xmlBufGetNodeContent(buf, (const xmlNode *)cur);
18588         desret_int(ret_val);
18589         call_tests++;
18590         des_xmlBufPtr(n_buf, buf, 0);
18591         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
18592         xmlResetLastError();
18593         if (mem_base != xmlMemBlocks()) {
18594             printf("Leak of %d blocks found in xmlBufGetNodeContent",
18595                    xmlMemBlocks() - mem_base);
18596             test_ret++;
18597             printf(" %d", n_buf);
18598             printf(" %d", n_cur);
18599             printf("\n");
18600         }
18601     }
18602     }
18603     function_tests++;
18604
18605     return(test_ret);
18606 }
18607
18608
18609 static int
18610 test_xmlBufNodeDump(void) {
18611     int test_ret = 0;
18612
18613
18614     /* missing type support */
18615     return(test_ret);
18616 }
18617
18618
18619 static int
18620 test_xmlBufShrink(void) {
18621     int test_ret = 0;
18622
18623
18624     /* missing type support */
18625     return(test_ret);
18626 }
18627
18628
18629 #define gen_nb_const_xmlBufPtr 1
18630 static xmlBufPtr gen_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18631     return(NULL);
18632 }
18633 static void des_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, const xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18634 }
18635
18636 static int
18637 test_xmlBufUse(void) {
18638     int test_ret = 0;
18639
18640
18641     /* missing type support */
18642     return(test_ret);
18643 }
18644
18645
18646 static int
18647 test_xmlBufferAdd(void) {
18648     int test_ret = 0;
18649
18650     int mem_base;
18651     int ret_val;
18652     xmlBufferPtr buf; /* the buffer to dump */
18653     int n_buf;
18654     xmlChar * str; /* the #xmlChar string */
18655     int n_str;
18656     int len; /* the number of #xmlChar to add */
18657     int n_len;
18658
18659     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18660     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18661     for (n_len = 0;n_len < gen_nb_int;n_len++) {
18662         mem_base = xmlMemBlocks();
18663         buf = gen_xmlBufferPtr(n_buf, 0);
18664         str = gen_const_xmlChar_ptr(n_str, 1);
18665         len = gen_int(n_len, 2);
18666         if ((str != NULL) &&
18667             (len > (int) strlen((const char *) str) + 1))
18668             continue;
18669
18670         ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
18671         desret_int(ret_val);
18672         call_tests++;
18673         des_xmlBufferPtr(n_buf, buf, 0);
18674         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18675         des_int(n_len, len, 2);
18676         xmlResetLastError();
18677         if (mem_base != xmlMemBlocks()) {
18678             printf("Leak of %d blocks found in xmlBufferAdd",
18679                    xmlMemBlocks() - mem_base);
18680             test_ret++;
18681             printf(" %d", n_buf);
18682             printf(" %d", n_str);
18683             printf(" %d", n_len);
18684             printf("\n");
18685         }
18686     }
18687     }
18688     }
18689     function_tests++;
18690
18691     return(test_ret);
18692 }
18693
18694
18695 static int
18696 test_xmlBufferAddHead(void) {
18697     int test_ret = 0;
18698
18699     int mem_base;
18700     int ret_val;
18701     xmlBufferPtr buf; /* the buffer */
18702     int n_buf;
18703     xmlChar * str; /* the #xmlChar string */
18704     int n_str;
18705     int len; /* the number of #xmlChar to add */
18706     int n_len;
18707
18708     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18709     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18710     for (n_len = 0;n_len < gen_nb_int;n_len++) {
18711         mem_base = xmlMemBlocks();
18712         buf = gen_xmlBufferPtr(n_buf, 0);
18713         str = gen_const_xmlChar_ptr(n_str, 1);
18714         len = gen_int(n_len, 2);
18715         if ((str != NULL) &&
18716             (len > (int) strlen((const char *) str) + 1))
18717             continue;
18718
18719         ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
18720         desret_int(ret_val);
18721         call_tests++;
18722         des_xmlBufferPtr(n_buf, buf, 0);
18723         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18724         des_int(n_len, len, 2);
18725         xmlResetLastError();
18726         if (mem_base != xmlMemBlocks()) {
18727             printf("Leak of %d blocks found in xmlBufferAddHead",
18728                    xmlMemBlocks() - mem_base);
18729             test_ret++;
18730             printf(" %d", n_buf);
18731             printf(" %d", n_str);
18732             printf(" %d", n_len);
18733             printf("\n");
18734         }
18735     }
18736     }
18737     }
18738     function_tests++;
18739
18740     return(test_ret);
18741 }
18742
18743
18744 static int
18745 test_xmlBufferCCat(void) {
18746     int test_ret = 0;
18747
18748     int mem_base;
18749     int ret_val;
18750     xmlBufferPtr buf; /* the buffer to dump */
18751     int n_buf;
18752     char * str; /* the C char string */
18753     int n_str;
18754
18755     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18756     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
18757         mem_base = xmlMemBlocks();
18758         buf = gen_xmlBufferPtr(n_buf, 0);
18759         str = gen_const_char_ptr(n_str, 1);
18760
18761         ret_val = xmlBufferCCat(buf, (const char *)str);
18762         desret_int(ret_val);
18763         call_tests++;
18764         des_xmlBufferPtr(n_buf, buf, 0);
18765         des_const_char_ptr(n_str, (const char *)str, 1);
18766         xmlResetLastError();
18767         if (mem_base != xmlMemBlocks()) {
18768             printf("Leak of %d blocks found in xmlBufferCCat",
18769                    xmlMemBlocks() - mem_base);
18770             test_ret++;
18771             printf(" %d", n_buf);
18772             printf(" %d", n_str);
18773             printf("\n");
18774         }
18775     }
18776     }
18777     function_tests++;
18778
18779     return(test_ret);
18780 }
18781
18782
18783 static int
18784 test_xmlBufferCat(void) {
18785     int test_ret = 0;
18786
18787     int mem_base;
18788     int ret_val;
18789     xmlBufferPtr buf; /* the buffer to add to */
18790     int n_buf;
18791     xmlChar * str; /* the #xmlChar string */
18792     int n_str;
18793
18794     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18795     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18796         mem_base = xmlMemBlocks();
18797         buf = gen_xmlBufferPtr(n_buf, 0);
18798         str = gen_const_xmlChar_ptr(n_str, 1);
18799
18800         ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18801         desret_int(ret_val);
18802         call_tests++;
18803         des_xmlBufferPtr(n_buf, buf, 0);
18804         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18805         xmlResetLastError();
18806         if (mem_base != xmlMemBlocks()) {
18807             printf("Leak of %d blocks found in xmlBufferCat",
18808                    xmlMemBlocks() - mem_base);
18809             test_ret++;
18810             printf(" %d", n_buf);
18811             printf(" %d", n_str);
18812             printf("\n");
18813         }
18814     }
18815     }
18816     function_tests++;
18817
18818     return(test_ret);
18819 }
18820
18821
18822 #define gen_nb_const_xmlBuffer_ptr 1
18823 static xmlBuffer * gen_const_xmlBuffer_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18824     return(NULL);
18825 }
18826 static void des_const_xmlBuffer_ptr(int no ATTRIBUTE_UNUSED, const xmlBuffer * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18827 }
18828
18829 static int
18830 test_xmlBufferContent(void) {
18831     int test_ret = 0;
18832
18833     int mem_base;
18834     const xmlChar * ret_val;
18835     xmlBuffer * buf; /* the buffer */
18836     int n_buf;
18837
18838     for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) {
18839         mem_base = xmlMemBlocks();
18840         buf = gen_const_xmlBuffer_ptr(n_buf, 0);
18841
18842         ret_val = xmlBufferContent((const xmlBuffer *)buf);
18843         desret_const_xmlChar_ptr(ret_val);
18844         call_tests++;
18845         des_const_xmlBuffer_ptr(n_buf, (const xmlBuffer *)buf, 0);
18846         xmlResetLastError();
18847         if (mem_base != xmlMemBlocks()) {
18848             printf("Leak of %d blocks found in xmlBufferContent",
18849                    xmlMemBlocks() - mem_base);
18850             test_ret++;
18851             printf(" %d", n_buf);
18852             printf("\n");
18853         }
18854     }
18855     function_tests++;
18856
18857     return(test_ret);
18858 }
18859
18860
18861 static int
18862 test_xmlBufferCreate(void) {
18863     int test_ret = 0;
18864
18865     int mem_base;
18866     xmlBufferPtr ret_val;
18867
18868         mem_base = xmlMemBlocks();
18869
18870         ret_val = xmlBufferCreate();
18871         desret_xmlBufferPtr(ret_val);
18872         call_tests++;
18873         xmlResetLastError();
18874         if (mem_base != xmlMemBlocks()) {
18875             printf("Leak of %d blocks found in xmlBufferCreate",
18876                    xmlMemBlocks() - mem_base);
18877             test_ret++;
18878             printf("\n");
18879         }
18880     function_tests++;
18881
18882     return(test_ret);
18883 }
18884
18885
18886 static int
18887 test_xmlBufferCreateSize(void) {
18888     int test_ret = 0;
18889
18890
18891     /* missing type support */
18892     return(test_ret);
18893 }
18894
18895
18896 static int
18897 test_xmlBufferCreateStatic(void) {
18898     int test_ret = 0;
18899
18900
18901     /* missing type support */
18902     return(test_ret);
18903 }
18904
18905
18906 static int
18907 test_xmlBufferDetach(void) {
18908     int test_ret = 0;
18909
18910     int mem_base;
18911     xmlChar * ret_val;
18912     xmlBufferPtr buf; /* the buffer */
18913     int n_buf;
18914
18915     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18916         mem_base = xmlMemBlocks();
18917         buf = gen_xmlBufferPtr(n_buf, 0);
18918
18919         ret_val = xmlBufferDetach(buf);
18920         desret_xmlChar_ptr(ret_val);
18921         call_tests++;
18922         des_xmlBufferPtr(n_buf, buf, 0);
18923         xmlResetLastError();
18924         if (mem_base != xmlMemBlocks()) {
18925             printf("Leak of %d blocks found in xmlBufferDetach",
18926                    xmlMemBlocks() - mem_base);
18927             test_ret++;
18928             printf(" %d", n_buf);
18929             printf("\n");
18930         }
18931     }
18932     function_tests++;
18933
18934     return(test_ret);
18935 }
18936
18937
18938 static int
18939 test_xmlBufferEmpty(void) {
18940     int test_ret = 0;
18941
18942     int mem_base;
18943     xmlBufferPtr buf; /* the buffer */
18944     int n_buf;
18945
18946     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18947         mem_base = xmlMemBlocks();
18948         buf = gen_xmlBufferPtr(n_buf, 0);
18949
18950         xmlBufferEmpty(buf);
18951         call_tests++;
18952         des_xmlBufferPtr(n_buf, buf, 0);
18953         xmlResetLastError();
18954         if (mem_base != xmlMemBlocks()) {
18955             printf("Leak of %d blocks found in xmlBufferEmpty",
18956                    xmlMemBlocks() - mem_base);
18957             test_ret++;
18958             printf(" %d", n_buf);
18959             printf("\n");
18960         }
18961     }
18962     function_tests++;
18963
18964     return(test_ret);
18965 }
18966
18967
18968 static int
18969 test_xmlBufferGrow(void) {
18970     int test_ret = 0;
18971
18972     int mem_base;
18973     int ret_val;
18974     xmlBufferPtr buf; /* the buffer */
18975     int n_buf;
18976     unsigned int len; /* the minimum free size to allocate */
18977     int n_len;
18978
18979     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18980     for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18981         mem_base = xmlMemBlocks();
18982         buf = gen_xmlBufferPtr(n_buf, 0);
18983         len = gen_unsigned_int(n_len, 1);
18984
18985         ret_val = xmlBufferGrow(buf, len);
18986         desret_int(ret_val);
18987         call_tests++;
18988         des_xmlBufferPtr(n_buf, buf, 0);
18989         des_unsigned_int(n_len, len, 1);
18990         xmlResetLastError();
18991         if (mem_base != xmlMemBlocks()) {
18992             printf("Leak of %d blocks found in xmlBufferGrow",
18993                    xmlMemBlocks() - mem_base);
18994             test_ret++;
18995             printf(" %d", n_buf);
18996             printf(" %d", n_len);
18997             printf("\n");
18998         }
18999     }
19000     }
19001     function_tests++;
19002
19003     return(test_ret);
19004 }
19005
19006
19007 static int
19008 test_xmlBufferLength(void) {
19009     int test_ret = 0;
19010
19011     int mem_base;
19012     int ret_val;
19013     xmlBuffer * buf; /* the buffer */
19014     int n_buf;
19015
19016     for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) {
19017         mem_base = xmlMemBlocks();
19018         buf = gen_const_xmlBuffer_ptr(n_buf, 0);
19019
19020         ret_val = xmlBufferLength((const xmlBuffer *)buf);
19021         desret_int(ret_val);
19022         call_tests++;
19023         des_const_xmlBuffer_ptr(n_buf, (const xmlBuffer *)buf, 0);
19024         xmlResetLastError();
19025         if (mem_base != xmlMemBlocks()) {
19026             printf("Leak of %d blocks found in xmlBufferLength",
19027                    xmlMemBlocks() - mem_base);
19028             test_ret++;
19029             printf(" %d", n_buf);
19030             printf("\n");
19031         }
19032     }
19033     function_tests++;
19034
19035     return(test_ret);
19036 }
19037
19038
19039 static int
19040 test_xmlBufferResize(void) {
19041     int test_ret = 0;
19042
19043     int mem_base;
19044     int ret_val;
19045     xmlBufferPtr buf; /* the buffer to resize */
19046     int n_buf;
19047     unsigned int size; /* the desired size */
19048     int n_size;
19049
19050     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19051     for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
19052         mem_base = xmlMemBlocks();
19053         buf = gen_xmlBufferPtr(n_buf, 0);
19054         size = gen_unsigned_int(n_size, 1);
19055
19056         ret_val = xmlBufferResize(buf, size);
19057         desret_int(ret_val);
19058         call_tests++;
19059         des_xmlBufferPtr(n_buf, buf, 0);
19060         des_unsigned_int(n_size, size, 1);
19061         xmlResetLastError();
19062         if (mem_base != xmlMemBlocks()) {
19063             printf("Leak of %d blocks found in xmlBufferResize",
19064                    xmlMemBlocks() - mem_base);
19065             test_ret++;
19066             printf(" %d", n_buf);
19067             printf(" %d", n_size);
19068             printf("\n");
19069         }
19070     }
19071     }
19072     function_tests++;
19073
19074     return(test_ret);
19075 }
19076
19077
19078 static int
19079 test_xmlBufferSetAllocationScheme(void) {
19080     int test_ret = 0;
19081
19082     int mem_base;
19083     xmlBufferPtr buf; /* the buffer to tune */
19084     int n_buf;
19085     xmlBufferAllocationScheme scheme; /* allocation scheme to use */
19086     int n_scheme;
19087
19088     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19089     for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
19090         mem_base = xmlMemBlocks();
19091         buf = gen_xmlBufferPtr(n_buf, 0);
19092         scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
19093
19094         xmlBufferSetAllocationScheme(buf, scheme);
19095         if ((buf != NULL) && (scheme == XML_BUFFER_ALLOC_IMMUTABLE) && (buf->content != NULL) && (buf->content != static_buf_content)) { xmlFree(buf->content); buf->content = NULL;}
19096         call_tests++;
19097         des_xmlBufferPtr(n_buf, buf, 0);
19098         des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
19099         xmlResetLastError();
19100         if (mem_base != xmlMemBlocks()) {
19101             printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
19102                    xmlMemBlocks() - mem_base);
19103             test_ret++;
19104             printf(" %d", n_buf);
19105             printf(" %d", n_scheme);
19106             printf("\n");
19107         }
19108     }
19109     }
19110     function_tests++;
19111
19112     return(test_ret);
19113 }
19114
19115
19116 static int
19117 test_xmlBufferShrink(void) {
19118     int test_ret = 0;
19119
19120     int mem_base;
19121     int ret_val;
19122     xmlBufferPtr buf; /* the buffer to dump */
19123     int n_buf;
19124     unsigned int len; /* the number of xmlChar to remove */
19125     int n_len;
19126
19127     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19128     for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
19129         mem_base = xmlMemBlocks();
19130         buf = gen_xmlBufferPtr(n_buf, 0);
19131         len = gen_unsigned_int(n_len, 1);
19132
19133         ret_val = xmlBufferShrink(buf, len);
19134         desret_int(ret_val);
19135         call_tests++;
19136         des_xmlBufferPtr(n_buf, buf, 0);
19137         des_unsigned_int(n_len, len, 1);
19138         xmlResetLastError();
19139         if (mem_base != xmlMemBlocks()) {
19140             printf("Leak of %d blocks found in xmlBufferShrink",
19141                    xmlMemBlocks() - mem_base);
19142             test_ret++;
19143             printf(" %d", n_buf);
19144             printf(" %d", n_len);
19145             printf("\n");
19146         }
19147     }
19148     }
19149     function_tests++;
19150
19151     return(test_ret);
19152 }
19153
19154
19155 static int
19156 test_xmlBufferWriteCHAR(void) {
19157     int test_ret = 0;
19158
19159     int mem_base;
19160     xmlBufferPtr buf; /* the XML buffer */
19161     int n_buf;
19162     xmlChar * string; /* the string to add */
19163     int n_string;
19164
19165     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19166     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
19167         mem_base = xmlMemBlocks();
19168         buf = gen_xmlBufferPtr(n_buf, 0);
19169         string = gen_const_xmlChar_ptr(n_string, 1);
19170
19171         xmlBufferWriteCHAR(buf, (const xmlChar *)string);
19172         call_tests++;
19173         des_xmlBufferPtr(n_buf, buf, 0);
19174         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
19175         xmlResetLastError();
19176         if (mem_base != xmlMemBlocks()) {
19177             printf("Leak of %d blocks found in xmlBufferWriteCHAR",
19178                    xmlMemBlocks() - mem_base);
19179             test_ret++;
19180             printf(" %d", n_buf);
19181             printf(" %d", n_string);
19182             printf("\n");
19183         }
19184     }
19185     }
19186     function_tests++;
19187
19188     return(test_ret);
19189 }
19190
19191
19192 static int
19193 test_xmlBufferWriteChar(void) {
19194     int test_ret = 0;
19195
19196     int mem_base;
19197     xmlBufferPtr buf; /* the XML buffer output */
19198     int n_buf;
19199     char * string; /* the string to add */
19200     int n_string;
19201
19202     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19203     for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
19204         mem_base = xmlMemBlocks();
19205         buf = gen_xmlBufferPtr(n_buf, 0);
19206         string = gen_const_char_ptr(n_string, 1);
19207
19208         xmlBufferWriteChar(buf, (const char *)string);
19209         call_tests++;
19210         des_xmlBufferPtr(n_buf, buf, 0);
19211         des_const_char_ptr(n_string, (const char *)string, 1);
19212         xmlResetLastError();
19213         if (mem_base != xmlMemBlocks()) {
19214             printf("Leak of %d blocks found in xmlBufferWriteChar",
19215                    xmlMemBlocks() - mem_base);
19216             test_ret++;
19217             printf(" %d", n_buf);
19218             printf(" %d", n_string);
19219             printf("\n");
19220         }
19221     }
19222     }
19223     function_tests++;
19224
19225     return(test_ret);
19226 }
19227
19228
19229 static int
19230 test_xmlBufferWriteQuotedString(void) {
19231     int test_ret = 0;
19232
19233     int mem_base;
19234     xmlBufferPtr buf; /* the XML buffer output */
19235     int n_buf;
19236     xmlChar * string; /* the string to add */
19237     int n_string;
19238
19239     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19240     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
19241         mem_base = xmlMemBlocks();
19242         buf = gen_xmlBufferPtr(n_buf, 0);
19243         string = gen_const_xmlChar_ptr(n_string, 1);
19244
19245         xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
19246         call_tests++;
19247         des_xmlBufferPtr(n_buf, buf, 0);
19248         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
19249         xmlResetLastError();
19250         if (mem_base != xmlMemBlocks()) {
19251             printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
19252                    xmlMemBlocks() - mem_base);
19253             test_ret++;
19254             printf(" %d", n_buf);
19255             printf(" %d", n_string);
19256             printf("\n");
19257         }
19258     }
19259     }
19260     function_tests++;
19261
19262     return(test_ret);
19263 }
19264
19265
19266 static int
19267 test_xmlBuildQName(void) {
19268     int test_ret = 0;
19269
19270     int mem_base;
19271     xmlChar * ret_val;
19272     xmlChar * ncname; /* the Name */
19273     int n_ncname;
19274     xmlChar * prefix; /* the prefix */
19275     int n_prefix;
19276     xmlChar * memory; /* preallocated memory */
19277     int n_memory;
19278     int len; /* preallocated memory length */
19279     int n_len;
19280
19281     for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
19282     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
19283     for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
19284     for (n_len = 0;n_len < gen_nb_int;n_len++) {
19285         mem_base = xmlMemBlocks();
19286         ncname = gen_const_xmlChar_ptr(n_ncname, 0);
19287         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
19288         memory = gen_xmlChar_ptr(n_memory, 2);
19289         len = gen_int(n_len, 3);
19290         if ((prefix != NULL) &&
19291             (len > (int) strlen((const char *) prefix) + 1))
19292             continue;
19293
19294         ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
19295         if ((ret_val != NULL) && (ret_val != ncname) &&
19296               (ret_val != prefix) && (ret_val != memory))
19297               xmlFree(ret_val);
19298           ret_val = NULL;
19299         desret_xmlChar_ptr(ret_val);
19300         call_tests++;
19301         des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
19302         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
19303         des_xmlChar_ptr(n_memory, memory, 2);
19304         des_int(n_len, len, 3);
19305         xmlResetLastError();
19306         if (mem_base != xmlMemBlocks()) {
19307             printf("Leak of %d blocks found in xmlBuildQName",
19308                    xmlMemBlocks() - mem_base);
19309             test_ret++;
19310             printf(" %d", n_ncname);
19311             printf(" %d", n_prefix);
19312             printf(" %d", n_memory);
19313             printf(" %d", n_len);
19314             printf("\n");
19315         }
19316     }
19317     }
19318     }
19319     }
19320     function_tests++;
19321
19322     return(test_ret);
19323 }
19324
19325
19326 static int
19327 test_xmlChildElementCount(void) {
19328     int test_ret = 0;
19329
19330 #if defined(LIBXML_TREE_ENABLED)
19331     int mem_base;
19332     unsigned long ret_val;
19333     xmlNodePtr parent; /* the parent node */
19334     int n_parent;
19335
19336     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19337         mem_base = xmlMemBlocks();
19338         parent = gen_xmlNodePtr(n_parent, 0);
19339
19340         ret_val = xmlChildElementCount(parent);
19341         desret_unsigned_long(ret_val);
19342         call_tests++;
19343         des_xmlNodePtr(n_parent, parent, 0);
19344         xmlResetLastError();
19345         if (mem_base != xmlMemBlocks()) {
19346             printf("Leak of %d blocks found in xmlChildElementCount",
19347                    xmlMemBlocks() - mem_base);
19348             test_ret++;
19349             printf(" %d", n_parent);
19350             printf("\n");
19351         }
19352     }
19353     function_tests++;
19354 #endif
19355
19356     return(test_ret);
19357 }
19358
19359
19360 static int
19361 test_xmlCopyDoc(void) {
19362     int test_ret = 0;
19363
19364 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
19365     int mem_base;
19366     xmlDocPtr ret_val;
19367     xmlDocPtr doc; /* the document */
19368     int n_doc;
19369     int recursive; /* if not zero do a recursive copy. */
19370     int n_recursive;
19371
19372     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19373     for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
19374         mem_base = xmlMemBlocks();
19375         doc = gen_xmlDocPtr(n_doc, 0);
19376         recursive = gen_int(n_recursive, 1);
19377
19378         ret_val = xmlCopyDoc(doc, recursive);
19379         desret_xmlDocPtr(ret_val);
19380         call_tests++;
19381         des_xmlDocPtr(n_doc, doc, 0);
19382         des_int(n_recursive, recursive, 1);
19383         xmlResetLastError();
19384         if (mem_base != xmlMemBlocks()) {
19385             printf("Leak of %d blocks found in xmlCopyDoc",
19386                    xmlMemBlocks() - mem_base);
19387             test_ret++;
19388             printf(" %d", n_doc);
19389             printf(" %d", n_recursive);
19390             printf("\n");
19391         }
19392     }
19393     }
19394     function_tests++;
19395 #endif
19396
19397     return(test_ret);
19398 }
19399
19400
19401 static int
19402 test_xmlCopyDtd(void) {
19403     int test_ret = 0;
19404
19405 #if defined(LIBXML_TREE_ENABLED)
19406     int mem_base;
19407     xmlDtdPtr ret_val;
19408     xmlDtdPtr dtd; /* the dtd */
19409     int n_dtd;
19410
19411     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
19412         mem_base = xmlMemBlocks();
19413         dtd = gen_xmlDtdPtr(n_dtd, 0);
19414
19415         ret_val = xmlCopyDtd(dtd);
19416         desret_xmlDtdPtr(ret_val);
19417         call_tests++;
19418         des_xmlDtdPtr(n_dtd, dtd, 0);
19419         xmlResetLastError();
19420         if (mem_base != xmlMemBlocks()) {
19421             printf("Leak of %d blocks found in xmlCopyDtd",
19422                    xmlMemBlocks() - mem_base);
19423             test_ret++;
19424             printf(" %d", n_dtd);
19425             printf("\n");
19426         }
19427     }
19428     function_tests++;
19429 #endif
19430
19431     return(test_ret);
19432 }
19433
19434
19435 static int
19436 test_xmlCopyNamespace(void) {
19437     int test_ret = 0;
19438
19439     int mem_base;
19440     xmlNsPtr ret_val;
19441     xmlNsPtr cur; /* the namespace */
19442     int n_cur;
19443
19444     for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19445         mem_base = xmlMemBlocks();
19446         cur = gen_xmlNsPtr(n_cur, 0);
19447
19448         ret_val = xmlCopyNamespace(cur);
19449         if (ret_val != NULL) xmlFreeNs(ret_val);
19450         desret_xmlNsPtr(ret_val);
19451         call_tests++;
19452         des_xmlNsPtr(n_cur, cur, 0);
19453         xmlResetLastError();
19454         if (mem_base != xmlMemBlocks()) {
19455             printf("Leak of %d blocks found in xmlCopyNamespace",
19456                    xmlMemBlocks() - mem_base);
19457             test_ret++;
19458             printf(" %d", n_cur);
19459             printf("\n");
19460         }
19461     }
19462     function_tests++;
19463
19464     return(test_ret);
19465 }
19466
19467
19468 static int
19469 test_xmlCopyNamespaceList(void) {
19470     int test_ret = 0;
19471
19472     int mem_base;
19473     xmlNsPtr ret_val;
19474     xmlNsPtr cur; /* the first namespace */
19475     int n_cur;
19476
19477     for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19478         mem_base = xmlMemBlocks();
19479         cur = gen_xmlNsPtr(n_cur, 0);
19480
19481         ret_val = xmlCopyNamespaceList(cur);
19482         if (ret_val != NULL) xmlFreeNsList(ret_val);
19483         desret_xmlNsPtr(ret_val);
19484         call_tests++;
19485         des_xmlNsPtr(n_cur, cur, 0);
19486         xmlResetLastError();
19487         if (mem_base != xmlMemBlocks()) {
19488             printf("Leak of %d blocks found in xmlCopyNamespaceList",
19489                    xmlMemBlocks() - mem_base);
19490             test_ret++;
19491             printf(" %d", n_cur);
19492             printf("\n");
19493         }
19494     }
19495     function_tests++;
19496
19497     return(test_ret);
19498 }
19499
19500
19501 static int
19502 test_xmlCopyNode(void) {
19503     int test_ret = 0;
19504
19505     int mem_base;
19506     xmlNodePtr ret_val;
19507     xmlNodePtr node; /* the node */
19508     int n_node;
19509     int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19510     int n_extended;
19511
19512     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19513     for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19514         mem_base = xmlMemBlocks();
19515         node = gen_xmlNodePtr(n_node, 0);
19516         extended = gen_int(n_extended, 1);
19517
19518         ret_val = xmlCopyNode(node, extended);
19519         desret_xmlNodePtr(ret_val);
19520         call_tests++;
19521         des_xmlNodePtr(n_node, node, 0);
19522         des_int(n_extended, extended, 1);
19523         xmlResetLastError();
19524         if (mem_base != xmlMemBlocks()) {
19525             printf("Leak of %d blocks found in xmlCopyNode",
19526                    xmlMemBlocks() - mem_base);
19527             test_ret++;
19528             printf(" %d", n_node);
19529             printf(" %d", n_extended);
19530             printf("\n");
19531         }
19532     }
19533     }
19534     function_tests++;
19535
19536     return(test_ret);
19537 }
19538
19539
19540 static int
19541 test_xmlCopyNodeList(void) {
19542     int test_ret = 0;
19543
19544     int mem_base;
19545     xmlNodePtr ret_val;
19546     xmlNodePtr node; /* the first node in the list. */
19547     int n_node;
19548
19549     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19550         mem_base = xmlMemBlocks();
19551         node = gen_xmlNodePtr(n_node, 0);
19552
19553         ret_val = xmlCopyNodeList(node);
19554         desret_xmlNodePtr(ret_val);
19555         call_tests++;
19556         des_xmlNodePtr(n_node, node, 0);
19557         xmlResetLastError();
19558         if (mem_base != xmlMemBlocks()) {
19559             printf("Leak of %d blocks found in xmlCopyNodeList",
19560                    xmlMemBlocks() - mem_base);
19561             test_ret++;
19562             printf(" %d", n_node);
19563             printf("\n");
19564         }
19565     }
19566     function_tests++;
19567
19568     return(test_ret);
19569 }
19570
19571
19572 static int
19573 test_xmlCopyProp(void) {
19574     int test_ret = 0;
19575
19576     int mem_base;
19577     xmlAttrPtr ret_val;
19578     xmlNodePtr target; /* the element where the attribute will be grafted */
19579     int n_target;
19580     xmlAttrPtr cur; /* the attribute */
19581     int n_cur;
19582
19583     for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19584     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19585         mem_base = xmlMemBlocks();
19586         target = gen_xmlNodePtr(n_target, 0);
19587         cur = gen_xmlAttrPtr(n_cur, 1);
19588
19589         ret_val = xmlCopyProp(target, cur);
19590         desret_xmlAttrPtr(ret_val);
19591         call_tests++;
19592         des_xmlNodePtr(n_target, target, 0);
19593         des_xmlAttrPtr(n_cur, cur, 1);
19594         xmlResetLastError();
19595         if (mem_base != xmlMemBlocks()) {
19596             printf("Leak of %d blocks found in xmlCopyProp",
19597                    xmlMemBlocks() - mem_base);
19598             test_ret++;
19599             printf(" %d", n_target);
19600             printf(" %d", n_cur);
19601             printf("\n");
19602         }
19603     }
19604     }
19605     function_tests++;
19606
19607     return(test_ret);
19608 }
19609
19610
19611 static int
19612 test_xmlCopyPropList(void) {
19613     int test_ret = 0;
19614
19615     int mem_base;
19616     xmlAttrPtr ret_val;
19617     xmlNodePtr target; /* the element where the attributes will be grafted */
19618     int n_target;
19619     xmlAttrPtr cur; /* the first attribute */
19620     int n_cur;
19621
19622     for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19623     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19624         mem_base = xmlMemBlocks();
19625         target = gen_xmlNodePtr(n_target, 0);
19626         cur = gen_xmlAttrPtr(n_cur, 1);
19627
19628         ret_val = xmlCopyPropList(target, cur);
19629         desret_xmlAttrPtr(ret_val);
19630         call_tests++;
19631         des_xmlNodePtr(n_target, target, 0);
19632         des_xmlAttrPtr(n_cur, cur, 1);
19633         xmlResetLastError();
19634         if (mem_base != xmlMemBlocks()) {
19635             printf("Leak of %d blocks found in xmlCopyPropList",
19636                    xmlMemBlocks() - mem_base);
19637             test_ret++;
19638             printf(" %d", n_target);
19639             printf(" %d", n_cur);
19640             printf("\n");
19641         }
19642     }
19643     }
19644     function_tests++;
19645
19646     return(test_ret);
19647 }
19648
19649
19650 static int
19651 test_xmlCreateIntSubset(void) {
19652     int test_ret = 0;
19653
19654     int mem_base;
19655     xmlDtdPtr ret_val;
19656     xmlDocPtr doc; /* the document pointer */
19657     int n_doc;
19658     xmlChar * name; /* the DTD name */
19659     int n_name;
19660     xmlChar * ExternalID; /* the external (PUBLIC) ID */
19661     int n_ExternalID;
19662     xmlChar * SystemID; /* the system ID */
19663     int n_SystemID;
19664
19665     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19666     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19667     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
19668     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
19669         mem_base = xmlMemBlocks();
19670         doc = gen_xmlDocPtr(n_doc, 0);
19671         name = gen_const_xmlChar_ptr(n_name, 1);
19672         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
19673         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
19674
19675         ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
19676         desret_xmlDtdPtr(ret_val);
19677         call_tests++;
19678         des_xmlDocPtr(n_doc, doc, 0);
19679         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19680         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
19681         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
19682         xmlResetLastError();
19683         if (mem_base != xmlMemBlocks()) {
19684             printf("Leak of %d blocks found in xmlCreateIntSubset",
19685                    xmlMemBlocks() - mem_base);
19686             test_ret++;
19687             printf(" %d", n_doc);
19688             printf(" %d", n_name);
19689             printf(" %d", n_ExternalID);
19690             printf(" %d", n_SystemID);
19691             printf("\n");
19692         }
19693     }
19694     }
19695     }
19696     }
19697     function_tests++;
19698
19699     return(test_ret);
19700 }
19701
19702
19703 #define gen_nb_xmlDOMWrapCtxtPtr 1
19704 static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19705     return(NULL);
19706 }
19707 static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19708 }
19709
19710 static int
19711 test_xmlDOMWrapAdoptNode(void) {
19712     int test_ret = 0;
19713
19714     int mem_base;
19715     int ret_val;
19716     xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19717     int n_ctxt;
19718     xmlDocPtr sourceDoc; /* the optional sourceDoc */
19719     int n_sourceDoc;
19720     xmlNodePtr node; /* the node to start with */
19721     int n_node;
19722     xmlDocPtr destDoc; /* the destination doc */
19723     int n_destDoc;
19724     xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19725     int n_destParent;
19726     int options; /* option flags */
19727     int n_options;
19728
19729     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19730     for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19731     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19732     for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19733     for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19734     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19735         mem_base = xmlMemBlocks();
19736         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19737         sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19738         node = gen_xmlNodePtr(n_node, 2);
19739         destDoc = gen_xmlDocPtr(n_destDoc, 3);
19740         destParent = gen_xmlNodePtr(n_destParent, 4);
19741         options = gen_int(n_options, 5);
19742
19743         ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
19744         if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
19745         desret_int(ret_val);
19746         call_tests++;
19747         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19748         des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19749         des_xmlNodePtr(n_node, node, 2);
19750         des_xmlDocPtr(n_destDoc, destDoc, 3);
19751         des_xmlNodePtr(n_destParent, destParent, 4);
19752         des_int(n_options, options, 5);
19753         xmlResetLastError();
19754         if (mem_base != xmlMemBlocks()) {
19755             printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
19756                    xmlMemBlocks() - mem_base);
19757             test_ret++;
19758             printf(" %d", n_ctxt);
19759             printf(" %d", n_sourceDoc);
19760             printf(" %d", n_node);
19761             printf(" %d", n_destDoc);
19762             printf(" %d", n_destParent);
19763             printf(" %d", n_options);
19764             printf("\n");
19765         }
19766     }
19767     }
19768     }
19769     }
19770     }
19771     }
19772     function_tests++;
19773
19774     return(test_ret);
19775 }
19776
19777
19778 static int
19779 test_xmlDOMWrapCloneNode(void) {
19780     int test_ret = 0;
19781
19782     int mem_base;
19783     int ret_val;
19784     xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19785     int n_ctxt;
19786     xmlDocPtr sourceDoc; /* the optional sourceDoc */
19787     int n_sourceDoc;
19788     xmlNodePtr node; /* the node to start with */
19789     int n_node;
19790     xmlNodePtr * resNode; /* the clone of the given @node */
19791     int n_resNode;
19792     xmlDocPtr destDoc; /* the destination doc */
19793     int n_destDoc;
19794     xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19795     int n_destParent;
19796     int deep; /* descend into child if set */
19797     int n_deep;
19798     int options; /* option flags */
19799     int n_options;
19800
19801     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19802     for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19803     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19804     for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
19805     for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19806     for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19807     for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
19808     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19809         mem_base = xmlMemBlocks();
19810         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19811         sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19812         node = gen_xmlNodePtr(n_node, 2);
19813         resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
19814         destDoc = gen_xmlDocPtr(n_destDoc, 4);
19815         destParent = gen_xmlNodePtr(n_destParent, 5);
19816         deep = gen_int(n_deep, 6);
19817         options = gen_int(n_options, 7);
19818
19819         ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
19820         desret_int(ret_val);
19821         call_tests++;
19822         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19823         des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19824         des_xmlNodePtr(n_node, node, 2);
19825         des_xmlNodePtr_ptr(n_resNode, resNode, 3);
19826         des_xmlDocPtr(n_destDoc, destDoc, 4);
19827         des_xmlNodePtr(n_destParent, destParent, 5);
19828         des_int(n_deep, deep, 6);
19829         des_int(n_options, options, 7);
19830         xmlResetLastError();
19831         if (mem_base != xmlMemBlocks()) {
19832             printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
19833                    xmlMemBlocks() - mem_base);
19834             test_ret++;
19835             printf(" %d", n_ctxt);
19836             printf(" %d", n_sourceDoc);
19837             printf(" %d", n_node);
19838             printf(" %d", n_resNode);
19839             printf(" %d", n_destDoc);
19840             printf(" %d", n_destParent);
19841             printf(" %d", n_deep);
19842             printf(" %d", n_options);
19843             printf("\n");
19844         }
19845     }
19846     }
19847     }
19848     }
19849     }
19850     }
19851     }
19852     }
19853     function_tests++;
19854
19855     return(test_ret);
19856 }
19857
19858
19859 static int
19860 test_xmlDOMWrapNewCtxt(void) {
19861     int test_ret = 0;
19862
19863
19864     /* missing type support */
19865     return(test_ret);
19866 }
19867
19868
19869 static int
19870 test_xmlDOMWrapReconcileNamespaces(void) {
19871     int test_ret = 0;
19872
19873     int mem_base;
19874     int ret_val;
19875     xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
19876     int n_ctxt;
19877     xmlNodePtr elem; /* the element-node */
19878     int n_elem;
19879     int options; /* option flags */
19880     int n_options;
19881
19882     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19883     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
19884     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19885         mem_base = xmlMemBlocks();
19886         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19887         elem = gen_xmlNodePtr(n_elem, 1);
19888         options = gen_int(n_options, 2);
19889
19890         ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
19891         desret_int(ret_val);
19892         call_tests++;
19893         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19894         des_xmlNodePtr(n_elem, elem, 1);
19895         des_int(n_options, options, 2);
19896         xmlResetLastError();
19897         if (mem_base != xmlMemBlocks()) {
19898             printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
19899                    xmlMemBlocks() - mem_base);
19900             test_ret++;
19901             printf(" %d", n_ctxt);
19902             printf(" %d", n_elem);
19903             printf(" %d", n_options);
19904             printf("\n");
19905         }
19906     }
19907     }
19908     }
19909     function_tests++;
19910
19911     return(test_ret);
19912 }
19913
19914
19915 static int
19916 test_xmlDOMWrapRemoveNode(void) {
19917     int test_ret = 0;
19918
19919     int mem_base;
19920     int ret_val;
19921     xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
19922     int n_ctxt;
19923     xmlDocPtr doc; /* the doc */
19924     int n_doc;
19925     xmlNodePtr node; /* the node to be removed. */
19926     int n_node;
19927     int options; /* set of options, unused at the moment */
19928     int n_options;
19929
19930     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19931     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19932     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19933     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19934         mem_base = xmlMemBlocks();
19935         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19936         doc = gen_xmlDocPtr(n_doc, 1);
19937         node = gen_xmlNodePtr(n_node, 2);
19938         options = gen_int(n_options, 3);
19939
19940         ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
19941         desret_int(ret_val);
19942         call_tests++;
19943         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19944         des_xmlDocPtr(n_doc, doc, 1);
19945         des_xmlNodePtr(n_node, node, 2);
19946         des_int(n_options, options, 3);
19947         xmlResetLastError();
19948         if (mem_base != xmlMemBlocks()) {
19949             printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
19950                    xmlMemBlocks() - mem_base);
19951             test_ret++;
19952             printf(" %d", n_ctxt);
19953             printf(" %d", n_doc);
19954             printf(" %d", n_node);
19955             printf(" %d", n_options);
19956             printf("\n");
19957         }
19958     }
19959     }
19960     }
19961     }
19962     function_tests++;
19963
19964     return(test_ret);
19965 }
19966
19967
19968 static int
19969 test_xmlDocCopyNode(void) {
19970     int test_ret = 0;
19971
19972     int mem_base;
19973     xmlNodePtr ret_val;
19974     xmlNodePtr node; /* the node */
19975     int n_node;
19976     xmlDocPtr doc; /* the document */
19977     int n_doc;
19978     int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19979     int n_extended;
19980
19981     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19982     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19983     for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19984         mem_base = xmlMemBlocks();
19985         node = gen_xmlNodePtr(n_node, 0);
19986         doc = gen_xmlDocPtr(n_doc, 1);
19987         extended = gen_int(n_extended, 2);
19988
19989         ret_val = xmlDocCopyNode(node, doc, extended);
19990         desret_xmlNodePtr(ret_val);
19991         call_tests++;
19992         des_xmlNodePtr(n_node, node, 0);
19993         des_xmlDocPtr(n_doc, doc, 1);
19994         des_int(n_extended, extended, 2);
19995         xmlResetLastError();
19996         if (mem_base != xmlMemBlocks()) {
19997             printf("Leak of %d blocks found in xmlDocCopyNode",
19998                    xmlMemBlocks() - mem_base);
19999             test_ret++;
20000             printf(" %d", n_node);
20001             printf(" %d", n_doc);
20002             printf(" %d", n_extended);
20003             printf("\n");
20004         }
20005     }
20006     }
20007     }
20008     function_tests++;
20009
20010     return(test_ret);
20011 }
20012
20013
20014 static int
20015 test_xmlDocCopyNodeList(void) {
20016     int test_ret = 0;
20017
20018     int mem_base;
20019     xmlNodePtr ret_val;
20020     xmlDocPtr doc; /* the target document */
20021     int n_doc;
20022     xmlNodePtr node; /* the first node in the list. */
20023     int n_node;
20024
20025     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20026     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20027         mem_base = xmlMemBlocks();
20028         doc = gen_xmlDocPtr(n_doc, 0);
20029         node = gen_xmlNodePtr(n_node, 1);
20030
20031         ret_val = xmlDocCopyNodeList(doc, node);
20032         desret_xmlNodePtr(ret_val);
20033         call_tests++;
20034         des_xmlDocPtr(n_doc, doc, 0);
20035         des_xmlNodePtr(n_node, node, 1);
20036         xmlResetLastError();
20037         if (mem_base != xmlMemBlocks()) {
20038             printf("Leak of %d blocks found in xmlDocCopyNodeList",
20039                    xmlMemBlocks() - mem_base);
20040             test_ret++;
20041             printf(" %d", n_doc);
20042             printf(" %d", n_node);
20043             printf("\n");
20044         }
20045     }
20046     }
20047     function_tests++;
20048
20049     return(test_ret);
20050 }
20051
20052
20053 static int
20054 test_xmlDocDump(void) {
20055     int test_ret = 0;
20056
20057 #if defined(LIBXML_OUTPUT_ENABLED)
20058     int mem_base;
20059     int ret_val;
20060     FILE * f; /* the FILE* */
20061     int n_f;
20062     xmlDocPtr cur; /* the document */
20063     int n_cur;
20064
20065     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20066     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20067         mem_base = xmlMemBlocks();
20068         f = gen_FILE_ptr(n_f, 0);
20069         cur = gen_xmlDocPtr(n_cur, 1);
20070
20071         ret_val = xmlDocDump(f, cur);
20072         desret_int(ret_val);
20073         call_tests++;
20074         des_FILE_ptr(n_f, f, 0);
20075         des_xmlDocPtr(n_cur, cur, 1);
20076         xmlResetLastError();
20077         if (mem_base != xmlMemBlocks()) {
20078             printf("Leak of %d blocks found in xmlDocDump",
20079                    xmlMemBlocks() - mem_base);
20080             test_ret++;
20081             printf(" %d", n_f);
20082             printf(" %d", n_cur);
20083             printf("\n");
20084         }
20085     }
20086     }
20087     function_tests++;
20088 #endif
20089
20090     return(test_ret);
20091 }
20092
20093
20094 static int
20095 test_xmlDocDumpFormatMemory(void) {
20096     int test_ret = 0;
20097
20098 #if defined(LIBXML_OUTPUT_ENABLED)
20099     int mem_base;
20100     xmlDocPtr cur; /* the document */
20101     int n_cur;
20102     xmlChar ** mem; /* OUT: the memory pointer */
20103     int n_mem;
20104     int * size; /* OUT: the memory length */
20105     int n_size;
20106     int format; /* should formatting spaces been added */
20107     int n_format;
20108
20109     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20110     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
20111     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
20112     for (n_format = 0;n_format < gen_nb_int;n_format++) {
20113         mem_base = xmlMemBlocks();
20114         cur = gen_xmlDocPtr(n_cur, 0);
20115         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
20116         size = gen_int_ptr(n_size, 2);
20117         format = gen_int(n_format, 3);
20118
20119         xmlDocDumpFormatMemory(cur, mem, size, format);
20120         call_tests++;
20121         des_xmlDocPtr(n_cur, cur, 0);
20122         des_xmlChar_ptr_ptr(n_mem, mem, 1);
20123         des_int_ptr(n_size, size, 2);
20124         des_int(n_format, format, 3);
20125         xmlResetLastError();
20126         if (mem_base != xmlMemBlocks()) {
20127             printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
20128                    xmlMemBlocks() - mem_base);
20129             test_ret++;
20130             printf(" %d", n_cur);
20131             printf(" %d", n_mem);
20132             printf(" %d", n_size);
20133             printf(" %d", n_format);
20134             printf("\n");
20135         }
20136     }
20137     }
20138     }
20139     }
20140     function_tests++;
20141 #endif
20142
20143     return(test_ret);
20144 }
20145
20146
20147 static int
20148 test_xmlDocDumpFormatMemoryEnc(void) {
20149     int test_ret = 0;
20150
20151 #if defined(LIBXML_OUTPUT_ENABLED)
20152     int mem_base;
20153     xmlDocPtr out_doc; /* Document to generate XML text from */
20154     int n_out_doc;
20155     xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
20156     int n_doc_txt_ptr;
20157     int * doc_txt_len; /* Length of the generated XML text */
20158     int n_doc_txt_len;
20159     char * txt_encoding; /* Character encoding to use when generating XML text */
20160     int n_txt_encoding;
20161     int format; /* should formatting spaces been added */
20162     int n_format;
20163
20164     for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
20165     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
20166     for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
20167     for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
20168     for (n_format = 0;n_format < gen_nb_int;n_format++) {
20169         mem_base = xmlMemBlocks();
20170         out_doc = gen_xmlDocPtr(n_out_doc, 0);
20171         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
20172         doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
20173         txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
20174         format = gen_int(n_format, 4);
20175
20176         xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
20177         call_tests++;
20178         des_xmlDocPtr(n_out_doc, out_doc, 0);
20179         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
20180         des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
20181         des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
20182         des_int(n_format, format, 4);
20183         xmlResetLastError();
20184         if (mem_base != xmlMemBlocks()) {
20185             printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
20186                    xmlMemBlocks() - mem_base);
20187             test_ret++;
20188             printf(" %d", n_out_doc);
20189             printf(" %d", n_doc_txt_ptr);
20190             printf(" %d", n_doc_txt_len);
20191             printf(" %d", n_txt_encoding);
20192             printf(" %d", n_format);
20193             printf("\n");
20194         }
20195     }
20196     }
20197     }
20198     }
20199     }
20200     function_tests++;
20201 #endif
20202
20203     return(test_ret);
20204 }
20205
20206
20207 static int
20208 test_xmlDocDumpMemory(void) {
20209     int test_ret = 0;
20210
20211 #if defined(LIBXML_OUTPUT_ENABLED)
20212     int mem_base;
20213     xmlDocPtr cur; /* the document */
20214     int n_cur;
20215     xmlChar ** mem; /* OUT: the memory pointer */
20216     int n_mem;
20217     int * size; /* OUT: the memory length */
20218     int n_size;
20219
20220     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20221     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
20222     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
20223         mem_base = xmlMemBlocks();
20224         cur = gen_xmlDocPtr(n_cur, 0);
20225         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
20226         size = gen_int_ptr(n_size, 2);
20227
20228         xmlDocDumpMemory(cur, mem, size);
20229         call_tests++;
20230         des_xmlDocPtr(n_cur, cur, 0);
20231         des_xmlChar_ptr_ptr(n_mem, mem, 1);
20232         des_int_ptr(n_size, size, 2);
20233         xmlResetLastError();
20234         if (mem_base != xmlMemBlocks()) {
20235             printf("Leak of %d blocks found in xmlDocDumpMemory",
20236                    xmlMemBlocks() - mem_base);
20237             test_ret++;
20238             printf(" %d", n_cur);
20239             printf(" %d", n_mem);
20240             printf(" %d", n_size);
20241             printf("\n");
20242         }
20243     }
20244     }
20245     }
20246     function_tests++;
20247 #endif
20248
20249     return(test_ret);
20250 }
20251
20252
20253 static int
20254 test_xmlDocDumpMemoryEnc(void) {
20255     int test_ret = 0;
20256
20257 #if defined(LIBXML_OUTPUT_ENABLED)
20258     int mem_base;
20259     xmlDocPtr out_doc; /* Document to generate XML text from */
20260     int n_out_doc;
20261     xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
20262     int n_doc_txt_ptr;
20263     int * doc_txt_len; /* Length of the generated XML text */
20264     int n_doc_txt_len;
20265     char * txt_encoding; /* Character encoding to use when generating XML text */
20266     int n_txt_encoding;
20267
20268     for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
20269     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
20270     for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
20271     for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
20272         mem_base = xmlMemBlocks();
20273         out_doc = gen_xmlDocPtr(n_out_doc, 0);
20274         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
20275         doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
20276         txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
20277
20278         xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
20279         call_tests++;
20280         des_xmlDocPtr(n_out_doc, out_doc, 0);
20281         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
20282         des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
20283         des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
20284         xmlResetLastError();
20285         if (mem_base != xmlMemBlocks()) {
20286             printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
20287                    xmlMemBlocks() - mem_base);
20288             test_ret++;
20289             printf(" %d", n_out_doc);
20290             printf(" %d", n_doc_txt_ptr);
20291             printf(" %d", n_doc_txt_len);
20292             printf(" %d", n_txt_encoding);
20293             printf("\n");
20294         }
20295     }
20296     }
20297     }
20298     }
20299     function_tests++;
20300 #endif
20301
20302     return(test_ret);
20303 }
20304
20305
20306 static int
20307 test_xmlDocFormatDump(void) {
20308     int test_ret = 0;
20309
20310 #if defined(LIBXML_OUTPUT_ENABLED)
20311     int mem_base;
20312     int ret_val;
20313     FILE * f; /* the FILE* */
20314     int n_f;
20315     xmlDocPtr cur; /* the document */
20316     int n_cur;
20317     int format; /* should formatting spaces been added */
20318     int n_format;
20319
20320     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20321     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20322     for (n_format = 0;n_format < gen_nb_int;n_format++) {
20323         mem_base = xmlMemBlocks();
20324         f = gen_FILE_ptr(n_f, 0);
20325         cur = gen_xmlDocPtr(n_cur, 1);
20326         format = gen_int(n_format, 2);
20327
20328         ret_val = xmlDocFormatDump(f, cur, format);
20329         desret_int(ret_val);
20330         call_tests++;
20331         des_FILE_ptr(n_f, f, 0);
20332         des_xmlDocPtr(n_cur, cur, 1);
20333         des_int(n_format, format, 2);
20334         xmlResetLastError();
20335         if (mem_base != xmlMemBlocks()) {
20336             printf("Leak of %d blocks found in xmlDocFormatDump",
20337                    xmlMemBlocks() - mem_base);
20338             test_ret++;
20339             printf(" %d", n_f);
20340             printf(" %d", n_cur);
20341             printf(" %d", n_format);
20342             printf("\n");
20343         }
20344     }
20345     }
20346     }
20347     function_tests++;
20348 #endif
20349
20350     return(test_ret);
20351 }
20352
20353
20354 static int
20355 test_xmlDocGetRootElement(void) {
20356     int test_ret = 0;
20357
20358     int mem_base;
20359     xmlNodePtr ret_val;
20360     xmlDoc * doc; /* the document */
20361     int n_doc;
20362
20363     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
20364         mem_base = xmlMemBlocks();
20365         doc = gen_const_xmlDoc_ptr(n_doc, 0);
20366
20367         ret_val = xmlDocGetRootElement((const xmlDoc *)doc);
20368         desret_xmlNodePtr(ret_val);
20369         call_tests++;
20370         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
20371         xmlResetLastError();
20372         if (mem_base != xmlMemBlocks()) {
20373             printf("Leak of %d blocks found in xmlDocGetRootElement",
20374                    xmlMemBlocks() - mem_base);
20375             test_ret++;
20376             printf(" %d", n_doc);
20377             printf("\n");
20378         }
20379     }
20380     function_tests++;
20381
20382     return(test_ret);
20383 }
20384
20385
20386 static int
20387 test_xmlDocSetRootElement(void) {
20388     int test_ret = 0;
20389
20390 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
20391     int mem_base;
20392     xmlNodePtr ret_val;
20393     xmlDocPtr doc; /* the document */
20394     int n_doc;
20395     xmlNodePtr root; /* the new document root element, if root is NULL no action is taken, to remove a node from a document use xmlUnlinkNode(root) instead. */
20396     int n_root;
20397
20398     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20399     for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
20400         mem_base = xmlMemBlocks();
20401         doc = gen_xmlDocPtr(n_doc, 0);
20402         root = gen_xmlNodePtr_in(n_root, 1);
20403
20404         ret_val = xmlDocSetRootElement(doc, root);
20405         if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
20406         desret_xmlNodePtr(ret_val);
20407         call_tests++;
20408         des_xmlDocPtr(n_doc, doc, 0);
20409         des_xmlNodePtr_in(n_root, root, 1);
20410         xmlResetLastError();
20411         if (mem_base != xmlMemBlocks()) {
20412             printf("Leak of %d blocks found in xmlDocSetRootElement",
20413                    xmlMemBlocks() - mem_base);
20414             test_ret++;
20415             printf(" %d", n_doc);
20416             printf(" %d", n_root);
20417             printf("\n");
20418         }
20419     }
20420     }
20421     function_tests++;
20422 #endif
20423
20424     return(test_ret);
20425 }
20426
20427
20428 static int
20429 test_xmlElemDump(void) {
20430     int test_ret = 0;
20431
20432 #if defined(LIBXML_OUTPUT_ENABLED)
20433     int mem_base;
20434     FILE * f; /* the FILE * for the output */
20435     int n_f;
20436     xmlDocPtr doc; /* the document */
20437     int n_doc;
20438     xmlNodePtr cur; /* the current node */
20439     int n_cur;
20440
20441     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20442     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20443     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20444         mem_base = xmlMemBlocks();
20445         f = gen_FILE_ptr(n_f, 0);
20446         doc = gen_xmlDocPtr(n_doc, 1);
20447         cur = gen_xmlNodePtr(n_cur, 2);
20448
20449         xmlElemDump(f, doc, cur);
20450         call_tests++;
20451         des_FILE_ptr(n_f, f, 0);
20452         des_xmlDocPtr(n_doc, doc, 1);
20453         des_xmlNodePtr(n_cur, cur, 2);
20454         xmlResetLastError();
20455         if (mem_base != xmlMemBlocks()) {
20456             printf("Leak of %d blocks found in xmlElemDump",
20457                    xmlMemBlocks() - mem_base);
20458             test_ret++;
20459             printf(" %d", n_f);
20460             printf(" %d", n_doc);
20461             printf(" %d", n_cur);
20462             printf("\n");
20463         }
20464     }
20465     }
20466     }
20467     function_tests++;
20468 #endif
20469
20470     return(test_ret);
20471 }
20472
20473
20474 static int
20475 test_xmlFirstElementChild(void) {
20476     int test_ret = 0;
20477
20478 #if defined(LIBXML_TREE_ENABLED)
20479     int mem_base;
20480     xmlNodePtr ret_val;
20481     xmlNodePtr parent; /* the parent node */
20482     int n_parent;
20483
20484     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20485         mem_base = xmlMemBlocks();
20486         parent = gen_xmlNodePtr(n_parent, 0);
20487
20488         ret_val = xmlFirstElementChild(parent);
20489         desret_xmlNodePtr(ret_val);
20490         call_tests++;
20491         des_xmlNodePtr(n_parent, parent, 0);
20492         xmlResetLastError();
20493         if (mem_base != xmlMemBlocks()) {
20494             printf("Leak of %d blocks found in xmlFirstElementChild",
20495                    xmlMemBlocks() - mem_base);
20496             test_ret++;
20497             printf(" %d", n_parent);
20498             printf("\n");
20499         }
20500     }
20501     function_tests++;
20502 #endif
20503
20504     return(test_ret);
20505 }
20506
20507
20508 static int
20509 test_xmlGetBufferAllocationScheme(void) {
20510     int test_ret = 0;
20511
20512     int mem_base;
20513     xmlBufferAllocationScheme ret_val;
20514
20515         mem_base = xmlMemBlocks();
20516
20517         ret_val = xmlGetBufferAllocationScheme();
20518         desret_xmlBufferAllocationScheme(ret_val);
20519         call_tests++;
20520         xmlResetLastError();
20521         if (mem_base != xmlMemBlocks()) {
20522             printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
20523                    xmlMemBlocks() - mem_base);
20524             test_ret++;
20525             printf("\n");
20526         }
20527     function_tests++;
20528
20529     return(test_ret);
20530 }
20531
20532
20533 static int
20534 test_xmlGetCompressMode(void) {
20535     int test_ret = 0;
20536
20537     int mem_base;
20538     int ret_val;
20539
20540         mem_base = xmlMemBlocks();
20541
20542         ret_val = xmlGetCompressMode();
20543         desret_int(ret_val);
20544         call_tests++;
20545         xmlResetLastError();
20546         if (mem_base != xmlMemBlocks()) {
20547             printf("Leak of %d blocks found in xmlGetCompressMode",
20548                    xmlMemBlocks() - mem_base);
20549             test_ret++;
20550             printf("\n");
20551         }
20552     function_tests++;
20553
20554     return(test_ret);
20555 }
20556
20557
20558 static int
20559 test_xmlGetDocCompressMode(void) {
20560     int test_ret = 0;
20561
20562     int mem_base;
20563     int ret_val;
20564     xmlDoc * doc; /* the document */
20565     int n_doc;
20566
20567     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
20568         mem_base = xmlMemBlocks();
20569         doc = gen_const_xmlDoc_ptr(n_doc, 0);
20570
20571         ret_val = xmlGetDocCompressMode((const xmlDoc *)doc);
20572         desret_int(ret_val);
20573         call_tests++;
20574         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
20575         xmlResetLastError();
20576         if (mem_base != xmlMemBlocks()) {
20577             printf("Leak of %d blocks found in xmlGetDocCompressMode",
20578                    xmlMemBlocks() - mem_base);
20579             test_ret++;
20580             printf(" %d", n_doc);
20581             printf("\n");
20582         }
20583     }
20584     function_tests++;
20585
20586     return(test_ret);
20587 }
20588
20589
20590 static int
20591 test_xmlGetIntSubset(void) {
20592     int test_ret = 0;
20593
20594     int mem_base;
20595     xmlDtdPtr ret_val;
20596     xmlDoc * doc; /* the document pointer */
20597     int n_doc;
20598
20599     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
20600         mem_base = xmlMemBlocks();
20601         doc = gen_const_xmlDoc_ptr(n_doc, 0);
20602
20603         ret_val = xmlGetIntSubset((const xmlDoc *)doc);
20604         desret_xmlDtdPtr(ret_val);
20605         call_tests++;
20606         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
20607         xmlResetLastError();
20608         if (mem_base != xmlMemBlocks()) {
20609             printf("Leak of %d blocks found in xmlGetIntSubset",
20610                    xmlMemBlocks() - mem_base);
20611             test_ret++;
20612             printf(" %d", n_doc);
20613             printf("\n");
20614         }
20615     }
20616     function_tests++;
20617
20618     return(test_ret);
20619 }
20620
20621
20622 static int
20623 test_xmlGetLastChild(void) {
20624     int test_ret = 0;
20625
20626     int mem_base;
20627     xmlNodePtr ret_val;
20628     xmlNode * parent; /* the parent node */
20629     int n_parent;
20630
20631     for (n_parent = 0;n_parent < gen_nb_const_xmlNode_ptr;n_parent++) {
20632         mem_base = xmlMemBlocks();
20633         parent = gen_const_xmlNode_ptr(n_parent, 0);
20634
20635         ret_val = xmlGetLastChild((const xmlNode *)parent);
20636         desret_xmlNodePtr(ret_val);
20637         call_tests++;
20638         des_const_xmlNode_ptr(n_parent, (const xmlNode *)parent, 0);
20639         xmlResetLastError();
20640         if (mem_base != xmlMemBlocks()) {
20641             printf("Leak of %d blocks found in xmlGetLastChild",
20642                    xmlMemBlocks() - mem_base);
20643             test_ret++;
20644             printf(" %d", n_parent);
20645             printf("\n");
20646         }
20647     }
20648     function_tests++;
20649
20650     return(test_ret);
20651 }
20652
20653
20654 static int
20655 test_xmlGetLineNo(void) {
20656     int test_ret = 0;
20657
20658     int mem_base;
20659     long ret_val;
20660     xmlNode * node; /* valid node */
20661     int n_node;
20662
20663     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20664         mem_base = xmlMemBlocks();
20665         node = gen_const_xmlNode_ptr(n_node, 0);
20666
20667         ret_val = xmlGetLineNo((const xmlNode *)node);
20668         desret_long(ret_val);
20669         call_tests++;
20670         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20671         xmlResetLastError();
20672         if (mem_base != xmlMemBlocks()) {
20673             printf("Leak of %d blocks found in xmlGetLineNo",
20674                    xmlMemBlocks() - mem_base);
20675             test_ret++;
20676             printf(" %d", n_node);
20677             printf("\n");
20678         }
20679     }
20680     function_tests++;
20681
20682     return(test_ret);
20683 }
20684
20685
20686 static int
20687 test_xmlGetNoNsProp(void) {
20688     int test_ret = 0;
20689
20690     int mem_base;
20691     xmlChar * ret_val;
20692     xmlNode * node; /* the node */
20693     int n_node;
20694     xmlChar * name; /* the attribute name */
20695     int n_name;
20696
20697     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20698     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20699         mem_base = xmlMemBlocks();
20700         node = gen_const_xmlNode_ptr(n_node, 0);
20701         name = gen_const_xmlChar_ptr(n_name, 1);
20702
20703         ret_val = xmlGetNoNsProp((const xmlNode *)node, (const xmlChar *)name);
20704         desret_xmlChar_ptr(ret_val);
20705         call_tests++;
20706         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20707         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20708         xmlResetLastError();
20709         if (mem_base != xmlMemBlocks()) {
20710             printf("Leak of %d blocks found in xmlGetNoNsProp",
20711                    xmlMemBlocks() - mem_base);
20712             test_ret++;
20713             printf(" %d", n_node);
20714             printf(" %d", n_name);
20715             printf("\n");
20716         }
20717     }
20718     }
20719     function_tests++;
20720
20721     return(test_ret);
20722 }
20723
20724
20725 static int
20726 test_xmlGetNodePath(void) {
20727     int test_ret = 0;
20728
20729 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
20730     int mem_base;
20731     xmlChar * ret_val;
20732     xmlNode * node; /* a node */
20733     int n_node;
20734
20735     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20736         mem_base = xmlMemBlocks();
20737         node = gen_const_xmlNode_ptr(n_node, 0);
20738
20739         ret_val = xmlGetNodePath((const xmlNode *)node);
20740         desret_xmlChar_ptr(ret_val);
20741         call_tests++;
20742         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20743         xmlResetLastError();
20744         if (mem_base != xmlMemBlocks()) {
20745             printf("Leak of %d blocks found in xmlGetNodePath",
20746                    xmlMemBlocks() - mem_base);
20747             test_ret++;
20748             printf(" %d", n_node);
20749             printf("\n");
20750         }
20751     }
20752     function_tests++;
20753 #endif
20754
20755     return(test_ret);
20756 }
20757
20758
20759 static int
20760 test_xmlGetNsList(void) {
20761     int test_ret = 0;
20762
20763
20764     /* missing type support */
20765     return(test_ret);
20766 }
20767
20768
20769 static int
20770 test_xmlGetNsProp(void) {
20771     int test_ret = 0;
20772
20773     int mem_base;
20774     xmlChar * ret_val;
20775     xmlNode * node; /* the node */
20776     int n_node;
20777     xmlChar * name; /* the attribute name */
20778     int n_name;
20779     xmlChar * nameSpace; /* the URI of the namespace */
20780     int n_nameSpace;
20781
20782     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20783     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20784     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20785         mem_base = xmlMemBlocks();
20786         node = gen_const_xmlNode_ptr(n_node, 0);
20787         name = gen_const_xmlChar_ptr(n_name, 1);
20788         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20789
20790         ret_val = xmlGetNsProp((const xmlNode *)node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20791         desret_xmlChar_ptr(ret_val);
20792         call_tests++;
20793         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20794         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20795         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20796         xmlResetLastError();
20797         if (mem_base != xmlMemBlocks()) {
20798             printf("Leak of %d blocks found in xmlGetNsProp",
20799                    xmlMemBlocks() - mem_base);
20800             test_ret++;
20801             printf(" %d", n_node);
20802             printf(" %d", n_name);
20803             printf(" %d", n_nameSpace);
20804             printf("\n");
20805         }
20806     }
20807     }
20808     }
20809     function_tests++;
20810
20811     return(test_ret);
20812 }
20813
20814
20815 static int
20816 test_xmlGetProp(void) {
20817     int test_ret = 0;
20818
20819     int mem_base;
20820     xmlChar * ret_val;
20821     xmlNode * node; /* the node */
20822     int n_node;
20823     xmlChar * name; /* the attribute name */
20824     int n_name;
20825
20826     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20827     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20828         mem_base = xmlMemBlocks();
20829         node = gen_const_xmlNode_ptr(n_node, 0);
20830         name = gen_const_xmlChar_ptr(n_name, 1);
20831
20832         ret_val = xmlGetProp((const xmlNode *)node, (const xmlChar *)name);
20833         desret_xmlChar_ptr(ret_val);
20834         call_tests++;
20835         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20836         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20837         xmlResetLastError();
20838         if (mem_base != xmlMemBlocks()) {
20839             printf("Leak of %d blocks found in xmlGetProp",
20840                    xmlMemBlocks() - mem_base);
20841             test_ret++;
20842             printf(" %d", n_node);
20843             printf(" %d", n_name);
20844             printf("\n");
20845         }
20846     }
20847     }
20848     function_tests++;
20849
20850     return(test_ret);
20851 }
20852
20853
20854 static int
20855 test_xmlHasNsProp(void) {
20856     int test_ret = 0;
20857
20858     int mem_base;
20859     xmlAttrPtr ret_val;
20860     xmlNode * node; /* the node */
20861     int n_node;
20862     xmlChar * name; /* the attribute name */
20863     int n_name;
20864     xmlChar * nameSpace; /* the URI of the namespace */
20865     int n_nameSpace;
20866
20867     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20868     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20869     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20870         mem_base = xmlMemBlocks();
20871         node = gen_const_xmlNode_ptr(n_node, 0);
20872         name = gen_const_xmlChar_ptr(n_name, 1);
20873         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20874
20875         ret_val = xmlHasNsProp((const xmlNode *)node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20876         desret_xmlAttrPtr(ret_val);
20877         call_tests++;
20878         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20879         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20880         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20881         xmlResetLastError();
20882         if (mem_base != xmlMemBlocks()) {
20883             printf("Leak of %d blocks found in xmlHasNsProp",
20884                    xmlMemBlocks() - mem_base);
20885             test_ret++;
20886             printf(" %d", n_node);
20887             printf(" %d", n_name);
20888             printf(" %d", n_nameSpace);
20889             printf("\n");
20890         }
20891     }
20892     }
20893     }
20894     function_tests++;
20895
20896     return(test_ret);
20897 }
20898
20899
20900 static int
20901 test_xmlHasProp(void) {
20902     int test_ret = 0;
20903
20904     int mem_base;
20905     xmlAttrPtr ret_val;
20906     xmlNode * node; /* the node */
20907     int n_node;
20908     xmlChar * name; /* the attribute name */
20909     int n_name;
20910
20911     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20912     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20913         mem_base = xmlMemBlocks();
20914         node = gen_const_xmlNode_ptr(n_node, 0);
20915         name = gen_const_xmlChar_ptr(n_name, 1);
20916
20917         ret_val = xmlHasProp((const xmlNode *)node, (const xmlChar *)name);
20918         desret_xmlAttrPtr(ret_val);
20919         call_tests++;
20920         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20921         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20922         xmlResetLastError();
20923         if (mem_base != xmlMemBlocks()) {
20924             printf("Leak of %d blocks found in xmlHasProp",
20925                    xmlMemBlocks() - mem_base);
20926             test_ret++;
20927             printf(" %d", n_node);
20928             printf(" %d", n_name);
20929             printf("\n");
20930         }
20931     }
20932     }
20933     function_tests++;
20934
20935     return(test_ret);
20936 }
20937
20938
20939 static int
20940 test_xmlIsBlankNode(void) {
20941     int test_ret = 0;
20942
20943     int mem_base;
20944     int ret_val;
20945     xmlNode * node; /* the node */
20946     int n_node;
20947
20948     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20949         mem_base = xmlMemBlocks();
20950         node = gen_const_xmlNode_ptr(n_node, 0);
20951
20952         ret_val = xmlIsBlankNode((const xmlNode *)node);
20953         desret_int(ret_val);
20954         call_tests++;
20955         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20956         xmlResetLastError();
20957         if (mem_base != xmlMemBlocks()) {
20958             printf("Leak of %d blocks found in xmlIsBlankNode",
20959                    xmlMemBlocks() - mem_base);
20960             test_ret++;
20961             printf(" %d", n_node);
20962             printf("\n");
20963         }
20964     }
20965     function_tests++;
20966
20967     return(test_ret);
20968 }
20969
20970
20971 static int
20972 test_xmlIsXHTML(void) {
20973     int test_ret = 0;
20974
20975     int mem_base;
20976     int ret_val;
20977     xmlChar * systemID; /* the system identifier */
20978     int n_systemID;
20979     xmlChar * publicID; /* the public identifier */
20980     int n_publicID;
20981
20982     for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
20983     for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
20984         mem_base = xmlMemBlocks();
20985         systemID = gen_const_xmlChar_ptr(n_systemID, 0);
20986         publicID = gen_const_xmlChar_ptr(n_publicID, 1);
20987
20988         ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
20989         desret_int(ret_val);
20990         call_tests++;
20991         des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
20992         des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
20993         xmlResetLastError();
20994         if (mem_base != xmlMemBlocks()) {
20995             printf("Leak of %d blocks found in xmlIsXHTML",
20996                    xmlMemBlocks() - mem_base);
20997             test_ret++;
20998             printf(" %d", n_systemID);
20999             printf(" %d", n_publicID);
21000             printf("\n");
21001         }
21002     }
21003     }
21004     function_tests++;
21005
21006     return(test_ret);
21007 }
21008
21009
21010 static int
21011 test_xmlLastElementChild(void) {
21012     int test_ret = 0;
21013
21014 #if defined(LIBXML_TREE_ENABLED)
21015     int mem_base;
21016     xmlNodePtr ret_val;
21017     xmlNodePtr parent; /* the parent node */
21018     int n_parent;
21019
21020     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21021         mem_base = xmlMemBlocks();
21022         parent = gen_xmlNodePtr(n_parent, 0);
21023
21024         ret_val = xmlLastElementChild(parent);
21025         desret_xmlNodePtr(ret_val);
21026         call_tests++;
21027         des_xmlNodePtr(n_parent, parent, 0);
21028         xmlResetLastError();
21029         if (mem_base != xmlMemBlocks()) {
21030             printf("Leak of %d blocks found in xmlLastElementChild",
21031                    xmlMemBlocks() - mem_base);
21032             test_ret++;
21033             printf(" %d", n_parent);
21034             printf("\n");
21035         }
21036     }
21037     function_tests++;
21038 #endif
21039
21040     return(test_ret);
21041 }
21042
21043
21044 static int
21045 test_xmlNewCDataBlock(void) {
21046     int test_ret = 0;
21047
21048     int mem_base;
21049     xmlNodePtr ret_val;
21050     xmlDocPtr doc; /* the document */
21051     int n_doc;
21052     xmlChar * content; /* the CDATA block content content */
21053     int n_content;
21054     int len; /* the length of the block */
21055     int n_len;
21056
21057     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21058     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21059     for (n_len = 0;n_len < gen_nb_int;n_len++) {
21060         mem_base = xmlMemBlocks();
21061         doc = gen_xmlDocPtr(n_doc, 0);
21062         content = gen_const_xmlChar_ptr(n_content, 1);
21063         len = gen_int(n_len, 2);
21064         if ((content != NULL) &&
21065             (len > (int) strlen((const char *) content) + 1))
21066             continue;
21067
21068         ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
21069         desret_xmlNodePtr(ret_val);
21070         call_tests++;
21071         des_xmlDocPtr(n_doc, doc, 0);
21072         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21073         des_int(n_len, len, 2);
21074         xmlResetLastError();
21075         if (mem_base != xmlMemBlocks()) {
21076             printf("Leak of %d blocks found in xmlNewCDataBlock",
21077                    xmlMemBlocks() - mem_base);
21078             test_ret++;
21079             printf(" %d", n_doc);
21080             printf(" %d", n_content);
21081             printf(" %d", n_len);
21082             printf("\n");
21083         }
21084     }
21085     }
21086     }
21087     function_tests++;
21088
21089     return(test_ret);
21090 }
21091
21092
21093 static int
21094 test_xmlNewCharRef(void) {
21095     int test_ret = 0;
21096
21097     int mem_base;
21098     xmlNodePtr ret_val;
21099     xmlDocPtr doc; /* the document */
21100     int n_doc;
21101     xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
21102     int n_name;
21103
21104     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21105     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21106         mem_base = xmlMemBlocks();
21107         doc = gen_xmlDocPtr(n_doc, 0);
21108         name = gen_const_xmlChar_ptr(n_name, 1);
21109
21110         ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
21111         desret_xmlNodePtr(ret_val);
21112         call_tests++;
21113         des_xmlDocPtr(n_doc, doc, 0);
21114         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21115         xmlResetLastError();
21116         if (mem_base != xmlMemBlocks()) {
21117             printf("Leak of %d blocks found in xmlNewCharRef",
21118                    xmlMemBlocks() - mem_base);
21119             test_ret++;
21120             printf(" %d", n_doc);
21121             printf(" %d", n_name);
21122             printf("\n");
21123         }
21124     }
21125     }
21126     function_tests++;
21127
21128     return(test_ret);
21129 }
21130
21131
21132 static int
21133 test_xmlNewChild(void) {
21134     int test_ret = 0;
21135
21136 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21137 #ifdef LIBXML_TREE_ENABLED
21138     int mem_base;
21139     xmlNodePtr ret_val;
21140     xmlNodePtr parent; /* the parent node */
21141     int n_parent;
21142     xmlNsPtr ns; /* a namespace if any */
21143     int n_ns;
21144     xmlChar * name; /* the name of the child */
21145     int n_name;
21146     xmlChar * content; /* the XML content of the child if any. */
21147     int n_content;
21148
21149     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21150     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21151     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21152     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21153         mem_base = xmlMemBlocks();
21154         parent = gen_xmlNodePtr(n_parent, 0);
21155         ns = gen_xmlNsPtr(n_ns, 1);
21156         name = gen_const_xmlChar_ptr(n_name, 2);
21157         content = gen_const_xmlChar_ptr(n_content, 3);
21158
21159         ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21160         desret_xmlNodePtr(ret_val);
21161         call_tests++;
21162         des_xmlNodePtr(n_parent, parent, 0);
21163         des_xmlNsPtr(n_ns, ns, 1);
21164         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21165         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21166         xmlResetLastError();
21167         if (mem_base != xmlMemBlocks()) {
21168             printf("Leak of %d blocks found in xmlNewChild",
21169                    xmlMemBlocks() - mem_base);
21170             test_ret++;
21171             printf(" %d", n_parent);
21172             printf(" %d", n_ns);
21173             printf(" %d", n_name);
21174             printf(" %d", n_content);
21175             printf("\n");
21176         }
21177     }
21178     }
21179     }
21180     }
21181     function_tests++;
21182 #endif
21183 #endif
21184
21185     return(test_ret);
21186 }
21187
21188
21189 static int
21190 test_xmlNewComment(void) {
21191     int test_ret = 0;
21192
21193     int mem_base;
21194     xmlNodePtr ret_val;
21195     xmlChar * content; /* the comment content */
21196     int n_content;
21197
21198     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21199         mem_base = xmlMemBlocks();
21200         content = gen_const_xmlChar_ptr(n_content, 0);
21201
21202         ret_val = xmlNewComment((const xmlChar *)content);
21203         desret_xmlNodePtr(ret_val);
21204         call_tests++;
21205         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21206         xmlResetLastError();
21207         if (mem_base != xmlMemBlocks()) {
21208             printf("Leak of %d blocks found in xmlNewComment",
21209                    xmlMemBlocks() - mem_base);
21210             test_ret++;
21211             printf(" %d", n_content);
21212             printf("\n");
21213         }
21214     }
21215     function_tests++;
21216
21217     return(test_ret);
21218 }
21219
21220
21221 static int
21222 test_xmlNewDoc(void) {
21223     int test_ret = 0;
21224
21225     int mem_base;
21226     xmlDocPtr ret_val;
21227     xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
21228     int n_version;
21229
21230     for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
21231         mem_base = xmlMemBlocks();
21232         version = gen_const_xmlChar_ptr(n_version, 0);
21233
21234         ret_val = xmlNewDoc((const xmlChar *)version);
21235         desret_xmlDocPtr(ret_val);
21236         call_tests++;
21237         des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
21238         xmlResetLastError();
21239         if (mem_base != xmlMemBlocks()) {
21240             printf("Leak of %d blocks found in xmlNewDoc",
21241                    xmlMemBlocks() - mem_base);
21242             test_ret++;
21243             printf(" %d", n_version);
21244             printf("\n");
21245         }
21246     }
21247     function_tests++;
21248
21249     return(test_ret);
21250 }
21251
21252
21253 static int
21254 test_xmlNewDocComment(void) {
21255     int test_ret = 0;
21256
21257     int mem_base;
21258     xmlNodePtr ret_val;
21259     xmlDocPtr doc; /* the document */
21260     int n_doc;
21261     xmlChar * content; /* the comment content */
21262     int n_content;
21263
21264     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21265     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21266         mem_base = xmlMemBlocks();
21267         doc = gen_xmlDocPtr(n_doc, 0);
21268         content = gen_const_xmlChar_ptr(n_content, 1);
21269
21270         ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
21271         desret_xmlNodePtr(ret_val);
21272         call_tests++;
21273         des_xmlDocPtr(n_doc, doc, 0);
21274         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21275         xmlResetLastError();
21276         if (mem_base != xmlMemBlocks()) {
21277             printf("Leak of %d blocks found in xmlNewDocComment",
21278                    xmlMemBlocks() - mem_base);
21279             test_ret++;
21280             printf(" %d", n_doc);
21281             printf(" %d", n_content);
21282             printf("\n");
21283         }
21284     }
21285     }
21286     function_tests++;
21287
21288     return(test_ret);
21289 }
21290
21291
21292 static int
21293 test_xmlNewDocFragment(void) {
21294     int test_ret = 0;
21295
21296 #if defined(LIBXML_TREE_ENABLED)
21297     int mem_base;
21298     xmlNodePtr ret_val;
21299     xmlDocPtr doc; /* the document owning the fragment */
21300     int n_doc;
21301
21302     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21303         mem_base = xmlMemBlocks();
21304         doc = gen_xmlDocPtr(n_doc, 0);
21305
21306         ret_val = xmlNewDocFragment(doc);
21307         desret_xmlNodePtr(ret_val);
21308         call_tests++;
21309         des_xmlDocPtr(n_doc, doc, 0);
21310         xmlResetLastError();
21311         if (mem_base != xmlMemBlocks()) {
21312             printf("Leak of %d blocks found in xmlNewDocFragment",
21313                    xmlMemBlocks() - mem_base);
21314             test_ret++;
21315             printf(" %d", n_doc);
21316             printf("\n");
21317         }
21318     }
21319     function_tests++;
21320 #endif
21321
21322     return(test_ret);
21323 }
21324
21325
21326 static int
21327 test_xmlNewDocNode(void) {
21328     int test_ret = 0;
21329
21330     int mem_base;
21331     xmlNodePtr ret_val;
21332     xmlDocPtr doc; /* the document */
21333     int n_doc;
21334     xmlNsPtr ns; /* namespace if any */
21335     int n_ns;
21336     xmlChar * name; /* the node name */
21337     int n_name;
21338     xmlChar * content; /* the XML text content if any */
21339     int n_content;
21340
21341     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21342     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21343     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21344     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21345         mem_base = xmlMemBlocks();
21346         doc = gen_xmlDocPtr(n_doc, 0);
21347         ns = gen_xmlNsPtr(n_ns, 1);
21348         name = gen_const_xmlChar_ptr(n_name, 2);
21349         content = gen_const_xmlChar_ptr(n_content, 3);
21350
21351         ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21352         desret_xmlNodePtr(ret_val);
21353         call_tests++;
21354         des_xmlDocPtr(n_doc, doc, 0);
21355         des_xmlNsPtr(n_ns, ns, 1);
21356         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21357         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21358         xmlResetLastError();
21359         if (mem_base != xmlMemBlocks()) {
21360             printf("Leak of %d blocks found in xmlNewDocNode",
21361                    xmlMemBlocks() - mem_base);
21362             test_ret++;
21363             printf(" %d", n_doc);
21364             printf(" %d", n_ns);
21365             printf(" %d", n_name);
21366             printf(" %d", n_content);
21367             printf("\n");
21368         }
21369     }
21370     }
21371     }
21372     }
21373     function_tests++;
21374
21375     return(test_ret);
21376 }
21377
21378
21379 static int
21380 test_xmlNewDocNodeEatName(void) {
21381     int test_ret = 0;
21382
21383     int mem_base;
21384     xmlNodePtr ret_val;
21385     xmlDocPtr doc; /* the document */
21386     int n_doc;
21387     xmlNsPtr ns; /* namespace if any */
21388     int n_ns;
21389     xmlChar * name; /* the node name */
21390     int n_name;
21391     xmlChar * content; /* the XML text content if any */
21392     int n_content;
21393
21394     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21395     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21396     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21397     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21398         mem_base = xmlMemBlocks();
21399         doc = gen_xmlDocPtr(n_doc, 0);
21400         ns = gen_xmlNsPtr(n_ns, 1);
21401         name = gen_eaten_name(n_name, 2);
21402         content = gen_const_xmlChar_ptr(n_content, 3);
21403
21404         ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
21405         desret_xmlNodePtr(ret_val);
21406         call_tests++;
21407         des_xmlDocPtr(n_doc, doc, 0);
21408         des_xmlNsPtr(n_ns, ns, 1);
21409         des_eaten_name(n_name, name, 2);
21410         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21411         xmlResetLastError();
21412         if (mem_base != xmlMemBlocks()) {
21413             printf("Leak of %d blocks found in xmlNewDocNodeEatName",
21414                    xmlMemBlocks() - mem_base);
21415             test_ret++;
21416             printf(" %d", n_doc);
21417             printf(" %d", n_ns);
21418             printf(" %d", n_name);
21419             printf(" %d", n_content);
21420             printf("\n");
21421         }
21422     }
21423     }
21424     }
21425     }
21426     function_tests++;
21427
21428     return(test_ret);
21429 }
21430
21431
21432 static int
21433 test_xmlNewDocPI(void) {
21434     int test_ret = 0;
21435
21436     int mem_base;
21437     xmlNodePtr ret_val;
21438     xmlDocPtr doc; /* the target document */
21439     int n_doc;
21440     xmlChar * name; /* the processing instruction name */
21441     int n_name;
21442     xmlChar * content; /* the PI content */
21443     int n_content;
21444
21445     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21446     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21447     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21448         mem_base = xmlMemBlocks();
21449         doc = gen_xmlDocPtr(n_doc, 0);
21450         name = gen_const_xmlChar_ptr(n_name, 1);
21451         content = gen_const_xmlChar_ptr(n_content, 2);
21452
21453         ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
21454         desret_xmlNodePtr(ret_val);
21455         call_tests++;
21456         des_xmlDocPtr(n_doc, doc, 0);
21457         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21458         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
21459         xmlResetLastError();
21460         if (mem_base != xmlMemBlocks()) {
21461             printf("Leak of %d blocks found in xmlNewDocPI",
21462                    xmlMemBlocks() - mem_base);
21463             test_ret++;
21464             printf(" %d", n_doc);
21465             printf(" %d", n_name);
21466             printf(" %d", n_content);
21467             printf("\n");
21468         }
21469     }
21470     }
21471     }
21472     function_tests++;
21473
21474     return(test_ret);
21475 }
21476
21477
21478 static int
21479 test_xmlNewDocProp(void) {
21480     int test_ret = 0;
21481
21482     int mem_base;
21483     xmlAttrPtr ret_val;
21484     xmlDocPtr doc; /* the document */
21485     int n_doc;
21486     xmlChar * name; /* the name of the attribute */
21487     int n_name;
21488     xmlChar * value; /* the value of the attribute */
21489     int n_value;
21490
21491     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21492     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21493     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21494         mem_base = xmlMemBlocks();
21495         doc = gen_xmlDocPtr(n_doc, 0);
21496         name = gen_const_xmlChar_ptr(n_name, 1);
21497         value = gen_const_xmlChar_ptr(n_value, 2);
21498
21499         ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
21500         desret_xmlAttrPtr(ret_val);
21501         call_tests++;
21502         des_xmlDocPtr(n_doc, doc, 0);
21503         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21504         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21505         xmlResetLastError();
21506         if (mem_base != xmlMemBlocks()) {
21507             printf("Leak of %d blocks found in xmlNewDocProp",
21508                    xmlMemBlocks() - mem_base);
21509             test_ret++;
21510             printf(" %d", n_doc);
21511             printf(" %d", n_name);
21512             printf(" %d", n_value);
21513             printf("\n");
21514         }
21515     }
21516     }
21517     }
21518     function_tests++;
21519
21520     return(test_ret);
21521 }
21522
21523
21524 static int
21525 test_xmlNewDocRawNode(void) {
21526     int test_ret = 0;
21527
21528 #if defined(LIBXML_TREE_ENABLED)
21529 #ifdef LIBXML_TREE_ENABLED
21530     int mem_base;
21531     xmlNodePtr ret_val;
21532     xmlDocPtr doc; /* the document */
21533     int n_doc;
21534     xmlNsPtr ns; /* namespace if any */
21535     int n_ns;
21536     xmlChar * name; /* the node name */
21537     int n_name;
21538     xmlChar * content; /* the text content if any */
21539     int n_content;
21540
21541     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21542     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21543     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21544     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21545         mem_base = xmlMemBlocks();
21546         doc = gen_xmlDocPtr(n_doc, 0);
21547         ns = gen_xmlNsPtr(n_ns, 1);
21548         name = gen_const_xmlChar_ptr(n_name, 2);
21549         content = gen_const_xmlChar_ptr(n_content, 3);
21550
21551         ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21552         desret_xmlNodePtr(ret_val);
21553         call_tests++;
21554         des_xmlDocPtr(n_doc, doc, 0);
21555         des_xmlNsPtr(n_ns, ns, 1);
21556         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21557         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21558         xmlResetLastError();
21559         if (mem_base != xmlMemBlocks()) {
21560             printf("Leak of %d blocks found in xmlNewDocRawNode",
21561                    xmlMemBlocks() - mem_base);
21562             test_ret++;
21563             printf(" %d", n_doc);
21564             printf(" %d", n_ns);
21565             printf(" %d", n_name);
21566             printf(" %d", n_content);
21567             printf("\n");
21568         }
21569     }
21570     }
21571     }
21572     }
21573     function_tests++;
21574 #endif
21575 #endif
21576
21577     return(test_ret);
21578 }
21579
21580
21581 static int
21582 test_xmlNewDocText(void) {
21583     int test_ret = 0;
21584
21585     int mem_base;
21586     xmlNodePtr ret_val;
21587     xmlDoc * doc; /* the document */
21588     int n_doc;
21589     xmlChar * content; /* the text content */
21590     int n_content;
21591
21592     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
21593     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21594         mem_base = xmlMemBlocks();
21595         doc = gen_const_xmlDoc_ptr(n_doc, 0);
21596         content = gen_const_xmlChar_ptr(n_content, 1);
21597
21598         ret_val = xmlNewDocText((const xmlDoc *)doc, (const xmlChar *)content);
21599         desret_xmlNodePtr(ret_val);
21600         call_tests++;
21601         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
21602         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21603         xmlResetLastError();
21604         if (mem_base != xmlMemBlocks()) {
21605             printf("Leak of %d blocks found in xmlNewDocText",
21606                    xmlMemBlocks() - mem_base);
21607             test_ret++;
21608             printf(" %d", n_doc);
21609             printf(" %d", n_content);
21610             printf("\n");
21611         }
21612     }
21613     }
21614     function_tests++;
21615
21616     return(test_ret);
21617 }
21618
21619
21620 static int
21621 test_xmlNewDocTextLen(void) {
21622     int test_ret = 0;
21623
21624     int mem_base;
21625     xmlNodePtr ret_val;
21626     xmlDocPtr doc; /* the document */
21627     int n_doc;
21628     xmlChar * content; /* the text content */
21629     int n_content;
21630     int len; /* the text len. */
21631     int n_len;
21632
21633     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21634     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21635     for (n_len = 0;n_len < gen_nb_int;n_len++) {
21636         mem_base = xmlMemBlocks();
21637         doc = gen_xmlDocPtr(n_doc, 0);
21638         content = gen_const_xmlChar_ptr(n_content, 1);
21639         len = gen_int(n_len, 2);
21640         if ((content != NULL) &&
21641             (len > (int) strlen((const char *) content) + 1))
21642             continue;
21643
21644         ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
21645         desret_xmlNodePtr(ret_val);
21646         call_tests++;
21647         des_xmlDocPtr(n_doc, doc, 0);
21648         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21649         des_int(n_len, len, 2);
21650         xmlResetLastError();
21651         if (mem_base != xmlMemBlocks()) {
21652             printf("Leak of %d blocks found in xmlNewDocTextLen",
21653                    xmlMemBlocks() - mem_base);
21654             test_ret++;
21655             printf(" %d", n_doc);
21656             printf(" %d", n_content);
21657             printf(" %d", n_len);
21658             printf("\n");
21659         }
21660     }
21661     }
21662     }
21663     function_tests++;
21664
21665     return(test_ret);
21666 }
21667
21668
21669 static int
21670 test_xmlNewDtd(void) {
21671     int test_ret = 0;
21672
21673     int mem_base;
21674     xmlDtdPtr ret_val;
21675     xmlDocPtr doc; /* the document pointer */
21676     int n_doc;
21677     xmlChar * name; /* the DTD name */
21678     int n_name;
21679     xmlChar * ExternalID; /* the external ID */
21680     int n_ExternalID;
21681     xmlChar * SystemID; /* the system ID */
21682     int n_SystemID;
21683
21684     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21685     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21686     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
21687     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
21688         mem_base = xmlMemBlocks();
21689         doc = gen_xmlDocPtr(n_doc, 0);
21690         name = gen_const_xmlChar_ptr(n_name, 1);
21691         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
21692         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
21693
21694         ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
21695         desret_xmlDtdPtr(ret_val);
21696         call_tests++;
21697         des_xmlDocPtr(n_doc, doc, 0);
21698         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21699         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
21700         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
21701         xmlResetLastError();
21702         if (mem_base != xmlMemBlocks()) {
21703             printf("Leak of %d blocks found in xmlNewDtd",
21704                    xmlMemBlocks() - mem_base);
21705             test_ret++;
21706             printf(" %d", n_doc);
21707             printf(" %d", n_name);
21708             printf(" %d", n_ExternalID);
21709             printf(" %d", n_SystemID);
21710             printf("\n");
21711         }
21712     }
21713     }
21714     }
21715     }
21716     function_tests++;
21717
21718     return(test_ret);
21719 }
21720
21721
21722 static int
21723 test_xmlNewNode(void) {
21724     int test_ret = 0;
21725
21726     int mem_base;
21727     xmlNodePtr ret_val;
21728     xmlNsPtr ns; /* namespace if any */
21729     int n_ns;
21730     xmlChar * name; /* the node name */
21731     int n_name;
21732
21733     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21734     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21735         mem_base = xmlMemBlocks();
21736         ns = gen_xmlNsPtr(n_ns, 0);
21737         name = gen_const_xmlChar_ptr(n_name, 1);
21738
21739         ret_val = xmlNewNode(ns, (const xmlChar *)name);
21740         desret_xmlNodePtr(ret_val);
21741         call_tests++;
21742         des_xmlNsPtr(n_ns, ns, 0);
21743         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21744         xmlResetLastError();
21745         if (mem_base != xmlMemBlocks()) {
21746             printf("Leak of %d blocks found in xmlNewNode",
21747                    xmlMemBlocks() - mem_base);
21748             test_ret++;
21749             printf(" %d", n_ns);
21750             printf(" %d", n_name);
21751             printf("\n");
21752         }
21753     }
21754     }
21755     function_tests++;
21756
21757     return(test_ret);
21758 }
21759
21760
21761 static int
21762 test_xmlNewNodeEatName(void) {
21763     int test_ret = 0;
21764
21765     int mem_base;
21766     xmlNodePtr ret_val;
21767     xmlNsPtr ns; /* namespace if any */
21768     int n_ns;
21769     xmlChar * name; /* the node name */
21770     int n_name;
21771
21772     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21773     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21774         mem_base = xmlMemBlocks();
21775         ns = gen_xmlNsPtr(n_ns, 0);
21776         name = gen_eaten_name(n_name, 1);
21777
21778         ret_val = xmlNewNodeEatName(ns, name);
21779         desret_xmlNodePtr(ret_val);
21780         call_tests++;
21781         des_xmlNsPtr(n_ns, ns, 0);
21782         des_eaten_name(n_name, name, 1);
21783         xmlResetLastError();
21784         if (mem_base != xmlMemBlocks()) {
21785             printf("Leak of %d blocks found in xmlNewNodeEatName",
21786                    xmlMemBlocks() - mem_base);
21787             test_ret++;
21788             printf(" %d", n_ns);
21789             printf(" %d", n_name);
21790             printf("\n");
21791         }
21792     }
21793     }
21794     function_tests++;
21795
21796     return(test_ret);
21797 }
21798
21799
21800 static int
21801 test_xmlNewNs(void) {
21802     int test_ret = 0;
21803
21804     int mem_base;
21805     xmlNsPtr ret_val;
21806     xmlNodePtr node; /* the element carrying the namespace */
21807     int n_node;
21808     xmlChar * href; /* the URI associated */
21809     int n_href;
21810     xmlChar * prefix; /* the prefix for the namespace */
21811     int n_prefix;
21812
21813     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21814     for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21815     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21816         mem_base = xmlMemBlocks();
21817         node = gen_xmlNodePtr(n_node, 0);
21818         href = gen_const_xmlChar_ptr(n_href, 1);
21819         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
21820
21821         ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
21822         if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
21823         desret_xmlNsPtr(ret_val);
21824         call_tests++;
21825         des_xmlNodePtr(n_node, node, 0);
21826         des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
21827         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
21828         xmlResetLastError();
21829         if (mem_base != xmlMemBlocks()) {
21830             printf("Leak of %d blocks found in xmlNewNs",
21831                    xmlMemBlocks() - mem_base);
21832             test_ret++;
21833             printf(" %d", n_node);
21834             printf(" %d", n_href);
21835             printf(" %d", n_prefix);
21836             printf("\n");
21837         }
21838     }
21839     }
21840     }
21841     function_tests++;
21842
21843     return(test_ret);
21844 }
21845
21846
21847 static int
21848 test_xmlNewNsProp(void) {
21849     int test_ret = 0;
21850
21851     int mem_base;
21852     xmlAttrPtr ret_val;
21853     xmlNodePtr node; /* the holding node */
21854     int n_node;
21855     xmlNsPtr ns; /* the namespace */
21856     int n_ns;
21857     xmlChar * name; /* the name of the attribute */
21858     int n_name;
21859     xmlChar * value; /* the value of the attribute */
21860     int n_value;
21861
21862     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21863     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21864     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21865     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21866         mem_base = xmlMemBlocks();
21867         node = gen_xmlNodePtr(n_node, 0);
21868         ns = gen_xmlNsPtr(n_ns, 1);
21869         name = gen_const_xmlChar_ptr(n_name, 2);
21870         value = gen_const_xmlChar_ptr(n_value, 3);
21871
21872         ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
21873         desret_xmlAttrPtr(ret_val);
21874         call_tests++;
21875         des_xmlNodePtr(n_node, node, 0);
21876         des_xmlNsPtr(n_ns, ns, 1);
21877         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21878         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21879         xmlResetLastError();
21880         if (mem_base != xmlMemBlocks()) {
21881             printf("Leak of %d blocks found in xmlNewNsProp",
21882                    xmlMemBlocks() - mem_base);
21883             test_ret++;
21884             printf(" %d", n_node);
21885             printf(" %d", n_ns);
21886             printf(" %d", n_name);
21887             printf(" %d", n_value);
21888             printf("\n");
21889         }
21890     }
21891     }
21892     }
21893     }
21894     function_tests++;
21895
21896     return(test_ret);
21897 }
21898
21899
21900 static int
21901 test_xmlNewNsPropEatName(void) {
21902     int test_ret = 0;
21903
21904     int mem_base;
21905     xmlAttrPtr ret_val;
21906     xmlNodePtr node; /* the holding node */
21907     int n_node;
21908     xmlNsPtr ns; /* the namespace */
21909     int n_ns;
21910     xmlChar * name; /* the name of the attribute */
21911     int n_name;
21912     xmlChar * value; /* the value of the attribute */
21913     int n_value;
21914
21915     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21916     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21917     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21918     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21919         mem_base = xmlMemBlocks();
21920         node = gen_xmlNodePtr(n_node, 0);
21921         ns = gen_xmlNsPtr(n_ns, 1);
21922         name = gen_eaten_name(n_name, 2);
21923         value = gen_const_xmlChar_ptr(n_value, 3);
21924
21925         ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
21926         desret_xmlAttrPtr(ret_val);
21927         call_tests++;
21928         des_xmlNodePtr(n_node, node, 0);
21929         des_xmlNsPtr(n_ns, ns, 1);
21930         des_eaten_name(n_name, name, 2);
21931         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21932         xmlResetLastError();
21933         if (mem_base != xmlMemBlocks()) {
21934             printf("Leak of %d blocks found in xmlNewNsPropEatName",
21935                    xmlMemBlocks() - mem_base);
21936             test_ret++;
21937             printf(" %d", n_node);
21938             printf(" %d", n_ns);
21939             printf(" %d", n_name);
21940             printf(" %d", n_value);
21941             printf("\n");
21942         }
21943     }
21944     }
21945     }
21946     }
21947     function_tests++;
21948
21949     return(test_ret);
21950 }
21951
21952
21953 static int
21954 test_xmlNewPI(void) {
21955     int test_ret = 0;
21956
21957     int mem_base;
21958     xmlNodePtr ret_val;
21959     xmlChar * name; /* the processing instruction name */
21960     int n_name;
21961     xmlChar * content; /* the PI content */
21962     int n_content;
21963
21964     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21965     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21966         mem_base = xmlMemBlocks();
21967         name = gen_const_xmlChar_ptr(n_name, 0);
21968         content = gen_const_xmlChar_ptr(n_content, 1);
21969
21970         ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
21971         desret_xmlNodePtr(ret_val);
21972         call_tests++;
21973         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
21974         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21975         xmlResetLastError();
21976         if (mem_base != xmlMemBlocks()) {
21977             printf("Leak of %d blocks found in xmlNewPI",
21978                    xmlMemBlocks() - mem_base);
21979             test_ret++;
21980             printf(" %d", n_name);
21981             printf(" %d", n_content);
21982             printf("\n");
21983         }
21984     }
21985     }
21986     function_tests++;
21987
21988     return(test_ret);
21989 }
21990
21991
21992 static int
21993 test_xmlNewProp(void) {
21994     int test_ret = 0;
21995
21996 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21997 #ifdef LIBXML_TREE_ENABLED
21998     int mem_base;
21999     xmlAttrPtr ret_val;
22000     xmlNodePtr node; /* the holding node */
22001     int n_node;
22002     xmlChar * name; /* the name of the attribute */
22003     int n_name;
22004     xmlChar * value; /* the value of the attribute */
22005     int n_value;
22006
22007     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22008     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22009     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22010         mem_base = xmlMemBlocks();
22011         node = gen_xmlNodePtr(n_node, 0);
22012         name = gen_const_xmlChar_ptr(n_name, 1);
22013         value = gen_const_xmlChar_ptr(n_value, 2);
22014
22015         ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
22016         desret_xmlAttrPtr(ret_val);
22017         call_tests++;
22018         des_xmlNodePtr(n_node, node, 0);
22019         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22020         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
22021         xmlResetLastError();
22022         if (mem_base != xmlMemBlocks()) {
22023             printf("Leak of %d blocks found in xmlNewProp",
22024                    xmlMemBlocks() - mem_base);
22025             test_ret++;
22026             printf(" %d", n_node);
22027             printf(" %d", n_name);
22028             printf(" %d", n_value);
22029             printf("\n");
22030         }
22031     }
22032     }
22033     }
22034     function_tests++;
22035 #endif
22036 #endif
22037
22038     return(test_ret);
22039 }
22040
22041
22042 static int
22043 test_xmlNewReference(void) {
22044     int test_ret = 0;
22045
22046     int mem_base;
22047     xmlNodePtr ret_val;
22048     xmlDoc * doc; /* the document */
22049     int n_doc;
22050     xmlChar * name; /* the reference name, or the reference string with & and ; */
22051     int n_name;
22052
22053     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
22054     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22055         mem_base = xmlMemBlocks();
22056         doc = gen_const_xmlDoc_ptr(n_doc, 0);
22057         name = gen_const_xmlChar_ptr(n_name, 1);
22058
22059         ret_val = xmlNewReference((const xmlDoc *)doc, (const xmlChar *)name);
22060         desret_xmlNodePtr(ret_val);
22061         call_tests++;
22062         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
22063         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22064         xmlResetLastError();
22065         if (mem_base != xmlMemBlocks()) {
22066             printf("Leak of %d blocks found in xmlNewReference",
22067                    xmlMemBlocks() - mem_base);
22068             test_ret++;
22069             printf(" %d", n_doc);
22070             printf(" %d", n_name);
22071             printf("\n");
22072         }
22073     }
22074     }
22075     function_tests++;
22076
22077     return(test_ret);
22078 }
22079
22080
22081 static int
22082 test_xmlNewText(void) {
22083     int test_ret = 0;
22084
22085     int mem_base;
22086     xmlNodePtr ret_val;
22087     xmlChar * content; /* the text content */
22088     int n_content;
22089
22090     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22091         mem_base = xmlMemBlocks();
22092         content = gen_const_xmlChar_ptr(n_content, 0);
22093
22094         ret_val = xmlNewText((const xmlChar *)content);
22095         desret_xmlNodePtr(ret_val);
22096         call_tests++;
22097         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
22098         xmlResetLastError();
22099         if (mem_base != xmlMemBlocks()) {
22100             printf("Leak of %d blocks found in xmlNewText",
22101                    xmlMemBlocks() - mem_base);
22102             test_ret++;
22103             printf(" %d", n_content);
22104             printf("\n");
22105         }
22106     }
22107     function_tests++;
22108
22109     return(test_ret);
22110 }
22111
22112
22113 static int
22114 test_xmlNewTextChild(void) {
22115     int test_ret = 0;
22116
22117 #if defined(LIBXML_TREE_ENABLED)
22118 #ifdef LIBXML_TREE_ENABLED
22119     int mem_base;
22120     xmlNodePtr ret_val;
22121     xmlNodePtr parent; /* the parent node */
22122     int n_parent;
22123     xmlNsPtr ns; /* a namespace if any */
22124     int n_ns;
22125     xmlChar * name; /* the name of the child */
22126     int n_name;
22127     xmlChar * content; /* the text content of the child if any. */
22128     int n_content;
22129
22130     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
22131     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22132     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22133     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22134         mem_base = xmlMemBlocks();
22135         parent = gen_xmlNodePtr(n_parent, 0);
22136         ns = gen_xmlNsPtr(n_ns, 1);
22137         name = gen_const_xmlChar_ptr(n_name, 2);
22138         content = gen_const_xmlChar_ptr(n_content, 3);
22139
22140         ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
22141         desret_xmlNodePtr(ret_val);
22142         call_tests++;
22143         des_xmlNodePtr(n_parent, parent, 0);
22144         des_xmlNsPtr(n_ns, ns, 1);
22145         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
22146         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
22147         xmlResetLastError();
22148         if (mem_base != xmlMemBlocks()) {
22149             printf("Leak of %d blocks found in xmlNewTextChild",
22150                    xmlMemBlocks() - mem_base);
22151             test_ret++;
22152             printf(" %d", n_parent);
22153             printf(" %d", n_ns);
22154             printf(" %d", n_name);
22155             printf(" %d", n_content);
22156             printf("\n");
22157         }
22158     }
22159     }
22160     }
22161     }
22162     function_tests++;
22163 #endif
22164 #endif
22165
22166     return(test_ret);
22167 }
22168
22169
22170 static int
22171 test_xmlNewTextLen(void) {
22172     int test_ret = 0;
22173
22174     int mem_base;
22175     xmlNodePtr ret_val;
22176     xmlChar * content; /* the text content */
22177     int n_content;
22178     int len; /* the text len. */
22179     int n_len;
22180
22181     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22182     for (n_len = 0;n_len < gen_nb_int;n_len++) {
22183         mem_base = xmlMemBlocks();
22184         content = gen_const_xmlChar_ptr(n_content, 0);
22185         len = gen_int(n_len, 1);
22186         if ((content != NULL) &&
22187             (len > (int) strlen((const char *) content) + 1))
22188             continue;
22189
22190         ret_val = xmlNewTextLen((const xmlChar *)content, len);
22191         desret_xmlNodePtr(ret_val);
22192         call_tests++;
22193         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
22194         des_int(n_len, len, 1);
22195         xmlResetLastError();
22196         if (mem_base != xmlMemBlocks()) {
22197             printf("Leak of %d blocks found in xmlNewTextLen",
22198                    xmlMemBlocks() - mem_base);
22199             test_ret++;
22200             printf(" %d", n_content);
22201             printf(" %d", n_len);
22202             printf("\n");
22203         }
22204     }
22205     }
22206     function_tests++;
22207
22208     return(test_ret);
22209 }
22210
22211
22212 static int
22213 test_xmlNextElementSibling(void) {
22214     int test_ret = 0;
22215
22216 #if defined(LIBXML_TREE_ENABLED)
22217     int mem_base;
22218     xmlNodePtr ret_val;
22219     xmlNodePtr node; /* the current node */
22220     int n_node;
22221
22222     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22223         mem_base = xmlMemBlocks();
22224         node = gen_xmlNodePtr(n_node, 0);
22225
22226         ret_val = xmlNextElementSibling(node);
22227         desret_xmlNodePtr(ret_val);
22228         call_tests++;
22229         des_xmlNodePtr(n_node, node, 0);
22230         xmlResetLastError();
22231         if (mem_base != xmlMemBlocks()) {
22232             printf("Leak of %d blocks found in xmlNextElementSibling",
22233                    xmlMemBlocks() - mem_base);
22234             test_ret++;
22235             printf(" %d", n_node);
22236             printf("\n");
22237         }
22238     }
22239     function_tests++;
22240 #endif
22241
22242     return(test_ret);
22243 }
22244
22245
22246 static int
22247 test_xmlNodeAddContent(void) {
22248     int test_ret = 0;
22249
22250     int mem_base;
22251     xmlNodePtr cur; /* the node being modified */
22252     int n_cur;
22253     xmlChar * content; /* extra content */
22254     int n_content;
22255
22256     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22257     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22258         mem_base = xmlMemBlocks();
22259         cur = gen_xmlNodePtr(n_cur, 0);
22260         content = gen_const_xmlChar_ptr(n_content, 1);
22261
22262         xmlNodeAddContent(cur, (const xmlChar *)content);
22263         call_tests++;
22264         des_xmlNodePtr(n_cur, cur, 0);
22265         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22266         xmlResetLastError();
22267         if (mem_base != xmlMemBlocks()) {
22268             printf("Leak of %d blocks found in xmlNodeAddContent",
22269                    xmlMemBlocks() - mem_base);
22270             test_ret++;
22271             printf(" %d", n_cur);
22272             printf(" %d", n_content);
22273             printf("\n");
22274         }
22275     }
22276     }
22277     function_tests++;
22278
22279     return(test_ret);
22280 }
22281
22282
22283 static int
22284 test_xmlNodeAddContentLen(void) {
22285     int test_ret = 0;
22286
22287     int mem_base;
22288     xmlNodePtr cur; /* the node being modified */
22289     int n_cur;
22290     xmlChar * content; /* extra content */
22291     int n_content;
22292     int len; /* the size of @content */
22293     int n_len;
22294
22295     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22296     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22297     for (n_len = 0;n_len < gen_nb_int;n_len++) {
22298         mem_base = xmlMemBlocks();
22299         cur = gen_xmlNodePtr(n_cur, 0);
22300         content = gen_const_xmlChar_ptr(n_content, 1);
22301         len = gen_int(n_len, 2);
22302         if ((content != NULL) &&
22303             (len > (int) strlen((const char *) content) + 1))
22304             continue;
22305
22306         xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
22307         call_tests++;
22308         des_xmlNodePtr(n_cur, cur, 0);
22309         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22310         des_int(n_len, len, 2);
22311         xmlResetLastError();
22312         if (mem_base != xmlMemBlocks()) {
22313             printf("Leak of %d blocks found in xmlNodeAddContentLen",
22314                    xmlMemBlocks() - mem_base);
22315             test_ret++;
22316             printf(" %d", n_cur);
22317             printf(" %d", n_content);
22318             printf(" %d", n_len);
22319             printf("\n");
22320         }
22321     }
22322     }
22323     }
22324     function_tests++;
22325
22326     return(test_ret);
22327 }
22328
22329
22330 static int
22331 test_xmlNodeBufGetContent(void) {
22332     int test_ret = 0;
22333
22334     int mem_base;
22335     int ret_val;
22336     xmlBufferPtr buffer; /* a buffer */
22337     int n_buffer;
22338     xmlNode * cur; /* the node being read */
22339     int n_cur;
22340
22341     for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
22342     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22343         mem_base = xmlMemBlocks();
22344         buffer = gen_xmlBufferPtr(n_buffer, 0);
22345         cur = gen_const_xmlNode_ptr(n_cur, 1);
22346
22347         ret_val = xmlNodeBufGetContent(buffer, (const xmlNode *)cur);
22348         desret_int(ret_val);
22349         call_tests++;
22350         des_xmlBufferPtr(n_buffer, buffer, 0);
22351         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
22352         xmlResetLastError();
22353         if (mem_base != xmlMemBlocks()) {
22354             printf("Leak of %d blocks found in xmlNodeBufGetContent",
22355                    xmlMemBlocks() - mem_base);
22356             test_ret++;
22357             printf(" %d", n_buffer);
22358             printf(" %d", n_cur);
22359             printf("\n");
22360         }
22361     }
22362     }
22363     function_tests++;
22364
22365     return(test_ret);
22366 }
22367
22368
22369 static int
22370 test_xmlNodeDump(void) {
22371     int test_ret = 0;
22372
22373 #if defined(LIBXML_OUTPUT_ENABLED)
22374     int mem_base;
22375     int ret_val;
22376     xmlBufferPtr buf; /* the XML buffer output */
22377     int n_buf;
22378     xmlDocPtr doc; /* the document */
22379     int n_doc;
22380     xmlNodePtr cur; /* the current node */
22381     int n_cur;
22382     int level; /* the imbrication level for indenting */
22383     int n_level;
22384     int format; /* is formatting allowed */
22385     int n_format;
22386
22387     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
22388     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22389     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22390     for (n_level = 0;n_level < gen_nb_int;n_level++) {
22391     for (n_format = 0;n_format < gen_nb_int;n_format++) {
22392         mem_base = xmlMemBlocks();
22393         buf = gen_xmlBufferPtr(n_buf, 0);
22394         doc = gen_xmlDocPtr(n_doc, 1);
22395         cur = gen_xmlNodePtr(n_cur, 2);
22396         level = gen_int(n_level, 3);
22397         format = gen_int(n_format, 4);
22398
22399         ret_val = xmlNodeDump(buf, doc, cur, level, format);
22400         desret_int(ret_val);
22401         call_tests++;
22402         des_xmlBufferPtr(n_buf, buf, 0);
22403         des_xmlDocPtr(n_doc, doc, 1);
22404         des_xmlNodePtr(n_cur, cur, 2);
22405         des_int(n_level, level, 3);
22406         des_int(n_format, format, 4);
22407         xmlResetLastError();
22408         if (mem_base != xmlMemBlocks()) {
22409             printf("Leak of %d blocks found in xmlNodeDump",
22410                    xmlMemBlocks() - mem_base);
22411             test_ret++;
22412             printf(" %d", n_buf);
22413             printf(" %d", n_doc);
22414             printf(" %d", n_cur);
22415             printf(" %d", n_level);
22416             printf(" %d", n_format);
22417             printf("\n");
22418         }
22419     }
22420     }
22421     }
22422     }
22423     }
22424     function_tests++;
22425 #endif
22426
22427     return(test_ret);
22428 }
22429
22430
22431 static int
22432 test_xmlNodeDumpOutput(void) {
22433     int test_ret = 0;
22434
22435 #if defined(LIBXML_OUTPUT_ENABLED)
22436     int mem_base;
22437     xmlOutputBufferPtr buf; /* the XML buffer output */
22438     int n_buf;
22439     xmlDocPtr doc; /* the document */
22440     int n_doc;
22441     xmlNodePtr cur; /* the current node */
22442     int n_cur;
22443     int level; /* the imbrication level for indenting */
22444     int n_level;
22445     int format; /* is formatting allowed */
22446     int n_format;
22447     char * encoding; /* an optional encoding string */
22448     int n_encoding;
22449
22450     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22451     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22452     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22453     for (n_level = 0;n_level < gen_nb_int;n_level++) {
22454     for (n_format = 0;n_format < gen_nb_int;n_format++) {
22455     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22456         mem_base = xmlMemBlocks();
22457         buf = gen_xmlOutputBufferPtr(n_buf, 0);
22458         doc = gen_xmlDocPtr(n_doc, 1);
22459         cur = gen_xmlNodePtr(n_cur, 2);
22460         level = gen_int(n_level, 3);
22461         format = gen_int(n_format, 4);
22462         encoding = gen_const_char_ptr(n_encoding, 5);
22463
22464         xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
22465         call_tests++;
22466         des_xmlOutputBufferPtr(n_buf, buf, 0);
22467         des_xmlDocPtr(n_doc, doc, 1);
22468         des_xmlNodePtr(n_cur, cur, 2);
22469         des_int(n_level, level, 3);
22470         des_int(n_format, format, 4);
22471         des_const_char_ptr(n_encoding, (const char *)encoding, 5);
22472         xmlResetLastError();
22473         if (mem_base != xmlMemBlocks()) {
22474             printf("Leak of %d blocks found in xmlNodeDumpOutput",
22475                    xmlMemBlocks() - mem_base);
22476             test_ret++;
22477             printf(" %d", n_buf);
22478             printf(" %d", n_doc);
22479             printf(" %d", n_cur);
22480             printf(" %d", n_level);
22481             printf(" %d", n_format);
22482             printf(" %d", n_encoding);
22483             printf("\n");
22484         }
22485     }
22486     }
22487     }
22488     }
22489     }
22490     }
22491     function_tests++;
22492 #endif
22493
22494     return(test_ret);
22495 }
22496
22497
22498 static int
22499 test_xmlNodeGetBase(void) {
22500     int test_ret = 0;
22501
22502     int mem_base;
22503     xmlChar * ret_val;
22504     xmlDoc * doc; /* the document the node pertains to */
22505     int n_doc;
22506     xmlNode * cur; /* the node being checked */
22507     int n_cur;
22508
22509     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
22510     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22511         mem_base = xmlMemBlocks();
22512         doc = gen_const_xmlDoc_ptr(n_doc, 0);
22513         cur = gen_const_xmlNode_ptr(n_cur, 1);
22514
22515         ret_val = xmlNodeGetBase((const xmlDoc *)doc, (const xmlNode *)cur);
22516         desret_xmlChar_ptr(ret_val);
22517         call_tests++;
22518         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
22519         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
22520         xmlResetLastError();
22521         if (mem_base != xmlMemBlocks()) {
22522             printf("Leak of %d blocks found in xmlNodeGetBase",
22523                    xmlMemBlocks() - mem_base);
22524             test_ret++;
22525             printf(" %d", n_doc);
22526             printf(" %d", n_cur);
22527             printf("\n");
22528         }
22529     }
22530     }
22531     function_tests++;
22532
22533     return(test_ret);
22534 }
22535
22536
22537 static int
22538 test_xmlNodeGetContent(void) {
22539     int test_ret = 0;
22540
22541     int mem_base;
22542     xmlChar * ret_val;
22543     xmlNode * cur; /* the node being read */
22544     int n_cur;
22545
22546     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22547         mem_base = xmlMemBlocks();
22548         cur = gen_const_xmlNode_ptr(n_cur, 0);
22549
22550         ret_val = xmlNodeGetContent((const xmlNode *)cur);
22551         desret_xmlChar_ptr(ret_val);
22552         call_tests++;
22553         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
22554         xmlResetLastError();
22555         if (mem_base != xmlMemBlocks()) {
22556             printf("Leak of %d blocks found in xmlNodeGetContent",
22557                    xmlMemBlocks() - mem_base);
22558             test_ret++;
22559             printf(" %d", n_cur);
22560             printf("\n");
22561         }
22562     }
22563     function_tests++;
22564
22565     return(test_ret);
22566 }
22567
22568
22569 static int
22570 test_xmlNodeGetLang(void) {
22571     int test_ret = 0;
22572
22573     int mem_base;
22574     xmlChar * ret_val;
22575     xmlNode * cur; /* the node being checked */
22576     int n_cur;
22577
22578     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22579         mem_base = xmlMemBlocks();
22580         cur = gen_const_xmlNode_ptr(n_cur, 0);
22581
22582         ret_val = xmlNodeGetLang((const xmlNode *)cur);
22583         desret_xmlChar_ptr(ret_val);
22584         call_tests++;
22585         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
22586         xmlResetLastError();
22587         if (mem_base != xmlMemBlocks()) {
22588             printf("Leak of %d blocks found in xmlNodeGetLang",
22589                    xmlMemBlocks() - mem_base);
22590             test_ret++;
22591             printf(" %d", n_cur);
22592             printf("\n");
22593         }
22594     }
22595     function_tests++;
22596
22597     return(test_ret);
22598 }
22599
22600
22601 static int
22602 test_xmlNodeGetSpacePreserve(void) {
22603     int test_ret = 0;
22604
22605     int mem_base;
22606     int ret_val;
22607     xmlNode * cur; /* the node being checked */
22608     int n_cur;
22609
22610     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22611         mem_base = xmlMemBlocks();
22612         cur = gen_const_xmlNode_ptr(n_cur, 0);
22613
22614         ret_val = xmlNodeGetSpacePreserve((const xmlNode *)cur);
22615         desret_int(ret_val);
22616         call_tests++;
22617         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
22618         xmlResetLastError();
22619         if (mem_base != xmlMemBlocks()) {
22620             printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
22621                    xmlMemBlocks() - mem_base);
22622             test_ret++;
22623             printf(" %d", n_cur);
22624             printf("\n");
22625         }
22626     }
22627     function_tests++;
22628
22629     return(test_ret);
22630 }
22631
22632
22633 static int
22634 test_xmlNodeIsText(void) {
22635     int test_ret = 0;
22636
22637     int mem_base;
22638     int ret_val;
22639     xmlNode * node; /* the node */
22640     int n_node;
22641
22642     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
22643         mem_base = xmlMemBlocks();
22644         node = gen_const_xmlNode_ptr(n_node, 0);
22645
22646         ret_val = xmlNodeIsText((const xmlNode *)node);
22647         desret_int(ret_val);
22648         call_tests++;
22649         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
22650         xmlResetLastError();
22651         if (mem_base != xmlMemBlocks()) {
22652             printf("Leak of %d blocks found in xmlNodeIsText",
22653                    xmlMemBlocks() - mem_base);
22654             test_ret++;
22655             printf(" %d", n_node);
22656             printf("\n");
22657         }
22658     }
22659     function_tests++;
22660
22661     return(test_ret);
22662 }
22663
22664
22665 static int
22666 test_xmlNodeListGetRawString(void) {
22667     int test_ret = 0;
22668
22669 #if defined(LIBXML_TREE_ENABLED)
22670     int mem_base;
22671     xmlChar * ret_val;
22672     xmlDoc * doc; /* the document */
22673     int n_doc;
22674     xmlNode * list; /* a Node list */
22675     int n_list;
22676     int inLine; /* should we replace entity contents or show their external form */
22677     int n_inLine;
22678
22679     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
22680     for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) {
22681     for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22682         mem_base = xmlMemBlocks();
22683         doc = gen_const_xmlDoc_ptr(n_doc, 0);
22684         list = gen_const_xmlNode_ptr(n_list, 1);
22685         inLine = gen_int(n_inLine, 2);
22686
22687         ret_val = xmlNodeListGetRawString((const xmlDoc *)doc, (const xmlNode *)list, inLine);
22688         desret_xmlChar_ptr(ret_val);
22689         call_tests++;
22690         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
22691         des_const_xmlNode_ptr(n_list, (const xmlNode *)list, 1);
22692         des_int(n_inLine, inLine, 2);
22693         xmlResetLastError();
22694         if (mem_base != xmlMemBlocks()) {
22695             printf("Leak of %d blocks found in xmlNodeListGetRawString",
22696                    xmlMemBlocks() - mem_base);
22697             test_ret++;
22698             printf(" %d", n_doc);
22699             printf(" %d", n_list);
22700             printf(" %d", n_inLine);
22701             printf("\n");
22702         }
22703     }
22704     }
22705     }
22706     function_tests++;
22707 #endif
22708
22709     return(test_ret);
22710 }
22711
22712
22713 static int
22714 test_xmlNodeListGetString(void) {
22715     int test_ret = 0;
22716
22717     int mem_base;
22718     xmlChar * ret_val;
22719     xmlDocPtr doc; /* the document */
22720     int n_doc;
22721     xmlNode * list; /* a Node list */
22722     int n_list;
22723     int inLine; /* should we replace entity contents or show their external form */
22724     int n_inLine;
22725
22726     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22727     for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) {
22728     for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22729         mem_base = xmlMemBlocks();
22730         doc = gen_xmlDocPtr(n_doc, 0);
22731         list = gen_const_xmlNode_ptr(n_list, 1);
22732         inLine = gen_int(n_inLine, 2);
22733
22734         ret_val = xmlNodeListGetString(doc, (const xmlNode *)list, inLine);
22735         desret_xmlChar_ptr(ret_val);
22736         call_tests++;
22737         des_xmlDocPtr(n_doc, doc, 0);
22738         des_const_xmlNode_ptr(n_list, (const xmlNode *)list, 1);
22739         des_int(n_inLine, inLine, 2);
22740         xmlResetLastError();
22741         if (mem_base != xmlMemBlocks()) {
22742             printf("Leak of %d blocks found in xmlNodeListGetString",
22743                    xmlMemBlocks() - mem_base);
22744             test_ret++;
22745             printf(" %d", n_doc);
22746             printf(" %d", n_list);
22747             printf(" %d", n_inLine);
22748             printf("\n");
22749         }
22750     }
22751     }
22752     }
22753     function_tests++;
22754
22755     return(test_ret);
22756 }
22757
22758
22759 static int
22760 test_xmlNodeSetBase(void) {
22761     int test_ret = 0;
22762
22763 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
22764     int mem_base;
22765     xmlNodePtr cur; /* the node being changed */
22766     int n_cur;
22767     xmlChar * uri; /* the new base URI */
22768     int n_uri;
22769
22770     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22771     for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
22772         mem_base = xmlMemBlocks();
22773         cur = gen_xmlNodePtr(n_cur, 0);
22774         uri = gen_const_xmlChar_ptr(n_uri, 1);
22775
22776         xmlNodeSetBase(cur, (const xmlChar *)uri);
22777         call_tests++;
22778         des_xmlNodePtr(n_cur, cur, 0);
22779         des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
22780         xmlResetLastError();
22781         if (mem_base != xmlMemBlocks()) {
22782             printf("Leak of %d blocks found in xmlNodeSetBase",
22783                    xmlMemBlocks() - mem_base);
22784             test_ret++;
22785             printf(" %d", n_cur);
22786             printf(" %d", n_uri);
22787             printf("\n");
22788         }
22789     }
22790     }
22791     function_tests++;
22792 #endif
22793
22794     return(test_ret);
22795 }
22796
22797
22798 static int
22799 test_xmlNodeSetContent(void) {
22800     int test_ret = 0;
22801
22802     int mem_base;
22803     xmlNodePtr cur; /* the node being modified */
22804     int n_cur;
22805     xmlChar * content; /* the new value of the content */
22806     int n_content;
22807
22808     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22809     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22810         mem_base = xmlMemBlocks();
22811         cur = gen_xmlNodePtr(n_cur, 0);
22812         content = gen_const_xmlChar_ptr(n_content, 1);
22813
22814         xmlNodeSetContent(cur, (const xmlChar *)content);
22815         call_tests++;
22816         des_xmlNodePtr(n_cur, cur, 0);
22817         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22818         xmlResetLastError();
22819         if (mem_base != xmlMemBlocks()) {
22820             printf("Leak of %d blocks found in xmlNodeSetContent",
22821                    xmlMemBlocks() - mem_base);
22822             test_ret++;
22823             printf(" %d", n_cur);
22824             printf(" %d", n_content);
22825             printf("\n");
22826         }
22827     }
22828     }
22829     function_tests++;
22830
22831     return(test_ret);
22832 }
22833
22834
22835 static int
22836 test_xmlNodeSetContentLen(void) {
22837     int test_ret = 0;
22838
22839 #if defined(LIBXML_TREE_ENABLED)
22840     int mem_base;
22841     xmlNodePtr cur; /* the node being modified */
22842     int n_cur;
22843     xmlChar * content; /* the new value of the content */
22844     int n_content;
22845     int len; /* the size of @content */
22846     int n_len;
22847
22848     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22849     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22850     for (n_len = 0;n_len < gen_nb_int;n_len++) {
22851         mem_base = xmlMemBlocks();
22852         cur = gen_xmlNodePtr(n_cur, 0);
22853         content = gen_const_xmlChar_ptr(n_content, 1);
22854         len = gen_int(n_len, 2);
22855         if ((content != NULL) &&
22856             (len > (int) strlen((const char *) content) + 1))
22857             continue;
22858
22859         xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
22860         call_tests++;
22861         des_xmlNodePtr(n_cur, cur, 0);
22862         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22863         des_int(n_len, len, 2);
22864         xmlResetLastError();
22865         if (mem_base != xmlMemBlocks()) {
22866             printf("Leak of %d blocks found in xmlNodeSetContentLen",
22867                    xmlMemBlocks() - mem_base);
22868             test_ret++;
22869             printf(" %d", n_cur);
22870             printf(" %d", n_content);
22871             printf(" %d", n_len);
22872             printf("\n");
22873         }
22874     }
22875     }
22876     }
22877     function_tests++;
22878 #endif
22879
22880     return(test_ret);
22881 }
22882
22883
22884 static int
22885 test_xmlNodeSetLang(void) {
22886     int test_ret = 0;
22887
22888 #if defined(LIBXML_TREE_ENABLED)
22889     int mem_base;
22890     xmlNodePtr cur; /* the node being changed */
22891     int n_cur;
22892     xmlChar * lang; /* the language description */
22893     int n_lang;
22894
22895     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22896     for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
22897         mem_base = xmlMemBlocks();
22898         cur = gen_xmlNodePtr(n_cur, 0);
22899         lang = gen_const_xmlChar_ptr(n_lang, 1);
22900
22901         xmlNodeSetLang(cur, (const xmlChar *)lang);
22902         call_tests++;
22903         des_xmlNodePtr(n_cur, cur, 0);
22904         des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
22905         xmlResetLastError();
22906         if (mem_base != xmlMemBlocks()) {
22907             printf("Leak of %d blocks found in xmlNodeSetLang",
22908                    xmlMemBlocks() - mem_base);
22909             test_ret++;
22910             printf(" %d", n_cur);
22911             printf(" %d", n_lang);
22912             printf("\n");
22913         }
22914     }
22915     }
22916     function_tests++;
22917 #endif
22918
22919     return(test_ret);
22920 }
22921
22922
22923 static int
22924 test_xmlNodeSetName(void) {
22925     int test_ret = 0;
22926
22927 #if defined(LIBXML_TREE_ENABLED)
22928     int mem_base;
22929     xmlNodePtr cur; /* the node being changed */
22930     int n_cur;
22931     xmlChar * name; /* the new tag name */
22932     int n_name;
22933
22934     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22935     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22936         mem_base = xmlMemBlocks();
22937         cur = gen_xmlNodePtr(n_cur, 0);
22938         name = gen_const_xmlChar_ptr(n_name, 1);
22939
22940         xmlNodeSetName(cur, (const xmlChar *)name);
22941         call_tests++;
22942         des_xmlNodePtr(n_cur, cur, 0);
22943         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22944         xmlResetLastError();
22945         if (mem_base != xmlMemBlocks()) {
22946             printf("Leak of %d blocks found in xmlNodeSetName",
22947                    xmlMemBlocks() - mem_base);
22948             test_ret++;
22949             printf(" %d", n_cur);
22950             printf(" %d", n_name);
22951             printf("\n");
22952         }
22953     }
22954     }
22955     function_tests++;
22956 #endif
22957
22958     return(test_ret);
22959 }
22960
22961
22962 static int
22963 test_xmlNodeSetSpacePreserve(void) {
22964     int test_ret = 0;
22965
22966 #if defined(LIBXML_TREE_ENABLED)
22967     int mem_base;
22968     xmlNodePtr cur; /* the node being changed */
22969     int n_cur;
22970     int val; /* the xml:space value ("0": default, 1: "preserve") */
22971     int n_val;
22972
22973     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22974     for (n_val = 0;n_val < gen_nb_int;n_val++) {
22975         mem_base = xmlMemBlocks();
22976         cur = gen_xmlNodePtr(n_cur, 0);
22977         val = gen_int(n_val, 1);
22978
22979         xmlNodeSetSpacePreserve(cur, val);
22980         call_tests++;
22981         des_xmlNodePtr(n_cur, cur, 0);
22982         des_int(n_val, val, 1);
22983         xmlResetLastError();
22984         if (mem_base != xmlMemBlocks()) {
22985             printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
22986                    xmlMemBlocks() - mem_base);
22987             test_ret++;
22988             printf(" %d", n_cur);
22989             printf(" %d", n_val);
22990             printf("\n");
22991         }
22992     }
22993     }
22994     function_tests++;
22995 #endif
22996
22997     return(test_ret);
22998 }
22999
23000
23001 static int
23002 test_xmlPreviousElementSibling(void) {
23003     int test_ret = 0;
23004
23005 #if defined(LIBXML_TREE_ENABLED)
23006     int mem_base;
23007     xmlNodePtr ret_val;
23008     xmlNodePtr node; /* the current node */
23009     int n_node;
23010
23011     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23012         mem_base = xmlMemBlocks();
23013         node = gen_xmlNodePtr(n_node, 0);
23014
23015         ret_val = xmlPreviousElementSibling(node);
23016         desret_xmlNodePtr(ret_val);
23017         call_tests++;
23018         des_xmlNodePtr(n_node, node, 0);
23019         xmlResetLastError();
23020         if (mem_base != xmlMemBlocks()) {
23021             printf("Leak of %d blocks found in xmlPreviousElementSibling",
23022                    xmlMemBlocks() - mem_base);
23023             test_ret++;
23024             printf(" %d", n_node);
23025             printf("\n");
23026         }
23027     }
23028     function_tests++;
23029 #endif
23030
23031     return(test_ret);
23032 }
23033
23034
23035 static int
23036 test_xmlReconciliateNs(void) {
23037     int test_ret = 0;
23038
23039 #if defined(LIBXML_TREE_ENABLED)
23040 #ifdef LIBXML_TREE_ENABLED
23041     int mem_base;
23042     int ret_val;
23043     xmlDocPtr doc; /* the document */
23044     int n_doc;
23045     xmlNodePtr tree; /* a node defining the subtree to reconciliate */
23046     int n_tree;
23047
23048     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23049     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
23050         mem_base = xmlMemBlocks();
23051         doc = gen_xmlDocPtr(n_doc, 0);
23052         tree = gen_xmlNodePtr(n_tree, 1);
23053
23054         ret_val = xmlReconciliateNs(doc, tree);
23055         desret_int(ret_val);
23056         call_tests++;
23057         des_xmlDocPtr(n_doc, doc, 0);
23058         des_xmlNodePtr(n_tree, tree, 1);
23059         xmlResetLastError();
23060         if (mem_base != xmlMemBlocks()) {
23061             printf("Leak of %d blocks found in xmlReconciliateNs",
23062                    xmlMemBlocks() - mem_base);
23063             test_ret++;
23064             printf(" %d", n_doc);
23065             printf(" %d", n_tree);
23066             printf("\n");
23067         }
23068     }
23069     }
23070     function_tests++;
23071 #endif
23072 #endif
23073
23074     return(test_ret);
23075 }
23076
23077
23078 static int
23079 test_xmlRemoveProp(void) {
23080     int test_ret = 0;
23081
23082     int mem_base;
23083     int ret_val;
23084     xmlAttrPtr cur; /* an attribute */
23085     int n_cur;
23086
23087     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
23088         mem_base = xmlMemBlocks();
23089         cur = gen_xmlAttrPtr(n_cur, 0);
23090
23091         ret_val = xmlRemoveProp(cur);
23092         cur = NULL;
23093         desret_int(ret_val);
23094         call_tests++;
23095         des_xmlAttrPtr(n_cur, cur, 0);
23096         xmlResetLastError();
23097         if (mem_base != xmlMemBlocks()) {
23098             printf("Leak of %d blocks found in xmlRemoveProp",
23099                    xmlMemBlocks() - mem_base);
23100             test_ret++;
23101             printf(" %d", n_cur);
23102             printf("\n");
23103         }
23104     }
23105     function_tests++;
23106
23107     return(test_ret);
23108 }
23109
23110
23111 static int
23112 test_xmlReplaceNode(void) {
23113     int test_ret = 0;
23114
23115 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
23116     int mem_base;
23117     xmlNodePtr ret_val;
23118     xmlNodePtr old; /* the old node */
23119     int n_old;
23120     xmlNodePtr cur; /* the node */
23121     int n_cur;
23122
23123     for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
23124     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
23125         mem_base = xmlMemBlocks();
23126         old = gen_xmlNodePtr(n_old, 0);
23127         cur = gen_xmlNodePtr_in(n_cur, 1);
23128
23129         ret_val = xmlReplaceNode(old, cur);
23130         if (cur != NULL) {
23131               xmlUnlinkNode(cur);
23132               xmlFreeNode(cur) ; cur = NULL ; }
23133           if (old != NULL) {
23134               xmlUnlinkNode(old);
23135               xmlFreeNode(old) ; old = NULL ; }
23136           ret_val = NULL;
23137         desret_xmlNodePtr(ret_val);
23138         call_tests++;
23139         des_xmlNodePtr(n_old, old, 0);
23140         des_xmlNodePtr_in(n_cur, cur, 1);
23141         xmlResetLastError();
23142         if (mem_base != xmlMemBlocks()) {
23143             printf("Leak of %d blocks found in xmlReplaceNode",
23144                    xmlMemBlocks() - mem_base);
23145             test_ret++;
23146             printf(" %d", n_old);
23147             printf(" %d", n_cur);
23148             printf("\n");
23149         }
23150     }
23151     }
23152     function_tests++;
23153 #endif
23154
23155     return(test_ret);
23156 }
23157
23158
23159 static int
23160 test_xmlSaveFile(void) {
23161     int test_ret = 0;
23162
23163 #if defined(LIBXML_OUTPUT_ENABLED)
23164     int mem_base;
23165     int ret_val;
23166     const char * filename; /* the filename (or URL) */
23167     int n_filename;
23168     xmlDocPtr cur; /* the document */
23169     int n_cur;
23170
23171     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23172     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23173         mem_base = xmlMemBlocks();
23174         filename = gen_fileoutput(n_filename, 0);
23175         cur = gen_xmlDocPtr(n_cur, 1);
23176
23177         ret_val = xmlSaveFile(filename, cur);
23178         desret_int(ret_val);
23179         call_tests++;
23180         des_fileoutput(n_filename, filename, 0);
23181         des_xmlDocPtr(n_cur, cur, 1);
23182         xmlResetLastError();
23183         if (mem_base != xmlMemBlocks()) {
23184             printf("Leak of %d blocks found in xmlSaveFile",
23185                    xmlMemBlocks() - mem_base);
23186             test_ret++;
23187             printf(" %d", n_filename);
23188             printf(" %d", n_cur);
23189             printf("\n");
23190         }
23191     }
23192     }
23193     function_tests++;
23194 #endif
23195
23196     return(test_ret);
23197 }
23198
23199
23200 static int
23201 test_xmlSaveFileEnc(void) {
23202     int test_ret = 0;
23203
23204 #if defined(LIBXML_OUTPUT_ENABLED)
23205     int mem_base;
23206     int ret_val;
23207     const char * filename; /* the filename (or URL) */
23208     int n_filename;
23209     xmlDocPtr cur; /* the document */
23210     int n_cur;
23211     char * encoding; /* the name of an encoding (or NULL) */
23212     int n_encoding;
23213
23214     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23215     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23216     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23217         mem_base = xmlMemBlocks();
23218         filename = gen_fileoutput(n_filename, 0);
23219         cur = gen_xmlDocPtr(n_cur, 1);
23220         encoding = gen_const_char_ptr(n_encoding, 2);
23221
23222         ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
23223         desret_int(ret_val);
23224         call_tests++;
23225         des_fileoutput(n_filename, filename, 0);
23226         des_xmlDocPtr(n_cur, cur, 1);
23227         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23228         xmlResetLastError();
23229         if (mem_base != xmlMemBlocks()) {
23230             printf("Leak of %d blocks found in xmlSaveFileEnc",
23231                    xmlMemBlocks() - mem_base);
23232             test_ret++;
23233             printf(" %d", n_filename);
23234             printf(" %d", n_cur);
23235             printf(" %d", n_encoding);
23236             printf("\n");
23237         }
23238     }
23239     }
23240     }
23241     function_tests++;
23242 #endif
23243
23244     return(test_ret);
23245 }
23246
23247
23248 static int
23249 test_xmlSaveFileTo(void) {
23250     int test_ret = 0;
23251
23252 #if defined(LIBXML_OUTPUT_ENABLED)
23253     int mem_base;
23254     int ret_val;
23255     xmlOutputBufferPtr buf; /* an output I/O buffer */
23256     int n_buf;
23257     xmlDocPtr cur; /* the document */
23258     int n_cur;
23259     char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23260     int n_encoding;
23261
23262     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23263     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23264     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23265         mem_base = xmlMemBlocks();
23266         buf = gen_xmlOutputBufferPtr(n_buf, 0);
23267         cur = gen_xmlDocPtr(n_cur, 1);
23268         encoding = gen_const_char_ptr(n_encoding, 2);
23269
23270         ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
23271         buf = NULL;
23272         desret_int(ret_val);
23273         call_tests++;
23274         des_xmlOutputBufferPtr(n_buf, buf, 0);
23275         des_xmlDocPtr(n_cur, cur, 1);
23276         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23277         xmlResetLastError();
23278         if (mem_base != xmlMemBlocks()) {
23279             printf("Leak of %d blocks found in xmlSaveFileTo",
23280                    xmlMemBlocks() - mem_base);
23281             test_ret++;
23282             printf(" %d", n_buf);
23283             printf(" %d", n_cur);
23284             printf(" %d", n_encoding);
23285             printf("\n");
23286         }
23287     }
23288     }
23289     }
23290     function_tests++;
23291 #endif
23292
23293     return(test_ret);
23294 }
23295
23296
23297 static int
23298 test_xmlSaveFormatFile(void) {
23299     int test_ret = 0;
23300
23301 #if defined(LIBXML_OUTPUT_ENABLED)
23302     int mem_base;
23303     int ret_val;
23304     const char * filename; /* the filename (or URL) */
23305     int n_filename;
23306     xmlDocPtr cur; /* the document */
23307     int n_cur;
23308     int format; /* should formatting spaces been added */
23309     int n_format;
23310
23311     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23312     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23313     for (n_format = 0;n_format < gen_nb_int;n_format++) {
23314         mem_base = xmlMemBlocks();
23315         filename = gen_fileoutput(n_filename, 0);
23316         cur = gen_xmlDocPtr(n_cur, 1);
23317         format = gen_int(n_format, 2);
23318
23319         ret_val = xmlSaveFormatFile(filename, cur, format);
23320         desret_int(ret_val);
23321         call_tests++;
23322         des_fileoutput(n_filename, filename, 0);
23323         des_xmlDocPtr(n_cur, cur, 1);
23324         des_int(n_format, format, 2);
23325         xmlResetLastError();
23326         if (mem_base != xmlMemBlocks()) {
23327             printf("Leak of %d blocks found in xmlSaveFormatFile",
23328                    xmlMemBlocks() - mem_base);
23329             test_ret++;
23330             printf(" %d", n_filename);
23331             printf(" %d", n_cur);
23332             printf(" %d", n_format);
23333             printf("\n");
23334         }
23335     }
23336     }
23337     }
23338     function_tests++;
23339 #endif
23340
23341     return(test_ret);
23342 }
23343
23344
23345 static int
23346 test_xmlSaveFormatFileEnc(void) {
23347     int test_ret = 0;
23348
23349 #if defined(LIBXML_OUTPUT_ENABLED)
23350     int mem_base;
23351     int ret_val;
23352     const char * filename; /* the filename or URL to output */
23353     int n_filename;
23354     xmlDocPtr cur; /* the document being saved */
23355     int n_cur;
23356     char * encoding; /* the name of the encoding to use or NULL. */
23357     int n_encoding;
23358     int format; /* should formatting spaces be added. */
23359     int n_format;
23360
23361     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23362     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23363     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23364     for (n_format = 0;n_format < gen_nb_int;n_format++) {
23365         mem_base = xmlMemBlocks();
23366         filename = gen_fileoutput(n_filename, 0);
23367         cur = gen_xmlDocPtr(n_cur, 1);
23368         encoding = gen_const_char_ptr(n_encoding, 2);
23369         format = gen_int(n_format, 3);
23370
23371         ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
23372         desret_int(ret_val);
23373         call_tests++;
23374         des_fileoutput(n_filename, filename, 0);
23375         des_xmlDocPtr(n_cur, cur, 1);
23376         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23377         des_int(n_format, format, 3);
23378         xmlResetLastError();
23379         if (mem_base != xmlMemBlocks()) {
23380             printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
23381                    xmlMemBlocks() - mem_base);
23382             test_ret++;
23383             printf(" %d", n_filename);
23384             printf(" %d", n_cur);
23385             printf(" %d", n_encoding);
23386             printf(" %d", n_format);
23387             printf("\n");
23388         }
23389     }
23390     }
23391     }
23392     }
23393     function_tests++;
23394 #endif
23395
23396     return(test_ret);
23397 }
23398
23399
23400 static int
23401 test_xmlSaveFormatFileTo(void) {
23402     int test_ret = 0;
23403
23404 #if defined(LIBXML_OUTPUT_ENABLED)
23405     int mem_base;
23406     int ret_val;
23407     xmlOutputBufferPtr buf; /* an output I/O buffer */
23408     int n_buf;
23409     xmlDocPtr cur; /* the document */
23410     int n_cur;
23411     char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23412     int n_encoding;
23413     int format; /* should formatting spaces been added */
23414     int n_format;
23415
23416     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23417     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23418     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23419     for (n_format = 0;n_format < gen_nb_int;n_format++) {
23420         mem_base = xmlMemBlocks();
23421         buf = gen_xmlOutputBufferPtr(n_buf, 0);
23422         cur = gen_xmlDocPtr(n_cur, 1);
23423         encoding = gen_const_char_ptr(n_encoding, 2);
23424         format = gen_int(n_format, 3);
23425
23426         ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
23427         buf = NULL;
23428         desret_int(ret_val);
23429         call_tests++;
23430         des_xmlOutputBufferPtr(n_buf, buf, 0);
23431         des_xmlDocPtr(n_cur, cur, 1);
23432         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23433         des_int(n_format, format, 3);
23434         xmlResetLastError();
23435         if (mem_base != xmlMemBlocks()) {
23436             printf("Leak of %d blocks found in xmlSaveFormatFileTo",
23437                    xmlMemBlocks() - mem_base);
23438             test_ret++;
23439             printf(" %d", n_buf);
23440             printf(" %d", n_cur);
23441             printf(" %d", n_encoding);
23442             printf(" %d", n_format);
23443             printf("\n");
23444         }
23445     }
23446     }
23447     }
23448     }
23449     function_tests++;
23450 #endif
23451
23452     return(test_ret);
23453 }
23454
23455
23456 static int
23457 test_xmlSearchNs(void) {
23458     int test_ret = 0;
23459
23460     int mem_base;
23461     xmlNsPtr ret_val;
23462     xmlDocPtr doc; /* the document */
23463     int n_doc;
23464     xmlNodePtr node; /* the current node */
23465     int n_node;
23466     xmlChar * nameSpace; /* the namespace prefix */
23467     int n_nameSpace;
23468
23469     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23470     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23471     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
23472         mem_base = xmlMemBlocks();
23473         doc = gen_xmlDocPtr(n_doc, 0);
23474         node = gen_xmlNodePtr(n_node, 1);
23475         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
23476
23477         ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
23478         desret_xmlNsPtr(ret_val);
23479         call_tests++;
23480         des_xmlDocPtr(n_doc, doc, 0);
23481         des_xmlNodePtr(n_node, node, 1);
23482         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
23483         xmlResetLastError();
23484         if (mem_base != xmlMemBlocks()) {
23485             printf("Leak of %d blocks found in xmlSearchNs",
23486                    xmlMemBlocks() - mem_base);
23487             test_ret++;
23488             printf(" %d", n_doc);
23489             printf(" %d", n_node);
23490             printf(" %d", n_nameSpace);
23491             printf("\n");
23492         }
23493     }
23494     }
23495     }
23496     function_tests++;
23497
23498     return(test_ret);
23499 }
23500
23501
23502 static int
23503 test_xmlSearchNsByHref(void) {
23504     int test_ret = 0;
23505
23506     int mem_base;
23507     xmlNsPtr ret_val;
23508     xmlDocPtr doc; /* the document */
23509     int n_doc;
23510     xmlNodePtr node; /* the current node */
23511     int n_node;
23512     xmlChar * href; /* the namespace value */
23513     int n_href;
23514
23515     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23516     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23517     for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
23518         mem_base = xmlMemBlocks();
23519         doc = gen_xmlDocPtr(n_doc, 0);
23520         node = gen_xmlNodePtr(n_node, 1);
23521         href = gen_const_xmlChar_ptr(n_href, 2);
23522
23523         ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
23524         desret_xmlNsPtr(ret_val);
23525         call_tests++;
23526         des_xmlDocPtr(n_doc, doc, 0);
23527         des_xmlNodePtr(n_node, node, 1);
23528         des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
23529         xmlResetLastError();
23530         if (mem_base != xmlMemBlocks()) {
23531             printf("Leak of %d blocks found in xmlSearchNsByHref",
23532                    xmlMemBlocks() - mem_base);
23533             test_ret++;
23534             printf(" %d", n_doc);
23535             printf(" %d", n_node);
23536             printf(" %d", n_href);
23537             printf("\n");
23538         }
23539     }
23540     }
23541     }
23542     function_tests++;
23543
23544     return(test_ret);
23545 }
23546
23547
23548 static int
23549 test_xmlSetBufferAllocationScheme(void) {
23550     int test_ret = 0;
23551
23552     int mem_base;
23553     xmlBufferAllocationScheme scheme; /* allocation method to use */
23554     int n_scheme;
23555
23556     for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
23557         mem_base = xmlMemBlocks();
23558         scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
23559
23560         xmlSetBufferAllocationScheme(scheme);
23561         call_tests++;
23562         des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
23563         xmlResetLastError();
23564         if (mem_base != xmlMemBlocks()) {
23565             printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
23566                    xmlMemBlocks() - mem_base);
23567             test_ret++;
23568             printf(" %d", n_scheme);
23569             printf("\n");
23570         }
23571     }
23572     function_tests++;
23573
23574     return(test_ret);
23575 }
23576
23577
23578 static int
23579 test_xmlSetCompressMode(void) {
23580     int test_ret = 0;
23581
23582     int mem_base;
23583     int mode; /* the compression ratio */
23584     int n_mode;
23585
23586     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23587         mem_base = xmlMemBlocks();
23588         mode = gen_int(n_mode, 0);
23589
23590         xmlSetCompressMode(mode);
23591         call_tests++;
23592         des_int(n_mode, mode, 0);
23593         xmlResetLastError();
23594         if (mem_base != xmlMemBlocks()) {
23595             printf("Leak of %d blocks found in xmlSetCompressMode",
23596                    xmlMemBlocks() - mem_base);
23597             test_ret++;
23598             printf(" %d", n_mode);
23599             printf("\n");
23600         }
23601     }
23602     function_tests++;
23603
23604     return(test_ret);
23605 }
23606
23607
23608 static int
23609 test_xmlSetDocCompressMode(void) {
23610     int test_ret = 0;
23611
23612     int mem_base;
23613     xmlDocPtr doc; /* the document */
23614     int n_doc;
23615     int mode; /* the compression ratio */
23616     int n_mode;
23617
23618     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23619     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23620         mem_base = xmlMemBlocks();
23621         doc = gen_xmlDocPtr(n_doc, 0);
23622         mode = gen_int(n_mode, 1);
23623
23624         xmlSetDocCompressMode(doc, mode);
23625         call_tests++;
23626         des_xmlDocPtr(n_doc, doc, 0);
23627         des_int(n_mode, mode, 1);
23628         xmlResetLastError();
23629         if (mem_base != xmlMemBlocks()) {
23630             printf("Leak of %d blocks found in xmlSetDocCompressMode",
23631                    xmlMemBlocks() - mem_base);
23632             test_ret++;
23633             printf(" %d", n_doc);
23634             printf(" %d", n_mode);
23635             printf("\n");
23636         }
23637     }
23638     }
23639     function_tests++;
23640
23641     return(test_ret);
23642 }
23643
23644
23645 static int
23646 test_xmlSetNs(void) {
23647     int test_ret = 0;
23648
23649     int mem_base;
23650     xmlNodePtr node; /* a node in the document */
23651     int n_node;
23652     xmlNsPtr ns; /* a namespace pointer */
23653     int n_ns;
23654
23655     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23656     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23657         mem_base = xmlMemBlocks();
23658         node = gen_xmlNodePtr(n_node, 0);
23659         ns = gen_xmlNsPtr(n_ns, 1);
23660
23661         xmlSetNs(node, ns);
23662         call_tests++;
23663         des_xmlNodePtr(n_node, node, 0);
23664         des_xmlNsPtr(n_ns, ns, 1);
23665         xmlResetLastError();
23666         if (mem_base != xmlMemBlocks()) {
23667             printf("Leak of %d blocks found in xmlSetNs",
23668                    xmlMemBlocks() - mem_base);
23669             test_ret++;
23670             printf(" %d", n_node);
23671             printf(" %d", n_ns);
23672             printf("\n");
23673         }
23674     }
23675     }
23676     function_tests++;
23677
23678     return(test_ret);
23679 }
23680
23681
23682 static int
23683 test_xmlSetNsProp(void) {
23684     int test_ret = 0;
23685
23686 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23687     int mem_base;
23688     xmlAttrPtr ret_val;
23689     xmlNodePtr node; /* the node */
23690     int n_node;
23691     xmlNsPtr ns; /* the namespace definition */
23692     int n_ns;
23693     xmlChar * name; /* the attribute name */
23694     int n_name;
23695     xmlChar * value; /* the attribute value */
23696     int n_value;
23697
23698     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23699     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23700     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23701     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23702         mem_base = xmlMemBlocks();
23703         node = gen_xmlNodePtr(n_node, 0);
23704         ns = gen_xmlNsPtr(n_ns, 1);
23705         name = gen_const_xmlChar_ptr(n_name, 2);
23706         value = gen_const_xmlChar_ptr(n_value, 3);
23707
23708         ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
23709         desret_xmlAttrPtr(ret_val);
23710         call_tests++;
23711         des_xmlNodePtr(n_node, node, 0);
23712         des_xmlNsPtr(n_ns, ns, 1);
23713         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23714         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
23715         xmlResetLastError();
23716         if (mem_base != xmlMemBlocks()) {
23717             printf("Leak of %d blocks found in xmlSetNsProp",
23718                    xmlMemBlocks() - mem_base);
23719             test_ret++;
23720             printf(" %d", n_node);
23721             printf(" %d", n_ns);
23722             printf(" %d", n_name);
23723             printf(" %d", n_value);
23724             printf("\n");
23725         }
23726     }
23727     }
23728     }
23729     }
23730     function_tests++;
23731 #endif
23732
23733     return(test_ret);
23734 }
23735
23736
23737 static int
23738 test_xmlSetProp(void) {
23739     int test_ret = 0;
23740
23741 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23742     int mem_base;
23743     xmlAttrPtr ret_val;
23744     xmlNodePtr node; /* the node */
23745     int n_node;
23746     xmlChar * name; /* the attribute name (a QName) */
23747     int n_name;
23748     xmlChar * value; /* the attribute value */
23749     int n_value;
23750
23751     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23752     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23753     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23754         mem_base = xmlMemBlocks();
23755         node = gen_xmlNodePtr(n_node, 0);
23756         name = gen_const_xmlChar_ptr(n_name, 1);
23757         value = gen_const_xmlChar_ptr(n_value, 2);
23758
23759         ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
23760         desret_xmlAttrPtr(ret_val);
23761         call_tests++;
23762         des_xmlNodePtr(n_node, node, 0);
23763         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23764         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
23765         xmlResetLastError();
23766         if (mem_base != xmlMemBlocks()) {
23767             printf("Leak of %d blocks found in xmlSetProp",
23768                    xmlMemBlocks() - mem_base);
23769             test_ret++;
23770             printf(" %d", n_node);
23771             printf(" %d", n_name);
23772             printf(" %d", n_value);
23773             printf("\n");
23774         }
23775     }
23776     }
23777     }
23778     function_tests++;
23779 #endif
23780
23781     return(test_ret);
23782 }
23783
23784
23785 static int
23786 test_xmlSplitQName2(void) {
23787     int test_ret = 0;
23788
23789     int mem_base;
23790     xmlChar * ret_val;
23791     xmlChar * name; /* the full QName */
23792     int n_name;
23793     xmlChar ** prefix; /* a xmlChar ** */
23794     int n_prefix;
23795
23796     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23797     for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
23798         mem_base = xmlMemBlocks();
23799         name = gen_const_xmlChar_ptr(n_name, 0);
23800         prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
23801
23802         ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
23803         desret_xmlChar_ptr(ret_val);
23804         call_tests++;
23805         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23806         des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
23807         xmlResetLastError();
23808         if (mem_base != xmlMemBlocks()) {
23809             printf("Leak of %d blocks found in xmlSplitQName2",
23810                    xmlMemBlocks() - mem_base);
23811             test_ret++;
23812             printf(" %d", n_name);
23813             printf(" %d", n_prefix);
23814             printf("\n");
23815         }
23816     }
23817     }
23818     function_tests++;
23819
23820     return(test_ret);
23821 }
23822
23823
23824 static int
23825 test_xmlSplitQName3(void) {
23826     int test_ret = 0;
23827
23828     int mem_base;
23829     const xmlChar * ret_val;
23830     xmlChar * name; /* the full QName */
23831     int n_name;
23832     int * len; /* an int * */
23833     int n_len;
23834
23835     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23836     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
23837         mem_base = xmlMemBlocks();
23838         name = gen_const_xmlChar_ptr(n_name, 0);
23839         len = gen_int_ptr(n_len, 1);
23840
23841         ret_val = xmlSplitQName3((const xmlChar *)name, len);
23842         desret_const_xmlChar_ptr(ret_val);
23843         call_tests++;
23844         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23845         des_int_ptr(n_len, len, 1);
23846         xmlResetLastError();
23847         if (mem_base != xmlMemBlocks()) {
23848             printf("Leak of %d blocks found in xmlSplitQName3",
23849                    xmlMemBlocks() - mem_base);
23850             test_ret++;
23851             printf(" %d", n_name);
23852             printf(" %d", n_len);
23853             printf("\n");
23854         }
23855     }
23856     }
23857     function_tests++;
23858
23859     return(test_ret);
23860 }
23861
23862
23863 static int
23864 test_xmlStringGetNodeList(void) {
23865     int test_ret = 0;
23866
23867     int mem_base;
23868     xmlNodePtr ret_val;
23869     xmlDoc * doc; /* the document */
23870     int n_doc;
23871     xmlChar * value; /* the value of the attribute */
23872     int n_value;
23873
23874     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
23875     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23876         mem_base = xmlMemBlocks();
23877         doc = gen_const_xmlDoc_ptr(n_doc, 0);
23878         value = gen_const_xmlChar_ptr(n_value, 1);
23879
23880         ret_val = xmlStringGetNodeList((const xmlDoc *)doc, (const xmlChar *)value);
23881         desret_xmlNodePtr(ret_val);
23882         call_tests++;
23883         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
23884         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23885         xmlResetLastError();
23886         if (mem_base != xmlMemBlocks()) {
23887             printf("Leak of %d blocks found in xmlStringGetNodeList",
23888                    xmlMemBlocks() - mem_base);
23889             test_ret++;
23890             printf(" %d", n_doc);
23891             printf(" %d", n_value);
23892             printf("\n");
23893         }
23894     }
23895     }
23896     function_tests++;
23897
23898     return(test_ret);
23899 }
23900
23901
23902 static int
23903 test_xmlStringLenGetNodeList(void) {
23904     int test_ret = 0;
23905
23906     int mem_base;
23907     xmlNodePtr ret_val;
23908     xmlDoc * doc; /* the document */
23909     int n_doc;
23910     xmlChar * value; /* the value of the text */
23911     int n_value;
23912     int len; /* the length of the string value */
23913     int n_len;
23914
23915     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
23916     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23917     for (n_len = 0;n_len < gen_nb_int;n_len++) {
23918         mem_base = xmlMemBlocks();
23919         doc = gen_const_xmlDoc_ptr(n_doc, 0);
23920         value = gen_const_xmlChar_ptr(n_value, 1);
23921         len = gen_int(n_len, 2);
23922         if ((value != NULL) &&
23923             (len > (int) strlen((const char *) value) + 1))
23924             continue;
23925
23926         ret_val = xmlStringLenGetNodeList((const xmlDoc *)doc, (const xmlChar *)value, len);
23927         desret_xmlNodePtr(ret_val);
23928         call_tests++;
23929         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
23930         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23931         des_int(n_len, len, 2);
23932         xmlResetLastError();
23933         if (mem_base != xmlMemBlocks()) {
23934             printf("Leak of %d blocks found in xmlStringLenGetNodeList",
23935                    xmlMemBlocks() - mem_base);
23936             test_ret++;
23937             printf(" %d", n_doc);
23938             printf(" %d", n_value);
23939             printf(" %d", n_len);
23940             printf("\n");
23941         }
23942     }
23943     }
23944     }
23945     function_tests++;
23946
23947     return(test_ret);
23948 }
23949
23950
23951 static int
23952 test_xmlTextConcat(void) {
23953     int test_ret = 0;
23954
23955     int mem_base;
23956     int ret_val;
23957     xmlNodePtr node; /* the node */
23958     int n_node;
23959     xmlChar * content; /* the content */
23960     int n_content;
23961     int len; /* @content length */
23962     int n_len;
23963
23964     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23965     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23966     for (n_len = 0;n_len < gen_nb_int;n_len++) {
23967         mem_base = xmlMemBlocks();
23968         node = gen_xmlNodePtr(n_node, 0);
23969         content = gen_const_xmlChar_ptr(n_content, 1);
23970         len = gen_int(n_len, 2);
23971         if ((content != NULL) &&
23972             (len > (int) strlen((const char *) content) + 1))
23973             continue;
23974
23975         ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
23976         desret_int(ret_val);
23977         call_tests++;
23978         des_xmlNodePtr(n_node, node, 0);
23979         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23980         des_int(n_len, len, 2);
23981         xmlResetLastError();
23982         if (mem_base != xmlMemBlocks()) {
23983             printf("Leak of %d blocks found in xmlTextConcat",
23984                    xmlMemBlocks() - mem_base);
23985             test_ret++;
23986             printf(" %d", n_node);
23987             printf(" %d", n_content);
23988             printf(" %d", n_len);
23989             printf("\n");
23990         }
23991     }
23992     }
23993     }
23994     function_tests++;
23995
23996     return(test_ret);
23997 }
23998
23999
24000 static int
24001 test_xmlTextMerge(void) {
24002     int test_ret = 0;
24003
24004     int mem_base;
24005     xmlNodePtr ret_val;
24006     xmlNodePtr first; /* the first text node */
24007     int n_first;
24008     xmlNodePtr second; /* the second text node being merged */
24009     int n_second;
24010
24011     for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
24012     for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
24013         mem_base = xmlMemBlocks();
24014         first = gen_xmlNodePtr_in(n_first, 0);
24015         second = gen_xmlNodePtr_in(n_second, 1);
24016
24017         ret_val = xmlTextMerge(first, second);
24018         if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
24019               xmlUnlinkNode(second);
24020               xmlFreeNode(second) ; second = NULL ; }
24021         desret_xmlNodePtr(ret_val);
24022         call_tests++;
24023         des_xmlNodePtr_in(n_first, first, 0);
24024         des_xmlNodePtr_in(n_second, second, 1);
24025         xmlResetLastError();
24026         if (mem_base != xmlMemBlocks()) {
24027             printf("Leak of %d blocks found in xmlTextMerge",
24028                    xmlMemBlocks() - mem_base);
24029             test_ret++;
24030             printf(" %d", n_first);
24031             printf(" %d", n_second);
24032             printf("\n");
24033         }
24034     }
24035     }
24036     function_tests++;
24037
24038     return(test_ret);
24039 }
24040
24041
24042 static int
24043 test_xmlUnsetNsProp(void) {
24044     int test_ret = 0;
24045
24046 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24047     int mem_base;
24048     int ret_val;
24049     xmlNodePtr node; /* the node */
24050     int n_node;
24051     xmlNsPtr ns; /* the namespace definition */
24052     int n_ns;
24053     xmlChar * name; /* the attribute name */
24054     int n_name;
24055
24056     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
24057     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
24058     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24059         mem_base = xmlMemBlocks();
24060         node = gen_xmlNodePtr(n_node, 0);
24061         ns = gen_xmlNsPtr(n_ns, 1);
24062         name = gen_const_xmlChar_ptr(n_name, 2);
24063
24064         ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
24065         desret_int(ret_val);
24066         call_tests++;
24067         des_xmlNodePtr(n_node, node, 0);
24068         des_xmlNsPtr(n_ns, ns, 1);
24069         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24070         xmlResetLastError();
24071         if (mem_base != xmlMemBlocks()) {
24072             printf("Leak of %d blocks found in xmlUnsetNsProp",
24073                    xmlMemBlocks() - mem_base);
24074             test_ret++;
24075             printf(" %d", n_node);
24076             printf(" %d", n_ns);
24077             printf(" %d", n_name);
24078             printf("\n");
24079         }
24080     }
24081     }
24082     }
24083     function_tests++;
24084 #endif
24085
24086     return(test_ret);
24087 }
24088
24089
24090 static int
24091 test_xmlUnsetProp(void) {
24092     int test_ret = 0;
24093
24094 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24095     int mem_base;
24096     int ret_val;
24097     xmlNodePtr node; /* the node */
24098     int n_node;
24099     xmlChar * name; /* the attribute name */
24100     int n_name;
24101
24102     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
24103     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24104         mem_base = xmlMemBlocks();
24105         node = gen_xmlNodePtr(n_node, 0);
24106         name = gen_const_xmlChar_ptr(n_name, 1);
24107
24108         ret_val = xmlUnsetProp(node, (const xmlChar *)name);
24109         desret_int(ret_val);
24110         call_tests++;
24111         des_xmlNodePtr(n_node, node, 0);
24112         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24113         xmlResetLastError();
24114         if (mem_base != xmlMemBlocks()) {
24115             printf("Leak of %d blocks found in xmlUnsetProp",
24116                    xmlMemBlocks() - mem_base);
24117             test_ret++;
24118             printf(" %d", n_node);
24119             printf(" %d", n_name);
24120             printf("\n");
24121         }
24122     }
24123     }
24124     function_tests++;
24125 #endif
24126
24127     return(test_ret);
24128 }
24129
24130
24131 static int
24132 test_xmlValidateNCName(void) {
24133     int test_ret = 0;
24134
24135 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
24136 #ifdef LIBXML_TREE_ENABLED
24137     int mem_base;
24138     int ret_val;
24139     xmlChar * value; /* the value to check */
24140     int n_value;
24141     int space; /* allow spaces in front and end of the string */
24142     int n_space;
24143
24144     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24145     for (n_space = 0;n_space < gen_nb_int;n_space++) {
24146         mem_base = xmlMemBlocks();
24147         value = gen_const_xmlChar_ptr(n_value, 0);
24148         space = gen_int(n_space, 1);
24149
24150         ret_val = xmlValidateNCName((const xmlChar *)value, space);
24151         desret_int(ret_val);
24152         call_tests++;
24153         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24154         des_int(n_space, space, 1);
24155         xmlResetLastError();
24156         if (mem_base != xmlMemBlocks()) {
24157             printf("Leak of %d blocks found in xmlValidateNCName",
24158                    xmlMemBlocks() - mem_base);
24159             test_ret++;
24160             printf(" %d", n_value);
24161             printf(" %d", n_space);
24162             printf("\n");
24163         }
24164     }
24165     }
24166     function_tests++;
24167 #endif
24168 #endif
24169
24170     return(test_ret);
24171 }
24172
24173
24174 static int
24175 test_xmlValidateNMToken(void) {
24176     int test_ret = 0;
24177
24178 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24179 #ifdef LIBXML_TREE_ENABLED
24180     int mem_base;
24181     int ret_val;
24182     xmlChar * value; /* the value to check */
24183     int n_value;
24184     int space; /* allow spaces in front and end of the string */
24185     int n_space;
24186
24187     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24188     for (n_space = 0;n_space < gen_nb_int;n_space++) {
24189         mem_base = xmlMemBlocks();
24190         value = gen_const_xmlChar_ptr(n_value, 0);
24191         space = gen_int(n_space, 1);
24192
24193         ret_val = xmlValidateNMToken((const xmlChar *)value, space);
24194         desret_int(ret_val);
24195         call_tests++;
24196         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24197         des_int(n_space, space, 1);
24198         xmlResetLastError();
24199         if (mem_base != xmlMemBlocks()) {
24200             printf("Leak of %d blocks found in xmlValidateNMToken",
24201                    xmlMemBlocks() - mem_base);
24202             test_ret++;
24203             printf(" %d", n_value);
24204             printf(" %d", n_space);
24205             printf("\n");
24206         }
24207     }
24208     }
24209     function_tests++;
24210 #endif
24211 #endif
24212
24213     return(test_ret);
24214 }
24215
24216
24217 static int
24218 test_xmlValidateName(void) {
24219     int test_ret = 0;
24220
24221 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24222 #ifdef LIBXML_TREE_ENABLED
24223     int mem_base;
24224     int ret_val;
24225     xmlChar * value; /* the value to check */
24226     int n_value;
24227     int space; /* allow spaces in front and end of the string */
24228     int n_space;
24229
24230     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24231     for (n_space = 0;n_space < gen_nb_int;n_space++) {
24232         mem_base = xmlMemBlocks();
24233         value = gen_const_xmlChar_ptr(n_value, 0);
24234         space = gen_int(n_space, 1);
24235
24236         ret_val = xmlValidateName((const xmlChar *)value, space);
24237         desret_int(ret_val);
24238         call_tests++;
24239         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24240         des_int(n_space, space, 1);
24241         xmlResetLastError();
24242         if (mem_base != xmlMemBlocks()) {
24243             printf("Leak of %d blocks found in xmlValidateName",
24244                    xmlMemBlocks() - mem_base);
24245             test_ret++;
24246             printf(" %d", n_value);
24247             printf(" %d", n_space);
24248             printf("\n");
24249         }
24250     }
24251     }
24252     function_tests++;
24253 #endif
24254 #endif
24255
24256     return(test_ret);
24257 }
24258
24259
24260 static int
24261 test_xmlValidateQName(void) {
24262     int test_ret = 0;
24263
24264 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24265 #ifdef LIBXML_TREE_ENABLED
24266     int mem_base;
24267     int ret_val;
24268     xmlChar * value; /* the value to check */
24269     int n_value;
24270     int space; /* allow spaces in front and end of the string */
24271     int n_space;
24272
24273     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24274     for (n_space = 0;n_space < gen_nb_int;n_space++) {
24275         mem_base = xmlMemBlocks();
24276         value = gen_const_xmlChar_ptr(n_value, 0);
24277         space = gen_int(n_space, 1);
24278
24279         ret_val = xmlValidateQName((const xmlChar *)value, space);
24280         desret_int(ret_val);
24281         call_tests++;
24282         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24283         des_int(n_space, space, 1);
24284         xmlResetLastError();
24285         if (mem_base != xmlMemBlocks()) {
24286             printf("Leak of %d blocks found in xmlValidateQName",
24287                    xmlMemBlocks() - mem_base);
24288             test_ret++;
24289             printf(" %d", n_value);
24290             printf(" %d", n_space);
24291             printf("\n");
24292         }
24293     }
24294     }
24295     function_tests++;
24296 #endif
24297 #endif
24298
24299     return(test_ret);
24300 }
24301
24302 static int
24303 test_tree(void) {
24304     int test_ret = 0;
24305
24306     if (quiet == 0) printf("Testing tree : 142 of 164 functions ...\n");
24307     test_ret += test_xmlAddChild();
24308     test_ret += test_xmlAddChildList();
24309     test_ret += test_xmlAddNextSibling();
24310     test_ret += test_xmlAddPrevSibling();
24311     test_ret += test_xmlAddSibling();
24312     test_ret += test_xmlAttrSerializeTxtContent();
24313     test_ret += test_xmlBufContent();
24314     test_ret += test_xmlBufEnd();
24315     test_ret += test_xmlBufGetNodeContent();
24316     test_ret += test_xmlBufNodeDump();
24317     test_ret += test_xmlBufShrink();
24318     test_ret += test_xmlBufUse();
24319     test_ret += test_xmlBufferAdd();
24320     test_ret += test_xmlBufferAddHead();
24321     test_ret += test_xmlBufferCCat();
24322     test_ret += test_xmlBufferCat();
24323     test_ret += test_xmlBufferContent();
24324     test_ret += test_xmlBufferCreate();
24325     test_ret += test_xmlBufferCreateSize();
24326     test_ret += test_xmlBufferCreateStatic();
24327     test_ret += test_xmlBufferDetach();
24328     test_ret += test_xmlBufferEmpty();
24329     test_ret += test_xmlBufferGrow();
24330     test_ret += test_xmlBufferLength();
24331     test_ret += test_xmlBufferResize();
24332     test_ret += test_xmlBufferSetAllocationScheme();
24333     test_ret += test_xmlBufferShrink();
24334     test_ret += test_xmlBufferWriteCHAR();
24335     test_ret += test_xmlBufferWriteChar();
24336     test_ret += test_xmlBufferWriteQuotedString();
24337     test_ret += test_xmlBuildQName();
24338     test_ret += test_xmlChildElementCount();
24339     test_ret += test_xmlCopyDoc();
24340     test_ret += test_xmlCopyDtd();
24341     test_ret += test_xmlCopyNamespace();
24342     test_ret += test_xmlCopyNamespaceList();
24343     test_ret += test_xmlCopyNode();
24344     test_ret += test_xmlCopyNodeList();
24345     test_ret += test_xmlCopyProp();
24346     test_ret += test_xmlCopyPropList();
24347     test_ret += test_xmlCreateIntSubset();
24348     test_ret += test_xmlDOMWrapAdoptNode();
24349     test_ret += test_xmlDOMWrapCloneNode();
24350     test_ret += test_xmlDOMWrapNewCtxt();
24351     test_ret += test_xmlDOMWrapReconcileNamespaces();
24352     test_ret += test_xmlDOMWrapRemoveNode();
24353     test_ret += test_xmlDocCopyNode();
24354     test_ret += test_xmlDocCopyNodeList();
24355     test_ret += test_xmlDocDump();
24356     test_ret += test_xmlDocDumpFormatMemory();
24357     test_ret += test_xmlDocDumpFormatMemoryEnc();
24358     test_ret += test_xmlDocDumpMemory();
24359     test_ret += test_xmlDocDumpMemoryEnc();
24360     test_ret += test_xmlDocFormatDump();
24361     test_ret += test_xmlDocGetRootElement();
24362     test_ret += test_xmlDocSetRootElement();
24363     test_ret += test_xmlElemDump();
24364     test_ret += test_xmlFirstElementChild();
24365     test_ret += test_xmlGetBufferAllocationScheme();
24366     test_ret += test_xmlGetCompressMode();
24367     test_ret += test_xmlGetDocCompressMode();
24368     test_ret += test_xmlGetIntSubset();
24369     test_ret += test_xmlGetLastChild();
24370     test_ret += test_xmlGetLineNo();
24371     test_ret += test_xmlGetNoNsProp();
24372     test_ret += test_xmlGetNodePath();
24373     test_ret += test_xmlGetNsList();
24374     test_ret += test_xmlGetNsProp();
24375     test_ret += test_xmlGetProp();
24376     test_ret += test_xmlHasNsProp();
24377     test_ret += test_xmlHasProp();
24378     test_ret += test_xmlIsBlankNode();
24379     test_ret += test_xmlIsXHTML();
24380     test_ret += test_xmlLastElementChild();
24381     test_ret += test_xmlNewCDataBlock();
24382     test_ret += test_xmlNewCharRef();
24383     test_ret += test_xmlNewChild();
24384     test_ret += test_xmlNewComment();
24385     test_ret += test_xmlNewDoc();
24386     test_ret += test_xmlNewDocComment();
24387     test_ret += test_xmlNewDocFragment();
24388     test_ret += test_xmlNewDocNode();
24389     test_ret += test_xmlNewDocNodeEatName();
24390     test_ret += test_xmlNewDocPI();
24391     test_ret += test_xmlNewDocProp();
24392     test_ret += test_xmlNewDocRawNode();
24393     test_ret += test_xmlNewDocText();
24394     test_ret += test_xmlNewDocTextLen();
24395     test_ret += test_xmlNewDtd();
24396     test_ret += test_xmlNewNode();
24397     test_ret += test_xmlNewNodeEatName();
24398     test_ret += test_xmlNewNs();
24399     test_ret += test_xmlNewNsProp();
24400     test_ret += test_xmlNewNsPropEatName();
24401     test_ret += test_xmlNewPI();
24402     test_ret += test_xmlNewProp();
24403     test_ret += test_xmlNewReference();
24404     test_ret += test_xmlNewText();
24405     test_ret += test_xmlNewTextChild();
24406     test_ret += test_xmlNewTextLen();
24407     test_ret += test_xmlNextElementSibling();
24408     test_ret += test_xmlNodeAddContent();
24409     test_ret += test_xmlNodeAddContentLen();
24410     test_ret += test_xmlNodeBufGetContent();
24411     test_ret += test_xmlNodeDump();
24412     test_ret += test_xmlNodeDumpOutput();
24413     test_ret += test_xmlNodeGetBase();
24414     test_ret += test_xmlNodeGetContent();
24415     test_ret += test_xmlNodeGetLang();
24416     test_ret += test_xmlNodeGetSpacePreserve();
24417     test_ret += test_xmlNodeIsText();
24418     test_ret += test_xmlNodeListGetRawString();
24419     test_ret += test_xmlNodeListGetString();
24420     test_ret += test_xmlNodeSetBase();
24421     test_ret += test_xmlNodeSetContent();
24422     test_ret += test_xmlNodeSetContentLen();
24423     test_ret += test_xmlNodeSetLang();
24424     test_ret += test_xmlNodeSetName();
24425     test_ret += test_xmlNodeSetSpacePreserve();
24426     test_ret += test_xmlPreviousElementSibling();
24427     test_ret += test_xmlReconciliateNs();
24428     test_ret += test_xmlRemoveProp();
24429     test_ret += test_xmlReplaceNode();
24430     test_ret += test_xmlSaveFile();
24431     test_ret += test_xmlSaveFileEnc();
24432     test_ret += test_xmlSaveFileTo();
24433     test_ret += test_xmlSaveFormatFile();
24434     test_ret += test_xmlSaveFormatFileEnc();
24435     test_ret += test_xmlSaveFormatFileTo();
24436     test_ret += test_xmlSearchNs();
24437     test_ret += test_xmlSearchNsByHref();
24438     test_ret += test_xmlSetBufferAllocationScheme();
24439     test_ret += test_xmlSetCompressMode();
24440     test_ret += test_xmlSetDocCompressMode();
24441     test_ret += test_xmlSetNs();
24442     test_ret += test_xmlSetNsProp();
24443     test_ret += test_xmlSetProp();
24444     test_ret += test_xmlSplitQName2();
24445     test_ret += test_xmlSplitQName3();
24446     test_ret += test_xmlStringGetNodeList();
24447     test_ret += test_xmlStringLenGetNodeList();
24448     test_ret += test_xmlTextConcat();
24449     test_ret += test_xmlTextMerge();
24450     test_ret += test_xmlUnsetNsProp();
24451     test_ret += test_xmlUnsetProp();
24452     test_ret += test_xmlValidateNCName();
24453     test_ret += test_xmlValidateNMToken();
24454     test_ret += test_xmlValidateName();
24455     test_ret += test_xmlValidateQName();
24456
24457     if (test_ret != 0)
24458         printf("Module tree: %d errors\n", test_ret);
24459     return(test_ret);
24460 }
24461
24462 static int
24463 test_xmlBuildRelativeURI(void) {
24464     int test_ret = 0;
24465
24466     int mem_base;
24467     xmlChar * ret_val;
24468     xmlChar * URI; /* the URI reference under consideration */
24469     int n_URI;
24470     xmlChar * base; /* the base value */
24471     int n_base;
24472
24473     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24474     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24475         mem_base = xmlMemBlocks();
24476         URI = gen_const_xmlChar_ptr(n_URI, 0);
24477         base = gen_const_xmlChar_ptr(n_base, 1);
24478
24479         ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
24480         desret_xmlChar_ptr(ret_val);
24481         call_tests++;
24482         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24483         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24484         xmlResetLastError();
24485         if (mem_base != xmlMemBlocks()) {
24486             printf("Leak of %d blocks found in xmlBuildRelativeURI",
24487                    xmlMemBlocks() - mem_base);
24488             test_ret++;
24489             printf(" %d", n_URI);
24490             printf(" %d", n_base);
24491             printf("\n");
24492         }
24493     }
24494     }
24495     function_tests++;
24496
24497     return(test_ret);
24498 }
24499
24500
24501 static int
24502 test_xmlBuildURI(void) {
24503     int test_ret = 0;
24504
24505     int mem_base;
24506     xmlChar * ret_val;
24507     xmlChar * URI; /* the URI instance found in the document */
24508     int n_URI;
24509     xmlChar * base; /* the base value */
24510     int n_base;
24511
24512     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24513     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24514         mem_base = xmlMemBlocks();
24515         URI = gen_const_xmlChar_ptr(n_URI, 0);
24516         base = gen_const_xmlChar_ptr(n_base, 1);
24517
24518         ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
24519         desret_xmlChar_ptr(ret_val);
24520         call_tests++;
24521         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24522         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24523         xmlResetLastError();
24524         if (mem_base != xmlMemBlocks()) {
24525             printf("Leak of %d blocks found in xmlBuildURI",
24526                    xmlMemBlocks() - mem_base);
24527             test_ret++;
24528             printf(" %d", n_URI);
24529             printf(" %d", n_base);
24530             printf("\n");
24531         }
24532     }
24533     }
24534     function_tests++;
24535
24536     return(test_ret);
24537 }
24538
24539
24540 static int
24541 test_xmlCanonicPath(void) {
24542     int test_ret = 0;
24543
24544     int mem_base;
24545     xmlChar * ret_val;
24546     xmlChar * path; /* the resource locator in a filesystem notation */
24547     int n_path;
24548
24549     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24550         mem_base = xmlMemBlocks();
24551         path = gen_const_xmlChar_ptr(n_path, 0);
24552
24553         ret_val = xmlCanonicPath((const xmlChar *)path);
24554         desret_xmlChar_ptr(ret_val);
24555         call_tests++;
24556         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24557         xmlResetLastError();
24558         if (mem_base != xmlMemBlocks()) {
24559             printf("Leak of %d blocks found in xmlCanonicPath",
24560                    xmlMemBlocks() - mem_base);
24561             test_ret++;
24562             printf(" %d", n_path);
24563             printf("\n");
24564         }
24565     }
24566     function_tests++;
24567
24568     return(test_ret);
24569 }
24570
24571
24572 static int
24573 test_xmlCreateURI(void) {
24574     int test_ret = 0;
24575
24576
24577     /* missing type support */
24578     return(test_ret);
24579 }
24580
24581
24582 static int
24583 test_xmlNormalizeURIPath(void) {
24584     int test_ret = 0;
24585
24586     int mem_base;
24587     int ret_val;
24588     char * path; /* pointer to the path string */
24589     int n_path;
24590
24591     for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
24592         mem_base = xmlMemBlocks();
24593         path = gen_char_ptr(n_path, 0);
24594
24595         ret_val = xmlNormalizeURIPath(path);
24596         desret_int(ret_val);
24597         call_tests++;
24598         des_char_ptr(n_path, path, 0);
24599         xmlResetLastError();
24600         if (mem_base != xmlMemBlocks()) {
24601             printf("Leak of %d blocks found in xmlNormalizeURIPath",
24602                    xmlMemBlocks() - mem_base);
24603             test_ret++;
24604             printf(" %d", n_path);
24605             printf("\n");
24606         }
24607     }
24608     function_tests++;
24609
24610     return(test_ret);
24611 }
24612
24613
24614 static int
24615 test_xmlParseURI(void) {
24616     int test_ret = 0;
24617
24618
24619     /* missing type support */
24620     return(test_ret);
24621 }
24622
24623
24624 static int
24625 test_xmlParseURIRaw(void) {
24626     int test_ret = 0;
24627
24628
24629     /* missing type support */
24630     return(test_ret);
24631 }
24632
24633
24634 #define gen_nb_xmlURIPtr 1
24635 static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24636     return(NULL);
24637 }
24638 static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24639 }
24640
24641 static int
24642 test_xmlParseURIReference(void) {
24643     int test_ret = 0;
24644
24645     int mem_base;
24646     int ret_val;
24647     xmlURIPtr uri; /* pointer to an URI structure */
24648     int n_uri;
24649     char * str; /* the string to analyze */
24650     int n_str;
24651
24652     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24653     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
24654         mem_base = xmlMemBlocks();
24655         uri = gen_xmlURIPtr(n_uri, 0);
24656         str = gen_const_char_ptr(n_str, 1);
24657
24658         ret_val = xmlParseURIReference(uri, (const char *)str);
24659         desret_int(ret_val);
24660         call_tests++;
24661         des_xmlURIPtr(n_uri, uri, 0);
24662         des_const_char_ptr(n_str, (const char *)str, 1);
24663         xmlResetLastError();
24664         if (mem_base != xmlMemBlocks()) {
24665             printf("Leak of %d blocks found in xmlParseURIReference",
24666                    xmlMemBlocks() - mem_base);
24667             test_ret++;
24668             printf(" %d", n_uri);
24669             printf(" %d", n_str);
24670             printf("\n");
24671         }
24672     }
24673     }
24674     function_tests++;
24675
24676     return(test_ret);
24677 }
24678
24679
24680 static int
24681 test_xmlPathToURI(void) {
24682     int test_ret = 0;
24683
24684     int mem_base;
24685     xmlChar * ret_val;
24686     xmlChar * path; /* the resource locator in a filesystem notation */
24687     int n_path;
24688
24689     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24690         mem_base = xmlMemBlocks();
24691         path = gen_const_xmlChar_ptr(n_path, 0);
24692
24693         ret_val = xmlPathToURI((const xmlChar *)path);
24694         desret_xmlChar_ptr(ret_val);
24695         call_tests++;
24696         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24697         xmlResetLastError();
24698         if (mem_base != xmlMemBlocks()) {
24699             printf("Leak of %d blocks found in xmlPathToURI",
24700                    xmlMemBlocks() - mem_base);
24701             test_ret++;
24702             printf(" %d", n_path);
24703             printf("\n");
24704         }
24705     }
24706     function_tests++;
24707
24708     return(test_ret);
24709 }
24710
24711
24712 static int
24713 test_xmlPrintURI(void) {
24714     int test_ret = 0;
24715
24716     int mem_base;
24717     FILE * stream; /* a FILE* for the output */
24718     int n_stream;
24719     xmlURIPtr uri; /* pointer to an xmlURI */
24720     int n_uri;
24721
24722     for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
24723     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24724         mem_base = xmlMemBlocks();
24725         stream = gen_FILE_ptr(n_stream, 0);
24726         uri = gen_xmlURIPtr(n_uri, 1);
24727
24728         xmlPrintURI(stream, uri);
24729         call_tests++;
24730         des_FILE_ptr(n_stream, stream, 0);
24731         des_xmlURIPtr(n_uri, uri, 1);
24732         xmlResetLastError();
24733         if (mem_base != xmlMemBlocks()) {
24734             printf("Leak of %d blocks found in xmlPrintURI",
24735                    xmlMemBlocks() - mem_base);
24736             test_ret++;
24737             printf(" %d", n_stream);
24738             printf(" %d", n_uri);
24739             printf("\n");
24740         }
24741     }
24742     }
24743     function_tests++;
24744
24745     return(test_ret);
24746 }
24747
24748
24749 static int
24750 test_xmlSaveUri(void) {
24751     int test_ret = 0;
24752
24753     int mem_base;
24754     xmlChar * ret_val;
24755     xmlURIPtr uri; /* pointer to an xmlURI */
24756     int n_uri;
24757
24758     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24759         mem_base = xmlMemBlocks();
24760         uri = gen_xmlURIPtr(n_uri, 0);
24761
24762         ret_val = xmlSaveUri(uri);
24763         desret_xmlChar_ptr(ret_val);
24764         call_tests++;
24765         des_xmlURIPtr(n_uri, uri, 0);
24766         xmlResetLastError();
24767         if (mem_base != xmlMemBlocks()) {
24768             printf("Leak of %d blocks found in xmlSaveUri",
24769                    xmlMemBlocks() - mem_base);
24770             test_ret++;
24771             printf(" %d", n_uri);
24772             printf("\n");
24773         }
24774     }
24775     function_tests++;
24776
24777     return(test_ret);
24778 }
24779
24780
24781 static int
24782 test_xmlURIEscape(void) {
24783     int test_ret = 0;
24784
24785     int mem_base;
24786     xmlChar * ret_val;
24787     xmlChar * str; /* the string of the URI to escape */
24788     int n_str;
24789
24790     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24791         mem_base = xmlMemBlocks();
24792         str = gen_const_xmlChar_ptr(n_str, 0);
24793
24794         ret_val = xmlURIEscape((const xmlChar *)str);
24795         desret_xmlChar_ptr(ret_val);
24796         call_tests++;
24797         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24798         xmlResetLastError();
24799         if (mem_base != xmlMemBlocks()) {
24800             printf("Leak of %d blocks found in xmlURIEscape",
24801                    xmlMemBlocks() - mem_base);
24802             test_ret++;
24803             printf(" %d", n_str);
24804             printf("\n");
24805         }
24806     }
24807     function_tests++;
24808
24809     return(test_ret);
24810 }
24811
24812
24813 static int
24814 test_xmlURIEscapeStr(void) {
24815     int test_ret = 0;
24816
24817     int mem_base;
24818     xmlChar * ret_val;
24819     xmlChar * str; /* string to escape */
24820     int n_str;
24821     xmlChar * list; /* exception list string of chars not to escape */
24822     int n_list;
24823
24824     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24825     for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
24826         mem_base = xmlMemBlocks();
24827         str = gen_const_xmlChar_ptr(n_str, 0);
24828         list = gen_const_xmlChar_ptr(n_list, 1);
24829
24830         ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
24831         desret_xmlChar_ptr(ret_val);
24832         call_tests++;
24833         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24834         des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
24835         xmlResetLastError();
24836         if (mem_base != xmlMemBlocks()) {
24837             printf("Leak of %d blocks found in xmlURIEscapeStr",
24838                    xmlMemBlocks() - mem_base);
24839             test_ret++;
24840             printf(" %d", n_str);
24841             printf(" %d", n_list);
24842             printf("\n");
24843         }
24844     }
24845     }
24846     function_tests++;
24847
24848     return(test_ret);
24849 }
24850
24851
24852 static int
24853 test_xmlURIUnescapeString(void) {
24854     int test_ret = 0;
24855
24856
24857     /* missing type support */
24858     return(test_ret);
24859 }
24860
24861 static int
24862 test_uri(void) {
24863     int test_ret = 0;
24864
24865     if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
24866     test_ret += test_xmlBuildRelativeURI();
24867     test_ret += test_xmlBuildURI();
24868     test_ret += test_xmlCanonicPath();
24869     test_ret += test_xmlCreateURI();
24870     test_ret += test_xmlNormalizeURIPath();
24871     test_ret += test_xmlParseURI();
24872     test_ret += test_xmlParseURIRaw();
24873     test_ret += test_xmlParseURIReference();
24874     test_ret += test_xmlPathToURI();
24875     test_ret += test_xmlPrintURI();
24876     test_ret += test_xmlSaveUri();
24877     test_ret += test_xmlURIEscape();
24878     test_ret += test_xmlURIEscapeStr();
24879     test_ret += test_xmlURIUnescapeString();
24880
24881     if (test_ret != 0)
24882         printf("Module uri: %d errors\n", test_ret);
24883     return(test_ret);
24884 }
24885
24886 static int
24887 test_xmlAddAttributeDecl(void) {
24888     int test_ret = 0;
24889
24890     int mem_base;
24891     xmlAttributePtr ret_val;
24892     xmlValidCtxtPtr ctxt; /* the validation context */
24893     int n_ctxt;
24894     xmlDtdPtr dtd; /* pointer to the DTD */
24895     int n_dtd;
24896     xmlChar * elem; /* the element name */
24897     int n_elem;
24898     xmlChar * name; /* the attribute name */
24899     int n_name;
24900     xmlChar * ns; /* the attribute namespace prefix */
24901     int n_ns;
24902     xmlAttributeType type; /* the attribute type */
24903     int n_type;
24904     xmlAttributeDefault def; /* the attribute default type */
24905     int n_def;
24906     xmlChar * defaultValue; /* the attribute default value */
24907     int n_defaultValue;
24908     xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
24909     int n_tree;
24910
24911     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24912     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24913     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24914     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24915     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
24916     for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24917     for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
24918     for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
24919     for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
24920         mem_base = xmlMemBlocks();
24921         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24922         dtd = gen_xmlDtdPtr(n_dtd, 1);
24923         elem = gen_const_xmlChar_ptr(n_elem, 2);
24924         name = gen_const_xmlChar_ptr(n_name, 3);
24925         ns = gen_const_xmlChar_ptr(n_ns, 4);
24926         type = gen_xmlAttributeType(n_type, 5);
24927         def = gen_xmlAttributeDefault(n_def, 6);
24928         defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
24929         tree = gen_xmlEnumerationPtr(n_tree, 8);
24930
24931         ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
24932         desret_xmlAttributePtr(ret_val);
24933         call_tests++;
24934         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24935         des_xmlDtdPtr(n_dtd, dtd, 1);
24936         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
24937         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24938         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
24939         des_xmlAttributeType(n_type, type, 5);
24940         des_xmlAttributeDefault(n_def, def, 6);
24941         des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
24942         des_xmlEnumerationPtr(n_tree, tree, 8);
24943         xmlResetLastError();
24944         if (mem_base != xmlMemBlocks()) {
24945             printf("Leak of %d blocks found in xmlAddAttributeDecl",
24946                    xmlMemBlocks() - mem_base);
24947             test_ret++;
24948             printf(" %d", n_ctxt);
24949             printf(" %d", n_dtd);
24950             printf(" %d", n_elem);
24951             printf(" %d", n_name);
24952             printf(" %d", n_ns);
24953             printf(" %d", n_type);
24954             printf(" %d", n_def);
24955             printf(" %d", n_defaultValue);
24956             printf(" %d", n_tree);
24957             printf("\n");
24958         }
24959     }
24960     }
24961     }
24962     }
24963     }
24964     }
24965     }
24966     }
24967     }
24968     function_tests++;
24969
24970     return(test_ret);
24971 }
24972
24973
24974 static int
24975 test_xmlAddElementDecl(void) {
24976     int test_ret = 0;
24977
24978     int mem_base;
24979     xmlElementPtr ret_val;
24980     xmlValidCtxtPtr ctxt; /* the validation context */
24981     int n_ctxt;
24982     xmlDtdPtr dtd; /* pointer to the DTD */
24983     int n_dtd;
24984     xmlChar * name; /* the entity name */
24985     int n_name;
24986     xmlElementTypeVal type; /* the element type */
24987     int n_type;
24988     xmlElementContentPtr content; /* the element content tree or NULL */
24989     int n_content;
24990
24991     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24992     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24993     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24994     for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
24995     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24996         mem_base = xmlMemBlocks();
24997         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24998         dtd = gen_xmlDtdPtr(n_dtd, 1);
24999         name = gen_const_xmlChar_ptr(n_name, 2);
25000         type = gen_xmlElementTypeVal(n_type, 3);
25001         content = gen_xmlElementContentPtr(n_content, 4);
25002
25003         ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
25004         desret_xmlElementPtr(ret_val);
25005         call_tests++;
25006         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25007         des_xmlDtdPtr(n_dtd, dtd, 1);
25008         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25009         des_xmlElementTypeVal(n_type, type, 3);
25010         des_xmlElementContentPtr(n_content, content, 4);
25011         xmlResetLastError();
25012         if (mem_base != xmlMemBlocks()) {
25013             printf("Leak of %d blocks found in xmlAddElementDecl",
25014                    xmlMemBlocks() - mem_base);
25015             test_ret++;
25016             printf(" %d", n_ctxt);
25017             printf(" %d", n_dtd);
25018             printf(" %d", n_name);
25019             printf(" %d", n_type);
25020             printf(" %d", n_content);
25021             printf("\n");
25022         }
25023     }
25024     }
25025     }
25026     }
25027     }
25028     function_tests++;
25029
25030     return(test_ret);
25031 }
25032
25033
25034 static int
25035 test_xmlAddID(void) {
25036     int test_ret = 0;
25037
25038
25039     /* missing type support */
25040     return(test_ret);
25041 }
25042
25043
25044 static int
25045 test_xmlAddNotationDecl(void) {
25046     int test_ret = 0;
25047
25048
25049     /* missing type support */
25050     return(test_ret);
25051 }
25052
25053
25054 static int
25055 test_xmlAddRef(void) {
25056     int test_ret = 0;
25057
25058
25059     /* missing type support */
25060     return(test_ret);
25061 }
25062
25063
25064 #define gen_nb_xmlAttributeTablePtr 1
25065 static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25066     return(NULL);
25067 }
25068 static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25069 }
25070
25071 static int
25072 test_xmlCopyAttributeTable(void) {
25073     int test_ret = 0;
25074
25075
25076     /* missing type support */
25077     return(test_ret);
25078 }
25079
25080
25081 static int
25082 test_xmlCopyDocElementContent(void) {
25083     int test_ret = 0;
25084
25085     int mem_base;
25086     xmlElementContentPtr ret_val;
25087     xmlDocPtr doc; /* the document owning the element declaration */
25088     int n_doc;
25089     xmlElementContentPtr cur; /* An element content pointer. */
25090     int n_cur;
25091
25092     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25093     for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
25094         mem_base = xmlMemBlocks();
25095         doc = gen_xmlDocPtr(n_doc, 0);
25096         cur = gen_xmlElementContentPtr(n_cur, 1);
25097
25098         ret_val = xmlCopyDocElementContent(doc, cur);
25099         desret_xmlElementContentPtr(ret_val);
25100         call_tests++;
25101         des_xmlDocPtr(n_doc, doc, 0);
25102         des_xmlElementContentPtr(n_cur, cur, 1);
25103         xmlResetLastError();
25104         if (mem_base != xmlMemBlocks()) {
25105             printf("Leak of %d blocks found in xmlCopyDocElementContent",
25106                    xmlMemBlocks() - mem_base);
25107             test_ret++;
25108             printf(" %d", n_doc);
25109             printf(" %d", n_cur);
25110             printf("\n");
25111         }
25112     }
25113     }
25114     function_tests++;
25115
25116     return(test_ret);
25117 }
25118
25119
25120 static int
25121 test_xmlCopyElementContent(void) {
25122     int test_ret = 0;
25123
25124     int mem_base;
25125     xmlElementContentPtr ret_val;
25126     xmlElementContentPtr cur; /* An element content pointer. */
25127     int n_cur;
25128
25129     for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
25130         mem_base = xmlMemBlocks();
25131         cur = gen_xmlElementContentPtr(n_cur, 0);
25132
25133         ret_val = xmlCopyElementContent(cur);
25134         desret_xmlElementContentPtr(ret_val);
25135         call_tests++;
25136         des_xmlElementContentPtr(n_cur, cur, 0);
25137         xmlResetLastError();
25138         if (mem_base != xmlMemBlocks()) {
25139             printf("Leak of %d blocks found in xmlCopyElementContent",
25140                    xmlMemBlocks() - mem_base);
25141             test_ret++;
25142             printf(" %d", n_cur);
25143             printf("\n");
25144         }
25145     }
25146     function_tests++;
25147
25148     return(test_ret);
25149 }
25150
25151
25152 #define gen_nb_xmlElementTablePtr 1
25153 static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25154     return(NULL);
25155 }
25156 static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25157 }
25158
25159 static int
25160 test_xmlCopyElementTable(void) {
25161     int test_ret = 0;
25162
25163
25164     /* missing type support */
25165     return(test_ret);
25166 }
25167
25168
25169 static int
25170 test_xmlCopyEnumeration(void) {
25171     int test_ret = 0;
25172
25173
25174     /* missing type support */
25175     return(test_ret);
25176 }
25177
25178
25179 #define gen_nb_xmlNotationTablePtr 1
25180 static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25181     return(NULL);
25182 }
25183 static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25184 }
25185
25186 static int
25187 test_xmlCopyNotationTable(void) {
25188     int test_ret = 0;
25189
25190
25191     /* missing type support */
25192     return(test_ret);
25193 }
25194
25195
25196 static int
25197 test_xmlCreateEnumeration(void) {
25198     int test_ret = 0;
25199
25200
25201     /* missing type support */
25202     return(test_ret);
25203 }
25204
25205
25206 #define gen_nb_xmlAttributePtr 1
25207 static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25208     return(NULL);
25209 }
25210 static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25211 }
25212
25213 static int
25214 test_xmlDumpAttributeDecl(void) {
25215     int test_ret = 0;
25216
25217 #if defined(LIBXML_OUTPUT_ENABLED)
25218     int mem_base;
25219     xmlBufferPtr buf; /* the XML buffer output */
25220     int n_buf;
25221     xmlAttributePtr attr; /* An attribute declaration */
25222     int n_attr;
25223
25224     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25225     for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
25226         mem_base = xmlMemBlocks();
25227         buf = gen_xmlBufferPtr(n_buf, 0);
25228         attr = gen_xmlAttributePtr(n_attr, 1);
25229
25230         xmlDumpAttributeDecl(buf, attr);
25231         call_tests++;
25232         des_xmlBufferPtr(n_buf, buf, 0);
25233         des_xmlAttributePtr(n_attr, attr, 1);
25234         xmlResetLastError();
25235         if (mem_base != xmlMemBlocks()) {
25236             printf("Leak of %d blocks found in xmlDumpAttributeDecl",
25237                    xmlMemBlocks() - mem_base);
25238             test_ret++;
25239             printf(" %d", n_buf);
25240             printf(" %d", n_attr);
25241             printf("\n");
25242         }
25243     }
25244     }
25245     function_tests++;
25246 #endif
25247
25248     return(test_ret);
25249 }
25250
25251
25252 static int
25253 test_xmlDumpAttributeTable(void) {
25254     int test_ret = 0;
25255
25256 #if defined(LIBXML_OUTPUT_ENABLED)
25257     int mem_base;
25258     xmlBufferPtr buf; /* the XML buffer output */
25259     int n_buf;
25260     xmlAttributeTablePtr table; /* An attribute table */
25261     int n_table;
25262
25263     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25264     for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
25265         mem_base = xmlMemBlocks();
25266         buf = gen_xmlBufferPtr(n_buf, 0);
25267         table = gen_xmlAttributeTablePtr(n_table, 1);
25268
25269         xmlDumpAttributeTable(buf, table);
25270         call_tests++;
25271         des_xmlBufferPtr(n_buf, buf, 0);
25272         des_xmlAttributeTablePtr(n_table, table, 1);
25273         xmlResetLastError();
25274         if (mem_base != xmlMemBlocks()) {
25275             printf("Leak of %d blocks found in xmlDumpAttributeTable",
25276                    xmlMemBlocks() - mem_base);
25277             test_ret++;
25278             printf(" %d", n_buf);
25279             printf(" %d", n_table);
25280             printf("\n");
25281         }
25282     }
25283     }
25284     function_tests++;
25285 #endif
25286
25287     return(test_ret);
25288 }
25289
25290
25291 #define gen_nb_xmlElementPtr 1
25292 static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25293     return(NULL);
25294 }
25295 static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25296 }
25297
25298 static int
25299 test_xmlDumpElementDecl(void) {
25300     int test_ret = 0;
25301
25302 #if defined(LIBXML_OUTPUT_ENABLED)
25303     int mem_base;
25304     xmlBufferPtr buf; /* the XML buffer output */
25305     int n_buf;
25306     xmlElementPtr elem; /* An element table */
25307     int n_elem;
25308
25309     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25310     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25311         mem_base = xmlMemBlocks();
25312         buf = gen_xmlBufferPtr(n_buf, 0);
25313         elem = gen_xmlElementPtr(n_elem, 1);
25314
25315         xmlDumpElementDecl(buf, elem);
25316         call_tests++;
25317         des_xmlBufferPtr(n_buf, buf, 0);
25318         des_xmlElementPtr(n_elem, elem, 1);
25319         xmlResetLastError();
25320         if (mem_base != xmlMemBlocks()) {
25321             printf("Leak of %d blocks found in xmlDumpElementDecl",
25322                    xmlMemBlocks() - mem_base);
25323             test_ret++;
25324             printf(" %d", n_buf);
25325             printf(" %d", n_elem);
25326             printf("\n");
25327         }
25328     }
25329     }
25330     function_tests++;
25331 #endif
25332
25333     return(test_ret);
25334 }
25335
25336
25337 static int
25338 test_xmlDumpElementTable(void) {
25339     int test_ret = 0;
25340
25341 #if defined(LIBXML_OUTPUT_ENABLED)
25342     int mem_base;
25343     xmlBufferPtr buf; /* the XML buffer output */
25344     int n_buf;
25345     xmlElementTablePtr table; /* An element table */
25346     int n_table;
25347
25348     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25349     for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
25350         mem_base = xmlMemBlocks();
25351         buf = gen_xmlBufferPtr(n_buf, 0);
25352         table = gen_xmlElementTablePtr(n_table, 1);
25353
25354         xmlDumpElementTable(buf, table);
25355         call_tests++;
25356         des_xmlBufferPtr(n_buf, buf, 0);
25357         des_xmlElementTablePtr(n_table, table, 1);
25358         xmlResetLastError();
25359         if (mem_base != xmlMemBlocks()) {
25360             printf("Leak of %d blocks found in xmlDumpElementTable",
25361                    xmlMemBlocks() - mem_base);
25362             test_ret++;
25363             printf(" %d", n_buf);
25364             printf(" %d", n_table);
25365             printf("\n");
25366         }
25367     }
25368     }
25369     function_tests++;
25370 #endif
25371
25372     return(test_ret);
25373 }
25374
25375
25376 #define gen_nb_xmlNotationPtr 1
25377 static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25378     return(NULL);
25379 }
25380 static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25381 }
25382
25383 static int
25384 test_xmlDumpNotationDecl(void) {
25385     int test_ret = 0;
25386
25387 #if defined(LIBXML_OUTPUT_ENABLED)
25388     int mem_base;
25389     xmlBufferPtr buf; /* the XML buffer output */
25390     int n_buf;
25391     xmlNotationPtr nota; /* A notation declaration */
25392     int n_nota;
25393
25394     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25395     for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
25396         mem_base = xmlMemBlocks();
25397         buf = gen_xmlBufferPtr(n_buf, 0);
25398         nota = gen_xmlNotationPtr(n_nota, 1);
25399
25400         xmlDumpNotationDecl(buf, nota);
25401         call_tests++;
25402         des_xmlBufferPtr(n_buf, buf, 0);
25403         des_xmlNotationPtr(n_nota, nota, 1);
25404         xmlResetLastError();
25405         if (mem_base != xmlMemBlocks()) {
25406             printf("Leak of %d blocks found in xmlDumpNotationDecl",
25407                    xmlMemBlocks() - mem_base);
25408             test_ret++;
25409             printf(" %d", n_buf);
25410             printf(" %d", n_nota);
25411             printf("\n");
25412         }
25413     }
25414     }
25415     function_tests++;
25416 #endif
25417
25418     return(test_ret);
25419 }
25420
25421
25422 static int
25423 test_xmlDumpNotationTable(void) {
25424     int test_ret = 0;
25425
25426 #if defined(LIBXML_OUTPUT_ENABLED)
25427     int mem_base;
25428     xmlBufferPtr buf; /* the XML buffer output */
25429     int n_buf;
25430     xmlNotationTablePtr table; /* A notation table */
25431     int n_table;
25432
25433     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25434     for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
25435         mem_base = xmlMemBlocks();
25436         buf = gen_xmlBufferPtr(n_buf, 0);
25437         table = gen_xmlNotationTablePtr(n_table, 1);
25438
25439         xmlDumpNotationTable(buf, table);
25440         call_tests++;
25441         des_xmlBufferPtr(n_buf, buf, 0);
25442         des_xmlNotationTablePtr(n_table, table, 1);
25443         xmlResetLastError();
25444         if (mem_base != xmlMemBlocks()) {
25445             printf("Leak of %d blocks found in xmlDumpNotationTable",
25446                    xmlMemBlocks() - mem_base);
25447             test_ret++;
25448             printf(" %d", n_buf);
25449             printf(" %d", n_table);
25450             printf("\n");
25451         }
25452     }
25453     }
25454     function_tests++;
25455 #endif
25456
25457     return(test_ret);
25458 }
25459
25460
25461 static int
25462 test_xmlGetDtdAttrDesc(void) {
25463     int test_ret = 0;
25464
25465     int mem_base;
25466     xmlAttributePtr ret_val;
25467     xmlDtdPtr dtd; /* a pointer to the DtD to search */
25468     int n_dtd;
25469     xmlChar * elem; /* the element name */
25470     int n_elem;
25471     xmlChar * name; /* the attribute name */
25472     int n_name;
25473
25474     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25475     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25476     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25477         mem_base = xmlMemBlocks();
25478         dtd = gen_xmlDtdPtr(n_dtd, 0);
25479         elem = gen_const_xmlChar_ptr(n_elem, 1);
25480         name = gen_const_xmlChar_ptr(n_name, 2);
25481
25482         ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
25483         desret_xmlAttributePtr(ret_val);
25484         call_tests++;
25485         des_xmlDtdPtr(n_dtd, dtd, 0);
25486         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25487         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25488         xmlResetLastError();
25489         if (mem_base != xmlMemBlocks()) {
25490             printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
25491                    xmlMemBlocks() - mem_base);
25492             test_ret++;
25493             printf(" %d", n_dtd);
25494             printf(" %d", n_elem);
25495             printf(" %d", n_name);
25496             printf("\n");
25497         }
25498     }
25499     }
25500     }
25501     function_tests++;
25502
25503     return(test_ret);
25504 }
25505
25506
25507 static int
25508 test_xmlGetDtdElementDesc(void) {
25509     int test_ret = 0;
25510
25511     int mem_base;
25512     xmlElementPtr ret_val;
25513     xmlDtdPtr dtd; /* a pointer to the DtD to search */
25514     int n_dtd;
25515     xmlChar * name; /* the element name */
25516     int n_name;
25517
25518     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25519     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25520         mem_base = xmlMemBlocks();
25521         dtd = gen_xmlDtdPtr(n_dtd, 0);
25522         name = gen_const_xmlChar_ptr(n_name, 1);
25523
25524         ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
25525         desret_xmlElementPtr(ret_val);
25526         call_tests++;
25527         des_xmlDtdPtr(n_dtd, dtd, 0);
25528         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25529         xmlResetLastError();
25530         if (mem_base != xmlMemBlocks()) {
25531             printf("Leak of %d blocks found in xmlGetDtdElementDesc",
25532                    xmlMemBlocks() - mem_base);
25533             test_ret++;
25534             printf(" %d", n_dtd);
25535             printf(" %d", n_name);
25536             printf("\n");
25537         }
25538     }
25539     }
25540     function_tests++;
25541
25542     return(test_ret);
25543 }
25544
25545
25546 static int
25547 test_xmlGetDtdNotationDesc(void) {
25548     int test_ret = 0;
25549
25550
25551     /* missing type support */
25552     return(test_ret);
25553 }
25554
25555
25556 static int
25557 test_xmlGetDtdQAttrDesc(void) {
25558     int test_ret = 0;
25559
25560     int mem_base;
25561     xmlAttributePtr ret_val;
25562     xmlDtdPtr dtd; /* a pointer to the DtD to search */
25563     int n_dtd;
25564     xmlChar * elem; /* the element name */
25565     int n_elem;
25566     xmlChar * name; /* the attribute name */
25567     int n_name;
25568     xmlChar * prefix; /* the attribute namespace prefix */
25569     int n_prefix;
25570
25571     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25572     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25573     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25574     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25575         mem_base = xmlMemBlocks();
25576         dtd = gen_xmlDtdPtr(n_dtd, 0);
25577         elem = gen_const_xmlChar_ptr(n_elem, 1);
25578         name = gen_const_xmlChar_ptr(n_name, 2);
25579         prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25580
25581         ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
25582         desret_xmlAttributePtr(ret_val);
25583         call_tests++;
25584         des_xmlDtdPtr(n_dtd, dtd, 0);
25585         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25586         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25587         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
25588         xmlResetLastError();
25589         if (mem_base != xmlMemBlocks()) {
25590             printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
25591                    xmlMemBlocks() - mem_base);
25592             test_ret++;
25593             printf(" %d", n_dtd);
25594             printf(" %d", n_elem);
25595             printf(" %d", n_name);
25596             printf(" %d", n_prefix);
25597             printf("\n");
25598         }
25599     }
25600     }
25601     }
25602     }
25603     function_tests++;
25604
25605     return(test_ret);
25606 }
25607
25608
25609 static int
25610 test_xmlGetDtdQElementDesc(void) {
25611     int test_ret = 0;
25612
25613     int mem_base;
25614     xmlElementPtr ret_val;
25615     xmlDtdPtr dtd; /* a pointer to the DtD to search */
25616     int n_dtd;
25617     xmlChar * name; /* the element name */
25618     int n_name;
25619     xmlChar * prefix; /* the element namespace prefix */
25620     int n_prefix;
25621
25622     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25623     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25624     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25625         mem_base = xmlMemBlocks();
25626         dtd = gen_xmlDtdPtr(n_dtd, 0);
25627         name = gen_const_xmlChar_ptr(n_name, 1);
25628         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
25629
25630         ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
25631         desret_xmlElementPtr(ret_val);
25632         call_tests++;
25633         des_xmlDtdPtr(n_dtd, dtd, 0);
25634         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25635         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
25636         xmlResetLastError();
25637         if (mem_base != xmlMemBlocks()) {
25638             printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
25639                    xmlMemBlocks() - mem_base);
25640             test_ret++;
25641             printf(" %d", n_dtd);
25642             printf(" %d", n_name);
25643             printf(" %d", n_prefix);
25644             printf("\n");
25645         }
25646     }
25647     }
25648     }
25649     function_tests++;
25650
25651     return(test_ret);
25652 }
25653
25654
25655 static int
25656 test_xmlGetID(void) {
25657     int test_ret = 0;
25658
25659     int mem_base;
25660     xmlAttrPtr ret_val;
25661     xmlDocPtr doc; /* pointer to the document */
25662     int n_doc;
25663     xmlChar * ID; /* the ID value */
25664     int n_ID;
25665
25666     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25667     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
25668         mem_base = xmlMemBlocks();
25669         doc = gen_xmlDocPtr(n_doc, 0);
25670         ID = gen_const_xmlChar_ptr(n_ID, 1);
25671
25672         ret_val = xmlGetID(doc, (const xmlChar *)ID);
25673         desret_xmlAttrPtr(ret_val);
25674         call_tests++;
25675         des_xmlDocPtr(n_doc, doc, 0);
25676         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
25677         xmlResetLastError();
25678         if (mem_base != xmlMemBlocks()) {
25679             printf("Leak of %d blocks found in xmlGetID",
25680                    xmlMemBlocks() - mem_base);
25681             test_ret++;
25682             printf(" %d", n_doc);
25683             printf(" %d", n_ID);
25684             printf("\n");
25685         }
25686     }
25687     }
25688     function_tests++;
25689
25690     return(test_ret);
25691 }
25692
25693
25694 static int
25695 test_xmlGetRefs(void) {
25696     int test_ret = 0;
25697
25698
25699     /* missing type support */
25700     return(test_ret);
25701 }
25702
25703
25704 static int
25705 test_xmlIsID(void) {
25706     int test_ret = 0;
25707
25708     int mem_base;
25709     int ret_val;
25710     xmlDocPtr doc; /* the document */
25711     int n_doc;
25712     xmlNodePtr elem; /* the element carrying the attribute */
25713     int n_elem;
25714     xmlAttrPtr attr; /* the attribute */
25715     int n_attr;
25716
25717     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25718     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25719     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25720         mem_base = xmlMemBlocks();
25721         doc = gen_xmlDocPtr(n_doc, 0);
25722         elem = gen_xmlNodePtr(n_elem, 1);
25723         attr = gen_xmlAttrPtr(n_attr, 2);
25724
25725         ret_val = xmlIsID(doc, elem, attr);
25726         desret_int(ret_val);
25727         call_tests++;
25728         des_xmlDocPtr(n_doc, doc, 0);
25729         des_xmlNodePtr(n_elem, elem, 1);
25730         des_xmlAttrPtr(n_attr, attr, 2);
25731         xmlResetLastError();
25732         if (mem_base != xmlMemBlocks()) {
25733             printf("Leak of %d blocks found in xmlIsID",
25734                    xmlMemBlocks() - mem_base);
25735             test_ret++;
25736             printf(" %d", n_doc);
25737             printf(" %d", n_elem);
25738             printf(" %d", n_attr);
25739             printf("\n");
25740         }
25741     }
25742     }
25743     }
25744     function_tests++;
25745
25746     return(test_ret);
25747 }
25748
25749
25750 static int
25751 test_xmlIsMixedElement(void) {
25752     int test_ret = 0;
25753
25754     int mem_base;
25755     int ret_val;
25756     xmlDocPtr doc; /* the document */
25757     int n_doc;
25758     xmlChar * name; /* the element name */
25759     int n_name;
25760
25761     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25762     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25763         mem_base = xmlMemBlocks();
25764         doc = gen_xmlDocPtr(n_doc, 0);
25765         name = gen_const_xmlChar_ptr(n_name, 1);
25766
25767         ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
25768         desret_int(ret_val);
25769         call_tests++;
25770         des_xmlDocPtr(n_doc, doc, 0);
25771         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25772         xmlResetLastError();
25773         if (mem_base != xmlMemBlocks()) {
25774             printf("Leak of %d blocks found in xmlIsMixedElement",
25775                    xmlMemBlocks() - mem_base);
25776             test_ret++;
25777             printf(" %d", n_doc);
25778             printf(" %d", n_name);
25779             printf("\n");
25780         }
25781     }
25782     }
25783     function_tests++;
25784
25785     return(test_ret);
25786 }
25787
25788
25789 static int
25790 test_xmlIsRef(void) {
25791     int test_ret = 0;
25792
25793     int mem_base;
25794     int ret_val;
25795     xmlDocPtr doc; /* the document */
25796     int n_doc;
25797     xmlNodePtr elem; /* the element carrying the attribute */
25798     int n_elem;
25799     xmlAttrPtr attr; /* the attribute */
25800     int n_attr;
25801
25802     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25803     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25804     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25805         mem_base = xmlMemBlocks();
25806         doc = gen_xmlDocPtr(n_doc, 0);
25807         elem = gen_xmlNodePtr(n_elem, 1);
25808         attr = gen_xmlAttrPtr(n_attr, 2);
25809
25810         ret_val = xmlIsRef(doc, elem, attr);
25811         desret_int(ret_val);
25812         call_tests++;
25813         des_xmlDocPtr(n_doc, doc, 0);
25814         des_xmlNodePtr(n_elem, elem, 1);
25815         des_xmlAttrPtr(n_attr, attr, 2);
25816         xmlResetLastError();
25817         if (mem_base != xmlMemBlocks()) {
25818             printf("Leak of %d blocks found in xmlIsRef",
25819                    xmlMemBlocks() - mem_base);
25820             test_ret++;
25821             printf(" %d", n_doc);
25822             printf(" %d", n_elem);
25823             printf(" %d", n_attr);
25824             printf("\n");
25825         }
25826     }
25827     }
25828     }
25829     function_tests++;
25830
25831     return(test_ret);
25832 }
25833
25834
25835 static int
25836 test_xmlNewDocElementContent(void) {
25837     int test_ret = 0;
25838
25839     int mem_base;
25840     xmlElementContentPtr ret_val;
25841     xmlDocPtr doc; /* the document */
25842     int n_doc;
25843     xmlChar * name; /* the subelement name or NULL */
25844     int n_name;
25845     xmlElementContentType type; /* the type of element content decl */
25846     int n_type;
25847
25848     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25849     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25850     for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25851         mem_base = xmlMemBlocks();
25852         doc = gen_xmlDocPtr(n_doc, 0);
25853         name = gen_const_xmlChar_ptr(n_name, 1);
25854         type = gen_xmlElementContentType(n_type, 2);
25855
25856         ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
25857         xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
25858         desret_xmlElementContentPtr(ret_val);
25859         call_tests++;
25860         des_xmlDocPtr(n_doc, doc, 0);
25861         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25862         des_xmlElementContentType(n_type, type, 2);
25863         xmlResetLastError();
25864         if (mem_base != xmlMemBlocks()) {
25865             printf("Leak of %d blocks found in xmlNewDocElementContent",
25866                    xmlMemBlocks() - mem_base);
25867             test_ret++;
25868             printf(" %d", n_doc);
25869             printf(" %d", n_name);
25870             printf(" %d", n_type);
25871             printf("\n");
25872         }
25873     }
25874     }
25875     }
25876     function_tests++;
25877
25878     return(test_ret);
25879 }
25880
25881
25882 static int
25883 test_xmlNewElementContent(void) {
25884     int test_ret = 0;
25885
25886     int mem_base;
25887     xmlElementContentPtr ret_val;
25888     xmlChar * name; /* the subelement name or NULL */
25889     int n_name;
25890     xmlElementContentType type; /* the type of element content decl */
25891     int n_type;
25892
25893     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25894     for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25895         mem_base = xmlMemBlocks();
25896         name = gen_const_xmlChar_ptr(n_name, 0);
25897         type = gen_xmlElementContentType(n_type, 1);
25898
25899         ret_val = xmlNewElementContent((const xmlChar *)name, type);
25900         desret_xmlElementContentPtr(ret_val);
25901         call_tests++;
25902         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
25903         des_xmlElementContentType(n_type, type, 1);
25904         xmlResetLastError();
25905         if (mem_base != xmlMemBlocks()) {
25906             printf("Leak of %d blocks found in xmlNewElementContent",
25907                    xmlMemBlocks() - mem_base);
25908             test_ret++;
25909             printf(" %d", n_name);
25910             printf(" %d", n_type);
25911             printf("\n");
25912         }
25913     }
25914     }
25915     function_tests++;
25916
25917     return(test_ret);
25918 }
25919
25920
25921 static int
25922 test_xmlNewValidCtxt(void) {
25923     int test_ret = 0;
25924
25925
25926     /* missing type support */
25927     return(test_ret);
25928 }
25929
25930
25931 static int
25932 test_xmlRemoveID(void) {
25933     int test_ret = 0;
25934
25935     int mem_base;
25936     int ret_val;
25937     xmlDocPtr doc; /* the document */
25938     int n_doc;
25939     xmlAttrPtr attr; /* the attribute */
25940     int n_attr;
25941
25942     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25943     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25944         mem_base = xmlMemBlocks();
25945         doc = gen_xmlDocPtr(n_doc, 0);
25946         attr = gen_xmlAttrPtr(n_attr, 1);
25947
25948         ret_val = xmlRemoveID(doc, attr);
25949         desret_int(ret_val);
25950         call_tests++;
25951         des_xmlDocPtr(n_doc, doc, 0);
25952         des_xmlAttrPtr(n_attr, attr, 1);
25953         xmlResetLastError();
25954         if (mem_base != xmlMemBlocks()) {
25955             printf("Leak of %d blocks found in xmlRemoveID",
25956                    xmlMemBlocks() - mem_base);
25957             test_ret++;
25958             printf(" %d", n_doc);
25959             printf(" %d", n_attr);
25960             printf("\n");
25961         }
25962     }
25963     }
25964     function_tests++;
25965
25966     return(test_ret);
25967 }
25968
25969
25970 static int
25971 test_xmlRemoveRef(void) {
25972     int test_ret = 0;
25973
25974     int mem_base;
25975     int ret_val;
25976     xmlDocPtr doc; /* the document */
25977     int n_doc;
25978     xmlAttrPtr attr; /* the attribute */
25979     int n_attr;
25980
25981     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25982     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25983         mem_base = xmlMemBlocks();
25984         doc = gen_xmlDocPtr(n_doc, 0);
25985         attr = gen_xmlAttrPtr(n_attr, 1);
25986
25987         ret_val = xmlRemoveRef(doc, attr);
25988         desret_int(ret_val);
25989         call_tests++;
25990         des_xmlDocPtr(n_doc, doc, 0);
25991         des_xmlAttrPtr(n_attr, attr, 1);
25992         xmlResetLastError();
25993         if (mem_base != xmlMemBlocks()) {
25994             printf("Leak of %d blocks found in xmlRemoveRef",
25995                    xmlMemBlocks() - mem_base);
25996             test_ret++;
25997             printf(" %d", n_doc);
25998             printf(" %d", n_attr);
25999             printf("\n");
26000         }
26001     }
26002     }
26003     function_tests++;
26004
26005     return(test_ret);
26006 }
26007
26008
26009 static int
26010 test_xmlSnprintfElementContent(void) {
26011     int test_ret = 0;
26012
26013     int mem_base;
26014     char * buf; /* an output buffer */
26015     int n_buf;
26016     int size; /* the buffer size */
26017     int n_size;
26018     xmlElementContentPtr content; /* An element table */
26019     int n_content;
26020     int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
26021     int n_englob;
26022
26023     for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
26024     for (n_size = 0;n_size < gen_nb_int;n_size++) {
26025     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
26026     for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
26027         mem_base = xmlMemBlocks();
26028         buf = gen_char_ptr(n_buf, 0);
26029         size = gen_int(n_size, 1);
26030         content = gen_xmlElementContentPtr(n_content, 2);
26031         englob = gen_int(n_englob, 3);
26032
26033         xmlSnprintfElementContent(buf, size, content, englob);
26034         call_tests++;
26035         des_char_ptr(n_buf, buf, 0);
26036         des_int(n_size, size, 1);
26037         des_xmlElementContentPtr(n_content, content, 2);
26038         des_int(n_englob, englob, 3);
26039         xmlResetLastError();
26040         if (mem_base != xmlMemBlocks()) {
26041             printf("Leak of %d blocks found in xmlSnprintfElementContent",
26042                    xmlMemBlocks() - mem_base);
26043             test_ret++;
26044             printf(" %d", n_buf);
26045             printf(" %d", n_size);
26046             printf(" %d", n_content);
26047             printf(" %d", n_englob);
26048             printf("\n");
26049         }
26050     }
26051     }
26052     }
26053     }
26054     function_tests++;
26055
26056     return(test_ret);
26057 }
26058
26059
26060 static int
26061 test_xmlSprintfElementContent(void) {
26062     int test_ret = 0;
26063
26064 #if defined(LIBXML_OUTPUT_ENABLED)
26065 #ifdef LIBXML_OUTPUT_ENABLED
26066     int mem_base;
26067     char * buf; /* an output buffer */
26068     int n_buf;
26069     xmlElementContentPtr content; /* An element table */
26070     int n_content;
26071     int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
26072     int n_englob;
26073
26074     for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
26075     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
26076     for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
26077         mem_base = xmlMemBlocks();
26078         buf = gen_char_ptr(n_buf, 0);
26079         content = gen_xmlElementContentPtr(n_content, 1);
26080         englob = gen_int(n_englob, 2);
26081
26082         xmlSprintfElementContent(buf, content, englob);
26083         call_tests++;
26084         des_char_ptr(n_buf, buf, 0);
26085         des_xmlElementContentPtr(n_content, content, 1);
26086         des_int(n_englob, englob, 2);
26087         xmlResetLastError();
26088         if (mem_base != xmlMemBlocks()) {
26089             printf("Leak of %d blocks found in xmlSprintfElementContent",
26090                    xmlMemBlocks() - mem_base);
26091             test_ret++;
26092             printf(" %d", n_buf);
26093             printf(" %d", n_content);
26094             printf(" %d", n_englob);
26095             printf("\n");
26096         }
26097     }
26098     }
26099     }
26100     function_tests++;
26101 #endif
26102 #endif
26103
26104     return(test_ret);
26105 }
26106
26107
26108 static int
26109 test_xmlValidBuildContentModel(void) {
26110     int test_ret = 0;
26111
26112 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26113     int mem_base;
26114     int ret_val;
26115     xmlValidCtxtPtr ctxt; /* a validation context */
26116     int n_ctxt;
26117     xmlElementPtr elem; /* an element declaration node */
26118     int n_elem;
26119
26120     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26121     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26122         mem_base = xmlMemBlocks();
26123         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26124         elem = gen_xmlElementPtr(n_elem, 1);
26125
26126         ret_val = xmlValidBuildContentModel(ctxt, elem);
26127         desret_int(ret_val);
26128         call_tests++;
26129         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26130         des_xmlElementPtr(n_elem, elem, 1);
26131         xmlResetLastError();
26132         if (mem_base != xmlMemBlocks()) {
26133             printf("Leak of %d blocks found in xmlValidBuildContentModel",
26134                    xmlMemBlocks() - mem_base);
26135             test_ret++;
26136             printf(" %d", n_ctxt);
26137             printf(" %d", n_elem);
26138             printf("\n");
26139         }
26140     }
26141     }
26142     function_tests++;
26143 #endif
26144
26145     return(test_ret);
26146 }
26147
26148
26149 static int
26150 test_xmlValidCtxtNormalizeAttributeValue(void) {
26151     int test_ret = 0;
26152
26153 #if defined(LIBXML_VALID_ENABLED)
26154     int mem_base;
26155     xmlChar * ret_val;
26156     xmlValidCtxtPtr ctxt; /* the validation context or NULL */
26157     int n_ctxt;
26158     xmlDocPtr doc; /* the document */
26159     int n_doc;
26160     xmlNodePtr elem; /* the parent */
26161     int n_elem;
26162     xmlChar * name; /* the attribute name */
26163     int n_name;
26164     xmlChar * value; /* the attribute value */
26165     int n_value;
26166
26167     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26168     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26169     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26170     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26171     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26172         mem_base = xmlMemBlocks();
26173         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26174         doc = gen_xmlDocPtr(n_doc, 1);
26175         elem = gen_xmlNodePtr(n_elem, 2);
26176         name = gen_const_xmlChar_ptr(n_name, 3);
26177         value = gen_const_xmlChar_ptr(n_value, 4);
26178
26179         ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26180         desret_xmlChar_ptr(ret_val);
26181         call_tests++;
26182         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26183         des_xmlDocPtr(n_doc, doc, 1);
26184         des_xmlNodePtr(n_elem, elem, 2);
26185         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
26186         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26187         xmlResetLastError();
26188         if (mem_base != xmlMemBlocks()) {
26189             printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
26190                    xmlMemBlocks() - mem_base);
26191             test_ret++;
26192             printf(" %d", n_ctxt);
26193             printf(" %d", n_doc);
26194             printf(" %d", n_elem);
26195             printf(" %d", n_name);
26196             printf(" %d", n_value);
26197             printf("\n");
26198         }
26199     }
26200     }
26201     }
26202     }
26203     }
26204     function_tests++;
26205 #endif
26206
26207     return(test_ret);
26208 }
26209
26210
26211 #define gen_nb_xmlElementContent_ptr 1
26212 static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26213     return(NULL);
26214 }
26215 static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26216 }
26217
26218 static int
26219 test_xmlValidGetPotentialChildren(void) {
26220     int test_ret = 0;
26221
26222 #if defined(LIBXML_VALID_ENABLED)
26223 #ifdef LIBXML_VALID_ENABLED
26224     int mem_base;
26225     int ret_val;
26226     xmlElementContent * ctree; /* an element content tree */
26227     int n_ctree;
26228     xmlChar ** names; /* an array to store the list of child names */
26229     int n_names;
26230     int * len; /* a pointer to the number of element in the list */
26231     int n_len;
26232     int max; /* the size of the array */
26233     int n_max;
26234
26235     for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
26236     for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
26237     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
26238     for (n_max = 0;n_max < gen_nb_int;n_max++) {
26239         mem_base = xmlMemBlocks();
26240         ctree = gen_xmlElementContent_ptr(n_ctree, 0);
26241         names = gen_const_xmlChar_ptr_ptr(n_names, 1);
26242         len = gen_int_ptr(n_len, 2);
26243         max = gen_int(n_max, 3);
26244
26245         ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
26246         desret_int(ret_val);
26247         call_tests++;
26248         des_xmlElementContent_ptr(n_ctree, ctree, 0);
26249         des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
26250         des_int_ptr(n_len, len, 2);
26251         des_int(n_max, max, 3);
26252         xmlResetLastError();
26253         if (mem_base != xmlMemBlocks()) {
26254             printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
26255                    xmlMemBlocks() - mem_base);
26256             test_ret++;
26257             printf(" %d", n_ctree);
26258             printf(" %d", n_names);
26259             printf(" %d", n_len);
26260             printf(" %d", n_max);
26261             printf("\n");
26262         }
26263     }
26264     }
26265     }
26266     }
26267     function_tests++;
26268 #endif
26269 #endif
26270
26271     return(test_ret);
26272 }
26273
26274
26275 static int
26276 test_xmlValidGetValidElements(void) {
26277     int test_ret = 0;
26278
26279 #if defined(LIBXML_VALID_ENABLED)
26280 #ifdef LIBXML_VALID_ENABLED
26281     int mem_base;
26282     int ret_val;
26283     xmlNode * prev; /* an element to insert after */
26284     int n_prev;
26285     xmlNode * next; /* an element to insert next */
26286     int n_next;
26287     xmlChar ** names; /* an array to store the list of child names */
26288     int n_names;
26289     int max; /* the size of the array */
26290     int n_max;
26291
26292     for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
26293     for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
26294     for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
26295     for (n_max = 0;n_max < gen_nb_int;n_max++) {
26296         mem_base = xmlMemBlocks();
26297         prev = gen_xmlNodePtr(n_prev, 0);
26298         next = gen_xmlNodePtr(n_next, 1);
26299         names = gen_const_xmlChar_ptr_ptr(n_names, 2);
26300         max = gen_int(n_max, 3);
26301
26302         ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
26303         desret_int(ret_val);
26304         call_tests++;
26305         des_xmlNodePtr(n_prev, prev, 0);
26306         des_xmlNodePtr(n_next, next, 1);
26307         des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
26308         des_int(n_max, max, 3);
26309         xmlResetLastError();
26310         if (mem_base != xmlMemBlocks()) {
26311             printf("Leak of %d blocks found in xmlValidGetValidElements",
26312                    xmlMemBlocks() - mem_base);
26313             test_ret++;
26314             printf(" %d", n_prev);
26315             printf(" %d", n_next);
26316             printf(" %d", n_names);
26317             printf(" %d", n_max);
26318             printf("\n");
26319         }
26320     }
26321     }
26322     }
26323     }
26324     function_tests++;
26325 #endif
26326 #endif
26327
26328     return(test_ret);
26329 }
26330
26331
26332 static int
26333 test_xmlValidNormalizeAttributeValue(void) {
26334     int test_ret = 0;
26335
26336 #if defined(LIBXML_VALID_ENABLED)
26337     int mem_base;
26338     xmlChar * ret_val;
26339     xmlDocPtr doc; /* the document */
26340     int n_doc;
26341     xmlNodePtr elem; /* the parent */
26342     int n_elem;
26343     xmlChar * name; /* the attribute name */
26344     int n_name;
26345     xmlChar * value; /* the attribute value */
26346     int n_value;
26347
26348     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26349     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26350     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26351     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26352         mem_base = xmlMemBlocks();
26353         doc = gen_xmlDocPtr(n_doc, 0);
26354         elem = gen_xmlNodePtr(n_elem, 1);
26355         name = gen_const_xmlChar_ptr(n_name, 2);
26356         value = gen_const_xmlChar_ptr(n_value, 3);
26357
26358         ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26359         desret_xmlChar_ptr(ret_val);
26360         call_tests++;
26361         des_xmlDocPtr(n_doc, doc, 0);
26362         des_xmlNodePtr(n_elem, elem, 1);
26363         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
26364         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
26365         xmlResetLastError();
26366         if (mem_base != xmlMemBlocks()) {
26367             printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
26368                    xmlMemBlocks() - mem_base);
26369             test_ret++;
26370             printf(" %d", n_doc);
26371             printf(" %d", n_elem);
26372             printf(" %d", n_name);
26373             printf(" %d", n_value);
26374             printf("\n");
26375         }
26376     }
26377     }
26378     }
26379     }
26380     function_tests++;
26381 #endif
26382
26383     return(test_ret);
26384 }
26385
26386
26387 static int
26388 test_xmlValidateAttributeDecl(void) {
26389     int test_ret = 0;
26390
26391 #if defined(LIBXML_VALID_ENABLED)
26392     int mem_base;
26393     int ret_val;
26394     xmlValidCtxtPtr ctxt; /* the validation context */
26395     int n_ctxt;
26396     xmlDocPtr doc; /* a document instance */
26397     int n_doc;
26398     xmlAttributePtr attr; /* an attribute definition */
26399     int n_attr;
26400
26401     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26402     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26403     for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
26404         mem_base = xmlMemBlocks();
26405         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26406         doc = gen_xmlDocPtr(n_doc, 1);
26407         attr = gen_xmlAttributePtr(n_attr, 2);
26408
26409         ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
26410         desret_int(ret_val);
26411         call_tests++;
26412         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26413         des_xmlDocPtr(n_doc, doc, 1);
26414         des_xmlAttributePtr(n_attr, attr, 2);
26415         xmlResetLastError();
26416         if (mem_base != xmlMemBlocks()) {
26417             printf("Leak of %d blocks found in xmlValidateAttributeDecl",
26418                    xmlMemBlocks() - mem_base);
26419             test_ret++;
26420             printf(" %d", n_ctxt);
26421             printf(" %d", n_doc);
26422             printf(" %d", n_attr);
26423             printf("\n");
26424         }
26425     }
26426     }
26427     }
26428     function_tests++;
26429 #endif
26430
26431     return(test_ret);
26432 }
26433
26434
26435 static int
26436 test_xmlValidateAttributeValue(void) {
26437     int test_ret = 0;
26438
26439 #if defined(LIBXML_VALID_ENABLED)
26440     int mem_base;
26441     int ret_val;
26442     xmlAttributeType type; /* an attribute type */
26443     int n_type;
26444     xmlChar * value; /* an attribute value */
26445     int n_value;
26446
26447     for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
26448     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26449         mem_base = xmlMemBlocks();
26450         type = gen_xmlAttributeType(n_type, 0);
26451         value = gen_const_xmlChar_ptr(n_value, 1);
26452
26453         ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
26454         desret_int(ret_val);
26455         call_tests++;
26456         des_xmlAttributeType(n_type, type, 0);
26457         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
26458         xmlResetLastError();
26459         if (mem_base != xmlMemBlocks()) {
26460             printf("Leak of %d blocks found in xmlValidateAttributeValue",
26461                    xmlMemBlocks() - mem_base);
26462             test_ret++;
26463             printf(" %d", n_type);
26464             printf(" %d", n_value);
26465             printf("\n");
26466         }
26467     }
26468     }
26469     function_tests++;
26470 #endif
26471
26472     return(test_ret);
26473 }
26474
26475
26476 static int
26477 test_xmlValidateDocument(void) {
26478     int test_ret = 0;
26479
26480 #if defined(LIBXML_VALID_ENABLED)
26481     int mem_base;
26482     int ret_val;
26483     xmlValidCtxtPtr ctxt; /* the validation context */
26484     int n_ctxt;
26485     xmlDocPtr doc; /* a document instance */
26486     int n_doc;
26487
26488     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26489     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26490         mem_base = xmlMemBlocks();
26491         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26492         doc = gen_xmlDocPtr(n_doc, 1);
26493
26494         ret_val = xmlValidateDocument(ctxt, doc);
26495         desret_int(ret_val);
26496         call_tests++;
26497         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26498         des_xmlDocPtr(n_doc, doc, 1);
26499         xmlResetLastError();
26500         if (mem_base != xmlMemBlocks()) {
26501             printf("Leak of %d blocks found in xmlValidateDocument",
26502                    xmlMemBlocks() - mem_base);
26503             test_ret++;
26504             printf(" %d", n_ctxt);
26505             printf(" %d", n_doc);
26506             printf("\n");
26507         }
26508     }
26509     }
26510     function_tests++;
26511 #endif
26512
26513     return(test_ret);
26514 }
26515
26516
26517 static int
26518 test_xmlValidateDocumentFinal(void) {
26519     int test_ret = 0;
26520
26521 #if defined(LIBXML_VALID_ENABLED)
26522     int mem_base;
26523     int ret_val;
26524     xmlValidCtxtPtr ctxt; /* the validation context */
26525     int n_ctxt;
26526     xmlDocPtr doc; /* a document instance */
26527     int n_doc;
26528
26529     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26530     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26531         mem_base = xmlMemBlocks();
26532         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26533         doc = gen_xmlDocPtr(n_doc, 1);
26534
26535         ret_val = xmlValidateDocumentFinal(ctxt, doc);
26536         desret_int(ret_val);
26537         call_tests++;
26538         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26539         des_xmlDocPtr(n_doc, doc, 1);
26540         xmlResetLastError();
26541         if (mem_base != xmlMemBlocks()) {
26542             printf("Leak of %d blocks found in xmlValidateDocumentFinal",
26543                    xmlMemBlocks() - mem_base);
26544             test_ret++;
26545             printf(" %d", n_ctxt);
26546             printf(" %d", n_doc);
26547             printf("\n");
26548         }
26549     }
26550     }
26551     function_tests++;
26552 #endif
26553
26554     return(test_ret);
26555 }
26556
26557
26558 static int
26559 test_xmlValidateDtd(void) {
26560     int test_ret = 0;
26561
26562 #if defined(LIBXML_VALID_ENABLED)
26563     int mem_base;
26564     int ret_val;
26565     xmlValidCtxtPtr ctxt; /* the validation context */
26566     int n_ctxt;
26567     xmlDocPtr doc; /* a document instance */
26568     int n_doc;
26569     xmlDtdPtr dtd; /* a dtd instance */
26570     int n_dtd;
26571
26572     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26573     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26574     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26575         mem_base = xmlMemBlocks();
26576         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26577         doc = gen_xmlDocPtr(n_doc, 1);
26578         dtd = gen_xmlDtdPtr(n_dtd, 2);
26579
26580         ret_val = xmlValidateDtd(ctxt, doc, dtd);
26581         desret_int(ret_val);
26582         call_tests++;
26583         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26584         des_xmlDocPtr(n_doc, doc, 1);
26585         des_xmlDtdPtr(n_dtd, dtd, 2);
26586         xmlResetLastError();
26587         if (mem_base != xmlMemBlocks()) {
26588             printf("Leak of %d blocks found in xmlValidateDtd",
26589                    xmlMemBlocks() - mem_base);
26590             test_ret++;
26591             printf(" %d", n_ctxt);
26592             printf(" %d", n_doc);
26593             printf(" %d", n_dtd);
26594             printf("\n");
26595         }
26596     }
26597     }
26598     }
26599     function_tests++;
26600 #endif
26601
26602     return(test_ret);
26603 }
26604
26605
26606 static int
26607 test_xmlValidateDtdFinal(void) {
26608     int test_ret = 0;
26609
26610 #if defined(LIBXML_VALID_ENABLED)
26611     int mem_base;
26612     int ret_val;
26613     xmlValidCtxtPtr ctxt; /* the validation context */
26614     int n_ctxt;
26615     xmlDocPtr doc; /* a document instance */
26616     int n_doc;
26617
26618     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26619     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26620         mem_base = xmlMemBlocks();
26621         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26622         doc = gen_xmlDocPtr(n_doc, 1);
26623
26624         ret_val = xmlValidateDtdFinal(ctxt, doc);
26625         desret_int(ret_val);
26626         call_tests++;
26627         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26628         des_xmlDocPtr(n_doc, doc, 1);
26629         xmlResetLastError();
26630         if (mem_base != xmlMemBlocks()) {
26631             printf("Leak of %d blocks found in xmlValidateDtdFinal",
26632                    xmlMemBlocks() - mem_base);
26633             test_ret++;
26634             printf(" %d", n_ctxt);
26635             printf(" %d", n_doc);
26636             printf("\n");
26637         }
26638     }
26639     }
26640     function_tests++;
26641 #endif
26642
26643     return(test_ret);
26644 }
26645
26646
26647 static int
26648 test_xmlValidateElement(void) {
26649     int test_ret = 0;
26650
26651 #if defined(LIBXML_VALID_ENABLED)
26652     int mem_base;
26653     int ret_val;
26654     xmlValidCtxtPtr ctxt; /* the validation context */
26655     int n_ctxt;
26656     xmlDocPtr doc; /* a document instance */
26657     int n_doc;
26658     xmlNodePtr elem; /* an element instance */
26659     int n_elem;
26660
26661     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26662     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26663     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26664         mem_base = xmlMemBlocks();
26665         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26666         doc = gen_xmlDocPtr(n_doc, 1);
26667         elem = gen_xmlNodePtr(n_elem, 2);
26668
26669         ret_val = xmlValidateElement(ctxt, doc, elem);
26670         desret_int(ret_val);
26671         call_tests++;
26672         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26673         des_xmlDocPtr(n_doc, doc, 1);
26674         des_xmlNodePtr(n_elem, elem, 2);
26675         xmlResetLastError();
26676         if (mem_base != xmlMemBlocks()) {
26677             printf("Leak of %d blocks found in xmlValidateElement",
26678                    xmlMemBlocks() - mem_base);
26679             test_ret++;
26680             printf(" %d", n_ctxt);
26681             printf(" %d", n_doc);
26682             printf(" %d", n_elem);
26683             printf("\n");
26684         }
26685     }
26686     }
26687     }
26688     function_tests++;
26689 #endif
26690
26691     return(test_ret);
26692 }
26693
26694
26695 static int
26696 test_xmlValidateElementDecl(void) {
26697     int test_ret = 0;
26698
26699 #if defined(LIBXML_VALID_ENABLED)
26700     int mem_base;
26701     int ret_val;
26702     xmlValidCtxtPtr ctxt; /* the validation context */
26703     int n_ctxt;
26704     xmlDocPtr doc; /* a document instance */
26705     int n_doc;
26706     xmlElementPtr elem; /* an element definition */
26707     int n_elem;
26708
26709     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26710     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26711     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26712         mem_base = xmlMemBlocks();
26713         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26714         doc = gen_xmlDocPtr(n_doc, 1);
26715         elem = gen_xmlElementPtr(n_elem, 2);
26716
26717         ret_val = xmlValidateElementDecl(ctxt, doc, elem);
26718         desret_int(ret_val);
26719         call_tests++;
26720         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26721         des_xmlDocPtr(n_doc, doc, 1);
26722         des_xmlElementPtr(n_elem, elem, 2);
26723         xmlResetLastError();
26724         if (mem_base != xmlMemBlocks()) {
26725             printf("Leak of %d blocks found in xmlValidateElementDecl",
26726                    xmlMemBlocks() - mem_base);
26727             test_ret++;
26728             printf(" %d", n_ctxt);
26729             printf(" %d", n_doc);
26730             printf(" %d", n_elem);
26731             printf("\n");
26732         }
26733     }
26734     }
26735     }
26736     function_tests++;
26737 #endif
26738
26739     return(test_ret);
26740 }
26741
26742
26743 static int
26744 test_xmlValidateNameValue(void) {
26745     int test_ret = 0;
26746
26747 #if defined(LIBXML_VALID_ENABLED)
26748     int mem_base;
26749     int ret_val;
26750     xmlChar * value; /* an Name value */
26751     int n_value;
26752
26753     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26754         mem_base = xmlMemBlocks();
26755         value = gen_const_xmlChar_ptr(n_value, 0);
26756
26757         ret_val = xmlValidateNameValue((const xmlChar *)value);
26758         desret_int(ret_val);
26759         call_tests++;
26760         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26761         xmlResetLastError();
26762         if (mem_base != xmlMemBlocks()) {
26763             printf("Leak of %d blocks found in xmlValidateNameValue",
26764                    xmlMemBlocks() - mem_base);
26765             test_ret++;
26766             printf(" %d", n_value);
26767             printf("\n");
26768         }
26769     }
26770     function_tests++;
26771 #endif
26772
26773     return(test_ret);
26774 }
26775
26776
26777 static int
26778 test_xmlValidateNamesValue(void) {
26779     int test_ret = 0;
26780
26781 #if defined(LIBXML_VALID_ENABLED)
26782     int mem_base;
26783     int ret_val;
26784     xmlChar * value; /* an Names value */
26785     int n_value;
26786
26787     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26788         mem_base = xmlMemBlocks();
26789         value = gen_const_xmlChar_ptr(n_value, 0);
26790
26791         ret_val = xmlValidateNamesValue((const xmlChar *)value);
26792         desret_int(ret_val);
26793         call_tests++;
26794         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26795         xmlResetLastError();
26796         if (mem_base != xmlMemBlocks()) {
26797             printf("Leak of %d blocks found in xmlValidateNamesValue",
26798                    xmlMemBlocks() - mem_base);
26799             test_ret++;
26800             printf(" %d", n_value);
26801             printf("\n");
26802         }
26803     }
26804     function_tests++;
26805 #endif
26806
26807     return(test_ret);
26808 }
26809
26810
26811 static int
26812 test_xmlValidateNmtokenValue(void) {
26813     int test_ret = 0;
26814
26815 #if defined(LIBXML_VALID_ENABLED)
26816     int mem_base;
26817     int ret_val;
26818     xmlChar * value; /* an Nmtoken value */
26819     int n_value;
26820
26821     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26822         mem_base = xmlMemBlocks();
26823         value = gen_const_xmlChar_ptr(n_value, 0);
26824
26825         ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
26826         desret_int(ret_val);
26827         call_tests++;
26828         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26829         xmlResetLastError();
26830         if (mem_base != xmlMemBlocks()) {
26831             printf("Leak of %d blocks found in xmlValidateNmtokenValue",
26832                    xmlMemBlocks() - mem_base);
26833             test_ret++;
26834             printf(" %d", n_value);
26835             printf("\n");
26836         }
26837     }
26838     function_tests++;
26839 #endif
26840
26841     return(test_ret);
26842 }
26843
26844
26845 static int
26846 test_xmlValidateNmtokensValue(void) {
26847     int test_ret = 0;
26848
26849 #if defined(LIBXML_VALID_ENABLED)
26850     int mem_base;
26851     int ret_val;
26852     xmlChar * value; /* an Nmtokens value */
26853     int n_value;
26854
26855     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26856         mem_base = xmlMemBlocks();
26857         value = gen_const_xmlChar_ptr(n_value, 0);
26858
26859         ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
26860         desret_int(ret_val);
26861         call_tests++;
26862         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26863         xmlResetLastError();
26864         if (mem_base != xmlMemBlocks()) {
26865             printf("Leak of %d blocks found in xmlValidateNmtokensValue",
26866                    xmlMemBlocks() - mem_base);
26867             test_ret++;
26868             printf(" %d", n_value);
26869             printf("\n");
26870         }
26871     }
26872     function_tests++;
26873 #endif
26874
26875     return(test_ret);
26876 }
26877
26878
26879 static int
26880 test_xmlValidateNotationDecl(void) {
26881     int test_ret = 0;
26882
26883 #if defined(LIBXML_VALID_ENABLED)
26884     int mem_base;
26885     int ret_val;
26886     xmlValidCtxtPtr ctxt; /* the validation context */
26887     int n_ctxt;
26888     xmlDocPtr doc; /* a document instance */
26889     int n_doc;
26890     xmlNotationPtr nota; /* a notation definition */
26891     int n_nota;
26892
26893     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26894     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26895     for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
26896         mem_base = xmlMemBlocks();
26897         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26898         doc = gen_xmlDocPtr(n_doc, 1);
26899         nota = gen_xmlNotationPtr(n_nota, 2);
26900
26901         ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
26902         desret_int(ret_val);
26903         call_tests++;
26904         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26905         des_xmlDocPtr(n_doc, doc, 1);
26906         des_xmlNotationPtr(n_nota, nota, 2);
26907         xmlResetLastError();
26908         if (mem_base != xmlMemBlocks()) {
26909             printf("Leak of %d blocks found in xmlValidateNotationDecl",
26910                    xmlMemBlocks() - mem_base);
26911             test_ret++;
26912             printf(" %d", n_ctxt);
26913             printf(" %d", n_doc);
26914             printf(" %d", n_nota);
26915             printf("\n");
26916         }
26917     }
26918     }
26919     }
26920     function_tests++;
26921 #endif
26922
26923     return(test_ret);
26924 }
26925
26926
26927 static int
26928 test_xmlValidateNotationUse(void) {
26929     int test_ret = 0;
26930
26931 #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
26932     int mem_base;
26933     int ret_val;
26934     xmlValidCtxtPtr ctxt; /* the validation context */
26935     int n_ctxt;
26936     xmlDocPtr doc; /* the document */
26937     int n_doc;
26938     xmlChar * notationName; /* the notation name to check */
26939     int n_notationName;
26940
26941     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26942     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26943     for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
26944         mem_base = xmlMemBlocks();
26945         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26946         doc = gen_xmlDocPtr(n_doc, 1);
26947         notationName = gen_const_xmlChar_ptr(n_notationName, 2);
26948
26949         ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
26950         desret_int(ret_val);
26951         call_tests++;
26952         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26953         des_xmlDocPtr(n_doc, doc, 1);
26954         des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
26955         xmlResetLastError();
26956         if (mem_base != xmlMemBlocks()) {
26957             printf("Leak of %d blocks found in xmlValidateNotationUse",
26958                    xmlMemBlocks() - mem_base);
26959             test_ret++;
26960             printf(" %d", n_ctxt);
26961             printf(" %d", n_doc);
26962             printf(" %d", n_notationName);
26963             printf("\n");
26964         }
26965     }
26966     }
26967     }
26968     function_tests++;
26969 #endif
26970
26971     return(test_ret);
26972 }
26973
26974
26975 static int
26976 test_xmlValidateOneAttribute(void) {
26977     int test_ret = 0;
26978
26979 #if defined(LIBXML_VALID_ENABLED)
26980     int mem_base;
26981     int ret_val;
26982     xmlValidCtxtPtr ctxt; /* the validation context */
26983     int n_ctxt;
26984     xmlDocPtr doc; /* a document instance */
26985     int n_doc;
26986     xmlNodePtr elem; /* an element instance */
26987     int n_elem;
26988     xmlAttrPtr attr; /* an attribute instance */
26989     int n_attr;
26990     xmlChar * value; /* the attribute value (without entities processing) */
26991     int n_value;
26992
26993     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26994     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26995     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26996     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26997     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26998         mem_base = xmlMemBlocks();
26999         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27000         doc = gen_xmlDocPtr(n_doc, 1);
27001         elem = gen_xmlNodePtr(n_elem, 2);
27002         attr = gen_xmlAttrPtr(n_attr, 3);
27003         value = gen_const_xmlChar_ptr(n_value, 4);
27004
27005         ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
27006         desret_int(ret_val);
27007         call_tests++;
27008         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27009         des_xmlDocPtr(n_doc, doc, 1);
27010         des_xmlNodePtr(n_elem, elem, 2);
27011         des_xmlAttrPtr(n_attr, attr, 3);
27012         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
27013         xmlResetLastError();
27014         if (mem_base != xmlMemBlocks()) {
27015             printf("Leak of %d blocks found in xmlValidateOneAttribute",
27016                    xmlMemBlocks() - mem_base);
27017             test_ret++;
27018             printf(" %d", n_ctxt);
27019             printf(" %d", n_doc);
27020             printf(" %d", n_elem);
27021             printf(" %d", n_attr);
27022             printf(" %d", n_value);
27023             printf("\n");
27024         }
27025     }
27026     }
27027     }
27028     }
27029     }
27030     function_tests++;
27031 #endif
27032
27033     return(test_ret);
27034 }
27035
27036
27037 static int
27038 test_xmlValidateOneElement(void) {
27039     int test_ret = 0;
27040
27041 #if defined(LIBXML_VALID_ENABLED)
27042     int mem_base;
27043     int ret_val;
27044     xmlValidCtxtPtr ctxt; /* the validation context */
27045     int n_ctxt;
27046     xmlDocPtr doc; /* a document instance */
27047     int n_doc;
27048     xmlNodePtr elem; /* an element instance */
27049     int n_elem;
27050
27051     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27052     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27053     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27054         mem_base = xmlMemBlocks();
27055         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27056         doc = gen_xmlDocPtr(n_doc, 1);
27057         elem = gen_xmlNodePtr(n_elem, 2);
27058
27059         ret_val = xmlValidateOneElement(ctxt, doc, elem);
27060         desret_int(ret_val);
27061         call_tests++;
27062         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27063         des_xmlDocPtr(n_doc, doc, 1);
27064         des_xmlNodePtr(n_elem, elem, 2);
27065         xmlResetLastError();
27066         if (mem_base != xmlMemBlocks()) {
27067             printf("Leak of %d blocks found in xmlValidateOneElement",
27068                    xmlMemBlocks() - mem_base);
27069             test_ret++;
27070             printf(" %d", n_ctxt);
27071             printf(" %d", n_doc);
27072             printf(" %d", n_elem);
27073             printf("\n");
27074         }
27075     }
27076     }
27077     }
27078     function_tests++;
27079 #endif
27080
27081     return(test_ret);
27082 }
27083
27084
27085 static int
27086 test_xmlValidateOneNamespace(void) {
27087     int test_ret = 0;
27088
27089 #if defined(LIBXML_VALID_ENABLED)
27090     int mem_base;
27091     int ret_val;
27092     xmlValidCtxtPtr ctxt; /* the validation context */
27093     int n_ctxt;
27094     xmlDocPtr doc; /* a document instance */
27095     int n_doc;
27096     xmlNodePtr elem; /* an element instance */
27097     int n_elem;
27098     xmlChar * prefix; /* the namespace prefix */
27099     int n_prefix;
27100     xmlNsPtr ns; /* an namespace declaration instance */
27101     int n_ns;
27102     xmlChar * value; /* the attribute value (without entities processing) */
27103     int n_value;
27104
27105     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27106     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27107     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27108     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
27109     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
27110     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
27111         mem_base = xmlMemBlocks();
27112         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27113         doc = gen_xmlDocPtr(n_doc, 1);
27114         elem = gen_xmlNodePtr(n_elem, 2);
27115         prefix = gen_const_xmlChar_ptr(n_prefix, 3);
27116         ns = gen_xmlNsPtr(n_ns, 4);
27117         value = gen_const_xmlChar_ptr(n_value, 5);
27118
27119         ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
27120         desret_int(ret_val);
27121         call_tests++;
27122         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27123         des_xmlDocPtr(n_doc, doc, 1);
27124         des_xmlNodePtr(n_elem, elem, 2);
27125         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
27126         des_xmlNsPtr(n_ns, ns, 4);
27127         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
27128         xmlResetLastError();
27129         if (mem_base != xmlMemBlocks()) {
27130             printf("Leak of %d blocks found in xmlValidateOneNamespace",
27131                    xmlMemBlocks() - mem_base);
27132             test_ret++;
27133             printf(" %d", n_ctxt);
27134             printf(" %d", n_doc);
27135             printf(" %d", n_elem);
27136             printf(" %d", n_prefix);
27137             printf(" %d", n_ns);
27138             printf(" %d", n_value);
27139             printf("\n");
27140         }
27141     }
27142     }
27143     }
27144     }
27145     }
27146     }
27147     function_tests++;
27148 #endif
27149
27150     return(test_ret);
27151 }
27152
27153
27154 static int
27155 test_xmlValidatePopElement(void) {
27156     int test_ret = 0;
27157
27158 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27159     int mem_base;
27160     int ret_val;
27161     xmlValidCtxtPtr ctxt; /* the validation context */
27162     int n_ctxt;
27163     xmlDocPtr doc; /* a document instance */
27164     int n_doc;
27165     xmlNodePtr elem; /* an element instance */
27166     int n_elem;
27167     xmlChar * qname; /* the qualified name as appearing in the serialization */
27168     int n_qname;
27169
27170     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27171     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27172     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27173     for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
27174         mem_base = xmlMemBlocks();
27175         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27176         doc = gen_xmlDocPtr(n_doc, 1);
27177         elem = gen_xmlNodePtr(n_elem, 2);
27178         qname = gen_const_xmlChar_ptr(n_qname, 3);
27179
27180         ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
27181         desret_int(ret_val);
27182         call_tests++;
27183         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27184         des_xmlDocPtr(n_doc, doc, 1);
27185         des_xmlNodePtr(n_elem, elem, 2);
27186         des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
27187         xmlResetLastError();
27188         if (mem_base != xmlMemBlocks()) {
27189             printf("Leak of %d blocks found in xmlValidatePopElement",
27190                    xmlMemBlocks() - mem_base);
27191             test_ret++;
27192             printf(" %d", n_ctxt);
27193             printf(" %d", n_doc);
27194             printf(" %d", n_elem);
27195             printf(" %d", n_qname);
27196             printf("\n");
27197         }
27198     }
27199     }
27200     }
27201     }
27202     function_tests++;
27203 #endif
27204
27205     return(test_ret);
27206 }
27207
27208
27209 static int
27210 test_xmlValidatePushCData(void) {
27211     int test_ret = 0;
27212
27213 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27214     int mem_base;
27215     int ret_val;
27216     xmlValidCtxtPtr ctxt; /* the validation context */
27217     int n_ctxt;
27218     xmlChar * data; /* some character data read */
27219     int n_data;
27220     int len; /* the length of the data */
27221     int n_len;
27222
27223     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27224     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
27225     for (n_len = 0;n_len < gen_nb_int;n_len++) {
27226         mem_base = xmlMemBlocks();
27227         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27228         data = gen_const_xmlChar_ptr(n_data, 1);
27229         len = gen_int(n_len, 2);
27230         if ((data != NULL) &&
27231             (len > (int) strlen((const char *) data) + 1))
27232             continue;
27233
27234         ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
27235         desret_int(ret_val);
27236         call_tests++;
27237         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27238         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
27239         des_int(n_len, len, 2);
27240         xmlResetLastError();
27241         if (mem_base != xmlMemBlocks()) {
27242             printf("Leak of %d blocks found in xmlValidatePushCData",
27243                    xmlMemBlocks() - mem_base);
27244             test_ret++;
27245             printf(" %d", n_ctxt);
27246             printf(" %d", n_data);
27247             printf(" %d", n_len);
27248             printf("\n");
27249         }
27250     }
27251     }
27252     }
27253     function_tests++;
27254 #endif
27255
27256     return(test_ret);
27257 }
27258
27259
27260 static int
27261 test_xmlValidatePushElement(void) {
27262     int test_ret = 0;
27263
27264 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27265     int mem_base;
27266     int ret_val;
27267     xmlValidCtxtPtr ctxt; /* the validation context */
27268     int n_ctxt;
27269     xmlDocPtr doc; /* a document instance */
27270     int n_doc;
27271     xmlNodePtr elem; /* an element instance */
27272     int n_elem;
27273     xmlChar * qname; /* the qualified name as appearing in the serialization */
27274     int n_qname;
27275
27276     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27277     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27278     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27279     for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
27280         mem_base = xmlMemBlocks();
27281         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27282         doc = gen_xmlDocPtr(n_doc, 1);
27283         elem = gen_xmlNodePtr(n_elem, 2);
27284         qname = gen_const_xmlChar_ptr(n_qname, 3);
27285
27286         ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
27287         desret_int(ret_val);
27288         call_tests++;
27289         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27290         des_xmlDocPtr(n_doc, doc, 1);
27291         des_xmlNodePtr(n_elem, elem, 2);
27292         des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
27293         xmlResetLastError();
27294         if (mem_base != xmlMemBlocks()) {
27295             printf("Leak of %d blocks found in xmlValidatePushElement",
27296                    xmlMemBlocks() - mem_base);
27297             test_ret++;
27298             printf(" %d", n_ctxt);
27299             printf(" %d", n_doc);
27300             printf(" %d", n_elem);
27301             printf(" %d", n_qname);
27302             printf("\n");
27303         }
27304     }
27305     }
27306     }
27307     }
27308     function_tests++;
27309 #endif
27310
27311     return(test_ret);
27312 }
27313
27314
27315 static int
27316 test_xmlValidateRoot(void) {
27317     int test_ret = 0;
27318
27319 #if defined(LIBXML_VALID_ENABLED)
27320     int mem_base;
27321     int ret_val;
27322     xmlValidCtxtPtr ctxt; /* the validation context */
27323     int n_ctxt;
27324     xmlDocPtr doc; /* a document instance */
27325     int n_doc;
27326
27327     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27328     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27329         mem_base = xmlMemBlocks();
27330         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27331         doc = gen_xmlDocPtr(n_doc, 1);
27332
27333         ret_val = xmlValidateRoot(ctxt, doc);
27334         desret_int(ret_val);
27335         call_tests++;
27336         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27337         des_xmlDocPtr(n_doc, doc, 1);
27338         xmlResetLastError();
27339         if (mem_base != xmlMemBlocks()) {
27340             printf("Leak of %d blocks found in xmlValidateRoot",
27341                    xmlMemBlocks() - mem_base);
27342             test_ret++;
27343             printf(" %d", n_ctxt);
27344             printf(" %d", n_doc);
27345             printf("\n");
27346         }
27347     }
27348     }
27349     function_tests++;
27350 #endif
27351
27352     return(test_ret);
27353 }
27354
27355 static int
27356 test_valid(void) {
27357     int test_ret = 0;
27358
27359     if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
27360     test_ret += test_xmlAddAttributeDecl();
27361     test_ret += test_xmlAddElementDecl();
27362     test_ret += test_xmlAddID();
27363     test_ret += test_xmlAddNotationDecl();
27364     test_ret += test_xmlAddRef();
27365     test_ret += test_xmlCopyAttributeTable();
27366     test_ret += test_xmlCopyDocElementContent();
27367     test_ret += test_xmlCopyElementContent();
27368     test_ret += test_xmlCopyElementTable();
27369     test_ret += test_xmlCopyEnumeration();
27370     test_ret += test_xmlCopyNotationTable();
27371     test_ret += test_xmlCreateEnumeration();
27372     test_ret += test_xmlDumpAttributeDecl();
27373     test_ret += test_xmlDumpAttributeTable();
27374     test_ret += test_xmlDumpElementDecl();
27375     test_ret += test_xmlDumpElementTable();
27376     test_ret += test_xmlDumpNotationDecl();
27377     test_ret += test_xmlDumpNotationTable();
27378     test_ret += test_xmlGetDtdAttrDesc();
27379     test_ret += test_xmlGetDtdElementDesc();
27380     test_ret += test_xmlGetDtdNotationDesc();
27381     test_ret += test_xmlGetDtdQAttrDesc();
27382     test_ret += test_xmlGetDtdQElementDesc();
27383     test_ret += test_xmlGetID();
27384     test_ret += test_xmlGetRefs();
27385     test_ret += test_xmlIsID();
27386     test_ret += test_xmlIsMixedElement();
27387     test_ret += test_xmlIsRef();
27388     test_ret += test_xmlNewDocElementContent();
27389     test_ret += test_xmlNewElementContent();
27390     test_ret += test_xmlNewValidCtxt();
27391     test_ret += test_xmlRemoveID();
27392     test_ret += test_xmlRemoveRef();
27393     test_ret += test_xmlSnprintfElementContent();
27394     test_ret += test_xmlSprintfElementContent();
27395     test_ret += test_xmlValidBuildContentModel();
27396     test_ret += test_xmlValidCtxtNormalizeAttributeValue();
27397     test_ret += test_xmlValidGetPotentialChildren();
27398     test_ret += test_xmlValidGetValidElements();
27399     test_ret += test_xmlValidNormalizeAttributeValue();
27400     test_ret += test_xmlValidateAttributeDecl();
27401     test_ret += test_xmlValidateAttributeValue();
27402     test_ret += test_xmlValidateDocument();
27403     test_ret += test_xmlValidateDocumentFinal();
27404     test_ret += test_xmlValidateDtd();
27405     test_ret += test_xmlValidateDtdFinal();
27406     test_ret += test_xmlValidateElement();
27407     test_ret += test_xmlValidateElementDecl();
27408     test_ret += test_xmlValidateNameValue();
27409     test_ret += test_xmlValidateNamesValue();
27410     test_ret += test_xmlValidateNmtokenValue();
27411     test_ret += test_xmlValidateNmtokensValue();
27412     test_ret += test_xmlValidateNotationDecl();
27413     test_ret += test_xmlValidateNotationUse();
27414     test_ret += test_xmlValidateOneAttribute();
27415     test_ret += test_xmlValidateOneElement();
27416     test_ret += test_xmlValidateOneNamespace();
27417     test_ret += test_xmlValidatePopElement();
27418     test_ret += test_xmlValidatePushCData();
27419     test_ret += test_xmlValidatePushElement();
27420     test_ret += test_xmlValidateRoot();
27421
27422     if (test_ret != 0)
27423         printf("Module valid: %d errors\n", test_ret);
27424     return(test_ret);
27425 }
27426
27427 static int
27428 test_xmlXIncludeNewContext(void) {
27429     int test_ret = 0;
27430
27431
27432     /* missing type support */
27433     return(test_ret);
27434 }
27435
27436
27437 static int
27438 test_xmlXIncludeProcess(void) {
27439     int test_ret = 0;
27440
27441 #if defined(LIBXML_XINCLUDE_ENABLED)
27442     int mem_base;
27443     int ret_val;
27444     xmlDocPtr doc; /* an XML document */
27445     int n_doc;
27446
27447     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27448         mem_base = xmlMemBlocks();
27449         doc = gen_xmlDocPtr(n_doc, 0);
27450
27451         ret_val = xmlXIncludeProcess(doc);
27452         desret_int(ret_val);
27453         call_tests++;
27454         des_xmlDocPtr(n_doc, doc, 0);
27455         xmlResetLastError();
27456         if (mem_base != xmlMemBlocks()) {
27457             printf("Leak of %d blocks found in xmlXIncludeProcess",
27458                    xmlMemBlocks() - mem_base);
27459             test_ret++;
27460             printf(" %d", n_doc);
27461             printf("\n");
27462         }
27463     }
27464     function_tests++;
27465 #endif
27466
27467     return(test_ret);
27468 }
27469
27470
27471 static int
27472 test_xmlXIncludeProcessFlags(void) {
27473     int test_ret = 0;
27474
27475 #if defined(LIBXML_XINCLUDE_ENABLED)
27476     int mem_base;
27477     int ret_val;
27478     xmlDocPtr doc; /* an XML document */
27479     int n_doc;
27480     int flags; /* a set of xmlParserOption used for parsing XML includes */
27481     int n_flags;
27482
27483     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27484     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27485         mem_base = xmlMemBlocks();
27486         doc = gen_xmlDocPtr(n_doc, 0);
27487         flags = gen_int(n_flags, 1);
27488
27489         ret_val = xmlXIncludeProcessFlags(doc, flags);
27490         desret_int(ret_val);
27491         call_tests++;
27492         des_xmlDocPtr(n_doc, doc, 0);
27493         des_int(n_flags, flags, 1);
27494         xmlResetLastError();
27495         if (mem_base != xmlMemBlocks()) {
27496             printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
27497                    xmlMemBlocks() - mem_base);
27498             test_ret++;
27499             printf(" %d", n_doc);
27500             printf(" %d", n_flags);
27501             printf("\n");
27502         }
27503     }
27504     }
27505     function_tests++;
27506 #endif
27507
27508     return(test_ret);
27509 }
27510
27511
27512 static int
27513 test_xmlXIncludeProcessFlagsData(void) {
27514     int test_ret = 0;
27515
27516 #if defined(LIBXML_XINCLUDE_ENABLED)
27517     int mem_base;
27518     int ret_val;
27519     xmlDocPtr doc; /* an XML document */
27520     int n_doc;
27521     int flags; /* a set of xmlParserOption used for parsing XML includes */
27522     int n_flags;
27523     void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27524     int n_data;
27525
27526     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27527     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27528     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27529         mem_base = xmlMemBlocks();
27530         doc = gen_xmlDocPtr(n_doc, 0);
27531         flags = gen_int(n_flags, 1);
27532         data = gen_userdata(n_data, 2);
27533
27534         ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
27535         desret_int(ret_val);
27536         call_tests++;
27537         des_xmlDocPtr(n_doc, doc, 0);
27538         des_int(n_flags, flags, 1);
27539         des_userdata(n_data, data, 2);
27540         xmlResetLastError();
27541         if (mem_base != xmlMemBlocks()) {
27542             printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
27543                    xmlMemBlocks() - mem_base);
27544             test_ret++;
27545             printf(" %d", n_doc);
27546             printf(" %d", n_flags);
27547             printf(" %d", n_data);
27548             printf("\n");
27549         }
27550     }
27551     }
27552     }
27553     function_tests++;
27554 #endif
27555
27556     return(test_ret);
27557 }
27558
27559 #ifdef LIBXML_XINCLUDE_ENABLED
27560
27561 #define gen_nb_xmlXIncludeCtxtPtr 1
27562 static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27563     return(NULL);
27564 }
27565 static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27566 }
27567 #endif
27568
27569
27570 static int
27571 test_xmlXIncludeProcessNode(void) {
27572     int test_ret = 0;
27573
27574 #if defined(LIBXML_XINCLUDE_ENABLED)
27575     int mem_base;
27576     int ret_val;
27577     xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
27578     int n_ctxt;
27579     xmlNodePtr node; /* a node in an XML document */
27580     int n_node;
27581
27582     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27583     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
27584         mem_base = xmlMemBlocks();
27585         ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27586         node = gen_xmlNodePtr(n_node, 1);
27587
27588         ret_val = xmlXIncludeProcessNode(ctxt, node);
27589         desret_int(ret_val);
27590         call_tests++;
27591         des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27592         des_xmlNodePtr(n_node, node, 1);
27593         xmlResetLastError();
27594         if (mem_base != xmlMemBlocks()) {
27595             printf("Leak of %d blocks found in xmlXIncludeProcessNode",
27596                    xmlMemBlocks() - mem_base);
27597             test_ret++;
27598             printf(" %d", n_ctxt);
27599             printf(" %d", n_node);
27600             printf("\n");
27601         }
27602     }
27603     }
27604     function_tests++;
27605 #endif
27606
27607     return(test_ret);
27608 }
27609
27610
27611 static int
27612 test_xmlXIncludeProcessTree(void) {
27613     int test_ret = 0;
27614
27615 #if defined(LIBXML_XINCLUDE_ENABLED)
27616     int mem_base;
27617     int ret_val;
27618     xmlNodePtr tree; /* a node in an XML document */
27619     int n_tree;
27620
27621     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27622         mem_base = xmlMemBlocks();
27623         tree = gen_xmlNodePtr(n_tree, 0);
27624
27625         ret_val = xmlXIncludeProcessTree(tree);
27626         desret_int(ret_val);
27627         call_tests++;
27628         des_xmlNodePtr(n_tree, tree, 0);
27629         xmlResetLastError();
27630         if (mem_base != xmlMemBlocks()) {
27631             printf("Leak of %d blocks found in xmlXIncludeProcessTree",
27632                    xmlMemBlocks() - mem_base);
27633             test_ret++;
27634             printf(" %d", n_tree);
27635             printf("\n");
27636         }
27637     }
27638     function_tests++;
27639 #endif
27640
27641     return(test_ret);
27642 }
27643
27644
27645 static int
27646 test_xmlXIncludeProcessTreeFlags(void) {
27647     int test_ret = 0;
27648
27649 #if defined(LIBXML_XINCLUDE_ENABLED)
27650     int mem_base;
27651     int ret_val;
27652     xmlNodePtr tree; /* a node in an XML document */
27653     int n_tree;
27654     int flags; /* a set of xmlParserOption used for parsing XML includes */
27655     int n_flags;
27656
27657     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27658     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27659         mem_base = xmlMemBlocks();
27660         tree = gen_xmlNodePtr(n_tree, 0);
27661         flags = gen_int(n_flags, 1);
27662
27663         ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
27664         desret_int(ret_val);
27665         call_tests++;
27666         des_xmlNodePtr(n_tree, tree, 0);
27667         des_int(n_flags, flags, 1);
27668         xmlResetLastError();
27669         if (mem_base != xmlMemBlocks()) {
27670             printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
27671                    xmlMemBlocks() - mem_base);
27672             test_ret++;
27673             printf(" %d", n_tree);
27674             printf(" %d", n_flags);
27675             printf("\n");
27676         }
27677     }
27678     }
27679     function_tests++;
27680 #endif
27681
27682     return(test_ret);
27683 }
27684
27685
27686 static int
27687 test_xmlXIncludeProcessTreeFlagsData(void) {
27688     int test_ret = 0;
27689
27690 #if defined(LIBXML_XINCLUDE_ENABLED)
27691     int mem_base;
27692     int ret_val;
27693     xmlNodePtr tree; /* an XML node */
27694     int n_tree;
27695     int flags; /* a set of xmlParserOption used for parsing XML includes */
27696     int n_flags;
27697     void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27698     int n_data;
27699
27700     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27701     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27702     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27703         mem_base = xmlMemBlocks();
27704         tree = gen_xmlNodePtr(n_tree, 0);
27705         flags = gen_int(n_flags, 1);
27706         data = gen_userdata(n_data, 2);
27707
27708         ret_val = xmlXIncludeProcessTreeFlagsData(tree, flags, data);
27709         desret_int(ret_val);
27710         call_tests++;
27711         des_xmlNodePtr(n_tree, tree, 0);
27712         des_int(n_flags, flags, 1);
27713         des_userdata(n_data, data, 2);
27714         xmlResetLastError();
27715         if (mem_base != xmlMemBlocks()) {
27716             printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlagsData",
27717                    xmlMemBlocks() - mem_base);
27718             test_ret++;
27719             printf(" %d", n_tree);
27720             printf(" %d", n_flags);
27721             printf(" %d", n_data);
27722             printf("\n");
27723         }
27724     }
27725     }
27726     }
27727     function_tests++;
27728 #endif
27729
27730     return(test_ret);
27731 }
27732
27733
27734 static int
27735 test_xmlXIncludeSetFlags(void) {
27736     int test_ret = 0;
27737
27738 #if defined(LIBXML_XINCLUDE_ENABLED)
27739     int mem_base;
27740     int ret_val;
27741     xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
27742     int n_ctxt;
27743     int flags; /* a set of xmlParserOption used for parsing XML includes */
27744     int n_flags;
27745
27746     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27747     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27748         mem_base = xmlMemBlocks();
27749         ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27750         flags = gen_int(n_flags, 1);
27751
27752         ret_val = xmlXIncludeSetFlags(ctxt, flags);
27753         desret_int(ret_val);
27754         call_tests++;
27755         des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27756         des_int(n_flags, flags, 1);
27757         xmlResetLastError();
27758         if (mem_base != xmlMemBlocks()) {
27759             printf("Leak of %d blocks found in xmlXIncludeSetFlags",
27760                    xmlMemBlocks() - mem_base);
27761             test_ret++;
27762             printf(" %d", n_ctxt);
27763             printf(" %d", n_flags);
27764             printf("\n");
27765         }
27766     }
27767     }
27768     function_tests++;
27769 #endif
27770
27771     return(test_ret);
27772 }
27773
27774 static int
27775 test_xinclude(void) {
27776     int test_ret = 0;
27777
27778     if (quiet == 0) printf("Testing xinclude : 8 of 10 functions ...\n");
27779     test_ret += test_xmlXIncludeNewContext();
27780     test_ret += test_xmlXIncludeProcess();
27781     test_ret += test_xmlXIncludeProcessFlags();
27782     test_ret += test_xmlXIncludeProcessFlagsData();
27783     test_ret += test_xmlXIncludeProcessNode();
27784     test_ret += test_xmlXIncludeProcessTree();
27785     test_ret += test_xmlXIncludeProcessTreeFlags();
27786     test_ret += test_xmlXIncludeProcessTreeFlagsData();
27787     test_ret += test_xmlXIncludeSetFlags();
27788
27789     if (test_ret != 0)
27790         printf("Module xinclude: %d errors\n", test_ret);
27791     return(test_ret);
27792 }
27793
27794 static int
27795 test_xmlAllocOutputBuffer(void) {
27796     int test_ret = 0;
27797
27798 #if defined(LIBXML_OUTPUT_ENABLED)
27799     int mem_base;
27800     xmlOutputBufferPtr ret_val;
27801     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27802     int n_encoder;
27803
27804     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27805         mem_base = xmlMemBlocks();
27806         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
27807
27808         ret_val = xmlAllocOutputBuffer(encoder);
27809         desret_xmlOutputBufferPtr(ret_val);
27810         call_tests++;
27811         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
27812         xmlResetLastError();
27813         if (mem_base != xmlMemBlocks()) {
27814             printf("Leak of %d blocks found in xmlAllocOutputBuffer",
27815                    xmlMemBlocks() - mem_base);
27816             test_ret++;
27817             printf(" %d", n_encoder);
27818             printf("\n");
27819         }
27820     }
27821     function_tests++;
27822 #endif
27823
27824     return(test_ret);
27825 }
27826
27827
27828 static int
27829 test_xmlAllocParserInputBuffer(void) {
27830     int test_ret = 0;
27831
27832     int mem_base;
27833     xmlParserInputBufferPtr ret_val;
27834     xmlCharEncoding enc; /* the charset encoding if known */
27835     int n_enc;
27836
27837     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27838         mem_base = xmlMemBlocks();
27839         enc = gen_xmlCharEncoding(n_enc, 0);
27840
27841         ret_val = xmlAllocParserInputBuffer(enc);
27842         desret_xmlParserInputBufferPtr(ret_val);
27843         call_tests++;
27844         des_xmlCharEncoding(n_enc, enc, 0);
27845         xmlResetLastError();
27846         if (mem_base != xmlMemBlocks()) {
27847             printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
27848                    xmlMemBlocks() - mem_base);
27849             test_ret++;
27850             printf(" %d", n_enc);
27851             printf("\n");
27852         }
27853     }
27854     function_tests++;
27855
27856     return(test_ret);
27857 }
27858
27859
27860 static int
27861 test_xmlCheckFilename(void) {
27862     int test_ret = 0;
27863
27864     int mem_base;
27865     int ret_val;
27866     char * path; /* the path to check */
27867     int n_path;
27868
27869     for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
27870         mem_base = xmlMemBlocks();
27871         path = gen_const_char_ptr(n_path, 0);
27872
27873         ret_val = xmlCheckFilename((const char *)path);
27874         desret_int(ret_val);
27875         call_tests++;
27876         des_const_char_ptr(n_path, (const char *)path, 0);
27877         xmlResetLastError();
27878         if (mem_base != xmlMemBlocks()) {
27879             printf("Leak of %d blocks found in xmlCheckFilename",
27880                    xmlMemBlocks() - mem_base);
27881             test_ret++;
27882             printf(" %d", n_path);
27883             printf("\n");
27884         }
27885     }
27886     function_tests++;
27887
27888     return(test_ret);
27889 }
27890
27891
27892 static int
27893 test_xmlCheckHTTPInput(void) {
27894     int test_ret = 0;
27895
27896     int mem_base;
27897     xmlParserInputPtr ret_val;
27898     xmlParserCtxtPtr ctxt; /* an XML parser context */
27899     int n_ctxt;
27900     xmlParserInputPtr ret; /* an XML parser input */
27901     int n_ret;
27902
27903     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27904     for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
27905         mem_base = xmlMemBlocks();
27906         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
27907         ret = gen_xmlParserInputPtr(n_ret, 1);
27908
27909         ret_val = xmlCheckHTTPInput(ctxt, ret);
27910         desret_xmlParserInputPtr(ret_val);
27911         call_tests++;
27912         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
27913         des_xmlParserInputPtr(n_ret, ret, 1);
27914         xmlResetLastError();
27915         if (mem_base != xmlMemBlocks()) {
27916             printf("Leak of %d blocks found in xmlCheckHTTPInput",
27917                    xmlMemBlocks() - mem_base);
27918             test_ret++;
27919             printf(" %d", n_ctxt);
27920             printf(" %d", n_ret);
27921             printf("\n");
27922         }
27923     }
27924     }
27925     function_tests++;
27926
27927     return(test_ret);
27928 }
27929
27930
27931 static int
27932 test_xmlCleanupInputCallbacks(void) {
27933     int test_ret = 0;
27934
27935     int mem_base;
27936
27937         mem_base = xmlMemBlocks();
27938
27939         xmlCleanupInputCallbacks();
27940         call_tests++;
27941         xmlResetLastError();
27942         if (mem_base != xmlMemBlocks()) {
27943             printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
27944                    xmlMemBlocks() - mem_base);
27945             test_ret++;
27946             printf("\n");
27947         }
27948     function_tests++;
27949
27950     return(test_ret);
27951 }
27952
27953
27954 static int
27955 test_xmlCleanupOutputCallbacks(void) {
27956     int test_ret = 0;
27957
27958 #if defined(LIBXML_OUTPUT_ENABLED)
27959     int mem_base;
27960
27961         mem_base = xmlMemBlocks();
27962
27963         xmlCleanupOutputCallbacks();
27964         call_tests++;
27965         xmlResetLastError();
27966         if (mem_base != xmlMemBlocks()) {
27967             printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
27968                    xmlMemBlocks() - mem_base);
27969             test_ret++;
27970             printf("\n");
27971         }
27972     function_tests++;
27973 #endif
27974
27975     return(test_ret);
27976 }
27977
27978
27979 static int
27980 test_xmlFileClose(void) {
27981     int test_ret = 0;
27982
27983     int mem_base;
27984     int ret_val;
27985     void * context; /* the I/O context */
27986     int n_context;
27987
27988     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27989         mem_base = xmlMemBlocks();
27990         context = gen_void_ptr(n_context, 0);
27991
27992         ret_val = xmlFileClose(context);
27993         desret_int(ret_val);
27994         call_tests++;
27995         des_void_ptr(n_context, context, 0);
27996         xmlResetLastError();
27997         if (mem_base != xmlMemBlocks()) {
27998             printf("Leak of %d blocks found in xmlFileClose",
27999                    xmlMemBlocks() - mem_base);
28000             test_ret++;
28001             printf(" %d", n_context);
28002             printf("\n");
28003         }
28004     }
28005     function_tests++;
28006
28007     return(test_ret);
28008 }
28009
28010
28011 static int
28012 test_xmlFileMatch(void) {
28013     int test_ret = 0;
28014
28015     int mem_base;
28016     int ret_val;
28017     const char * filename; /* the URI for matching */
28018     int n_filename;
28019
28020     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28021         mem_base = xmlMemBlocks();
28022         filename = gen_filepath(n_filename, 0);
28023
28024         ret_val = xmlFileMatch(filename);
28025         desret_int(ret_val);
28026         call_tests++;
28027         des_filepath(n_filename, filename, 0);
28028         xmlResetLastError();
28029         if (mem_base != xmlMemBlocks()) {
28030             printf("Leak of %d blocks found in xmlFileMatch",
28031                    xmlMemBlocks() - mem_base);
28032             test_ret++;
28033             printf(" %d", n_filename);
28034             printf("\n");
28035         }
28036     }
28037     function_tests++;
28038
28039     return(test_ret);
28040 }
28041
28042
28043 static int
28044 test_xmlFileOpen(void) {
28045     int test_ret = 0;
28046
28047     int mem_base;
28048     void * ret_val;
28049     const char * filename; /* the URI for matching */
28050     int n_filename;
28051
28052     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28053         mem_base = xmlMemBlocks();
28054         filename = gen_filepath(n_filename, 0);
28055
28056         ret_val = xmlFileOpen(filename);
28057         desret_void_ptr(ret_val);
28058         call_tests++;
28059         des_filepath(n_filename, filename, 0);
28060         xmlResetLastError();
28061         if (mem_base != xmlMemBlocks()) {
28062             printf("Leak of %d blocks found in xmlFileOpen",
28063                    xmlMemBlocks() - mem_base);
28064             test_ret++;
28065             printf(" %d", n_filename);
28066             printf("\n");
28067         }
28068     }
28069     function_tests++;
28070
28071     return(test_ret);
28072 }
28073
28074
28075 static int
28076 test_xmlFileRead(void) {
28077     int test_ret = 0;
28078
28079     int mem_base;
28080     int ret_val;
28081     void * context; /* the I/O context */
28082     int n_context;
28083     char * buffer; /* where to drop data */
28084     int n_buffer;
28085     int len; /* number of bytes to write */
28086     int n_len;
28087
28088     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28089     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28090     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28091         mem_base = xmlMemBlocks();
28092         context = gen_void_ptr(n_context, 0);
28093         buffer = gen_char_ptr(n_buffer, 1);
28094         len = gen_int(n_len, 2);
28095
28096         ret_val = xmlFileRead(context, buffer, len);
28097         desret_int(ret_val);
28098         call_tests++;
28099         des_void_ptr(n_context, context, 0);
28100         des_char_ptr(n_buffer, buffer, 1);
28101         des_int(n_len, len, 2);
28102         xmlResetLastError();
28103         if (mem_base != xmlMemBlocks()) {
28104             printf("Leak of %d blocks found in xmlFileRead",
28105                    xmlMemBlocks() - mem_base);
28106             test_ret++;
28107             printf(" %d", n_context);
28108             printf(" %d", n_buffer);
28109             printf(" %d", n_len);
28110             printf("\n");
28111         }
28112     }
28113     }
28114     }
28115     function_tests++;
28116
28117     return(test_ret);
28118 }
28119
28120
28121 static int
28122 test_xmlIOFTPClose(void) {
28123     int test_ret = 0;
28124
28125 #if defined(LIBXML_FTP_ENABLED)
28126     int mem_base;
28127     int ret_val;
28128     void * context; /* the I/O context */
28129     int n_context;
28130
28131     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28132         mem_base = xmlMemBlocks();
28133         context = gen_void_ptr(n_context, 0);
28134
28135         ret_val = xmlIOFTPClose(context);
28136         desret_int(ret_val);
28137         call_tests++;
28138         des_void_ptr(n_context, context, 0);
28139         xmlResetLastError();
28140         if (mem_base != xmlMemBlocks()) {
28141             printf("Leak of %d blocks found in xmlIOFTPClose",
28142                    xmlMemBlocks() - mem_base);
28143             test_ret++;
28144             printf(" %d", n_context);
28145             printf("\n");
28146         }
28147     }
28148     function_tests++;
28149 #endif
28150
28151     return(test_ret);
28152 }
28153
28154
28155 static int
28156 test_xmlIOFTPMatch(void) {
28157     int test_ret = 0;
28158
28159 #if defined(LIBXML_FTP_ENABLED)
28160     int mem_base;
28161     int ret_val;
28162     const char * filename; /* the URI for matching */
28163     int n_filename;
28164
28165     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28166         mem_base = xmlMemBlocks();
28167         filename = gen_filepath(n_filename, 0);
28168
28169         ret_val = xmlIOFTPMatch(filename);
28170         desret_int(ret_val);
28171         call_tests++;
28172         des_filepath(n_filename, filename, 0);
28173         xmlResetLastError();
28174         if (mem_base != xmlMemBlocks()) {
28175             printf("Leak of %d blocks found in xmlIOFTPMatch",
28176                    xmlMemBlocks() - mem_base);
28177             test_ret++;
28178             printf(" %d", n_filename);
28179             printf("\n");
28180         }
28181     }
28182     function_tests++;
28183 #endif
28184
28185     return(test_ret);
28186 }
28187
28188
28189 static int
28190 test_xmlIOFTPOpen(void) {
28191     int test_ret = 0;
28192
28193 #if defined(LIBXML_FTP_ENABLED)
28194     int mem_base;
28195     void * ret_val;
28196     const char * filename; /* the URI for matching */
28197     int n_filename;
28198
28199     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28200         mem_base = xmlMemBlocks();
28201         filename = gen_filepath(n_filename, 0);
28202
28203         ret_val = xmlIOFTPOpen(filename);
28204         desret_void_ptr(ret_val);
28205         call_tests++;
28206         des_filepath(n_filename, filename, 0);
28207         xmlResetLastError();
28208         if (mem_base != xmlMemBlocks()) {
28209             printf("Leak of %d blocks found in xmlIOFTPOpen",
28210                    xmlMemBlocks() - mem_base);
28211             test_ret++;
28212             printf(" %d", n_filename);
28213             printf("\n");
28214         }
28215     }
28216     function_tests++;
28217 #endif
28218
28219     return(test_ret);
28220 }
28221
28222
28223 static int
28224 test_xmlIOFTPRead(void) {
28225     int test_ret = 0;
28226
28227 #if defined(LIBXML_FTP_ENABLED)
28228     int mem_base;
28229     int ret_val;
28230     void * context; /* the I/O context */
28231     int n_context;
28232     char * buffer; /* where to drop data */
28233     int n_buffer;
28234     int len; /* number of bytes to write */
28235     int n_len;
28236
28237     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28238     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28239     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28240         mem_base = xmlMemBlocks();
28241         context = gen_void_ptr(n_context, 0);
28242         buffer = gen_char_ptr(n_buffer, 1);
28243         len = gen_int(n_len, 2);
28244
28245         ret_val = xmlIOFTPRead(context, buffer, len);
28246         desret_int(ret_val);
28247         call_tests++;
28248         des_void_ptr(n_context, context, 0);
28249         des_char_ptr(n_buffer, buffer, 1);
28250         des_int(n_len, len, 2);
28251         xmlResetLastError();
28252         if (mem_base != xmlMemBlocks()) {
28253             printf("Leak of %d blocks found in xmlIOFTPRead",
28254                    xmlMemBlocks() - mem_base);
28255             test_ret++;
28256             printf(" %d", n_context);
28257             printf(" %d", n_buffer);
28258             printf(" %d", n_len);
28259             printf("\n");
28260         }
28261     }
28262     }
28263     }
28264     function_tests++;
28265 #endif
28266
28267     return(test_ret);
28268 }
28269
28270
28271 static int
28272 test_xmlIOHTTPClose(void) {
28273     int test_ret = 0;
28274
28275 #if defined(LIBXML_HTTP_ENABLED)
28276     int mem_base;
28277     int ret_val;
28278     void * context; /* the I/O context */
28279     int n_context;
28280
28281     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28282         mem_base = xmlMemBlocks();
28283         context = gen_void_ptr(n_context, 0);
28284
28285         ret_val = xmlIOHTTPClose(context);
28286         desret_int(ret_val);
28287         call_tests++;
28288         des_void_ptr(n_context, context, 0);
28289         xmlResetLastError();
28290         if (mem_base != xmlMemBlocks()) {
28291             printf("Leak of %d blocks found in xmlIOHTTPClose",
28292                    xmlMemBlocks() - mem_base);
28293             test_ret++;
28294             printf(" %d", n_context);
28295             printf("\n");
28296         }
28297     }
28298     function_tests++;
28299 #endif
28300
28301     return(test_ret);
28302 }
28303
28304
28305 static int
28306 test_xmlIOHTTPMatch(void) {
28307     int test_ret = 0;
28308
28309 #if defined(LIBXML_HTTP_ENABLED)
28310     int mem_base;
28311     int ret_val;
28312     const char * filename; /* the URI for matching */
28313     int n_filename;
28314
28315     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28316         mem_base = xmlMemBlocks();
28317         filename = gen_filepath(n_filename, 0);
28318
28319         ret_val = xmlIOHTTPMatch(filename);
28320         desret_int(ret_val);
28321         call_tests++;
28322         des_filepath(n_filename, filename, 0);
28323         xmlResetLastError();
28324         if (mem_base != xmlMemBlocks()) {
28325             printf("Leak of %d blocks found in xmlIOHTTPMatch",
28326                    xmlMemBlocks() - mem_base);
28327             test_ret++;
28328             printf(" %d", n_filename);
28329             printf("\n");
28330         }
28331     }
28332     function_tests++;
28333 #endif
28334
28335     return(test_ret);
28336 }
28337
28338
28339 static int
28340 test_xmlIOHTTPOpen(void) {
28341     int test_ret = 0;
28342
28343 #if defined(LIBXML_HTTP_ENABLED)
28344     int mem_base;
28345     void * ret_val;
28346     const char * filename; /* the URI for matching */
28347     int n_filename;
28348
28349     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28350         mem_base = xmlMemBlocks();
28351         filename = gen_filepath(n_filename, 0);
28352
28353         ret_val = xmlIOHTTPOpen(filename);
28354         desret_xmlNanoHTTPCtxtPtr(ret_val);
28355         call_tests++;
28356         des_filepath(n_filename, filename, 0);
28357         xmlResetLastError();
28358         if (mem_base != xmlMemBlocks()) {
28359             printf("Leak of %d blocks found in xmlIOHTTPOpen",
28360                    xmlMemBlocks() - mem_base);
28361             test_ret++;
28362             printf(" %d", n_filename);
28363             printf("\n");
28364         }
28365     }
28366     function_tests++;
28367 #endif
28368
28369     return(test_ret);
28370 }
28371
28372
28373 static int
28374 test_xmlIOHTTPRead(void) {
28375     int test_ret = 0;
28376
28377 #if defined(LIBXML_HTTP_ENABLED)
28378     int mem_base;
28379     int ret_val;
28380     void * context; /* the I/O context */
28381     int n_context;
28382     char * buffer; /* where to drop data */
28383     int n_buffer;
28384     int len; /* number of bytes to write */
28385     int n_len;
28386
28387     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28388     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28389     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28390         mem_base = xmlMemBlocks();
28391         context = gen_void_ptr(n_context, 0);
28392         buffer = gen_char_ptr(n_buffer, 1);
28393         len = gen_int(n_len, 2);
28394
28395         ret_val = xmlIOHTTPRead(context, buffer, len);
28396         desret_int(ret_val);
28397         call_tests++;
28398         des_void_ptr(n_context, context, 0);
28399         des_char_ptr(n_buffer, buffer, 1);
28400         des_int(n_len, len, 2);
28401         xmlResetLastError();
28402         if (mem_base != xmlMemBlocks()) {
28403             printf("Leak of %d blocks found in xmlIOHTTPRead",
28404                    xmlMemBlocks() - mem_base);
28405             test_ret++;
28406             printf(" %d", n_context);
28407             printf(" %d", n_buffer);
28408             printf(" %d", n_len);
28409             printf("\n");
28410         }
28411     }
28412     }
28413     }
28414     function_tests++;
28415 #endif
28416
28417     return(test_ret);
28418 }
28419
28420
28421 static int
28422 test_xmlNoNetExternalEntityLoader(void) {
28423     int test_ret = 0;
28424
28425     int mem_base;
28426     xmlParserInputPtr ret_val;
28427     const char * URL; /* the URL for the entity to load */
28428     int n_URL;
28429     char * ID; /* the System ID for the entity to load */
28430     int n_ID;
28431     xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
28432     int n_ctxt;
28433
28434     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28435     for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
28436     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
28437         mem_base = xmlMemBlocks();
28438         URL = gen_filepath(n_URL, 0);
28439         ID = gen_const_char_ptr(n_ID, 1);
28440         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
28441
28442         ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
28443         desret_xmlParserInputPtr(ret_val);
28444         call_tests++;
28445         des_filepath(n_URL, URL, 0);
28446         des_const_char_ptr(n_ID, (const char *)ID, 1);
28447         des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
28448         xmlResetLastError();
28449         if (mem_base != xmlMemBlocks()) {
28450             printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
28451                    xmlMemBlocks() - mem_base);
28452             test_ret++;
28453             printf(" %d", n_URL);
28454             printf(" %d", n_ID);
28455             printf(" %d", n_ctxt);
28456             printf("\n");
28457         }
28458     }
28459     }
28460     }
28461     function_tests++;
28462
28463     return(test_ret);
28464 }
28465
28466
28467 static int
28468 test_xmlNormalizeWindowsPath(void) {
28469     int test_ret = 0;
28470
28471     int mem_base;
28472     xmlChar * ret_val;
28473     xmlChar * path; /* the input file path */
28474     int n_path;
28475
28476     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
28477         mem_base = xmlMemBlocks();
28478         path = gen_const_xmlChar_ptr(n_path, 0);
28479
28480         ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
28481         desret_xmlChar_ptr(ret_val);
28482         call_tests++;
28483         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
28484         xmlResetLastError();
28485         if (mem_base != xmlMemBlocks()) {
28486             printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
28487                    xmlMemBlocks() - mem_base);
28488             test_ret++;
28489             printf(" %d", n_path);
28490             printf("\n");
28491         }
28492     }
28493     function_tests++;
28494
28495     return(test_ret);
28496 }
28497
28498
28499 static int
28500 test_xmlOutputBufferCreateBuffer(void) {
28501     int test_ret = 0;
28502
28503 #if defined(LIBXML_OUTPUT_ENABLED)
28504     int mem_base;
28505     xmlOutputBufferPtr ret_val;
28506     xmlBufferPtr buffer; /* a xmlBufferPtr */
28507     int n_buffer;
28508     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28509     int n_encoder;
28510
28511     for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
28512     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28513         mem_base = xmlMemBlocks();
28514         buffer = gen_xmlBufferPtr(n_buffer, 0);
28515         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28516
28517         ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
28518         desret_xmlOutputBufferPtr(ret_val);
28519         call_tests++;
28520         des_xmlBufferPtr(n_buffer, buffer, 0);
28521         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28522         xmlResetLastError();
28523         if (mem_base != xmlMemBlocks()) {
28524             printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
28525                    xmlMemBlocks() - mem_base);
28526             test_ret++;
28527             printf(" %d", n_buffer);
28528             printf(" %d", n_encoder);
28529             printf("\n");
28530         }
28531     }
28532     }
28533     function_tests++;
28534 #endif
28535
28536     return(test_ret);
28537 }
28538
28539
28540 static int
28541 test_xmlOutputBufferCreateFd(void) {
28542     int test_ret = 0;
28543
28544 #if defined(LIBXML_OUTPUT_ENABLED)
28545     int mem_base;
28546     xmlOutputBufferPtr ret_val;
28547     int fd; /* a file descriptor number */
28548     int n_fd;
28549     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28550     int n_encoder;
28551
28552     for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28553     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28554         mem_base = xmlMemBlocks();
28555         fd = gen_int(n_fd, 0);
28556         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28557
28558         ret_val = xmlOutputBufferCreateFd(fd, encoder);
28559         desret_xmlOutputBufferPtr(ret_val);
28560         call_tests++;
28561         des_int(n_fd, fd, 0);
28562         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28563         xmlResetLastError();
28564         if (mem_base != xmlMemBlocks()) {
28565             printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
28566                    xmlMemBlocks() - mem_base);
28567             test_ret++;
28568             printf(" %d", n_fd);
28569             printf(" %d", n_encoder);
28570             printf("\n");
28571         }
28572     }
28573     }
28574     function_tests++;
28575 #endif
28576
28577     return(test_ret);
28578 }
28579
28580
28581 static int
28582 test_xmlOutputBufferCreateFile(void) {
28583     int test_ret = 0;
28584
28585 #if defined(LIBXML_OUTPUT_ENABLED)
28586     int mem_base;
28587     xmlOutputBufferPtr ret_val;
28588     FILE * file; /* a FILE* */
28589     int n_file;
28590     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28591     int n_encoder;
28592
28593     for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28594     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28595         mem_base = xmlMemBlocks();
28596         file = gen_FILE_ptr(n_file, 0);
28597         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28598
28599         ret_val = xmlOutputBufferCreateFile(file, encoder);
28600         desret_xmlOutputBufferPtr(ret_val);
28601         call_tests++;
28602         des_FILE_ptr(n_file, file, 0);
28603         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28604         xmlResetLastError();
28605         if (mem_base != xmlMemBlocks()) {
28606             printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
28607                    xmlMemBlocks() - mem_base);
28608             test_ret++;
28609             printf(" %d", n_file);
28610             printf(" %d", n_encoder);
28611             printf("\n");
28612         }
28613     }
28614     }
28615     function_tests++;
28616 #endif
28617
28618     return(test_ret);
28619 }
28620
28621
28622 static int
28623 test_xmlOutputBufferCreateFilename(void) {
28624     int test_ret = 0;
28625
28626 #if defined(LIBXML_OUTPUT_ENABLED)
28627     int mem_base;
28628     xmlOutputBufferPtr ret_val;
28629     const char * URI; /* a C string containing the URI or filename */
28630     int n_URI;
28631     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28632     int n_encoder;
28633     int compression; /* the compression ration (0 none, 9 max). */
28634     int n_compression;
28635
28636     for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28637     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28638     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
28639         mem_base = xmlMemBlocks();
28640         URI = gen_fileoutput(n_URI, 0);
28641         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28642         compression = gen_int(n_compression, 2);
28643
28644         ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
28645         desret_xmlOutputBufferPtr(ret_val);
28646         call_tests++;
28647         des_fileoutput(n_URI, URI, 0);
28648         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28649         des_int(n_compression, compression, 2);
28650         xmlResetLastError();
28651         if (mem_base != xmlMemBlocks()) {
28652             printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
28653                    xmlMemBlocks() - mem_base);
28654             test_ret++;
28655             printf(" %d", n_URI);
28656             printf(" %d", n_encoder);
28657             printf(" %d", n_compression);
28658             printf("\n");
28659         }
28660     }
28661     }
28662     }
28663     function_tests++;
28664 #endif
28665
28666     return(test_ret);
28667 }
28668
28669
28670 static int
28671 test_xmlOutputBufferFlush(void) {
28672     int test_ret = 0;
28673
28674 #if defined(LIBXML_OUTPUT_ENABLED)
28675     int mem_base;
28676     int ret_val;
28677     xmlOutputBufferPtr out; /* a buffered output */
28678     int n_out;
28679
28680     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28681         mem_base = xmlMemBlocks();
28682         out = gen_xmlOutputBufferPtr(n_out, 0);
28683
28684         ret_val = xmlOutputBufferFlush(out);
28685         desret_int(ret_val);
28686         call_tests++;
28687         des_xmlOutputBufferPtr(n_out, out, 0);
28688         xmlResetLastError();
28689         if (mem_base != xmlMemBlocks()) {
28690             printf("Leak of %d blocks found in xmlOutputBufferFlush",
28691                    xmlMemBlocks() - mem_base);
28692             test_ret++;
28693             printf(" %d", n_out);
28694             printf("\n");
28695         }
28696     }
28697     function_tests++;
28698 #endif
28699
28700     return(test_ret);
28701 }
28702
28703
28704 static int
28705 test_xmlOutputBufferGetContent(void) {
28706     int test_ret = 0;
28707
28708 #if defined(LIBXML_OUTPUT_ENABLED)
28709     int mem_base;
28710     const xmlChar * ret_val;
28711     xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
28712     int n_out;
28713
28714     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28715         mem_base = xmlMemBlocks();
28716         out = gen_xmlOutputBufferPtr(n_out, 0);
28717
28718         ret_val = xmlOutputBufferGetContent(out);
28719         desret_const_xmlChar_ptr(ret_val);
28720         call_tests++;
28721         des_xmlOutputBufferPtr(n_out, out, 0);
28722         xmlResetLastError();
28723         if (mem_base != xmlMemBlocks()) {
28724             printf("Leak of %d blocks found in xmlOutputBufferGetContent",
28725                    xmlMemBlocks() - mem_base);
28726             test_ret++;
28727             printf(" %d", n_out);
28728             printf("\n");
28729         }
28730     }
28731     function_tests++;
28732 #endif
28733
28734     return(test_ret);
28735 }
28736
28737
28738 static int
28739 test_xmlOutputBufferGetSize(void) {
28740     int test_ret = 0;
28741
28742
28743     /* missing type support */
28744     return(test_ret);
28745 }
28746
28747
28748 static int
28749 test_xmlOutputBufferWrite(void) {
28750     int test_ret = 0;
28751
28752 #if defined(LIBXML_OUTPUT_ENABLED)
28753     int mem_base;
28754     int ret_val;
28755     xmlOutputBufferPtr out; /* a buffered parser output */
28756     int n_out;
28757     int len; /* the size in bytes of the array. */
28758     int n_len;
28759     char * buf; /* an char array */
28760     int n_buf;
28761
28762     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28763     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28764     for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28765         mem_base = xmlMemBlocks();
28766         out = gen_xmlOutputBufferPtr(n_out, 0);
28767         len = gen_int(n_len, 1);
28768         buf = gen_const_char_ptr(n_buf, 2);
28769         if ((buf != NULL) &&
28770             (len > (int) strlen((const char *) buf) + 1))
28771             continue;
28772
28773         ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
28774         desret_int(ret_val);
28775         call_tests++;
28776         des_xmlOutputBufferPtr(n_out, out, 0);
28777         des_int(n_len, len, 1);
28778         des_const_char_ptr(n_buf, (const char *)buf, 2);
28779         xmlResetLastError();
28780         if (mem_base != xmlMemBlocks()) {
28781             printf("Leak of %d blocks found in xmlOutputBufferWrite",
28782                    xmlMemBlocks() - mem_base);
28783             test_ret++;
28784             printf(" %d", n_out);
28785             printf(" %d", n_len);
28786             printf(" %d", n_buf);
28787             printf("\n");
28788         }
28789     }
28790     }
28791     }
28792     function_tests++;
28793 #endif
28794
28795     return(test_ret);
28796 }
28797
28798
28799 static int
28800 test_xmlOutputBufferWriteEscape(void) {
28801     int test_ret = 0;
28802
28803
28804     /* missing type support */
28805     return(test_ret);
28806 }
28807
28808
28809 static int
28810 test_xmlOutputBufferWriteString(void) {
28811     int test_ret = 0;
28812
28813 #if defined(LIBXML_OUTPUT_ENABLED)
28814     int mem_base;
28815     int ret_val;
28816     xmlOutputBufferPtr out; /* a buffered parser output */
28817     int n_out;
28818     char * str; /* a zero terminated C string */
28819     int n_str;
28820
28821     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28822     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
28823         mem_base = xmlMemBlocks();
28824         out = gen_xmlOutputBufferPtr(n_out, 0);
28825         str = gen_const_char_ptr(n_str, 1);
28826
28827         ret_val = xmlOutputBufferWriteString(out, (const char *)str);
28828         desret_int(ret_val);
28829         call_tests++;
28830         des_xmlOutputBufferPtr(n_out, out, 0);
28831         des_const_char_ptr(n_str, (const char *)str, 1);
28832         xmlResetLastError();
28833         if (mem_base != xmlMemBlocks()) {
28834             printf("Leak of %d blocks found in xmlOutputBufferWriteString",
28835                    xmlMemBlocks() - mem_base);
28836             test_ret++;
28837             printf(" %d", n_out);
28838             printf(" %d", n_str);
28839             printf("\n");
28840         }
28841     }
28842     }
28843     function_tests++;
28844 #endif
28845
28846     return(test_ret);
28847 }
28848
28849
28850 static int
28851 test_xmlParserGetDirectory(void) {
28852     int test_ret = 0;
28853
28854
28855     /* missing type support */
28856     return(test_ret);
28857 }
28858
28859
28860 static int
28861 test_xmlParserInputBufferCreateFd(void) {
28862     int test_ret = 0;
28863
28864     int mem_base;
28865     xmlParserInputBufferPtr ret_val;
28866     int fd; /* a file descriptor number */
28867     int n_fd;
28868     xmlCharEncoding enc; /* the charset encoding if known */
28869     int n_enc;
28870
28871     for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28872     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28873         mem_base = xmlMemBlocks();
28874         fd = gen_int(n_fd, 0);
28875         enc = gen_xmlCharEncoding(n_enc, 1);
28876         if (fd >= 0) fd = -1;
28877
28878         ret_val = xmlParserInputBufferCreateFd(fd, enc);
28879         desret_xmlParserInputBufferPtr(ret_val);
28880         call_tests++;
28881         des_int(n_fd, fd, 0);
28882         des_xmlCharEncoding(n_enc, enc, 1);
28883         xmlResetLastError();
28884         if (mem_base != xmlMemBlocks()) {
28885             printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
28886                    xmlMemBlocks() - mem_base);
28887             test_ret++;
28888             printf(" %d", n_fd);
28889             printf(" %d", n_enc);
28890             printf("\n");
28891         }
28892     }
28893     }
28894     function_tests++;
28895
28896     return(test_ret);
28897 }
28898
28899
28900 static int
28901 test_xmlParserInputBufferCreateFile(void) {
28902     int test_ret = 0;
28903
28904     int mem_base;
28905     xmlParserInputBufferPtr ret_val;
28906     FILE * file; /* a FILE* */
28907     int n_file;
28908     xmlCharEncoding enc; /* the charset encoding if known */
28909     int n_enc;
28910
28911     for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28912     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28913         mem_base = xmlMemBlocks();
28914         file = gen_FILE_ptr(n_file, 0);
28915         enc = gen_xmlCharEncoding(n_enc, 1);
28916
28917         ret_val = xmlParserInputBufferCreateFile(file, enc);
28918         desret_xmlParserInputBufferPtr(ret_val);
28919         call_tests++;
28920         des_FILE_ptr(n_file, file, 0);
28921         des_xmlCharEncoding(n_enc, enc, 1);
28922         xmlResetLastError();
28923         if (mem_base != xmlMemBlocks()) {
28924             printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
28925                    xmlMemBlocks() - mem_base);
28926             test_ret++;
28927             printf(" %d", n_file);
28928             printf(" %d", n_enc);
28929             printf("\n");
28930         }
28931     }
28932     }
28933     function_tests++;
28934
28935     return(test_ret);
28936 }
28937
28938
28939 static int
28940 test_xmlParserInputBufferCreateFilename(void) {
28941     int test_ret = 0;
28942
28943     int mem_base;
28944     xmlParserInputBufferPtr ret_val;
28945     const char * URI; /* a C string containing the URI or filename */
28946     int n_URI;
28947     xmlCharEncoding enc; /* the charset encoding if known */
28948     int n_enc;
28949
28950     for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28951     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28952         mem_base = xmlMemBlocks();
28953         URI = gen_fileoutput(n_URI, 0);
28954         enc = gen_xmlCharEncoding(n_enc, 1);
28955
28956         ret_val = xmlParserInputBufferCreateFilename(URI, enc);
28957         desret_xmlParserInputBufferPtr(ret_val);
28958         call_tests++;
28959         des_fileoutput(n_URI, URI, 0);
28960         des_xmlCharEncoding(n_enc, enc, 1);
28961         xmlResetLastError();
28962         if (mem_base != xmlMemBlocks()) {
28963             printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
28964                    xmlMemBlocks() - mem_base);
28965             test_ret++;
28966             printf(" %d", n_URI);
28967             printf(" %d", n_enc);
28968             printf("\n");
28969         }
28970     }
28971     }
28972     function_tests++;
28973
28974     return(test_ret);
28975 }
28976
28977
28978 static int
28979 test_xmlParserInputBufferCreateMem(void) {
28980     int test_ret = 0;
28981
28982     int mem_base;
28983     xmlParserInputBufferPtr ret_val;
28984     char * mem; /* the memory input */
28985     int n_mem;
28986     int size; /* the length of the memory block */
28987     int n_size;
28988     xmlCharEncoding enc; /* the charset encoding if known */
28989     int n_enc;
28990
28991     for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28992     for (n_size = 0;n_size < gen_nb_int;n_size++) {
28993     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28994         mem_base = xmlMemBlocks();
28995         mem = gen_const_char_ptr(n_mem, 0);
28996         size = gen_int(n_size, 1);
28997         enc = gen_xmlCharEncoding(n_enc, 2);
28998         if ((mem != NULL) &&
28999             (size > (int) strlen((const char *) mem) + 1))
29000             continue;
29001
29002         ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
29003         desret_xmlParserInputBufferPtr(ret_val);
29004         call_tests++;
29005         des_const_char_ptr(n_mem, (const char *)mem, 0);
29006         des_int(n_size, size, 1);
29007         des_xmlCharEncoding(n_enc, enc, 2);
29008         xmlResetLastError();
29009         if (mem_base != xmlMemBlocks()) {
29010             printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
29011                    xmlMemBlocks() - mem_base);
29012             test_ret++;
29013             printf(" %d", n_mem);
29014             printf(" %d", n_size);
29015             printf(" %d", n_enc);
29016             printf("\n");
29017         }
29018     }
29019     }
29020     }
29021     function_tests++;
29022
29023     return(test_ret);
29024 }
29025
29026
29027 static int
29028 test_xmlParserInputBufferCreateStatic(void) {
29029     int test_ret = 0;
29030
29031     int mem_base;
29032     xmlParserInputBufferPtr ret_val;
29033     char * mem; /* the memory input */
29034     int n_mem;
29035     int size; /* the length of the memory block */
29036     int n_size;
29037     xmlCharEncoding enc; /* the charset encoding if known */
29038     int n_enc;
29039
29040     for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
29041     for (n_size = 0;n_size < gen_nb_int;n_size++) {
29042     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
29043         mem_base = xmlMemBlocks();
29044         mem = gen_const_char_ptr(n_mem, 0);
29045         size = gen_int(n_size, 1);
29046         enc = gen_xmlCharEncoding(n_enc, 2);
29047         if ((mem != NULL) &&
29048             (size > (int) strlen((const char *) mem) + 1))
29049             continue;
29050
29051         ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
29052         desret_xmlParserInputBufferPtr(ret_val);
29053         call_tests++;
29054         des_const_char_ptr(n_mem, (const char *)mem, 0);
29055         des_int(n_size, size, 1);
29056         des_xmlCharEncoding(n_enc, enc, 2);
29057         xmlResetLastError();
29058         if (mem_base != xmlMemBlocks()) {
29059             printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
29060                    xmlMemBlocks() - mem_base);
29061             test_ret++;
29062             printf(" %d", n_mem);
29063             printf(" %d", n_size);
29064             printf(" %d", n_enc);
29065             printf("\n");
29066         }
29067     }
29068     }
29069     }
29070     function_tests++;
29071
29072     return(test_ret);
29073 }
29074
29075
29076 static int
29077 test_xmlParserInputBufferGrow(void) {
29078     int test_ret = 0;
29079
29080     int mem_base;
29081     int ret_val;
29082     xmlParserInputBufferPtr in; /* a buffered parser input */
29083     int n_in;
29084     int len; /* indicative value of the amount of chars to read */
29085     int n_len;
29086
29087     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
29088     for (n_len = 0;n_len < gen_nb_int;n_len++) {
29089         mem_base = xmlMemBlocks();
29090         in = gen_xmlParserInputBufferPtr(n_in, 0);
29091         len = gen_int(n_len, 1);
29092
29093         ret_val = xmlParserInputBufferGrow(in, len);
29094         desret_int(ret_val);
29095         call_tests++;
29096         des_xmlParserInputBufferPtr(n_in, in, 0);
29097         des_int(n_len, len, 1);
29098         xmlResetLastError();
29099         if (mem_base != xmlMemBlocks()) {
29100             printf("Leak of %d blocks found in xmlParserInputBufferGrow",
29101                    xmlMemBlocks() - mem_base);
29102             test_ret++;
29103             printf(" %d", n_in);
29104             printf(" %d", n_len);
29105             printf("\n");
29106         }
29107     }
29108     }
29109     function_tests++;
29110
29111     return(test_ret);
29112 }
29113
29114
29115 static int
29116 test_xmlParserInputBufferPush(void) {
29117     int test_ret = 0;
29118
29119     int mem_base;
29120     int ret_val;
29121     xmlParserInputBufferPtr in; /* a buffered parser input */
29122     int n_in;
29123     int len; /* the size in bytes of the array. */
29124     int n_len;
29125     char * buf; /* an char array */
29126     int n_buf;
29127
29128     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
29129     for (n_len = 0;n_len < gen_nb_int;n_len++) {
29130     for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
29131         mem_base = xmlMemBlocks();
29132         in = gen_xmlParserInputBufferPtr(n_in, 0);
29133         len = gen_int(n_len, 1);
29134         buf = gen_const_char_ptr(n_buf, 2);
29135         if ((buf != NULL) &&
29136             (len > (int) strlen((const char *) buf) + 1))
29137             continue;
29138
29139         ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
29140         desret_int(ret_val);
29141         call_tests++;
29142         des_xmlParserInputBufferPtr(n_in, in, 0);
29143         des_int(n_len, len, 1);
29144         des_const_char_ptr(n_buf, (const char *)buf, 2);
29145         xmlResetLastError();
29146         if (mem_base != xmlMemBlocks()) {
29147             printf("Leak of %d blocks found in xmlParserInputBufferPush",
29148                    xmlMemBlocks() - mem_base);
29149             test_ret++;
29150             printf(" %d", n_in);
29151             printf(" %d", n_len);
29152             printf(" %d", n_buf);
29153             printf("\n");
29154         }
29155     }
29156     }
29157     }
29158     function_tests++;
29159
29160     return(test_ret);
29161 }
29162
29163
29164 static int
29165 test_xmlParserInputBufferRead(void) {
29166     int test_ret = 0;
29167
29168     int mem_base;
29169     int ret_val;
29170     xmlParserInputBufferPtr in; /* a buffered parser input */
29171     int n_in;
29172     int len; /* indicative value of the amount of chars to read */
29173     int n_len;
29174
29175     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
29176     for (n_len = 0;n_len < gen_nb_int;n_len++) {
29177         mem_base = xmlMemBlocks();
29178         in = gen_xmlParserInputBufferPtr(n_in, 0);
29179         len = gen_int(n_len, 1);
29180
29181         ret_val = xmlParserInputBufferRead(in, len);
29182         desret_int(ret_val);
29183         call_tests++;
29184         des_xmlParserInputBufferPtr(n_in, in, 0);
29185         des_int(n_len, len, 1);
29186         xmlResetLastError();
29187         if (mem_base != xmlMemBlocks()) {
29188             printf("Leak of %d blocks found in xmlParserInputBufferRead",
29189                    xmlMemBlocks() - mem_base);
29190             test_ret++;
29191             printf(" %d", n_in);
29192             printf(" %d", n_len);
29193             printf("\n");
29194         }
29195     }
29196     }
29197     function_tests++;
29198
29199     return(test_ret);
29200 }
29201
29202
29203 static int
29204 test_xmlPopInputCallbacks(void) {
29205     int test_ret = 0;
29206
29207     int mem_base;
29208     int ret_val;
29209
29210         mem_base = xmlMemBlocks();
29211
29212         ret_val = xmlPopInputCallbacks();
29213         desret_int(ret_val);
29214         call_tests++;
29215         xmlResetLastError();
29216         if (mem_base != xmlMemBlocks()) {
29217             printf("Leak of %d blocks found in xmlPopInputCallbacks",
29218                    xmlMemBlocks() - mem_base);
29219             test_ret++;
29220             printf("\n");
29221         }
29222     function_tests++;
29223
29224     return(test_ret);
29225 }
29226
29227
29228 static int
29229 test_xmlRegisterDefaultInputCallbacks(void) {
29230     int test_ret = 0;
29231
29232     int mem_base;
29233
29234         mem_base = xmlMemBlocks();
29235
29236         xmlRegisterDefaultInputCallbacks();
29237         call_tests++;
29238         xmlResetLastError();
29239         if (mem_base != xmlMemBlocks()) {
29240             printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
29241                    xmlMemBlocks() - mem_base);
29242             test_ret++;
29243             printf("\n");
29244         }
29245     function_tests++;
29246
29247     return(test_ret);
29248 }
29249
29250
29251 static int
29252 test_xmlRegisterDefaultOutputCallbacks(void) {
29253     int test_ret = 0;
29254
29255 #if defined(LIBXML_OUTPUT_ENABLED)
29256     int mem_base;
29257
29258         mem_base = xmlMemBlocks();
29259
29260         xmlRegisterDefaultOutputCallbacks();
29261         call_tests++;
29262         xmlResetLastError();
29263         if (mem_base != xmlMemBlocks()) {
29264             printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
29265                    xmlMemBlocks() - mem_base);
29266             test_ret++;
29267             printf("\n");
29268         }
29269     function_tests++;
29270 #endif
29271
29272     return(test_ret);
29273 }
29274
29275
29276 static int
29277 test_xmlRegisterHTTPPostCallbacks(void) {
29278     int test_ret = 0;
29279
29280 #if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
29281     int mem_base;
29282
29283         mem_base = xmlMemBlocks();
29284
29285         xmlRegisterHTTPPostCallbacks();
29286         call_tests++;
29287         xmlResetLastError();
29288         if (mem_base != xmlMemBlocks()) {
29289             printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
29290                    xmlMemBlocks() - mem_base);
29291             test_ret++;
29292             printf("\n");
29293         }
29294     function_tests++;
29295 #endif
29296
29297     return(test_ret);
29298 }
29299
29300 static int
29301 test_xmlIO(void) {
29302     int test_ret = 0;
29303
29304     if (quiet == 0) printf("Testing xmlIO : 40 of 50 functions ...\n");
29305     test_ret += test_xmlAllocOutputBuffer();
29306     test_ret += test_xmlAllocParserInputBuffer();
29307     test_ret += test_xmlCheckFilename();
29308     test_ret += test_xmlCheckHTTPInput();
29309     test_ret += test_xmlCleanupInputCallbacks();
29310     test_ret += test_xmlCleanupOutputCallbacks();
29311     test_ret += test_xmlFileClose();
29312     test_ret += test_xmlFileMatch();
29313     test_ret += test_xmlFileOpen();
29314     test_ret += test_xmlFileRead();
29315     test_ret += test_xmlIOFTPClose();
29316     test_ret += test_xmlIOFTPMatch();
29317     test_ret += test_xmlIOFTPOpen();
29318     test_ret += test_xmlIOFTPRead();
29319     test_ret += test_xmlIOHTTPClose();
29320     test_ret += test_xmlIOHTTPMatch();
29321     test_ret += test_xmlIOHTTPOpen();
29322     test_ret += test_xmlIOHTTPRead();
29323     test_ret += test_xmlNoNetExternalEntityLoader();
29324     test_ret += test_xmlNormalizeWindowsPath();
29325     test_ret += test_xmlOutputBufferCreateBuffer();
29326     test_ret += test_xmlOutputBufferCreateFd();
29327     test_ret += test_xmlOutputBufferCreateFile();
29328     test_ret += test_xmlOutputBufferCreateFilename();
29329     test_ret += test_xmlOutputBufferFlush();
29330     test_ret += test_xmlOutputBufferGetContent();
29331     test_ret += test_xmlOutputBufferGetSize();
29332     test_ret += test_xmlOutputBufferWrite();
29333     test_ret += test_xmlOutputBufferWriteEscape();
29334     test_ret += test_xmlOutputBufferWriteString();
29335     test_ret += test_xmlParserGetDirectory();
29336     test_ret += test_xmlParserInputBufferCreateFd();
29337     test_ret += test_xmlParserInputBufferCreateFile();
29338     test_ret += test_xmlParserInputBufferCreateFilename();
29339     test_ret += test_xmlParserInputBufferCreateMem();
29340     test_ret += test_xmlParserInputBufferCreateStatic();
29341     test_ret += test_xmlParserInputBufferGrow();
29342     test_ret += test_xmlParserInputBufferPush();
29343     test_ret += test_xmlParserInputBufferRead();
29344     test_ret += test_xmlPopInputCallbacks();
29345     test_ret += test_xmlRegisterDefaultInputCallbacks();
29346     test_ret += test_xmlRegisterDefaultOutputCallbacks();
29347     test_ret += test_xmlRegisterHTTPPostCallbacks();
29348
29349     if (test_ret != 0)
29350         printf("Module xmlIO: %d errors\n", test_ret);
29351     return(test_ret);
29352 }
29353 #ifdef LIBXML_AUTOMATA_ENABLED
29354
29355 #define gen_nb_xmlAutomataPtr 1
29356 static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29357     return(NULL);
29358 }
29359 static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29360 }
29361 #endif
29362
29363
29364 static int
29365 test_xmlAutomataCompile(void) {
29366     int test_ret = 0;
29367
29368
29369     /* missing type support */
29370     return(test_ret);
29371 }
29372
29373
29374 static int
29375 test_xmlAutomataGetInitState(void) {
29376     int test_ret = 0;
29377
29378
29379     /* missing type support */
29380     return(test_ret);
29381 }
29382
29383
29384 static int
29385 test_xmlAutomataIsDeterminist(void) {
29386     int test_ret = 0;
29387
29388 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29389     int mem_base;
29390     int ret_val;
29391     xmlAutomataPtr am; /* an automata */
29392     int n_am;
29393
29394     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29395         mem_base = xmlMemBlocks();
29396         am = gen_xmlAutomataPtr(n_am, 0);
29397
29398         ret_val = xmlAutomataIsDeterminist(am);
29399         desret_int(ret_val);
29400         call_tests++;
29401         des_xmlAutomataPtr(n_am, am, 0);
29402         xmlResetLastError();
29403         if (mem_base != xmlMemBlocks()) {
29404             printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
29405                    xmlMemBlocks() - mem_base);
29406             test_ret++;
29407             printf(" %d", n_am);
29408             printf("\n");
29409         }
29410     }
29411     function_tests++;
29412 #endif
29413
29414     return(test_ret);
29415 }
29416
29417 #ifdef LIBXML_AUTOMATA_ENABLED
29418
29419 #define gen_nb_xmlAutomataStatePtr 1
29420 static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29421     return(NULL);
29422 }
29423 static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29424 }
29425 #endif
29426
29427
29428 static int
29429 test_xmlAutomataNewAllTrans(void) {
29430     int test_ret = 0;
29431
29432
29433     /* missing type support */
29434     return(test_ret);
29435 }
29436
29437
29438 static int
29439 test_xmlAutomataNewCountTrans(void) {
29440     int test_ret = 0;
29441
29442
29443     /* missing type support */
29444     return(test_ret);
29445 }
29446
29447
29448 static int
29449 test_xmlAutomataNewCountTrans2(void) {
29450     int test_ret = 0;
29451
29452
29453     /* missing type support */
29454     return(test_ret);
29455 }
29456
29457
29458 static int
29459 test_xmlAutomataNewCountedTrans(void) {
29460     int test_ret = 0;
29461
29462
29463     /* missing type support */
29464     return(test_ret);
29465 }
29466
29467
29468 static int
29469 test_xmlAutomataNewCounter(void) {
29470     int test_ret = 0;
29471
29472 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29473     int mem_base;
29474     int ret_val;
29475     xmlAutomataPtr am; /* an automata */
29476     int n_am;
29477     int min; /* the minimal value on the counter */
29478     int n_min;
29479     int max; /* the maximal value on the counter */
29480     int n_max;
29481
29482     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29483     for (n_min = 0;n_min < gen_nb_int;n_min++) {
29484     for (n_max = 0;n_max < gen_nb_int;n_max++) {
29485         mem_base = xmlMemBlocks();
29486         am = gen_xmlAutomataPtr(n_am, 0);
29487         min = gen_int(n_min, 1);
29488         max = gen_int(n_max, 2);
29489
29490         ret_val = xmlAutomataNewCounter(am, min, max);
29491         desret_int(ret_val);
29492         call_tests++;
29493         des_xmlAutomataPtr(n_am, am, 0);
29494         des_int(n_min, min, 1);
29495         des_int(n_max, max, 2);
29496         xmlResetLastError();
29497         if (mem_base != xmlMemBlocks()) {
29498             printf("Leak of %d blocks found in xmlAutomataNewCounter",
29499                    xmlMemBlocks() - mem_base);
29500             test_ret++;
29501             printf(" %d", n_am);
29502             printf(" %d", n_min);
29503             printf(" %d", n_max);
29504             printf("\n");
29505         }
29506     }
29507     }
29508     }
29509     function_tests++;
29510 #endif
29511
29512     return(test_ret);
29513 }
29514
29515
29516 static int
29517 test_xmlAutomataNewCounterTrans(void) {
29518     int test_ret = 0;
29519
29520
29521     /* missing type support */
29522     return(test_ret);
29523 }
29524
29525
29526 static int
29527 test_xmlAutomataNewEpsilon(void) {
29528     int test_ret = 0;
29529
29530
29531     /* missing type support */
29532     return(test_ret);
29533 }
29534
29535
29536 static int
29537 test_xmlAutomataNewNegTrans(void) {
29538     int test_ret = 0;
29539
29540
29541     /* missing type support */
29542     return(test_ret);
29543 }
29544
29545
29546 static int
29547 test_xmlAutomataNewOnceTrans(void) {
29548     int test_ret = 0;
29549
29550
29551     /* missing type support */
29552     return(test_ret);
29553 }
29554
29555
29556 static int
29557 test_xmlAutomataNewOnceTrans2(void) {
29558     int test_ret = 0;
29559
29560
29561     /* missing type support */
29562     return(test_ret);
29563 }
29564
29565
29566 static int
29567 test_xmlAutomataNewState(void) {
29568     int test_ret = 0;
29569
29570
29571     /* missing type support */
29572     return(test_ret);
29573 }
29574
29575
29576 static int
29577 test_xmlAutomataNewTransition(void) {
29578     int test_ret = 0;
29579
29580
29581     /* missing type support */
29582     return(test_ret);
29583 }
29584
29585
29586 static int
29587 test_xmlAutomataNewTransition2(void) {
29588     int test_ret = 0;
29589
29590
29591     /* missing type support */
29592     return(test_ret);
29593 }
29594
29595
29596 static int
29597 test_xmlAutomataSetFinalState(void) {
29598     int test_ret = 0;
29599
29600 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29601     int mem_base;
29602     int ret_val;
29603     xmlAutomataPtr am; /* an automata */
29604     int n_am;
29605     xmlAutomataStatePtr state; /* a state in this automata */
29606     int n_state;
29607
29608     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29609     for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
29610         mem_base = xmlMemBlocks();
29611         am = gen_xmlAutomataPtr(n_am, 0);
29612         state = gen_xmlAutomataStatePtr(n_state, 1);
29613
29614         ret_val = xmlAutomataSetFinalState(am, state);
29615         desret_int(ret_val);
29616         call_tests++;
29617         des_xmlAutomataPtr(n_am, am, 0);
29618         des_xmlAutomataStatePtr(n_state, state, 1);
29619         xmlResetLastError();
29620         if (mem_base != xmlMemBlocks()) {
29621             printf("Leak of %d blocks found in xmlAutomataSetFinalState",
29622                    xmlMemBlocks() - mem_base);
29623             test_ret++;
29624             printf(" %d", n_am);
29625             printf(" %d", n_state);
29626             printf("\n");
29627         }
29628     }
29629     }
29630     function_tests++;
29631 #endif
29632
29633     return(test_ret);
29634 }
29635
29636
29637 static int
29638 test_xmlNewAutomata(void) {
29639     int test_ret = 0;
29640
29641
29642     /* missing type support */
29643     return(test_ret);
29644 }
29645
29646 static int
29647 test_xmlautomata(void) {
29648     int test_ret = 0;
29649
29650     if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
29651     test_ret += test_xmlAutomataCompile();
29652     test_ret += test_xmlAutomataGetInitState();
29653     test_ret += test_xmlAutomataIsDeterminist();
29654     test_ret += test_xmlAutomataNewAllTrans();
29655     test_ret += test_xmlAutomataNewCountTrans();
29656     test_ret += test_xmlAutomataNewCountTrans2();
29657     test_ret += test_xmlAutomataNewCountedTrans();
29658     test_ret += test_xmlAutomataNewCounter();
29659     test_ret += test_xmlAutomataNewCounterTrans();
29660     test_ret += test_xmlAutomataNewEpsilon();
29661     test_ret += test_xmlAutomataNewNegTrans();
29662     test_ret += test_xmlAutomataNewOnceTrans();
29663     test_ret += test_xmlAutomataNewOnceTrans2();
29664     test_ret += test_xmlAutomataNewState();
29665     test_ret += test_xmlAutomataNewTransition();
29666     test_ret += test_xmlAutomataNewTransition2();
29667     test_ret += test_xmlAutomataSetFinalState();
29668     test_ret += test_xmlNewAutomata();
29669
29670     if (test_ret != 0)
29671         printf("Module xmlautomata: %d errors\n", test_ret);
29672     return(test_ret);
29673 }
29674
29675 #define gen_nb_xmlGenericErrorFunc_ptr 1
29676 static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29677     return(NULL);
29678 }
29679 static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29680 }
29681
29682 static int
29683 test_initGenericErrorDefaultFunc(void) {
29684     int test_ret = 0;
29685
29686     int mem_base;
29687     xmlGenericErrorFunc * handler; /* the handler */
29688     int n_handler;
29689
29690     for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
29691         mem_base = xmlMemBlocks();
29692         handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
29693
29694         initGenericErrorDefaultFunc(handler);
29695         call_tests++;
29696         des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
29697         xmlResetLastError();
29698         if (mem_base != xmlMemBlocks()) {
29699             printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
29700                    xmlMemBlocks() - mem_base);
29701             test_ret++;
29702             printf(" %d", n_handler);
29703             printf("\n");
29704         }
29705     }
29706     function_tests++;
29707
29708     return(test_ret);
29709 }
29710
29711
29712 #define gen_nb_xmlErrorPtr 1
29713 static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29714     return(NULL);
29715 }
29716 static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29717 }
29718
29719 static int
29720 test_xmlCopyError(void) {
29721     int test_ret = 0;
29722
29723     int mem_base;
29724     int ret_val;
29725     xmlErrorPtr from; /* a source error */
29726     int n_from;
29727     xmlErrorPtr to; /* a target error */
29728     int n_to;
29729
29730     for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
29731     for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
29732         mem_base = xmlMemBlocks();
29733         from = gen_xmlErrorPtr(n_from, 0);
29734         to = gen_xmlErrorPtr(n_to, 1);
29735
29736         ret_val = xmlCopyError(from, to);
29737         desret_int(ret_val);
29738         call_tests++;
29739         des_xmlErrorPtr(n_from, from, 0);
29740         des_xmlErrorPtr(n_to, to, 1);
29741         xmlResetLastError();
29742         if (mem_base != xmlMemBlocks()) {
29743             printf("Leak of %d blocks found in xmlCopyError",
29744                    xmlMemBlocks() - mem_base);
29745             test_ret++;
29746             printf(" %d", n_from);
29747             printf(" %d", n_to);
29748             printf("\n");
29749         }
29750     }
29751     }
29752     function_tests++;
29753
29754     return(test_ret);
29755 }
29756
29757
29758 static int
29759 test_xmlCtxtGetLastError(void) {
29760     int test_ret = 0;
29761
29762
29763     /* missing type support */
29764     return(test_ret);
29765 }
29766
29767
29768 static int
29769 test_xmlCtxtResetLastError(void) {
29770     int test_ret = 0;
29771
29772     int mem_base;
29773     void * ctx; /* an XML parser context */
29774     int n_ctx;
29775
29776     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
29777         mem_base = xmlMemBlocks();
29778         ctx = gen_void_ptr(n_ctx, 0);
29779
29780         xmlCtxtResetLastError(ctx);
29781         call_tests++;
29782         des_void_ptr(n_ctx, ctx, 0);
29783         xmlResetLastError();
29784         if (mem_base != xmlMemBlocks()) {
29785             printf("Leak of %d blocks found in xmlCtxtResetLastError",
29786                    xmlMemBlocks() - mem_base);
29787             test_ret++;
29788             printf(" %d", n_ctx);
29789             printf("\n");
29790         }
29791     }
29792     function_tests++;
29793
29794     return(test_ret);
29795 }
29796
29797
29798 static int
29799 test_xmlGetLastError(void) {
29800     int test_ret = 0;
29801
29802
29803     /* missing type support */
29804     return(test_ret);
29805 }
29806
29807
29808 static int
29809 test_xmlParserError(void) {
29810     int test_ret = 0;
29811
29812
29813     /* missing type support */
29814     return(test_ret);
29815 }
29816
29817
29818 static int
29819 test_xmlParserPrintFileContext(void) {
29820     int test_ret = 0;
29821
29822     int mem_base;
29823     xmlParserInputPtr input; /* an xmlParserInputPtr input */
29824     int n_input;
29825
29826     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29827         mem_base = xmlMemBlocks();
29828         input = gen_xmlParserInputPtr(n_input, 0);
29829
29830         xmlParserPrintFileContext(input);
29831         call_tests++;
29832         des_xmlParserInputPtr(n_input, input, 0);
29833         xmlResetLastError();
29834         if (mem_base != xmlMemBlocks()) {
29835             printf("Leak of %d blocks found in xmlParserPrintFileContext",
29836                    xmlMemBlocks() - mem_base);
29837             test_ret++;
29838             printf(" %d", n_input);
29839             printf("\n");
29840         }
29841     }
29842     function_tests++;
29843
29844     return(test_ret);
29845 }
29846
29847
29848 static int
29849 test_xmlParserPrintFileInfo(void) {
29850     int test_ret = 0;
29851
29852     int mem_base;
29853     xmlParserInputPtr input; /* an xmlParserInputPtr input */
29854     int n_input;
29855
29856     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29857         mem_base = xmlMemBlocks();
29858         input = gen_xmlParserInputPtr(n_input, 0);
29859
29860         xmlParserPrintFileInfo(input);
29861         call_tests++;
29862         des_xmlParserInputPtr(n_input, input, 0);
29863         xmlResetLastError();
29864         if (mem_base != xmlMemBlocks()) {
29865             printf("Leak of %d blocks found in xmlParserPrintFileInfo",
29866                    xmlMemBlocks() - mem_base);
29867             test_ret++;
29868             printf(" %d", n_input);
29869             printf("\n");
29870         }
29871     }
29872     function_tests++;
29873
29874     return(test_ret);
29875 }
29876
29877
29878 static int
29879 test_xmlParserValidityError(void) {
29880     int test_ret = 0;
29881
29882
29883     /* missing type support */
29884     return(test_ret);
29885 }
29886
29887
29888 static int
29889 test_xmlParserValidityWarning(void) {
29890     int test_ret = 0;
29891
29892
29893     /* missing type support */
29894     return(test_ret);
29895 }
29896
29897
29898 static int
29899 test_xmlParserWarning(void) {
29900     int test_ret = 0;
29901
29902
29903     /* missing type support */
29904     return(test_ret);
29905 }
29906
29907
29908 static int
29909 test_xmlResetError(void) {
29910     int test_ret = 0;
29911
29912     int mem_base;
29913     xmlErrorPtr err; /* pointer to the error. */
29914     int n_err;
29915
29916     for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
29917         mem_base = xmlMemBlocks();
29918         err = gen_xmlErrorPtr(n_err, 0);
29919
29920         xmlResetError(err);
29921         call_tests++;
29922         des_xmlErrorPtr(n_err, err, 0);
29923         xmlResetLastError();
29924         if (mem_base != xmlMemBlocks()) {
29925             printf("Leak of %d blocks found in xmlResetError",
29926                    xmlMemBlocks() - mem_base);
29927             test_ret++;
29928             printf(" %d", n_err);
29929             printf("\n");
29930         }
29931     }
29932     function_tests++;
29933
29934     return(test_ret);
29935 }
29936
29937
29938 static int
29939 test_xmlResetLastError(void) {
29940     int test_ret = 0;
29941
29942
29943
29944         xmlResetLastError();
29945         call_tests++;
29946         xmlResetLastError();
29947     function_tests++;
29948
29949     return(test_ret);
29950 }
29951
29952
29953 static int
29954 test_xmlSetGenericErrorFunc(void) {
29955     int test_ret = 0;
29956
29957
29958     /* missing type support */
29959     return(test_ret);
29960 }
29961
29962
29963 static int
29964 test_xmlSetStructuredErrorFunc(void) {
29965     int test_ret = 0;
29966
29967
29968     /* missing type support */
29969     return(test_ret);
29970 }
29971
29972 static int
29973 test_xmlerror(void) {
29974     int test_ret = 0;
29975
29976     if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
29977     test_ret += test_initGenericErrorDefaultFunc();
29978     test_ret += test_xmlCopyError();
29979     test_ret += test_xmlCtxtGetLastError();
29980     test_ret += test_xmlCtxtResetLastError();
29981     test_ret += test_xmlGetLastError();
29982     test_ret += test_xmlParserError();
29983     test_ret += test_xmlParserPrintFileContext();
29984     test_ret += test_xmlParserPrintFileInfo();
29985     test_ret += test_xmlParserValidityError();
29986     test_ret += test_xmlParserValidityWarning();
29987     test_ret += test_xmlParserWarning();
29988     test_ret += test_xmlResetError();
29989     test_ret += test_xmlResetLastError();
29990     test_ret += test_xmlSetGenericErrorFunc();
29991     test_ret += test_xmlSetStructuredErrorFunc();
29992
29993     if (test_ret != 0)
29994         printf("Module xmlerror: %d errors\n", test_ret);
29995     return(test_ret);
29996 }
29997 #ifdef LIBXML_MODULES_ENABLED
29998
29999 #define gen_nb_xmlModulePtr 1
30000 static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30001     return(NULL);
30002 }
30003 static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30004 }
30005 #endif
30006
30007
30008 static int
30009 test_xmlModuleClose(void) {
30010     int test_ret = 0;
30011
30012 #if defined(LIBXML_MODULES_ENABLED)
30013     int mem_base;
30014     int ret_val;
30015     xmlModulePtr module; /* the module handle */
30016     int n_module;
30017
30018     for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
30019         mem_base = xmlMemBlocks();
30020         module = gen_xmlModulePtr(n_module, 0);
30021
30022         ret_val = xmlModuleClose(module);
30023         desret_int(ret_val);
30024         call_tests++;
30025         des_xmlModulePtr(n_module, module, 0);
30026         xmlResetLastError();
30027         if (mem_base != xmlMemBlocks()) {
30028             printf("Leak of %d blocks found in xmlModuleClose",
30029                    xmlMemBlocks() - mem_base);
30030             test_ret++;
30031             printf(" %d", n_module);
30032             printf("\n");
30033         }
30034     }
30035     function_tests++;
30036 #endif
30037
30038     return(test_ret);
30039 }
30040
30041
30042 static int
30043 test_xmlModuleOpen(void) {
30044     int test_ret = 0;
30045
30046
30047     /* missing type support */
30048     return(test_ret);
30049 }
30050
30051
30052 static int
30053 test_xmlModuleSymbol(void) {
30054     int test_ret = 0;
30055
30056 #if defined(LIBXML_MODULES_ENABLED)
30057     int mem_base;
30058     int ret_val;
30059     xmlModulePtr module; /* the module */
30060     int n_module;
30061     char * name; /* the name of the symbol */
30062     int n_name;
30063     void ** symbol; /* the resulting symbol address */
30064     int n_symbol;
30065
30066     for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
30067     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
30068     for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
30069         mem_base = xmlMemBlocks();
30070         module = gen_xmlModulePtr(n_module, 0);
30071         name = gen_const_char_ptr(n_name, 1);
30072         symbol = gen_void_ptr_ptr(n_symbol, 2);
30073
30074         ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
30075         desret_int(ret_val);
30076         call_tests++;
30077         des_xmlModulePtr(n_module, module, 0);
30078         des_const_char_ptr(n_name, (const char *)name, 1);
30079         des_void_ptr_ptr(n_symbol, symbol, 2);
30080         xmlResetLastError();
30081         if (mem_base != xmlMemBlocks()) {
30082             printf("Leak of %d blocks found in xmlModuleSymbol",
30083                    xmlMemBlocks() - mem_base);
30084             test_ret++;
30085             printf(" %d", n_module);
30086             printf(" %d", n_name);
30087             printf(" %d", n_symbol);
30088             printf("\n");
30089         }
30090     }
30091     }
30092     }
30093     function_tests++;
30094 #endif
30095
30096     return(test_ret);
30097 }
30098
30099 static int
30100 test_xmlmodule(void) {
30101     int test_ret = 0;
30102
30103     if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
30104     test_ret += test_xmlModuleClose();
30105     test_ret += test_xmlModuleOpen();
30106     test_ret += test_xmlModuleSymbol();
30107
30108     if (test_ret != 0)
30109         printf("Module xmlmodule: %d errors\n", test_ret);
30110     return(test_ret);
30111 }
30112
30113 static int
30114 test_xmlNewTextReader(void) {
30115     int test_ret = 0;
30116
30117 #if defined(LIBXML_READER_ENABLED)
30118     int mem_base;
30119     xmlTextReaderPtr ret_val;
30120     xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
30121     int n_input;
30122     const char * URI; /* the URI information for the source if available */
30123     int n_URI;
30124
30125     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
30126     for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
30127         mem_base = xmlMemBlocks();
30128         input = gen_xmlParserInputBufferPtr(n_input, 0);
30129         URI = gen_filepath(n_URI, 1);
30130
30131         ret_val = xmlNewTextReader(input, URI);
30132         desret_xmlTextReaderPtr(ret_val);
30133         call_tests++;
30134         des_xmlParserInputBufferPtr(n_input, input, 0);
30135         des_filepath(n_URI, URI, 1);
30136         xmlResetLastError();
30137         if (mem_base != xmlMemBlocks()) {
30138             printf("Leak of %d blocks found in xmlNewTextReader",
30139                    xmlMemBlocks() - mem_base);
30140             test_ret++;
30141             printf(" %d", n_input);
30142             printf(" %d", n_URI);
30143             printf("\n");
30144         }
30145     }
30146     }
30147     function_tests++;
30148 #endif
30149
30150     return(test_ret);
30151 }
30152
30153
30154 static int
30155 test_xmlNewTextReaderFilename(void) {
30156     int test_ret = 0;
30157
30158 #if defined(LIBXML_READER_ENABLED)
30159     int mem_base;
30160     xmlTextReaderPtr ret_val;
30161     const char * URI; /* the URI of the resource to process */
30162     int n_URI;
30163
30164     for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
30165         mem_base = xmlMemBlocks();
30166         URI = gen_filepath(n_URI, 0);
30167
30168         ret_val = xmlNewTextReaderFilename(URI);
30169         desret_xmlTextReaderPtr(ret_val);
30170         call_tests++;
30171         des_filepath(n_URI, URI, 0);
30172         xmlResetLastError();
30173         if (mem_base != xmlMemBlocks()) {
30174             printf("Leak of %d blocks found in xmlNewTextReaderFilename",
30175                    xmlMemBlocks() - mem_base);
30176             test_ret++;
30177             printf(" %d", n_URI);
30178             printf("\n");
30179         }
30180     }
30181     function_tests++;
30182 #endif
30183
30184     return(test_ret);
30185 }
30186
30187
30188 static int
30189 test_xmlReaderForDoc(void) {
30190     int test_ret = 0;
30191
30192 #if defined(LIBXML_READER_ENABLED)
30193     int mem_base;
30194     xmlTextReaderPtr ret_val;
30195     xmlChar * cur; /* a pointer to a zero terminated string */
30196     int n_cur;
30197     const char * URL; /* the base URL to use for the document */
30198     int n_URL;
30199     char * encoding; /* the document encoding, or NULL */
30200     int n_encoding;
30201     int options; /* a combination of xmlParserOption */
30202     int n_options;
30203
30204     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
30205     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30206     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30207     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30208         mem_base = xmlMemBlocks();
30209         cur = gen_const_xmlChar_ptr(n_cur, 0);
30210         URL = gen_filepath(n_URL, 1);
30211         encoding = gen_const_char_ptr(n_encoding, 2);
30212         options = gen_parseroptions(n_options, 3);
30213
30214         ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
30215         desret_xmlTextReaderPtr(ret_val);
30216         call_tests++;
30217         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
30218         des_filepath(n_URL, URL, 1);
30219         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30220         des_parseroptions(n_options, options, 3);
30221         xmlResetLastError();
30222         if (mem_base != xmlMemBlocks()) {
30223             printf("Leak of %d blocks found in xmlReaderForDoc",
30224                    xmlMemBlocks() - mem_base);
30225             test_ret++;
30226             printf(" %d", n_cur);
30227             printf(" %d", n_URL);
30228             printf(" %d", n_encoding);
30229             printf(" %d", n_options);
30230             printf("\n");
30231         }
30232     }
30233     }
30234     }
30235     }
30236     function_tests++;
30237 #endif
30238
30239     return(test_ret);
30240 }
30241
30242
30243 static int
30244 test_xmlReaderForFile(void) {
30245     int test_ret = 0;
30246
30247 #if defined(LIBXML_READER_ENABLED)
30248     int mem_base;
30249     xmlTextReaderPtr ret_val;
30250     const char * filename; /* a file or URL */
30251     int n_filename;
30252     char * encoding; /* the document encoding, or NULL */
30253     int n_encoding;
30254     int options; /* a combination of xmlParserOption */
30255     int n_options;
30256
30257     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
30258     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30259     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30260         mem_base = xmlMemBlocks();
30261         filename = gen_filepath(n_filename, 0);
30262         encoding = gen_const_char_ptr(n_encoding, 1);
30263         options = gen_parseroptions(n_options, 2);
30264
30265         ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
30266         desret_xmlTextReaderPtr(ret_val);
30267         call_tests++;
30268         des_filepath(n_filename, filename, 0);
30269         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
30270         des_parseroptions(n_options, options, 2);
30271         xmlResetLastError();
30272         if (mem_base != xmlMemBlocks()) {
30273             printf("Leak of %d blocks found in xmlReaderForFile",
30274                    xmlMemBlocks() - mem_base);
30275             test_ret++;
30276             printf(" %d", n_filename);
30277             printf(" %d", n_encoding);
30278             printf(" %d", n_options);
30279             printf("\n");
30280         }
30281     }
30282     }
30283     }
30284     function_tests++;
30285 #endif
30286
30287     return(test_ret);
30288 }
30289
30290
30291 static int
30292 test_xmlReaderForMemory(void) {
30293     int test_ret = 0;
30294
30295 #if defined(LIBXML_READER_ENABLED)
30296     int mem_base;
30297     xmlTextReaderPtr ret_val;
30298     char * buffer; /* a pointer to a char array */
30299     int n_buffer;
30300     int size; /* the size of the array */
30301     int n_size;
30302     const char * URL; /* the base URL to use for the document */
30303     int n_URL;
30304     char * encoding; /* the document encoding, or NULL */
30305     int n_encoding;
30306     int options; /* a combination of xmlParserOption */
30307     int n_options;
30308
30309     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30310     for (n_size = 0;n_size < gen_nb_int;n_size++) {
30311     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30312     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30313     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30314         mem_base = xmlMemBlocks();
30315         buffer = gen_const_char_ptr(n_buffer, 0);
30316         size = gen_int(n_size, 1);
30317         URL = gen_filepath(n_URL, 2);
30318         encoding = gen_const_char_ptr(n_encoding, 3);
30319         options = gen_parseroptions(n_options, 4);
30320         if ((buffer != NULL) &&
30321             (size > (int) strlen((const char *) buffer) + 1))
30322             continue;
30323
30324         ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
30325         desret_xmlTextReaderPtr(ret_val);
30326         call_tests++;
30327         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
30328         des_int(n_size, size, 1);
30329         des_filepath(n_URL, URL, 2);
30330         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
30331         des_parseroptions(n_options, options, 4);
30332         xmlResetLastError();
30333         if (mem_base != xmlMemBlocks()) {
30334             printf("Leak of %d blocks found in xmlReaderForMemory",
30335                    xmlMemBlocks() - mem_base);
30336             test_ret++;
30337             printf(" %d", n_buffer);
30338             printf(" %d", n_size);
30339             printf(" %d", n_URL);
30340             printf(" %d", n_encoding);
30341             printf(" %d", n_options);
30342             printf("\n");
30343         }
30344     }
30345     }
30346     }
30347     }
30348     }
30349     function_tests++;
30350 #endif
30351
30352     return(test_ret);
30353 }
30354
30355
30356 static int
30357 test_xmlReaderNewDoc(void) {
30358     int test_ret = 0;
30359
30360 #if defined(LIBXML_READER_ENABLED)
30361     int mem_base;
30362     int ret_val;
30363     xmlTextReaderPtr reader; /* an XML reader */
30364     int n_reader;
30365     xmlChar * cur; /* a pointer to a zero terminated string */
30366     int n_cur;
30367     const char * URL; /* the base URL to use for the document */
30368     int n_URL;
30369     char * encoding; /* the document encoding, or NULL */
30370     int n_encoding;
30371     int options; /* a combination of xmlParserOption */
30372     int n_options;
30373
30374     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30375     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
30376     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30377     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30378     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30379         mem_base = xmlMemBlocks();
30380         reader = gen_xmlTextReaderPtr(n_reader, 0);
30381         cur = gen_const_xmlChar_ptr(n_cur, 1);
30382         URL = gen_filepath(n_URL, 2);
30383         encoding = gen_const_char_ptr(n_encoding, 3);
30384         options = gen_parseroptions(n_options, 4);
30385
30386         ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
30387         desret_int(ret_val);
30388         call_tests++;
30389         des_xmlTextReaderPtr(n_reader, reader, 0);
30390         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
30391         des_filepath(n_URL, URL, 2);
30392         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
30393         des_parseroptions(n_options, options, 4);
30394         xmlResetLastError();
30395         if (mem_base != xmlMemBlocks()) {
30396             printf("Leak of %d blocks found in xmlReaderNewDoc",
30397                    xmlMemBlocks() - mem_base);
30398             test_ret++;
30399             printf(" %d", n_reader);
30400             printf(" %d", n_cur);
30401             printf(" %d", n_URL);
30402             printf(" %d", n_encoding);
30403             printf(" %d", n_options);
30404             printf("\n");
30405         }
30406     }
30407     }
30408     }
30409     }
30410     }
30411     function_tests++;
30412 #endif
30413
30414     return(test_ret);
30415 }
30416
30417
30418 static int
30419 test_xmlReaderNewFile(void) {
30420     int test_ret = 0;
30421
30422 #if defined(LIBXML_READER_ENABLED)
30423     int mem_base;
30424     int ret_val;
30425     xmlTextReaderPtr reader; /* an XML reader */
30426     int n_reader;
30427     const char * filename; /* a file or URL */
30428     int n_filename;
30429     char * encoding; /* the document encoding, or NULL */
30430     int n_encoding;
30431     int options; /* a combination of xmlParserOption */
30432     int n_options;
30433
30434     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30435     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
30436     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30437     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30438         mem_base = xmlMemBlocks();
30439         reader = gen_xmlTextReaderPtr(n_reader, 0);
30440         filename = gen_filepath(n_filename, 1);
30441         encoding = gen_const_char_ptr(n_encoding, 2);
30442         options = gen_parseroptions(n_options, 3);
30443
30444         ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
30445         desret_int(ret_val);
30446         call_tests++;
30447         des_xmlTextReaderPtr(n_reader, reader, 0);
30448         des_filepath(n_filename, filename, 1);
30449         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30450         des_parseroptions(n_options, options, 3);
30451         xmlResetLastError();
30452         if (mem_base != xmlMemBlocks()) {
30453             printf("Leak of %d blocks found in xmlReaderNewFile",
30454                    xmlMemBlocks() - mem_base);
30455             test_ret++;
30456             printf(" %d", n_reader);
30457             printf(" %d", n_filename);
30458             printf(" %d", n_encoding);
30459             printf(" %d", n_options);
30460             printf("\n");
30461         }
30462     }
30463     }
30464     }
30465     }
30466     function_tests++;
30467 #endif
30468
30469     return(test_ret);
30470 }
30471
30472
30473 static int
30474 test_xmlReaderNewMemory(void) {
30475     int test_ret = 0;
30476
30477 #if defined(LIBXML_READER_ENABLED)
30478     int mem_base;
30479     int ret_val;
30480     xmlTextReaderPtr reader; /* an XML reader */
30481     int n_reader;
30482     char * buffer; /* a pointer to a char array */
30483     int n_buffer;
30484     int size; /* the size of the array */
30485     int n_size;
30486     const char * URL; /* the base URL to use for the document */
30487     int n_URL;
30488     char * encoding; /* the document encoding, or NULL */
30489     int n_encoding;
30490     int options; /* a combination of xmlParserOption */
30491     int n_options;
30492
30493     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30494     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30495     for (n_size = 0;n_size < gen_nb_int;n_size++) {
30496     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30497     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30498     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30499         mem_base = xmlMemBlocks();
30500         reader = gen_xmlTextReaderPtr(n_reader, 0);
30501         buffer = gen_const_char_ptr(n_buffer, 1);
30502         size = gen_int(n_size, 2);
30503         URL = gen_filepath(n_URL, 3);
30504         encoding = gen_const_char_ptr(n_encoding, 4);
30505         options = gen_parseroptions(n_options, 5);
30506         if ((buffer != NULL) &&
30507             (size > (int) strlen((const char *) buffer) + 1))
30508             continue;
30509
30510         ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
30511         desret_int(ret_val);
30512         call_tests++;
30513         des_xmlTextReaderPtr(n_reader, reader, 0);
30514         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
30515         des_int(n_size, size, 2);
30516         des_filepath(n_URL, URL, 3);
30517         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
30518         des_parseroptions(n_options, options, 5);
30519         xmlResetLastError();
30520         if (mem_base != xmlMemBlocks()) {
30521             printf("Leak of %d blocks found in xmlReaderNewMemory",
30522                    xmlMemBlocks() - mem_base);
30523             test_ret++;
30524             printf(" %d", n_reader);
30525             printf(" %d", n_buffer);
30526             printf(" %d", n_size);
30527             printf(" %d", n_URL);
30528             printf(" %d", n_encoding);
30529             printf(" %d", n_options);
30530             printf("\n");
30531         }
30532     }
30533     }
30534     }
30535     }
30536     }
30537     }
30538     function_tests++;
30539 #endif
30540
30541     return(test_ret);
30542 }
30543
30544
30545 static int
30546 test_xmlReaderNewWalker(void) {
30547     int test_ret = 0;
30548
30549 #if defined(LIBXML_READER_ENABLED)
30550     int mem_base;
30551     int ret_val;
30552     xmlTextReaderPtr reader; /* an XML reader */
30553     int n_reader;
30554     xmlDocPtr doc; /* a preparsed document */
30555     int n_doc;
30556
30557     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30558     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30559         mem_base = xmlMemBlocks();
30560         reader = gen_xmlTextReaderPtr(n_reader, 0);
30561         doc = gen_xmlDocPtr(n_doc, 1);
30562
30563         ret_val = xmlReaderNewWalker(reader, doc);
30564         desret_int(ret_val);
30565         call_tests++;
30566         des_xmlTextReaderPtr(n_reader, reader, 0);
30567         des_xmlDocPtr(n_doc, doc, 1);
30568         xmlResetLastError();
30569         if (mem_base != xmlMemBlocks()) {
30570             printf("Leak of %d blocks found in xmlReaderNewWalker",
30571                    xmlMemBlocks() - mem_base);
30572             test_ret++;
30573             printf(" %d", n_reader);
30574             printf(" %d", n_doc);
30575             printf("\n");
30576         }
30577     }
30578     }
30579     function_tests++;
30580 #endif
30581
30582     return(test_ret);
30583 }
30584
30585
30586 static int
30587 test_xmlReaderWalker(void) {
30588     int test_ret = 0;
30589
30590 #if defined(LIBXML_READER_ENABLED)
30591     int mem_base;
30592     xmlTextReaderPtr ret_val;
30593     xmlDocPtr doc; /* a preparsed document */
30594     int n_doc;
30595
30596     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30597         mem_base = xmlMemBlocks();
30598         doc = gen_xmlDocPtr(n_doc, 0);
30599
30600         ret_val = xmlReaderWalker(doc);
30601         desret_xmlTextReaderPtr(ret_val);
30602         call_tests++;
30603         des_xmlDocPtr(n_doc, doc, 0);
30604         xmlResetLastError();
30605         if (mem_base != xmlMemBlocks()) {
30606             printf("Leak of %d blocks found in xmlReaderWalker",
30607                    xmlMemBlocks() - mem_base);
30608             test_ret++;
30609             printf(" %d", n_doc);
30610             printf("\n");
30611         }
30612     }
30613     function_tests++;
30614 #endif
30615
30616     return(test_ret);
30617 }
30618
30619
30620 static int
30621 test_xmlTextReaderAttributeCount(void) {
30622     int test_ret = 0;
30623
30624 #if defined(LIBXML_READER_ENABLED)
30625     int mem_base;
30626     int ret_val;
30627     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30628     int n_reader;
30629
30630     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30631         mem_base = xmlMemBlocks();
30632         reader = gen_xmlTextReaderPtr(n_reader, 0);
30633
30634         ret_val = xmlTextReaderAttributeCount(reader);
30635         desret_int(ret_val);
30636         call_tests++;
30637         des_xmlTextReaderPtr(n_reader, reader, 0);
30638         xmlResetLastError();
30639         if (mem_base != xmlMemBlocks()) {
30640             printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
30641                    xmlMemBlocks() - mem_base);
30642             test_ret++;
30643             printf(" %d", n_reader);
30644             printf("\n");
30645         }
30646     }
30647     function_tests++;
30648 #endif
30649
30650     return(test_ret);
30651 }
30652
30653
30654 static int
30655 test_xmlTextReaderBaseUri(void) {
30656     int test_ret = 0;
30657
30658 #if defined(LIBXML_READER_ENABLED)
30659     int mem_base;
30660     xmlChar * ret_val;
30661     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30662     int n_reader;
30663
30664     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30665         mem_base = xmlMemBlocks();
30666         reader = gen_xmlTextReaderPtr(n_reader, 0);
30667
30668         ret_val = xmlTextReaderBaseUri(reader);
30669         desret_xmlChar_ptr(ret_val);
30670         call_tests++;
30671         des_xmlTextReaderPtr(n_reader, reader, 0);
30672         xmlResetLastError();
30673         if (mem_base != xmlMemBlocks()) {
30674             printf("Leak of %d blocks found in xmlTextReaderBaseUri",
30675                    xmlMemBlocks() - mem_base);
30676             test_ret++;
30677             printf(" %d", n_reader);
30678             printf("\n");
30679         }
30680     }
30681     function_tests++;
30682 #endif
30683
30684     return(test_ret);
30685 }
30686
30687
30688 static int
30689 test_xmlTextReaderByteConsumed(void) {
30690     int test_ret = 0;
30691
30692 #if defined(LIBXML_READER_ENABLED)
30693     int mem_base;
30694     long ret_val;
30695     xmlTextReaderPtr reader; /* an XML reader */
30696     int n_reader;
30697
30698     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30699         mem_base = xmlMemBlocks();
30700         reader = gen_xmlTextReaderPtr(n_reader, 0);
30701
30702         ret_val = xmlTextReaderByteConsumed(reader);
30703         desret_long(ret_val);
30704         call_tests++;
30705         des_xmlTextReaderPtr(n_reader, reader, 0);
30706         xmlResetLastError();
30707         if (mem_base != xmlMemBlocks()) {
30708             printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
30709                    xmlMemBlocks() - mem_base);
30710             test_ret++;
30711             printf(" %d", n_reader);
30712             printf("\n");
30713         }
30714     }
30715     function_tests++;
30716 #endif
30717
30718     return(test_ret);
30719 }
30720
30721
30722 static int
30723 test_xmlTextReaderClose(void) {
30724     int test_ret = 0;
30725
30726 #if defined(LIBXML_READER_ENABLED)
30727     int mem_base;
30728     int ret_val;
30729     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30730     int n_reader;
30731
30732     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30733         mem_base = xmlMemBlocks();
30734         reader = gen_xmlTextReaderPtr(n_reader, 0);
30735
30736         ret_val = xmlTextReaderClose(reader);
30737         desret_int(ret_val);
30738         call_tests++;
30739         des_xmlTextReaderPtr(n_reader, reader, 0);
30740         xmlResetLastError();
30741         if (mem_base != xmlMemBlocks()) {
30742             printf("Leak of %d blocks found in xmlTextReaderClose",
30743                    xmlMemBlocks() - mem_base);
30744             test_ret++;
30745             printf(" %d", n_reader);
30746             printf("\n");
30747         }
30748     }
30749     function_tests++;
30750 #endif
30751
30752     return(test_ret);
30753 }
30754
30755
30756 static int
30757 test_xmlTextReaderConstBaseUri(void) {
30758     int test_ret = 0;
30759
30760 #if defined(LIBXML_READER_ENABLED)
30761     int mem_base;
30762     const xmlChar * ret_val;
30763     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30764     int n_reader;
30765
30766     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30767         mem_base = xmlMemBlocks();
30768         reader = gen_xmlTextReaderPtr(n_reader, 0);
30769
30770         ret_val = xmlTextReaderConstBaseUri(reader);
30771         desret_const_xmlChar_ptr(ret_val);
30772         call_tests++;
30773         des_xmlTextReaderPtr(n_reader, reader, 0);
30774         xmlResetLastError();
30775         if (mem_base != xmlMemBlocks()) {
30776             printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
30777                    xmlMemBlocks() - mem_base);
30778             test_ret++;
30779             printf(" %d", n_reader);
30780             printf("\n");
30781         }
30782     }
30783     function_tests++;
30784 #endif
30785
30786     return(test_ret);
30787 }
30788
30789
30790 static int
30791 test_xmlTextReaderConstEncoding(void) {
30792     int test_ret = 0;
30793
30794 #if defined(LIBXML_READER_ENABLED)
30795     int mem_base;
30796     const xmlChar * ret_val;
30797     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30798     int n_reader;
30799
30800     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30801         mem_base = xmlMemBlocks();
30802         reader = gen_xmlTextReaderPtr(n_reader, 0);
30803
30804         ret_val = xmlTextReaderConstEncoding(reader);
30805         desret_const_xmlChar_ptr(ret_val);
30806         call_tests++;
30807         des_xmlTextReaderPtr(n_reader, reader, 0);
30808         xmlResetLastError();
30809         if (mem_base != xmlMemBlocks()) {
30810             printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
30811                    xmlMemBlocks() - mem_base);
30812             test_ret++;
30813             printf(" %d", n_reader);
30814             printf("\n");
30815         }
30816     }
30817     function_tests++;
30818 #endif
30819
30820     return(test_ret);
30821 }
30822
30823
30824 static int
30825 test_xmlTextReaderConstLocalName(void) {
30826     int test_ret = 0;
30827
30828 #if defined(LIBXML_READER_ENABLED)
30829     int mem_base;
30830     const xmlChar * ret_val;
30831     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30832     int n_reader;
30833
30834     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30835         mem_base = xmlMemBlocks();
30836         reader = gen_xmlTextReaderPtr(n_reader, 0);
30837
30838         ret_val = xmlTextReaderConstLocalName(reader);
30839         desret_const_xmlChar_ptr(ret_val);
30840         call_tests++;
30841         des_xmlTextReaderPtr(n_reader, reader, 0);
30842         xmlResetLastError();
30843         if (mem_base != xmlMemBlocks()) {
30844             printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
30845                    xmlMemBlocks() - mem_base);
30846             test_ret++;
30847             printf(" %d", n_reader);
30848             printf("\n");
30849         }
30850     }
30851     function_tests++;
30852 #endif
30853
30854     return(test_ret);
30855 }
30856
30857
30858 static int
30859 test_xmlTextReaderConstName(void) {
30860     int test_ret = 0;
30861
30862 #if defined(LIBXML_READER_ENABLED)
30863     int mem_base;
30864     const xmlChar * ret_val;
30865     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30866     int n_reader;
30867
30868     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30869         mem_base = xmlMemBlocks();
30870         reader = gen_xmlTextReaderPtr(n_reader, 0);
30871
30872         ret_val = xmlTextReaderConstName(reader);
30873         desret_const_xmlChar_ptr(ret_val);
30874         call_tests++;
30875         des_xmlTextReaderPtr(n_reader, reader, 0);
30876         xmlResetLastError();
30877         if (mem_base != xmlMemBlocks()) {
30878             printf("Leak of %d blocks found in xmlTextReaderConstName",
30879                    xmlMemBlocks() - mem_base);
30880             test_ret++;
30881             printf(" %d", n_reader);
30882             printf("\n");
30883         }
30884     }
30885     function_tests++;
30886 #endif
30887
30888     return(test_ret);
30889 }
30890
30891
30892 static int
30893 test_xmlTextReaderConstNamespaceUri(void) {
30894     int test_ret = 0;
30895
30896 #if defined(LIBXML_READER_ENABLED)
30897     int mem_base;
30898     const xmlChar * ret_val;
30899     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30900     int n_reader;
30901
30902     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30903         mem_base = xmlMemBlocks();
30904         reader = gen_xmlTextReaderPtr(n_reader, 0);
30905
30906         ret_val = xmlTextReaderConstNamespaceUri(reader);
30907         desret_const_xmlChar_ptr(ret_val);
30908         call_tests++;
30909         des_xmlTextReaderPtr(n_reader, reader, 0);
30910         xmlResetLastError();
30911         if (mem_base != xmlMemBlocks()) {
30912             printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
30913                    xmlMemBlocks() - mem_base);
30914             test_ret++;
30915             printf(" %d", n_reader);
30916             printf("\n");
30917         }
30918     }
30919     function_tests++;
30920 #endif
30921
30922     return(test_ret);
30923 }
30924
30925
30926 static int
30927 test_xmlTextReaderConstPrefix(void) {
30928     int test_ret = 0;
30929
30930 #if defined(LIBXML_READER_ENABLED)
30931     int mem_base;
30932     const xmlChar * ret_val;
30933     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30934     int n_reader;
30935
30936     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30937         mem_base = xmlMemBlocks();
30938         reader = gen_xmlTextReaderPtr(n_reader, 0);
30939
30940         ret_val = xmlTextReaderConstPrefix(reader);
30941         desret_const_xmlChar_ptr(ret_val);
30942         call_tests++;
30943         des_xmlTextReaderPtr(n_reader, reader, 0);
30944         xmlResetLastError();
30945         if (mem_base != xmlMemBlocks()) {
30946             printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
30947                    xmlMemBlocks() - mem_base);
30948             test_ret++;
30949             printf(" %d", n_reader);
30950             printf("\n");
30951         }
30952     }
30953     function_tests++;
30954 #endif
30955
30956     return(test_ret);
30957 }
30958
30959
30960 static int
30961 test_xmlTextReaderConstString(void) {
30962     int test_ret = 0;
30963
30964 #if defined(LIBXML_READER_ENABLED)
30965     int mem_base;
30966     const xmlChar * ret_val;
30967     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30968     int n_reader;
30969     xmlChar * str; /* the string to intern. */
30970     int n_str;
30971
30972     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30973     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
30974         mem_base = xmlMemBlocks();
30975         reader = gen_xmlTextReaderPtr(n_reader, 0);
30976         str = gen_const_xmlChar_ptr(n_str, 1);
30977
30978         ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
30979         desret_const_xmlChar_ptr(ret_val);
30980         call_tests++;
30981         des_xmlTextReaderPtr(n_reader, reader, 0);
30982         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
30983         xmlResetLastError();
30984         if (mem_base != xmlMemBlocks()) {
30985             printf("Leak of %d blocks found in xmlTextReaderConstString",
30986                    xmlMemBlocks() - mem_base);
30987             test_ret++;
30988             printf(" %d", n_reader);
30989             printf(" %d", n_str);
30990             printf("\n");
30991         }
30992     }
30993     }
30994     function_tests++;
30995 #endif
30996
30997     return(test_ret);
30998 }
30999
31000
31001 static int
31002 test_xmlTextReaderConstValue(void) {
31003     int test_ret = 0;
31004
31005 #if defined(LIBXML_READER_ENABLED)
31006     int mem_base;
31007     const xmlChar * ret_val;
31008     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31009     int n_reader;
31010
31011     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31012         mem_base = xmlMemBlocks();
31013         reader = gen_xmlTextReaderPtr(n_reader, 0);
31014
31015         ret_val = xmlTextReaderConstValue(reader);
31016         desret_const_xmlChar_ptr(ret_val);
31017         call_tests++;
31018         des_xmlTextReaderPtr(n_reader, reader, 0);
31019         xmlResetLastError();
31020         if (mem_base != xmlMemBlocks()) {
31021             printf("Leak of %d blocks found in xmlTextReaderConstValue",
31022                    xmlMemBlocks() - mem_base);
31023             test_ret++;
31024             printf(" %d", n_reader);
31025             printf("\n");
31026         }
31027     }
31028     function_tests++;
31029 #endif
31030
31031     return(test_ret);
31032 }
31033
31034
31035 static int
31036 test_xmlTextReaderConstXmlLang(void) {
31037     int test_ret = 0;
31038
31039 #if defined(LIBXML_READER_ENABLED)
31040     int mem_base;
31041     const xmlChar * ret_val;
31042     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31043     int n_reader;
31044
31045     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31046         mem_base = xmlMemBlocks();
31047         reader = gen_xmlTextReaderPtr(n_reader, 0);
31048
31049         ret_val = xmlTextReaderConstXmlLang(reader);
31050         desret_const_xmlChar_ptr(ret_val);
31051         call_tests++;
31052         des_xmlTextReaderPtr(n_reader, reader, 0);
31053         xmlResetLastError();
31054         if (mem_base != xmlMemBlocks()) {
31055             printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
31056                    xmlMemBlocks() - mem_base);
31057             test_ret++;
31058             printf(" %d", n_reader);
31059             printf("\n");
31060         }
31061     }
31062     function_tests++;
31063 #endif
31064
31065     return(test_ret);
31066 }
31067
31068
31069 static int
31070 test_xmlTextReaderConstXmlVersion(void) {
31071     int test_ret = 0;
31072
31073 #if defined(LIBXML_READER_ENABLED)
31074     int mem_base;
31075     const xmlChar * ret_val;
31076     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31077     int n_reader;
31078
31079     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31080         mem_base = xmlMemBlocks();
31081         reader = gen_xmlTextReaderPtr(n_reader, 0);
31082
31083         ret_val = xmlTextReaderConstXmlVersion(reader);
31084         desret_const_xmlChar_ptr(ret_val);
31085         call_tests++;
31086         des_xmlTextReaderPtr(n_reader, reader, 0);
31087         xmlResetLastError();
31088         if (mem_base != xmlMemBlocks()) {
31089             printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
31090                    xmlMemBlocks() - mem_base);
31091             test_ret++;
31092             printf(" %d", n_reader);
31093             printf("\n");
31094         }
31095     }
31096     function_tests++;
31097 #endif
31098
31099     return(test_ret);
31100 }
31101
31102
31103 static int
31104 test_xmlTextReaderCurrentDoc(void) {
31105     int test_ret = 0;
31106
31107 #if defined(LIBXML_READER_ENABLED)
31108     int mem_base;
31109     xmlDocPtr ret_val;
31110     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31111     int n_reader;
31112
31113     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31114         mem_base = xmlMemBlocks();
31115         reader = gen_xmlTextReaderPtr(n_reader, 0);
31116
31117         ret_val = xmlTextReaderCurrentDoc(reader);
31118         desret_xmlDocPtr(ret_val);
31119         call_tests++;
31120         des_xmlTextReaderPtr(n_reader, reader, 0);
31121         xmlResetLastError();
31122         if (mem_base != xmlMemBlocks()) {
31123             printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
31124                    xmlMemBlocks() - mem_base);
31125             test_ret++;
31126             printf(" %d", n_reader);
31127             printf("\n");
31128         }
31129     }
31130     function_tests++;
31131 #endif
31132
31133     return(test_ret);
31134 }
31135
31136
31137 static int
31138 test_xmlTextReaderCurrentNode(void) {
31139     int test_ret = 0;
31140
31141 #if defined(LIBXML_READER_ENABLED)
31142     int mem_base;
31143     xmlNodePtr ret_val;
31144     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31145     int n_reader;
31146
31147     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31148         mem_base = xmlMemBlocks();
31149         reader = gen_xmlTextReaderPtr(n_reader, 0);
31150
31151         ret_val = xmlTextReaderCurrentNode(reader);
31152         desret_xmlNodePtr(ret_val);
31153         call_tests++;
31154         des_xmlTextReaderPtr(n_reader, reader, 0);
31155         xmlResetLastError();
31156         if (mem_base != xmlMemBlocks()) {
31157             printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
31158                    xmlMemBlocks() - mem_base);
31159             test_ret++;
31160             printf(" %d", n_reader);
31161             printf("\n");
31162         }
31163     }
31164     function_tests++;
31165 #endif
31166
31167     return(test_ret);
31168 }
31169
31170
31171 static int
31172 test_xmlTextReaderDepth(void) {
31173     int test_ret = 0;
31174
31175 #if defined(LIBXML_READER_ENABLED)
31176     int mem_base;
31177     int ret_val;
31178     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31179     int n_reader;
31180
31181     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31182         mem_base = xmlMemBlocks();
31183         reader = gen_xmlTextReaderPtr(n_reader, 0);
31184
31185         ret_val = xmlTextReaderDepth(reader);
31186         desret_int(ret_val);
31187         call_tests++;
31188         des_xmlTextReaderPtr(n_reader, reader, 0);
31189         xmlResetLastError();
31190         if (mem_base != xmlMemBlocks()) {
31191             printf("Leak of %d blocks found in xmlTextReaderDepth",
31192                    xmlMemBlocks() - mem_base);
31193             test_ret++;
31194             printf(" %d", n_reader);
31195             printf("\n");
31196         }
31197     }
31198     function_tests++;
31199 #endif
31200
31201     return(test_ret);
31202 }
31203
31204
31205 static int
31206 test_xmlTextReaderExpand(void) {
31207     int test_ret = 0;
31208
31209 #if defined(LIBXML_READER_ENABLED)
31210     int mem_base;
31211     xmlNodePtr ret_val;
31212     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31213     int n_reader;
31214
31215     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31216         mem_base = xmlMemBlocks();
31217         reader = gen_xmlTextReaderPtr(n_reader, 0);
31218
31219         ret_val = xmlTextReaderExpand(reader);
31220         desret_xmlNodePtr(ret_val);
31221         call_tests++;
31222         des_xmlTextReaderPtr(n_reader, reader, 0);
31223         xmlResetLastError();
31224         if (mem_base != xmlMemBlocks()) {
31225             printf("Leak of %d blocks found in xmlTextReaderExpand",
31226                    xmlMemBlocks() - mem_base);
31227             test_ret++;
31228             printf(" %d", n_reader);
31229             printf("\n");
31230         }
31231     }
31232     function_tests++;
31233 #endif
31234
31235     return(test_ret);
31236 }
31237
31238
31239 static int
31240 test_xmlTextReaderGetAttribute(void) {
31241     int test_ret = 0;
31242
31243 #if defined(LIBXML_READER_ENABLED)
31244     int mem_base;
31245     xmlChar * ret_val;
31246     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31247     int n_reader;
31248     xmlChar * name; /* the qualified name of the attribute. */
31249     int n_name;
31250
31251     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31252     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31253         mem_base = xmlMemBlocks();
31254         reader = gen_xmlTextReaderPtr(n_reader, 0);
31255         name = gen_const_xmlChar_ptr(n_name, 1);
31256
31257         ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
31258         desret_xmlChar_ptr(ret_val);
31259         call_tests++;
31260         des_xmlTextReaderPtr(n_reader, reader, 0);
31261         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31262         xmlResetLastError();
31263         if (mem_base != xmlMemBlocks()) {
31264             printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
31265                    xmlMemBlocks() - mem_base);
31266             test_ret++;
31267             printf(" %d", n_reader);
31268             printf(" %d", n_name);
31269             printf("\n");
31270         }
31271     }
31272     }
31273     function_tests++;
31274 #endif
31275
31276     return(test_ret);
31277 }
31278
31279
31280 static int
31281 test_xmlTextReaderGetAttributeNo(void) {
31282     int test_ret = 0;
31283
31284 #if defined(LIBXML_READER_ENABLED)
31285     int mem_base;
31286     xmlChar * ret_val;
31287     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31288     int n_reader;
31289     int no; /* the zero-based index of the attribute relative to the containing element */
31290     int n_no;
31291
31292     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31293     for (n_no = 0;n_no < gen_nb_int;n_no++) {
31294         mem_base = xmlMemBlocks();
31295         reader = gen_xmlTextReaderPtr(n_reader, 0);
31296         no = gen_int(n_no, 1);
31297
31298         ret_val = xmlTextReaderGetAttributeNo(reader, no);
31299         desret_xmlChar_ptr(ret_val);
31300         call_tests++;
31301         des_xmlTextReaderPtr(n_reader, reader, 0);
31302         des_int(n_no, no, 1);
31303         xmlResetLastError();
31304         if (mem_base != xmlMemBlocks()) {
31305             printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
31306                    xmlMemBlocks() - mem_base);
31307             test_ret++;
31308             printf(" %d", n_reader);
31309             printf(" %d", n_no);
31310             printf("\n");
31311         }
31312     }
31313     }
31314     function_tests++;
31315 #endif
31316
31317     return(test_ret);
31318 }
31319
31320
31321 static int
31322 test_xmlTextReaderGetAttributeNs(void) {
31323     int test_ret = 0;
31324
31325 #if defined(LIBXML_READER_ENABLED)
31326     int mem_base;
31327     xmlChar * ret_val;
31328     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31329     int n_reader;
31330     xmlChar * localName; /* the local name of the attribute. */
31331     int n_localName;
31332     xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31333     int n_namespaceURI;
31334
31335     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31336     for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31337     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31338         mem_base = xmlMemBlocks();
31339         reader = gen_xmlTextReaderPtr(n_reader, 0);
31340         localName = gen_const_xmlChar_ptr(n_localName, 1);
31341         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31342
31343         ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31344         desret_xmlChar_ptr(ret_val);
31345         call_tests++;
31346         des_xmlTextReaderPtr(n_reader, reader, 0);
31347         des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31348         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31349         xmlResetLastError();
31350         if (mem_base != xmlMemBlocks()) {
31351             printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
31352                    xmlMemBlocks() - mem_base);
31353             test_ret++;
31354             printf(" %d", n_reader);
31355             printf(" %d", n_localName);
31356             printf(" %d", n_namespaceURI);
31357             printf("\n");
31358         }
31359     }
31360     }
31361     }
31362     function_tests++;
31363 #endif
31364
31365     return(test_ret);
31366 }
31367
31368 #ifdef LIBXML_READER_ENABLED
31369
31370 #define gen_nb_xmlTextReaderErrorFunc_ptr 1
31371 static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31372     return(NULL);
31373 }
31374 static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31375 }
31376 #endif
31377
31378
31379 static int
31380 test_xmlTextReaderGetErrorHandler(void) {
31381     int test_ret = 0;
31382
31383 #if defined(LIBXML_READER_ENABLED)
31384     int mem_base;
31385     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31386     int n_reader;
31387     xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
31388     int n_f;
31389     void ** arg; /* a user argument */
31390     int n_arg;
31391
31392     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31393     for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
31394     for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
31395         mem_base = xmlMemBlocks();
31396         reader = gen_xmlTextReaderPtr(n_reader, 0);
31397         f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
31398         arg = gen_void_ptr_ptr(n_arg, 2);
31399
31400         xmlTextReaderGetErrorHandler(reader, f, arg);
31401         call_tests++;
31402         des_xmlTextReaderPtr(n_reader, reader, 0);
31403         des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
31404         des_void_ptr_ptr(n_arg, arg, 2);
31405         xmlResetLastError();
31406         if (mem_base != xmlMemBlocks()) {
31407             printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
31408                    xmlMemBlocks() - mem_base);
31409             test_ret++;
31410             printf(" %d", n_reader);
31411             printf(" %d", n_f);
31412             printf(" %d", n_arg);
31413             printf("\n");
31414         }
31415     }
31416     }
31417     }
31418     function_tests++;
31419 #endif
31420
31421     return(test_ret);
31422 }
31423
31424
31425 static int
31426 test_xmlTextReaderGetParserColumnNumber(void) {
31427     int test_ret = 0;
31428
31429 #if defined(LIBXML_READER_ENABLED)
31430     int mem_base;
31431     int ret_val;
31432     xmlTextReaderPtr reader; /* the user data (XML reader context) */
31433     int n_reader;
31434
31435     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31436         mem_base = xmlMemBlocks();
31437         reader = gen_xmlTextReaderPtr(n_reader, 0);
31438
31439         ret_val = xmlTextReaderGetParserColumnNumber(reader);
31440         desret_int(ret_val);
31441         call_tests++;
31442         des_xmlTextReaderPtr(n_reader, reader, 0);
31443         xmlResetLastError();
31444         if (mem_base != xmlMemBlocks()) {
31445             printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
31446                    xmlMemBlocks() - mem_base);
31447             test_ret++;
31448             printf(" %d", n_reader);
31449             printf("\n");
31450         }
31451     }
31452     function_tests++;
31453 #endif
31454
31455     return(test_ret);
31456 }
31457
31458
31459 static int
31460 test_xmlTextReaderGetParserLineNumber(void) {
31461     int test_ret = 0;
31462
31463 #if defined(LIBXML_READER_ENABLED)
31464     int mem_base;
31465     int ret_val;
31466     xmlTextReaderPtr reader; /* the user data (XML reader context) */
31467     int n_reader;
31468
31469     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31470         mem_base = xmlMemBlocks();
31471         reader = gen_xmlTextReaderPtr(n_reader, 0);
31472
31473         ret_val = xmlTextReaderGetParserLineNumber(reader);
31474         desret_int(ret_val);
31475         call_tests++;
31476         des_xmlTextReaderPtr(n_reader, reader, 0);
31477         xmlResetLastError();
31478         if (mem_base != xmlMemBlocks()) {
31479             printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
31480                    xmlMemBlocks() - mem_base);
31481             test_ret++;
31482             printf(" %d", n_reader);
31483             printf("\n");
31484         }
31485     }
31486     function_tests++;
31487 #endif
31488
31489     return(test_ret);
31490 }
31491
31492
31493 static int
31494 test_xmlTextReaderGetParserProp(void) {
31495     int test_ret = 0;
31496
31497 #if defined(LIBXML_READER_ENABLED)
31498     int mem_base;
31499     int ret_val;
31500     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31501     int n_reader;
31502     int prop; /* the xmlParserProperties to get */
31503     int n_prop;
31504
31505     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31506     for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
31507         mem_base = xmlMemBlocks();
31508         reader = gen_xmlTextReaderPtr(n_reader, 0);
31509         prop = gen_int(n_prop, 1);
31510
31511         ret_val = xmlTextReaderGetParserProp(reader, prop);
31512         desret_int(ret_val);
31513         call_tests++;
31514         des_xmlTextReaderPtr(n_reader, reader, 0);
31515         des_int(n_prop, prop, 1);
31516         xmlResetLastError();
31517         if (mem_base != xmlMemBlocks()) {
31518             printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
31519                    xmlMemBlocks() - mem_base);
31520             test_ret++;
31521             printf(" %d", n_reader);
31522             printf(" %d", n_prop);
31523             printf("\n");
31524         }
31525     }
31526     }
31527     function_tests++;
31528 #endif
31529
31530     return(test_ret);
31531 }
31532
31533
31534 static int
31535 test_xmlTextReaderGetRemainder(void) {
31536     int test_ret = 0;
31537
31538 #if defined(LIBXML_READER_ENABLED)
31539     int mem_base;
31540     xmlParserInputBufferPtr ret_val;
31541     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31542     int n_reader;
31543
31544     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31545         mem_base = xmlMemBlocks();
31546         reader = gen_xmlTextReaderPtr(n_reader, 0);
31547
31548         ret_val = xmlTextReaderGetRemainder(reader);
31549         desret_xmlParserInputBufferPtr(ret_val);
31550         call_tests++;
31551         des_xmlTextReaderPtr(n_reader, reader, 0);
31552         xmlResetLastError();
31553         if (mem_base != xmlMemBlocks()) {
31554             printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
31555                    xmlMemBlocks() - mem_base);
31556             test_ret++;
31557             printf(" %d", n_reader);
31558             printf("\n");
31559         }
31560     }
31561     function_tests++;
31562 #endif
31563
31564     return(test_ret);
31565 }
31566
31567
31568 static int
31569 test_xmlTextReaderHasAttributes(void) {
31570     int test_ret = 0;
31571
31572 #if defined(LIBXML_READER_ENABLED)
31573     int mem_base;
31574     int ret_val;
31575     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31576     int n_reader;
31577
31578     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31579         mem_base = xmlMemBlocks();
31580         reader = gen_xmlTextReaderPtr(n_reader, 0);
31581
31582         ret_val = xmlTextReaderHasAttributes(reader);
31583         desret_int(ret_val);
31584         call_tests++;
31585         des_xmlTextReaderPtr(n_reader, reader, 0);
31586         xmlResetLastError();
31587         if (mem_base != xmlMemBlocks()) {
31588             printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
31589                    xmlMemBlocks() - mem_base);
31590             test_ret++;
31591             printf(" %d", n_reader);
31592             printf("\n");
31593         }
31594     }
31595     function_tests++;
31596 #endif
31597
31598     return(test_ret);
31599 }
31600
31601
31602 static int
31603 test_xmlTextReaderHasValue(void) {
31604     int test_ret = 0;
31605
31606 #if defined(LIBXML_READER_ENABLED)
31607     int mem_base;
31608     int ret_val;
31609     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31610     int n_reader;
31611
31612     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31613         mem_base = xmlMemBlocks();
31614         reader = gen_xmlTextReaderPtr(n_reader, 0);
31615
31616         ret_val = xmlTextReaderHasValue(reader);
31617         desret_int(ret_val);
31618         call_tests++;
31619         des_xmlTextReaderPtr(n_reader, reader, 0);
31620         xmlResetLastError();
31621         if (mem_base != xmlMemBlocks()) {
31622             printf("Leak of %d blocks found in xmlTextReaderHasValue",
31623                    xmlMemBlocks() - mem_base);
31624             test_ret++;
31625             printf(" %d", n_reader);
31626             printf("\n");
31627         }
31628     }
31629     function_tests++;
31630 #endif
31631
31632     return(test_ret);
31633 }
31634
31635
31636 static int
31637 test_xmlTextReaderIsDefault(void) {
31638     int test_ret = 0;
31639
31640 #if defined(LIBXML_READER_ENABLED)
31641     int mem_base;
31642     int ret_val;
31643     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31644     int n_reader;
31645
31646     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31647         mem_base = xmlMemBlocks();
31648         reader = gen_xmlTextReaderPtr(n_reader, 0);
31649
31650         ret_val = xmlTextReaderIsDefault(reader);
31651         desret_int(ret_val);
31652         call_tests++;
31653         des_xmlTextReaderPtr(n_reader, reader, 0);
31654         xmlResetLastError();
31655         if (mem_base != xmlMemBlocks()) {
31656             printf("Leak of %d blocks found in xmlTextReaderIsDefault",
31657                    xmlMemBlocks() - mem_base);
31658             test_ret++;
31659             printf(" %d", n_reader);
31660             printf("\n");
31661         }
31662     }
31663     function_tests++;
31664 #endif
31665
31666     return(test_ret);
31667 }
31668
31669
31670 static int
31671 test_xmlTextReaderIsEmptyElement(void) {
31672     int test_ret = 0;
31673
31674 #if defined(LIBXML_READER_ENABLED)
31675     int mem_base;
31676     int ret_val;
31677     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31678     int n_reader;
31679
31680     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31681         mem_base = xmlMemBlocks();
31682         reader = gen_xmlTextReaderPtr(n_reader, 0);
31683
31684         ret_val = xmlTextReaderIsEmptyElement(reader);
31685         desret_int(ret_val);
31686         call_tests++;
31687         des_xmlTextReaderPtr(n_reader, reader, 0);
31688         xmlResetLastError();
31689         if (mem_base != xmlMemBlocks()) {
31690             printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
31691                    xmlMemBlocks() - mem_base);
31692             test_ret++;
31693             printf(" %d", n_reader);
31694             printf("\n");
31695         }
31696     }
31697     function_tests++;
31698 #endif
31699
31700     return(test_ret);
31701 }
31702
31703
31704 static int
31705 test_xmlTextReaderIsNamespaceDecl(void) {
31706     int test_ret = 0;
31707
31708 #if defined(LIBXML_READER_ENABLED)
31709     int mem_base;
31710     int ret_val;
31711     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31712     int n_reader;
31713
31714     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31715         mem_base = xmlMemBlocks();
31716         reader = gen_xmlTextReaderPtr(n_reader, 0);
31717
31718         ret_val = xmlTextReaderIsNamespaceDecl(reader);
31719         desret_int(ret_val);
31720         call_tests++;
31721         des_xmlTextReaderPtr(n_reader, reader, 0);
31722         xmlResetLastError();
31723         if (mem_base != xmlMemBlocks()) {
31724             printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
31725                    xmlMemBlocks() - mem_base);
31726             test_ret++;
31727             printf(" %d", n_reader);
31728             printf("\n");
31729         }
31730     }
31731     function_tests++;
31732 #endif
31733
31734     return(test_ret);
31735 }
31736
31737
31738 static int
31739 test_xmlTextReaderIsValid(void) {
31740     int test_ret = 0;
31741
31742 #if defined(LIBXML_READER_ENABLED)
31743     int mem_base;
31744     int ret_val;
31745     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31746     int n_reader;
31747
31748     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31749         mem_base = xmlMemBlocks();
31750         reader = gen_xmlTextReaderPtr(n_reader, 0);
31751
31752         ret_val = xmlTextReaderIsValid(reader);
31753         desret_int(ret_val);
31754         call_tests++;
31755         des_xmlTextReaderPtr(n_reader, reader, 0);
31756         xmlResetLastError();
31757         if (mem_base != xmlMemBlocks()) {
31758             printf("Leak of %d blocks found in xmlTextReaderIsValid",
31759                    xmlMemBlocks() - mem_base);
31760             test_ret++;
31761             printf(" %d", n_reader);
31762             printf("\n");
31763         }
31764     }
31765     function_tests++;
31766 #endif
31767
31768     return(test_ret);
31769 }
31770
31771
31772 static int
31773 test_xmlTextReaderLocalName(void) {
31774     int test_ret = 0;
31775
31776 #if defined(LIBXML_READER_ENABLED)
31777     int mem_base;
31778     xmlChar * ret_val;
31779     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31780     int n_reader;
31781
31782     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31783         mem_base = xmlMemBlocks();
31784         reader = gen_xmlTextReaderPtr(n_reader, 0);
31785
31786         ret_val = xmlTextReaderLocalName(reader);
31787         desret_xmlChar_ptr(ret_val);
31788         call_tests++;
31789         des_xmlTextReaderPtr(n_reader, reader, 0);
31790         xmlResetLastError();
31791         if (mem_base != xmlMemBlocks()) {
31792             printf("Leak of %d blocks found in xmlTextReaderLocalName",
31793                    xmlMemBlocks() - mem_base);
31794             test_ret++;
31795             printf(" %d", n_reader);
31796             printf("\n");
31797         }
31798     }
31799     function_tests++;
31800 #endif
31801
31802     return(test_ret);
31803 }
31804
31805 #ifdef LIBXML_READER_ENABLED
31806
31807 #define gen_nb_xmlTextReaderLocatorPtr 1
31808 static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31809     return(NULL);
31810 }
31811 static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31812 }
31813 #endif
31814
31815
31816 static int
31817 test_xmlTextReaderLocatorBaseURI(void) {
31818     int test_ret = 0;
31819
31820 #if defined(LIBXML_READER_ENABLED)
31821     int mem_base;
31822     xmlChar * ret_val;
31823     xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31824     int n_locator;
31825
31826     for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31827         mem_base = xmlMemBlocks();
31828         locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31829
31830         ret_val = xmlTextReaderLocatorBaseURI(locator);
31831         desret_xmlChar_ptr(ret_val);
31832         call_tests++;
31833         des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31834         xmlResetLastError();
31835         if (mem_base != xmlMemBlocks()) {
31836             printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
31837                    xmlMemBlocks() - mem_base);
31838             test_ret++;
31839             printf(" %d", n_locator);
31840             printf("\n");
31841         }
31842     }
31843     function_tests++;
31844 #endif
31845
31846     return(test_ret);
31847 }
31848
31849
31850 static int
31851 test_xmlTextReaderLocatorLineNumber(void) {
31852     int test_ret = 0;
31853
31854 #if defined(LIBXML_READER_ENABLED)
31855     int mem_base;
31856     int ret_val;
31857     xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31858     int n_locator;
31859
31860     for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31861         mem_base = xmlMemBlocks();
31862         locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31863
31864         ret_val = xmlTextReaderLocatorLineNumber(locator);
31865         desret_int(ret_val);
31866         call_tests++;
31867         des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31868         xmlResetLastError();
31869         if (mem_base != xmlMemBlocks()) {
31870             printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
31871                    xmlMemBlocks() - mem_base);
31872             test_ret++;
31873             printf(" %d", n_locator);
31874             printf("\n");
31875         }
31876     }
31877     function_tests++;
31878 #endif
31879
31880     return(test_ret);
31881 }
31882
31883
31884 static int
31885 test_xmlTextReaderLookupNamespace(void) {
31886     int test_ret = 0;
31887
31888 #if defined(LIBXML_READER_ENABLED)
31889     int mem_base;
31890     xmlChar * ret_val;
31891     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31892     int n_reader;
31893     xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
31894     int n_prefix;
31895
31896     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31897     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
31898         mem_base = xmlMemBlocks();
31899         reader = gen_xmlTextReaderPtr(n_reader, 0);
31900         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
31901
31902         ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
31903         desret_xmlChar_ptr(ret_val);
31904         call_tests++;
31905         des_xmlTextReaderPtr(n_reader, reader, 0);
31906         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
31907         xmlResetLastError();
31908         if (mem_base != xmlMemBlocks()) {
31909             printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
31910                    xmlMemBlocks() - mem_base);
31911             test_ret++;
31912             printf(" %d", n_reader);
31913             printf(" %d", n_prefix);
31914             printf("\n");
31915         }
31916     }
31917     }
31918     function_tests++;
31919 #endif
31920
31921     return(test_ret);
31922 }
31923
31924
31925 static int
31926 test_xmlTextReaderMoveToAttribute(void) {
31927     int test_ret = 0;
31928
31929 #if defined(LIBXML_READER_ENABLED)
31930     int mem_base;
31931     int ret_val;
31932     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31933     int n_reader;
31934     xmlChar * name; /* the qualified name of the attribute. */
31935     int n_name;
31936
31937     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31938     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31939         mem_base = xmlMemBlocks();
31940         reader = gen_xmlTextReaderPtr(n_reader, 0);
31941         name = gen_const_xmlChar_ptr(n_name, 1);
31942
31943         ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
31944         desret_int(ret_val);
31945         call_tests++;
31946         des_xmlTextReaderPtr(n_reader, reader, 0);
31947         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31948         xmlResetLastError();
31949         if (mem_base != xmlMemBlocks()) {
31950             printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
31951                    xmlMemBlocks() - mem_base);
31952             test_ret++;
31953             printf(" %d", n_reader);
31954             printf(" %d", n_name);
31955             printf("\n");
31956         }
31957     }
31958     }
31959     function_tests++;
31960 #endif
31961
31962     return(test_ret);
31963 }
31964
31965
31966 static int
31967 test_xmlTextReaderMoveToAttributeNo(void) {
31968     int test_ret = 0;
31969
31970 #if defined(LIBXML_READER_ENABLED)
31971     int mem_base;
31972     int ret_val;
31973     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31974     int n_reader;
31975     int no; /* the zero-based index of the attribute relative to the containing element. */
31976     int n_no;
31977
31978     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31979     for (n_no = 0;n_no < gen_nb_int;n_no++) {
31980         mem_base = xmlMemBlocks();
31981         reader = gen_xmlTextReaderPtr(n_reader, 0);
31982         no = gen_int(n_no, 1);
31983
31984         ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
31985         desret_int(ret_val);
31986         call_tests++;
31987         des_xmlTextReaderPtr(n_reader, reader, 0);
31988         des_int(n_no, no, 1);
31989         xmlResetLastError();
31990         if (mem_base != xmlMemBlocks()) {
31991             printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
31992                    xmlMemBlocks() - mem_base);
31993             test_ret++;
31994             printf(" %d", n_reader);
31995             printf(" %d", n_no);
31996             printf("\n");
31997         }
31998     }
31999     }
32000     function_tests++;
32001 #endif
32002
32003     return(test_ret);
32004 }
32005
32006
32007 static int
32008 test_xmlTextReaderMoveToAttributeNs(void) {
32009     int test_ret = 0;
32010
32011 #if defined(LIBXML_READER_ENABLED)
32012     int mem_base;
32013     int ret_val;
32014     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32015     int n_reader;
32016     xmlChar * localName; /* the local name of the attribute. */
32017     int n_localName;
32018     xmlChar * namespaceURI; /* the namespace URI of the attribute. */
32019     int n_namespaceURI;
32020
32021     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32022     for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
32023     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
32024         mem_base = xmlMemBlocks();
32025         reader = gen_xmlTextReaderPtr(n_reader, 0);
32026         localName = gen_const_xmlChar_ptr(n_localName, 1);
32027         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
32028
32029         ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
32030         desret_int(ret_val);
32031         call_tests++;
32032         des_xmlTextReaderPtr(n_reader, reader, 0);
32033         des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
32034         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
32035         xmlResetLastError();
32036         if (mem_base != xmlMemBlocks()) {
32037             printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
32038                    xmlMemBlocks() - mem_base);
32039             test_ret++;
32040             printf(" %d", n_reader);
32041             printf(" %d", n_localName);
32042             printf(" %d", n_namespaceURI);
32043             printf("\n");
32044         }
32045     }
32046     }
32047     }
32048     function_tests++;
32049 #endif
32050
32051     return(test_ret);
32052 }
32053
32054
32055 static int
32056 test_xmlTextReaderMoveToElement(void) {
32057     int test_ret = 0;
32058
32059 #if defined(LIBXML_READER_ENABLED)
32060     int mem_base;
32061     int ret_val;
32062     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32063     int n_reader;
32064
32065     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32066         mem_base = xmlMemBlocks();
32067         reader = gen_xmlTextReaderPtr(n_reader, 0);
32068
32069         ret_val = xmlTextReaderMoveToElement(reader);
32070         desret_int(ret_val);
32071         call_tests++;
32072         des_xmlTextReaderPtr(n_reader, reader, 0);
32073         xmlResetLastError();
32074         if (mem_base != xmlMemBlocks()) {
32075             printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
32076                    xmlMemBlocks() - mem_base);
32077             test_ret++;
32078             printf(" %d", n_reader);
32079             printf("\n");
32080         }
32081     }
32082     function_tests++;
32083 #endif
32084
32085     return(test_ret);
32086 }
32087
32088
32089 static int
32090 test_xmlTextReaderMoveToFirstAttribute(void) {
32091     int test_ret = 0;
32092
32093 #if defined(LIBXML_READER_ENABLED)
32094     int mem_base;
32095     int ret_val;
32096     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32097     int n_reader;
32098
32099     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32100         mem_base = xmlMemBlocks();
32101         reader = gen_xmlTextReaderPtr(n_reader, 0);
32102
32103         ret_val = xmlTextReaderMoveToFirstAttribute(reader);
32104         desret_int(ret_val);
32105         call_tests++;
32106         des_xmlTextReaderPtr(n_reader, reader, 0);
32107         xmlResetLastError();
32108         if (mem_base != xmlMemBlocks()) {
32109             printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
32110                    xmlMemBlocks() - mem_base);
32111             test_ret++;
32112             printf(" %d", n_reader);
32113             printf("\n");
32114         }
32115     }
32116     function_tests++;
32117 #endif
32118
32119     return(test_ret);
32120 }
32121
32122
32123 static int
32124 test_xmlTextReaderMoveToNextAttribute(void) {
32125     int test_ret = 0;
32126
32127 #if defined(LIBXML_READER_ENABLED)
32128     int mem_base;
32129     int ret_val;
32130     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32131     int n_reader;
32132
32133     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32134         mem_base = xmlMemBlocks();
32135         reader = gen_xmlTextReaderPtr(n_reader, 0);
32136
32137         ret_val = xmlTextReaderMoveToNextAttribute(reader);
32138         desret_int(ret_val);
32139         call_tests++;
32140         des_xmlTextReaderPtr(n_reader, reader, 0);
32141         xmlResetLastError();
32142         if (mem_base != xmlMemBlocks()) {
32143             printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
32144                    xmlMemBlocks() - mem_base);
32145             test_ret++;
32146             printf(" %d", n_reader);
32147             printf("\n");
32148         }
32149     }
32150     function_tests++;
32151 #endif
32152
32153     return(test_ret);
32154 }
32155
32156
32157 static int
32158 test_xmlTextReaderName(void) {
32159     int test_ret = 0;
32160
32161 #if defined(LIBXML_READER_ENABLED)
32162     int mem_base;
32163     xmlChar * ret_val;
32164     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32165     int n_reader;
32166
32167     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32168         mem_base = xmlMemBlocks();
32169         reader = gen_xmlTextReaderPtr(n_reader, 0);
32170
32171         ret_val = xmlTextReaderName(reader);
32172         desret_xmlChar_ptr(ret_val);
32173         call_tests++;
32174         des_xmlTextReaderPtr(n_reader, reader, 0);
32175         xmlResetLastError();
32176         if (mem_base != xmlMemBlocks()) {
32177             printf("Leak of %d blocks found in xmlTextReaderName",
32178                    xmlMemBlocks() - mem_base);
32179             test_ret++;
32180             printf(" %d", n_reader);
32181             printf("\n");
32182         }
32183     }
32184     function_tests++;
32185 #endif
32186
32187     return(test_ret);
32188 }
32189
32190
32191 static int
32192 test_xmlTextReaderNamespaceUri(void) {
32193     int test_ret = 0;
32194
32195 #if defined(LIBXML_READER_ENABLED)
32196     int mem_base;
32197     xmlChar * ret_val;
32198     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32199     int n_reader;
32200
32201     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32202         mem_base = xmlMemBlocks();
32203         reader = gen_xmlTextReaderPtr(n_reader, 0);
32204
32205         ret_val = xmlTextReaderNamespaceUri(reader);
32206         desret_xmlChar_ptr(ret_val);
32207         call_tests++;
32208         des_xmlTextReaderPtr(n_reader, reader, 0);
32209         xmlResetLastError();
32210         if (mem_base != xmlMemBlocks()) {
32211             printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
32212                    xmlMemBlocks() - mem_base);
32213             test_ret++;
32214             printf(" %d", n_reader);
32215             printf("\n");
32216         }
32217     }
32218     function_tests++;
32219 #endif
32220
32221     return(test_ret);
32222 }
32223
32224
32225 static int
32226 test_xmlTextReaderNext(void) {
32227     int test_ret = 0;
32228
32229 #if defined(LIBXML_READER_ENABLED)
32230     int mem_base;
32231     int ret_val;
32232     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32233     int n_reader;
32234
32235     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32236         mem_base = xmlMemBlocks();
32237         reader = gen_xmlTextReaderPtr(n_reader, 0);
32238
32239         ret_val = xmlTextReaderNext(reader);
32240         desret_int(ret_val);
32241         call_tests++;
32242         des_xmlTextReaderPtr(n_reader, reader, 0);
32243         xmlResetLastError();
32244         if (mem_base != xmlMemBlocks()) {
32245             printf("Leak of %d blocks found in xmlTextReaderNext",
32246                    xmlMemBlocks() - mem_base);
32247             test_ret++;
32248             printf(" %d", n_reader);
32249             printf("\n");
32250         }
32251     }
32252     function_tests++;
32253 #endif
32254
32255     return(test_ret);
32256 }
32257
32258
32259 static int
32260 test_xmlTextReaderNextSibling(void) {
32261     int test_ret = 0;
32262
32263 #if defined(LIBXML_READER_ENABLED)
32264     int mem_base;
32265     int ret_val;
32266     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32267     int n_reader;
32268
32269     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32270         mem_base = xmlMemBlocks();
32271         reader = gen_xmlTextReaderPtr(n_reader, 0);
32272
32273         ret_val = xmlTextReaderNextSibling(reader);
32274         desret_int(ret_val);
32275         call_tests++;
32276         des_xmlTextReaderPtr(n_reader, reader, 0);
32277         xmlResetLastError();
32278         if (mem_base != xmlMemBlocks()) {
32279             printf("Leak of %d blocks found in xmlTextReaderNextSibling",
32280                    xmlMemBlocks() - mem_base);
32281             test_ret++;
32282             printf(" %d", n_reader);
32283             printf("\n");
32284         }
32285     }
32286     function_tests++;
32287 #endif
32288
32289     return(test_ret);
32290 }
32291
32292
32293 static int
32294 test_xmlTextReaderNodeType(void) {
32295     int test_ret = 0;
32296
32297 #if defined(LIBXML_READER_ENABLED)
32298     int mem_base;
32299     int ret_val;
32300     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32301     int n_reader;
32302
32303     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32304         mem_base = xmlMemBlocks();
32305         reader = gen_xmlTextReaderPtr(n_reader, 0);
32306
32307         ret_val = xmlTextReaderNodeType(reader);
32308         desret_int(ret_val);
32309         call_tests++;
32310         des_xmlTextReaderPtr(n_reader, reader, 0);
32311         xmlResetLastError();
32312         if (mem_base != xmlMemBlocks()) {
32313             printf("Leak of %d blocks found in xmlTextReaderNodeType",
32314                    xmlMemBlocks() - mem_base);
32315             test_ret++;
32316             printf(" %d", n_reader);
32317             printf("\n");
32318         }
32319     }
32320     function_tests++;
32321 #endif
32322
32323     return(test_ret);
32324 }
32325
32326
32327 static int
32328 test_xmlTextReaderNormalization(void) {
32329     int test_ret = 0;
32330
32331 #if defined(LIBXML_READER_ENABLED)
32332     int mem_base;
32333     int ret_val;
32334     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32335     int n_reader;
32336
32337     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32338         mem_base = xmlMemBlocks();
32339         reader = gen_xmlTextReaderPtr(n_reader, 0);
32340
32341         ret_val = xmlTextReaderNormalization(reader);
32342         desret_int(ret_val);
32343         call_tests++;
32344         des_xmlTextReaderPtr(n_reader, reader, 0);
32345         xmlResetLastError();
32346         if (mem_base != xmlMemBlocks()) {
32347             printf("Leak of %d blocks found in xmlTextReaderNormalization",
32348                    xmlMemBlocks() - mem_base);
32349             test_ret++;
32350             printf(" %d", n_reader);
32351             printf("\n");
32352         }
32353     }
32354     function_tests++;
32355 #endif
32356
32357     return(test_ret);
32358 }
32359
32360
32361 static int
32362 test_xmlTextReaderPrefix(void) {
32363     int test_ret = 0;
32364
32365 #if defined(LIBXML_READER_ENABLED)
32366     int mem_base;
32367     xmlChar * ret_val;
32368     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32369     int n_reader;
32370
32371     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32372         mem_base = xmlMemBlocks();
32373         reader = gen_xmlTextReaderPtr(n_reader, 0);
32374
32375         ret_val = xmlTextReaderPrefix(reader);
32376         desret_xmlChar_ptr(ret_val);
32377         call_tests++;
32378         des_xmlTextReaderPtr(n_reader, reader, 0);
32379         xmlResetLastError();
32380         if (mem_base != xmlMemBlocks()) {
32381             printf("Leak of %d blocks found in xmlTextReaderPrefix",
32382                    xmlMemBlocks() - mem_base);
32383             test_ret++;
32384             printf(" %d", n_reader);
32385             printf("\n");
32386         }
32387     }
32388     function_tests++;
32389 #endif
32390
32391     return(test_ret);
32392 }
32393
32394
32395 static int
32396 test_xmlTextReaderPreserve(void) {
32397     int test_ret = 0;
32398
32399 #if defined(LIBXML_READER_ENABLED)
32400     int mem_base;
32401     xmlNodePtr ret_val;
32402     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32403     int n_reader;
32404
32405     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32406         mem_base = xmlMemBlocks();
32407         reader = gen_xmlTextReaderPtr(n_reader, 0);
32408
32409         ret_val = xmlTextReaderPreserve(reader);
32410         desret_xmlNodePtr(ret_val);
32411         call_tests++;
32412         des_xmlTextReaderPtr(n_reader, reader, 0);
32413         xmlResetLastError();
32414         if (mem_base != xmlMemBlocks()) {
32415             printf("Leak of %d blocks found in xmlTextReaderPreserve",
32416                    xmlMemBlocks() - mem_base);
32417             test_ret++;
32418             printf(" %d", n_reader);
32419             printf("\n");
32420         }
32421     }
32422     function_tests++;
32423 #endif
32424
32425     return(test_ret);
32426 }
32427
32428
32429 static int
32430 test_xmlTextReaderPreservePattern(void) {
32431     int test_ret = 0;
32432
32433 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
32434 #ifdef LIBXML_PATTERN_ENABLED
32435     int mem_base;
32436     int ret_val;
32437     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32438     int n_reader;
32439     xmlChar * pattern; /* an XPath subset pattern */
32440     int n_pattern;
32441     xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
32442     int n_namespaces;
32443
32444     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32445     for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
32446     for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
32447         mem_base = xmlMemBlocks();
32448         reader = gen_xmlTextReaderPtr(n_reader, 0);
32449         pattern = gen_const_xmlChar_ptr(n_pattern, 1);
32450         namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
32451
32452         ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
32453         desret_int(ret_val);
32454         call_tests++;
32455         des_xmlTextReaderPtr(n_reader, reader, 0);
32456         des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
32457         des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
32458         xmlResetLastError();
32459         if (mem_base != xmlMemBlocks()) {
32460             printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
32461                    xmlMemBlocks() - mem_base);
32462             test_ret++;
32463             printf(" %d", n_reader);
32464             printf(" %d", n_pattern);
32465             printf(" %d", n_namespaces);
32466             printf("\n");
32467         }
32468     }
32469     }
32470     }
32471     function_tests++;
32472 #endif
32473 #endif
32474
32475     return(test_ret);
32476 }
32477
32478
32479 static int
32480 test_xmlTextReaderQuoteChar(void) {
32481     int test_ret = 0;
32482
32483 #if defined(LIBXML_READER_ENABLED)
32484     int mem_base;
32485     int ret_val;
32486     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32487     int n_reader;
32488
32489     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32490         mem_base = xmlMemBlocks();
32491         reader = gen_xmlTextReaderPtr(n_reader, 0);
32492
32493         ret_val = xmlTextReaderQuoteChar(reader);
32494         desret_int(ret_val);
32495         call_tests++;
32496         des_xmlTextReaderPtr(n_reader, reader, 0);
32497         xmlResetLastError();
32498         if (mem_base != xmlMemBlocks()) {
32499             printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
32500                    xmlMemBlocks() - mem_base);
32501             test_ret++;
32502             printf(" %d", n_reader);
32503             printf("\n");
32504         }
32505     }
32506     function_tests++;
32507 #endif
32508
32509     return(test_ret);
32510 }
32511
32512
32513 static int
32514 test_xmlTextReaderRead(void) {
32515     int test_ret = 0;
32516
32517 #if defined(LIBXML_READER_ENABLED)
32518     int mem_base;
32519     int ret_val;
32520     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32521     int n_reader;
32522
32523     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32524         mem_base = xmlMemBlocks();
32525         reader = gen_xmlTextReaderPtr(n_reader, 0);
32526
32527         ret_val = xmlTextReaderRead(reader);
32528         desret_int(ret_val);
32529         call_tests++;
32530         des_xmlTextReaderPtr(n_reader, reader, 0);
32531         xmlResetLastError();
32532         if (mem_base != xmlMemBlocks()) {
32533             printf("Leak of %d blocks found in xmlTextReaderRead",
32534                    xmlMemBlocks() - mem_base);
32535             test_ret++;
32536             printf(" %d", n_reader);
32537             printf("\n");
32538         }
32539     }
32540     function_tests++;
32541 #endif
32542
32543     return(test_ret);
32544 }
32545
32546
32547 static int
32548 test_xmlTextReaderReadAttributeValue(void) {
32549     int test_ret = 0;
32550
32551 #if defined(LIBXML_READER_ENABLED)
32552     int mem_base;
32553     int ret_val;
32554     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32555     int n_reader;
32556
32557     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32558         mem_base = xmlMemBlocks();
32559         reader = gen_xmlTextReaderPtr(n_reader, 0);
32560
32561         ret_val = xmlTextReaderReadAttributeValue(reader);
32562         desret_int(ret_val);
32563         call_tests++;
32564         des_xmlTextReaderPtr(n_reader, reader, 0);
32565         xmlResetLastError();
32566         if (mem_base != xmlMemBlocks()) {
32567             printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
32568                    xmlMemBlocks() - mem_base);
32569             test_ret++;
32570             printf(" %d", n_reader);
32571             printf("\n");
32572         }
32573     }
32574     function_tests++;
32575 #endif
32576
32577     return(test_ret);
32578 }
32579
32580
32581 static int
32582 test_xmlTextReaderReadState(void) {
32583     int test_ret = 0;
32584
32585 #if defined(LIBXML_READER_ENABLED)
32586     int mem_base;
32587     int ret_val;
32588     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32589     int n_reader;
32590
32591     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32592         mem_base = xmlMemBlocks();
32593         reader = gen_xmlTextReaderPtr(n_reader, 0);
32594
32595         ret_val = xmlTextReaderReadState(reader);
32596         desret_int(ret_val);
32597         call_tests++;
32598         des_xmlTextReaderPtr(n_reader, reader, 0);
32599         xmlResetLastError();
32600         if (mem_base != xmlMemBlocks()) {
32601             printf("Leak of %d blocks found in xmlTextReaderReadState",
32602                    xmlMemBlocks() - mem_base);
32603             test_ret++;
32604             printf(" %d", n_reader);
32605             printf("\n");
32606         }
32607     }
32608     function_tests++;
32609 #endif
32610
32611     return(test_ret);
32612 }
32613
32614
32615 static int
32616 test_xmlTextReaderRelaxNGSetSchema(void) {
32617     int test_ret = 0;
32618
32619 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32620     int mem_base;
32621     int ret_val;
32622     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32623     int n_reader;
32624     xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
32625     int n_schema;
32626
32627     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32628     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
32629         mem_base = xmlMemBlocks();
32630         reader = gen_xmlTextReaderPtr(n_reader, 0);
32631         schema = gen_xmlRelaxNGPtr(n_schema, 1);
32632
32633         ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
32634         desret_int(ret_val);
32635         call_tests++;
32636         des_xmlTextReaderPtr(n_reader, reader, 0);
32637         des_xmlRelaxNGPtr(n_schema, schema, 1);
32638         xmlResetLastError();
32639         if (mem_base != xmlMemBlocks()) {
32640             printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
32641                    xmlMemBlocks() - mem_base);
32642             test_ret++;
32643             printf(" %d", n_reader);
32644             printf(" %d", n_schema);
32645             printf("\n");
32646         }
32647     }
32648     }
32649     function_tests++;
32650 #endif
32651
32652     return(test_ret);
32653 }
32654
32655
32656 static int
32657 test_xmlTextReaderRelaxNGValidate(void) {
32658     int test_ret = 0;
32659
32660 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32661     int mem_base;
32662     int ret_val;
32663     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32664     int n_reader;
32665     char * rng; /* the path to a RelaxNG schema or NULL */
32666     int n_rng;
32667
32668     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32669     for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
32670         mem_base = xmlMemBlocks();
32671         reader = gen_xmlTextReaderPtr(n_reader, 0);
32672         rng = gen_const_char_ptr(n_rng, 1);
32673
32674         ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
32675         desret_int(ret_val);
32676         call_tests++;
32677         des_xmlTextReaderPtr(n_reader, reader, 0);
32678         des_const_char_ptr(n_rng, (const char *)rng, 1);
32679         xmlResetLastError();
32680         if (mem_base != xmlMemBlocks()) {
32681             printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
32682                    xmlMemBlocks() - mem_base);
32683             test_ret++;
32684             printf(" %d", n_reader);
32685             printf(" %d", n_rng);
32686             printf("\n");
32687         }
32688     }
32689     }
32690     function_tests++;
32691 #endif
32692
32693     return(test_ret);
32694 }
32695
32696
32697 static int
32698 test_xmlTextReaderRelaxNGValidateCtxt(void) {
32699     int test_ret = 0;
32700
32701 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32702     int mem_base;
32703     int ret_val;
32704     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32705     int n_reader;
32706     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG schema validation context or NULL */
32707     int n_ctxt;
32708     int options; /* options (not used yet) */
32709     int n_options;
32710
32711     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32712     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
32713     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32714         mem_base = xmlMemBlocks();
32715         reader = gen_xmlTextReaderPtr(n_reader, 0);
32716         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 1);
32717         options = gen_parseroptions(n_options, 2);
32718
32719         ret_val = xmlTextReaderRelaxNGValidateCtxt(reader, ctxt, options);
32720         desret_int(ret_val);
32721         call_tests++;
32722         des_xmlTextReaderPtr(n_reader, reader, 0);
32723         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 1);
32724         des_parseroptions(n_options, options, 2);
32725         xmlResetLastError();
32726         if (mem_base != xmlMemBlocks()) {
32727             printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidateCtxt",
32728                    xmlMemBlocks() - mem_base);
32729             test_ret++;
32730             printf(" %d", n_reader);
32731             printf(" %d", n_ctxt);
32732             printf(" %d", n_options);
32733             printf("\n");
32734         }
32735     }
32736     }
32737     }
32738     function_tests++;
32739 #endif
32740
32741     return(test_ret);
32742 }
32743
32744
32745 static int
32746 test_xmlTextReaderSchemaValidate(void) {
32747     int test_ret = 0;
32748
32749 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32750     int ret_val;
32751     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32752     int n_reader;
32753     char * xsd; /* the path to a W3C XSD schema or NULL */
32754     int n_xsd;
32755
32756     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32757     for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
32758         reader = gen_xmlTextReaderPtr(n_reader, 0);
32759         xsd = gen_const_char_ptr(n_xsd, 1);
32760
32761         ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
32762         desret_int(ret_val);
32763         call_tests++;
32764         des_xmlTextReaderPtr(n_reader, reader, 0);
32765         des_const_char_ptr(n_xsd, (const char *)xsd, 1);
32766         xmlResetLastError();
32767     }
32768     }
32769     function_tests++;
32770 #endif
32771
32772     return(test_ret);
32773 }
32774
32775
32776 static int
32777 test_xmlTextReaderSchemaValidateCtxt(void) {
32778     int test_ret = 0;
32779
32780 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32781     int mem_base;
32782     int ret_val;
32783     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32784     int n_reader;
32785     xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
32786     int n_ctxt;
32787     int options; /* options (not used yet) */
32788     int n_options;
32789
32790     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32791     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32792     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32793         mem_base = xmlMemBlocks();
32794         reader = gen_xmlTextReaderPtr(n_reader, 0);
32795         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
32796         options = gen_parseroptions(n_options, 2);
32797
32798         ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
32799         desret_int(ret_val);
32800         call_tests++;
32801         des_xmlTextReaderPtr(n_reader, reader, 0);
32802         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
32803         des_parseroptions(n_options, options, 2);
32804         xmlResetLastError();
32805         if (mem_base != xmlMemBlocks()) {
32806             printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
32807                    xmlMemBlocks() - mem_base);
32808             test_ret++;
32809             printf(" %d", n_reader);
32810             printf(" %d", n_ctxt);
32811             printf(" %d", n_options);
32812             printf("\n");
32813         }
32814     }
32815     }
32816     }
32817     function_tests++;
32818 #endif
32819
32820     return(test_ret);
32821 }
32822
32823
32824 static int
32825 test_xmlTextReaderSetErrorHandler(void) {
32826     int test_ret = 0;
32827
32828
32829     /* missing type support */
32830     return(test_ret);
32831 }
32832
32833
32834 static int
32835 test_xmlTextReaderSetParserProp(void) {
32836     int test_ret = 0;
32837
32838 #if defined(LIBXML_READER_ENABLED)
32839     int mem_base;
32840     int ret_val;
32841     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32842     int n_reader;
32843     int prop; /* the xmlParserProperties to set */
32844     int n_prop;
32845     int value; /* usually 0 or 1 to (de)activate it */
32846     int n_value;
32847
32848     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32849     for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32850     for (n_value = 0;n_value < gen_nb_int;n_value++) {
32851         mem_base = xmlMemBlocks();
32852         reader = gen_xmlTextReaderPtr(n_reader, 0);
32853         prop = gen_int(n_prop, 1);
32854         value = gen_int(n_value, 2);
32855
32856         ret_val = xmlTextReaderSetParserProp(reader, prop, value);
32857         desret_int(ret_val);
32858         call_tests++;
32859         des_xmlTextReaderPtr(n_reader, reader, 0);
32860         des_int(n_prop, prop, 1);
32861         des_int(n_value, value, 2);
32862         xmlResetLastError();
32863         if (mem_base != xmlMemBlocks()) {
32864             printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
32865                    xmlMemBlocks() - mem_base);
32866             test_ret++;
32867             printf(" %d", n_reader);
32868             printf(" %d", n_prop);
32869             printf(" %d", n_value);
32870             printf("\n");
32871         }
32872     }
32873     }
32874     }
32875     function_tests++;
32876 #endif
32877
32878     return(test_ret);
32879 }
32880
32881
32882 static int
32883 test_xmlTextReaderSetSchema(void) {
32884     int test_ret = 0;
32885
32886 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32887     int mem_base;
32888     int ret_val;
32889     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32890     int n_reader;
32891     xmlSchemaPtr schema; /* a precompiled Schema schema */
32892     int n_schema;
32893
32894     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32895     for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32896         mem_base = xmlMemBlocks();
32897         reader = gen_xmlTextReaderPtr(n_reader, 0);
32898         schema = gen_xmlSchemaPtr(n_schema, 1);
32899
32900         ret_val = xmlTextReaderSetSchema(reader, schema);
32901         desret_int(ret_val);
32902         call_tests++;
32903         des_xmlTextReaderPtr(n_reader, reader, 0);
32904         des_xmlSchemaPtr(n_schema, schema, 1);
32905         xmlResetLastError();
32906         if (mem_base != xmlMemBlocks()) {
32907             printf("Leak of %d blocks found in xmlTextReaderSetSchema",
32908                    xmlMemBlocks() - mem_base);
32909             test_ret++;
32910             printf(" %d", n_reader);
32911             printf(" %d", n_schema);
32912             printf("\n");
32913         }
32914     }
32915     }
32916     function_tests++;
32917 #endif
32918
32919     return(test_ret);
32920 }
32921
32922
32923 static int
32924 test_xmlTextReaderSetStructuredErrorHandler(void) {
32925     int test_ret = 0;
32926
32927
32928     /* missing type support */
32929     return(test_ret);
32930 }
32931
32932
32933 static int
32934 test_xmlTextReaderSetup(void) {
32935     int test_ret = 0;
32936
32937 #if defined(LIBXML_READER_ENABLED)
32938     int mem_base;
32939     int ret_val;
32940     xmlTextReaderPtr reader; /* an XML reader */
32941     int n_reader;
32942     xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
32943     int n_input;
32944     const char * URL; /* the base URL to use for the document */
32945     int n_URL;
32946     char * encoding; /* the document encoding, or NULL */
32947     int n_encoding;
32948     int options; /* a combination of xmlParserOption */
32949     int n_options;
32950
32951     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32952     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
32953     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
32954     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
32955     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32956         mem_base = xmlMemBlocks();
32957         reader = gen_xmlTextReaderPtr(n_reader, 0);
32958         input = gen_xmlParserInputBufferPtr(n_input, 1);
32959         URL = gen_filepath(n_URL, 2);
32960         encoding = gen_const_char_ptr(n_encoding, 3);
32961         options = gen_parseroptions(n_options, 4);
32962
32963         ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
32964         desret_int(ret_val);
32965         call_tests++;
32966         des_xmlTextReaderPtr(n_reader, reader, 0);
32967         des_filepath(n_URL, URL, 2);
32968         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
32969         des_parseroptions(n_options, options, 4);
32970         xmlResetLastError();
32971         if (mem_base != xmlMemBlocks()) {
32972             printf("Leak of %d blocks found in xmlTextReaderSetup",
32973                    xmlMemBlocks() - mem_base);
32974             test_ret++;
32975             printf(" %d", n_reader);
32976             printf(" %d", n_input);
32977             printf(" %d", n_URL);
32978             printf(" %d", n_encoding);
32979             printf(" %d", n_options);
32980             printf("\n");
32981         }
32982     }
32983     }
32984     }
32985     }
32986     }
32987     function_tests++;
32988 #endif
32989
32990     return(test_ret);
32991 }
32992
32993
32994 static int
32995 test_xmlTextReaderStandalone(void) {
32996     int test_ret = 0;
32997
32998 #if defined(LIBXML_READER_ENABLED)
32999     int mem_base;
33000     int ret_val;
33001     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33002     int n_reader;
33003
33004     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33005         mem_base = xmlMemBlocks();
33006         reader = gen_xmlTextReaderPtr(n_reader, 0);
33007
33008         ret_val = xmlTextReaderStandalone(reader);
33009         desret_int(ret_val);
33010         call_tests++;
33011         des_xmlTextReaderPtr(n_reader, reader, 0);
33012         xmlResetLastError();
33013         if (mem_base != xmlMemBlocks()) {
33014             printf("Leak of %d blocks found in xmlTextReaderStandalone",
33015                    xmlMemBlocks() - mem_base);
33016             test_ret++;
33017             printf(" %d", n_reader);
33018             printf("\n");
33019         }
33020     }
33021     function_tests++;
33022 #endif
33023
33024     return(test_ret);
33025 }
33026
33027
33028 static int
33029 test_xmlTextReaderValue(void) {
33030     int test_ret = 0;
33031
33032 #if defined(LIBXML_READER_ENABLED)
33033     int mem_base;
33034     xmlChar * ret_val;
33035     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33036     int n_reader;
33037
33038     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33039         mem_base = xmlMemBlocks();
33040         reader = gen_xmlTextReaderPtr(n_reader, 0);
33041
33042         ret_val = xmlTextReaderValue(reader);
33043         desret_xmlChar_ptr(ret_val);
33044         call_tests++;
33045         des_xmlTextReaderPtr(n_reader, reader, 0);
33046         xmlResetLastError();
33047         if (mem_base != xmlMemBlocks()) {
33048             printf("Leak of %d blocks found in xmlTextReaderValue",
33049                    xmlMemBlocks() - mem_base);
33050             test_ret++;
33051             printf(" %d", n_reader);
33052             printf("\n");
33053         }
33054     }
33055     function_tests++;
33056 #endif
33057
33058     return(test_ret);
33059 }
33060
33061
33062 static int
33063 test_xmlTextReaderXmlLang(void) {
33064     int test_ret = 0;
33065
33066 #if defined(LIBXML_READER_ENABLED)
33067     int mem_base;
33068     xmlChar * ret_val;
33069     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33070     int n_reader;
33071
33072     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33073         mem_base = xmlMemBlocks();
33074         reader = gen_xmlTextReaderPtr(n_reader, 0);
33075
33076         ret_val = xmlTextReaderXmlLang(reader);
33077         desret_xmlChar_ptr(ret_val);
33078         call_tests++;
33079         des_xmlTextReaderPtr(n_reader, reader, 0);
33080         xmlResetLastError();
33081         if (mem_base != xmlMemBlocks()) {
33082             printf("Leak of %d blocks found in xmlTextReaderXmlLang",
33083                    xmlMemBlocks() - mem_base);
33084             test_ret++;
33085             printf(" %d", n_reader);
33086             printf("\n");
33087         }
33088     }
33089     function_tests++;
33090 #endif
33091
33092     return(test_ret);
33093 }
33094
33095 static int
33096 test_xmlreader(void) {
33097     int test_ret = 0;
33098
33099     if (quiet == 0) printf("Testing xmlreader : 76 of 86 functions ...\n");
33100     test_ret += test_xmlNewTextReader();
33101     test_ret += test_xmlNewTextReaderFilename();
33102     test_ret += test_xmlReaderForDoc();
33103     test_ret += test_xmlReaderForFile();
33104     test_ret += test_xmlReaderForMemory();
33105     test_ret += test_xmlReaderNewDoc();
33106     test_ret += test_xmlReaderNewFile();
33107     test_ret += test_xmlReaderNewMemory();
33108     test_ret += test_xmlReaderNewWalker();
33109     test_ret += test_xmlReaderWalker();
33110     test_ret += test_xmlTextReaderAttributeCount();
33111     test_ret += test_xmlTextReaderBaseUri();
33112     test_ret += test_xmlTextReaderByteConsumed();
33113     test_ret += test_xmlTextReaderClose();
33114     test_ret += test_xmlTextReaderConstBaseUri();
33115     test_ret += test_xmlTextReaderConstEncoding();
33116     test_ret += test_xmlTextReaderConstLocalName();
33117     test_ret += test_xmlTextReaderConstName();
33118     test_ret += test_xmlTextReaderConstNamespaceUri();
33119     test_ret += test_xmlTextReaderConstPrefix();
33120     test_ret += test_xmlTextReaderConstString();
33121     test_ret += test_xmlTextReaderConstValue();
33122     test_ret += test_xmlTextReaderConstXmlLang();
33123     test_ret += test_xmlTextReaderConstXmlVersion();
33124     test_ret += test_xmlTextReaderCurrentDoc();
33125     test_ret += test_xmlTextReaderCurrentNode();
33126     test_ret += test_xmlTextReaderDepth();
33127     test_ret += test_xmlTextReaderExpand();
33128     test_ret += test_xmlTextReaderGetAttribute();
33129     test_ret += test_xmlTextReaderGetAttributeNo();
33130     test_ret += test_xmlTextReaderGetAttributeNs();
33131     test_ret += test_xmlTextReaderGetErrorHandler();
33132     test_ret += test_xmlTextReaderGetParserColumnNumber();
33133     test_ret += test_xmlTextReaderGetParserLineNumber();
33134     test_ret += test_xmlTextReaderGetParserProp();
33135     test_ret += test_xmlTextReaderGetRemainder();
33136     test_ret += test_xmlTextReaderHasAttributes();
33137     test_ret += test_xmlTextReaderHasValue();
33138     test_ret += test_xmlTextReaderIsDefault();
33139     test_ret += test_xmlTextReaderIsEmptyElement();
33140     test_ret += test_xmlTextReaderIsNamespaceDecl();
33141     test_ret += test_xmlTextReaderIsValid();
33142     test_ret += test_xmlTextReaderLocalName();
33143     test_ret += test_xmlTextReaderLocatorBaseURI();
33144     test_ret += test_xmlTextReaderLocatorLineNumber();
33145     test_ret += test_xmlTextReaderLookupNamespace();
33146     test_ret += test_xmlTextReaderMoveToAttribute();
33147     test_ret += test_xmlTextReaderMoveToAttributeNo();
33148     test_ret += test_xmlTextReaderMoveToAttributeNs();
33149     test_ret += test_xmlTextReaderMoveToElement();
33150     test_ret += test_xmlTextReaderMoveToFirstAttribute();
33151     test_ret += test_xmlTextReaderMoveToNextAttribute();
33152     test_ret += test_xmlTextReaderName();
33153     test_ret += test_xmlTextReaderNamespaceUri();
33154     test_ret += test_xmlTextReaderNext();
33155     test_ret += test_xmlTextReaderNextSibling();
33156     test_ret += test_xmlTextReaderNodeType();
33157     test_ret += test_xmlTextReaderNormalization();
33158     test_ret += test_xmlTextReaderPrefix();
33159     test_ret += test_xmlTextReaderPreserve();
33160     test_ret += test_xmlTextReaderPreservePattern();
33161     test_ret += test_xmlTextReaderQuoteChar();
33162     test_ret += test_xmlTextReaderRead();
33163     test_ret += test_xmlTextReaderReadAttributeValue();
33164     test_ret += test_xmlTextReaderReadState();
33165     test_ret += test_xmlTextReaderRelaxNGSetSchema();
33166     test_ret += test_xmlTextReaderRelaxNGValidate();
33167     test_ret += test_xmlTextReaderRelaxNGValidateCtxt();
33168     test_ret += test_xmlTextReaderSchemaValidate();
33169     test_ret += test_xmlTextReaderSchemaValidateCtxt();
33170     test_ret += test_xmlTextReaderSetErrorHandler();
33171     test_ret += test_xmlTextReaderSetParserProp();
33172     test_ret += test_xmlTextReaderSetSchema();
33173     test_ret += test_xmlTextReaderSetStructuredErrorHandler();
33174     test_ret += test_xmlTextReaderSetup();
33175     test_ret += test_xmlTextReaderStandalone();
33176     test_ret += test_xmlTextReaderValue();
33177     test_ret += test_xmlTextReaderXmlLang();
33178
33179     if (test_ret != 0)
33180         printf("Module xmlreader: %d errors\n", test_ret);
33181     return(test_ret);
33182 }
33183
33184 static int
33185 test_xmlExpCtxtNbCons(void) {
33186     int test_ret = 0;
33187
33188 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33189     int mem_base;
33190     int ret_val;
33191     xmlExpCtxtPtr ctxt; /* an expression context */
33192     int n_ctxt;
33193
33194     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33195         mem_base = xmlMemBlocks();
33196         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33197
33198         ret_val = xmlExpCtxtNbCons(ctxt);
33199         desret_int(ret_val);
33200         call_tests++;
33201         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33202         xmlResetLastError();
33203         if (mem_base != xmlMemBlocks()) {
33204             printf("Leak of %d blocks found in xmlExpCtxtNbCons",
33205                    xmlMemBlocks() - mem_base);
33206             test_ret++;
33207             printf(" %d", n_ctxt);
33208             printf("\n");
33209         }
33210     }
33211     function_tests++;
33212 #endif
33213
33214     return(test_ret);
33215 }
33216
33217
33218 static int
33219 test_xmlExpCtxtNbNodes(void) {
33220     int test_ret = 0;
33221
33222 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33223     int mem_base;
33224     int ret_val;
33225     xmlExpCtxtPtr ctxt; /* an expression context */
33226     int n_ctxt;
33227
33228     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33229         mem_base = xmlMemBlocks();
33230         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33231
33232         ret_val = xmlExpCtxtNbNodes(ctxt);
33233         desret_int(ret_val);
33234         call_tests++;
33235         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33236         xmlResetLastError();
33237         if (mem_base != xmlMemBlocks()) {
33238             printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
33239                    xmlMemBlocks() - mem_base);
33240             test_ret++;
33241             printf(" %d", n_ctxt);
33242             printf("\n");
33243         }
33244     }
33245     function_tests++;
33246 #endif
33247
33248     return(test_ret);
33249 }
33250
33251
33252 static int
33253 test_xmlExpDump(void) {
33254     int test_ret = 0;
33255
33256 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33257     int mem_base;
33258     xmlBufferPtr buf; /* a buffer to receive the output */
33259     int n_buf;
33260     xmlExpNodePtr expr; /* the compiled expression */
33261     int n_expr;
33262
33263     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
33264     for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
33265         mem_base = xmlMemBlocks();
33266         buf = gen_xmlBufferPtr(n_buf, 0);
33267         expr = gen_xmlExpNodePtr(n_expr, 1);
33268
33269         xmlExpDump(buf, expr);
33270         call_tests++;
33271         des_xmlBufferPtr(n_buf, buf, 0);
33272         des_xmlExpNodePtr(n_expr, expr, 1);
33273         xmlResetLastError();
33274         if (mem_base != xmlMemBlocks()) {
33275             printf("Leak of %d blocks found in xmlExpDump",
33276                    xmlMemBlocks() - mem_base);
33277             test_ret++;
33278             printf(" %d", n_buf);
33279             printf(" %d", n_expr);
33280             printf("\n");
33281         }
33282     }
33283     }
33284     function_tests++;
33285 #endif
33286
33287     return(test_ret);
33288 }
33289
33290
33291 static int
33292 test_xmlExpExpDerive(void) {
33293     int test_ret = 0;
33294
33295
33296     /* missing type support */
33297     return(test_ret);
33298 }
33299
33300
33301 static int
33302 test_xmlExpGetLanguage(void) {
33303     int test_ret = 0;
33304
33305 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33306     int mem_base;
33307     int ret_val;
33308     xmlExpCtxtPtr ctxt; /* the expression context */
33309     int n_ctxt;
33310     xmlExpNodePtr exp; /* the expression */
33311     int n_exp;
33312     xmlChar ** langList; /* where to store the tokens */
33313     int n_langList;
33314     int len; /* the allocated length of @list */
33315     int n_len;
33316
33317     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33318     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33319     for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
33320     for (n_len = 0;n_len < gen_nb_int;n_len++) {
33321         mem_base = xmlMemBlocks();
33322         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33323         exp = gen_xmlExpNodePtr(n_exp, 1);
33324         langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
33325         len = gen_int(n_len, 3);
33326
33327         ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
33328         desret_int(ret_val);
33329         call_tests++;
33330         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33331         des_xmlExpNodePtr(n_exp, exp, 1);
33332         des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
33333         des_int(n_len, len, 3);
33334         xmlResetLastError();
33335         if (mem_base != xmlMemBlocks()) {
33336             printf("Leak of %d blocks found in xmlExpGetLanguage",
33337                    xmlMemBlocks() - mem_base);
33338             test_ret++;
33339             printf(" %d", n_ctxt);
33340             printf(" %d", n_exp);
33341             printf(" %d", n_langList);
33342             printf(" %d", n_len);
33343             printf("\n");
33344         }
33345     }
33346     }
33347     }
33348     }
33349     function_tests++;
33350 #endif
33351
33352     return(test_ret);
33353 }
33354
33355
33356 static int
33357 test_xmlExpGetStart(void) {
33358     int test_ret = 0;
33359
33360 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33361     int mem_base;
33362     int ret_val;
33363     xmlExpCtxtPtr ctxt; /* the expression context */
33364     int n_ctxt;
33365     xmlExpNodePtr exp; /* the expression */
33366     int n_exp;
33367     xmlChar ** tokList; /* where to store the tokens */
33368     int n_tokList;
33369     int len; /* the allocated length of @list */
33370     int n_len;
33371
33372     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33373     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33374     for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
33375     for (n_len = 0;n_len < gen_nb_int;n_len++) {
33376         mem_base = xmlMemBlocks();
33377         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33378         exp = gen_xmlExpNodePtr(n_exp, 1);
33379         tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
33380         len = gen_int(n_len, 3);
33381
33382         ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
33383         desret_int(ret_val);
33384         call_tests++;
33385         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33386         des_xmlExpNodePtr(n_exp, exp, 1);
33387         des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
33388         des_int(n_len, len, 3);
33389         xmlResetLastError();
33390         if (mem_base != xmlMemBlocks()) {
33391             printf("Leak of %d blocks found in xmlExpGetStart",
33392                    xmlMemBlocks() - mem_base);
33393             test_ret++;
33394             printf(" %d", n_ctxt);
33395             printf(" %d", n_exp);
33396             printf(" %d", n_tokList);
33397             printf(" %d", n_len);
33398             printf("\n");
33399         }
33400     }
33401     }
33402     }
33403     }
33404     function_tests++;
33405 #endif
33406
33407     return(test_ret);
33408 }
33409
33410
33411 static int
33412 test_xmlExpIsNillable(void) {
33413     int test_ret = 0;
33414
33415 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33416     int mem_base;
33417     int ret_val;
33418     xmlExpNodePtr exp; /* the expression */
33419     int n_exp;
33420
33421     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33422         mem_base = xmlMemBlocks();
33423         exp = gen_xmlExpNodePtr(n_exp, 0);
33424
33425         ret_val = xmlExpIsNillable(exp);
33426         desret_int(ret_val);
33427         call_tests++;
33428         des_xmlExpNodePtr(n_exp, exp, 0);
33429         xmlResetLastError();
33430         if (mem_base != xmlMemBlocks()) {
33431             printf("Leak of %d blocks found in xmlExpIsNillable",
33432                    xmlMemBlocks() - mem_base);
33433             test_ret++;
33434             printf(" %d", n_exp);
33435             printf("\n");
33436         }
33437     }
33438     function_tests++;
33439 #endif
33440
33441     return(test_ret);
33442 }
33443
33444
33445 static int
33446 test_xmlExpMaxToken(void) {
33447     int test_ret = 0;
33448
33449 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33450     int mem_base;
33451     int ret_val;
33452     xmlExpNodePtr expr; /* a compiled expression */
33453     int n_expr;
33454
33455     for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
33456         mem_base = xmlMemBlocks();
33457         expr = gen_xmlExpNodePtr(n_expr, 0);
33458
33459         ret_val = xmlExpMaxToken(expr);
33460         desret_int(ret_val);
33461         call_tests++;
33462         des_xmlExpNodePtr(n_expr, expr, 0);
33463         xmlResetLastError();
33464         if (mem_base != xmlMemBlocks()) {
33465             printf("Leak of %d blocks found in xmlExpMaxToken",
33466                    xmlMemBlocks() - mem_base);
33467             test_ret++;
33468             printf(" %d", n_expr);
33469             printf("\n");
33470         }
33471     }
33472     function_tests++;
33473 #endif
33474
33475     return(test_ret);
33476 }
33477
33478
33479 static int
33480 test_xmlExpNewAtom(void) {
33481     int test_ret = 0;
33482
33483
33484     /* missing type support */
33485     return(test_ret);
33486 }
33487
33488
33489 static int
33490 test_xmlExpNewCtxt(void) {
33491     int test_ret = 0;
33492
33493
33494     /* missing type support */
33495     return(test_ret);
33496 }
33497
33498
33499 static int
33500 test_xmlExpNewOr(void) {
33501     int test_ret = 0;
33502
33503
33504     /* missing type support */
33505     return(test_ret);
33506 }
33507
33508
33509 static int
33510 test_xmlExpNewRange(void) {
33511     int test_ret = 0;
33512
33513
33514     /* missing type support */
33515     return(test_ret);
33516 }
33517
33518
33519 static int
33520 test_xmlExpNewSeq(void) {
33521     int test_ret = 0;
33522
33523
33524     /* missing type support */
33525     return(test_ret);
33526 }
33527
33528
33529 static int
33530 test_xmlExpParse(void) {
33531     int test_ret = 0;
33532
33533
33534     /* missing type support */
33535     return(test_ret);
33536 }
33537
33538
33539 static int
33540 test_xmlExpRef(void) {
33541     int test_ret = 0;
33542
33543 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33544     int mem_base;
33545     xmlExpNodePtr exp; /* the expression */
33546     int n_exp;
33547
33548     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33549         mem_base = xmlMemBlocks();
33550         exp = gen_xmlExpNodePtr(n_exp, 0);
33551
33552         xmlExpRef(exp);
33553         call_tests++;
33554         des_xmlExpNodePtr(n_exp, exp, 0);
33555         xmlResetLastError();
33556         if (mem_base != xmlMemBlocks()) {
33557             printf("Leak of %d blocks found in xmlExpRef",
33558                    xmlMemBlocks() - mem_base);
33559             test_ret++;
33560             printf(" %d", n_exp);
33561             printf("\n");
33562         }
33563     }
33564     function_tests++;
33565 #endif
33566
33567     return(test_ret);
33568 }
33569
33570
33571 static int
33572 test_xmlExpStringDerive(void) {
33573     int test_ret = 0;
33574
33575
33576     /* missing type support */
33577     return(test_ret);
33578 }
33579
33580
33581 static int
33582 test_xmlExpSubsume(void) {
33583     int test_ret = 0;
33584
33585 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33586     int mem_base;
33587     int ret_val;
33588     xmlExpCtxtPtr ctxt; /* the expressions context */
33589     int n_ctxt;
33590     xmlExpNodePtr exp; /* the englobing expression */
33591     int n_exp;
33592     xmlExpNodePtr sub; /* the subexpression */
33593     int n_sub;
33594
33595     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33596     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33597     for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
33598         mem_base = xmlMemBlocks();
33599         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33600         exp = gen_xmlExpNodePtr(n_exp, 1);
33601         sub = gen_xmlExpNodePtr(n_sub, 2);
33602
33603         ret_val = xmlExpSubsume(ctxt, exp, sub);
33604         desret_int(ret_val);
33605         call_tests++;
33606         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33607         des_xmlExpNodePtr(n_exp, exp, 1);
33608         des_xmlExpNodePtr(n_sub, sub, 2);
33609         xmlResetLastError();
33610         if (mem_base != xmlMemBlocks()) {
33611             printf("Leak of %d blocks found in xmlExpSubsume",
33612                    xmlMemBlocks() - mem_base);
33613             test_ret++;
33614             printf(" %d", n_ctxt);
33615             printf(" %d", n_exp);
33616             printf(" %d", n_sub);
33617             printf("\n");
33618         }
33619     }
33620     }
33621     }
33622     function_tests++;
33623 #endif
33624
33625     return(test_ret);
33626 }
33627
33628 #ifdef LIBXML_REGEXP_ENABLED
33629
33630 #define gen_nb_xmlRegExecCtxtPtr 1
33631 static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33632     return(NULL);
33633 }
33634 static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33635 }
33636 #endif
33637
33638
33639 static int
33640 test_xmlRegExecErrInfo(void) {
33641     int test_ret = 0;
33642
33643 #if defined(LIBXML_REGEXP_ENABLED)
33644     int mem_base;
33645     int ret_val;
33646     xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
33647     int n_exec;
33648     xmlChar ** string; /* return value for the error string */
33649     int n_string;
33650     int * nbval; /* pointer to the number of accepted values IN/OUT */
33651     int n_nbval;
33652     int * nbneg; /* return number of negative transitions */
33653     int n_nbneg;
33654     xmlChar ** values; /* pointer to the array of acceptable values */
33655     int n_values;
33656     int * terminal; /* return value if this was a terminal state */
33657     int n_terminal;
33658
33659     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33660     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
33661     for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33662     for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33663     for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33664     for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33665         mem_base = xmlMemBlocks();
33666         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33667         string = gen_const_xmlChar_ptr_ptr(n_string, 1);
33668         nbval = gen_int_ptr(n_nbval, 2);
33669         nbneg = gen_int_ptr(n_nbneg, 3);
33670         values = gen_xmlChar_ptr_ptr(n_values, 4);
33671         terminal = gen_int_ptr(n_terminal, 5);
33672
33673         ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
33674         desret_int(ret_val);
33675         call_tests++;
33676         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33677         des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
33678         des_int_ptr(n_nbval, nbval, 2);
33679         des_int_ptr(n_nbneg, nbneg, 3);
33680         des_xmlChar_ptr_ptr(n_values, values, 4);
33681         des_int_ptr(n_terminal, terminal, 5);
33682         xmlResetLastError();
33683         if (mem_base != xmlMemBlocks()) {
33684             printf("Leak of %d blocks found in xmlRegExecErrInfo",
33685                    xmlMemBlocks() - mem_base);
33686             test_ret++;
33687             printf(" %d", n_exec);
33688             printf(" %d", n_string);
33689             printf(" %d", n_nbval);
33690             printf(" %d", n_nbneg);
33691             printf(" %d", n_values);
33692             printf(" %d", n_terminal);
33693             printf("\n");
33694         }
33695     }
33696     }
33697     }
33698     }
33699     }
33700     }
33701     function_tests++;
33702 #endif
33703
33704     return(test_ret);
33705 }
33706
33707
33708 static int
33709 test_xmlRegExecNextValues(void) {
33710     int test_ret = 0;
33711
33712 #if defined(LIBXML_REGEXP_ENABLED)
33713     int mem_base;
33714     int ret_val;
33715     xmlRegExecCtxtPtr exec; /* a regexp execution context */
33716     int n_exec;
33717     int * nbval; /* pointer to the number of accepted values IN/OUT */
33718     int n_nbval;
33719     int * nbneg; /* return number of negative transitions */
33720     int n_nbneg;
33721     xmlChar ** values; /* pointer to the array of acceptable values */
33722     int n_values;
33723     int * terminal; /* return value if this was a terminal state */
33724     int n_terminal;
33725
33726     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33727     for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33728     for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33729     for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33730     for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33731         mem_base = xmlMemBlocks();
33732         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33733         nbval = gen_int_ptr(n_nbval, 1);
33734         nbneg = gen_int_ptr(n_nbneg, 2);
33735         values = gen_xmlChar_ptr_ptr(n_values, 3);
33736         terminal = gen_int_ptr(n_terminal, 4);
33737
33738         ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
33739         desret_int(ret_val);
33740         call_tests++;
33741         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33742         des_int_ptr(n_nbval, nbval, 1);
33743         des_int_ptr(n_nbneg, nbneg, 2);
33744         des_xmlChar_ptr_ptr(n_values, values, 3);
33745         des_int_ptr(n_terminal, terminal, 4);
33746         xmlResetLastError();
33747         if (mem_base != xmlMemBlocks()) {
33748             printf("Leak of %d blocks found in xmlRegExecNextValues",
33749                    xmlMemBlocks() - mem_base);
33750             test_ret++;
33751             printf(" %d", n_exec);
33752             printf(" %d", n_nbval);
33753             printf(" %d", n_nbneg);
33754             printf(" %d", n_values);
33755             printf(" %d", n_terminal);
33756             printf("\n");
33757         }
33758     }
33759     }
33760     }
33761     }
33762     }
33763     function_tests++;
33764 #endif
33765
33766     return(test_ret);
33767 }
33768
33769
33770 static int
33771 test_xmlRegExecPushString(void) {
33772     int test_ret = 0;
33773
33774 #if defined(LIBXML_REGEXP_ENABLED)
33775     int mem_base;
33776     int ret_val;
33777     xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33778     int n_exec;
33779     xmlChar * value; /* a string token input */
33780     int n_value;
33781     void * data; /* data associated to the token to reuse in callbacks */
33782     int n_data;
33783
33784     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33785     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33786     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33787         mem_base = xmlMemBlocks();
33788         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33789         value = gen_const_xmlChar_ptr(n_value, 1);
33790         data = gen_userdata(n_data, 2);
33791
33792         ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
33793         desret_int(ret_val);
33794         call_tests++;
33795         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33796         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33797         des_userdata(n_data, data, 2);
33798         xmlResetLastError();
33799         if (mem_base != xmlMemBlocks()) {
33800             printf("Leak of %d blocks found in xmlRegExecPushString",
33801                    xmlMemBlocks() - mem_base);
33802             test_ret++;
33803             printf(" %d", n_exec);
33804             printf(" %d", n_value);
33805             printf(" %d", n_data);
33806             printf("\n");
33807         }
33808     }
33809     }
33810     }
33811     function_tests++;
33812 #endif
33813
33814     return(test_ret);
33815 }
33816
33817
33818 static int
33819 test_xmlRegExecPushString2(void) {
33820     int test_ret = 0;
33821
33822 #if defined(LIBXML_REGEXP_ENABLED)
33823     int mem_base;
33824     int ret_val;
33825     xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33826     int n_exec;
33827     xmlChar * value; /* the first string token input */
33828     int n_value;
33829     xmlChar * value2; /* the second string token input */
33830     int n_value2;
33831     void * data; /* data associated to the token to reuse in callbacks */
33832     int n_data;
33833
33834     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33835     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33836     for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
33837     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33838         mem_base = xmlMemBlocks();
33839         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33840         value = gen_const_xmlChar_ptr(n_value, 1);
33841         value2 = gen_const_xmlChar_ptr(n_value2, 2);
33842         data = gen_userdata(n_data, 3);
33843
33844         ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
33845         desret_int(ret_val);
33846         call_tests++;
33847         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33848         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33849         des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
33850         des_userdata(n_data, data, 3);
33851         xmlResetLastError();
33852         if (mem_base != xmlMemBlocks()) {
33853             printf("Leak of %d blocks found in xmlRegExecPushString2",
33854                    xmlMemBlocks() - mem_base);
33855             test_ret++;
33856             printf(" %d", n_exec);
33857             printf(" %d", n_value);
33858             printf(" %d", n_value2);
33859             printf(" %d", n_data);
33860             printf("\n");
33861         }
33862     }
33863     }
33864     }
33865     }
33866     function_tests++;
33867 #endif
33868
33869     return(test_ret);
33870 }
33871
33872 #ifdef LIBXML_REGEXP_ENABLED
33873
33874 #define gen_nb_xmlRegexpPtr 1
33875 static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33876     return(NULL);
33877 }
33878 static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33879 }
33880 #endif
33881
33882
33883 static int
33884 test_xmlRegNewExecCtxt(void) {
33885     int test_ret = 0;
33886
33887
33888     /* missing type support */
33889     return(test_ret);
33890 }
33891
33892
33893 static int
33894 test_xmlRegexpCompile(void) {
33895     int test_ret = 0;
33896
33897
33898     /* missing type support */
33899     return(test_ret);
33900 }
33901
33902
33903 static int
33904 test_xmlRegexpExec(void) {
33905     int test_ret = 0;
33906
33907 #if defined(LIBXML_REGEXP_ENABLED)
33908     int mem_base;
33909     int ret_val;
33910     xmlRegexpPtr comp; /* the compiled regular expression */
33911     int n_comp;
33912     xmlChar * content; /* the value to check against the regular expression */
33913     int n_content;
33914
33915     for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33916     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
33917         mem_base = xmlMemBlocks();
33918         comp = gen_xmlRegexpPtr(n_comp, 0);
33919         content = gen_const_xmlChar_ptr(n_content, 1);
33920
33921         ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
33922         desret_int(ret_val);
33923         call_tests++;
33924         des_xmlRegexpPtr(n_comp, comp, 0);
33925         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
33926         xmlResetLastError();
33927         if (mem_base != xmlMemBlocks()) {
33928             printf("Leak of %d blocks found in xmlRegexpExec",
33929                    xmlMemBlocks() - mem_base);
33930             test_ret++;
33931             printf(" %d", n_comp);
33932             printf(" %d", n_content);
33933             printf("\n");
33934         }
33935     }
33936     }
33937     function_tests++;
33938 #endif
33939
33940     return(test_ret);
33941 }
33942
33943
33944 static int
33945 test_xmlRegexpIsDeterminist(void) {
33946     int test_ret = 0;
33947
33948 #if defined(LIBXML_REGEXP_ENABLED)
33949     int mem_base;
33950     int ret_val;
33951     xmlRegexpPtr comp; /* the compiled regular expression */
33952     int n_comp;
33953
33954     for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33955         mem_base = xmlMemBlocks();
33956         comp = gen_xmlRegexpPtr(n_comp, 0);
33957
33958         ret_val = xmlRegexpIsDeterminist(comp);
33959         desret_int(ret_val);
33960         call_tests++;
33961         des_xmlRegexpPtr(n_comp, comp, 0);
33962         xmlResetLastError();
33963         if (mem_base != xmlMemBlocks()) {
33964             printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
33965                    xmlMemBlocks() - mem_base);
33966             test_ret++;
33967             printf(" %d", n_comp);
33968             printf("\n");
33969         }
33970     }
33971     function_tests++;
33972 #endif
33973
33974     return(test_ret);
33975 }
33976
33977
33978 static int
33979 test_xmlRegexpPrint(void) {
33980     int test_ret = 0;
33981
33982 #if defined(LIBXML_REGEXP_ENABLED)
33983     int mem_base;
33984     FILE * output; /* the file for the output debug */
33985     int n_output;
33986     xmlRegexpPtr regexp; /* the compiled regexp */
33987     int n_regexp;
33988
33989     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33990     for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
33991         mem_base = xmlMemBlocks();
33992         output = gen_FILE_ptr(n_output, 0);
33993         regexp = gen_xmlRegexpPtr(n_regexp, 1);
33994
33995         xmlRegexpPrint(output, regexp);
33996         call_tests++;
33997         des_FILE_ptr(n_output, output, 0);
33998         des_xmlRegexpPtr(n_regexp, regexp, 1);
33999         xmlResetLastError();
34000         if (mem_base != xmlMemBlocks()) {
34001             printf("Leak of %d blocks found in xmlRegexpPrint",
34002                    xmlMemBlocks() - mem_base);
34003             test_ret++;
34004             printf(" %d", n_output);
34005             printf(" %d", n_regexp);
34006             printf("\n");
34007         }
34008     }
34009     }
34010     function_tests++;
34011 #endif
34012
34013     return(test_ret);
34014 }
34015
34016 static int
34017 test_xmlregexp(void) {
34018     int test_ret = 0;
34019
34020     if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
34021     test_ret += test_xmlExpCtxtNbCons();
34022     test_ret += test_xmlExpCtxtNbNodes();
34023     test_ret += test_xmlExpDump();
34024     test_ret += test_xmlExpExpDerive();
34025     test_ret += test_xmlExpGetLanguage();
34026     test_ret += test_xmlExpGetStart();
34027     test_ret += test_xmlExpIsNillable();
34028     test_ret += test_xmlExpMaxToken();
34029     test_ret += test_xmlExpNewAtom();
34030     test_ret += test_xmlExpNewCtxt();
34031     test_ret += test_xmlExpNewOr();
34032     test_ret += test_xmlExpNewRange();
34033     test_ret += test_xmlExpNewSeq();
34034     test_ret += test_xmlExpParse();
34035     test_ret += test_xmlExpRef();
34036     test_ret += test_xmlExpStringDerive();
34037     test_ret += test_xmlExpSubsume();
34038     test_ret += test_xmlRegExecErrInfo();
34039     test_ret += test_xmlRegExecNextValues();
34040     test_ret += test_xmlRegExecPushString();
34041     test_ret += test_xmlRegExecPushString2();
34042     test_ret += test_xmlRegNewExecCtxt();
34043     test_ret += test_xmlRegexpCompile();
34044     test_ret += test_xmlRegexpExec();
34045     test_ret += test_xmlRegexpIsDeterminist();
34046     test_ret += test_xmlRegexpPrint();
34047
34048     if (test_ret != 0)
34049         printf("Module xmlregexp: %d errors\n", test_ret);
34050     return(test_ret);
34051 }
34052 #ifdef LIBXML_OUTPUT_ENABLED
34053
34054 #define gen_nb_xmlSaveCtxtPtr 1
34055 static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34056     return(NULL);
34057 }
34058 static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34059 }
34060 #endif
34061
34062
34063 static int
34064 test_xmlSaveClose(void) {
34065     int test_ret = 0;
34066
34067 #if defined(LIBXML_OUTPUT_ENABLED)
34068     int mem_base;
34069     int ret_val;
34070     xmlSaveCtxtPtr ctxt; /* a document saving context */
34071     int n_ctxt;
34072
34073     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34074         mem_base = xmlMemBlocks();
34075         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34076
34077         ret_val = xmlSaveClose(ctxt);
34078         desret_int(ret_val);
34079         call_tests++;
34080         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34081         xmlResetLastError();
34082         if (mem_base != xmlMemBlocks()) {
34083             printf("Leak of %d blocks found in xmlSaveClose",
34084                    xmlMemBlocks() - mem_base);
34085             test_ret++;
34086             printf(" %d", n_ctxt);
34087             printf("\n");
34088         }
34089     }
34090     function_tests++;
34091 #endif
34092
34093     return(test_ret);
34094 }
34095
34096
34097 static int
34098 test_xmlSaveDoc(void) {
34099     int test_ret = 0;
34100
34101 #if defined(LIBXML_OUTPUT_ENABLED)
34102     int mem_base;
34103     long ret_val;
34104     xmlSaveCtxtPtr ctxt; /* a document saving context */
34105     int n_ctxt;
34106     xmlDocPtr doc; /* a document */
34107     int n_doc;
34108
34109     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34110     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34111         mem_base = xmlMemBlocks();
34112         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34113         doc = gen_xmlDocPtr(n_doc, 1);
34114
34115         ret_val = xmlSaveDoc(ctxt, doc);
34116         desret_long(ret_val);
34117         call_tests++;
34118         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34119         des_xmlDocPtr(n_doc, doc, 1);
34120         xmlResetLastError();
34121         if (mem_base != xmlMemBlocks()) {
34122             printf("Leak of %d blocks found in xmlSaveDoc",
34123                    xmlMemBlocks() - mem_base);
34124             test_ret++;
34125             printf(" %d", n_ctxt);
34126             printf(" %d", n_doc);
34127             printf("\n");
34128         }
34129     }
34130     }
34131     function_tests++;
34132 #endif
34133
34134     return(test_ret);
34135 }
34136
34137
34138 static int
34139 test_xmlSaveFlush(void) {
34140     int test_ret = 0;
34141
34142 #if defined(LIBXML_OUTPUT_ENABLED)
34143     int mem_base;
34144     int ret_val;
34145     xmlSaveCtxtPtr ctxt; /* a document saving context */
34146     int n_ctxt;
34147
34148     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34149         mem_base = xmlMemBlocks();
34150         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34151
34152         ret_val = xmlSaveFlush(ctxt);
34153         desret_int(ret_val);
34154         call_tests++;
34155         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34156         xmlResetLastError();
34157         if (mem_base != xmlMemBlocks()) {
34158             printf("Leak of %d blocks found in xmlSaveFlush",
34159                    xmlMemBlocks() - mem_base);
34160             test_ret++;
34161             printf(" %d", n_ctxt);
34162             printf("\n");
34163         }
34164     }
34165     function_tests++;
34166 #endif
34167
34168     return(test_ret);
34169 }
34170
34171
34172 static int
34173 test_xmlSaveSetAttrEscape(void) {
34174     int test_ret = 0;
34175
34176
34177     /* missing type support */
34178     return(test_ret);
34179 }
34180
34181
34182 static int
34183 test_xmlSaveSetEscape(void) {
34184     int test_ret = 0;
34185
34186
34187     /* missing type support */
34188     return(test_ret);
34189 }
34190
34191
34192 static int
34193 test_xmlSaveToBuffer(void) {
34194     int test_ret = 0;
34195
34196
34197     /* missing type support */
34198     return(test_ret);
34199 }
34200
34201
34202 static int
34203 test_xmlSaveToFd(void) {
34204     int test_ret = 0;
34205
34206
34207     /* missing type support */
34208     return(test_ret);
34209 }
34210
34211
34212 static int
34213 test_xmlSaveToFilename(void) {
34214     int test_ret = 0;
34215
34216
34217     /* missing type support */
34218     return(test_ret);
34219 }
34220
34221
34222 static int
34223 test_xmlSaveTree(void) {
34224     int test_ret = 0;
34225
34226 #if defined(LIBXML_OUTPUT_ENABLED)
34227     int mem_base;
34228     long ret_val;
34229     xmlSaveCtxtPtr ctxt; /* a document saving context */
34230     int n_ctxt;
34231     xmlNodePtr node; /* the top node of the subtree to save */
34232     int n_node;
34233
34234     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34235     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
34236         mem_base = xmlMemBlocks();
34237         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34238         node = gen_xmlNodePtr(n_node, 1);
34239
34240         ret_val = xmlSaveTree(ctxt, node);
34241         desret_long(ret_val);
34242         call_tests++;
34243         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34244         des_xmlNodePtr(n_node, node, 1);
34245         xmlResetLastError();
34246         if (mem_base != xmlMemBlocks()) {
34247             printf("Leak of %d blocks found in xmlSaveTree",
34248                    xmlMemBlocks() - mem_base);
34249             test_ret++;
34250             printf(" %d", n_ctxt);
34251             printf(" %d", n_node);
34252             printf("\n");
34253         }
34254     }
34255     }
34256     function_tests++;
34257 #endif
34258
34259     return(test_ret);
34260 }
34261
34262 static int
34263 test_xmlsave(void) {
34264     int test_ret = 0;
34265
34266     if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
34267     test_ret += test_xmlSaveClose();
34268     test_ret += test_xmlSaveDoc();
34269     test_ret += test_xmlSaveFlush();
34270     test_ret += test_xmlSaveSetAttrEscape();
34271     test_ret += test_xmlSaveSetEscape();
34272     test_ret += test_xmlSaveToBuffer();
34273     test_ret += test_xmlSaveToFd();
34274     test_ret += test_xmlSaveToFilename();
34275     test_ret += test_xmlSaveTree();
34276
34277     if (test_ret != 0)
34278         printf("Module xmlsave: %d errors\n", test_ret);
34279     return(test_ret);
34280 }
34281
34282 static int
34283 test_xmlSchemaDump(void) {
34284     int test_ret = 0;
34285
34286 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
34287     int mem_base;
34288     FILE * output; /* the file output */
34289     int n_output;
34290     xmlSchemaPtr schema; /* a schema structure */
34291     int n_schema;
34292
34293     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
34294     for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
34295         mem_base = xmlMemBlocks();
34296         output = gen_FILE_ptr(n_output, 0);
34297         schema = gen_xmlSchemaPtr(n_schema, 1);
34298
34299         xmlSchemaDump(output, schema);
34300         call_tests++;
34301         des_FILE_ptr(n_output, output, 0);
34302         des_xmlSchemaPtr(n_schema, schema, 1);
34303         xmlResetLastError();
34304         if (mem_base != xmlMemBlocks()) {
34305             printf("Leak of %d blocks found in xmlSchemaDump",
34306                    xmlMemBlocks() - mem_base);
34307             test_ret++;
34308             printf(" %d", n_output);
34309             printf(" %d", n_schema);
34310             printf("\n");
34311         }
34312     }
34313     }
34314     function_tests++;
34315 #endif
34316
34317     return(test_ret);
34318 }
34319
34320 #ifdef LIBXML_SCHEMAS_ENABLED
34321
34322 #define gen_nb_xmlSchemaParserCtxtPtr 1
34323 static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34324     return(NULL);
34325 }
34326 static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34327 }
34328 #endif
34329
34330 #ifdef LIBXML_SCHEMAS_ENABLED
34331
34332 #define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
34333 static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34334     return(NULL);
34335 }
34336 static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34337 }
34338 #endif
34339
34340 #ifdef LIBXML_SCHEMAS_ENABLED
34341
34342 #define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
34343 static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34344     return(NULL);
34345 }
34346 static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34347 }
34348 #endif
34349
34350
34351 static int
34352 test_xmlSchemaGetParserErrors(void) {
34353     int test_ret = 0;
34354
34355 #if defined(LIBXML_SCHEMAS_ENABLED)
34356     int mem_base;
34357     int ret_val;
34358     xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
34359     int n_ctxt;
34360     xmlSchemaValidityErrorFunc * err; /* the error callback result */
34361     int n_err;
34362     xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
34363     int n_warn;
34364     void ** ctx; /* contextual data for the callbacks result */
34365     int n_ctx;
34366
34367     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
34368     for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34369     for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34370     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34371         mem_base = xmlMemBlocks();
34372         ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
34373         err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34374         warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34375         ctx = gen_void_ptr_ptr(n_ctx, 3);
34376
34377         ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
34378         desret_int(ret_val);
34379         call_tests++;
34380         des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
34381         des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34382         des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34383         des_void_ptr_ptr(n_ctx, ctx, 3);
34384         xmlResetLastError();
34385         if (mem_base != xmlMemBlocks()) {
34386             printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
34387                    xmlMemBlocks() - mem_base);
34388             test_ret++;
34389             printf(" %d", n_ctxt);
34390             printf(" %d", n_err);
34391             printf(" %d", n_warn);
34392             printf(" %d", n_ctx);
34393             printf("\n");
34394         }
34395     }
34396     }
34397     }
34398     }
34399     function_tests++;
34400 #endif
34401
34402     return(test_ret);
34403 }
34404
34405
34406 static int
34407 test_xmlSchemaGetValidErrors(void) {
34408     int test_ret = 0;
34409
34410 #if defined(LIBXML_SCHEMAS_ENABLED)
34411     int mem_base;
34412     int ret_val;
34413     xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
34414     int n_ctxt;
34415     xmlSchemaValidityErrorFunc * err; /* the error function result */
34416     int n_err;
34417     xmlSchemaValidityWarningFunc * warn; /* the warning function result */
34418     int n_warn;
34419     void ** ctx; /* the functions context result */
34420     int n_ctx;
34421
34422     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34423     for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34424     for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34425     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34426         mem_base = xmlMemBlocks();
34427         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34428         err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34429         warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34430         ctx = gen_void_ptr_ptr(n_ctx, 3);
34431
34432         ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
34433         desret_int(ret_val);
34434         call_tests++;
34435         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34436         des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34437         des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34438         des_void_ptr_ptr(n_ctx, ctx, 3);
34439         xmlResetLastError();
34440         if (mem_base != xmlMemBlocks()) {
34441             printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
34442                    xmlMemBlocks() - mem_base);
34443             test_ret++;
34444             printf(" %d", n_ctxt);
34445             printf(" %d", n_err);
34446             printf(" %d", n_warn);
34447             printf(" %d", n_ctx);
34448             printf("\n");
34449         }
34450     }
34451     }
34452     }
34453     }
34454     function_tests++;
34455 #endif
34456
34457     return(test_ret);
34458 }
34459
34460
34461 static int
34462 test_xmlSchemaIsValid(void) {
34463     int test_ret = 0;
34464
34465 #if defined(LIBXML_SCHEMAS_ENABLED)
34466     int mem_base;
34467     int ret_val;
34468     xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
34469     int n_ctxt;
34470
34471     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34472         mem_base = xmlMemBlocks();
34473         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34474
34475         ret_val = xmlSchemaIsValid(ctxt);
34476         desret_int(ret_val);
34477         call_tests++;
34478         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34479         xmlResetLastError();
34480         if (mem_base != xmlMemBlocks()) {
34481             printf("Leak of %d blocks found in xmlSchemaIsValid",
34482                    xmlMemBlocks() - mem_base);
34483             test_ret++;
34484             printf(" %d", n_ctxt);
34485             printf("\n");
34486         }
34487     }
34488     function_tests++;
34489 #endif
34490
34491     return(test_ret);
34492 }
34493
34494
34495 static int
34496 test_xmlSchemaNewDocParserCtxt(void) {
34497     int test_ret = 0;
34498
34499 #if defined(LIBXML_SCHEMAS_ENABLED)
34500     int mem_base;
34501     xmlSchemaParserCtxtPtr ret_val;
34502     xmlDocPtr doc; /* a preparsed document tree */
34503     int n_doc;
34504
34505     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34506         mem_base = xmlMemBlocks();
34507         doc = gen_xmlDocPtr(n_doc, 0);
34508
34509         ret_val = xmlSchemaNewDocParserCtxt(doc);
34510         desret_xmlSchemaParserCtxtPtr(ret_val);
34511         call_tests++;
34512         des_xmlDocPtr(n_doc, doc, 0);
34513         xmlResetLastError();
34514         if (mem_base != xmlMemBlocks()) {
34515             printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
34516                    xmlMemBlocks() - mem_base);
34517             test_ret++;
34518             printf(" %d", n_doc);
34519             printf("\n");
34520         }
34521     }
34522     function_tests++;
34523 #endif
34524
34525     return(test_ret);
34526 }
34527
34528
34529 static int
34530 test_xmlSchemaNewMemParserCtxt(void) {
34531     int test_ret = 0;
34532
34533 #if defined(LIBXML_SCHEMAS_ENABLED)
34534     int mem_base;
34535     xmlSchemaParserCtxtPtr ret_val;
34536     char * buffer; /* a pointer to a char array containing the schemas */
34537     int n_buffer;
34538     int size; /* the size of the array */
34539     int n_size;
34540
34541     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
34542     for (n_size = 0;n_size < gen_nb_int;n_size++) {
34543         mem_base = xmlMemBlocks();
34544         buffer = gen_const_char_ptr(n_buffer, 0);
34545         size = gen_int(n_size, 1);
34546         if ((buffer != NULL) &&
34547             (size > (int) strlen((const char *) buffer) + 1))
34548             continue;
34549
34550         ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
34551         desret_xmlSchemaParserCtxtPtr(ret_val);
34552         call_tests++;
34553         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
34554         des_int(n_size, size, 1);
34555         xmlResetLastError();
34556         if (mem_base != xmlMemBlocks()) {
34557             printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
34558                    xmlMemBlocks() - mem_base);
34559             test_ret++;
34560             printf(" %d", n_buffer);
34561             printf(" %d", n_size);
34562             printf("\n");
34563         }
34564     }
34565     }
34566     function_tests++;
34567 #endif
34568
34569     return(test_ret);
34570 }
34571
34572
34573 static int
34574 test_xmlSchemaNewParserCtxt(void) {
34575     int test_ret = 0;
34576
34577 #if defined(LIBXML_SCHEMAS_ENABLED)
34578     int mem_base;
34579     xmlSchemaParserCtxtPtr ret_val;
34580     char * URL; /* the location of the schema */
34581     int n_URL;
34582
34583     for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
34584         mem_base = xmlMemBlocks();
34585         URL = gen_const_char_ptr(n_URL, 0);
34586
34587         ret_val = xmlSchemaNewParserCtxt((const char *)URL);
34588         desret_xmlSchemaParserCtxtPtr(ret_val);
34589         call_tests++;
34590         des_const_char_ptr(n_URL, (const char *)URL, 0);
34591         xmlResetLastError();
34592         if (mem_base != xmlMemBlocks()) {
34593             printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
34594                    xmlMemBlocks() - mem_base);
34595             test_ret++;
34596             printf(" %d", n_URL);
34597             printf("\n");
34598         }
34599     }
34600     function_tests++;
34601 #endif
34602
34603     return(test_ret);
34604 }
34605
34606
34607 static int
34608 test_xmlSchemaNewValidCtxt(void) {
34609     int test_ret = 0;
34610
34611
34612     /* missing type support */
34613     return(test_ret);
34614 }
34615
34616
34617 static int
34618 test_xmlSchemaParse(void) {
34619     int test_ret = 0;
34620
34621
34622     /* missing type support */
34623     return(test_ret);
34624 }
34625
34626 #ifdef LIBXML_SCHEMAS_ENABLED
34627
34628 #define gen_nb_xmlSAXHandlerPtr_ptr 1
34629 static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34630     return(NULL);
34631 }
34632 static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34633 }
34634 #endif
34635
34636
34637 static int
34638 test_xmlSchemaSAXPlug(void) {
34639     int test_ret = 0;
34640
34641
34642     /* missing type support */
34643     return(test_ret);
34644 }
34645
34646 #ifdef LIBXML_SCHEMAS_ENABLED
34647
34648 #define gen_nb_xmlSchemaSAXPlugPtr 1
34649 static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34650     return(NULL);
34651 }
34652 static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34653 }
34654 #endif
34655
34656
34657 static int
34658 test_xmlSchemaSAXUnplug(void) {
34659     int test_ret = 0;
34660
34661 #if defined(LIBXML_SCHEMAS_ENABLED)
34662     int mem_base;
34663     int ret_val;
34664     xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
34665     int n_plug;
34666
34667     for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
34668         mem_base = xmlMemBlocks();
34669         plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
34670
34671         ret_val = xmlSchemaSAXUnplug(plug);
34672         desret_int(ret_val);
34673         call_tests++;
34674         des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
34675         xmlResetLastError();
34676         if (mem_base != xmlMemBlocks()) {
34677             printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
34678                    xmlMemBlocks() - mem_base);
34679             test_ret++;
34680             printf(" %d", n_plug);
34681             printf("\n");
34682         }
34683     }
34684     function_tests++;
34685 #endif
34686
34687     return(test_ret);
34688 }
34689
34690
34691 static int
34692 test_xmlSchemaSetParserErrors(void) {
34693     int test_ret = 0;
34694
34695
34696     /* missing type support */
34697     return(test_ret);
34698 }
34699
34700
34701 static int
34702 test_xmlSchemaSetParserStructuredErrors(void) {
34703     int test_ret = 0;
34704
34705
34706     /* missing type support */
34707     return(test_ret);
34708 }
34709
34710
34711 static int
34712 test_xmlSchemaSetValidErrors(void) {
34713     int test_ret = 0;
34714
34715
34716     /* missing type support */
34717     return(test_ret);
34718 }
34719
34720
34721 static int
34722 test_xmlSchemaSetValidOptions(void) {
34723     int test_ret = 0;
34724
34725 #if defined(LIBXML_SCHEMAS_ENABLED)
34726     int mem_base;
34727     int ret_val;
34728     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34729     int n_ctxt;
34730     int options; /* a combination of xmlSchemaValidOption */
34731     int n_options;
34732
34733     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34734     for (n_options = 0;n_options < gen_nb_int;n_options++) {
34735         mem_base = xmlMemBlocks();
34736         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34737         options = gen_int(n_options, 1);
34738
34739         ret_val = xmlSchemaSetValidOptions(ctxt, options);
34740         desret_int(ret_val);
34741         call_tests++;
34742         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34743         des_int(n_options, options, 1);
34744         xmlResetLastError();
34745         if (mem_base != xmlMemBlocks()) {
34746             printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
34747                    xmlMemBlocks() - mem_base);
34748             test_ret++;
34749             printf(" %d", n_ctxt);
34750             printf(" %d", n_options);
34751             printf("\n");
34752         }
34753     }
34754     }
34755     function_tests++;
34756 #endif
34757
34758     return(test_ret);
34759 }
34760
34761
34762 static int
34763 test_xmlSchemaSetValidStructuredErrors(void) {
34764     int test_ret = 0;
34765
34766
34767     /* missing type support */
34768     return(test_ret);
34769 }
34770
34771
34772 static int
34773 test_xmlSchemaValidCtxtGetOptions(void) {
34774     int test_ret = 0;
34775
34776 #if defined(LIBXML_SCHEMAS_ENABLED)
34777     int mem_base;
34778     int ret_val;
34779     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34780     int n_ctxt;
34781
34782     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34783         mem_base = xmlMemBlocks();
34784         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34785
34786         ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
34787         desret_int(ret_val);
34788         call_tests++;
34789         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34790         xmlResetLastError();
34791         if (mem_base != xmlMemBlocks()) {
34792             printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
34793                    xmlMemBlocks() - mem_base);
34794             test_ret++;
34795             printf(" %d", n_ctxt);
34796             printf("\n");
34797         }
34798     }
34799     function_tests++;
34800 #endif
34801
34802     return(test_ret);
34803 }
34804
34805
34806 static int
34807 test_xmlSchemaValidCtxtGetParserCtxt(void) {
34808     int test_ret = 0;
34809
34810 #if defined(LIBXML_SCHEMAS_ENABLED)
34811     int mem_base;
34812     xmlParserCtxtPtr ret_val;
34813     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34814     int n_ctxt;
34815
34816     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34817         mem_base = xmlMemBlocks();
34818         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34819
34820         ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
34821         desret_xmlParserCtxtPtr(ret_val);
34822         call_tests++;
34823         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34824         xmlResetLastError();
34825         if (mem_base != xmlMemBlocks()) {
34826             printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
34827                    xmlMemBlocks() - mem_base);
34828             test_ret++;
34829             printf(" %d", n_ctxt);
34830             printf("\n");
34831         }
34832     }
34833     function_tests++;
34834 #endif
34835
34836     return(test_ret);
34837 }
34838
34839
34840 static int
34841 test_xmlSchemaValidateDoc(void) {
34842     int test_ret = 0;
34843
34844 #if defined(LIBXML_SCHEMAS_ENABLED)
34845     int mem_base;
34846     int ret_val;
34847     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34848     int n_ctxt;
34849     xmlDocPtr doc; /* a parsed document tree */
34850     int n_doc;
34851
34852     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34853     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34854         mem_base = xmlMemBlocks();
34855         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34856         doc = gen_xmlDocPtr(n_doc, 1);
34857
34858         ret_val = xmlSchemaValidateDoc(ctxt, doc);
34859         desret_int(ret_val);
34860         call_tests++;
34861         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34862         des_xmlDocPtr(n_doc, doc, 1);
34863         xmlResetLastError();
34864         if (mem_base != xmlMemBlocks()) {
34865             printf("Leak of %d blocks found in xmlSchemaValidateDoc",
34866                    xmlMemBlocks() - mem_base);
34867             test_ret++;
34868             printf(" %d", n_ctxt);
34869             printf(" %d", n_doc);
34870             printf("\n");
34871         }
34872     }
34873     }
34874     function_tests++;
34875 #endif
34876
34877     return(test_ret);
34878 }
34879
34880
34881 static int
34882 test_xmlSchemaValidateFile(void) {
34883     int test_ret = 0;
34884
34885 #if defined(LIBXML_SCHEMAS_ENABLED)
34886     int mem_base;
34887     int ret_val;
34888     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34889     int n_ctxt;
34890     const char * filename; /* the URI of the instance */
34891     int n_filename;
34892     int options; /* a future set of options, currently unused */
34893     int n_options;
34894
34895     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34896     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34897     for (n_options = 0;n_options < gen_nb_int;n_options++) {
34898         mem_base = xmlMemBlocks();
34899         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34900         filename = gen_filepath(n_filename, 1);
34901         options = gen_int(n_options, 2);
34902
34903         ret_val = xmlSchemaValidateFile(ctxt, filename, options);
34904         desret_int(ret_val);
34905         call_tests++;
34906         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34907         des_filepath(n_filename, filename, 1);
34908         des_int(n_options, options, 2);
34909         xmlResetLastError();
34910         if (mem_base != xmlMemBlocks()) {
34911             printf("Leak of %d blocks found in xmlSchemaValidateFile",
34912                    xmlMemBlocks() - mem_base);
34913             test_ret++;
34914             printf(" %d", n_ctxt);
34915             printf(" %d", n_filename);
34916             printf(" %d", n_options);
34917             printf("\n");
34918         }
34919     }
34920     }
34921     }
34922     function_tests++;
34923 #endif
34924
34925     return(test_ret);
34926 }
34927
34928
34929 static int
34930 test_xmlSchemaValidateOneElement(void) {
34931     int test_ret = 0;
34932
34933 #if defined(LIBXML_SCHEMAS_ENABLED)
34934     int mem_base;
34935     int ret_val;
34936     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34937     int n_ctxt;
34938     xmlNodePtr elem; /* an element node */
34939     int n_elem;
34940
34941     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34942     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
34943         mem_base = xmlMemBlocks();
34944         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34945         elem = gen_xmlNodePtr(n_elem, 1);
34946
34947         ret_val = xmlSchemaValidateOneElement(ctxt, elem);
34948         desret_int(ret_val);
34949         call_tests++;
34950         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34951         des_xmlNodePtr(n_elem, elem, 1);
34952         xmlResetLastError();
34953         if (mem_base != xmlMemBlocks()) {
34954             printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
34955                    xmlMemBlocks() - mem_base);
34956             test_ret++;
34957             printf(" %d", n_ctxt);
34958             printf(" %d", n_elem);
34959             printf("\n");
34960         }
34961     }
34962     }
34963     function_tests++;
34964 #endif
34965
34966     return(test_ret);
34967 }
34968
34969
34970 static int
34971 test_xmlSchemaValidateSetFilename(void) {
34972     int test_ret = 0;
34973
34974 #if defined(LIBXML_SCHEMAS_ENABLED)
34975     int mem_base;
34976     xmlSchemaValidCtxtPtr vctxt; /* the schema validation context */
34977     int n_vctxt;
34978     const char * filename; /* the file name */
34979     int n_filename;
34980
34981     for (n_vctxt = 0;n_vctxt < gen_nb_xmlSchemaValidCtxtPtr;n_vctxt++) {
34982     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34983         mem_base = xmlMemBlocks();
34984         vctxt = gen_xmlSchemaValidCtxtPtr(n_vctxt, 0);
34985         filename = gen_filepath(n_filename, 1);
34986
34987         xmlSchemaValidateSetFilename(vctxt, filename);
34988         call_tests++;
34989         des_xmlSchemaValidCtxtPtr(n_vctxt, vctxt, 0);
34990         des_filepath(n_filename, filename, 1);
34991         xmlResetLastError();
34992         if (mem_base != xmlMemBlocks()) {
34993             printf("Leak of %d blocks found in xmlSchemaValidateSetFilename",
34994                    xmlMemBlocks() - mem_base);
34995             test_ret++;
34996             printf(" %d", n_vctxt);
34997             printf(" %d", n_filename);
34998             printf("\n");
34999         }
35000     }
35001     }
35002     function_tests++;
35003 #endif
35004
35005     return(test_ret);
35006 }
35007
35008
35009 static int
35010 test_xmlSchemaValidateSetLocator(void) {
35011     int test_ret = 0;
35012
35013
35014     /* missing type support */
35015     return(test_ret);
35016 }
35017
35018
35019 static int
35020 test_xmlSchemaValidateStream(void) {
35021     int test_ret = 0;
35022
35023 #if defined(LIBXML_SCHEMAS_ENABLED)
35024     int mem_base;
35025     int ret_val;
35026     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
35027     int n_ctxt;
35028     xmlParserInputBufferPtr input; /* the input to use for reading the data */
35029     int n_input;
35030     xmlCharEncoding enc; /* an optional encoding information */
35031     int n_enc;
35032     xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
35033     int n_sax;
35034     void * user_data; /* the context to provide to the SAX handler. */
35035     int n_user_data;
35036
35037     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35038     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
35039     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
35040     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
35041     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
35042         mem_base = xmlMemBlocks();
35043         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35044         input = gen_xmlParserInputBufferPtr(n_input, 1);
35045         enc = gen_xmlCharEncoding(n_enc, 2);
35046         sax = gen_xmlSAXHandlerPtr(n_sax, 3);
35047         user_data = gen_userdata(n_user_data, 4);
35048
35049         ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
35050         desret_int(ret_val);
35051         call_tests++;
35052         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35053         des_xmlParserInputBufferPtr(n_input, input, 1);
35054         des_xmlCharEncoding(n_enc, enc, 2);
35055         des_xmlSAXHandlerPtr(n_sax, sax, 3);
35056         des_userdata(n_user_data, user_data, 4);
35057         xmlResetLastError();
35058         if (mem_base != xmlMemBlocks()) {
35059             printf("Leak of %d blocks found in xmlSchemaValidateStream",
35060                    xmlMemBlocks() - mem_base);
35061             test_ret++;
35062             printf(" %d", n_ctxt);
35063             printf(" %d", n_input);
35064             printf(" %d", n_enc);
35065             printf(" %d", n_sax);
35066             printf(" %d", n_user_data);
35067             printf("\n");
35068         }
35069     }
35070     }
35071     }
35072     }
35073     }
35074     function_tests++;
35075 #endif
35076
35077     return(test_ret);
35078 }
35079
35080 static int
35081 test_xmlschemas(void) {
35082     int test_ret = 0;
35083
35084     if (quiet == 0) printf("Testing xmlschemas : 16 of 27 functions ...\n");
35085     test_ret += test_xmlSchemaDump();
35086     test_ret += test_xmlSchemaGetParserErrors();
35087     test_ret += test_xmlSchemaGetValidErrors();
35088     test_ret += test_xmlSchemaIsValid();
35089     test_ret += test_xmlSchemaNewDocParserCtxt();
35090     test_ret += test_xmlSchemaNewMemParserCtxt();
35091     test_ret += test_xmlSchemaNewParserCtxt();
35092     test_ret += test_xmlSchemaNewValidCtxt();
35093     test_ret += test_xmlSchemaParse();
35094     test_ret += test_xmlSchemaSAXPlug();
35095     test_ret += test_xmlSchemaSAXUnplug();
35096     test_ret += test_xmlSchemaSetParserErrors();
35097     test_ret += test_xmlSchemaSetParserStructuredErrors();
35098     test_ret += test_xmlSchemaSetValidErrors();
35099     test_ret += test_xmlSchemaSetValidOptions();
35100     test_ret += test_xmlSchemaSetValidStructuredErrors();
35101     test_ret += test_xmlSchemaValidCtxtGetOptions();
35102     test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
35103     test_ret += test_xmlSchemaValidateDoc();
35104     test_ret += test_xmlSchemaValidateFile();
35105     test_ret += test_xmlSchemaValidateOneElement();
35106     test_ret += test_xmlSchemaValidateSetFilename();
35107     test_ret += test_xmlSchemaValidateSetLocator();
35108     test_ret += test_xmlSchemaValidateStream();
35109
35110     if (test_ret != 0)
35111         printf("Module xmlschemas: %d errors\n", test_ret);
35112     return(test_ret);
35113 }
35114 #ifdef LIBXML_SCHEMAS_ENABLED
35115
35116 #define gen_nb_xmlSchemaFacetPtr 1
35117 static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35118     return(NULL);
35119 }
35120 static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35121 }
35122 #endif
35123
35124 #ifdef LIBXML_SCHEMAS_ENABLED
35125
35126 #define gen_nb_xmlSchemaTypePtr 1
35127 static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35128     return(NULL);
35129 }
35130 static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35131 }
35132 #endif
35133
35134
35135 static int
35136 test_xmlSchemaCheckFacet(void) {
35137     int test_ret = 0;
35138
35139 #if defined(LIBXML_SCHEMAS_ENABLED)
35140     int mem_base;
35141     int ret_val;
35142     xmlSchemaFacetPtr facet; /* the facet */
35143     int n_facet;
35144     xmlSchemaTypePtr typeDecl; /* the schema type definition */
35145     int n_typeDecl;
35146     xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
35147     int n_pctxt;
35148     xmlChar * name; /* the optional name of the type */
35149     int n_name;
35150
35151     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35152     for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
35153     for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
35154     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35155         mem_base = xmlMemBlocks();
35156         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35157         typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
35158         pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
35159         name = gen_const_xmlChar_ptr(n_name, 3);
35160
35161         ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
35162         desret_int(ret_val);
35163         call_tests++;
35164         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35165         des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
35166         des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
35167         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
35168         xmlResetLastError();
35169         if (mem_base != xmlMemBlocks()) {
35170             printf("Leak of %d blocks found in xmlSchemaCheckFacet",
35171                    xmlMemBlocks() - mem_base);
35172             test_ret++;
35173             printf(" %d", n_facet);
35174             printf(" %d", n_typeDecl);
35175             printf(" %d", n_pctxt);
35176             printf(" %d", n_name);
35177             printf("\n");
35178         }
35179     }
35180     }
35181     }
35182     }
35183     function_tests++;
35184 #endif
35185
35186     return(test_ret);
35187 }
35188
35189
35190 static int
35191 test_xmlSchemaCleanupTypes(void) {
35192     int test_ret = 0;
35193
35194 #if defined(LIBXML_SCHEMAS_ENABLED)
35195
35196
35197         xmlSchemaCleanupTypes();
35198         call_tests++;
35199         xmlResetLastError();
35200     function_tests++;
35201 #endif
35202
35203     return(test_ret);
35204 }
35205
35206
35207 static int
35208 test_xmlSchemaCollapseString(void) {
35209     int test_ret = 0;
35210
35211 #if defined(LIBXML_SCHEMAS_ENABLED)
35212     int mem_base;
35213     xmlChar * ret_val;
35214     xmlChar * value; /* a value */
35215     int n_value;
35216
35217     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35218         mem_base = xmlMemBlocks();
35219         value = gen_const_xmlChar_ptr(n_value, 0);
35220
35221         ret_val = xmlSchemaCollapseString((const xmlChar *)value);
35222         desret_xmlChar_ptr(ret_val);
35223         call_tests++;
35224         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
35225         xmlResetLastError();
35226         if (mem_base != xmlMemBlocks()) {
35227             printf("Leak of %d blocks found in xmlSchemaCollapseString",
35228                    xmlMemBlocks() - mem_base);
35229             test_ret++;
35230             printf(" %d", n_value);
35231             printf("\n");
35232         }
35233     }
35234     function_tests++;
35235 #endif
35236
35237     return(test_ret);
35238 }
35239
35240 #ifdef LIBXML_SCHEMAS_ENABLED
35241
35242 #define gen_nb_xmlSchemaValPtr 1
35243 static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35244     return(NULL);
35245 }
35246 static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35247 }
35248 #endif
35249
35250
35251 static int
35252 test_xmlSchemaCompareValues(void) {
35253     int test_ret = 0;
35254
35255 #if defined(LIBXML_SCHEMAS_ENABLED)
35256     int mem_base;
35257     int ret_val;
35258     xmlSchemaValPtr x; /* a first value */
35259     int n_x;
35260     xmlSchemaValPtr y; /* a second value */
35261     int n_y;
35262
35263     for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
35264     for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
35265         mem_base = xmlMemBlocks();
35266         x = gen_xmlSchemaValPtr(n_x, 0);
35267         y = gen_xmlSchemaValPtr(n_y, 1);
35268
35269         ret_val = xmlSchemaCompareValues(x, y);
35270         desret_int(ret_val);
35271         call_tests++;
35272         des_xmlSchemaValPtr(n_x, x, 0);
35273         des_xmlSchemaValPtr(n_y, y, 1);
35274         xmlResetLastError();
35275         if (mem_base != xmlMemBlocks()) {
35276             printf("Leak of %d blocks found in xmlSchemaCompareValues",
35277                    xmlMemBlocks() - mem_base);
35278             test_ret++;
35279             printf(" %d", n_x);
35280             printf(" %d", n_y);
35281             printf("\n");
35282         }
35283     }
35284     }
35285     function_tests++;
35286 #endif
35287
35288     return(test_ret);
35289 }
35290
35291
35292 static int
35293 test_xmlSchemaCompareValuesWhtsp(void) {
35294     int test_ret = 0;
35295
35296 #if defined(LIBXML_SCHEMAS_ENABLED)
35297     int mem_base;
35298     int ret_val;
35299     xmlSchemaValPtr x; /* a first value */
35300     int n_x;
35301     xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
35302     int n_xws;
35303     xmlSchemaValPtr y; /* a second value */
35304     int n_y;
35305     xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
35306     int n_yws;
35307
35308     for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
35309     for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
35310     for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
35311     for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
35312         mem_base = xmlMemBlocks();
35313         x = gen_xmlSchemaValPtr(n_x, 0);
35314         xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
35315         y = gen_xmlSchemaValPtr(n_y, 2);
35316         yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
35317
35318         ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
35319         desret_int(ret_val);
35320         call_tests++;
35321         des_xmlSchemaValPtr(n_x, x, 0);
35322         des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
35323         des_xmlSchemaValPtr(n_y, y, 2);
35324         des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
35325         xmlResetLastError();
35326         if (mem_base != xmlMemBlocks()) {
35327             printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
35328                    xmlMemBlocks() - mem_base);
35329             test_ret++;
35330             printf(" %d", n_x);
35331             printf(" %d", n_xws);
35332             printf(" %d", n_y);
35333             printf(" %d", n_yws);
35334             printf("\n");
35335         }
35336     }
35337     }
35338     }
35339     }
35340     function_tests++;
35341 #endif
35342
35343     return(test_ret);
35344 }
35345
35346
35347 static int
35348 test_xmlSchemaCopyValue(void) {
35349     int test_ret = 0;
35350
35351
35352     /* missing type support */
35353     return(test_ret);
35354 }
35355
35356
35357 static int
35358 test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
35359     int test_ret = 0;
35360
35361 #if defined(LIBXML_SCHEMAS_ENABLED)
35362     int mem_base;
35363     xmlSchemaTypePtr ret_val;
35364     xmlSchemaTypePtr type; /* the built-in simple type. */
35365     int n_type;
35366
35367     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35368         mem_base = xmlMemBlocks();
35369         type = gen_xmlSchemaTypePtr(n_type, 0);
35370
35371         ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
35372         desret_xmlSchemaTypePtr(ret_val);
35373         call_tests++;
35374         des_xmlSchemaTypePtr(n_type, type, 0);
35375         xmlResetLastError();
35376         if (mem_base != xmlMemBlocks()) {
35377             printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
35378                    xmlMemBlocks() - mem_base);
35379             test_ret++;
35380             printf(" %d", n_type);
35381             printf("\n");
35382         }
35383     }
35384     function_tests++;
35385 #endif
35386
35387     return(test_ret);
35388 }
35389
35390
35391 static int
35392 test_xmlSchemaGetBuiltInType(void) {
35393     int test_ret = 0;
35394
35395 #if defined(LIBXML_SCHEMAS_ENABLED)
35396     xmlSchemaTypePtr ret_val;
35397     xmlSchemaValType type; /* the type of the built in type */
35398     int n_type;
35399
35400     for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
35401         type = gen_xmlSchemaValType(n_type, 0);
35402
35403         ret_val = xmlSchemaGetBuiltInType(type);
35404         desret_xmlSchemaTypePtr(ret_val);
35405         call_tests++;
35406         des_xmlSchemaValType(n_type, type, 0);
35407         xmlResetLastError();
35408     }
35409     function_tests++;
35410 #endif
35411
35412     return(test_ret);
35413 }
35414
35415
35416 static int
35417 test_xmlSchemaGetCanonValue(void) {
35418     int test_ret = 0;
35419
35420 #if defined(LIBXML_SCHEMAS_ENABLED)
35421     int mem_base;
35422     int ret_val;
35423     xmlSchemaValPtr val; /* the precomputed value */
35424     int n_val;
35425     xmlChar ** retValue; /* the returned value */
35426     int n_retValue;
35427
35428     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35429     for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35430         mem_base = xmlMemBlocks();
35431         val = gen_xmlSchemaValPtr(n_val, 0);
35432         retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35433
35434         ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
35435         desret_int(ret_val);
35436         call_tests++;
35437         des_xmlSchemaValPtr(n_val, val, 0);
35438         des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
35439         xmlResetLastError();
35440         if (mem_base != xmlMemBlocks()) {
35441             printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
35442                    xmlMemBlocks() - mem_base);
35443             test_ret++;
35444             printf(" %d", n_val);
35445             printf(" %d", n_retValue);
35446             printf("\n");
35447         }
35448     }
35449     }
35450     function_tests++;
35451 #endif
35452
35453     return(test_ret);
35454 }
35455
35456
35457 static int
35458 test_xmlSchemaGetCanonValueWhtsp(void) {
35459     int test_ret = 0;
35460
35461 #if defined(LIBXML_SCHEMAS_ENABLED)
35462     int mem_base;
35463     int ret_val;
35464     xmlSchemaValPtr val; /* the precomputed value */
35465     int n_val;
35466     xmlChar ** retValue; /* the returned value */
35467     int n_retValue;
35468     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35469     int n_ws;
35470
35471     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35472     for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35473     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35474         mem_base = xmlMemBlocks();
35475         val = gen_xmlSchemaValPtr(n_val, 0);
35476         retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35477         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
35478
35479         ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
35480         desret_int(ret_val);
35481         call_tests++;
35482         des_xmlSchemaValPtr(n_val, val, 0);
35483         des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
35484         des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
35485         xmlResetLastError();
35486         if (mem_base != xmlMemBlocks()) {
35487             printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
35488                    xmlMemBlocks() - mem_base);
35489             test_ret++;
35490             printf(" %d", n_val);
35491             printf(" %d", n_retValue);
35492             printf(" %d", n_ws);
35493             printf("\n");
35494         }
35495     }
35496     }
35497     }
35498     function_tests++;
35499 #endif
35500
35501     return(test_ret);
35502 }
35503
35504
35505 static int
35506 test_xmlSchemaGetFacetValueAsULong(void) {
35507     int test_ret = 0;
35508
35509 #if defined(LIBXML_SCHEMAS_ENABLED)
35510     int mem_base;
35511     unsigned long ret_val;
35512     xmlSchemaFacetPtr facet; /* an schemas type facet */
35513     int n_facet;
35514
35515     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35516         mem_base = xmlMemBlocks();
35517         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35518
35519         ret_val = xmlSchemaGetFacetValueAsULong(facet);
35520         desret_unsigned_long(ret_val);
35521         call_tests++;
35522         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35523         xmlResetLastError();
35524         if (mem_base != xmlMemBlocks()) {
35525             printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
35526                    xmlMemBlocks() - mem_base);
35527             test_ret++;
35528             printf(" %d", n_facet);
35529             printf("\n");
35530         }
35531     }
35532     function_tests++;
35533 #endif
35534
35535     return(test_ret);
35536 }
35537
35538
35539 static int
35540 test_xmlSchemaGetPredefinedType(void) {
35541     int test_ret = 0;
35542
35543 #if defined(LIBXML_SCHEMAS_ENABLED)
35544     int mem_base;
35545     xmlSchemaTypePtr ret_val;
35546     xmlChar * name; /* the type name */
35547     int n_name;
35548     xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
35549     int n_ns;
35550
35551     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35552     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
35553         mem_base = xmlMemBlocks();
35554         name = gen_const_xmlChar_ptr(n_name, 0);
35555         ns = gen_const_xmlChar_ptr(n_ns, 1);
35556
35557         ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
35558         desret_xmlSchemaTypePtr(ret_val);
35559         call_tests++;
35560         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
35561         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
35562         xmlResetLastError();
35563         if (mem_base != xmlMemBlocks()) {
35564             printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
35565                    xmlMemBlocks() - mem_base);
35566             test_ret++;
35567             printf(" %d", n_name);
35568             printf(" %d", n_ns);
35569             printf("\n");
35570         }
35571     }
35572     }
35573     function_tests++;
35574 #endif
35575
35576     return(test_ret);
35577 }
35578
35579
35580 static int
35581 test_xmlSchemaGetValType(void) {
35582     int test_ret = 0;
35583
35584 #if defined(LIBXML_SCHEMAS_ENABLED)
35585     int mem_base;
35586     xmlSchemaValType ret_val;
35587     xmlSchemaValPtr val; /* a schemas value */
35588     int n_val;
35589
35590     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35591         mem_base = xmlMemBlocks();
35592         val = gen_xmlSchemaValPtr(n_val, 0);
35593
35594         ret_val = xmlSchemaGetValType(val);
35595         desret_xmlSchemaValType(ret_val);
35596         call_tests++;
35597         des_xmlSchemaValPtr(n_val, val, 0);
35598         xmlResetLastError();
35599         if (mem_base != xmlMemBlocks()) {
35600             printf("Leak of %d blocks found in xmlSchemaGetValType",
35601                    xmlMemBlocks() - mem_base);
35602             test_ret++;
35603             printf(" %d", n_val);
35604             printf("\n");
35605         }
35606     }
35607     function_tests++;
35608 #endif
35609
35610     return(test_ret);
35611 }
35612
35613
35614 static int
35615 test_xmlSchemaInitTypes(void) {
35616     int test_ret = 0;
35617
35618 #if defined(LIBXML_SCHEMAS_ENABLED)
35619
35620
35621         xmlSchemaInitTypes();
35622         call_tests++;
35623         xmlResetLastError();
35624     function_tests++;
35625 #endif
35626
35627     return(test_ret);
35628 }
35629
35630
35631 static int
35632 test_xmlSchemaIsBuiltInTypeFacet(void) {
35633     int test_ret = 0;
35634
35635 #if defined(LIBXML_SCHEMAS_ENABLED)
35636     int mem_base;
35637     int ret_val;
35638     xmlSchemaTypePtr type; /* the built-in type */
35639     int n_type;
35640     int facetType; /* the facet type */
35641     int n_facetType;
35642
35643     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35644     for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
35645         mem_base = xmlMemBlocks();
35646         type = gen_xmlSchemaTypePtr(n_type, 0);
35647         facetType = gen_int(n_facetType, 1);
35648
35649         ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
35650         desret_int(ret_val);
35651         call_tests++;
35652         des_xmlSchemaTypePtr(n_type, type, 0);
35653         des_int(n_facetType, facetType, 1);
35654         xmlResetLastError();
35655         if (mem_base != xmlMemBlocks()) {
35656             printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
35657                    xmlMemBlocks() - mem_base);
35658             test_ret++;
35659             printf(" %d", n_type);
35660             printf(" %d", n_facetType);
35661             printf("\n");
35662         }
35663     }
35664     }
35665     function_tests++;
35666 #endif
35667
35668     return(test_ret);
35669 }
35670
35671
35672 static int
35673 test_xmlSchemaNewFacet(void) {
35674     int test_ret = 0;
35675
35676
35677     /* missing type support */
35678     return(test_ret);
35679 }
35680
35681
35682 static int
35683 test_xmlSchemaNewNOTATIONValue(void) {
35684     int test_ret = 0;
35685
35686
35687     /* missing type support */
35688     return(test_ret);
35689 }
35690
35691
35692 static int
35693 test_xmlSchemaNewQNameValue(void) {
35694     int test_ret = 0;
35695
35696
35697     /* missing type support */
35698     return(test_ret);
35699 }
35700
35701
35702 static int
35703 test_xmlSchemaNewStringValue(void) {
35704     int test_ret = 0;
35705
35706
35707     /* missing type support */
35708     return(test_ret);
35709 }
35710
35711 #ifdef LIBXML_SCHEMAS_ENABLED
35712
35713 #define gen_nb_xmlSchemaValPtr_ptr 1
35714 static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35715     return(NULL);
35716 }
35717 static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35718 }
35719 #endif
35720
35721
35722 static int
35723 test_xmlSchemaValPredefTypeNode(void) {
35724     int test_ret = 0;
35725
35726 #if defined(LIBXML_SCHEMAS_ENABLED)
35727     int mem_base;
35728     int ret_val;
35729     xmlSchemaTypePtr type; /* the predefined type */
35730     int n_type;
35731     xmlChar * value; /* the value to check */
35732     int n_value;
35733     xmlSchemaValPtr * val; /* the return computed value */
35734     int n_val;
35735     xmlNodePtr node; /* the node containing the value */
35736     int n_node;
35737
35738     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35739     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35740     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35741     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35742         mem_base = xmlMemBlocks();
35743         type = gen_xmlSchemaTypePtr(n_type, 0);
35744         value = gen_const_xmlChar_ptr(n_value, 1);
35745         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35746         node = gen_xmlNodePtr(n_node, 3);
35747
35748         ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
35749         desret_int(ret_val);
35750         call_tests++;
35751         des_xmlSchemaTypePtr(n_type, type, 0);
35752         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35753         des_xmlSchemaValPtr_ptr(n_val, val, 2);
35754         des_xmlNodePtr(n_node, node, 3);
35755         xmlResetLastError();
35756         if (mem_base != xmlMemBlocks()) {
35757             printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
35758                    xmlMemBlocks() - mem_base);
35759             test_ret++;
35760             printf(" %d", n_type);
35761             printf(" %d", n_value);
35762             printf(" %d", n_val);
35763             printf(" %d", n_node);
35764             printf("\n");
35765         }
35766     }
35767     }
35768     }
35769     }
35770     function_tests++;
35771 #endif
35772
35773     return(test_ret);
35774 }
35775
35776
35777 static int
35778 test_xmlSchemaValPredefTypeNodeNoNorm(void) {
35779     int test_ret = 0;
35780
35781 #if defined(LIBXML_SCHEMAS_ENABLED)
35782     int mem_base;
35783     int ret_val;
35784     xmlSchemaTypePtr type; /* the predefined type */
35785     int n_type;
35786     xmlChar * value; /* the value to check */
35787     int n_value;
35788     xmlSchemaValPtr * val; /* the return computed value */
35789     int n_val;
35790     xmlNodePtr node; /* the node containing the value */
35791     int n_node;
35792
35793     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35794     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35795     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35796     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35797         mem_base = xmlMemBlocks();
35798         type = gen_xmlSchemaTypePtr(n_type, 0);
35799         value = gen_const_xmlChar_ptr(n_value, 1);
35800         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35801         node = gen_xmlNodePtr(n_node, 3);
35802
35803         ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
35804         desret_int(ret_val);
35805         call_tests++;
35806         des_xmlSchemaTypePtr(n_type, type, 0);
35807         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35808         des_xmlSchemaValPtr_ptr(n_val, val, 2);
35809         des_xmlNodePtr(n_node, node, 3);
35810         xmlResetLastError();
35811         if (mem_base != xmlMemBlocks()) {
35812             printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
35813                    xmlMemBlocks() - mem_base);
35814             test_ret++;
35815             printf(" %d", n_type);
35816             printf(" %d", n_value);
35817             printf(" %d", n_val);
35818             printf(" %d", n_node);
35819             printf("\n");
35820         }
35821     }
35822     }
35823     }
35824     }
35825     function_tests++;
35826 #endif
35827
35828     return(test_ret);
35829 }
35830
35831
35832 static int
35833 test_xmlSchemaValidateFacet(void) {
35834     int test_ret = 0;
35835
35836 #if defined(LIBXML_SCHEMAS_ENABLED)
35837     int mem_base;
35838     int ret_val;
35839     xmlSchemaTypePtr base; /* the base type */
35840     int n_base;
35841     xmlSchemaFacetPtr facet; /* the facet to check */
35842     int n_facet;
35843     xmlChar * value; /* the lexical repr of the value to validate */
35844     int n_value;
35845     xmlSchemaValPtr val; /* the precomputed value */
35846     int n_val;
35847
35848     for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
35849     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35850     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35851     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35852         mem_base = xmlMemBlocks();
35853         base = gen_xmlSchemaTypePtr(n_base, 0);
35854         facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35855         value = gen_const_xmlChar_ptr(n_value, 2);
35856         val = gen_xmlSchemaValPtr(n_val, 3);
35857
35858         ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
35859         desret_int(ret_val);
35860         call_tests++;
35861         des_xmlSchemaTypePtr(n_base, base, 0);
35862         des_xmlSchemaFacetPtr(n_facet, facet, 1);
35863         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35864         des_xmlSchemaValPtr(n_val, val, 3);
35865         xmlResetLastError();
35866         if (mem_base != xmlMemBlocks()) {
35867             printf("Leak of %d blocks found in xmlSchemaValidateFacet",
35868                    xmlMemBlocks() - mem_base);
35869             test_ret++;
35870             printf(" %d", n_base);
35871             printf(" %d", n_facet);
35872             printf(" %d", n_value);
35873             printf(" %d", n_val);
35874             printf("\n");
35875         }
35876     }
35877     }
35878     }
35879     }
35880     function_tests++;
35881 #endif
35882
35883     return(test_ret);
35884 }
35885
35886
35887 static int
35888 test_xmlSchemaValidateFacetWhtsp(void) {
35889     int test_ret = 0;
35890
35891 #if defined(LIBXML_SCHEMAS_ENABLED)
35892     int mem_base;
35893     int ret_val;
35894     xmlSchemaFacetPtr facet; /* the facet to check */
35895     int n_facet;
35896     xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
35897     int n_fws;
35898     xmlSchemaValType valType; /* the built-in type of the value */
35899     int n_valType;
35900     xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
35901     int n_value;
35902     xmlSchemaValPtr val; /* the precomputed value */
35903     int n_val;
35904     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35905     int n_ws;
35906
35907     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35908     for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
35909     for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35910     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35911     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35912     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35913         mem_base = xmlMemBlocks();
35914         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35915         fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
35916         valType = gen_xmlSchemaValType(n_valType, 2);
35917         value = gen_const_xmlChar_ptr(n_value, 3);
35918         val = gen_xmlSchemaValPtr(n_val, 4);
35919         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35920
35921         ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
35922         desret_int(ret_val);
35923         call_tests++;
35924         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35925         des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
35926         des_xmlSchemaValType(n_valType, valType, 2);
35927         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
35928         des_xmlSchemaValPtr(n_val, val, 4);
35929         des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35930         xmlResetLastError();
35931         if (mem_base != xmlMemBlocks()) {
35932             printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
35933                    xmlMemBlocks() - mem_base);
35934             test_ret++;
35935             printf(" %d", n_facet);
35936             printf(" %d", n_fws);
35937             printf(" %d", n_valType);
35938             printf(" %d", n_value);
35939             printf(" %d", n_val);
35940             printf(" %d", n_ws);
35941             printf("\n");
35942         }
35943     }
35944     }
35945     }
35946     }
35947     }
35948     }
35949     function_tests++;
35950 #endif
35951
35952     return(test_ret);
35953 }
35954
35955
35956 static int
35957 test_xmlSchemaValidateLengthFacet(void) {
35958     int test_ret = 0;
35959
35960 #if defined(LIBXML_SCHEMAS_ENABLED)
35961     int mem_base;
35962     int ret_val;
35963     xmlSchemaTypePtr type; /* the built-in type */
35964     int n_type;
35965     xmlSchemaFacetPtr facet; /* the facet to check */
35966     int n_facet;
35967     xmlChar * value; /* the lexical repr. of the value to be validated */
35968     int n_value;
35969     xmlSchemaValPtr val; /* the precomputed value */
35970     int n_val;
35971     unsigned long * length; /* the actual length of the value */
35972     int n_length;
35973
35974     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35975     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35976     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35977     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35978     for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35979         mem_base = xmlMemBlocks();
35980         type = gen_xmlSchemaTypePtr(n_type, 0);
35981         facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35982         value = gen_const_xmlChar_ptr(n_value, 2);
35983         val = gen_xmlSchemaValPtr(n_val, 3);
35984         length = gen_unsigned_long_ptr(n_length, 4);
35985
35986         ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
35987         desret_int(ret_val);
35988         call_tests++;
35989         des_xmlSchemaTypePtr(n_type, type, 0);
35990         des_xmlSchemaFacetPtr(n_facet, facet, 1);
35991         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35992         des_xmlSchemaValPtr(n_val, val, 3);
35993         des_unsigned_long_ptr(n_length, length, 4);
35994         xmlResetLastError();
35995         if (mem_base != xmlMemBlocks()) {
35996             printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
35997                    xmlMemBlocks() - mem_base);
35998             test_ret++;
35999             printf(" %d", n_type);
36000             printf(" %d", n_facet);
36001             printf(" %d", n_value);
36002             printf(" %d", n_val);
36003             printf(" %d", n_length);
36004             printf("\n");
36005         }
36006     }
36007     }
36008     }
36009     }
36010     }
36011     function_tests++;
36012 #endif
36013
36014     return(test_ret);
36015 }
36016
36017
36018 static int
36019 test_xmlSchemaValidateLengthFacetWhtsp(void) {
36020     int test_ret = 0;
36021
36022 #if defined(LIBXML_SCHEMAS_ENABLED)
36023     int mem_base;
36024     int ret_val;
36025     xmlSchemaFacetPtr facet; /* the facet to check */
36026     int n_facet;
36027     xmlSchemaValType valType; /* the built-in type */
36028     int n_valType;
36029     xmlChar * value; /* the lexical repr. of the value to be validated */
36030     int n_value;
36031     xmlSchemaValPtr val; /* the precomputed value */
36032     int n_val;
36033     unsigned long * length; /* the actual length of the value */
36034     int n_length;
36035     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
36036     int n_ws;
36037
36038     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
36039     for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
36040     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36041     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36042     for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
36043     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
36044         mem_base = xmlMemBlocks();
36045         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
36046         valType = gen_xmlSchemaValType(n_valType, 1);
36047         value = gen_const_xmlChar_ptr(n_value, 2);
36048         val = gen_xmlSchemaValPtr(n_val, 3);
36049         length = gen_unsigned_long_ptr(n_length, 4);
36050         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
36051
36052         ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
36053         desret_int(ret_val);
36054         call_tests++;
36055         des_xmlSchemaFacetPtr(n_facet, facet, 0);
36056         des_xmlSchemaValType(n_valType, valType, 1);
36057         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
36058         des_xmlSchemaValPtr(n_val, val, 3);
36059         des_unsigned_long_ptr(n_length, length, 4);
36060         des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
36061         xmlResetLastError();
36062         if (mem_base != xmlMemBlocks()) {
36063             printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
36064                    xmlMemBlocks() - mem_base);
36065             test_ret++;
36066             printf(" %d", n_facet);
36067             printf(" %d", n_valType);
36068             printf(" %d", n_value);
36069             printf(" %d", n_val);
36070             printf(" %d", n_length);
36071             printf(" %d", n_ws);
36072             printf("\n");
36073         }
36074     }
36075     }
36076     }
36077     }
36078     }
36079     }
36080     function_tests++;
36081 #endif
36082
36083     return(test_ret);
36084 }
36085
36086
36087 static int
36088 test_xmlSchemaValidateListSimpleTypeFacet(void) {
36089     int test_ret = 0;
36090
36091 #if defined(LIBXML_SCHEMAS_ENABLED)
36092     int mem_base;
36093     int ret_val;
36094     xmlSchemaFacetPtr facet; /* the facet to check */
36095     int n_facet;
36096     xmlChar * value; /* the lexical repr of the value to validate */
36097     int n_value;
36098     unsigned long actualLen; /* the number of list items */
36099     int n_actualLen;
36100     unsigned long * expectedLen; /* the resulting expected number of list items */
36101     int n_expectedLen;
36102
36103     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
36104     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36105     for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
36106     for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
36107         mem_base = xmlMemBlocks();
36108         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
36109         value = gen_const_xmlChar_ptr(n_value, 1);
36110         actualLen = gen_unsigned_long(n_actualLen, 2);
36111         expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
36112
36113         ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
36114         desret_int(ret_val);
36115         call_tests++;
36116         des_xmlSchemaFacetPtr(n_facet, facet, 0);
36117         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
36118         des_unsigned_long(n_actualLen, actualLen, 2);
36119         des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
36120         xmlResetLastError();
36121         if (mem_base != xmlMemBlocks()) {
36122             printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
36123                    xmlMemBlocks() - mem_base);
36124             test_ret++;
36125             printf(" %d", n_facet);
36126             printf(" %d", n_value);
36127             printf(" %d", n_actualLen);
36128             printf(" %d", n_expectedLen);
36129             printf("\n");
36130         }
36131     }
36132     }
36133     }
36134     }
36135     function_tests++;
36136 #endif
36137
36138     return(test_ret);
36139 }
36140
36141
36142 static int
36143 test_xmlSchemaValidatePredefinedType(void) {
36144     int test_ret = 0;
36145
36146 #if defined(LIBXML_SCHEMAS_ENABLED)
36147     int mem_base;
36148     int ret_val;
36149     xmlSchemaTypePtr type; /* the predefined type */
36150     int n_type;
36151     xmlChar * value; /* the value to check */
36152     int n_value;
36153     xmlSchemaValPtr * val; /* the return computed value */
36154     int n_val;
36155
36156     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
36157     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36158     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
36159         mem_base = xmlMemBlocks();
36160         type = gen_xmlSchemaTypePtr(n_type, 0);
36161         value = gen_const_xmlChar_ptr(n_value, 1);
36162         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
36163
36164         ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
36165         desret_int(ret_val);
36166         call_tests++;
36167         des_xmlSchemaTypePtr(n_type, type, 0);
36168         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
36169         des_xmlSchemaValPtr_ptr(n_val, val, 2);
36170         xmlResetLastError();
36171         if (mem_base != xmlMemBlocks()) {
36172             printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
36173                    xmlMemBlocks() - mem_base);
36174             test_ret++;
36175             printf(" %d", n_type);
36176             printf(" %d", n_value);
36177             printf(" %d", n_val);
36178             printf("\n");
36179         }
36180     }
36181     }
36182     }
36183     function_tests++;
36184 #endif
36185
36186     return(test_ret);
36187 }
36188
36189
36190 static int
36191 test_xmlSchemaValueAppend(void) {
36192     int test_ret = 0;
36193
36194 #if defined(LIBXML_SCHEMAS_ENABLED)
36195     int mem_base;
36196     int ret_val;
36197     xmlSchemaValPtr prev; /* the value */
36198     int n_prev;
36199     xmlSchemaValPtr cur; /* the value to be appended */
36200     int n_cur;
36201
36202     for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
36203     for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
36204         mem_base = xmlMemBlocks();
36205         prev = gen_xmlSchemaValPtr(n_prev, 0);
36206         cur = gen_xmlSchemaValPtr(n_cur, 1);
36207
36208         ret_val = xmlSchemaValueAppend(prev, cur);
36209         desret_int(ret_val);
36210         call_tests++;
36211         des_xmlSchemaValPtr(n_prev, prev, 0);
36212         des_xmlSchemaValPtr(n_cur, cur, 1);
36213         xmlResetLastError();
36214         if (mem_base != xmlMemBlocks()) {
36215             printf("Leak of %d blocks found in xmlSchemaValueAppend",
36216                    xmlMemBlocks() - mem_base);
36217             test_ret++;
36218             printf(" %d", n_prev);
36219             printf(" %d", n_cur);
36220             printf("\n");
36221         }
36222     }
36223     }
36224     function_tests++;
36225 #endif
36226
36227     return(test_ret);
36228 }
36229
36230
36231 static int
36232 test_xmlSchemaValueGetAsBoolean(void) {
36233     int test_ret = 0;
36234
36235 #if defined(LIBXML_SCHEMAS_ENABLED)
36236     int mem_base;
36237     int ret_val;
36238     xmlSchemaValPtr val; /* the value */
36239     int n_val;
36240
36241     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36242         mem_base = xmlMemBlocks();
36243         val = gen_xmlSchemaValPtr(n_val, 0);
36244
36245         ret_val = xmlSchemaValueGetAsBoolean(val);
36246         desret_int(ret_val);
36247         call_tests++;
36248         des_xmlSchemaValPtr(n_val, val, 0);
36249         xmlResetLastError();
36250         if (mem_base != xmlMemBlocks()) {
36251             printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
36252                    xmlMemBlocks() - mem_base);
36253             test_ret++;
36254             printf(" %d", n_val);
36255             printf("\n");
36256         }
36257     }
36258     function_tests++;
36259 #endif
36260
36261     return(test_ret);
36262 }
36263
36264
36265 static int
36266 test_xmlSchemaValueGetAsString(void) {
36267     int test_ret = 0;
36268
36269 #if defined(LIBXML_SCHEMAS_ENABLED)
36270     int mem_base;
36271     const xmlChar * ret_val;
36272     xmlSchemaValPtr val; /* the value */
36273     int n_val;
36274
36275     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36276         mem_base = xmlMemBlocks();
36277         val = gen_xmlSchemaValPtr(n_val, 0);
36278
36279         ret_val = xmlSchemaValueGetAsString(val);
36280         desret_const_xmlChar_ptr(ret_val);
36281         call_tests++;
36282         des_xmlSchemaValPtr(n_val, val, 0);
36283         xmlResetLastError();
36284         if (mem_base != xmlMemBlocks()) {
36285             printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
36286                    xmlMemBlocks() - mem_base);
36287             test_ret++;
36288             printf(" %d", n_val);
36289             printf("\n");
36290         }
36291     }
36292     function_tests++;
36293 #endif
36294
36295     return(test_ret);
36296 }
36297
36298
36299 static int
36300 test_xmlSchemaValueGetNext(void) {
36301     int test_ret = 0;
36302
36303
36304     /* missing type support */
36305     return(test_ret);
36306 }
36307
36308
36309 static int
36310 test_xmlSchemaWhiteSpaceReplace(void) {
36311     int test_ret = 0;
36312
36313 #if defined(LIBXML_SCHEMAS_ENABLED)
36314     int mem_base;
36315     xmlChar * ret_val;
36316     xmlChar * value; /* a value */
36317     int n_value;
36318
36319     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36320         mem_base = xmlMemBlocks();
36321         value = gen_const_xmlChar_ptr(n_value, 0);
36322
36323         ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
36324         desret_xmlChar_ptr(ret_val);
36325         call_tests++;
36326         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
36327         xmlResetLastError();
36328         if (mem_base != xmlMemBlocks()) {
36329             printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
36330                    xmlMemBlocks() - mem_base);
36331             test_ret++;
36332             printf(" %d", n_value);
36333             printf("\n");
36334         }
36335     }
36336     function_tests++;
36337 #endif
36338
36339     return(test_ret);
36340 }
36341
36342 static int
36343 test_xmlschemastypes(void) {
36344     int test_ret = 0;
36345
36346     if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
36347     test_ret += test_xmlSchemaCheckFacet();
36348     test_ret += test_xmlSchemaCleanupTypes();
36349     test_ret += test_xmlSchemaCollapseString();
36350     test_ret += test_xmlSchemaCompareValues();
36351     test_ret += test_xmlSchemaCompareValuesWhtsp();
36352     test_ret += test_xmlSchemaCopyValue();
36353     test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
36354     test_ret += test_xmlSchemaGetBuiltInType();
36355     test_ret += test_xmlSchemaGetCanonValue();
36356     test_ret += test_xmlSchemaGetCanonValueWhtsp();
36357     test_ret += test_xmlSchemaGetFacetValueAsULong();
36358     test_ret += test_xmlSchemaGetPredefinedType();
36359     test_ret += test_xmlSchemaGetValType();
36360     test_ret += test_xmlSchemaInitTypes();
36361     test_ret += test_xmlSchemaIsBuiltInTypeFacet();
36362     test_ret += test_xmlSchemaNewFacet();
36363     test_ret += test_xmlSchemaNewNOTATIONValue();
36364     test_ret += test_xmlSchemaNewQNameValue();
36365     test_ret += test_xmlSchemaNewStringValue();
36366     test_ret += test_xmlSchemaValPredefTypeNode();
36367     test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
36368     test_ret += test_xmlSchemaValidateFacet();
36369     test_ret += test_xmlSchemaValidateFacetWhtsp();
36370     test_ret += test_xmlSchemaValidateLengthFacet();
36371     test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
36372     test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
36373     test_ret += test_xmlSchemaValidatePredefinedType();
36374     test_ret += test_xmlSchemaValueAppend();
36375     test_ret += test_xmlSchemaValueGetAsBoolean();
36376     test_ret += test_xmlSchemaValueGetAsString();
36377     test_ret += test_xmlSchemaValueGetNext();
36378     test_ret += test_xmlSchemaWhiteSpaceReplace();
36379
36380     if (test_ret != 0)
36381         printf("Module xmlschemastypes: %d errors\n", test_ret);
36382     return(test_ret);
36383 }
36384
36385 static int
36386 test_xmlCharStrdup(void) {
36387     int test_ret = 0;
36388
36389     int mem_base;
36390     xmlChar * ret_val;
36391     char * cur; /* the input char * */
36392     int n_cur;
36393
36394     for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
36395         mem_base = xmlMemBlocks();
36396         cur = gen_const_char_ptr(n_cur, 0);
36397
36398         ret_val = xmlCharStrdup((const char *)cur);
36399         desret_xmlChar_ptr(ret_val);
36400         call_tests++;
36401         des_const_char_ptr(n_cur, (const char *)cur, 0);
36402         xmlResetLastError();
36403         if (mem_base != xmlMemBlocks()) {
36404             printf("Leak of %d blocks found in xmlCharStrdup",
36405                    xmlMemBlocks() - mem_base);
36406             test_ret++;
36407             printf(" %d", n_cur);
36408             printf("\n");
36409         }
36410     }
36411     function_tests++;
36412
36413     return(test_ret);
36414 }
36415
36416
36417 static int
36418 test_xmlCharStrndup(void) {
36419     int test_ret = 0;
36420
36421     int mem_base;
36422     xmlChar * ret_val;
36423     char * cur; /* the input char * */
36424     int n_cur;
36425     int len; /* the len of @cur */
36426     int n_len;
36427
36428     for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
36429     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36430         mem_base = xmlMemBlocks();
36431         cur = gen_const_char_ptr(n_cur, 0);
36432         len = gen_int(n_len, 1);
36433         if ((cur != NULL) &&
36434             (len > (int) strlen((const char *) cur) + 1))
36435             continue;
36436
36437         ret_val = xmlCharStrndup((const char *)cur, len);
36438         desret_xmlChar_ptr(ret_val);
36439         call_tests++;
36440         des_const_char_ptr(n_cur, (const char *)cur, 0);
36441         des_int(n_len, len, 1);
36442         xmlResetLastError();
36443         if (mem_base != xmlMemBlocks()) {
36444             printf("Leak of %d blocks found in xmlCharStrndup",
36445                    xmlMemBlocks() - mem_base);
36446             test_ret++;
36447             printf(" %d", n_cur);
36448             printf(" %d", n_len);
36449             printf("\n");
36450         }
36451     }
36452     }
36453     function_tests++;
36454
36455     return(test_ret);
36456 }
36457
36458
36459 static int
36460 test_xmlCheckUTF8(void) {
36461     int test_ret = 0;
36462
36463     int mem_base;
36464     int ret_val;
36465     unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
36466     int n_utf;
36467
36468     for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36469         mem_base = xmlMemBlocks();
36470         utf = gen_const_unsigned_char_ptr(n_utf, 0);
36471
36472         ret_val = xmlCheckUTF8((const unsigned char *)utf);
36473         desret_int(ret_val);
36474         call_tests++;
36475         des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36476         xmlResetLastError();
36477         if (mem_base != xmlMemBlocks()) {
36478             printf("Leak of %d blocks found in xmlCheckUTF8",
36479                    xmlMemBlocks() - mem_base);
36480             test_ret++;
36481             printf(" %d", n_utf);
36482             printf("\n");
36483         }
36484     }
36485     function_tests++;
36486
36487     return(test_ret);
36488 }
36489
36490
36491 static int
36492 test_xmlGetUTF8Char(void) {
36493     int test_ret = 0;
36494
36495     int mem_base;
36496     int ret_val;
36497     unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
36498     int n_utf;
36499     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. */
36500     int n_len;
36501
36502     for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36503     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
36504         mem_base = xmlMemBlocks();
36505         utf = gen_const_unsigned_char_ptr(n_utf, 0);
36506         len = gen_int_ptr(n_len, 1);
36507
36508         ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
36509         desret_int(ret_val);
36510         call_tests++;
36511         des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36512         des_int_ptr(n_len, len, 1);
36513         xmlResetLastError();
36514         if (mem_base != xmlMemBlocks()) {
36515             printf("Leak of %d blocks found in xmlGetUTF8Char",
36516                    xmlMemBlocks() - mem_base);
36517             test_ret++;
36518             printf(" %d", n_utf);
36519             printf(" %d", n_len);
36520             printf("\n");
36521         }
36522     }
36523     }
36524     function_tests++;
36525
36526     return(test_ret);
36527 }
36528
36529
36530 static int
36531 test_xmlStrEqual(void) {
36532     int test_ret = 0;
36533
36534     int mem_base;
36535     int ret_val;
36536     xmlChar * str1; /* the first xmlChar * */
36537     int n_str1;
36538     xmlChar * str2; /* the second xmlChar * */
36539     int n_str2;
36540
36541     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36542     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36543         mem_base = xmlMemBlocks();
36544         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36545         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36546
36547         ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
36548         desret_int(ret_val);
36549         call_tests++;
36550         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36551         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36552         xmlResetLastError();
36553         if (mem_base != xmlMemBlocks()) {
36554             printf("Leak of %d blocks found in xmlStrEqual",
36555                    xmlMemBlocks() - mem_base);
36556             test_ret++;
36557             printf(" %d", n_str1);
36558             printf(" %d", n_str2);
36559             printf("\n");
36560         }
36561     }
36562     }
36563     function_tests++;
36564
36565     return(test_ret);
36566 }
36567
36568
36569 static int
36570 test_xmlStrPrintf(void) {
36571     int test_ret = 0;
36572
36573
36574     /* missing type support */
36575     return(test_ret);
36576 }
36577
36578
36579 static int
36580 test_xmlStrQEqual(void) {
36581     int test_ret = 0;
36582
36583     int mem_base;
36584     int ret_val;
36585     xmlChar * pref; /* the prefix of the QName */
36586     int n_pref;
36587     xmlChar * name; /* the localname of the QName */
36588     int n_name;
36589     xmlChar * str; /* the second xmlChar * */
36590     int n_str;
36591
36592     for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
36593     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
36594     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36595         mem_base = xmlMemBlocks();
36596         pref = gen_const_xmlChar_ptr(n_pref, 0);
36597         name = gen_const_xmlChar_ptr(n_name, 1);
36598         str = gen_const_xmlChar_ptr(n_str, 2);
36599
36600         ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
36601         desret_int(ret_val);
36602         call_tests++;
36603         des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
36604         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
36605         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
36606         xmlResetLastError();
36607         if (mem_base != xmlMemBlocks()) {
36608             printf("Leak of %d blocks found in xmlStrQEqual",
36609                    xmlMemBlocks() - mem_base);
36610             test_ret++;
36611             printf(" %d", n_pref);
36612             printf(" %d", n_name);
36613             printf(" %d", n_str);
36614             printf("\n");
36615         }
36616     }
36617     }
36618     }
36619     function_tests++;
36620
36621     return(test_ret);
36622 }
36623
36624
36625 static int
36626 test_xmlStrVPrintf(void) {
36627     int test_ret = 0;
36628
36629
36630     /* missing type support */
36631     return(test_ret);
36632 }
36633
36634
36635 static int
36636 test_xmlStrcasecmp(void) {
36637     int test_ret = 0;
36638
36639     int mem_base;
36640     int ret_val;
36641     xmlChar * str1; /* the first xmlChar * */
36642     int n_str1;
36643     xmlChar * str2; /* the second xmlChar * */
36644     int n_str2;
36645
36646     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36647     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36648         mem_base = xmlMemBlocks();
36649         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36650         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36651
36652         ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
36653         desret_int(ret_val);
36654         call_tests++;
36655         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36656         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36657         xmlResetLastError();
36658         if (mem_base != xmlMemBlocks()) {
36659             printf("Leak of %d blocks found in xmlStrcasecmp",
36660                    xmlMemBlocks() - mem_base);
36661             test_ret++;
36662             printf(" %d", n_str1);
36663             printf(" %d", n_str2);
36664             printf("\n");
36665         }
36666     }
36667     }
36668     function_tests++;
36669
36670     return(test_ret);
36671 }
36672
36673
36674 static int
36675 test_xmlStrcasestr(void) {
36676     int test_ret = 0;
36677
36678     int mem_base;
36679     const xmlChar * ret_val;
36680     xmlChar * str; /* the xmlChar * array (haystack) */
36681     int n_str;
36682     xmlChar * val; /* the xmlChar to search (needle) */
36683     int n_val;
36684
36685     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36686     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36687         mem_base = xmlMemBlocks();
36688         str = gen_const_xmlChar_ptr(n_str, 0);
36689         val = gen_const_xmlChar_ptr(n_val, 1);
36690
36691         ret_val = xmlStrcasestr((const xmlChar *)str, (const xmlChar *)val);
36692         desret_const_xmlChar_ptr(ret_val);
36693         call_tests++;
36694         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36695         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36696         xmlResetLastError();
36697         if (mem_base != xmlMemBlocks()) {
36698             printf("Leak of %d blocks found in xmlStrcasestr",
36699                    xmlMemBlocks() - mem_base);
36700             test_ret++;
36701             printf(" %d", n_str);
36702             printf(" %d", n_val);
36703             printf("\n");
36704         }
36705     }
36706     }
36707     function_tests++;
36708
36709     return(test_ret);
36710 }
36711
36712
36713 static int
36714 test_xmlStrchr(void) {
36715     int test_ret = 0;
36716
36717     int mem_base;
36718     const xmlChar * ret_val;
36719     xmlChar * str; /* the xmlChar * array */
36720     int n_str;
36721     xmlChar val; /* the xmlChar to search */
36722     int n_val;
36723
36724     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36725     for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
36726         mem_base = xmlMemBlocks();
36727         str = gen_const_xmlChar_ptr(n_str, 0);
36728         val = gen_xmlChar(n_val, 1);
36729
36730         ret_val = xmlStrchr((const xmlChar *)str, val);
36731         desret_const_xmlChar_ptr(ret_val);
36732         call_tests++;
36733         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36734         des_xmlChar(n_val, val, 1);
36735         xmlResetLastError();
36736         if (mem_base != xmlMemBlocks()) {
36737             printf("Leak of %d blocks found in xmlStrchr",
36738                    xmlMemBlocks() - mem_base);
36739             test_ret++;
36740             printf(" %d", n_str);
36741             printf(" %d", n_val);
36742             printf("\n");
36743         }
36744     }
36745     }
36746     function_tests++;
36747
36748     return(test_ret);
36749 }
36750
36751
36752 static int
36753 test_xmlStrcmp(void) {
36754     int test_ret = 0;
36755
36756     int mem_base;
36757     int ret_val;
36758     xmlChar * str1; /* the first xmlChar * */
36759     int n_str1;
36760     xmlChar * str2; /* the second xmlChar * */
36761     int n_str2;
36762
36763     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36764     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36765         mem_base = xmlMemBlocks();
36766         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36767         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36768
36769         ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
36770         desret_int(ret_val);
36771         call_tests++;
36772         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36773         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36774         xmlResetLastError();
36775         if (mem_base != xmlMemBlocks()) {
36776             printf("Leak of %d blocks found in xmlStrcmp",
36777                    xmlMemBlocks() - mem_base);
36778             test_ret++;
36779             printf(" %d", n_str1);
36780             printf(" %d", n_str2);
36781             printf("\n");
36782         }
36783     }
36784     }
36785     function_tests++;
36786
36787     return(test_ret);
36788 }
36789
36790
36791 static int
36792 test_xmlStrdup(void) {
36793     int test_ret = 0;
36794
36795     int mem_base;
36796     xmlChar * ret_val;
36797     xmlChar * cur; /* the input xmlChar * */
36798     int n_cur;
36799
36800     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36801         mem_base = xmlMemBlocks();
36802         cur = gen_const_xmlChar_ptr(n_cur, 0);
36803
36804         ret_val = xmlStrdup((const xmlChar *)cur);
36805         desret_xmlChar_ptr(ret_val);
36806         call_tests++;
36807         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36808         xmlResetLastError();
36809         if (mem_base != xmlMemBlocks()) {
36810             printf("Leak of %d blocks found in xmlStrdup",
36811                    xmlMemBlocks() - mem_base);
36812             test_ret++;
36813             printf(" %d", n_cur);
36814             printf("\n");
36815         }
36816     }
36817     function_tests++;
36818
36819     return(test_ret);
36820 }
36821
36822
36823 static int
36824 test_xmlStrlen(void) {
36825     int test_ret = 0;
36826
36827     int mem_base;
36828     int ret_val;
36829     xmlChar * str; /* the xmlChar * array */
36830     int n_str;
36831
36832     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36833         mem_base = xmlMemBlocks();
36834         str = gen_const_xmlChar_ptr(n_str, 0);
36835
36836         ret_val = xmlStrlen((const xmlChar *)str);
36837         desret_int(ret_val);
36838         call_tests++;
36839         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36840         xmlResetLastError();
36841         if (mem_base != xmlMemBlocks()) {
36842             printf("Leak of %d blocks found in xmlStrlen",
36843                    xmlMemBlocks() - mem_base);
36844             test_ret++;
36845             printf(" %d", n_str);
36846             printf("\n");
36847         }
36848     }
36849     function_tests++;
36850
36851     return(test_ret);
36852 }
36853
36854
36855 static int
36856 test_xmlStrncasecmp(void) {
36857     int test_ret = 0;
36858
36859     int mem_base;
36860     int ret_val;
36861     xmlChar * str1; /* the first xmlChar * */
36862     int n_str1;
36863     xmlChar * str2; /* the second xmlChar * */
36864     int n_str2;
36865     int len; /* the max comparison length */
36866     int n_len;
36867
36868     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36869     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36870     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36871         mem_base = xmlMemBlocks();
36872         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36873         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36874         len = gen_int(n_len, 2);
36875         if ((str2 != NULL) &&
36876             (len > (int) strlen((const char *) str2) + 1))
36877             continue;
36878
36879         ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36880         desret_int(ret_val);
36881         call_tests++;
36882         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36883         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36884         des_int(n_len, len, 2);
36885         xmlResetLastError();
36886         if (mem_base != xmlMemBlocks()) {
36887             printf("Leak of %d blocks found in xmlStrncasecmp",
36888                    xmlMemBlocks() - mem_base);
36889             test_ret++;
36890             printf(" %d", n_str1);
36891             printf(" %d", n_str2);
36892             printf(" %d", n_len);
36893             printf("\n");
36894         }
36895     }
36896     }
36897     }
36898     function_tests++;
36899
36900     return(test_ret);
36901 }
36902
36903
36904 static int
36905 test_xmlStrncatNew(void) {
36906     int test_ret = 0;
36907
36908     int mem_base;
36909     xmlChar * ret_val;
36910     xmlChar * str1; /* first xmlChar string */
36911     int n_str1;
36912     xmlChar * str2; /* second xmlChar string */
36913     int n_str2;
36914     int len; /* the len of @str2 or < 0 */
36915     int n_len;
36916
36917     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36918     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36919     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36920         mem_base = xmlMemBlocks();
36921         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36922         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36923         len = gen_int(n_len, 2);
36924         if ((str2 != NULL) &&
36925             (len > (int) strlen((const char *) str2) + 1))
36926             continue;
36927
36928         ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
36929         desret_xmlChar_ptr(ret_val);
36930         call_tests++;
36931         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36932         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36933         des_int(n_len, len, 2);
36934         xmlResetLastError();
36935         if (mem_base != xmlMemBlocks()) {
36936             printf("Leak of %d blocks found in xmlStrncatNew",
36937                    xmlMemBlocks() - mem_base);
36938             test_ret++;
36939             printf(" %d", n_str1);
36940             printf(" %d", n_str2);
36941             printf(" %d", n_len);
36942             printf("\n");
36943         }
36944     }
36945     }
36946     }
36947     function_tests++;
36948
36949     return(test_ret);
36950 }
36951
36952
36953 static int
36954 test_xmlStrncmp(void) {
36955     int test_ret = 0;
36956
36957     int mem_base;
36958     int ret_val;
36959     xmlChar * str1; /* the first xmlChar * */
36960     int n_str1;
36961     xmlChar * str2; /* the second xmlChar * */
36962     int n_str2;
36963     int len; /* the max comparison length */
36964     int n_len;
36965
36966     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36967     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36968     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36969         mem_base = xmlMemBlocks();
36970         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36971         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36972         len = gen_int(n_len, 2);
36973         if ((str2 != NULL) &&
36974             (len > (int) strlen((const char *) str2) + 1))
36975             continue;
36976
36977         ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36978         desret_int(ret_val);
36979         call_tests++;
36980         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36981         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36982         des_int(n_len, len, 2);
36983         xmlResetLastError();
36984         if (mem_base != xmlMemBlocks()) {
36985             printf("Leak of %d blocks found in xmlStrncmp",
36986                    xmlMemBlocks() - mem_base);
36987             test_ret++;
36988             printf(" %d", n_str1);
36989             printf(" %d", n_str2);
36990             printf(" %d", n_len);
36991             printf("\n");
36992         }
36993     }
36994     }
36995     }
36996     function_tests++;
36997
36998     return(test_ret);
36999 }
37000
37001
37002 static int
37003 test_xmlStrndup(void) {
37004     int test_ret = 0;
37005
37006     int mem_base;
37007     xmlChar * ret_val;
37008     xmlChar * cur; /* the input xmlChar * */
37009     int n_cur;
37010     int len; /* the len of @cur */
37011     int n_len;
37012
37013     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
37014     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37015         mem_base = xmlMemBlocks();
37016         cur = gen_const_xmlChar_ptr(n_cur, 0);
37017         len = gen_int(n_len, 1);
37018         if ((cur != NULL) &&
37019             (len > (int) strlen((const char *) cur) + 1))
37020             continue;
37021
37022         ret_val = xmlStrndup((const xmlChar *)cur, len);
37023         desret_xmlChar_ptr(ret_val);
37024         call_tests++;
37025         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
37026         des_int(n_len, len, 1);
37027         xmlResetLastError();
37028         if (mem_base != xmlMemBlocks()) {
37029             printf("Leak of %d blocks found in xmlStrndup",
37030                    xmlMemBlocks() - mem_base);
37031             test_ret++;
37032             printf(" %d", n_cur);
37033             printf(" %d", n_len);
37034             printf("\n");
37035         }
37036     }
37037     }
37038     function_tests++;
37039
37040     return(test_ret);
37041 }
37042
37043
37044 static int
37045 test_xmlStrstr(void) {
37046     int test_ret = 0;
37047
37048     int mem_base;
37049     const xmlChar * ret_val;
37050     xmlChar * str; /* the xmlChar * array (haystack) */
37051     int n_str;
37052     xmlChar * val; /* the xmlChar to search (needle) */
37053     int n_val;
37054
37055     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
37056     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
37057         mem_base = xmlMemBlocks();
37058         str = gen_const_xmlChar_ptr(n_str, 0);
37059         val = gen_const_xmlChar_ptr(n_val, 1);
37060
37061         ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
37062         desret_const_xmlChar_ptr(ret_val);
37063         call_tests++;
37064         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
37065         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
37066         xmlResetLastError();
37067         if (mem_base != xmlMemBlocks()) {
37068             printf("Leak of %d blocks found in xmlStrstr",
37069                    xmlMemBlocks() - mem_base);
37070             test_ret++;
37071             printf(" %d", n_str);
37072             printf(" %d", n_val);
37073             printf("\n");
37074         }
37075     }
37076     }
37077     function_tests++;
37078
37079     return(test_ret);
37080 }
37081
37082
37083 static int
37084 test_xmlStrsub(void) {
37085     int test_ret = 0;
37086
37087     int mem_base;
37088     xmlChar * ret_val;
37089     xmlChar * str; /* the xmlChar * array (haystack) */
37090     int n_str;
37091     int start; /* the index of the first char (zero based) */
37092     int n_start;
37093     int len; /* the length of the substring */
37094     int n_len;
37095
37096     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
37097     for (n_start = 0;n_start < gen_nb_int;n_start++) {
37098     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37099         mem_base = xmlMemBlocks();
37100         str = gen_const_xmlChar_ptr(n_str, 0);
37101         start = gen_int(n_start, 1);
37102         len = gen_int(n_len, 2);
37103         if ((str != NULL) &&
37104             (start > (int) strlen((const char *) str) + 1))
37105             continue;
37106         if ((str != NULL) &&
37107             (len > (int) strlen((const char *) str) + 1))
37108             continue;
37109
37110         ret_val = xmlStrsub((const xmlChar *)str, start, len);
37111         desret_xmlChar_ptr(ret_val);
37112         call_tests++;
37113         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
37114         des_int(n_start, start, 1);
37115         des_int(n_len, len, 2);
37116         xmlResetLastError();
37117         if (mem_base != xmlMemBlocks()) {
37118             printf("Leak of %d blocks found in xmlStrsub",
37119                    xmlMemBlocks() - mem_base);
37120             test_ret++;
37121             printf(" %d", n_str);
37122             printf(" %d", n_start);
37123             printf(" %d", n_len);
37124             printf("\n");
37125         }
37126     }
37127     }
37128     }
37129     function_tests++;
37130
37131     return(test_ret);
37132 }
37133
37134
37135 static int
37136 test_xmlUTF8Charcmp(void) {
37137     int test_ret = 0;
37138
37139     int mem_base;
37140     int ret_val;
37141     xmlChar * utf1; /* pointer to first UTF8 char */
37142     int n_utf1;
37143     xmlChar * utf2; /* pointer to second UTF8 char */
37144     int n_utf2;
37145
37146     for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
37147     for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
37148         mem_base = xmlMemBlocks();
37149         utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
37150         utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
37151
37152         ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
37153         desret_int(ret_val);
37154         call_tests++;
37155         des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
37156         des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
37157         xmlResetLastError();
37158         if (mem_base != xmlMemBlocks()) {
37159             printf("Leak of %d blocks found in xmlUTF8Charcmp",
37160                    xmlMemBlocks() - mem_base);
37161             test_ret++;
37162             printf(" %d", n_utf1);
37163             printf(" %d", n_utf2);
37164             printf("\n");
37165         }
37166     }
37167     }
37168     function_tests++;
37169
37170     return(test_ret);
37171 }
37172
37173
37174 static int
37175 test_xmlUTF8Size(void) {
37176     int test_ret = 0;
37177
37178     int mem_base;
37179     int ret_val;
37180     xmlChar * utf; /* pointer to the UTF8 character */
37181     int n_utf;
37182
37183     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37184         mem_base = xmlMemBlocks();
37185         utf = gen_const_xmlChar_ptr(n_utf, 0);
37186
37187         ret_val = xmlUTF8Size((const xmlChar *)utf);
37188         desret_int(ret_val);
37189         call_tests++;
37190         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37191         xmlResetLastError();
37192         if (mem_base != xmlMemBlocks()) {
37193             printf("Leak of %d blocks found in xmlUTF8Size",
37194                    xmlMemBlocks() - mem_base);
37195             test_ret++;
37196             printf(" %d", n_utf);
37197             printf("\n");
37198         }
37199     }
37200     function_tests++;
37201
37202     return(test_ret);
37203 }
37204
37205
37206 static int
37207 test_xmlUTF8Strlen(void) {
37208     int test_ret = 0;
37209
37210     int mem_base;
37211     int ret_val;
37212     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37213     int n_utf;
37214
37215     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37216         mem_base = xmlMemBlocks();
37217         utf = gen_const_xmlChar_ptr(n_utf, 0);
37218
37219         ret_val = xmlUTF8Strlen((const xmlChar *)utf);
37220         desret_int(ret_val);
37221         call_tests++;
37222         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37223         xmlResetLastError();
37224         if (mem_base != xmlMemBlocks()) {
37225             printf("Leak of %d blocks found in xmlUTF8Strlen",
37226                    xmlMemBlocks() - mem_base);
37227             test_ret++;
37228             printf(" %d", n_utf);
37229             printf("\n");
37230         }
37231     }
37232     function_tests++;
37233
37234     return(test_ret);
37235 }
37236
37237
37238 static int
37239 test_xmlUTF8Strloc(void) {
37240     int test_ret = 0;
37241
37242     int mem_base;
37243     int ret_val;
37244     xmlChar * utf; /* the input UTF8 * */
37245     int n_utf;
37246     xmlChar * utfchar; /* the UTF8 character to be found */
37247     int n_utfchar;
37248
37249     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37250     for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
37251         mem_base = xmlMemBlocks();
37252         utf = gen_const_xmlChar_ptr(n_utf, 0);
37253         utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
37254
37255         ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
37256         desret_int(ret_val);
37257         call_tests++;
37258         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37259         des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
37260         xmlResetLastError();
37261         if (mem_base != xmlMemBlocks()) {
37262             printf("Leak of %d blocks found in xmlUTF8Strloc",
37263                    xmlMemBlocks() - mem_base);
37264             test_ret++;
37265             printf(" %d", n_utf);
37266             printf(" %d", n_utfchar);
37267             printf("\n");
37268         }
37269     }
37270     }
37271     function_tests++;
37272
37273     return(test_ret);
37274 }
37275
37276
37277 static int
37278 test_xmlUTF8Strndup(void) {
37279     int test_ret = 0;
37280
37281     int mem_base;
37282     xmlChar * ret_val;
37283     xmlChar * utf; /* the input UTF8 * */
37284     int n_utf;
37285     int len; /* the len of @utf (in chars) */
37286     int n_len;
37287
37288     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37289     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37290         mem_base = xmlMemBlocks();
37291         utf = gen_const_xmlChar_ptr(n_utf, 0);
37292         len = gen_int(n_len, 1);
37293         if ((utf != NULL) &&
37294             (len > (int) strlen((const char *) utf) + 1))
37295             continue;
37296
37297         ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
37298         desret_xmlChar_ptr(ret_val);
37299         call_tests++;
37300         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37301         des_int(n_len, len, 1);
37302         xmlResetLastError();
37303         if (mem_base != xmlMemBlocks()) {
37304             printf("Leak of %d blocks found in xmlUTF8Strndup",
37305                    xmlMemBlocks() - mem_base);
37306             test_ret++;
37307             printf(" %d", n_utf);
37308             printf(" %d", n_len);
37309             printf("\n");
37310         }
37311     }
37312     }
37313     function_tests++;
37314
37315     return(test_ret);
37316 }
37317
37318
37319 static int
37320 test_xmlUTF8Strpos(void) {
37321     int test_ret = 0;
37322
37323     int mem_base;
37324     const xmlChar * ret_val;
37325     xmlChar * utf; /* the input UTF8 * */
37326     int n_utf;
37327     int pos; /* the position of the desired UTF8 char (in chars) */
37328     int n_pos;
37329
37330     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37331     for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
37332         mem_base = xmlMemBlocks();
37333         utf = gen_const_xmlChar_ptr(n_utf, 0);
37334         pos = gen_int(n_pos, 1);
37335
37336         ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
37337         desret_const_xmlChar_ptr(ret_val);
37338         call_tests++;
37339         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37340         des_int(n_pos, pos, 1);
37341         xmlResetLastError();
37342         if (mem_base != xmlMemBlocks()) {
37343             printf("Leak of %d blocks found in xmlUTF8Strpos",
37344                    xmlMemBlocks() - mem_base);
37345             test_ret++;
37346             printf(" %d", n_utf);
37347             printf(" %d", n_pos);
37348             printf("\n");
37349         }
37350     }
37351     }
37352     function_tests++;
37353
37354     return(test_ret);
37355 }
37356
37357
37358 static int
37359 test_xmlUTF8Strsize(void) {
37360     int test_ret = 0;
37361
37362     int mem_base;
37363     int ret_val;
37364     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37365     int n_utf;
37366     int len; /* the number of characters in the array */
37367     int n_len;
37368
37369     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37370     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37371         mem_base = xmlMemBlocks();
37372         utf = gen_const_xmlChar_ptr(n_utf, 0);
37373         len = gen_int(n_len, 1);
37374         if ((utf != NULL) &&
37375             (len > (int) strlen((const char *) utf) + 1))
37376             continue;
37377
37378         ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
37379         desret_int(ret_val);
37380         call_tests++;
37381         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37382         des_int(n_len, len, 1);
37383         xmlResetLastError();
37384         if (mem_base != xmlMemBlocks()) {
37385             printf("Leak of %d blocks found in xmlUTF8Strsize",
37386                    xmlMemBlocks() - mem_base);
37387             test_ret++;
37388             printf(" %d", n_utf);
37389             printf(" %d", n_len);
37390             printf("\n");
37391         }
37392     }
37393     }
37394     function_tests++;
37395
37396     return(test_ret);
37397 }
37398
37399
37400 static int
37401 test_xmlUTF8Strsub(void) {
37402     int test_ret = 0;
37403
37404     int mem_base;
37405     xmlChar * ret_val;
37406     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37407     int n_utf;
37408     int start; /* relative pos of first char */
37409     int n_start;
37410     int len; /* total number to copy */
37411     int n_len;
37412
37413     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37414     for (n_start = 0;n_start < gen_nb_int;n_start++) {
37415     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37416         mem_base = xmlMemBlocks();
37417         utf = gen_const_xmlChar_ptr(n_utf, 0);
37418         start = gen_int(n_start, 1);
37419         len = gen_int(n_len, 2);
37420         if ((utf != NULL) &&
37421             (start > (int) strlen((const char *) utf) + 1))
37422             continue;
37423         if ((utf != NULL) &&
37424             (len > (int) strlen((const char *) utf) + 1))
37425             continue;
37426
37427         ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
37428         desret_xmlChar_ptr(ret_val);
37429         call_tests++;
37430         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37431         des_int(n_start, start, 1);
37432         des_int(n_len, len, 2);
37433         xmlResetLastError();
37434         if (mem_base != xmlMemBlocks()) {
37435             printf("Leak of %d blocks found in xmlUTF8Strsub",
37436                    xmlMemBlocks() - mem_base);
37437             test_ret++;
37438             printf(" %d", n_utf);
37439             printf(" %d", n_start);
37440             printf(" %d", n_len);
37441             printf("\n");
37442         }
37443     }
37444     }
37445     }
37446     function_tests++;
37447
37448     return(test_ret);
37449 }
37450
37451 static int
37452 test_xmlstring(void) {
37453     int test_ret = 0;
37454
37455     if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
37456     test_ret += test_xmlCharStrdup();
37457     test_ret += test_xmlCharStrndup();
37458     test_ret += test_xmlCheckUTF8();
37459     test_ret += test_xmlGetUTF8Char();
37460     test_ret += test_xmlStrEqual();
37461     test_ret += test_xmlStrPrintf();
37462     test_ret += test_xmlStrQEqual();
37463     test_ret += test_xmlStrVPrintf();
37464     test_ret += test_xmlStrcasecmp();
37465     test_ret += test_xmlStrcasestr();
37466     test_ret += test_xmlStrchr();
37467     test_ret += test_xmlStrcmp();
37468     test_ret += test_xmlStrdup();
37469     test_ret += test_xmlStrlen();
37470     test_ret += test_xmlStrncasecmp();
37471     test_ret += test_xmlStrncatNew();
37472     test_ret += test_xmlStrncmp();
37473     test_ret += test_xmlStrndup();
37474     test_ret += test_xmlStrstr();
37475     test_ret += test_xmlStrsub();
37476     test_ret += test_xmlUTF8Charcmp();
37477     test_ret += test_xmlUTF8Size();
37478     test_ret += test_xmlUTF8Strlen();
37479     test_ret += test_xmlUTF8Strloc();
37480     test_ret += test_xmlUTF8Strndup();
37481     test_ret += test_xmlUTF8Strpos();
37482     test_ret += test_xmlUTF8Strsize();
37483     test_ret += test_xmlUTF8Strsub();
37484
37485     if (test_ret != 0)
37486         printf("Module xmlstring: %d errors\n", test_ret);
37487     return(test_ret);
37488 }
37489
37490 static int
37491 test_xmlUCSIsAegeanNumbers(void) {
37492     int test_ret = 0;
37493
37494 #if defined(LIBXML_UNICODE_ENABLED)
37495     int mem_base;
37496     int ret_val;
37497     int code; /* UCS code point */
37498     int n_code;
37499
37500     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37501         mem_base = xmlMemBlocks();
37502         code = gen_int(n_code, 0);
37503
37504         ret_val = xmlUCSIsAegeanNumbers(code);
37505         desret_int(ret_val);
37506         call_tests++;
37507         des_int(n_code, code, 0);
37508         xmlResetLastError();
37509         if (mem_base != xmlMemBlocks()) {
37510             printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
37511                    xmlMemBlocks() - mem_base);
37512             test_ret++;
37513             printf(" %d", n_code);
37514             printf("\n");
37515         }
37516     }
37517     function_tests++;
37518 #endif
37519
37520     return(test_ret);
37521 }
37522
37523
37524 static int
37525 test_xmlUCSIsAlphabeticPresentationForms(void) {
37526     int test_ret = 0;
37527
37528 #if defined(LIBXML_UNICODE_ENABLED)
37529     int mem_base;
37530     int ret_val;
37531     int code; /* UCS code point */
37532     int n_code;
37533
37534     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37535         mem_base = xmlMemBlocks();
37536         code = gen_int(n_code, 0);
37537
37538         ret_val = xmlUCSIsAlphabeticPresentationForms(code);
37539         desret_int(ret_val);
37540         call_tests++;
37541         des_int(n_code, code, 0);
37542         xmlResetLastError();
37543         if (mem_base != xmlMemBlocks()) {
37544             printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
37545                    xmlMemBlocks() - mem_base);
37546             test_ret++;
37547             printf(" %d", n_code);
37548             printf("\n");
37549         }
37550     }
37551     function_tests++;
37552 #endif
37553
37554     return(test_ret);
37555 }
37556
37557
37558 static int
37559 test_xmlUCSIsArabic(void) {
37560     int test_ret = 0;
37561
37562 #if defined(LIBXML_UNICODE_ENABLED)
37563     int mem_base;
37564     int ret_val;
37565     int code; /* UCS code point */
37566     int n_code;
37567
37568     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37569         mem_base = xmlMemBlocks();
37570         code = gen_int(n_code, 0);
37571
37572         ret_val = xmlUCSIsArabic(code);
37573         desret_int(ret_val);
37574         call_tests++;
37575         des_int(n_code, code, 0);
37576         xmlResetLastError();
37577         if (mem_base != xmlMemBlocks()) {
37578             printf("Leak of %d blocks found in xmlUCSIsArabic",
37579                    xmlMemBlocks() - mem_base);
37580             test_ret++;
37581             printf(" %d", n_code);
37582             printf("\n");
37583         }
37584     }
37585     function_tests++;
37586 #endif
37587
37588     return(test_ret);
37589 }
37590
37591
37592 static int
37593 test_xmlUCSIsArabicPresentationFormsA(void) {
37594     int test_ret = 0;
37595
37596 #if defined(LIBXML_UNICODE_ENABLED)
37597     int mem_base;
37598     int ret_val;
37599     int code; /* UCS code point */
37600     int n_code;
37601
37602     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37603         mem_base = xmlMemBlocks();
37604         code = gen_int(n_code, 0);
37605
37606         ret_val = xmlUCSIsArabicPresentationFormsA(code);
37607         desret_int(ret_val);
37608         call_tests++;
37609         des_int(n_code, code, 0);
37610         xmlResetLastError();
37611         if (mem_base != xmlMemBlocks()) {
37612             printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
37613                    xmlMemBlocks() - mem_base);
37614             test_ret++;
37615             printf(" %d", n_code);
37616             printf("\n");
37617         }
37618     }
37619     function_tests++;
37620 #endif
37621
37622     return(test_ret);
37623 }
37624
37625
37626 static int
37627 test_xmlUCSIsArabicPresentationFormsB(void) {
37628     int test_ret = 0;
37629
37630 #if defined(LIBXML_UNICODE_ENABLED)
37631     int mem_base;
37632     int ret_val;
37633     int code; /* UCS code point */
37634     int n_code;
37635
37636     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37637         mem_base = xmlMemBlocks();
37638         code = gen_int(n_code, 0);
37639
37640         ret_val = xmlUCSIsArabicPresentationFormsB(code);
37641         desret_int(ret_val);
37642         call_tests++;
37643         des_int(n_code, code, 0);
37644         xmlResetLastError();
37645         if (mem_base != xmlMemBlocks()) {
37646             printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
37647                    xmlMemBlocks() - mem_base);
37648             test_ret++;
37649             printf(" %d", n_code);
37650             printf("\n");
37651         }
37652     }
37653     function_tests++;
37654 #endif
37655
37656     return(test_ret);
37657 }
37658
37659
37660 static int
37661 test_xmlUCSIsArmenian(void) {
37662     int test_ret = 0;
37663
37664 #if defined(LIBXML_UNICODE_ENABLED)
37665     int mem_base;
37666     int ret_val;
37667     int code; /* UCS code point */
37668     int n_code;
37669
37670     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37671         mem_base = xmlMemBlocks();
37672         code = gen_int(n_code, 0);
37673
37674         ret_val = xmlUCSIsArmenian(code);
37675         desret_int(ret_val);
37676         call_tests++;
37677         des_int(n_code, code, 0);
37678         xmlResetLastError();
37679         if (mem_base != xmlMemBlocks()) {
37680             printf("Leak of %d blocks found in xmlUCSIsArmenian",
37681                    xmlMemBlocks() - mem_base);
37682             test_ret++;
37683             printf(" %d", n_code);
37684             printf("\n");
37685         }
37686     }
37687     function_tests++;
37688 #endif
37689
37690     return(test_ret);
37691 }
37692
37693
37694 static int
37695 test_xmlUCSIsArrows(void) {
37696     int test_ret = 0;
37697
37698 #if defined(LIBXML_UNICODE_ENABLED)
37699     int mem_base;
37700     int ret_val;
37701     int code; /* UCS code point */
37702     int n_code;
37703
37704     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37705         mem_base = xmlMemBlocks();
37706         code = gen_int(n_code, 0);
37707
37708         ret_val = xmlUCSIsArrows(code);
37709         desret_int(ret_val);
37710         call_tests++;
37711         des_int(n_code, code, 0);
37712         xmlResetLastError();
37713         if (mem_base != xmlMemBlocks()) {
37714             printf("Leak of %d blocks found in xmlUCSIsArrows",
37715                    xmlMemBlocks() - mem_base);
37716             test_ret++;
37717             printf(" %d", n_code);
37718             printf("\n");
37719         }
37720     }
37721     function_tests++;
37722 #endif
37723
37724     return(test_ret);
37725 }
37726
37727
37728 static int
37729 test_xmlUCSIsBasicLatin(void) {
37730     int test_ret = 0;
37731
37732 #if defined(LIBXML_UNICODE_ENABLED)
37733     int mem_base;
37734     int ret_val;
37735     int code; /* UCS code point */
37736     int n_code;
37737
37738     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37739         mem_base = xmlMemBlocks();
37740         code = gen_int(n_code, 0);
37741
37742         ret_val = xmlUCSIsBasicLatin(code);
37743         desret_int(ret_val);
37744         call_tests++;
37745         des_int(n_code, code, 0);
37746         xmlResetLastError();
37747         if (mem_base != xmlMemBlocks()) {
37748             printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
37749                    xmlMemBlocks() - mem_base);
37750             test_ret++;
37751             printf(" %d", n_code);
37752             printf("\n");
37753         }
37754     }
37755     function_tests++;
37756 #endif
37757
37758     return(test_ret);
37759 }
37760
37761
37762 static int
37763 test_xmlUCSIsBengali(void) {
37764     int test_ret = 0;
37765
37766 #if defined(LIBXML_UNICODE_ENABLED)
37767     int mem_base;
37768     int ret_val;
37769     int code; /* UCS code point */
37770     int n_code;
37771
37772     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37773         mem_base = xmlMemBlocks();
37774         code = gen_int(n_code, 0);
37775
37776         ret_val = xmlUCSIsBengali(code);
37777         desret_int(ret_val);
37778         call_tests++;
37779         des_int(n_code, code, 0);
37780         xmlResetLastError();
37781         if (mem_base != xmlMemBlocks()) {
37782             printf("Leak of %d blocks found in xmlUCSIsBengali",
37783                    xmlMemBlocks() - mem_base);
37784             test_ret++;
37785             printf(" %d", n_code);
37786             printf("\n");
37787         }
37788     }
37789     function_tests++;
37790 #endif
37791
37792     return(test_ret);
37793 }
37794
37795
37796 static int
37797 test_xmlUCSIsBlock(void) {
37798     int test_ret = 0;
37799
37800 #if defined(LIBXML_UNICODE_ENABLED)
37801     int mem_base;
37802     int ret_val;
37803     int code; /* UCS code point */
37804     int n_code;
37805     char * block; /* UCS block name */
37806     int n_block;
37807
37808     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37809     for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
37810         mem_base = xmlMemBlocks();
37811         code = gen_int(n_code, 0);
37812         block = gen_const_char_ptr(n_block, 1);
37813
37814         ret_val = xmlUCSIsBlock(code, (const char *)block);
37815         desret_int(ret_val);
37816         call_tests++;
37817         des_int(n_code, code, 0);
37818         des_const_char_ptr(n_block, (const char *)block, 1);
37819         xmlResetLastError();
37820         if (mem_base != xmlMemBlocks()) {
37821             printf("Leak of %d blocks found in xmlUCSIsBlock",
37822                    xmlMemBlocks() - mem_base);
37823             test_ret++;
37824             printf(" %d", n_code);
37825             printf(" %d", n_block);
37826             printf("\n");
37827         }
37828     }
37829     }
37830     function_tests++;
37831 #endif
37832
37833     return(test_ret);
37834 }
37835
37836
37837 static int
37838 test_xmlUCSIsBlockElements(void) {
37839     int test_ret = 0;
37840
37841 #if defined(LIBXML_UNICODE_ENABLED)
37842     int mem_base;
37843     int ret_val;
37844     int code; /* UCS code point */
37845     int n_code;
37846
37847     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37848         mem_base = xmlMemBlocks();
37849         code = gen_int(n_code, 0);
37850
37851         ret_val = xmlUCSIsBlockElements(code);
37852         desret_int(ret_val);
37853         call_tests++;
37854         des_int(n_code, code, 0);
37855         xmlResetLastError();
37856         if (mem_base != xmlMemBlocks()) {
37857             printf("Leak of %d blocks found in xmlUCSIsBlockElements",
37858                    xmlMemBlocks() - mem_base);
37859             test_ret++;
37860             printf(" %d", n_code);
37861             printf("\n");
37862         }
37863     }
37864     function_tests++;
37865 #endif
37866
37867     return(test_ret);
37868 }
37869
37870
37871 static int
37872 test_xmlUCSIsBopomofo(void) {
37873     int test_ret = 0;
37874
37875 #if defined(LIBXML_UNICODE_ENABLED)
37876     int mem_base;
37877     int ret_val;
37878     int code; /* UCS code point */
37879     int n_code;
37880
37881     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37882         mem_base = xmlMemBlocks();
37883         code = gen_int(n_code, 0);
37884
37885         ret_val = xmlUCSIsBopomofo(code);
37886         desret_int(ret_val);
37887         call_tests++;
37888         des_int(n_code, code, 0);
37889         xmlResetLastError();
37890         if (mem_base != xmlMemBlocks()) {
37891             printf("Leak of %d blocks found in xmlUCSIsBopomofo",
37892                    xmlMemBlocks() - mem_base);
37893             test_ret++;
37894             printf(" %d", n_code);
37895             printf("\n");
37896         }
37897     }
37898     function_tests++;
37899 #endif
37900
37901     return(test_ret);
37902 }
37903
37904
37905 static int
37906 test_xmlUCSIsBopomofoExtended(void) {
37907     int test_ret = 0;
37908
37909 #if defined(LIBXML_UNICODE_ENABLED)
37910     int mem_base;
37911     int ret_val;
37912     int code; /* UCS code point */
37913     int n_code;
37914
37915     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37916         mem_base = xmlMemBlocks();
37917         code = gen_int(n_code, 0);
37918
37919         ret_val = xmlUCSIsBopomofoExtended(code);
37920         desret_int(ret_val);
37921         call_tests++;
37922         des_int(n_code, code, 0);
37923         xmlResetLastError();
37924         if (mem_base != xmlMemBlocks()) {
37925             printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
37926                    xmlMemBlocks() - mem_base);
37927             test_ret++;
37928             printf(" %d", n_code);
37929             printf("\n");
37930         }
37931     }
37932     function_tests++;
37933 #endif
37934
37935     return(test_ret);
37936 }
37937
37938
37939 static int
37940 test_xmlUCSIsBoxDrawing(void) {
37941     int test_ret = 0;
37942
37943 #if defined(LIBXML_UNICODE_ENABLED)
37944     int mem_base;
37945     int ret_val;
37946     int code; /* UCS code point */
37947     int n_code;
37948
37949     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37950         mem_base = xmlMemBlocks();
37951         code = gen_int(n_code, 0);
37952
37953         ret_val = xmlUCSIsBoxDrawing(code);
37954         desret_int(ret_val);
37955         call_tests++;
37956         des_int(n_code, code, 0);
37957         xmlResetLastError();
37958         if (mem_base != xmlMemBlocks()) {
37959             printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
37960                    xmlMemBlocks() - mem_base);
37961             test_ret++;
37962             printf(" %d", n_code);
37963             printf("\n");
37964         }
37965     }
37966     function_tests++;
37967 #endif
37968
37969     return(test_ret);
37970 }
37971
37972
37973 static int
37974 test_xmlUCSIsBraillePatterns(void) {
37975     int test_ret = 0;
37976
37977 #if defined(LIBXML_UNICODE_ENABLED)
37978     int mem_base;
37979     int ret_val;
37980     int code; /* UCS code point */
37981     int n_code;
37982
37983     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37984         mem_base = xmlMemBlocks();
37985         code = gen_int(n_code, 0);
37986
37987         ret_val = xmlUCSIsBraillePatterns(code);
37988         desret_int(ret_val);
37989         call_tests++;
37990         des_int(n_code, code, 0);
37991         xmlResetLastError();
37992         if (mem_base != xmlMemBlocks()) {
37993             printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
37994                    xmlMemBlocks() - mem_base);
37995             test_ret++;
37996             printf(" %d", n_code);
37997             printf("\n");
37998         }
37999     }
38000     function_tests++;
38001 #endif
38002
38003     return(test_ret);
38004 }
38005
38006
38007 static int
38008 test_xmlUCSIsBuhid(void) {
38009     int test_ret = 0;
38010
38011 #if defined(LIBXML_UNICODE_ENABLED)
38012     int mem_base;
38013     int ret_val;
38014     int code; /* UCS code point */
38015     int n_code;
38016
38017     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38018         mem_base = xmlMemBlocks();
38019         code = gen_int(n_code, 0);
38020
38021         ret_val = xmlUCSIsBuhid(code);
38022         desret_int(ret_val);
38023         call_tests++;
38024         des_int(n_code, code, 0);
38025         xmlResetLastError();
38026         if (mem_base != xmlMemBlocks()) {
38027             printf("Leak of %d blocks found in xmlUCSIsBuhid",
38028                    xmlMemBlocks() - mem_base);
38029             test_ret++;
38030             printf(" %d", n_code);
38031             printf("\n");
38032         }
38033     }
38034     function_tests++;
38035 #endif
38036
38037     return(test_ret);
38038 }
38039
38040
38041 static int
38042 test_xmlUCSIsByzantineMusicalSymbols(void) {
38043     int test_ret = 0;
38044
38045 #if defined(LIBXML_UNICODE_ENABLED)
38046     int mem_base;
38047     int ret_val;
38048     int code; /* UCS code point */
38049     int n_code;
38050
38051     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38052         mem_base = xmlMemBlocks();
38053         code = gen_int(n_code, 0);
38054
38055         ret_val = xmlUCSIsByzantineMusicalSymbols(code);
38056         desret_int(ret_val);
38057         call_tests++;
38058         des_int(n_code, code, 0);
38059         xmlResetLastError();
38060         if (mem_base != xmlMemBlocks()) {
38061             printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
38062                    xmlMemBlocks() - mem_base);
38063             test_ret++;
38064             printf(" %d", n_code);
38065             printf("\n");
38066         }
38067     }
38068     function_tests++;
38069 #endif
38070
38071     return(test_ret);
38072 }
38073
38074
38075 static int
38076 test_xmlUCSIsCJKCompatibility(void) {
38077     int test_ret = 0;
38078
38079 #if defined(LIBXML_UNICODE_ENABLED)
38080     int mem_base;
38081     int ret_val;
38082     int code; /* UCS code point */
38083     int n_code;
38084
38085     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38086         mem_base = xmlMemBlocks();
38087         code = gen_int(n_code, 0);
38088
38089         ret_val = xmlUCSIsCJKCompatibility(code);
38090         desret_int(ret_val);
38091         call_tests++;
38092         des_int(n_code, code, 0);
38093         xmlResetLastError();
38094         if (mem_base != xmlMemBlocks()) {
38095             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
38096                    xmlMemBlocks() - mem_base);
38097             test_ret++;
38098             printf(" %d", n_code);
38099             printf("\n");
38100         }
38101     }
38102     function_tests++;
38103 #endif
38104
38105     return(test_ret);
38106 }
38107
38108
38109 static int
38110 test_xmlUCSIsCJKCompatibilityForms(void) {
38111     int test_ret = 0;
38112
38113 #if defined(LIBXML_UNICODE_ENABLED)
38114     int mem_base;
38115     int ret_val;
38116     int code; /* UCS code point */
38117     int n_code;
38118
38119     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38120         mem_base = xmlMemBlocks();
38121         code = gen_int(n_code, 0);
38122
38123         ret_val = xmlUCSIsCJKCompatibilityForms(code);
38124         desret_int(ret_val);
38125         call_tests++;
38126         des_int(n_code, code, 0);
38127         xmlResetLastError();
38128         if (mem_base != xmlMemBlocks()) {
38129             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
38130                    xmlMemBlocks() - mem_base);
38131             test_ret++;
38132             printf(" %d", n_code);
38133             printf("\n");
38134         }
38135     }
38136     function_tests++;
38137 #endif
38138
38139     return(test_ret);
38140 }
38141
38142
38143 static int
38144 test_xmlUCSIsCJKCompatibilityIdeographs(void) {
38145     int test_ret = 0;
38146
38147 #if defined(LIBXML_UNICODE_ENABLED)
38148     int mem_base;
38149     int ret_val;
38150     int code; /* UCS code point */
38151     int n_code;
38152
38153     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38154         mem_base = xmlMemBlocks();
38155         code = gen_int(n_code, 0);
38156
38157         ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
38158         desret_int(ret_val);
38159         call_tests++;
38160         des_int(n_code, code, 0);
38161         xmlResetLastError();
38162         if (mem_base != xmlMemBlocks()) {
38163             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
38164                    xmlMemBlocks() - mem_base);
38165             test_ret++;
38166             printf(" %d", n_code);
38167             printf("\n");
38168         }
38169     }
38170     function_tests++;
38171 #endif
38172
38173     return(test_ret);
38174 }
38175
38176
38177 static int
38178 test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
38179     int test_ret = 0;
38180
38181 #if defined(LIBXML_UNICODE_ENABLED)
38182     int mem_base;
38183     int ret_val;
38184     int code; /* UCS code point */
38185     int n_code;
38186
38187     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38188         mem_base = xmlMemBlocks();
38189         code = gen_int(n_code, 0);
38190
38191         ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
38192         desret_int(ret_val);
38193         call_tests++;
38194         des_int(n_code, code, 0);
38195         xmlResetLastError();
38196         if (mem_base != xmlMemBlocks()) {
38197             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
38198                    xmlMemBlocks() - mem_base);
38199             test_ret++;
38200             printf(" %d", n_code);
38201             printf("\n");
38202         }
38203     }
38204     function_tests++;
38205 #endif
38206
38207     return(test_ret);
38208 }
38209
38210
38211 static int
38212 test_xmlUCSIsCJKRadicalsSupplement(void) {
38213     int test_ret = 0;
38214
38215 #if defined(LIBXML_UNICODE_ENABLED)
38216     int mem_base;
38217     int ret_val;
38218     int code; /* UCS code point */
38219     int n_code;
38220
38221     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38222         mem_base = xmlMemBlocks();
38223         code = gen_int(n_code, 0);
38224
38225         ret_val = xmlUCSIsCJKRadicalsSupplement(code);
38226         desret_int(ret_val);
38227         call_tests++;
38228         des_int(n_code, code, 0);
38229         xmlResetLastError();
38230         if (mem_base != xmlMemBlocks()) {
38231             printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
38232                    xmlMemBlocks() - mem_base);
38233             test_ret++;
38234             printf(" %d", n_code);
38235             printf("\n");
38236         }
38237     }
38238     function_tests++;
38239 #endif
38240
38241     return(test_ret);
38242 }
38243
38244
38245 static int
38246 test_xmlUCSIsCJKSymbolsandPunctuation(void) {
38247     int test_ret = 0;
38248
38249 #if defined(LIBXML_UNICODE_ENABLED)
38250     int mem_base;
38251     int ret_val;
38252     int code; /* UCS code point */
38253     int n_code;
38254
38255     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38256         mem_base = xmlMemBlocks();
38257         code = gen_int(n_code, 0);
38258
38259         ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
38260         desret_int(ret_val);
38261         call_tests++;
38262         des_int(n_code, code, 0);
38263         xmlResetLastError();
38264         if (mem_base != xmlMemBlocks()) {
38265             printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
38266                    xmlMemBlocks() - mem_base);
38267             test_ret++;
38268             printf(" %d", n_code);
38269             printf("\n");
38270         }
38271     }
38272     function_tests++;
38273 #endif
38274
38275     return(test_ret);
38276 }
38277
38278
38279 static int
38280 test_xmlUCSIsCJKUnifiedIdeographs(void) {
38281     int test_ret = 0;
38282
38283 #if defined(LIBXML_UNICODE_ENABLED)
38284     int mem_base;
38285     int ret_val;
38286     int code; /* UCS code point */
38287     int n_code;
38288
38289     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38290         mem_base = xmlMemBlocks();
38291         code = gen_int(n_code, 0);
38292
38293         ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
38294         desret_int(ret_val);
38295         call_tests++;
38296         des_int(n_code, code, 0);
38297         xmlResetLastError();
38298         if (mem_base != xmlMemBlocks()) {
38299             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
38300                    xmlMemBlocks() - mem_base);
38301             test_ret++;
38302             printf(" %d", n_code);
38303             printf("\n");
38304         }
38305     }
38306     function_tests++;
38307 #endif
38308
38309     return(test_ret);
38310 }
38311
38312
38313 static int
38314 test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
38315     int test_ret = 0;
38316
38317 #if defined(LIBXML_UNICODE_ENABLED)
38318     int mem_base;
38319     int ret_val;
38320     int code; /* UCS code point */
38321     int n_code;
38322
38323     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38324         mem_base = xmlMemBlocks();
38325         code = gen_int(n_code, 0);
38326
38327         ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
38328         desret_int(ret_val);
38329         call_tests++;
38330         des_int(n_code, code, 0);
38331         xmlResetLastError();
38332         if (mem_base != xmlMemBlocks()) {
38333             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
38334                    xmlMemBlocks() - mem_base);
38335             test_ret++;
38336             printf(" %d", n_code);
38337             printf("\n");
38338         }
38339     }
38340     function_tests++;
38341 #endif
38342
38343     return(test_ret);
38344 }
38345
38346
38347 static int
38348 test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
38349     int test_ret = 0;
38350
38351 #if defined(LIBXML_UNICODE_ENABLED)
38352     int mem_base;
38353     int ret_val;
38354     int code; /* UCS code point */
38355     int n_code;
38356
38357     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38358         mem_base = xmlMemBlocks();
38359         code = gen_int(n_code, 0);
38360
38361         ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
38362         desret_int(ret_val);
38363         call_tests++;
38364         des_int(n_code, code, 0);
38365         xmlResetLastError();
38366         if (mem_base != xmlMemBlocks()) {
38367             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
38368                    xmlMemBlocks() - mem_base);
38369             test_ret++;
38370             printf(" %d", n_code);
38371             printf("\n");
38372         }
38373     }
38374     function_tests++;
38375 #endif
38376
38377     return(test_ret);
38378 }
38379
38380
38381 static int
38382 test_xmlUCSIsCat(void) {
38383     int test_ret = 0;
38384
38385 #if defined(LIBXML_UNICODE_ENABLED)
38386     int mem_base;
38387     int ret_val;
38388     int code; /* UCS code point */
38389     int n_code;
38390     char * cat; /* UCS Category name */
38391     int n_cat;
38392
38393     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38394     for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
38395         mem_base = xmlMemBlocks();
38396         code = gen_int(n_code, 0);
38397         cat = gen_const_char_ptr(n_cat, 1);
38398
38399         ret_val = xmlUCSIsCat(code, (const char *)cat);
38400         desret_int(ret_val);
38401         call_tests++;
38402         des_int(n_code, code, 0);
38403         des_const_char_ptr(n_cat, (const char *)cat, 1);
38404         xmlResetLastError();
38405         if (mem_base != xmlMemBlocks()) {
38406             printf("Leak of %d blocks found in xmlUCSIsCat",
38407                    xmlMemBlocks() - mem_base);
38408             test_ret++;
38409             printf(" %d", n_code);
38410             printf(" %d", n_cat);
38411             printf("\n");
38412         }
38413     }
38414     }
38415     function_tests++;
38416 #endif
38417
38418     return(test_ret);
38419 }
38420
38421
38422 static int
38423 test_xmlUCSIsCatC(void) {
38424     int test_ret = 0;
38425
38426 #if defined(LIBXML_UNICODE_ENABLED)
38427     int mem_base;
38428     int ret_val;
38429     int code; /* UCS code point */
38430     int n_code;
38431
38432     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38433         mem_base = xmlMemBlocks();
38434         code = gen_int(n_code, 0);
38435
38436         ret_val = xmlUCSIsCatC(code);
38437         desret_int(ret_val);
38438         call_tests++;
38439         des_int(n_code, code, 0);
38440         xmlResetLastError();
38441         if (mem_base != xmlMemBlocks()) {
38442             printf("Leak of %d blocks found in xmlUCSIsCatC",
38443                    xmlMemBlocks() - mem_base);
38444             test_ret++;
38445             printf(" %d", n_code);
38446             printf("\n");
38447         }
38448     }
38449     function_tests++;
38450 #endif
38451
38452     return(test_ret);
38453 }
38454
38455
38456 static int
38457 test_xmlUCSIsCatCc(void) {
38458     int test_ret = 0;
38459
38460 #if defined(LIBXML_UNICODE_ENABLED)
38461     int mem_base;
38462     int ret_val;
38463     int code; /* UCS code point */
38464     int n_code;
38465
38466     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38467         mem_base = xmlMemBlocks();
38468         code = gen_int(n_code, 0);
38469
38470         ret_val = xmlUCSIsCatCc(code);
38471         desret_int(ret_val);
38472         call_tests++;
38473         des_int(n_code, code, 0);
38474         xmlResetLastError();
38475         if (mem_base != xmlMemBlocks()) {
38476             printf("Leak of %d blocks found in xmlUCSIsCatCc",
38477                    xmlMemBlocks() - mem_base);
38478             test_ret++;
38479             printf(" %d", n_code);
38480             printf("\n");
38481         }
38482     }
38483     function_tests++;
38484 #endif
38485
38486     return(test_ret);
38487 }
38488
38489
38490 static int
38491 test_xmlUCSIsCatCf(void) {
38492     int test_ret = 0;
38493
38494 #if defined(LIBXML_UNICODE_ENABLED)
38495     int mem_base;
38496     int ret_val;
38497     int code; /* UCS code point */
38498     int n_code;
38499
38500     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38501         mem_base = xmlMemBlocks();
38502         code = gen_int(n_code, 0);
38503
38504         ret_val = xmlUCSIsCatCf(code);
38505         desret_int(ret_val);
38506         call_tests++;
38507         des_int(n_code, code, 0);
38508         xmlResetLastError();
38509         if (mem_base != xmlMemBlocks()) {
38510             printf("Leak of %d blocks found in xmlUCSIsCatCf",
38511                    xmlMemBlocks() - mem_base);
38512             test_ret++;
38513             printf(" %d", n_code);
38514             printf("\n");
38515         }
38516     }
38517     function_tests++;
38518 #endif
38519
38520     return(test_ret);
38521 }
38522
38523
38524 static int
38525 test_xmlUCSIsCatCo(void) {
38526     int test_ret = 0;
38527
38528 #if defined(LIBXML_UNICODE_ENABLED)
38529     int mem_base;
38530     int ret_val;
38531     int code; /* UCS code point */
38532     int n_code;
38533
38534     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38535         mem_base = xmlMemBlocks();
38536         code = gen_int(n_code, 0);
38537
38538         ret_val = xmlUCSIsCatCo(code);
38539         desret_int(ret_val);
38540         call_tests++;
38541         des_int(n_code, code, 0);
38542         xmlResetLastError();
38543         if (mem_base != xmlMemBlocks()) {
38544             printf("Leak of %d blocks found in xmlUCSIsCatCo",
38545                    xmlMemBlocks() - mem_base);
38546             test_ret++;
38547             printf(" %d", n_code);
38548             printf("\n");
38549         }
38550     }
38551     function_tests++;
38552 #endif
38553
38554     return(test_ret);
38555 }
38556
38557
38558 static int
38559 test_xmlUCSIsCatCs(void) {
38560     int test_ret = 0;
38561
38562 #if defined(LIBXML_UNICODE_ENABLED)
38563     int mem_base;
38564     int ret_val;
38565     int code; /* UCS code point */
38566     int n_code;
38567
38568     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38569         mem_base = xmlMemBlocks();
38570         code = gen_int(n_code, 0);
38571
38572         ret_val = xmlUCSIsCatCs(code);
38573         desret_int(ret_val);
38574         call_tests++;
38575         des_int(n_code, code, 0);
38576         xmlResetLastError();
38577         if (mem_base != xmlMemBlocks()) {
38578             printf("Leak of %d blocks found in xmlUCSIsCatCs",
38579                    xmlMemBlocks() - mem_base);
38580             test_ret++;
38581             printf(" %d", n_code);
38582             printf("\n");
38583         }
38584     }
38585     function_tests++;
38586 #endif
38587
38588     return(test_ret);
38589 }
38590
38591
38592 static int
38593 test_xmlUCSIsCatL(void) {
38594     int test_ret = 0;
38595
38596 #if defined(LIBXML_UNICODE_ENABLED)
38597     int mem_base;
38598     int ret_val;
38599     int code; /* UCS code point */
38600     int n_code;
38601
38602     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38603         mem_base = xmlMemBlocks();
38604         code = gen_int(n_code, 0);
38605
38606         ret_val = xmlUCSIsCatL(code);
38607         desret_int(ret_val);
38608         call_tests++;
38609         des_int(n_code, code, 0);
38610         xmlResetLastError();
38611         if (mem_base != xmlMemBlocks()) {
38612             printf("Leak of %d blocks found in xmlUCSIsCatL",
38613                    xmlMemBlocks() - mem_base);
38614             test_ret++;
38615             printf(" %d", n_code);
38616             printf("\n");
38617         }
38618     }
38619     function_tests++;
38620 #endif
38621
38622     return(test_ret);
38623 }
38624
38625
38626 static int
38627 test_xmlUCSIsCatLl(void) {
38628     int test_ret = 0;
38629
38630 #if defined(LIBXML_UNICODE_ENABLED)
38631     int mem_base;
38632     int ret_val;
38633     int code; /* UCS code point */
38634     int n_code;
38635
38636     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38637         mem_base = xmlMemBlocks();
38638         code = gen_int(n_code, 0);
38639
38640         ret_val = xmlUCSIsCatLl(code);
38641         desret_int(ret_val);
38642         call_tests++;
38643         des_int(n_code, code, 0);
38644         xmlResetLastError();
38645         if (mem_base != xmlMemBlocks()) {
38646             printf("Leak of %d blocks found in xmlUCSIsCatLl",
38647                    xmlMemBlocks() - mem_base);
38648             test_ret++;
38649             printf(" %d", n_code);
38650             printf("\n");
38651         }
38652     }
38653     function_tests++;
38654 #endif
38655
38656     return(test_ret);
38657 }
38658
38659
38660 static int
38661 test_xmlUCSIsCatLm(void) {
38662     int test_ret = 0;
38663
38664 #if defined(LIBXML_UNICODE_ENABLED)
38665     int mem_base;
38666     int ret_val;
38667     int code; /* UCS code point */
38668     int n_code;
38669
38670     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38671         mem_base = xmlMemBlocks();
38672         code = gen_int(n_code, 0);
38673
38674         ret_val = xmlUCSIsCatLm(code);
38675         desret_int(ret_val);
38676         call_tests++;
38677         des_int(n_code, code, 0);
38678         xmlResetLastError();
38679         if (mem_base != xmlMemBlocks()) {
38680             printf("Leak of %d blocks found in xmlUCSIsCatLm",
38681                    xmlMemBlocks() - mem_base);
38682             test_ret++;
38683             printf(" %d", n_code);
38684             printf("\n");
38685         }
38686     }
38687     function_tests++;
38688 #endif
38689
38690     return(test_ret);
38691 }
38692
38693
38694 static int
38695 test_xmlUCSIsCatLo(void) {
38696     int test_ret = 0;
38697
38698 #if defined(LIBXML_UNICODE_ENABLED)
38699     int mem_base;
38700     int ret_val;
38701     int code; /* UCS code point */
38702     int n_code;
38703
38704     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38705         mem_base = xmlMemBlocks();
38706         code = gen_int(n_code, 0);
38707
38708         ret_val = xmlUCSIsCatLo(code);
38709         desret_int(ret_val);
38710         call_tests++;
38711         des_int(n_code, code, 0);
38712         xmlResetLastError();
38713         if (mem_base != xmlMemBlocks()) {
38714             printf("Leak of %d blocks found in xmlUCSIsCatLo",
38715                    xmlMemBlocks() - mem_base);
38716             test_ret++;
38717             printf(" %d", n_code);
38718             printf("\n");
38719         }
38720     }
38721     function_tests++;
38722 #endif
38723
38724     return(test_ret);
38725 }
38726
38727
38728 static int
38729 test_xmlUCSIsCatLt(void) {
38730     int test_ret = 0;
38731
38732 #if defined(LIBXML_UNICODE_ENABLED)
38733     int mem_base;
38734     int ret_val;
38735     int code; /* UCS code point */
38736     int n_code;
38737
38738     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38739         mem_base = xmlMemBlocks();
38740         code = gen_int(n_code, 0);
38741
38742         ret_val = xmlUCSIsCatLt(code);
38743         desret_int(ret_val);
38744         call_tests++;
38745         des_int(n_code, code, 0);
38746         xmlResetLastError();
38747         if (mem_base != xmlMemBlocks()) {
38748             printf("Leak of %d blocks found in xmlUCSIsCatLt",
38749                    xmlMemBlocks() - mem_base);
38750             test_ret++;
38751             printf(" %d", n_code);
38752             printf("\n");
38753         }
38754     }
38755     function_tests++;
38756 #endif
38757
38758     return(test_ret);
38759 }
38760
38761
38762 static int
38763 test_xmlUCSIsCatLu(void) {
38764     int test_ret = 0;
38765
38766 #if defined(LIBXML_UNICODE_ENABLED)
38767     int mem_base;
38768     int ret_val;
38769     int code; /* UCS code point */
38770     int n_code;
38771
38772     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38773         mem_base = xmlMemBlocks();
38774         code = gen_int(n_code, 0);
38775
38776         ret_val = xmlUCSIsCatLu(code);
38777         desret_int(ret_val);
38778         call_tests++;
38779         des_int(n_code, code, 0);
38780         xmlResetLastError();
38781         if (mem_base != xmlMemBlocks()) {
38782             printf("Leak of %d blocks found in xmlUCSIsCatLu",
38783                    xmlMemBlocks() - mem_base);
38784             test_ret++;
38785             printf(" %d", n_code);
38786             printf("\n");
38787         }
38788     }
38789     function_tests++;
38790 #endif
38791
38792     return(test_ret);
38793 }
38794
38795
38796 static int
38797 test_xmlUCSIsCatM(void) {
38798     int test_ret = 0;
38799
38800 #if defined(LIBXML_UNICODE_ENABLED)
38801     int mem_base;
38802     int ret_val;
38803     int code; /* UCS code point */
38804     int n_code;
38805
38806     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38807         mem_base = xmlMemBlocks();
38808         code = gen_int(n_code, 0);
38809
38810         ret_val = xmlUCSIsCatM(code);
38811         desret_int(ret_val);
38812         call_tests++;
38813         des_int(n_code, code, 0);
38814         xmlResetLastError();
38815         if (mem_base != xmlMemBlocks()) {
38816             printf("Leak of %d blocks found in xmlUCSIsCatM",
38817                    xmlMemBlocks() - mem_base);
38818             test_ret++;
38819             printf(" %d", n_code);
38820             printf("\n");
38821         }
38822     }
38823     function_tests++;
38824 #endif
38825
38826     return(test_ret);
38827 }
38828
38829
38830 static int
38831 test_xmlUCSIsCatMc(void) {
38832     int test_ret = 0;
38833
38834 #if defined(LIBXML_UNICODE_ENABLED)
38835     int mem_base;
38836     int ret_val;
38837     int code; /* UCS code point */
38838     int n_code;
38839
38840     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38841         mem_base = xmlMemBlocks();
38842         code = gen_int(n_code, 0);
38843
38844         ret_val = xmlUCSIsCatMc(code);
38845         desret_int(ret_val);
38846         call_tests++;
38847         des_int(n_code, code, 0);
38848         xmlResetLastError();
38849         if (mem_base != xmlMemBlocks()) {
38850             printf("Leak of %d blocks found in xmlUCSIsCatMc",
38851                    xmlMemBlocks() - mem_base);
38852             test_ret++;
38853             printf(" %d", n_code);
38854             printf("\n");
38855         }
38856     }
38857     function_tests++;
38858 #endif
38859
38860     return(test_ret);
38861 }
38862
38863
38864 static int
38865 test_xmlUCSIsCatMe(void) {
38866     int test_ret = 0;
38867
38868 #if defined(LIBXML_UNICODE_ENABLED)
38869     int mem_base;
38870     int ret_val;
38871     int code; /* UCS code point */
38872     int n_code;
38873
38874     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38875         mem_base = xmlMemBlocks();
38876         code = gen_int(n_code, 0);
38877
38878         ret_val = xmlUCSIsCatMe(code);
38879         desret_int(ret_val);
38880         call_tests++;
38881         des_int(n_code, code, 0);
38882         xmlResetLastError();
38883         if (mem_base != xmlMemBlocks()) {
38884             printf("Leak of %d blocks found in xmlUCSIsCatMe",
38885                    xmlMemBlocks() - mem_base);
38886             test_ret++;
38887             printf(" %d", n_code);
38888             printf("\n");
38889         }
38890     }
38891     function_tests++;
38892 #endif
38893
38894     return(test_ret);
38895 }
38896
38897
38898 static int
38899 test_xmlUCSIsCatMn(void) {
38900     int test_ret = 0;
38901
38902 #if defined(LIBXML_UNICODE_ENABLED)
38903     int mem_base;
38904     int ret_val;
38905     int code; /* UCS code point */
38906     int n_code;
38907
38908     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38909         mem_base = xmlMemBlocks();
38910         code = gen_int(n_code, 0);
38911
38912         ret_val = xmlUCSIsCatMn(code);
38913         desret_int(ret_val);
38914         call_tests++;
38915         des_int(n_code, code, 0);
38916         xmlResetLastError();
38917         if (mem_base != xmlMemBlocks()) {
38918             printf("Leak of %d blocks found in xmlUCSIsCatMn",
38919                    xmlMemBlocks() - mem_base);
38920             test_ret++;
38921             printf(" %d", n_code);
38922             printf("\n");
38923         }
38924     }
38925     function_tests++;
38926 #endif
38927
38928     return(test_ret);
38929 }
38930
38931
38932 static int
38933 test_xmlUCSIsCatN(void) {
38934     int test_ret = 0;
38935
38936 #if defined(LIBXML_UNICODE_ENABLED)
38937     int mem_base;
38938     int ret_val;
38939     int code; /* UCS code point */
38940     int n_code;
38941
38942     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38943         mem_base = xmlMemBlocks();
38944         code = gen_int(n_code, 0);
38945
38946         ret_val = xmlUCSIsCatN(code);
38947         desret_int(ret_val);
38948         call_tests++;
38949         des_int(n_code, code, 0);
38950         xmlResetLastError();
38951         if (mem_base != xmlMemBlocks()) {
38952             printf("Leak of %d blocks found in xmlUCSIsCatN",
38953                    xmlMemBlocks() - mem_base);
38954             test_ret++;
38955             printf(" %d", n_code);
38956             printf("\n");
38957         }
38958     }
38959     function_tests++;
38960 #endif
38961
38962     return(test_ret);
38963 }
38964
38965
38966 static int
38967 test_xmlUCSIsCatNd(void) {
38968     int test_ret = 0;
38969
38970 #if defined(LIBXML_UNICODE_ENABLED)
38971     int mem_base;
38972     int ret_val;
38973     int code; /* UCS code point */
38974     int n_code;
38975
38976     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38977         mem_base = xmlMemBlocks();
38978         code = gen_int(n_code, 0);
38979
38980         ret_val = xmlUCSIsCatNd(code);
38981         desret_int(ret_val);
38982         call_tests++;
38983         des_int(n_code, code, 0);
38984         xmlResetLastError();
38985         if (mem_base != xmlMemBlocks()) {
38986             printf("Leak of %d blocks found in xmlUCSIsCatNd",
38987                    xmlMemBlocks() - mem_base);
38988             test_ret++;
38989             printf(" %d", n_code);
38990             printf("\n");
38991         }
38992     }
38993     function_tests++;
38994 #endif
38995
38996     return(test_ret);
38997 }
38998
38999
39000 static int
39001 test_xmlUCSIsCatNl(void) {
39002     int test_ret = 0;
39003
39004 #if defined(LIBXML_UNICODE_ENABLED)
39005     int mem_base;
39006     int ret_val;
39007     int code; /* UCS code point */
39008     int n_code;
39009
39010     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39011         mem_base = xmlMemBlocks();
39012         code = gen_int(n_code, 0);
39013
39014         ret_val = xmlUCSIsCatNl(code);
39015         desret_int(ret_val);
39016         call_tests++;
39017         des_int(n_code, code, 0);
39018         xmlResetLastError();
39019         if (mem_base != xmlMemBlocks()) {
39020             printf("Leak of %d blocks found in xmlUCSIsCatNl",
39021                    xmlMemBlocks() - mem_base);
39022             test_ret++;
39023             printf(" %d", n_code);
39024             printf("\n");
39025         }
39026     }
39027     function_tests++;
39028 #endif
39029
39030     return(test_ret);
39031 }
39032
39033
39034 static int
39035 test_xmlUCSIsCatNo(void) {
39036     int test_ret = 0;
39037
39038 #if defined(LIBXML_UNICODE_ENABLED)
39039     int mem_base;
39040     int ret_val;
39041     int code; /* UCS code point */
39042     int n_code;
39043
39044     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39045         mem_base = xmlMemBlocks();
39046         code = gen_int(n_code, 0);
39047
39048         ret_val = xmlUCSIsCatNo(code);
39049         desret_int(ret_val);
39050         call_tests++;
39051         des_int(n_code, code, 0);
39052         xmlResetLastError();
39053         if (mem_base != xmlMemBlocks()) {
39054             printf("Leak of %d blocks found in xmlUCSIsCatNo",
39055                    xmlMemBlocks() - mem_base);
39056             test_ret++;
39057             printf(" %d", n_code);
39058             printf("\n");
39059         }
39060     }
39061     function_tests++;
39062 #endif
39063
39064     return(test_ret);
39065 }
39066
39067
39068 static int
39069 test_xmlUCSIsCatP(void) {
39070     int test_ret = 0;
39071
39072 #if defined(LIBXML_UNICODE_ENABLED)
39073     int mem_base;
39074     int ret_val;
39075     int code; /* UCS code point */
39076     int n_code;
39077
39078     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39079         mem_base = xmlMemBlocks();
39080         code = gen_int(n_code, 0);
39081
39082         ret_val = xmlUCSIsCatP(code);
39083         desret_int(ret_val);
39084         call_tests++;
39085         des_int(n_code, code, 0);
39086         xmlResetLastError();
39087         if (mem_base != xmlMemBlocks()) {
39088             printf("Leak of %d blocks found in xmlUCSIsCatP",
39089                    xmlMemBlocks() - mem_base);
39090             test_ret++;
39091             printf(" %d", n_code);
39092             printf("\n");
39093         }
39094     }
39095     function_tests++;
39096 #endif
39097
39098     return(test_ret);
39099 }
39100
39101
39102 static int
39103 test_xmlUCSIsCatPc(void) {
39104     int test_ret = 0;
39105
39106 #if defined(LIBXML_UNICODE_ENABLED)
39107     int mem_base;
39108     int ret_val;
39109     int code; /* UCS code point */
39110     int n_code;
39111
39112     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39113         mem_base = xmlMemBlocks();
39114         code = gen_int(n_code, 0);
39115
39116         ret_val = xmlUCSIsCatPc(code);
39117         desret_int(ret_val);
39118         call_tests++;
39119         des_int(n_code, code, 0);
39120         xmlResetLastError();
39121         if (mem_base != xmlMemBlocks()) {
39122             printf("Leak of %d blocks found in xmlUCSIsCatPc",
39123                    xmlMemBlocks() - mem_base);
39124             test_ret++;
39125             printf(" %d", n_code);
39126             printf("\n");
39127         }
39128     }
39129     function_tests++;
39130 #endif
39131
39132     return(test_ret);
39133 }
39134
39135
39136 static int
39137 test_xmlUCSIsCatPd(void) {
39138     int test_ret = 0;
39139
39140 #if defined(LIBXML_UNICODE_ENABLED)
39141     int mem_base;
39142     int ret_val;
39143     int code; /* UCS code point */
39144     int n_code;
39145
39146     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39147         mem_base = xmlMemBlocks();
39148         code = gen_int(n_code, 0);
39149
39150         ret_val = xmlUCSIsCatPd(code);
39151         desret_int(ret_val);
39152         call_tests++;
39153         des_int(n_code, code, 0);
39154         xmlResetLastError();
39155         if (mem_base != xmlMemBlocks()) {
39156             printf("Leak of %d blocks found in xmlUCSIsCatPd",
39157                    xmlMemBlocks() - mem_base);
39158             test_ret++;
39159             printf(" %d", n_code);
39160             printf("\n");
39161         }
39162     }
39163     function_tests++;
39164 #endif
39165
39166     return(test_ret);
39167 }
39168
39169
39170 static int
39171 test_xmlUCSIsCatPe(void) {
39172     int test_ret = 0;
39173
39174 #if defined(LIBXML_UNICODE_ENABLED)
39175     int mem_base;
39176     int ret_val;
39177     int code; /* UCS code point */
39178     int n_code;
39179
39180     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39181         mem_base = xmlMemBlocks();
39182         code = gen_int(n_code, 0);
39183
39184         ret_val = xmlUCSIsCatPe(code);
39185         desret_int(ret_val);
39186         call_tests++;
39187         des_int(n_code, code, 0);
39188         xmlResetLastError();
39189         if (mem_base != xmlMemBlocks()) {
39190             printf("Leak of %d blocks found in xmlUCSIsCatPe",
39191                    xmlMemBlocks() - mem_base);
39192             test_ret++;
39193             printf(" %d", n_code);
39194             printf("\n");
39195         }
39196     }
39197     function_tests++;
39198 #endif
39199
39200     return(test_ret);
39201 }
39202
39203
39204 static int
39205 test_xmlUCSIsCatPf(void) {
39206     int test_ret = 0;
39207
39208 #if defined(LIBXML_UNICODE_ENABLED)
39209     int mem_base;
39210     int ret_val;
39211     int code; /* UCS code point */
39212     int n_code;
39213
39214     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39215         mem_base = xmlMemBlocks();
39216         code = gen_int(n_code, 0);
39217
39218         ret_val = xmlUCSIsCatPf(code);
39219         desret_int(ret_val);
39220         call_tests++;
39221         des_int(n_code, code, 0);
39222         xmlResetLastError();
39223         if (mem_base != xmlMemBlocks()) {
39224             printf("Leak of %d blocks found in xmlUCSIsCatPf",
39225                    xmlMemBlocks() - mem_base);
39226             test_ret++;
39227             printf(" %d", n_code);
39228             printf("\n");
39229         }
39230     }
39231     function_tests++;
39232 #endif
39233
39234     return(test_ret);
39235 }
39236
39237
39238 static int
39239 test_xmlUCSIsCatPi(void) {
39240     int test_ret = 0;
39241
39242 #if defined(LIBXML_UNICODE_ENABLED)
39243     int mem_base;
39244     int ret_val;
39245     int code; /* UCS code point */
39246     int n_code;
39247
39248     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39249         mem_base = xmlMemBlocks();
39250         code = gen_int(n_code, 0);
39251
39252         ret_val = xmlUCSIsCatPi(code);
39253         desret_int(ret_val);
39254         call_tests++;
39255         des_int(n_code, code, 0);
39256         xmlResetLastError();
39257         if (mem_base != xmlMemBlocks()) {
39258             printf("Leak of %d blocks found in xmlUCSIsCatPi",
39259                    xmlMemBlocks() - mem_base);
39260             test_ret++;
39261             printf(" %d", n_code);
39262             printf("\n");
39263         }
39264     }
39265     function_tests++;
39266 #endif
39267
39268     return(test_ret);
39269 }
39270
39271
39272 static int
39273 test_xmlUCSIsCatPo(void) {
39274     int test_ret = 0;
39275
39276 #if defined(LIBXML_UNICODE_ENABLED)
39277     int mem_base;
39278     int ret_val;
39279     int code; /* UCS code point */
39280     int n_code;
39281
39282     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39283         mem_base = xmlMemBlocks();
39284         code = gen_int(n_code, 0);
39285
39286         ret_val = xmlUCSIsCatPo(code);
39287         desret_int(ret_val);
39288         call_tests++;
39289         des_int(n_code, code, 0);
39290         xmlResetLastError();
39291         if (mem_base != xmlMemBlocks()) {
39292             printf("Leak of %d blocks found in xmlUCSIsCatPo",
39293                    xmlMemBlocks() - mem_base);
39294             test_ret++;
39295             printf(" %d", n_code);
39296             printf("\n");
39297         }
39298     }
39299     function_tests++;
39300 #endif
39301
39302     return(test_ret);
39303 }
39304
39305
39306 static int
39307 test_xmlUCSIsCatPs(void) {
39308     int test_ret = 0;
39309
39310 #if defined(LIBXML_UNICODE_ENABLED)
39311     int mem_base;
39312     int ret_val;
39313     int code; /* UCS code point */
39314     int n_code;
39315
39316     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39317         mem_base = xmlMemBlocks();
39318         code = gen_int(n_code, 0);
39319
39320         ret_val = xmlUCSIsCatPs(code);
39321         desret_int(ret_val);
39322         call_tests++;
39323         des_int(n_code, code, 0);
39324         xmlResetLastError();
39325         if (mem_base != xmlMemBlocks()) {
39326             printf("Leak of %d blocks found in xmlUCSIsCatPs",
39327                    xmlMemBlocks() - mem_base);
39328             test_ret++;
39329             printf(" %d", n_code);
39330             printf("\n");
39331         }
39332     }
39333     function_tests++;
39334 #endif
39335
39336     return(test_ret);
39337 }
39338
39339
39340 static int
39341 test_xmlUCSIsCatS(void) {
39342     int test_ret = 0;
39343
39344 #if defined(LIBXML_UNICODE_ENABLED)
39345     int mem_base;
39346     int ret_val;
39347     int code; /* UCS code point */
39348     int n_code;
39349
39350     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39351         mem_base = xmlMemBlocks();
39352         code = gen_int(n_code, 0);
39353
39354         ret_val = xmlUCSIsCatS(code);
39355         desret_int(ret_val);
39356         call_tests++;
39357         des_int(n_code, code, 0);
39358         xmlResetLastError();
39359         if (mem_base != xmlMemBlocks()) {
39360             printf("Leak of %d blocks found in xmlUCSIsCatS",
39361                    xmlMemBlocks() - mem_base);
39362             test_ret++;
39363             printf(" %d", n_code);
39364             printf("\n");
39365         }
39366     }
39367     function_tests++;
39368 #endif
39369
39370     return(test_ret);
39371 }
39372
39373
39374 static int
39375 test_xmlUCSIsCatSc(void) {
39376     int test_ret = 0;
39377
39378 #if defined(LIBXML_UNICODE_ENABLED)
39379     int mem_base;
39380     int ret_val;
39381     int code; /* UCS code point */
39382     int n_code;
39383
39384     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39385         mem_base = xmlMemBlocks();
39386         code = gen_int(n_code, 0);
39387
39388         ret_val = xmlUCSIsCatSc(code);
39389         desret_int(ret_val);
39390         call_tests++;
39391         des_int(n_code, code, 0);
39392         xmlResetLastError();
39393         if (mem_base != xmlMemBlocks()) {
39394             printf("Leak of %d blocks found in xmlUCSIsCatSc",
39395                    xmlMemBlocks() - mem_base);
39396             test_ret++;
39397             printf(" %d", n_code);
39398             printf("\n");
39399         }
39400     }
39401     function_tests++;
39402 #endif
39403
39404     return(test_ret);
39405 }
39406
39407
39408 static int
39409 test_xmlUCSIsCatSk(void) {
39410     int test_ret = 0;
39411
39412 #if defined(LIBXML_UNICODE_ENABLED)
39413     int mem_base;
39414     int ret_val;
39415     int code; /* UCS code point */
39416     int n_code;
39417
39418     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39419         mem_base = xmlMemBlocks();
39420         code = gen_int(n_code, 0);
39421
39422         ret_val = xmlUCSIsCatSk(code);
39423         desret_int(ret_val);
39424         call_tests++;
39425         des_int(n_code, code, 0);
39426         xmlResetLastError();
39427         if (mem_base != xmlMemBlocks()) {
39428             printf("Leak of %d blocks found in xmlUCSIsCatSk",
39429                    xmlMemBlocks() - mem_base);
39430             test_ret++;
39431             printf(" %d", n_code);
39432             printf("\n");
39433         }
39434     }
39435     function_tests++;
39436 #endif
39437
39438     return(test_ret);
39439 }
39440
39441
39442 static int
39443 test_xmlUCSIsCatSm(void) {
39444     int test_ret = 0;
39445
39446 #if defined(LIBXML_UNICODE_ENABLED)
39447     int mem_base;
39448     int ret_val;
39449     int code; /* UCS code point */
39450     int n_code;
39451
39452     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39453         mem_base = xmlMemBlocks();
39454         code = gen_int(n_code, 0);
39455
39456         ret_val = xmlUCSIsCatSm(code);
39457         desret_int(ret_val);
39458         call_tests++;
39459         des_int(n_code, code, 0);
39460         xmlResetLastError();
39461         if (mem_base != xmlMemBlocks()) {
39462             printf("Leak of %d blocks found in xmlUCSIsCatSm",
39463                    xmlMemBlocks() - mem_base);
39464             test_ret++;
39465             printf(" %d", n_code);
39466             printf("\n");
39467         }
39468     }
39469     function_tests++;
39470 #endif
39471
39472     return(test_ret);
39473 }
39474
39475
39476 static int
39477 test_xmlUCSIsCatSo(void) {
39478     int test_ret = 0;
39479
39480 #if defined(LIBXML_UNICODE_ENABLED)
39481     int mem_base;
39482     int ret_val;
39483     int code; /* UCS code point */
39484     int n_code;
39485
39486     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39487         mem_base = xmlMemBlocks();
39488         code = gen_int(n_code, 0);
39489
39490         ret_val = xmlUCSIsCatSo(code);
39491         desret_int(ret_val);
39492         call_tests++;
39493         des_int(n_code, code, 0);
39494         xmlResetLastError();
39495         if (mem_base != xmlMemBlocks()) {
39496             printf("Leak of %d blocks found in xmlUCSIsCatSo",
39497                    xmlMemBlocks() - mem_base);
39498             test_ret++;
39499             printf(" %d", n_code);
39500             printf("\n");
39501         }
39502     }
39503     function_tests++;
39504 #endif
39505
39506     return(test_ret);
39507 }
39508
39509
39510 static int
39511 test_xmlUCSIsCatZ(void) {
39512     int test_ret = 0;
39513
39514 #if defined(LIBXML_UNICODE_ENABLED)
39515     int mem_base;
39516     int ret_val;
39517     int code; /* UCS code point */
39518     int n_code;
39519
39520     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39521         mem_base = xmlMemBlocks();
39522         code = gen_int(n_code, 0);
39523
39524         ret_val = xmlUCSIsCatZ(code);
39525         desret_int(ret_val);
39526         call_tests++;
39527         des_int(n_code, code, 0);
39528         xmlResetLastError();
39529         if (mem_base != xmlMemBlocks()) {
39530             printf("Leak of %d blocks found in xmlUCSIsCatZ",
39531                    xmlMemBlocks() - mem_base);
39532             test_ret++;
39533             printf(" %d", n_code);
39534             printf("\n");
39535         }
39536     }
39537     function_tests++;
39538 #endif
39539
39540     return(test_ret);
39541 }
39542
39543
39544 static int
39545 test_xmlUCSIsCatZl(void) {
39546     int test_ret = 0;
39547
39548 #if defined(LIBXML_UNICODE_ENABLED)
39549     int mem_base;
39550     int ret_val;
39551     int code; /* UCS code point */
39552     int n_code;
39553
39554     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39555         mem_base = xmlMemBlocks();
39556         code = gen_int(n_code, 0);
39557
39558         ret_val = xmlUCSIsCatZl(code);
39559         desret_int(ret_val);
39560         call_tests++;
39561         des_int(n_code, code, 0);
39562         xmlResetLastError();
39563         if (mem_base != xmlMemBlocks()) {
39564             printf("Leak of %d blocks found in xmlUCSIsCatZl",
39565                    xmlMemBlocks() - mem_base);
39566             test_ret++;
39567             printf(" %d", n_code);
39568             printf("\n");
39569         }
39570     }
39571     function_tests++;
39572 #endif
39573
39574     return(test_ret);
39575 }
39576
39577
39578 static int
39579 test_xmlUCSIsCatZp(void) {
39580     int test_ret = 0;
39581
39582 #if defined(LIBXML_UNICODE_ENABLED)
39583     int mem_base;
39584     int ret_val;
39585     int code; /* UCS code point */
39586     int n_code;
39587
39588     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39589         mem_base = xmlMemBlocks();
39590         code = gen_int(n_code, 0);
39591
39592         ret_val = xmlUCSIsCatZp(code);
39593         desret_int(ret_val);
39594         call_tests++;
39595         des_int(n_code, code, 0);
39596         xmlResetLastError();
39597         if (mem_base != xmlMemBlocks()) {
39598             printf("Leak of %d blocks found in xmlUCSIsCatZp",
39599                    xmlMemBlocks() - mem_base);
39600             test_ret++;
39601             printf(" %d", n_code);
39602             printf("\n");
39603         }
39604     }
39605     function_tests++;
39606 #endif
39607
39608     return(test_ret);
39609 }
39610
39611
39612 static int
39613 test_xmlUCSIsCatZs(void) {
39614     int test_ret = 0;
39615
39616 #if defined(LIBXML_UNICODE_ENABLED)
39617     int mem_base;
39618     int ret_val;
39619     int code; /* UCS code point */
39620     int n_code;
39621
39622     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39623         mem_base = xmlMemBlocks();
39624         code = gen_int(n_code, 0);
39625
39626         ret_val = xmlUCSIsCatZs(code);
39627         desret_int(ret_val);
39628         call_tests++;
39629         des_int(n_code, code, 0);
39630         xmlResetLastError();
39631         if (mem_base != xmlMemBlocks()) {
39632             printf("Leak of %d blocks found in xmlUCSIsCatZs",
39633                    xmlMemBlocks() - mem_base);
39634             test_ret++;
39635             printf(" %d", n_code);
39636             printf("\n");
39637         }
39638     }
39639     function_tests++;
39640 #endif
39641
39642     return(test_ret);
39643 }
39644
39645
39646 static int
39647 test_xmlUCSIsCherokee(void) {
39648     int test_ret = 0;
39649
39650 #if defined(LIBXML_UNICODE_ENABLED)
39651     int mem_base;
39652     int ret_val;
39653     int code; /* UCS code point */
39654     int n_code;
39655
39656     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39657         mem_base = xmlMemBlocks();
39658         code = gen_int(n_code, 0);
39659
39660         ret_val = xmlUCSIsCherokee(code);
39661         desret_int(ret_val);
39662         call_tests++;
39663         des_int(n_code, code, 0);
39664         xmlResetLastError();
39665         if (mem_base != xmlMemBlocks()) {
39666             printf("Leak of %d blocks found in xmlUCSIsCherokee",
39667                    xmlMemBlocks() - mem_base);
39668             test_ret++;
39669             printf(" %d", n_code);
39670             printf("\n");
39671         }
39672     }
39673     function_tests++;
39674 #endif
39675
39676     return(test_ret);
39677 }
39678
39679
39680 static int
39681 test_xmlUCSIsCombiningDiacriticalMarks(void) {
39682     int test_ret = 0;
39683
39684 #if defined(LIBXML_UNICODE_ENABLED)
39685     int mem_base;
39686     int ret_val;
39687     int code; /* UCS code point */
39688     int n_code;
39689
39690     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39691         mem_base = xmlMemBlocks();
39692         code = gen_int(n_code, 0);
39693
39694         ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
39695         desret_int(ret_val);
39696         call_tests++;
39697         des_int(n_code, code, 0);
39698         xmlResetLastError();
39699         if (mem_base != xmlMemBlocks()) {
39700             printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
39701                    xmlMemBlocks() - mem_base);
39702             test_ret++;
39703             printf(" %d", n_code);
39704             printf("\n");
39705         }
39706     }
39707     function_tests++;
39708 #endif
39709
39710     return(test_ret);
39711 }
39712
39713
39714 static int
39715 test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
39716     int test_ret = 0;
39717
39718 #if defined(LIBXML_UNICODE_ENABLED)
39719     int mem_base;
39720     int ret_val;
39721     int code; /* UCS code point */
39722     int n_code;
39723
39724     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39725         mem_base = xmlMemBlocks();
39726         code = gen_int(n_code, 0);
39727
39728         ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
39729         desret_int(ret_val);
39730         call_tests++;
39731         des_int(n_code, code, 0);
39732         xmlResetLastError();
39733         if (mem_base != xmlMemBlocks()) {
39734             printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
39735                    xmlMemBlocks() - mem_base);
39736             test_ret++;
39737             printf(" %d", n_code);
39738             printf("\n");
39739         }
39740     }
39741     function_tests++;
39742 #endif
39743
39744     return(test_ret);
39745 }
39746
39747
39748 static int
39749 test_xmlUCSIsCombiningHalfMarks(void) {
39750     int test_ret = 0;
39751
39752 #if defined(LIBXML_UNICODE_ENABLED)
39753     int mem_base;
39754     int ret_val;
39755     int code; /* UCS code point */
39756     int n_code;
39757
39758     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39759         mem_base = xmlMemBlocks();
39760         code = gen_int(n_code, 0);
39761
39762         ret_val = xmlUCSIsCombiningHalfMarks(code);
39763         desret_int(ret_val);
39764         call_tests++;
39765         des_int(n_code, code, 0);
39766         xmlResetLastError();
39767         if (mem_base != xmlMemBlocks()) {
39768             printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
39769                    xmlMemBlocks() - mem_base);
39770             test_ret++;
39771             printf(" %d", n_code);
39772             printf("\n");
39773         }
39774     }
39775     function_tests++;
39776 #endif
39777
39778     return(test_ret);
39779 }
39780
39781
39782 static int
39783 test_xmlUCSIsCombiningMarksforSymbols(void) {
39784     int test_ret = 0;
39785
39786 #if defined(LIBXML_UNICODE_ENABLED)
39787     int mem_base;
39788     int ret_val;
39789     int code; /* UCS code point */
39790     int n_code;
39791
39792     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39793         mem_base = xmlMemBlocks();
39794         code = gen_int(n_code, 0);
39795
39796         ret_val = xmlUCSIsCombiningMarksforSymbols(code);
39797         desret_int(ret_val);
39798         call_tests++;
39799         des_int(n_code, code, 0);
39800         xmlResetLastError();
39801         if (mem_base != xmlMemBlocks()) {
39802             printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
39803                    xmlMemBlocks() - mem_base);
39804             test_ret++;
39805             printf(" %d", n_code);
39806             printf("\n");
39807         }
39808     }
39809     function_tests++;
39810 #endif
39811
39812     return(test_ret);
39813 }
39814
39815
39816 static int
39817 test_xmlUCSIsControlPictures(void) {
39818     int test_ret = 0;
39819
39820 #if defined(LIBXML_UNICODE_ENABLED)
39821     int mem_base;
39822     int ret_val;
39823     int code; /* UCS code point */
39824     int n_code;
39825
39826     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39827         mem_base = xmlMemBlocks();
39828         code = gen_int(n_code, 0);
39829
39830         ret_val = xmlUCSIsControlPictures(code);
39831         desret_int(ret_val);
39832         call_tests++;
39833         des_int(n_code, code, 0);
39834         xmlResetLastError();
39835         if (mem_base != xmlMemBlocks()) {
39836             printf("Leak of %d blocks found in xmlUCSIsControlPictures",
39837                    xmlMemBlocks() - mem_base);
39838             test_ret++;
39839             printf(" %d", n_code);
39840             printf("\n");
39841         }
39842     }
39843     function_tests++;
39844 #endif
39845
39846     return(test_ret);
39847 }
39848
39849
39850 static int
39851 test_xmlUCSIsCurrencySymbols(void) {
39852     int test_ret = 0;
39853
39854 #if defined(LIBXML_UNICODE_ENABLED)
39855     int mem_base;
39856     int ret_val;
39857     int code; /* UCS code point */
39858     int n_code;
39859
39860     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39861         mem_base = xmlMemBlocks();
39862         code = gen_int(n_code, 0);
39863
39864         ret_val = xmlUCSIsCurrencySymbols(code);
39865         desret_int(ret_val);
39866         call_tests++;
39867         des_int(n_code, code, 0);
39868         xmlResetLastError();
39869         if (mem_base != xmlMemBlocks()) {
39870             printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
39871                    xmlMemBlocks() - mem_base);
39872             test_ret++;
39873             printf(" %d", n_code);
39874             printf("\n");
39875         }
39876     }
39877     function_tests++;
39878 #endif
39879
39880     return(test_ret);
39881 }
39882
39883
39884 static int
39885 test_xmlUCSIsCypriotSyllabary(void) {
39886     int test_ret = 0;
39887
39888 #if defined(LIBXML_UNICODE_ENABLED)
39889     int mem_base;
39890     int ret_val;
39891     int code; /* UCS code point */
39892     int n_code;
39893
39894     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39895         mem_base = xmlMemBlocks();
39896         code = gen_int(n_code, 0);
39897
39898         ret_val = xmlUCSIsCypriotSyllabary(code);
39899         desret_int(ret_val);
39900         call_tests++;
39901         des_int(n_code, code, 0);
39902         xmlResetLastError();
39903         if (mem_base != xmlMemBlocks()) {
39904             printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
39905                    xmlMemBlocks() - mem_base);
39906             test_ret++;
39907             printf(" %d", n_code);
39908             printf("\n");
39909         }
39910     }
39911     function_tests++;
39912 #endif
39913
39914     return(test_ret);
39915 }
39916
39917
39918 static int
39919 test_xmlUCSIsCyrillic(void) {
39920     int test_ret = 0;
39921
39922 #if defined(LIBXML_UNICODE_ENABLED)
39923     int mem_base;
39924     int ret_val;
39925     int code; /* UCS code point */
39926     int n_code;
39927
39928     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39929         mem_base = xmlMemBlocks();
39930         code = gen_int(n_code, 0);
39931
39932         ret_val = xmlUCSIsCyrillic(code);
39933         desret_int(ret_val);
39934         call_tests++;
39935         des_int(n_code, code, 0);
39936         xmlResetLastError();
39937         if (mem_base != xmlMemBlocks()) {
39938             printf("Leak of %d blocks found in xmlUCSIsCyrillic",
39939                    xmlMemBlocks() - mem_base);
39940             test_ret++;
39941             printf(" %d", n_code);
39942             printf("\n");
39943         }
39944     }
39945     function_tests++;
39946 #endif
39947
39948     return(test_ret);
39949 }
39950
39951
39952 static int
39953 test_xmlUCSIsCyrillicSupplement(void) {
39954     int test_ret = 0;
39955
39956 #if defined(LIBXML_UNICODE_ENABLED)
39957     int mem_base;
39958     int ret_val;
39959     int code; /* UCS code point */
39960     int n_code;
39961
39962     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39963         mem_base = xmlMemBlocks();
39964         code = gen_int(n_code, 0);
39965
39966         ret_val = xmlUCSIsCyrillicSupplement(code);
39967         desret_int(ret_val);
39968         call_tests++;
39969         des_int(n_code, code, 0);
39970         xmlResetLastError();
39971         if (mem_base != xmlMemBlocks()) {
39972             printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
39973                    xmlMemBlocks() - mem_base);
39974             test_ret++;
39975             printf(" %d", n_code);
39976             printf("\n");
39977         }
39978     }
39979     function_tests++;
39980 #endif
39981
39982     return(test_ret);
39983 }
39984
39985
39986 static int
39987 test_xmlUCSIsDeseret(void) {
39988     int test_ret = 0;
39989
39990 #if defined(LIBXML_UNICODE_ENABLED)
39991     int mem_base;
39992     int ret_val;
39993     int code; /* UCS code point */
39994     int n_code;
39995
39996     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39997         mem_base = xmlMemBlocks();
39998         code = gen_int(n_code, 0);
39999
40000         ret_val = xmlUCSIsDeseret(code);
40001         desret_int(ret_val);
40002         call_tests++;
40003         des_int(n_code, code, 0);
40004         xmlResetLastError();
40005         if (mem_base != xmlMemBlocks()) {
40006             printf("Leak of %d blocks found in xmlUCSIsDeseret",
40007                    xmlMemBlocks() - mem_base);
40008             test_ret++;
40009             printf(" %d", n_code);
40010             printf("\n");
40011         }
40012     }
40013     function_tests++;
40014 #endif
40015
40016     return(test_ret);
40017 }
40018
40019
40020 static int
40021 test_xmlUCSIsDevanagari(void) {
40022     int test_ret = 0;
40023
40024 #if defined(LIBXML_UNICODE_ENABLED)
40025     int mem_base;
40026     int ret_val;
40027     int code; /* UCS code point */
40028     int n_code;
40029
40030     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40031         mem_base = xmlMemBlocks();
40032         code = gen_int(n_code, 0);
40033
40034         ret_val = xmlUCSIsDevanagari(code);
40035         desret_int(ret_val);
40036         call_tests++;
40037         des_int(n_code, code, 0);
40038         xmlResetLastError();
40039         if (mem_base != xmlMemBlocks()) {
40040             printf("Leak of %d blocks found in xmlUCSIsDevanagari",
40041                    xmlMemBlocks() - mem_base);
40042             test_ret++;
40043             printf(" %d", n_code);
40044             printf("\n");
40045         }
40046     }
40047     function_tests++;
40048 #endif
40049
40050     return(test_ret);
40051 }
40052
40053
40054 static int
40055 test_xmlUCSIsDingbats(void) {
40056     int test_ret = 0;
40057
40058 #if defined(LIBXML_UNICODE_ENABLED)
40059     int mem_base;
40060     int ret_val;
40061     int code; /* UCS code point */
40062     int n_code;
40063
40064     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40065         mem_base = xmlMemBlocks();
40066         code = gen_int(n_code, 0);
40067
40068         ret_val = xmlUCSIsDingbats(code);
40069         desret_int(ret_val);
40070         call_tests++;
40071         des_int(n_code, code, 0);
40072         xmlResetLastError();
40073         if (mem_base != xmlMemBlocks()) {
40074             printf("Leak of %d blocks found in xmlUCSIsDingbats",
40075                    xmlMemBlocks() - mem_base);
40076             test_ret++;
40077             printf(" %d", n_code);
40078             printf("\n");
40079         }
40080     }
40081     function_tests++;
40082 #endif
40083
40084     return(test_ret);
40085 }
40086
40087
40088 static int
40089 test_xmlUCSIsEnclosedAlphanumerics(void) {
40090     int test_ret = 0;
40091
40092 #if defined(LIBXML_UNICODE_ENABLED)
40093     int mem_base;
40094     int ret_val;
40095     int code; /* UCS code point */
40096     int n_code;
40097
40098     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40099         mem_base = xmlMemBlocks();
40100         code = gen_int(n_code, 0);
40101
40102         ret_val = xmlUCSIsEnclosedAlphanumerics(code);
40103         desret_int(ret_val);
40104         call_tests++;
40105         des_int(n_code, code, 0);
40106         xmlResetLastError();
40107         if (mem_base != xmlMemBlocks()) {
40108             printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
40109                    xmlMemBlocks() - mem_base);
40110             test_ret++;
40111             printf(" %d", n_code);
40112             printf("\n");
40113         }
40114     }
40115     function_tests++;
40116 #endif
40117
40118     return(test_ret);
40119 }
40120
40121
40122 static int
40123 test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
40124     int test_ret = 0;
40125
40126 #if defined(LIBXML_UNICODE_ENABLED)
40127     int mem_base;
40128     int ret_val;
40129     int code; /* UCS code point */
40130     int n_code;
40131
40132     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40133         mem_base = xmlMemBlocks();
40134         code = gen_int(n_code, 0);
40135
40136         ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
40137         desret_int(ret_val);
40138         call_tests++;
40139         des_int(n_code, code, 0);
40140         xmlResetLastError();
40141         if (mem_base != xmlMemBlocks()) {
40142             printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
40143                    xmlMemBlocks() - mem_base);
40144             test_ret++;
40145             printf(" %d", n_code);
40146             printf("\n");
40147         }
40148     }
40149     function_tests++;
40150 #endif
40151
40152     return(test_ret);
40153 }
40154
40155
40156 static int
40157 test_xmlUCSIsEthiopic(void) {
40158     int test_ret = 0;
40159
40160 #if defined(LIBXML_UNICODE_ENABLED)
40161     int mem_base;
40162     int ret_val;
40163     int code; /* UCS code point */
40164     int n_code;
40165
40166     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40167         mem_base = xmlMemBlocks();
40168         code = gen_int(n_code, 0);
40169
40170         ret_val = xmlUCSIsEthiopic(code);
40171         desret_int(ret_val);
40172         call_tests++;
40173         des_int(n_code, code, 0);
40174         xmlResetLastError();
40175         if (mem_base != xmlMemBlocks()) {
40176             printf("Leak of %d blocks found in xmlUCSIsEthiopic",
40177                    xmlMemBlocks() - mem_base);
40178             test_ret++;
40179             printf(" %d", n_code);
40180             printf("\n");
40181         }
40182     }
40183     function_tests++;
40184 #endif
40185
40186     return(test_ret);
40187 }
40188
40189
40190 static int
40191 test_xmlUCSIsGeneralPunctuation(void) {
40192     int test_ret = 0;
40193
40194 #if defined(LIBXML_UNICODE_ENABLED)
40195     int mem_base;
40196     int ret_val;
40197     int code; /* UCS code point */
40198     int n_code;
40199
40200     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40201         mem_base = xmlMemBlocks();
40202         code = gen_int(n_code, 0);
40203
40204         ret_val = xmlUCSIsGeneralPunctuation(code);
40205         desret_int(ret_val);
40206         call_tests++;
40207         des_int(n_code, code, 0);
40208         xmlResetLastError();
40209         if (mem_base != xmlMemBlocks()) {
40210             printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
40211                    xmlMemBlocks() - mem_base);
40212             test_ret++;
40213             printf(" %d", n_code);
40214             printf("\n");
40215         }
40216     }
40217     function_tests++;
40218 #endif
40219
40220     return(test_ret);
40221 }
40222
40223
40224 static int
40225 test_xmlUCSIsGeometricShapes(void) {
40226     int test_ret = 0;
40227
40228 #if defined(LIBXML_UNICODE_ENABLED)
40229     int mem_base;
40230     int ret_val;
40231     int code; /* UCS code point */
40232     int n_code;
40233
40234     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40235         mem_base = xmlMemBlocks();
40236         code = gen_int(n_code, 0);
40237
40238         ret_val = xmlUCSIsGeometricShapes(code);
40239         desret_int(ret_val);
40240         call_tests++;
40241         des_int(n_code, code, 0);
40242         xmlResetLastError();
40243         if (mem_base != xmlMemBlocks()) {
40244             printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
40245                    xmlMemBlocks() - mem_base);
40246             test_ret++;
40247             printf(" %d", n_code);
40248             printf("\n");
40249         }
40250     }
40251     function_tests++;
40252 #endif
40253
40254     return(test_ret);
40255 }
40256
40257
40258 static int
40259 test_xmlUCSIsGeorgian(void) {
40260     int test_ret = 0;
40261
40262 #if defined(LIBXML_UNICODE_ENABLED)
40263     int mem_base;
40264     int ret_val;
40265     int code; /* UCS code point */
40266     int n_code;
40267
40268     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40269         mem_base = xmlMemBlocks();
40270         code = gen_int(n_code, 0);
40271
40272         ret_val = xmlUCSIsGeorgian(code);
40273         desret_int(ret_val);
40274         call_tests++;
40275         des_int(n_code, code, 0);
40276         xmlResetLastError();
40277         if (mem_base != xmlMemBlocks()) {
40278             printf("Leak of %d blocks found in xmlUCSIsGeorgian",
40279                    xmlMemBlocks() - mem_base);
40280             test_ret++;
40281             printf(" %d", n_code);
40282             printf("\n");
40283         }
40284     }
40285     function_tests++;
40286 #endif
40287
40288     return(test_ret);
40289 }
40290
40291
40292 static int
40293 test_xmlUCSIsGothic(void) {
40294     int test_ret = 0;
40295
40296 #if defined(LIBXML_UNICODE_ENABLED)
40297     int mem_base;
40298     int ret_val;
40299     int code; /* UCS code point */
40300     int n_code;
40301
40302     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40303         mem_base = xmlMemBlocks();
40304         code = gen_int(n_code, 0);
40305
40306         ret_val = xmlUCSIsGothic(code);
40307         desret_int(ret_val);
40308         call_tests++;
40309         des_int(n_code, code, 0);
40310         xmlResetLastError();
40311         if (mem_base != xmlMemBlocks()) {
40312             printf("Leak of %d blocks found in xmlUCSIsGothic",
40313                    xmlMemBlocks() - mem_base);
40314             test_ret++;
40315             printf(" %d", n_code);
40316             printf("\n");
40317         }
40318     }
40319     function_tests++;
40320 #endif
40321
40322     return(test_ret);
40323 }
40324
40325
40326 static int
40327 test_xmlUCSIsGreek(void) {
40328     int test_ret = 0;
40329
40330 #if defined(LIBXML_UNICODE_ENABLED)
40331     int mem_base;
40332     int ret_val;
40333     int code; /* UCS code point */
40334     int n_code;
40335
40336     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40337         mem_base = xmlMemBlocks();
40338         code = gen_int(n_code, 0);
40339
40340         ret_val = xmlUCSIsGreek(code);
40341         desret_int(ret_val);
40342         call_tests++;
40343         des_int(n_code, code, 0);
40344         xmlResetLastError();
40345         if (mem_base != xmlMemBlocks()) {
40346             printf("Leak of %d blocks found in xmlUCSIsGreek",
40347                    xmlMemBlocks() - mem_base);
40348             test_ret++;
40349             printf(" %d", n_code);
40350             printf("\n");
40351         }
40352     }
40353     function_tests++;
40354 #endif
40355
40356     return(test_ret);
40357 }
40358
40359
40360 static int
40361 test_xmlUCSIsGreekExtended(void) {
40362     int test_ret = 0;
40363
40364 #if defined(LIBXML_UNICODE_ENABLED)
40365     int mem_base;
40366     int ret_val;
40367     int code; /* UCS code point */
40368     int n_code;
40369
40370     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40371         mem_base = xmlMemBlocks();
40372         code = gen_int(n_code, 0);
40373
40374         ret_val = xmlUCSIsGreekExtended(code);
40375         desret_int(ret_val);
40376         call_tests++;
40377         des_int(n_code, code, 0);
40378         xmlResetLastError();
40379         if (mem_base != xmlMemBlocks()) {
40380             printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
40381                    xmlMemBlocks() - mem_base);
40382             test_ret++;
40383             printf(" %d", n_code);
40384             printf("\n");
40385         }
40386     }
40387     function_tests++;
40388 #endif
40389
40390     return(test_ret);
40391 }
40392
40393
40394 static int
40395 test_xmlUCSIsGreekandCoptic(void) {
40396     int test_ret = 0;
40397
40398 #if defined(LIBXML_UNICODE_ENABLED)
40399     int mem_base;
40400     int ret_val;
40401     int code; /* UCS code point */
40402     int n_code;
40403
40404     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40405         mem_base = xmlMemBlocks();
40406         code = gen_int(n_code, 0);
40407
40408         ret_val = xmlUCSIsGreekandCoptic(code);
40409         desret_int(ret_val);
40410         call_tests++;
40411         des_int(n_code, code, 0);
40412         xmlResetLastError();
40413         if (mem_base != xmlMemBlocks()) {
40414             printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
40415                    xmlMemBlocks() - mem_base);
40416             test_ret++;
40417             printf(" %d", n_code);
40418             printf("\n");
40419         }
40420     }
40421     function_tests++;
40422 #endif
40423
40424     return(test_ret);
40425 }
40426
40427
40428 static int
40429 test_xmlUCSIsGujarati(void) {
40430     int test_ret = 0;
40431
40432 #if defined(LIBXML_UNICODE_ENABLED)
40433     int mem_base;
40434     int ret_val;
40435     int code; /* UCS code point */
40436     int n_code;
40437
40438     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40439         mem_base = xmlMemBlocks();
40440         code = gen_int(n_code, 0);
40441
40442         ret_val = xmlUCSIsGujarati(code);
40443         desret_int(ret_val);
40444         call_tests++;
40445         des_int(n_code, code, 0);
40446         xmlResetLastError();
40447         if (mem_base != xmlMemBlocks()) {
40448             printf("Leak of %d blocks found in xmlUCSIsGujarati",
40449                    xmlMemBlocks() - mem_base);
40450             test_ret++;
40451             printf(" %d", n_code);
40452             printf("\n");
40453         }
40454     }
40455     function_tests++;
40456 #endif
40457
40458     return(test_ret);
40459 }
40460
40461
40462 static int
40463 test_xmlUCSIsGurmukhi(void) {
40464     int test_ret = 0;
40465
40466 #if defined(LIBXML_UNICODE_ENABLED)
40467     int mem_base;
40468     int ret_val;
40469     int code; /* UCS code point */
40470     int n_code;
40471
40472     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40473         mem_base = xmlMemBlocks();
40474         code = gen_int(n_code, 0);
40475
40476         ret_val = xmlUCSIsGurmukhi(code);
40477         desret_int(ret_val);
40478         call_tests++;
40479         des_int(n_code, code, 0);
40480         xmlResetLastError();
40481         if (mem_base != xmlMemBlocks()) {
40482             printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
40483                    xmlMemBlocks() - mem_base);
40484             test_ret++;
40485             printf(" %d", n_code);
40486             printf("\n");
40487         }
40488     }
40489     function_tests++;
40490 #endif
40491
40492     return(test_ret);
40493 }
40494
40495
40496 static int
40497 test_xmlUCSIsHalfwidthandFullwidthForms(void) {
40498     int test_ret = 0;
40499
40500 #if defined(LIBXML_UNICODE_ENABLED)
40501     int mem_base;
40502     int ret_val;
40503     int code; /* UCS code point */
40504     int n_code;
40505
40506     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40507         mem_base = xmlMemBlocks();
40508         code = gen_int(n_code, 0);
40509
40510         ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
40511         desret_int(ret_val);
40512         call_tests++;
40513         des_int(n_code, code, 0);
40514         xmlResetLastError();
40515         if (mem_base != xmlMemBlocks()) {
40516             printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
40517                    xmlMemBlocks() - mem_base);
40518             test_ret++;
40519             printf(" %d", n_code);
40520             printf("\n");
40521         }
40522     }
40523     function_tests++;
40524 #endif
40525
40526     return(test_ret);
40527 }
40528
40529
40530 static int
40531 test_xmlUCSIsHangulCompatibilityJamo(void) {
40532     int test_ret = 0;
40533
40534 #if defined(LIBXML_UNICODE_ENABLED)
40535     int mem_base;
40536     int ret_val;
40537     int code; /* UCS code point */
40538     int n_code;
40539
40540     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40541         mem_base = xmlMemBlocks();
40542         code = gen_int(n_code, 0);
40543
40544         ret_val = xmlUCSIsHangulCompatibilityJamo(code);
40545         desret_int(ret_val);
40546         call_tests++;
40547         des_int(n_code, code, 0);
40548         xmlResetLastError();
40549         if (mem_base != xmlMemBlocks()) {
40550             printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
40551                    xmlMemBlocks() - mem_base);
40552             test_ret++;
40553             printf(" %d", n_code);
40554             printf("\n");
40555         }
40556     }
40557     function_tests++;
40558 #endif
40559
40560     return(test_ret);
40561 }
40562
40563
40564 static int
40565 test_xmlUCSIsHangulJamo(void) {
40566     int test_ret = 0;
40567
40568 #if defined(LIBXML_UNICODE_ENABLED)
40569     int mem_base;
40570     int ret_val;
40571     int code; /* UCS code point */
40572     int n_code;
40573
40574     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40575         mem_base = xmlMemBlocks();
40576         code = gen_int(n_code, 0);
40577
40578         ret_val = xmlUCSIsHangulJamo(code);
40579         desret_int(ret_val);
40580         call_tests++;
40581         des_int(n_code, code, 0);
40582         xmlResetLastError();
40583         if (mem_base != xmlMemBlocks()) {
40584             printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
40585                    xmlMemBlocks() - mem_base);
40586             test_ret++;
40587             printf(" %d", n_code);
40588             printf("\n");
40589         }
40590     }
40591     function_tests++;
40592 #endif
40593
40594     return(test_ret);
40595 }
40596
40597
40598 static int
40599 test_xmlUCSIsHangulSyllables(void) {
40600     int test_ret = 0;
40601
40602 #if defined(LIBXML_UNICODE_ENABLED)
40603     int mem_base;
40604     int ret_val;
40605     int code; /* UCS code point */
40606     int n_code;
40607
40608     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40609         mem_base = xmlMemBlocks();
40610         code = gen_int(n_code, 0);
40611
40612         ret_val = xmlUCSIsHangulSyllables(code);
40613         desret_int(ret_val);
40614         call_tests++;
40615         des_int(n_code, code, 0);
40616         xmlResetLastError();
40617         if (mem_base != xmlMemBlocks()) {
40618             printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
40619                    xmlMemBlocks() - mem_base);
40620             test_ret++;
40621             printf(" %d", n_code);
40622             printf("\n");
40623         }
40624     }
40625     function_tests++;
40626 #endif
40627
40628     return(test_ret);
40629 }
40630
40631
40632 static int
40633 test_xmlUCSIsHanunoo(void) {
40634     int test_ret = 0;
40635
40636 #if defined(LIBXML_UNICODE_ENABLED)
40637     int mem_base;
40638     int ret_val;
40639     int code; /* UCS code point */
40640     int n_code;
40641
40642     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40643         mem_base = xmlMemBlocks();
40644         code = gen_int(n_code, 0);
40645
40646         ret_val = xmlUCSIsHanunoo(code);
40647         desret_int(ret_val);
40648         call_tests++;
40649         des_int(n_code, code, 0);
40650         xmlResetLastError();
40651         if (mem_base != xmlMemBlocks()) {
40652             printf("Leak of %d blocks found in xmlUCSIsHanunoo",
40653                    xmlMemBlocks() - mem_base);
40654             test_ret++;
40655             printf(" %d", n_code);
40656             printf("\n");
40657         }
40658     }
40659     function_tests++;
40660 #endif
40661
40662     return(test_ret);
40663 }
40664
40665
40666 static int
40667 test_xmlUCSIsHebrew(void) {
40668     int test_ret = 0;
40669
40670 #if defined(LIBXML_UNICODE_ENABLED)
40671     int mem_base;
40672     int ret_val;
40673     int code; /* UCS code point */
40674     int n_code;
40675
40676     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40677         mem_base = xmlMemBlocks();
40678         code = gen_int(n_code, 0);
40679
40680         ret_val = xmlUCSIsHebrew(code);
40681         desret_int(ret_val);
40682         call_tests++;
40683         des_int(n_code, code, 0);
40684         xmlResetLastError();
40685         if (mem_base != xmlMemBlocks()) {
40686             printf("Leak of %d blocks found in xmlUCSIsHebrew",
40687                    xmlMemBlocks() - mem_base);
40688             test_ret++;
40689             printf(" %d", n_code);
40690             printf("\n");
40691         }
40692     }
40693     function_tests++;
40694 #endif
40695
40696     return(test_ret);
40697 }
40698
40699
40700 static int
40701 test_xmlUCSIsHighPrivateUseSurrogates(void) {
40702     int test_ret = 0;
40703
40704 #if defined(LIBXML_UNICODE_ENABLED)
40705     int mem_base;
40706     int ret_val;
40707     int code; /* UCS code point */
40708     int n_code;
40709
40710     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40711         mem_base = xmlMemBlocks();
40712         code = gen_int(n_code, 0);
40713
40714         ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
40715         desret_int(ret_val);
40716         call_tests++;
40717         des_int(n_code, code, 0);
40718         xmlResetLastError();
40719         if (mem_base != xmlMemBlocks()) {
40720             printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
40721                    xmlMemBlocks() - mem_base);
40722             test_ret++;
40723             printf(" %d", n_code);
40724             printf("\n");
40725         }
40726     }
40727     function_tests++;
40728 #endif
40729
40730     return(test_ret);
40731 }
40732
40733
40734 static int
40735 test_xmlUCSIsHighSurrogates(void) {
40736     int test_ret = 0;
40737
40738 #if defined(LIBXML_UNICODE_ENABLED)
40739     int mem_base;
40740     int ret_val;
40741     int code; /* UCS code point */
40742     int n_code;
40743
40744     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40745         mem_base = xmlMemBlocks();
40746         code = gen_int(n_code, 0);
40747
40748         ret_val = xmlUCSIsHighSurrogates(code);
40749         desret_int(ret_val);
40750         call_tests++;
40751         des_int(n_code, code, 0);
40752         xmlResetLastError();
40753         if (mem_base != xmlMemBlocks()) {
40754             printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
40755                    xmlMemBlocks() - mem_base);
40756             test_ret++;
40757             printf(" %d", n_code);
40758             printf("\n");
40759         }
40760     }
40761     function_tests++;
40762 #endif
40763
40764     return(test_ret);
40765 }
40766
40767
40768 static int
40769 test_xmlUCSIsHiragana(void) {
40770     int test_ret = 0;
40771
40772 #if defined(LIBXML_UNICODE_ENABLED)
40773     int mem_base;
40774     int ret_val;
40775     int code; /* UCS code point */
40776     int n_code;
40777
40778     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40779         mem_base = xmlMemBlocks();
40780         code = gen_int(n_code, 0);
40781
40782         ret_val = xmlUCSIsHiragana(code);
40783         desret_int(ret_val);
40784         call_tests++;
40785         des_int(n_code, code, 0);
40786         xmlResetLastError();
40787         if (mem_base != xmlMemBlocks()) {
40788             printf("Leak of %d blocks found in xmlUCSIsHiragana",
40789                    xmlMemBlocks() - mem_base);
40790             test_ret++;
40791             printf(" %d", n_code);
40792             printf("\n");
40793         }
40794     }
40795     function_tests++;
40796 #endif
40797
40798     return(test_ret);
40799 }
40800
40801
40802 static int
40803 test_xmlUCSIsIPAExtensions(void) {
40804     int test_ret = 0;
40805
40806 #if defined(LIBXML_UNICODE_ENABLED)
40807     int mem_base;
40808     int ret_val;
40809     int code; /* UCS code point */
40810     int n_code;
40811
40812     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40813         mem_base = xmlMemBlocks();
40814         code = gen_int(n_code, 0);
40815
40816         ret_val = xmlUCSIsIPAExtensions(code);
40817         desret_int(ret_val);
40818         call_tests++;
40819         des_int(n_code, code, 0);
40820         xmlResetLastError();
40821         if (mem_base != xmlMemBlocks()) {
40822             printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
40823                    xmlMemBlocks() - mem_base);
40824             test_ret++;
40825             printf(" %d", n_code);
40826             printf("\n");
40827         }
40828     }
40829     function_tests++;
40830 #endif
40831
40832     return(test_ret);
40833 }
40834
40835
40836 static int
40837 test_xmlUCSIsIdeographicDescriptionCharacters(void) {
40838     int test_ret = 0;
40839
40840 #if defined(LIBXML_UNICODE_ENABLED)
40841     int mem_base;
40842     int ret_val;
40843     int code; /* UCS code point */
40844     int n_code;
40845
40846     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40847         mem_base = xmlMemBlocks();
40848         code = gen_int(n_code, 0);
40849
40850         ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
40851         desret_int(ret_val);
40852         call_tests++;
40853         des_int(n_code, code, 0);
40854         xmlResetLastError();
40855         if (mem_base != xmlMemBlocks()) {
40856             printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
40857                    xmlMemBlocks() - mem_base);
40858             test_ret++;
40859             printf(" %d", n_code);
40860             printf("\n");
40861         }
40862     }
40863     function_tests++;
40864 #endif
40865
40866     return(test_ret);
40867 }
40868
40869
40870 static int
40871 test_xmlUCSIsKanbun(void) {
40872     int test_ret = 0;
40873
40874 #if defined(LIBXML_UNICODE_ENABLED)
40875     int mem_base;
40876     int ret_val;
40877     int code; /* UCS code point */
40878     int n_code;
40879
40880     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40881         mem_base = xmlMemBlocks();
40882         code = gen_int(n_code, 0);
40883
40884         ret_val = xmlUCSIsKanbun(code);
40885         desret_int(ret_val);
40886         call_tests++;
40887         des_int(n_code, code, 0);
40888         xmlResetLastError();
40889         if (mem_base != xmlMemBlocks()) {
40890             printf("Leak of %d blocks found in xmlUCSIsKanbun",
40891                    xmlMemBlocks() - mem_base);
40892             test_ret++;
40893             printf(" %d", n_code);
40894             printf("\n");
40895         }
40896     }
40897     function_tests++;
40898 #endif
40899
40900     return(test_ret);
40901 }
40902
40903
40904 static int
40905 test_xmlUCSIsKangxiRadicals(void) {
40906     int test_ret = 0;
40907
40908 #if defined(LIBXML_UNICODE_ENABLED)
40909     int mem_base;
40910     int ret_val;
40911     int code; /* UCS code point */
40912     int n_code;
40913
40914     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40915         mem_base = xmlMemBlocks();
40916         code = gen_int(n_code, 0);
40917
40918         ret_val = xmlUCSIsKangxiRadicals(code);
40919         desret_int(ret_val);
40920         call_tests++;
40921         des_int(n_code, code, 0);
40922         xmlResetLastError();
40923         if (mem_base != xmlMemBlocks()) {
40924             printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
40925                    xmlMemBlocks() - mem_base);
40926             test_ret++;
40927             printf(" %d", n_code);
40928             printf("\n");
40929         }
40930     }
40931     function_tests++;
40932 #endif
40933
40934     return(test_ret);
40935 }
40936
40937
40938 static int
40939 test_xmlUCSIsKannada(void) {
40940     int test_ret = 0;
40941
40942 #if defined(LIBXML_UNICODE_ENABLED)
40943     int mem_base;
40944     int ret_val;
40945     int code; /* UCS code point */
40946     int n_code;
40947
40948     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40949         mem_base = xmlMemBlocks();
40950         code = gen_int(n_code, 0);
40951
40952         ret_val = xmlUCSIsKannada(code);
40953         desret_int(ret_val);
40954         call_tests++;
40955         des_int(n_code, code, 0);
40956         xmlResetLastError();
40957         if (mem_base != xmlMemBlocks()) {
40958             printf("Leak of %d blocks found in xmlUCSIsKannada",
40959                    xmlMemBlocks() - mem_base);
40960             test_ret++;
40961             printf(" %d", n_code);
40962             printf("\n");
40963         }
40964     }
40965     function_tests++;
40966 #endif
40967
40968     return(test_ret);
40969 }
40970
40971
40972 static int
40973 test_xmlUCSIsKatakana(void) {
40974     int test_ret = 0;
40975
40976 #if defined(LIBXML_UNICODE_ENABLED)
40977     int mem_base;
40978     int ret_val;
40979     int code; /* UCS code point */
40980     int n_code;
40981
40982     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40983         mem_base = xmlMemBlocks();
40984         code = gen_int(n_code, 0);
40985
40986         ret_val = xmlUCSIsKatakana(code);
40987         desret_int(ret_val);
40988         call_tests++;
40989         des_int(n_code, code, 0);
40990         xmlResetLastError();
40991         if (mem_base != xmlMemBlocks()) {
40992             printf("Leak of %d blocks found in xmlUCSIsKatakana",
40993                    xmlMemBlocks() - mem_base);
40994             test_ret++;
40995             printf(" %d", n_code);
40996             printf("\n");
40997         }
40998     }
40999     function_tests++;
41000 #endif
41001
41002     return(test_ret);
41003 }
41004
41005
41006 static int
41007 test_xmlUCSIsKatakanaPhoneticExtensions(void) {
41008     int test_ret = 0;
41009
41010 #if defined(LIBXML_UNICODE_ENABLED)
41011     int mem_base;
41012     int ret_val;
41013     int code; /* UCS code point */
41014     int n_code;
41015
41016     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41017         mem_base = xmlMemBlocks();
41018         code = gen_int(n_code, 0);
41019
41020         ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
41021         desret_int(ret_val);
41022         call_tests++;
41023         des_int(n_code, code, 0);
41024         xmlResetLastError();
41025         if (mem_base != xmlMemBlocks()) {
41026             printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
41027                    xmlMemBlocks() - mem_base);
41028             test_ret++;
41029             printf(" %d", n_code);
41030             printf("\n");
41031         }
41032     }
41033     function_tests++;
41034 #endif
41035
41036     return(test_ret);
41037 }
41038
41039
41040 static int
41041 test_xmlUCSIsKhmer(void) {
41042     int test_ret = 0;
41043
41044 #if defined(LIBXML_UNICODE_ENABLED)
41045     int mem_base;
41046     int ret_val;
41047     int code; /* UCS code point */
41048     int n_code;
41049
41050     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41051         mem_base = xmlMemBlocks();
41052         code = gen_int(n_code, 0);
41053
41054         ret_val = xmlUCSIsKhmer(code);
41055         desret_int(ret_val);
41056         call_tests++;
41057         des_int(n_code, code, 0);
41058         xmlResetLastError();
41059         if (mem_base != xmlMemBlocks()) {
41060             printf("Leak of %d blocks found in xmlUCSIsKhmer",
41061                    xmlMemBlocks() - mem_base);
41062             test_ret++;
41063             printf(" %d", n_code);
41064             printf("\n");
41065         }
41066     }
41067     function_tests++;
41068 #endif
41069
41070     return(test_ret);
41071 }
41072
41073
41074 static int
41075 test_xmlUCSIsKhmerSymbols(void) {
41076     int test_ret = 0;
41077
41078 #if defined(LIBXML_UNICODE_ENABLED)
41079     int mem_base;
41080     int ret_val;
41081     int code; /* UCS code point */
41082     int n_code;
41083
41084     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41085         mem_base = xmlMemBlocks();
41086         code = gen_int(n_code, 0);
41087
41088         ret_val = xmlUCSIsKhmerSymbols(code);
41089         desret_int(ret_val);
41090         call_tests++;
41091         des_int(n_code, code, 0);
41092         xmlResetLastError();
41093         if (mem_base != xmlMemBlocks()) {
41094             printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
41095                    xmlMemBlocks() - mem_base);
41096             test_ret++;
41097             printf(" %d", n_code);
41098             printf("\n");
41099         }
41100     }
41101     function_tests++;
41102 #endif
41103
41104     return(test_ret);
41105 }
41106
41107
41108 static int
41109 test_xmlUCSIsLao(void) {
41110     int test_ret = 0;
41111
41112 #if defined(LIBXML_UNICODE_ENABLED)
41113     int mem_base;
41114     int ret_val;
41115     int code; /* UCS code point */
41116     int n_code;
41117
41118     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41119         mem_base = xmlMemBlocks();
41120         code = gen_int(n_code, 0);
41121
41122         ret_val = xmlUCSIsLao(code);
41123         desret_int(ret_val);
41124         call_tests++;
41125         des_int(n_code, code, 0);
41126         xmlResetLastError();
41127         if (mem_base != xmlMemBlocks()) {
41128             printf("Leak of %d blocks found in xmlUCSIsLao",
41129                    xmlMemBlocks() - mem_base);
41130             test_ret++;
41131             printf(" %d", n_code);
41132             printf("\n");
41133         }
41134     }
41135     function_tests++;
41136 #endif
41137
41138     return(test_ret);
41139 }
41140
41141
41142 static int
41143 test_xmlUCSIsLatin1Supplement(void) {
41144     int test_ret = 0;
41145
41146 #if defined(LIBXML_UNICODE_ENABLED)
41147     int mem_base;
41148     int ret_val;
41149     int code; /* UCS code point */
41150     int n_code;
41151
41152     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41153         mem_base = xmlMemBlocks();
41154         code = gen_int(n_code, 0);
41155
41156         ret_val = xmlUCSIsLatin1Supplement(code);
41157         desret_int(ret_val);
41158         call_tests++;
41159         des_int(n_code, code, 0);
41160         xmlResetLastError();
41161         if (mem_base != xmlMemBlocks()) {
41162             printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
41163                    xmlMemBlocks() - mem_base);
41164             test_ret++;
41165             printf(" %d", n_code);
41166             printf("\n");
41167         }
41168     }
41169     function_tests++;
41170 #endif
41171
41172     return(test_ret);
41173 }
41174
41175
41176 static int
41177 test_xmlUCSIsLatinExtendedA(void) {
41178     int test_ret = 0;
41179
41180 #if defined(LIBXML_UNICODE_ENABLED)
41181     int mem_base;
41182     int ret_val;
41183     int code; /* UCS code point */
41184     int n_code;
41185
41186     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41187         mem_base = xmlMemBlocks();
41188         code = gen_int(n_code, 0);
41189
41190         ret_val = xmlUCSIsLatinExtendedA(code);
41191         desret_int(ret_val);
41192         call_tests++;
41193         des_int(n_code, code, 0);
41194         xmlResetLastError();
41195         if (mem_base != xmlMemBlocks()) {
41196             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
41197                    xmlMemBlocks() - mem_base);
41198             test_ret++;
41199             printf(" %d", n_code);
41200             printf("\n");
41201         }
41202     }
41203     function_tests++;
41204 #endif
41205
41206     return(test_ret);
41207 }
41208
41209
41210 static int
41211 test_xmlUCSIsLatinExtendedAdditional(void) {
41212     int test_ret = 0;
41213
41214 #if defined(LIBXML_UNICODE_ENABLED)
41215     int mem_base;
41216     int ret_val;
41217     int code; /* UCS code point */
41218     int n_code;
41219
41220     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41221         mem_base = xmlMemBlocks();
41222         code = gen_int(n_code, 0);
41223
41224         ret_val = xmlUCSIsLatinExtendedAdditional(code);
41225         desret_int(ret_val);
41226         call_tests++;
41227         des_int(n_code, code, 0);
41228         xmlResetLastError();
41229         if (mem_base != xmlMemBlocks()) {
41230             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
41231                    xmlMemBlocks() - mem_base);
41232             test_ret++;
41233             printf(" %d", n_code);
41234             printf("\n");
41235         }
41236     }
41237     function_tests++;
41238 #endif
41239
41240     return(test_ret);
41241 }
41242
41243
41244 static int
41245 test_xmlUCSIsLatinExtendedB(void) {
41246     int test_ret = 0;
41247
41248 #if defined(LIBXML_UNICODE_ENABLED)
41249     int mem_base;
41250     int ret_val;
41251     int code; /* UCS code point */
41252     int n_code;
41253
41254     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41255         mem_base = xmlMemBlocks();
41256         code = gen_int(n_code, 0);
41257
41258         ret_val = xmlUCSIsLatinExtendedB(code);
41259         desret_int(ret_val);
41260         call_tests++;
41261         des_int(n_code, code, 0);
41262         xmlResetLastError();
41263         if (mem_base != xmlMemBlocks()) {
41264             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
41265                    xmlMemBlocks() - mem_base);
41266             test_ret++;
41267             printf(" %d", n_code);
41268             printf("\n");
41269         }
41270     }
41271     function_tests++;
41272 #endif
41273
41274     return(test_ret);
41275 }
41276
41277
41278 static int
41279 test_xmlUCSIsLetterlikeSymbols(void) {
41280     int test_ret = 0;
41281
41282 #if defined(LIBXML_UNICODE_ENABLED)
41283     int mem_base;
41284     int ret_val;
41285     int code; /* UCS code point */
41286     int n_code;
41287
41288     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41289         mem_base = xmlMemBlocks();
41290         code = gen_int(n_code, 0);
41291
41292         ret_val = xmlUCSIsLetterlikeSymbols(code);
41293         desret_int(ret_val);
41294         call_tests++;
41295         des_int(n_code, code, 0);
41296         xmlResetLastError();
41297         if (mem_base != xmlMemBlocks()) {
41298             printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
41299                    xmlMemBlocks() - mem_base);
41300             test_ret++;
41301             printf(" %d", n_code);
41302             printf("\n");
41303         }
41304     }
41305     function_tests++;
41306 #endif
41307
41308     return(test_ret);
41309 }
41310
41311
41312 static int
41313 test_xmlUCSIsLimbu(void) {
41314     int test_ret = 0;
41315
41316 #if defined(LIBXML_UNICODE_ENABLED)
41317     int mem_base;
41318     int ret_val;
41319     int code; /* UCS code point */
41320     int n_code;
41321
41322     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41323         mem_base = xmlMemBlocks();
41324         code = gen_int(n_code, 0);
41325
41326         ret_val = xmlUCSIsLimbu(code);
41327         desret_int(ret_val);
41328         call_tests++;
41329         des_int(n_code, code, 0);
41330         xmlResetLastError();
41331         if (mem_base != xmlMemBlocks()) {
41332             printf("Leak of %d blocks found in xmlUCSIsLimbu",
41333                    xmlMemBlocks() - mem_base);
41334             test_ret++;
41335             printf(" %d", n_code);
41336             printf("\n");
41337         }
41338     }
41339     function_tests++;
41340 #endif
41341
41342     return(test_ret);
41343 }
41344
41345
41346 static int
41347 test_xmlUCSIsLinearBIdeograms(void) {
41348     int test_ret = 0;
41349
41350 #if defined(LIBXML_UNICODE_ENABLED)
41351     int mem_base;
41352     int ret_val;
41353     int code; /* UCS code point */
41354     int n_code;
41355
41356     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41357         mem_base = xmlMemBlocks();
41358         code = gen_int(n_code, 0);
41359
41360         ret_val = xmlUCSIsLinearBIdeograms(code);
41361         desret_int(ret_val);
41362         call_tests++;
41363         des_int(n_code, code, 0);
41364         xmlResetLastError();
41365         if (mem_base != xmlMemBlocks()) {
41366             printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
41367                    xmlMemBlocks() - mem_base);
41368             test_ret++;
41369             printf(" %d", n_code);
41370             printf("\n");
41371         }
41372     }
41373     function_tests++;
41374 #endif
41375
41376     return(test_ret);
41377 }
41378
41379
41380 static int
41381 test_xmlUCSIsLinearBSyllabary(void) {
41382     int test_ret = 0;
41383
41384 #if defined(LIBXML_UNICODE_ENABLED)
41385     int mem_base;
41386     int ret_val;
41387     int code; /* UCS code point */
41388     int n_code;
41389
41390     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41391         mem_base = xmlMemBlocks();
41392         code = gen_int(n_code, 0);
41393
41394         ret_val = xmlUCSIsLinearBSyllabary(code);
41395         desret_int(ret_val);
41396         call_tests++;
41397         des_int(n_code, code, 0);
41398         xmlResetLastError();
41399         if (mem_base != xmlMemBlocks()) {
41400             printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
41401                    xmlMemBlocks() - mem_base);
41402             test_ret++;
41403             printf(" %d", n_code);
41404             printf("\n");
41405         }
41406     }
41407     function_tests++;
41408 #endif
41409
41410     return(test_ret);
41411 }
41412
41413
41414 static int
41415 test_xmlUCSIsLowSurrogates(void) {
41416     int test_ret = 0;
41417
41418 #if defined(LIBXML_UNICODE_ENABLED)
41419     int mem_base;
41420     int ret_val;
41421     int code; /* UCS code point */
41422     int n_code;
41423
41424     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41425         mem_base = xmlMemBlocks();
41426         code = gen_int(n_code, 0);
41427
41428         ret_val = xmlUCSIsLowSurrogates(code);
41429         desret_int(ret_val);
41430         call_tests++;
41431         des_int(n_code, code, 0);
41432         xmlResetLastError();
41433         if (mem_base != xmlMemBlocks()) {
41434             printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
41435                    xmlMemBlocks() - mem_base);
41436             test_ret++;
41437             printf(" %d", n_code);
41438             printf("\n");
41439         }
41440     }
41441     function_tests++;
41442 #endif
41443
41444     return(test_ret);
41445 }
41446
41447
41448 static int
41449 test_xmlUCSIsMalayalam(void) {
41450     int test_ret = 0;
41451
41452 #if defined(LIBXML_UNICODE_ENABLED)
41453     int mem_base;
41454     int ret_val;
41455     int code; /* UCS code point */
41456     int n_code;
41457
41458     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41459         mem_base = xmlMemBlocks();
41460         code = gen_int(n_code, 0);
41461
41462         ret_val = xmlUCSIsMalayalam(code);
41463         desret_int(ret_val);
41464         call_tests++;
41465         des_int(n_code, code, 0);
41466         xmlResetLastError();
41467         if (mem_base != xmlMemBlocks()) {
41468             printf("Leak of %d blocks found in xmlUCSIsMalayalam",
41469                    xmlMemBlocks() - mem_base);
41470             test_ret++;
41471             printf(" %d", n_code);
41472             printf("\n");
41473         }
41474     }
41475     function_tests++;
41476 #endif
41477
41478     return(test_ret);
41479 }
41480
41481
41482 static int
41483 test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
41484     int test_ret = 0;
41485
41486 #if defined(LIBXML_UNICODE_ENABLED)
41487     int mem_base;
41488     int ret_val;
41489     int code; /* UCS code point */
41490     int n_code;
41491
41492     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41493         mem_base = xmlMemBlocks();
41494         code = gen_int(n_code, 0);
41495
41496         ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
41497         desret_int(ret_val);
41498         call_tests++;
41499         des_int(n_code, code, 0);
41500         xmlResetLastError();
41501         if (mem_base != xmlMemBlocks()) {
41502             printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
41503                    xmlMemBlocks() - mem_base);
41504             test_ret++;
41505             printf(" %d", n_code);
41506             printf("\n");
41507         }
41508     }
41509     function_tests++;
41510 #endif
41511
41512     return(test_ret);
41513 }
41514
41515
41516 static int
41517 test_xmlUCSIsMathematicalOperators(void) {
41518     int test_ret = 0;
41519
41520 #if defined(LIBXML_UNICODE_ENABLED)
41521     int mem_base;
41522     int ret_val;
41523     int code; /* UCS code point */
41524     int n_code;
41525
41526     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41527         mem_base = xmlMemBlocks();
41528         code = gen_int(n_code, 0);
41529
41530         ret_val = xmlUCSIsMathematicalOperators(code);
41531         desret_int(ret_val);
41532         call_tests++;
41533         des_int(n_code, code, 0);
41534         xmlResetLastError();
41535         if (mem_base != xmlMemBlocks()) {
41536             printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
41537                    xmlMemBlocks() - mem_base);
41538             test_ret++;
41539             printf(" %d", n_code);
41540             printf("\n");
41541         }
41542     }
41543     function_tests++;
41544 #endif
41545
41546     return(test_ret);
41547 }
41548
41549
41550 static int
41551 test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
41552     int test_ret = 0;
41553
41554 #if defined(LIBXML_UNICODE_ENABLED)
41555     int mem_base;
41556     int ret_val;
41557     int code; /* UCS code point */
41558     int n_code;
41559
41560     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41561         mem_base = xmlMemBlocks();
41562         code = gen_int(n_code, 0);
41563
41564         ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
41565         desret_int(ret_val);
41566         call_tests++;
41567         des_int(n_code, code, 0);
41568         xmlResetLastError();
41569         if (mem_base != xmlMemBlocks()) {
41570             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
41571                    xmlMemBlocks() - mem_base);
41572             test_ret++;
41573             printf(" %d", n_code);
41574             printf("\n");
41575         }
41576     }
41577     function_tests++;
41578 #endif
41579
41580     return(test_ret);
41581 }
41582
41583
41584 static int
41585 test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
41586     int test_ret = 0;
41587
41588 #if defined(LIBXML_UNICODE_ENABLED)
41589     int mem_base;
41590     int ret_val;
41591     int code; /* UCS code point */
41592     int n_code;
41593
41594     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41595         mem_base = xmlMemBlocks();
41596         code = gen_int(n_code, 0);
41597
41598         ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
41599         desret_int(ret_val);
41600         call_tests++;
41601         des_int(n_code, code, 0);
41602         xmlResetLastError();
41603         if (mem_base != xmlMemBlocks()) {
41604             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
41605                    xmlMemBlocks() - mem_base);
41606             test_ret++;
41607             printf(" %d", n_code);
41608             printf("\n");
41609         }
41610     }
41611     function_tests++;
41612 #endif
41613
41614     return(test_ret);
41615 }
41616
41617
41618 static int
41619 test_xmlUCSIsMiscellaneousSymbols(void) {
41620     int test_ret = 0;
41621
41622 #if defined(LIBXML_UNICODE_ENABLED)
41623     int mem_base;
41624     int ret_val;
41625     int code; /* UCS code point */
41626     int n_code;
41627
41628     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41629         mem_base = xmlMemBlocks();
41630         code = gen_int(n_code, 0);
41631
41632         ret_val = xmlUCSIsMiscellaneousSymbols(code);
41633         desret_int(ret_val);
41634         call_tests++;
41635         des_int(n_code, code, 0);
41636         xmlResetLastError();
41637         if (mem_base != xmlMemBlocks()) {
41638             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
41639                    xmlMemBlocks() - mem_base);
41640             test_ret++;
41641             printf(" %d", n_code);
41642             printf("\n");
41643         }
41644     }
41645     function_tests++;
41646 #endif
41647
41648     return(test_ret);
41649 }
41650
41651
41652 static int
41653 test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
41654     int test_ret = 0;
41655
41656 #if defined(LIBXML_UNICODE_ENABLED)
41657     int mem_base;
41658     int ret_val;
41659     int code; /* UCS code point */
41660     int n_code;
41661
41662     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41663         mem_base = xmlMemBlocks();
41664         code = gen_int(n_code, 0);
41665
41666         ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
41667         desret_int(ret_val);
41668         call_tests++;
41669         des_int(n_code, code, 0);
41670         xmlResetLastError();
41671         if (mem_base != xmlMemBlocks()) {
41672             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
41673                    xmlMemBlocks() - mem_base);
41674             test_ret++;
41675             printf(" %d", n_code);
41676             printf("\n");
41677         }
41678     }
41679     function_tests++;
41680 #endif
41681
41682     return(test_ret);
41683 }
41684
41685
41686 static int
41687 test_xmlUCSIsMiscellaneousTechnical(void) {
41688     int test_ret = 0;
41689
41690 #if defined(LIBXML_UNICODE_ENABLED)
41691     int mem_base;
41692     int ret_val;
41693     int code; /* UCS code point */
41694     int n_code;
41695
41696     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41697         mem_base = xmlMemBlocks();
41698         code = gen_int(n_code, 0);
41699
41700         ret_val = xmlUCSIsMiscellaneousTechnical(code);
41701         desret_int(ret_val);
41702         call_tests++;
41703         des_int(n_code, code, 0);
41704         xmlResetLastError();
41705         if (mem_base != xmlMemBlocks()) {
41706             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
41707                    xmlMemBlocks() - mem_base);
41708             test_ret++;
41709             printf(" %d", n_code);
41710             printf("\n");
41711         }
41712     }
41713     function_tests++;
41714 #endif
41715
41716     return(test_ret);
41717 }
41718
41719
41720 static int
41721 test_xmlUCSIsMongolian(void) {
41722     int test_ret = 0;
41723
41724 #if defined(LIBXML_UNICODE_ENABLED)
41725     int mem_base;
41726     int ret_val;
41727     int code; /* UCS code point */
41728     int n_code;
41729
41730     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41731         mem_base = xmlMemBlocks();
41732         code = gen_int(n_code, 0);
41733
41734         ret_val = xmlUCSIsMongolian(code);
41735         desret_int(ret_val);
41736         call_tests++;
41737         des_int(n_code, code, 0);
41738         xmlResetLastError();
41739         if (mem_base != xmlMemBlocks()) {
41740             printf("Leak of %d blocks found in xmlUCSIsMongolian",
41741                    xmlMemBlocks() - mem_base);
41742             test_ret++;
41743             printf(" %d", n_code);
41744             printf("\n");
41745         }
41746     }
41747     function_tests++;
41748 #endif
41749
41750     return(test_ret);
41751 }
41752
41753
41754 static int
41755 test_xmlUCSIsMusicalSymbols(void) {
41756     int test_ret = 0;
41757
41758 #if defined(LIBXML_UNICODE_ENABLED)
41759     int mem_base;
41760     int ret_val;
41761     int code; /* UCS code point */
41762     int n_code;
41763
41764     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41765         mem_base = xmlMemBlocks();
41766         code = gen_int(n_code, 0);
41767
41768         ret_val = xmlUCSIsMusicalSymbols(code);
41769         desret_int(ret_val);
41770         call_tests++;
41771         des_int(n_code, code, 0);
41772         xmlResetLastError();
41773         if (mem_base != xmlMemBlocks()) {
41774             printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
41775                    xmlMemBlocks() - mem_base);
41776             test_ret++;
41777             printf(" %d", n_code);
41778             printf("\n");
41779         }
41780     }
41781     function_tests++;
41782 #endif
41783
41784     return(test_ret);
41785 }
41786
41787
41788 static int
41789 test_xmlUCSIsMyanmar(void) {
41790     int test_ret = 0;
41791
41792 #if defined(LIBXML_UNICODE_ENABLED)
41793     int mem_base;
41794     int ret_val;
41795     int code; /* UCS code point */
41796     int n_code;
41797
41798     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41799         mem_base = xmlMemBlocks();
41800         code = gen_int(n_code, 0);
41801
41802         ret_val = xmlUCSIsMyanmar(code);
41803         desret_int(ret_val);
41804         call_tests++;
41805         des_int(n_code, code, 0);
41806         xmlResetLastError();
41807         if (mem_base != xmlMemBlocks()) {
41808             printf("Leak of %d blocks found in xmlUCSIsMyanmar",
41809                    xmlMemBlocks() - mem_base);
41810             test_ret++;
41811             printf(" %d", n_code);
41812             printf("\n");
41813         }
41814     }
41815     function_tests++;
41816 #endif
41817
41818     return(test_ret);
41819 }
41820
41821
41822 static int
41823 test_xmlUCSIsNumberForms(void) {
41824     int test_ret = 0;
41825
41826 #if defined(LIBXML_UNICODE_ENABLED)
41827     int mem_base;
41828     int ret_val;
41829     int code; /* UCS code point */
41830     int n_code;
41831
41832     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41833         mem_base = xmlMemBlocks();
41834         code = gen_int(n_code, 0);
41835
41836         ret_val = xmlUCSIsNumberForms(code);
41837         desret_int(ret_val);
41838         call_tests++;
41839         des_int(n_code, code, 0);
41840         xmlResetLastError();
41841         if (mem_base != xmlMemBlocks()) {
41842             printf("Leak of %d blocks found in xmlUCSIsNumberForms",
41843                    xmlMemBlocks() - mem_base);
41844             test_ret++;
41845             printf(" %d", n_code);
41846             printf("\n");
41847         }
41848     }
41849     function_tests++;
41850 #endif
41851
41852     return(test_ret);
41853 }
41854
41855
41856 static int
41857 test_xmlUCSIsOgham(void) {
41858     int test_ret = 0;
41859
41860 #if defined(LIBXML_UNICODE_ENABLED)
41861     int mem_base;
41862     int ret_val;
41863     int code; /* UCS code point */
41864     int n_code;
41865
41866     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41867         mem_base = xmlMemBlocks();
41868         code = gen_int(n_code, 0);
41869
41870         ret_val = xmlUCSIsOgham(code);
41871         desret_int(ret_val);
41872         call_tests++;
41873         des_int(n_code, code, 0);
41874         xmlResetLastError();
41875         if (mem_base != xmlMemBlocks()) {
41876             printf("Leak of %d blocks found in xmlUCSIsOgham",
41877                    xmlMemBlocks() - mem_base);
41878             test_ret++;
41879             printf(" %d", n_code);
41880             printf("\n");
41881         }
41882     }
41883     function_tests++;
41884 #endif
41885
41886     return(test_ret);
41887 }
41888
41889
41890 static int
41891 test_xmlUCSIsOldItalic(void) {
41892     int test_ret = 0;
41893
41894 #if defined(LIBXML_UNICODE_ENABLED)
41895     int mem_base;
41896     int ret_val;
41897     int code; /* UCS code point */
41898     int n_code;
41899
41900     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41901         mem_base = xmlMemBlocks();
41902         code = gen_int(n_code, 0);
41903
41904         ret_val = xmlUCSIsOldItalic(code);
41905         desret_int(ret_val);
41906         call_tests++;
41907         des_int(n_code, code, 0);
41908         xmlResetLastError();
41909         if (mem_base != xmlMemBlocks()) {
41910             printf("Leak of %d blocks found in xmlUCSIsOldItalic",
41911                    xmlMemBlocks() - mem_base);
41912             test_ret++;
41913             printf(" %d", n_code);
41914             printf("\n");
41915         }
41916     }
41917     function_tests++;
41918 #endif
41919
41920     return(test_ret);
41921 }
41922
41923
41924 static int
41925 test_xmlUCSIsOpticalCharacterRecognition(void) {
41926     int test_ret = 0;
41927
41928 #if defined(LIBXML_UNICODE_ENABLED)
41929     int mem_base;
41930     int ret_val;
41931     int code; /* UCS code point */
41932     int n_code;
41933
41934     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41935         mem_base = xmlMemBlocks();
41936         code = gen_int(n_code, 0);
41937
41938         ret_val = xmlUCSIsOpticalCharacterRecognition(code);
41939         desret_int(ret_val);
41940         call_tests++;
41941         des_int(n_code, code, 0);
41942         xmlResetLastError();
41943         if (mem_base != xmlMemBlocks()) {
41944             printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
41945                    xmlMemBlocks() - mem_base);
41946             test_ret++;
41947             printf(" %d", n_code);
41948             printf("\n");
41949         }
41950     }
41951     function_tests++;
41952 #endif
41953
41954     return(test_ret);
41955 }
41956
41957
41958 static int
41959 test_xmlUCSIsOriya(void) {
41960     int test_ret = 0;
41961
41962 #if defined(LIBXML_UNICODE_ENABLED)
41963     int mem_base;
41964     int ret_val;
41965     int code; /* UCS code point */
41966     int n_code;
41967
41968     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41969         mem_base = xmlMemBlocks();
41970         code = gen_int(n_code, 0);
41971
41972         ret_val = xmlUCSIsOriya(code);
41973         desret_int(ret_val);
41974         call_tests++;
41975         des_int(n_code, code, 0);
41976         xmlResetLastError();
41977         if (mem_base != xmlMemBlocks()) {
41978             printf("Leak of %d blocks found in xmlUCSIsOriya",
41979                    xmlMemBlocks() - mem_base);
41980             test_ret++;
41981             printf(" %d", n_code);
41982             printf("\n");
41983         }
41984     }
41985     function_tests++;
41986 #endif
41987
41988     return(test_ret);
41989 }
41990
41991
41992 static int
41993 test_xmlUCSIsOsmanya(void) {
41994     int test_ret = 0;
41995
41996 #if defined(LIBXML_UNICODE_ENABLED)
41997     int mem_base;
41998     int ret_val;
41999     int code; /* UCS code point */
42000     int n_code;
42001
42002     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42003         mem_base = xmlMemBlocks();
42004         code = gen_int(n_code, 0);
42005
42006         ret_val = xmlUCSIsOsmanya(code);
42007         desret_int(ret_val);
42008         call_tests++;
42009         des_int(n_code, code, 0);
42010         xmlResetLastError();
42011         if (mem_base != xmlMemBlocks()) {
42012             printf("Leak of %d blocks found in xmlUCSIsOsmanya",
42013                    xmlMemBlocks() - mem_base);
42014             test_ret++;
42015             printf(" %d", n_code);
42016             printf("\n");
42017         }
42018     }
42019     function_tests++;
42020 #endif
42021
42022     return(test_ret);
42023 }
42024
42025
42026 static int
42027 test_xmlUCSIsPhoneticExtensions(void) {
42028     int test_ret = 0;
42029
42030 #if defined(LIBXML_UNICODE_ENABLED)
42031     int mem_base;
42032     int ret_val;
42033     int code; /* UCS code point */
42034     int n_code;
42035
42036     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42037         mem_base = xmlMemBlocks();
42038         code = gen_int(n_code, 0);
42039
42040         ret_val = xmlUCSIsPhoneticExtensions(code);
42041         desret_int(ret_val);
42042         call_tests++;
42043         des_int(n_code, code, 0);
42044         xmlResetLastError();
42045         if (mem_base != xmlMemBlocks()) {
42046             printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
42047                    xmlMemBlocks() - mem_base);
42048             test_ret++;
42049             printf(" %d", n_code);
42050             printf("\n");
42051         }
42052     }
42053     function_tests++;
42054 #endif
42055
42056     return(test_ret);
42057 }
42058
42059
42060 static int
42061 test_xmlUCSIsPrivateUse(void) {
42062     int test_ret = 0;
42063
42064 #if defined(LIBXML_UNICODE_ENABLED)
42065     int mem_base;
42066     int ret_val;
42067     int code; /* UCS code point */
42068     int n_code;
42069
42070     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42071         mem_base = xmlMemBlocks();
42072         code = gen_int(n_code, 0);
42073
42074         ret_val = xmlUCSIsPrivateUse(code);
42075         desret_int(ret_val);
42076         call_tests++;
42077         des_int(n_code, code, 0);
42078         xmlResetLastError();
42079         if (mem_base != xmlMemBlocks()) {
42080             printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
42081                    xmlMemBlocks() - mem_base);
42082             test_ret++;
42083             printf(" %d", n_code);
42084             printf("\n");
42085         }
42086     }
42087     function_tests++;
42088 #endif
42089
42090     return(test_ret);
42091 }
42092
42093
42094 static int
42095 test_xmlUCSIsPrivateUseArea(void) {
42096     int test_ret = 0;
42097
42098 #if defined(LIBXML_UNICODE_ENABLED)
42099     int mem_base;
42100     int ret_val;
42101     int code; /* UCS code point */
42102     int n_code;
42103
42104     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42105         mem_base = xmlMemBlocks();
42106         code = gen_int(n_code, 0);
42107
42108         ret_val = xmlUCSIsPrivateUseArea(code);
42109         desret_int(ret_val);
42110         call_tests++;
42111         des_int(n_code, code, 0);
42112         xmlResetLastError();
42113         if (mem_base != xmlMemBlocks()) {
42114             printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
42115                    xmlMemBlocks() - mem_base);
42116             test_ret++;
42117             printf(" %d", n_code);
42118             printf("\n");
42119         }
42120     }
42121     function_tests++;
42122 #endif
42123
42124     return(test_ret);
42125 }
42126
42127
42128 static int
42129 test_xmlUCSIsRunic(void) {
42130     int test_ret = 0;
42131
42132 #if defined(LIBXML_UNICODE_ENABLED)
42133     int mem_base;
42134     int ret_val;
42135     int code; /* UCS code point */
42136     int n_code;
42137
42138     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42139         mem_base = xmlMemBlocks();
42140         code = gen_int(n_code, 0);
42141
42142         ret_val = xmlUCSIsRunic(code);
42143         desret_int(ret_val);
42144         call_tests++;
42145         des_int(n_code, code, 0);
42146         xmlResetLastError();
42147         if (mem_base != xmlMemBlocks()) {
42148             printf("Leak of %d blocks found in xmlUCSIsRunic",
42149                    xmlMemBlocks() - mem_base);
42150             test_ret++;
42151             printf(" %d", n_code);
42152             printf("\n");
42153         }
42154     }
42155     function_tests++;
42156 #endif
42157
42158     return(test_ret);
42159 }
42160
42161
42162 static int
42163 test_xmlUCSIsShavian(void) {
42164     int test_ret = 0;
42165
42166 #if defined(LIBXML_UNICODE_ENABLED)
42167     int mem_base;
42168     int ret_val;
42169     int code; /* UCS code point */
42170     int n_code;
42171
42172     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42173         mem_base = xmlMemBlocks();
42174         code = gen_int(n_code, 0);
42175
42176         ret_val = xmlUCSIsShavian(code);
42177         desret_int(ret_val);
42178         call_tests++;
42179         des_int(n_code, code, 0);
42180         xmlResetLastError();
42181         if (mem_base != xmlMemBlocks()) {
42182             printf("Leak of %d blocks found in xmlUCSIsShavian",
42183                    xmlMemBlocks() - mem_base);
42184             test_ret++;
42185             printf(" %d", n_code);
42186             printf("\n");
42187         }
42188     }
42189     function_tests++;
42190 #endif
42191
42192     return(test_ret);
42193 }
42194
42195
42196 static int
42197 test_xmlUCSIsSinhala(void) {
42198     int test_ret = 0;
42199
42200 #if defined(LIBXML_UNICODE_ENABLED)
42201     int mem_base;
42202     int ret_val;
42203     int code; /* UCS code point */
42204     int n_code;
42205
42206     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42207         mem_base = xmlMemBlocks();
42208         code = gen_int(n_code, 0);
42209
42210         ret_val = xmlUCSIsSinhala(code);
42211         desret_int(ret_val);
42212         call_tests++;
42213         des_int(n_code, code, 0);
42214         xmlResetLastError();
42215         if (mem_base != xmlMemBlocks()) {
42216             printf("Leak of %d blocks found in xmlUCSIsSinhala",
42217                    xmlMemBlocks() - mem_base);
42218             test_ret++;
42219             printf(" %d", n_code);
42220             printf("\n");
42221         }
42222     }
42223     function_tests++;
42224 #endif
42225
42226     return(test_ret);
42227 }
42228
42229
42230 static int
42231 test_xmlUCSIsSmallFormVariants(void) {
42232     int test_ret = 0;
42233
42234 #if defined(LIBXML_UNICODE_ENABLED)
42235     int mem_base;
42236     int ret_val;
42237     int code; /* UCS code point */
42238     int n_code;
42239
42240     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42241         mem_base = xmlMemBlocks();
42242         code = gen_int(n_code, 0);
42243
42244         ret_val = xmlUCSIsSmallFormVariants(code);
42245         desret_int(ret_val);
42246         call_tests++;
42247         des_int(n_code, code, 0);
42248         xmlResetLastError();
42249         if (mem_base != xmlMemBlocks()) {
42250             printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
42251                    xmlMemBlocks() - mem_base);
42252             test_ret++;
42253             printf(" %d", n_code);
42254             printf("\n");
42255         }
42256     }
42257     function_tests++;
42258 #endif
42259
42260     return(test_ret);
42261 }
42262
42263
42264 static int
42265 test_xmlUCSIsSpacingModifierLetters(void) {
42266     int test_ret = 0;
42267
42268 #if defined(LIBXML_UNICODE_ENABLED)
42269     int mem_base;
42270     int ret_val;
42271     int code; /* UCS code point */
42272     int n_code;
42273
42274     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42275         mem_base = xmlMemBlocks();
42276         code = gen_int(n_code, 0);
42277
42278         ret_val = xmlUCSIsSpacingModifierLetters(code);
42279         desret_int(ret_val);
42280         call_tests++;
42281         des_int(n_code, code, 0);
42282         xmlResetLastError();
42283         if (mem_base != xmlMemBlocks()) {
42284             printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
42285                    xmlMemBlocks() - mem_base);
42286             test_ret++;
42287             printf(" %d", n_code);
42288             printf("\n");
42289         }
42290     }
42291     function_tests++;
42292 #endif
42293
42294     return(test_ret);
42295 }
42296
42297
42298 static int
42299 test_xmlUCSIsSpecials(void) {
42300     int test_ret = 0;
42301
42302 #if defined(LIBXML_UNICODE_ENABLED)
42303     int mem_base;
42304     int ret_val;
42305     int code; /* UCS code point */
42306     int n_code;
42307
42308     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42309         mem_base = xmlMemBlocks();
42310         code = gen_int(n_code, 0);
42311
42312         ret_val = xmlUCSIsSpecials(code);
42313         desret_int(ret_val);
42314         call_tests++;
42315         des_int(n_code, code, 0);
42316         xmlResetLastError();
42317         if (mem_base != xmlMemBlocks()) {
42318             printf("Leak of %d blocks found in xmlUCSIsSpecials",
42319                    xmlMemBlocks() - mem_base);
42320             test_ret++;
42321             printf(" %d", n_code);
42322             printf("\n");
42323         }
42324     }
42325     function_tests++;
42326 #endif
42327
42328     return(test_ret);
42329 }
42330
42331
42332 static int
42333 test_xmlUCSIsSuperscriptsandSubscripts(void) {
42334     int test_ret = 0;
42335
42336 #if defined(LIBXML_UNICODE_ENABLED)
42337     int mem_base;
42338     int ret_val;
42339     int code; /* UCS code point */
42340     int n_code;
42341
42342     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42343         mem_base = xmlMemBlocks();
42344         code = gen_int(n_code, 0);
42345
42346         ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
42347         desret_int(ret_val);
42348         call_tests++;
42349         des_int(n_code, code, 0);
42350         xmlResetLastError();
42351         if (mem_base != xmlMemBlocks()) {
42352             printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
42353                    xmlMemBlocks() - mem_base);
42354             test_ret++;
42355             printf(" %d", n_code);
42356             printf("\n");
42357         }
42358     }
42359     function_tests++;
42360 #endif
42361
42362     return(test_ret);
42363 }
42364
42365
42366 static int
42367 test_xmlUCSIsSupplementalArrowsA(void) {
42368     int test_ret = 0;
42369
42370 #if defined(LIBXML_UNICODE_ENABLED)
42371     int mem_base;
42372     int ret_val;
42373     int code; /* UCS code point */
42374     int n_code;
42375
42376     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42377         mem_base = xmlMemBlocks();
42378         code = gen_int(n_code, 0);
42379
42380         ret_val = xmlUCSIsSupplementalArrowsA(code);
42381         desret_int(ret_val);
42382         call_tests++;
42383         des_int(n_code, code, 0);
42384         xmlResetLastError();
42385         if (mem_base != xmlMemBlocks()) {
42386             printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
42387                    xmlMemBlocks() - mem_base);
42388             test_ret++;
42389             printf(" %d", n_code);
42390             printf("\n");
42391         }
42392     }
42393     function_tests++;
42394 #endif
42395
42396     return(test_ret);
42397 }
42398
42399
42400 static int
42401 test_xmlUCSIsSupplementalArrowsB(void) {
42402     int test_ret = 0;
42403
42404 #if defined(LIBXML_UNICODE_ENABLED)
42405     int mem_base;
42406     int ret_val;
42407     int code; /* UCS code point */
42408     int n_code;
42409
42410     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42411         mem_base = xmlMemBlocks();
42412         code = gen_int(n_code, 0);
42413
42414         ret_val = xmlUCSIsSupplementalArrowsB(code);
42415         desret_int(ret_val);
42416         call_tests++;
42417         des_int(n_code, code, 0);
42418         xmlResetLastError();
42419         if (mem_base != xmlMemBlocks()) {
42420             printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
42421                    xmlMemBlocks() - mem_base);
42422             test_ret++;
42423             printf(" %d", n_code);
42424             printf("\n");
42425         }
42426     }
42427     function_tests++;
42428 #endif
42429
42430     return(test_ret);
42431 }
42432
42433
42434 static int
42435 test_xmlUCSIsSupplementalMathematicalOperators(void) {
42436     int test_ret = 0;
42437
42438 #if defined(LIBXML_UNICODE_ENABLED)
42439     int mem_base;
42440     int ret_val;
42441     int code; /* UCS code point */
42442     int n_code;
42443
42444     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42445         mem_base = xmlMemBlocks();
42446         code = gen_int(n_code, 0);
42447
42448         ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
42449         desret_int(ret_val);
42450         call_tests++;
42451         des_int(n_code, code, 0);
42452         xmlResetLastError();
42453         if (mem_base != xmlMemBlocks()) {
42454             printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
42455                    xmlMemBlocks() - mem_base);
42456             test_ret++;
42457             printf(" %d", n_code);
42458             printf("\n");
42459         }
42460     }
42461     function_tests++;
42462 #endif
42463
42464     return(test_ret);
42465 }
42466
42467
42468 static int
42469 test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
42470     int test_ret = 0;
42471
42472 #if defined(LIBXML_UNICODE_ENABLED)
42473     int mem_base;
42474     int ret_val;
42475     int code; /* UCS code point */
42476     int n_code;
42477
42478     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42479         mem_base = xmlMemBlocks();
42480         code = gen_int(n_code, 0);
42481
42482         ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
42483         desret_int(ret_val);
42484         call_tests++;
42485         des_int(n_code, code, 0);
42486         xmlResetLastError();
42487         if (mem_base != xmlMemBlocks()) {
42488             printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
42489                    xmlMemBlocks() - mem_base);
42490             test_ret++;
42491             printf(" %d", n_code);
42492             printf("\n");
42493         }
42494     }
42495     function_tests++;
42496 #endif
42497
42498     return(test_ret);
42499 }
42500
42501
42502 static int
42503 test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
42504     int test_ret = 0;
42505
42506 #if defined(LIBXML_UNICODE_ENABLED)
42507     int mem_base;
42508     int ret_val;
42509     int code; /* UCS code point */
42510     int n_code;
42511
42512     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42513         mem_base = xmlMemBlocks();
42514         code = gen_int(n_code, 0);
42515
42516         ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
42517         desret_int(ret_val);
42518         call_tests++;
42519         des_int(n_code, code, 0);
42520         xmlResetLastError();
42521         if (mem_base != xmlMemBlocks()) {
42522             printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
42523                    xmlMemBlocks() - mem_base);
42524             test_ret++;
42525             printf(" %d", n_code);
42526             printf("\n");
42527         }
42528     }
42529     function_tests++;
42530 #endif
42531
42532     return(test_ret);
42533 }
42534
42535
42536 static int
42537 test_xmlUCSIsSyriac(void) {
42538     int test_ret = 0;
42539
42540 #if defined(LIBXML_UNICODE_ENABLED)
42541     int mem_base;
42542     int ret_val;
42543     int code; /* UCS code point */
42544     int n_code;
42545
42546     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42547         mem_base = xmlMemBlocks();
42548         code = gen_int(n_code, 0);
42549
42550         ret_val = xmlUCSIsSyriac(code);
42551         desret_int(ret_val);
42552         call_tests++;
42553         des_int(n_code, code, 0);
42554         xmlResetLastError();
42555         if (mem_base != xmlMemBlocks()) {
42556             printf("Leak of %d blocks found in xmlUCSIsSyriac",
42557                    xmlMemBlocks() - mem_base);
42558             test_ret++;
42559             printf(" %d", n_code);
42560             printf("\n");
42561         }
42562     }
42563     function_tests++;
42564 #endif
42565
42566     return(test_ret);
42567 }
42568
42569
42570 static int
42571 test_xmlUCSIsTagalog(void) {
42572     int test_ret = 0;
42573
42574 #if defined(LIBXML_UNICODE_ENABLED)
42575     int mem_base;
42576     int ret_val;
42577     int code; /* UCS code point */
42578     int n_code;
42579
42580     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42581         mem_base = xmlMemBlocks();
42582         code = gen_int(n_code, 0);
42583
42584         ret_val = xmlUCSIsTagalog(code);
42585         desret_int(ret_val);
42586         call_tests++;
42587         des_int(n_code, code, 0);
42588         xmlResetLastError();
42589         if (mem_base != xmlMemBlocks()) {
42590             printf("Leak of %d blocks found in xmlUCSIsTagalog",
42591                    xmlMemBlocks() - mem_base);
42592             test_ret++;
42593             printf(" %d", n_code);
42594             printf("\n");
42595         }
42596     }
42597     function_tests++;
42598 #endif
42599
42600     return(test_ret);
42601 }
42602
42603
42604 static int
42605 test_xmlUCSIsTagbanwa(void) {
42606     int test_ret = 0;
42607
42608 #if defined(LIBXML_UNICODE_ENABLED)
42609     int mem_base;
42610     int ret_val;
42611     int code; /* UCS code point */
42612     int n_code;
42613
42614     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42615         mem_base = xmlMemBlocks();
42616         code = gen_int(n_code, 0);
42617
42618         ret_val = xmlUCSIsTagbanwa(code);
42619         desret_int(ret_val);
42620         call_tests++;
42621         des_int(n_code, code, 0);
42622         xmlResetLastError();
42623         if (mem_base != xmlMemBlocks()) {
42624             printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
42625                    xmlMemBlocks() - mem_base);
42626             test_ret++;
42627             printf(" %d", n_code);
42628             printf("\n");
42629         }
42630     }
42631     function_tests++;
42632 #endif
42633
42634     return(test_ret);
42635 }
42636
42637
42638 static int
42639 test_xmlUCSIsTags(void) {
42640     int test_ret = 0;
42641
42642 #if defined(LIBXML_UNICODE_ENABLED)
42643     int mem_base;
42644     int ret_val;
42645     int code; /* UCS code point */
42646     int n_code;
42647
42648     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42649         mem_base = xmlMemBlocks();
42650         code = gen_int(n_code, 0);
42651
42652         ret_val = xmlUCSIsTags(code);
42653         desret_int(ret_val);
42654         call_tests++;
42655         des_int(n_code, code, 0);
42656         xmlResetLastError();
42657         if (mem_base != xmlMemBlocks()) {
42658             printf("Leak of %d blocks found in xmlUCSIsTags",
42659                    xmlMemBlocks() - mem_base);
42660             test_ret++;
42661             printf(" %d", n_code);
42662             printf("\n");
42663         }
42664     }
42665     function_tests++;
42666 #endif
42667
42668     return(test_ret);
42669 }
42670
42671
42672 static int
42673 test_xmlUCSIsTaiLe(void) {
42674     int test_ret = 0;
42675
42676 #if defined(LIBXML_UNICODE_ENABLED)
42677     int mem_base;
42678     int ret_val;
42679     int code; /* UCS code point */
42680     int n_code;
42681
42682     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42683         mem_base = xmlMemBlocks();
42684         code = gen_int(n_code, 0);
42685
42686         ret_val = xmlUCSIsTaiLe(code);
42687         desret_int(ret_val);
42688         call_tests++;
42689         des_int(n_code, code, 0);
42690         xmlResetLastError();
42691         if (mem_base != xmlMemBlocks()) {
42692             printf("Leak of %d blocks found in xmlUCSIsTaiLe",
42693                    xmlMemBlocks() - mem_base);
42694             test_ret++;
42695             printf(" %d", n_code);
42696             printf("\n");
42697         }
42698     }
42699     function_tests++;
42700 #endif
42701
42702     return(test_ret);
42703 }
42704
42705
42706 static int
42707 test_xmlUCSIsTaiXuanJingSymbols(void) {
42708     int test_ret = 0;
42709
42710 #if defined(LIBXML_UNICODE_ENABLED)
42711     int mem_base;
42712     int ret_val;
42713     int code; /* UCS code point */
42714     int n_code;
42715
42716     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42717         mem_base = xmlMemBlocks();
42718         code = gen_int(n_code, 0);
42719
42720         ret_val = xmlUCSIsTaiXuanJingSymbols(code);
42721         desret_int(ret_val);
42722         call_tests++;
42723         des_int(n_code, code, 0);
42724         xmlResetLastError();
42725         if (mem_base != xmlMemBlocks()) {
42726             printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
42727                    xmlMemBlocks() - mem_base);
42728             test_ret++;
42729             printf(" %d", n_code);
42730             printf("\n");
42731         }
42732     }
42733     function_tests++;
42734 #endif
42735
42736     return(test_ret);
42737 }
42738
42739
42740 static int
42741 test_xmlUCSIsTamil(void) {
42742     int test_ret = 0;
42743
42744 #if defined(LIBXML_UNICODE_ENABLED)
42745     int mem_base;
42746     int ret_val;
42747     int code; /* UCS code point */
42748     int n_code;
42749
42750     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42751         mem_base = xmlMemBlocks();
42752         code = gen_int(n_code, 0);
42753
42754         ret_val = xmlUCSIsTamil(code);
42755         desret_int(ret_val);
42756         call_tests++;
42757         des_int(n_code, code, 0);
42758         xmlResetLastError();
42759         if (mem_base != xmlMemBlocks()) {
42760             printf("Leak of %d blocks found in xmlUCSIsTamil",
42761                    xmlMemBlocks() - mem_base);
42762             test_ret++;
42763             printf(" %d", n_code);
42764             printf("\n");
42765         }
42766     }
42767     function_tests++;
42768 #endif
42769
42770     return(test_ret);
42771 }
42772
42773
42774 static int
42775 test_xmlUCSIsTelugu(void) {
42776     int test_ret = 0;
42777
42778 #if defined(LIBXML_UNICODE_ENABLED)
42779     int mem_base;
42780     int ret_val;
42781     int code; /* UCS code point */
42782     int n_code;
42783
42784     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42785         mem_base = xmlMemBlocks();
42786         code = gen_int(n_code, 0);
42787
42788         ret_val = xmlUCSIsTelugu(code);
42789         desret_int(ret_val);
42790         call_tests++;
42791         des_int(n_code, code, 0);
42792         xmlResetLastError();
42793         if (mem_base != xmlMemBlocks()) {
42794             printf("Leak of %d blocks found in xmlUCSIsTelugu",
42795                    xmlMemBlocks() - mem_base);
42796             test_ret++;
42797             printf(" %d", n_code);
42798             printf("\n");
42799         }
42800     }
42801     function_tests++;
42802 #endif
42803
42804     return(test_ret);
42805 }
42806
42807
42808 static int
42809 test_xmlUCSIsThaana(void) {
42810     int test_ret = 0;
42811
42812 #if defined(LIBXML_UNICODE_ENABLED)
42813     int mem_base;
42814     int ret_val;
42815     int code; /* UCS code point */
42816     int n_code;
42817
42818     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42819         mem_base = xmlMemBlocks();
42820         code = gen_int(n_code, 0);
42821
42822         ret_val = xmlUCSIsThaana(code);
42823         desret_int(ret_val);
42824         call_tests++;
42825         des_int(n_code, code, 0);
42826         xmlResetLastError();
42827         if (mem_base != xmlMemBlocks()) {
42828             printf("Leak of %d blocks found in xmlUCSIsThaana",
42829                    xmlMemBlocks() - mem_base);
42830             test_ret++;
42831             printf(" %d", n_code);
42832             printf("\n");
42833         }
42834     }
42835     function_tests++;
42836 #endif
42837
42838     return(test_ret);
42839 }
42840
42841
42842 static int
42843 test_xmlUCSIsThai(void) {
42844     int test_ret = 0;
42845
42846 #if defined(LIBXML_UNICODE_ENABLED)
42847     int mem_base;
42848     int ret_val;
42849     int code; /* UCS code point */
42850     int n_code;
42851
42852     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42853         mem_base = xmlMemBlocks();
42854         code = gen_int(n_code, 0);
42855
42856         ret_val = xmlUCSIsThai(code);
42857         desret_int(ret_val);
42858         call_tests++;
42859         des_int(n_code, code, 0);
42860         xmlResetLastError();
42861         if (mem_base != xmlMemBlocks()) {
42862             printf("Leak of %d blocks found in xmlUCSIsThai",
42863                    xmlMemBlocks() - mem_base);
42864             test_ret++;
42865             printf(" %d", n_code);
42866             printf("\n");
42867         }
42868     }
42869     function_tests++;
42870 #endif
42871
42872     return(test_ret);
42873 }
42874
42875
42876 static int
42877 test_xmlUCSIsTibetan(void) {
42878     int test_ret = 0;
42879
42880 #if defined(LIBXML_UNICODE_ENABLED)
42881     int mem_base;
42882     int ret_val;
42883     int code; /* UCS code point */
42884     int n_code;
42885
42886     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42887         mem_base = xmlMemBlocks();
42888         code = gen_int(n_code, 0);
42889
42890         ret_val = xmlUCSIsTibetan(code);
42891         desret_int(ret_val);
42892         call_tests++;
42893         des_int(n_code, code, 0);
42894         xmlResetLastError();
42895         if (mem_base != xmlMemBlocks()) {
42896             printf("Leak of %d blocks found in xmlUCSIsTibetan",
42897                    xmlMemBlocks() - mem_base);
42898             test_ret++;
42899             printf(" %d", n_code);
42900             printf("\n");
42901         }
42902     }
42903     function_tests++;
42904 #endif
42905
42906     return(test_ret);
42907 }
42908
42909
42910 static int
42911 test_xmlUCSIsUgaritic(void) {
42912     int test_ret = 0;
42913
42914 #if defined(LIBXML_UNICODE_ENABLED)
42915     int mem_base;
42916     int ret_val;
42917     int code; /* UCS code point */
42918     int n_code;
42919
42920     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42921         mem_base = xmlMemBlocks();
42922         code = gen_int(n_code, 0);
42923
42924         ret_val = xmlUCSIsUgaritic(code);
42925         desret_int(ret_val);
42926         call_tests++;
42927         des_int(n_code, code, 0);
42928         xmlResetLastError();
42929         if (mem_base != xmlMemBlocks()) {
42930             printf("Leak of %d blocks found in xmlUCSIsUgaritic",
42931                    xmlMemBlocks() - mem_base);
42932             test_ret++;
42933             printf(" %d", n_code);
42934             printf("\n");
42935         }
42936     }
42937     function_tests++;
42938 #endif
42939
42940     return(test_ret);
42941 }
42942
42943
42944 static int
42945 test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
42946     int test_ret = 0;
42947
42948 #if defined(LIBXML_UNICODE_ENABLED)
42949     int mem_base;
42950     int ret_val;
42951     int code; /* UCS code point */
42952     int n_code;
42953
42954     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42955         mem_base = xmlMemBlocks();
42956         code = gen_int(n_code, 0);
42957
42958         ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
42959         desret_int(ret_val);
42960         call_tests++;
42961         des_int(n_code, code, 0);
42962         xmlResetLastError();
42963         if (mem_base != xmlMemBlocks()) {
42964             printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
42965                    xmlMemBlocks() - mem_base);
42966             test_ret++;
42967             printf(" %d", n_code);
42968             printf("\n");
42969         }
42970     }
42971     function_tests++;
42972 #endif
42973
42974     return(test_ret);
42975 }
42976
42977
42978 static int
42979 test_xmlUCSIsVariationSelectors(void) {
42980     int test_ret = 0;
42981
42982 #if defined(LIBXML_UNICODE_ENABLED)
42983     int mem_base;
42984     int ret_val;
42985     int code; /* UCS code point */
42986     int n_code;
42987
42988     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42989         mem_base = xmlMemBlocks();
42990         code = gen_int(n_code, 0);
42991
42992         ret_val = xmlUCSIsVariationSelectors(code);
42993         desret_int(ret_val);
42994         call_tests++;
42995         des_int(n_code, code, 0);
42996         xmlResetLastError();
42997         if (mem_base != xmlMemBlocks()) {
42998             printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
42999                    xmlMemBlocks() - mem_base);
43000             test_ret++;
43001             printf(" %d", n_code);
43002             printf("\n");
43003         }
43004     }
43005     function_tests++;
43006 #endif
43007
43008     return(test_ret);
43009 }
43010
43011
43012 static int
43013 test_xmlUCSIsVariationSelectorsSupplement(void) {
43014     int test_ret = 0;
43015
43016 #if defined(LIBXML_UNICODE_ENABLED)
43017     int mem_base;
43018     int ret_val;
43019     int code; /* UCS code point */
43020     int n_code;
43021
43022     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43023         mem_base = xmlMemBlocks();
43024         code = gen_int(n_code, 0);
43025
43026         ret_val = xmlUCSIsVariationSelectorsSupplement(code);
43027         desret_int(ret_val);
43028         call_tests++;
43029         des_int(n_code, code, 0);
43030         xmlResetLastError();
43031         if (mem_base != xmlMemBlocks()) {
43032             printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
43033                    xmlMemBlocks() - mem_base);
43034             test_ret++;
43035             printf(" %d", n_code);
43036             printf("\n");
43037         }
43038     }
43039     function_tests++;
43040 #endif
43041
43042     return(test_ret);
43043 }
43044
43045
43046 static int
43047 test_xmlUCSIsYiRadicals(void) {
43048     int test_ret = 0;
43049
43050 #if defined(LIBXML_UNICODE_ENABLED)
43051     int mem_base;
43052     int ret_val;
43053     int code; /* UCS code point */
43054     int n_code;
43055
43056     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43057         mem_base = xmlMemBlocks();
43058         code = gen_int(n_code, 0);
43059
43060         ret_val = xmlUCSIsYiRadicals(code);
43061         desret_int(ret_val);
43062         call_tests++;
43063         des_int(n_code, code, 0);
43064         xmlResetLastError();
43065         if (mem_base != xmlMemBlocks()) {
43066             printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
43067                    xmlMemBlocks() - mem_base);
43068             test_ret++;
43069             printf(" %d", n_code);
43070             printf("\n");
43071         }
43072     }
43073     function_tests++;
43074 #endif
43075
43076     return(test_ret);
43077 }
43078
43079
43080 static int
43081 test_xmlUCSIsYiSyllables(void) {
43082     int test_ret = 0;
43083
43084 #if defined(LIBXML_UNICODE_ENABLED)
43085     int mem_base;
43086     int ret_val;
43087     int code; /* UCS code point */
43088     int n_code;
43089
43090     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43091         mem_base = xmlMemBlocks();
43092         code = gen_int(n_code, 0);
43093
43094         ret_val = xmlUCSIsYiSyllables(code);
43095         desret_int(ret_val);
43096         call_tests++;
43097         des_int(n_code, code, 0);
43098         xmlResetLastError();
43099         if (mem_base != xmlMemBlocks()) {
43100             printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
43101                    xmlMemBlocks() - mem_base);
43102             test_ret++;
43103             printf(" %d", n_code);
43104             printf("\n");
43105         }
43106     }
43107     function_tests++;
43108 #endif
43109
43110     return(test_ret);
43111 }
43112
43113
43114 static int
43115 test_xmlUCSIsYijingHexagramSymbols(void) {
43116     int test_ret = 0;
43117
43118 #if defined(LIBXML_UNICODE_ENABLED)
43119     int mem_base;
43120     int ret_val;
43121     int code; /* UCS code point */
43122     int n_code;
43123
43124     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43125         mem_base = xmlMemBlocks();
43126         code = gen_int(n_code, 0);
43127
43128         ret_val = xmlUCSIsYijingHexagramSymbols(code);
43129         desret_int(ret_val);
43130         call_tests++;
43131         des_int(n_code, code, 0);
43132         xmlResetLastError();
43133         if (mem_base != xmlMemBlocks()) {
43134             printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
43135                    xmlMemBlocks() - mem_base);
43136             test_ret++;
43137             printf(" %d", n_code);
43138             printf("\n");
43139         }
43140     }
43141     function_tests++;
43142 #endif
43143
43144     return(test_ret);
43145 }
43146
43147 static int
43148 test_xmlunicode(void) {
43149     int test_ret = 0;
43150
43151     if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
43152     test_ret += test_xmlUCSIsAegeanNumbers();
43153     test_ret += test_xmlUCSIsAlphabeticPresentationForms();
43154     test_ret += test_xmlUCSIsArabic();
43155     test_ret += test_xmlUCSIsArabicPresentationFormsA();
43156     test_ret += test_xmlUCSIsArabicPresentationFormsB();
43157     test_ret += test_xmlUCSIsArmenian();
43158     test_ret += test_xmlUCSIsArrows();
43159     test_ret += test_xmlUCSIsBasicLatin();
43160     test_ret += test_xmlUCSIsBengali();
43161     test_ret += test_xmlUCSIsBlock();
43162     test_ret += test_xmlUCSIsBlockElements();
43163     test_ret += test_xmlUCSIsBopomofo();
43164     test_ret += test_xmlUCSIsBopomofoExtended();
43165     test_ret += test_xmlUCSIsBoxDrawing();
43166     test_ret += test_xmlUCSIsBraillePatterns();
43167     test_ret += test_xmlUCSIsBuhid();
43168     test_ret += test_xmlUCSIsByzantineMusicalSymbols();
43169     test_ret += test_xmlUCSIsCJKCompatibility();
43170     test_ret += test_xmlUCSIsCJKCompatibilityForms();
43171     test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
43172     test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
43173     test_ret += test_xmlUCSIsCJKRadicalsSupplement();
43174     test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
43175     test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
43176     test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
43177     test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
43178     test_ret += test_xmlUCSIsCat();
43179     test_ret += test_xmlUCSIsCatC();
43180     test_ret += test_xmlUCSIsCatCc();
43181     test_ret += test_xmlUCSIsCatCf();
43182     test_ret += test_xmlUCSIsCatCo();
43183     test_ret += test_xmlUCSIsCatCs();
43184     test_ret += test_xmlUCSIsCatL();
43185     test_ret += test_xmlUCSIsCatLl();
43186     test_ret += test_xmlUCSIsCatLm();
43187     test_ret += test_xmlUCSIsCatLo();
43188     test_ret += test_xmlUCSIsCatLt();
43189     test_ret += test_xmlUCSIsCatLu();
43190     test_ret += test_xmlUCSIsCatM();
43191     test_ret += test_xmlUCSIsCatMc();
43192     test_ret += test_xmlUCSIsCatMe();
43193     test_ret += test_xmlUCSIsCatMn();
43194     test_ret += test_xmlUCSIsCatN();
43195     test_ret += test_xmlUCSIsCatNd();
43196     test_ret += test_xmlUCSIsCatNl();
43197     test_ret += test_xmlUCSIsCatNo();
43198     test_ret += test_xmlUCSIsCatP();
43199     test_ret += test_xmlUCSIsCatPc();
43200     test_ret += test_xmlUCSIsCatPd();
43201     test_ret += test_xmlUCSIsCatPe();
43202     test_ret += test_xmlUCSIsCatPf();
43203     test_ret += test_xmlUCSIsCatPi();
43204     test_ret += test_xmlUCSIsCatPo();
43205     test_ret += test_xmlUCSIsCatPs();
43206     test_ret += test_xmlUCSIsCatS();
43207     test_ret += test_xmlUCSIsCatSc();
43208     test_ret += test_xmlUCSIsCatSk();
43209     test_ret += test_xmlUCSIsCatSm();
43210     test_ret += test_xmlUCSIsCatSo();
43211     test_ret += test_xmlUCSIsCatZ();
43212     test_ret += test_xmlUCSIsCatZl();
43213     test_ret += test_xmlUCSIsCatZp();
43214     test_ret += test_xmlUCSIsCatZs();
43215     test_ret += test_xmlUCSIsCherokee();
43216     test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
43217     test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
43218     test_ret += test_xmlUCSIsCombiningHalfMarks();
43219     test_ret += test_xmlUCSIsCombiningMarksforSymbols();
43220     test_ret += test_xmlUCSIsControlPictures();
43221     test_ret += test_xmlUCSIsCurrencySymbols();
43222     test_ret += test_xmlUCSIsCypriotSyllabary();
43223     test_ret += test_xmlUCSIsCyrillic();
43224     test_ret += test_xmlUCSIsCyrillicSupplement();
43225     test_ret += test_xmlUCSIsDeseret();
43226     test_ret += test_xmlUCSIsDevanagari();
43227     test_ret += test_xmlUCSIsDingbats();
43228     test_ret += test_xmlUCSIsEnclosedAlphanumerics();
43229     test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
43230     test_ret += test_xmlUCSIsEthiopic();
43231     test_ret += test_xmlUCSIsGeneralPunctuation();
43232     test_ret += test_xmlUCSIsGeometricShapes();
43233     test_ret += test_xmlUCSIsGeorgian();
43234     test_ret += test_xmlUCSIsGothic();
43235     test_ret += test_xmlUCSIsGreek();
43236     test_ret += test_xmlUCSIsGreekExtended();
43237     test_ret += test_xmlUCSIsGreekandCoptic();
43238     test_ret += test_xmlUCSIsGujarati();
43239     test_ret += test_xmlUCSIsGurmukhi();
43240     test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
43241     test_ret += test_xmlUCSIsHangulCompatibilityJamo();
43242     test_ret += test_xmlUCSIsHangulJamo();
43243     test_ret += test_xmlUCSIsHangulSyllables();
43244     test_ret += test_xmlUCSIsHanunoo();
43245     test_ret += test_xmlUCSIsHebrew();
43246     test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
43247     test_ret += test_xmlUCSIsHighSurrogates();
43248     test_ret += test_xmlUCSIsHiragana();
43249     test_ret += test_xmlUCSIsIPAExtensions();
43250     test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
43251     test_ret += test_xmlUCSIsKanbun();
43252     test_ret += test_xmlUCSIsKangxiRadicals();
43253     test_ret += test_xmlUCSIsKannada();
43254     test_ret += test_xmlUCSIsKatakana();
43255     test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
43256     test_ret += test_xmlUCSIsKhmer();
43257     test_ret += test_xmlUCSIsKhmerSymbols();
43258     test_ret += test_xmlUCSIsLao();
43259     test_ret += test_xmlUCSIsLatin1Supplement();
43260     test_ret += test_xmlUCSIsLatinExtendedA();
43261     test_ret += test_xmlUCSIsLatinExtendedAdditional();
43262     test_ret += test_xmlUCSIsLatinExtendedB();
43263     test_ret += test_xmlUCSIsLetterlikeSymbols();
43264     test_ret += test_xmlUCSIsLimbu();
43265     test_ret += test_xmlUCSIsLinearBIdeograms();
43266     test_ret += test_xmlUCSIsLinearBSyllabary();
43267     test_ret += test_xmlUCSIsLowSurrogates();
43268     test_ret += test_xmlUCSIsMalayalam();
43269     test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
43270     test_ret += test_xmlUCSIsMathematicalOperators();
43271     test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
43272     test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
43273     test_ret += test_xmlUCSIsMiscellaneousSymbols();
43274     test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
43275     test_ret += test_xmlUCSIsMiscellaneousTechnical();
43276     test_ret += test_xmlUCSIsMongolian();
43277     test_ret += test_xmlUCSIsMusicalSymbols();
43278     test_ret += test_xmlUCSIsMyanmar();
43279     test_ret += test_xmlUCSIsNumberForms();
43280     test_ret += test_xmlUCSIsOgham();
43281     test_ret += test_xmlUCSIsOldItalic();
43282     test_ret += test_xmlUCSIsOpticalCharacterRecognition();
43283     test_ret += test_xmlUCSIsOriya();
43284     test_ret += test_xmlUCSIsOsmanya();
43285     test_ret += test_xmlUCSIsPhoneticExtensions();
43286     test_ret += test_xmlUCSIsPrivateUse();
43287     test_ret += test_xmlUCSIsPrivateUseArea();
43288     test_ret += test_xmlUCSIsRunic();
43289     test_ret += test_xmlUCSIsShavian();
43290     test_ret += test_xmlUCSIsSinhala();
43291     test_ret += test_xmlUCSIsSmallFormVariants();
43292     test_ret += test_xmlUCSIsSpacingModifierLetters();
43293     test_ret += test_xmlUCSIsSpecials();
43294     test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
43295     test_ret += test_xmlUCSIsSupplementalArrowsA();
43296     test_ret += test_xmlUCSIsSupplementalArrowsB();
43297     test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
43298     test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
43299     test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
43300     test_ret += test_xmlUCSIsSyriac();
43301     test_ret += test_xmlUCSIsTagalog();
43302     test_ret += test_xmlUCSIsTagbanwa();
43303     test_ret += test_xmlUCSIsTags();
43304     test_ret += test_xmlUCSIsTaiLe();
43305     test_ret += test_xmlUCSIsTaiXuanJingSymbols();
43306     test_ret += test_xmlUCSIsTamil();
43307     test_ret += test_xmlUCSIsTelugu();
43308     test_ret += test_xmlUCSIsThaana();
43309     test_ret += test_xmlUCSIsThai();
43310     test_ret += test_xmlUCSIsTibetan();
43311     test_ret += test_xmlUCSIsUgaritic();
43312     test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
43313     test_ret += test_xmlUCSIsVariationSelectors();
43314     test_ret += test_xmlUCSIsVariationSelectorsSupplement();
43315     test_ret += test_xmlUCSIsYiRadicals();
43316     test_ret += test_xmlUCSIsYiSyllables();
43317     test_ret += test_xmlUCSIsYijingHexagramSymbols();
43318
43319     if (test_ret != 0)
43320         printf("Module xmlunicode: %d errors\n", test_ret);
43321     return(test_ret);
43322 }
43323
43324 static int
43325 test_xmlNewTextWriter(void) {
43326     int test_ret = 0;
43327
43328 #if defined(LIBXML_WRITER_ENABLED)
43329     int mem_base;
43330     xmlTextWriterPtr ret_val;
43331     xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
43332     int n_out;
43333
43334     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
43335         mem_base = xmlMemBlocks();
43336         out = gen_xmlOutputBufferPtr(n_out, 0);
43337
43338         ret_val = xmlNewTextWriter(out);
43339         if (ret_val != NULL) out = NULL;
43340         desret_xmlTextWriterPtr(ret_val);
43341         call_tests++;
43342         des_xmlOutputBufferPtr(n_out, out, 0);
43343         xmlResetLastError();
43344         if (mem_base != xmlMemBlocks()) {
43345             printf("Leak of %d blocks found in xmlNewTextWriter",
43346                    xmlMemBlocks() - mem_base);
43347             test_ret++;
43348             printf(" %d", n_out);
43349             printf("\n");
43350         }
43351     }
43352     function_tests++;
43353 #endif
43354
43355     return(test_ret);
43356 }
43357
43358
43359 static int
43360 test_xmlNewTextWriterFilename(void) {
43361     int test_ret = 0;
43362
43363 #if defined(LIBXML_WRITER_ENABLED)
43364     int mem_base;
43365     xmlTextWriterPtr ret_val;
43366     const char * uri; /* the URI of the resource for the output */
43367     int n_uri;
43368     int compression; /* compress the output? */
43369     int n_compression;
43370
43371     for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
43372     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43373         mem_base = xmlMemBlocks();
43374         uri = gen_fileoutput(n_uri, 0);
43375         compression = gen_int(n_compression, 1);
43376
43377         ret_val = xmlNewTextWriterFilename(uri, compression);
43378         desret_xmlTextWriterPtr(ret_val);
43379         call_tests++;
43380         des_fileoutput(n_uri, uri, 0);
43381         des_int(n_compression, compression, 1);
43382         xmlResetLastError();
43383         if (mem_base != xmlMemBlocks()) {
43384             printf("Leak of %d blocks found in xmlNewTextWriterFilename",
43385                    xmlMemBlocks() - mem_base);
43386             test_ret++;
43387             printf(" %d", n_uri);
43388             printf(" %d", n_compression);
43389             printf("\n");
43390         }
43391     }
43392     }
43393     function_tests++;
43394 #endif
43395
43396     return(test_ret);
43397 }
43398
43399
43400 static int
43401 test_xmlNewTextWriterMemory(void) {
43402     int test_ret = 0;
43403
43404 #if defined(LIBXML_WRITER_ENABLED)
43405     int mem_base;
43406     xmlTextWriterPtr ret_val;
43407     xmlBufferPtr buf; /* xmlBufferPtr */
43408     int n_buf;
43409     int compression; /* compress the output? */
43410     int n_compression;
43411
43412     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
43413     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43414         mem_base = xmlMemBlocks();
43415         buf = gen_xmlBufferPtr(n_buf, 0);
43416         compression = gen_int(n_compression, 1);
43417
43418         ret_val = xmlNewTextWriterMemory(buf, compression);
43419         desret_xmlTextWriterPtr(ret_val);
43420         call_tests++;
43421         des_xmlBufferPtr(n_buf, buf, 0);
43422         des_int(n_compression, compression, 1);
43423         xmlResetLastError();
43424         if (mem_base != xmlMemBlocks()) {
43425             printf("Leak of %d blocks found in xmlNewTextWriterMemory",
43426                    xmlMemBlocks() - mem_base);
43427             test_ret++;
43428             printf(" %d", n_buf);
43429             printf(" %d", n_compression);
43430             printf("\n");
43431         }
43432     }
43433     }
43434     function_tests++;
43435 #endif
43436
43437     return(test_ret);
43438 }
43439
43440
43441 static int
43442 test_xmlNewTextWriterPushParser(void) {
43443     int test_ret = 0;
43444
43445 #if defined(LIBXML_WRITER_ENABLED)
43446     int mem_base;
43447     xmlTextWriterPtr ret_val;
43448     xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
43449     int n_ctxt;
43450     int compression; /* compress the output? */
43451     int n_compression;
43452
43453     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
43454     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43455         mem_base = xmlMemBlocks();
43456         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
43457         compression = gen_int(n_compression, 1);
43458
43459         ret_val = xmlNewTextWriterPushParser(ctxt, compression);
43460         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
43461         desret_xmlTextWriterPtr(ret_val);
43462         call_tests++;
43463         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
43464         des_int(n_compression, compression, 1);
43465         xmlResetLastError();
43466         if (mem_base != xmlMemBlocks()) {
43467             printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
43468                    xmlMemBlocks() - mem_base);
43469             test_ret++;
43470             printf(" %d", n_ctxt);
43471             printf(" %d", n_compression);
43472             printf("\n");
43473         }
43474     }
43475     }
43476     function_tests++;
43477 #endif
43478
43479     return(test_ret);
43480 }
43481
43482
43483 static int
43484 test_xmlNewTextWriterTree(void) {
43485     int test_ret = 0;
43486
43487 #if defined(LIBXML_WRITER_ENABLED)
43488     int mem_base;
43489     xmlTextWriterPtr ret_val;
43490     xmlDocPtr doc; /* xmlDocPtr */
43491     int n_doc;
43492     xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
43493     int n_node;
43494     int compression; /* compress the output? */
43495     int n_compression;
43496
43497     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
43498     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
43499     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43500         mem_base = xmlMemBlocks();
43501         doc = gen_xmlDocPtr(n_doc, 0);
43502         node = gen_xmlNodePtr(n_node, 1);
43503         compression = gen_int(n_compression, 2);
43504
43505         ret_val = xmlNewTextWriterTree(doc, node, compression);
43506         desret_xmlTextWriterPtr(ret_val);
43507         call_tests++;
43508         des_xmlDocPtr(n_doc, doc, 0);
43509         des_xmlNodePtr(n_node, node, 1);
43510         des_int(n_compression, compression, 2);
43511         xmlResetLastError();
43512         if (mem_base != xmlMemBlocks()) {
43513             printf("Leak of %d blocks found in xmlNewTextWriterTree",
43514                    xmlMemBlocks() - mem_base);
43515             test_ret++;
43516             printf(" %d", n_doc);
43517             printf(" %d", n_node);
43518             printf(" %d", n_compression);
43519             printf("\n");
43520         }
43521     }
43522     }
43523     }
43524     function_tests++;
43525 #endif
43526
43527     return(test_ret);
43528 }
43529
43530
43531 static int
43532 test_xmlTextWriterEndAttribute(void) {
43533     int test_ret = 0;
43534
43535 #if defined(LIBXML_WRITER_ENABLED)
43536     int mem_base;
43537     int ret_val;
43538     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43539     int n_writer;
43540
43541     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43542         mem_base = xmlMemBlocks();
43543         writer = gen_xmlTextWriterPtr(n_writer, 0);
43544
43545         ret_val = xmlTextWriterEndAttribute(writer);
43546         desret_int(ret_val);
43547         call_tests++;
43548         des_xmlTextWriterPtr(n_writer, writer, 0);
43549         xmlResetLastError();
43550         if (mem_base != xmlMemBlocks()) {
43551             printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
43552                    xmlMemBlocks() - mem_base);
43553             test_ret++;
43554             printf(" %d", n_writer);
43555             printf("\n");
43556         }
43557     }
43558     function_tests++;
43559 #endif
43560
43561     return(test_ret);
43562 }
43563
43564
43565 static int
43566 test_xmlTextWriterEndCDATA(void) {
43567     int test_ret = 0;
43568
43569 #if defined(LIBXML_WRITER_ENABLED)
43570     int mem_base;
43571     int ret_val;
43572     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43573     int n_writer;
43574
43575     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43576         mem_base = xmlMemBlocks();
43577         writer = gen_xmlTextWriterPtr(n_writer, 0);
43578
43579         ret_val = xmlTextWriterEndCDATA(writer);
43580         desret_int(ret_val);
43581         call_tests++;
43582         des_xmlTextWriterPtr(n_writer, writer, 0);
43583         xmlResetLastError();
43584         if (mem_base != xmlMemBlocks()) {
43585             printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
43586                    xmlMemBlocks() - mem_base);
43587             test_ret++;
43588             printf(" %d", n_writer);
43589             printf("\n");
43590         }
43591     }
43592     function_tests++;
43593 #endif
43594
43595     return(test_ret);
43596 }
43597
43598
43599 static int
43600 test_xmlTextWriterEndComment(void) {
43601     int test_ret = 0;
43602
43603 #if defined(LIBXML_WRITER_ENABLED)
43604     int mem_base;
43605     int ret_val;
43606     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43607     int n_writer;
43608
43609     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43610         mem_base = xmlMemBlocks();
43611         writer = gen_xmlTextWriterPtr(n_writer, 0);
43612
43613         ret_val = xmlTextWriterEndComment(writer);
43614         desret_int(ret_val);
43615         call_tests++;
43616         des_xmlTextWriterPtr(n_writer, writer, 0);
43617         xmlResetLastError();
43618         if (mem_base != xmlMemBlocks()) {
43619             printf("Leak of %d blocks found in xmlTextWriterEndComment",
43620                    xmlMemBlocks() - mem_base);
43621             test_ret++;
43622             printf(" %d", n_writer);
43623             printf("\n");
43624         }
43625     }
43626     function_tests++;
43627 #endif
43628
43629     return(test_ret);
43630 }
43631
43632
43633 static int
43634 test_xmlTextWriterEndDTD(void) {
43635     int test_ret = 0;
43636
43637 #if defined(LIBXML_WRITER_ENABLED)
43638     int mem_base;
43639     int ret_val;
43640     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43641     int n_writer;
43642
43643     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43644         mem_base = xmlMemBlocks();
43645         writer = gen_xmlTextWriterPtr(n_writer, 0);
43646
43647         ret_val = xmlTextWriterEndDTD(writer);
43648         desret_int(ret_val);
43649         call_tests++;
43650         des_xmlTextWriterPtr(n_writer, writer, 0);
43651         xmlResetLastError();
43652         if (mem_base != xmlMemBlocks()) {
43653             printf("Leak of %d blocks found in xmlTextWriterEndDTD",
43654                    xmlMemBlocks() - mem_base);
43655             test_ret++;
43656             printf(" %d", n_writer);
43657             printf("\n");
43658         }
43659     }
43660     function_tests++;
43661 #endif
43662
43663     return(test_ret);
43664 }
43665
43666
43667 static int
43668 test_xmlTextWriterEndDTDAttlist(void) {
43669     int test_ret = 0;
43670
43671 #if defined(LIBXML_WRITER_ENABLED)
43672     int mem_base;
43673     int ret_val;
43674     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43675     int n_writer;
43676
43677     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43678         mem_base = xmlMemBlocks();
43679         writer = gen_xmlTextWriterPtr(n_writer, 0);
43680
43681         ret_val = xmlTextWriterEndDTDAttlist(writer);
43682         desret_int(ret_val);
43683         call_tests++;
43684         des_xmlTextWriterPtr(n_writer, writer, 0);
43685         xmlResetLastError();
43686         if (mem_base != xmlMemBlocks()) {
43687             printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
43688                    xmlMemBlocks() - mem_base);
43689             test_ret++;
43690             printf(" %d", n_writer);
43691             printf("\n");
43692         }
43693     }
43694     function_tests++;
43695 #endif
43696
43697     return(test_ret);
43698 }
43699
43700
43701 static int
43702 test_xmlTextWriterEndDTDElement(void) {
43703     int test_ret = 0;
43704
43705 #if defined(LIBXML_WRITER_ENABLED)
43706     int mem_base;
43707     int ret_val;
43708     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43709     int n_writer;
43710
43711     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43712         mem_base = xmlMemBlocks();
43713         writer = gen_xmlTextWriterPtr(n_writer, 0);
43714
43715         ret_val = xmlTextWriterEndDTDElement(writer);
43716         desret_int(ret_val);
43717         call_tests++;
43718         des_xmlTextWriterPtr(n_writer, writer, 0);
43719         xmlResetLastError();
43720         if (mem_base != xmlMemBlocks()) {
43721             printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
43722                    xmlMemBlocks() - mem_base);
43723             test_ret++;
43724             printf(" %d", n_writer);
43725             printf("\n");
43726         }
43727     }
43728     function_tests++;
43729 #endif
43730
43731     return(test_ret);
43732 }
43733
43734
43735 static int
43736 test_xmlTextWriterEndDTDEntity(void) {
43737     int test_ret = 0;
43738
43739 #if defined(LIBXML_WRITER_ENABLED)
43740     int mem_base;
43741     int ret_val;
43742     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43743     int n_writer;
43744
43745     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43746         mem_base = xmlMemBlocks();
43747         writer = gen_xmlTextWriterPtr(n_writer, 0);
43748
43749         ret_val = xmlTextWriterEndDTDEntity(writer);
43750         desret_int(ret_val);
43751         call_tests++;
43752         des_xmlTextWriterPtr(n_writer, writer, 0);
43753         xmlResetLastError();
43754         if (mem_base != xmlMemBlocks()) {
43755             printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
43756                    xmlMemBlocks() - mem_base);
43757             test_ret++;
43758             printf(" %d", n_writer);
43759             printf("\n");
43760         }
43761     }
43762     function_tests++;
43763 #endif
43764
43765     return(test_ret);
43766 }
43767
43768
43769 static int
43770 test_xmlTextWriterEndDocument(void) {
43771     int test_ret = 0;
43772
43773 #if defined(LIBXML_WRITER_ENABLED)
43774     int mem_base;
43775     int ret_val;
43776     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43777     int n_writer;
43778
43779     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43780         mem_base = xmlMemBlocks();
43781         writer = gen_xmlTextWriterPtr(n_writer, 0);
43782
43783         ret_val = xmlTextWriterEndDocument(writer);
43784         desret_int(ret_val);
43785         call_tests++;
43786         des_xmlTextWriterPtr(n_writer, writer, 0);
43787         xmlResetLastError();
43788         if (mem_base != xmlMemBlocks()) {
43789             printf("Leak of %d blocks found in xmlTextWriterEndDocument",
43790                    xmlMemBlocks() - mem_base);
43791             test_ret++;
43792             printf(" %d", n_writer);
43793             printf("\n");
43794         }
43795     }
43796     function_tests++;
43797 #endif
43798
43799     return(test_ret);
43800 }
43801
43802
43803 static int
43804 test_xmlTextWriterEndElement(void) {
43805     int test_ret = 0;
43806
43807 #if defined(LIBXML_WRITER_ENABLED)
43808     int mem_base;
43809     int ret_val;
43810     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43811     int n_writer;
43812
43813     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43814         mem_base = xmlMemBlocks();
43815         writer = gen_xmlTextWriterPtr(n_writer, 0);
43816
43817         ret_val = xmlTextWriterEndElement(writer);
43818         desret_int(ret_val);
43819         call_tests++;
43820         des_xmlTextWriterPtr(n_writer, writer, 0);
43821         xmlResetLastError();
43822         if (mem_base != xmlMemBlocks()) {
43823             printf("Leak of %d blocks found in xmlTextWriterEndElement",
43824                    xmlMemBlocks() - mem_base);
43825             test_ret++;
43826             printf(" %d", n_writer);
43827             printf("\n");
43828         }
43829     }
43830     function_tests++;
43831 #endif
43832
43833     return(test_ret);
43834 }
43835
43836
43837 static int
43838 test_xmlTextWriterEndPI(void) {
43839     int test_ret = 0;
43840
43841 #if defined(LIBXML_WRITER_ENABLED)
43842     int mem_base;
43843     int ret_val;
43844     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43845     int n_writer;
43846
43847     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43848         mem_base = xmlMemBlocks();
43849         writer = gen_xmlTextWriterPtr(n_writer, 0);
43850
43851         ret_val = xmlTextWriterEndPI(writer);
43852         desret_int(ret_val);
43853         call_tests++;
43854         des_xmlTextWriterPtr(n_writer, writer, 0);
43855         xmlResetLastError();
43856         if (mem_base != xmlMemBlocks()) {
43857             printf("Leak of %d blocks found in xmlTextWriterEndPI",
43858                    xmlMemBlocks() - mem_base);
43859             test_ret++;
43860             printf(" %d", n_writer);
43861             printf("\n");
43862         }
43863     }
43864     function_tests++;
43865 #endif
43866
43867     return(test_ret);
43868 }
43869
43870
43871 static int
43872 test_xmlTextWriterFlush(void) {
43873     int test_ret = 0;
43874
43875 #if defined(LIBXML_WRITER_ENABLED)
43876     int mem_base;
43877     int ret_val;
43878     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43879     int n_writer;
43880
43881     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43882         mem_base = xmlMemBlocks();
43883         writer = gen_xmlTextWriterPtr(n_writer, 0);
43884
43885         ret_val = xmlTextWriterFlush(writer);
43886         desret_int(ret_val);
43887         call_tests++;
43888         des_xmlTextWriterPtr(n_writer, writer, 0);
43889         xmlResetLastError();
43890         if (mem_base != xmlMemBlocks()) {
43891             printf("Leak of %d blocks found in xmlTextWriterFlush",
43892                    xmlMemBlocks() - mem_base);
43893             test_ret++;
43894             printf(" %d", n_writer);
43895             printf("\n");
43896         }
43897     }
43898     function_tests++;
43899 #endif
43900
43901     return(test_ret);
43902 }
43903
43904
43905 static int
43906 test_xmlTextWriterFullEndElement(void) {
43907     int test_ret = 0;
43908
43909 #if defined(LIBXML_WRITER_ENABLED)
43910     int mem_base;
43911     int ret_val;
43912     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43913     int n_writer;
43914
43915     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43916         mem_base = xmlMemBlocks();
43917         writer = gen_xmlTextWriterPtr(n_writer, 0);
43918
43919         ret_val = xmlTextWriterFullEndElement(writer);
43920         desret_int(ret_val);
43921         call_tests++;
43922         des_xmlTextWriterPtr(n_writer, writer, 0);
43923         xmlResetLastError();
43924         if (mem_base != xmlMemBlocks()) {
43925             printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
43926                    xmlMemBlocks() - mem_base);
43927             test_ret++;
43928             printf(" %d", n_writer);
43929             printf("\n");
43930         }
43931     }
43932     function_tests++;
43933 #endif
43934
43935     return(test_ret);
43936 }
43937
43938
43939 static int
43940 test_xmlTextWriterSetIndent(void) {
43941     int test_ret = 0;
43942
43943 #if defined(LIBXML_WRITER_ENABLED)
43944     int mem_base;
43945     int ret_val;
43946     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43947     int n_writer;
43948     int indent; /* do indentation? */
43949     int n_indent;
43950
43951     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43952     for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
43953         mem_base = xmlMemBlocks();
43954         writer = gen_xmlTextWriterPtr(n_writer, 0);
43955         indent = gen_int(n_indent, 1);
43956
43957         ret_val = xmlTextWriterSetIndent(writer, indent);
43958         desret_int(ret_val);
43959         call_tests++;
43960         des_xmlTextWriterPtr(n_writer, writer, 0);
43961         des_int(n_indent, indent, 1);
43962         xmlResetLastError();
43963         if (mem_base != xmlMemBlocks()) {
43964             printf("Leak of %d blocks found in xmlTextWriterSetIndent",
43965                    xmlMemBlocks() - mem_base);
43966             test_ret++;
43967             printf(" %d", n_writer);
43968             printf(" %d", n_indent);
43969             printf("\n");
43970         }
43971     }
43972     }
43973     function_tests++;
43974 #endif
43975
43976     return(test_ret);
43977 }
43978
43979
43980 static int
43981 test_xmlTextWriterSetIndentString(void) {
43982     int test_ret = 0;
43983
43984 #if defined(LIBXML_WRITER_ENABLED)
43985     int mem_base;
43986     int ret_val;
43987     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43988     int n_writer;
43989     xmlChar * str; /* the xmlChar string */
43990     int n_str;
43991
43992     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43993     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
43994         mem_base = xmlMemBlocks();
43995         writer = gen_xmlTextWriterPtr(n_writer, 0);
43996         str = gen_const_xmlChar_ptr(n_str, 1);
43997
43998         ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
43999         desret_int(ret_val);
44000         call_tests++;
44001         des_xmlTextWriterPtr(n_writer, writer, 0);
44002         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
44003         xmlResetLastError();
44004         if (mem_base != xmlMemBlocks()) {
44005             printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
44006                    xmlMemBlocks() - mem_base);
44007             test_ret++;
44008             printf(" %d", n_writer);
44009             printf(" %d", n_str);
44010             printf("\n");
44011         }
44012     }
44013     }
44014     function_tests++;
44015 #endif
44016
44017     return(test_ret);
44018 }
44019
44020
44021 static int
44022 test_xmlTextWriterSetQuoteChar(void) {
44023     int test_ret = 0;
44024
44025 #if defined(LIBXML_WRITER_ENABLED)
44026     int mem_base;
44027     int ret_val;
44028     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44029     int n_writer;
44030     xmlChar quotechar; /* the quote character */
44031     int n_quotechar;
44032
44033     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44034     for (n_quotechar = 0;n_quotechar < gen_nb_xmlChar;n_quotechar++) {
44035         mem_base = xmlMemBlocks();
44036         writer = gen_xmlTextWriterPtr(n_writer, 0);
44037         quotechar = gen_xmlChar(n_quotechar, 1);
44038
44039         ret_val = xmlTextWriterSetQuoteChar(writer, quotechar);
44040         desret_int(ret_val);
44041         call_tests++;
44042         des_xmlTextWriterPtr(n_writer, writer, 0);
44043         des_xmlChar(n_quotechar, quotechar, 1);
44044         xmlResetLastError();
44045         if (mem_base != xmlMemBlocks()) {
44046             printf("Leak of %d blocks found in xmlTextWriterSetQuoteChar",
44047                    xmlMemBlocks() - mem_base);
44048             test_ret++;
44049             printf(" %d", n_writer);
44050             printf(" %d", n_quotechar);
44051             printf("\n");
44052         }
44053     }
44054     }
44055     function_tests++;
44056 #endif
44057
44058     return(test_ret);
44059 }
44060
44061
44062 static int
44063 test_xmlTextWriterStartAttribute(void) {
44064     int test_ret = 0;
44065
44066 #if defined(LIBXML_WRITER_ENABLED)
44067     int mem_base;
44068     int ret_val;
44069     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44070     int n_writer;
44071     xmlChar * name; /* element name */
44072     int n_name;
44073
44074     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44075     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44076         mem_base = xmlMemBlocks();
44077         writer = gen_xmlTextWriterPtr(n_writer, 0);
44078         name = gen_const_xmlChar_ptr(n_name, 1);
44079
44080         ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
44081         desret_int(ret_val);
44082         call_tests++;
44083         des_xmlTextWriterPtr(n_writer, writer, 0);
44084         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44085         xmlResetLastError();
44086         if (mem_base != xmlMemBlocks()) {
44087             printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
44088                    xmlMemBlocks() - mem_base);
44089             test_ret++;
44090             printf(" %d", n_writer);
44091             printf(" %d", n_name);
44092             printf("\n");
44093         }
44094     }
44095     }
44096     function_tests++;
44097 #endif
44098
44099     return(test_ret);
44100 }
44101
44102
44103 static int
44104 test_xmlTextWriterStartAttributeNS(void) {
44105     int test_ret = 0;
44106
44107 #if defined(LIBXML_WRITER_ENABLED)
44108     int mem_base;
44109     int ret_val;
44110     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44111     int n_writer;
44112     xmlChar * prefix; /* namespace prefix or NULL */
44113     int n_prefix;
44114     xmlChar * name; /* element local name */
44115     int n_name;
44116     xmlChar * namespaceURI; /* namespace URI or NULL */
44117     int n_namespaceURI;
44118
44119     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44120     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44121     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44122     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44123         mem_base = xmlMemBlocks();
44124         writer = gen_xmlTextWriterPtr(n_writer, 0);
44125         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44126         name = gen_const_xmlChar_ptr(n_name, 2);
44127         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44128
44129         ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
44130         desret_int(ret_val);
44131         call_tests++;
44132         des_xmlTextWriterPtr(n_writer, writer, 0);
44133         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44134         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44135         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44136         xmlResetLastError();
44137         if (mem_base != xmlMemBlocks()) {
44138             printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
44139                    xmlMemBlocks() - mem_base);
44140             test_ret++;
44141             printf(" %d", n_writer);
44142             printf(" %d", n_prefix);
44143             printf(" %d", n_name);
44144             printf(" %d", n_namespaceURI);
44145             printf("\n");
44146         }
44147     }
44148     }
44149     }
44150     }
44151     function_tests++;
44152 #endif
44153
44154     return(test_ret);
44155 }
44156
44157
44158 static int
44159 test_xmlTextWriterStartCDATA(void) {
44160     int test_ret = 0;
44161
44162 #if defined(LIBXML_WRITER_ENABLED)
44163     int mem_base;
44164     int ret_val;
44165     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44166     int n_writer;
44167
44168     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44169         mem_base = xmlMemBlocks();
44170         writer = gen_xmlTextWriterPtr(n_writer, 0);
44171
44172         ret_val = xmlTextWriterStartCDATA(writer);
44173         desret_int(ret_val);
44174         call_tests++;
44175         des_xmlTextWriterPtr(n_writer, writer, 0);
44176         xmlResetLastError();
44177         if (mem_base != xmlMemBlocks()) {
44178             printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
44179                    xmlMemBlocks() - mem_base);
44180             test_ret++;
44181             printf(" %d", n_writer);
44182             printf("\n");
44183         }
44184     }
44185     function_tests++;
44186 #endif
44187
44188     return(test_ret);
44189 }
44190
44191
44192 static int
44193 test_xmlTextWriterStartComment(void) {
44194     int test_ret = 0;
44195
44196 #if defined(LIBXML_WRITER_ENABLED)
44197     int mem_base;
44198     int ret_val;
44199     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44200     int n_writer;
44201
44202     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44203         mem_base = xmlMemBlocks();
44204         writer = gen_xmlTextWriterPtr(n_writer, 0);
44205
44206         ret_val = xmlTextWriterStartComment(writer);
44207         desret_int(ret_val);
44208         call_tests++;
44209         des_xmlTextWriterPtr(n_writer, writer, 0);
44210         xmlResetLastError();
44211         if (mem_base != xmlMemBlocks()) {
44212             printf("Leak of %d blocks found in xmlTextWriterStartComment",
44213                    xmlMemBlocks() - mem_base);
44214             test_ret++;
44215             printf(" %d", n_writer);
44216             printf("\n");
44217         }
44218     }
44219     function_tests++;
44220 #endif
44221
44222     return(test_ret);
44223 }
44224
44225
44226 static int
44227 test_xmlTextWriterStartDTD(void) {
44228     int test_ret = 0;
44229
44230 #if defined(LIBXML_WRITER_ENABLED)
44231     int mem_base;
44232     int ret_val;
44233     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44234     int n_writer;
44235     xmlChar * name; /* the name of the DTD */
44236     int n_name;
44237     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44238     int n_pubid;
44239     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44240     int n_sysid;
44241
44242     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44243     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44244     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44245     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44246         mem_base = xmlMemBlocks();
44247         writer = gen_xmlTextWriterPtr(n_writer, 0);
44248         name = gen_const_xmlChar_ptr(n_name, 1);
44249         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44250         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44251
44252         ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
44253         desret_int(ret_val);
44254         call_tests++;
44255         des_xmlTextWriterPtr(n_writer, writer, 0);
44256         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44257         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44258         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44259         xmlResetLastError();
44260         if (mem_base != xmlMemBlocks()) {
44261             printf("Leak of %d blocks found in xmlTextWriterStartDTD",
44262                    xmlMemBlocks() - mem_base);
44263             test_ret++;
44264             printf(" %d", n_writer);
44265             printf(" %d", n_name);
44266             printf(" %d", n_pubid);
44267             printf(" %d", n_sysid);
44268             printf("\n");
44269         }
44270     }
44271     }
44272     }
44273     }
44274     function_tests++;
44275 #endif
44276
44277     return(test_ret);
44278 }
44279
44280
44281 static int
44282 test_xmlTextWriterStartDTDAttlist(void) {
44283     int test_ret = 0;
44284
44285 #if defined(LIBXML_WRITER_ENABLED)
44286     int mem_base;
44287     int ret_val;
44288     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44289     int n_writer;
44290     xmlChar * name; /* the name of the DTD ATTLIST */
44291     int n_name;
44292
44293     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44294     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44295         mem_base = xmlMemBlocks();
44296         writer = gen_xmlTextWriterPtr(n_writer, 0);
44297         name = gen_const_xmlChar_ptr(n_name, 1);
44298
44299         ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
44300         desret_int(ret_val);
44301         call_tests++;
44302         des_xmlTextWriterPtr(n_writer, writer, 0);
44303         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44304         xmlResetLastError();
44305         if (mem_base != xmlMemBlocks()) {
44306             printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
44307                    xmlMemBlocks() - mem_base);
44308             test_ret++;
44309             printf(" %d", n_writer);
44310             printf(" %d", n_name);
44311             printf("\n");
44312         }
44313     }
44314     }
44315     function_tests++;
44316 #endif
44317
44318     return(test_ret);
44319 }
44320
44321
44322 static int
44323 test_xmlTextWriterStartDTDElement(void) {
44324     int test_ret = 0;
44325
44326 #if defined(LIBXML_WRITER_ENABLED)
44327     int mem_base;
44328     int ret_val;
44329     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44330     int n_writer;
44331     xmlChar * name; /* the name of the DTD element */
44332     int n_name;
44333
44334     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44335     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44336         mem_base = xmlMemBlocks();
44337         writer = gen_xmlTextWriterPtr(n_writer, 0);
44338         name = gen_const_xmlChar_ptr(n_name, 1);
44339
44340         ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
44341         desret_int(ret_val);
44342         call_tests++;
44343         des_xmlTextWriterPtr(n_writer, writer, 0);
44344         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44345         xmlResetLastError();
44346         if (mem_base != xmlMemBlocks()) {
44347             printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
44348                    xmlMemBlocks() - mem_base);
44349             test_ret++;
44350             printf(" %d", n_writer);
44351             printf(" %d", n_name);
44352             printf("\n");
44353         }
44354     }
44355     }
44356     function_tests++;
44357 #endif
44358
44359     return(test_ret);
44360 }
44361
44362
44363 static int
44364 test_xmlTextWriterStartDTDEntity(void) {
44365     int test_ret = 0;
44366
44367 #if defined(LIBXML_WRITER_ENABLED)
44368     int mem_base;
44369     int ret_val;
44370     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44371     int n_writer;
44372     int pe; /* TRUE if this is a parameter entity, FALSE if not */
44373     int n_pe;
44374     xmlChar * name; /* the name of the DTD ATTLIST */
44375     int n_name;
44376
44377     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44378     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44379     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44380         mem_base = xmlMemBlocks();
44381         writer = gen_xmlTextWriterPtr(n_writer, 0);
44382         pe = gen_int(n_pe, 1);
44383         name = gen_const_xmlChar_ptr(n_name, 2);
44384
44385         ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
44386         desret_int(ret_val);
44387         call_tests++;
44388         des_xmlTextWriterPtr(n_writer, writer, 0);
44389         des_int(n_pe, pe, 1);
44390         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44391         xmlResetLastError();
44392         if (mem_base != xmlMemBlocks()) {
44393             printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
44394                    xmlMemBlocks() - mem_base);
44395             test_ret++;
44396             printf(" %d", n_writer);
44397             printf(" %d", n_pe);
44398             printf(" %d", n_name);
44399             printf("\n");
44400         }
44401     }
44402     }
44403     }
44404     function_tests++;
44405 #endif
44406
44407     return(test_ret);
44408 }
44409
44410
44411 static int
44412 test_xmlTextWriterStartDocument(void) {
44413     int test_ret = 0;
44414
44415 #if defined(LIBXML_WRITER_ENABLED)
44416     int mem_base;
44417     int ret_val;
44418     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44419     int n_writer;
44420     char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
44421     int n_version;
44422     char * encoding; /* the encoding or NULL for default */
44423     int n_encoding;
44424     char * standalone; /* "yes" or "no" or NULL for default */
44425     int n_standalone;
44426
44427     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44428     for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
44429     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
44430     for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
44431         mem_base = xmlMemBlocks();
44432         writer = gen_xmlTextWriterPtr(n_writer, 0);
44433         version = gen_const_char_ptr(n_version, 1);
44434         encoding = gen_const_char_ptr(n_encoding, 2);
44435         standalone = gen_const_char_ptr(n_standalone, 3);
44436
44437         ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
44438         desret_int(ret_val);
44439         call_tests++;
44440         des_xmlTextWriterPtr(n_writer, writer, 0);
44441         des_const_char_ptr(n_version, (const char *)version, 1);
44442         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
44443         des_const_char_ptr(n_standalone, (const char *)standalone, 3);
44444         xmlResetLastError();
44445         if (mem_base != xmlMemBlocks()) {
44446             printf("Leak of %d blocks found in xmlTextWriterStartDocument",
44447                    xmlMemBlocks() - mem_base);
44448             test_ret++;
44449             printf(" %d", n_writer);
44450             printf(" %d", n_version);
44451             printf(" %d", n_encoding);
44452             printf(" %d", n_standalone);
44453             printf("\n");
44454         }
44455     }
44456     }
44457     }
44458     }
44459     function_tests++;
44460 #endif
44461
44462     return(test_ret);
44463 }
44464
44465
44466 static int
44467 test_xmlTextWriterStartElement(void) {
44468     int test_ret = 0;
44469
44470 #if defined(LIBXML_WRITER_ENABLED)
44471     int mem_base;
44472     int ret_val;
44473     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44474     int n_writer;
44475     xmlChar * name; /* element name */
44476     int n_name;
44477
44478     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44479     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44480         mem_base = xmlMemBlocks();
44481         writer = gen_xmlTextWriterPtr(n_writer, 0);
44482         name = gen_const_xmlChar_ptr(n_name, 1);
44483
44484         ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
44485         desret_int(ret_val);
44486         call_tests++;
44487         des_xmlTextWriterPtr(n_writer, writer, 0);
44488         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44489         xmlResetLastError();
44490         if (mem_base != xmlMemBlocks()) {
44491             printf("Leak of %d blocks found in xmlTextWriterStartElement",
44492                    xmlMemBlocks() - mem_base);
44493             test_ret++;
44494             printf(" %d", n_writer);
44495             printf(" %d", n_name);
44496             printf("\n");
44497         }
44498     }
44499     }
44500     function_tests++;
44501 #endif
44502
44503     return(test_ret);
44504 }
44505
44506
44507 static int
44508 test_xmlTextWriterStartElementNS(void) {
44509     int test_ret = 0;
44510
44511 #if defined(LIBXML_WRITER_ENABLED)
44512     int mem_base;
44513     int ret_val;
44514     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44515     int n_writer;
44516     xmlChar * prefix; /* namespace prefix or NULL */
44517     int n_prefix;
44518     xmlChar * name; /* element local name */
44519     int n_name;
44520     xmlChar * namespaceURI; /* namespace URI or NULL */
44521     int n_namespaceURI;
44522
44523     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44524     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44525     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44526     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44527         mem_base = xmlMemBlocks();
44528         writer = gen_xmlTextWriterPtr(n_writer, 0);
44529         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44530         name = gen_const_xmlChar_ptr(n_name, 2);
44531         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44532
44533         ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
44534         desret_int(ret_val);
44535         call_tests++;
44536         des_xmlTextWriterPtr(n_writer, writer, 0);
44537         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44538         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44539         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44540         xmlResetLastError();
44541         if (mem_base != xmlMemBlocks()) {
44542             printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
44543                    xmlMemBlocks() - mem_base);
44544             test_ret++;
44545             printf(" %d", n_writer);
44546             printf(" %d", n_prefix);
44547             printf(" %d", n_name);
44548             printf(" %d", n_namespaceURI);
44549             printf("\n");
44550         }
44551     }
44552     }
44553     }
44554     }
44555     function_tests++;
44556 #endif
44557
44558     return(test_ret);
44559 }
44560
44561
44562 static int
44563 test_xmlTextWriterStartPI(void) {
44564     int test_ret = 0;
44565
44566 #if defined(LIBXML_WRITER_ENABLED)
44567     int mem_base;
44568     int ret_val;
44569     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44570     int n_writer;
44571     xmlChar * target; /* PI target */
44572     int n_target;
44573
44574     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44575     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
44576         mem_base = xmlMemBlocks();
44577         writer = gen_xmlTextWriterPtr(n_writer, 0);
44578         target = gen_const_xmlChar_ptr(n_target, 1);
44579
44580         ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
44581         desret_int(ret_val);
44582         call_tests++;
44583         des_xmlTextWriterPtr(n_writer, writer, 0);
44584         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
44585         xmlResetLastError();
44586         if (mem_base != xmlMemBlocks()) {
44587             printf("Leak of %d blocks found in xmlTextWriterStartPI",
44588                    xmlMemBlocks() - mem_base);
44589             test_ret++;
44590             printf(" %d", n_writer);
44591             printf(" %d", n_target);
44592             printf("\n");
44593         }
44594     }
44595     }
44596     function_tests++;
44597 #endif
44598
44599     return(test_ret);
44600 }
44601
44602
44603 static int
44604 test_xmlTextWriterWriteAttribute(void) {
44605     int test_ret = 0;
44606
44607 #if defined(LIBXML_WRITER_ENABLED)
44608     int mem_base;
44609     int ret_val;
44610     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44611     int n_writer;
44612     xmlChar * name; /* attribute name */
44613     int n_name;
44614     xmlChar * content; /* attribute content */
44615     int n_content;
44616
44617     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44618     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44619     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44620         mem_base = xmlMemBlocks();
44621         writer = gen_xmlTextWriterPtr(n_writer, 0);
44622         name = gen_const_xmlChar_ptr(n_name, 1);
44623         content = gen_const_xmlChar_ptr(n_content, 2);
44624
44625         ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
44626         desret_int(ret_val);
44627         call_tests++;
44628         des_xmlTextWriterPtr(n_writer, writer, 0);
44629         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44630         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44631         xmlResetLastError();
44632         if (mem_base != xmlMemBlocks()) {
44633             printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
44634                    xmlMemBlocks() - mem_base);
44635             test_ret++;
44636             printf(" %d", n_writer);
44637             printf(" %d", n_name);
44638             printf(" %d", n_content);
44639             printf("\n");
44640         }
44641     }
44642     }
44643     }
44644     function_tests++;
44645 #endif
44646
44647     return(test_ret);
44648 }
44649
44650
44651 static int
44652 test_xmlTextWriterWriteAttributeNS(void) {
44653     int test_ret = 0;
44654
44655 #if defined(LIBXML_WRITER_ENABLED)
44656     int mem_base;
44657     int ret_val;
44658     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44659     int n_writer;
44660     xmlChar * prefix; /* namespace prefix */
44661     int n_prefix;
44662     xmlChar * name; /* attribute local name */
44663     int n_name;
44664     xmlChar * namespaceURI; /* namespace URI */
44665     int n_namespaceURI;
44666     xmlChar * content; /* attribute content */
44667     int n_content;
44668
44669     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44670     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44671     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44672     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44673     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44674         mem_base = xmlMemBlocks();
44675         writer = gen_xmlTextWriterPtr(n_writer, 0);
44676         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44677         name = gen_const_xmlChar_ptr(n_name, 2);
44678         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44679         content = gen_const_xmlChar_ptr(n_content, 4);
44680
44681         ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44682         desret_int(ret_val);
44683         call_tests++;
44684         des_xmlTextWriterPtr(n_writer, writer, 0);
44685         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44686         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44687         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44688         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44689         xmlResetLastError();
44690         if (mem_base != xmlMemBlocks()) {
44691             printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
44692                    xmlMemBlocks() - mem_base);
44693             test_ret++;
44694             printf(" %d", n_writer);
44695             printf(" %d", n_prefix);
44696             printf(" %d", n_name);
44697             printf(" %d", n_namespaceURI);
44698             printf(" %d", n_content);
44699             printf("\n");
44700         }
44701     }
44702     }
44703     }
44704     }
44705     }
44706     function_tests++;
44707 #endif
44708
44709     return(test_ret);
44710 }
44711
44712
44713 static int
44714 test_xmlTextWriterWriteBase64(void) {
44715     int test_ret = 0;
44716
44717 #if defined(LIBXML_WRITER_ENABLED)
44718     int mem_base;
44719     int ret_val;
44720     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44721     int n_writer;
44722     char * data; /* binary data */
44723     int n_data;
44724     int start; /* the position within the data of the first byte to encode */
44725     int n_start;
44726     int len; /* the number of bytes to encode */
44727     int n_len;
44728
44729     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44730     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44731     for (n_start = 0;n_start < gen_nb_int;n_start++) {
44732     for (n_len = 0;n_len < gen_nb_int;n_len++) {
44733         mem_base = xmlMemBlocks();
44734         writer = gen_xmlTextWriterPtr(n_writer, 0);
44735         data = gen_const_char_ptr(n_data, 1);
44736         start = gen_int(n_start, 2);
44737         len = gen_int(n_len, 3);
44738         if ((data != NULL) &&
44739             (start > (int) strlen((const char *) data) + 1))
44740             continue;
44741         if ((data != NULL) &&
44742             (len > (int) strlen((const char *) data) + 1))
44743             continue;
44744
44745         ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
44746         desret_int(ret_val);
44747         call_tests++;
44748         des_xmlTextWriterPtr(n_writer, writer, 0);
44749         des_const_char_ptr(n_data, (const char *)data, 1);
44750         des_int(n_start, start, 2);
44751         des_int(n_len, len, 3);
44752         xmlResetLastError();
44753         if (mem_base != xmlMemBlocks()) {
44754             printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
44755                    xmlMemBlocks() - mem_base);
44756             test_ret++;
44757             printf(" %d", n_writer);
44758             printf(" %d", n_data);
44759             printf(" %d", n_start);
44760             printf(" %d", n_len);
44761             printf("\n");
44762         }
44763     }
44764     }
44765     }
44766     }
44767     function_tests++;
44768 #endif
44769
44770     return(test_ret);
44771 }
44772
44773
44774 static int
44775 test_xmlTextWriterWriteBinHex(void) {
44776     int test_ret = 0;
44777
44778 #if defined(LIBXML_WRITER_ENABLED)
44779     int mem_base;
44780     int ret_val;
44781     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44782     int n_writer;
44783     char * data; /* binary data */
44784     int n_data;
44785     int start; /* the position within the data of the first byte to encode */
44786     int n_start;
44787     int len; /* the number of bytes to encode */
44788     int n_len;
44789
44790     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44791     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44792     for (n_start = 0;n_start < gen_nb_int;n_start++) {
44793     for (n_len = 0;n_len < gen_nb_int;n_len++) {
44794         mem_base = xmlMemBlocks();
44795         writer = gen_xmlTextWriterPtr(n_writer, 0);
44796         data = gen_const_char_ptr(n_data, 1);
44797         start = gen_int(n_start, 2);
44798         len = gen_int(n_len, 3);
44799         if ((data != NULL) &&
44800             (start > (int) strlen((const char *) data) + 1))
44801             continue;
44802         if ((data != NULL) &&
44803             (len > (int) strlen((const char *) data) + 1))
44804             continue;
44805
44806         ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
44807         desret_int(ret_val);
44808         call_tests++;
44809         des_xmlTextWriterPtr(n_writer, writer, 0);
44810         des_const_char_ptr(n_data, (const char *)data, 1);
44811         des_int(n_start, start, 2);
44812         des_int(n_len, len, 3);
44813         xmlResetLastError();
44814         if (mem_base != xmlMemBlocks()) {
44815             printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
44816                    xmlMemBlocks() - mem_base);
44817             test_ret++;
44818             printf(" %d", n_writer);
44819             printf(" %d", n_data);
44820             printf(" %d", n_start);
44821             printf(" %d", n_len);
44822             printf("\n");
44823         }
44824     }
44825     }
44826     }
44827     }
44828     function_tests++;
44829 #endif
44830
44831     return(test_ret);
44832 }
44833
44834
44835 static int
44836 test_xmlTextWriterWriteCDATA(void) {
44837     int test_ret = 0;
44838
44839 #if defined(LIBXML_WRITER_ENABLED)
44840     int mem_base;
44841     int ret_val;
44842     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44843     int n_writer;
44844     xmlChar * content; /* CDATA content */
44845     int n_content;
44846
44847     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44848     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44849         mem_base = xmlMemBlocks();
44850         writer = gen_xmlTextWriterPtr(n_writer, 0);
44851         content = gen_const_xmlChar_ptr(n_content, 1);
44852
44853         ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
44854         desret_int(ret_val);
44855         call_tests++;
44856         des_xmlTextWriterPtr(n_writer, writer, 0);
44857         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44858         xmlResetLastError();
44859         if (mem_base != xmlMemBlocks()) {
44860             printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
44861                    xmlMemBlocks() - mem_base);
44862             test_ret++;
44863             printf(" %d", n_writer);
44864             printf(" %d", n_content);
44865             printf("\n");
44866         }
44867     }
44868     }
44869     function_tests++;
44870 #endif
44871
44872     return(test_ret);
44873 }
44874
44875
44876 static int
44877 test_xmlTextWriterWriteComment(void) {
44878     int test_ret = 0;
44879
44880 #if defined(LIBXML_WRITER_ENABLED)
44881     int mem_base;
44882     int ret_val;
44883     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44884     int n_writer;
44885     xmlChar * content; /* comment string */
44886     int n_content;
44887
44888     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44889     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44890         mem_base = xmlMemBlocks();
44891         writer = gen_xmlTextWriterPtr(n_writer, 0);
44892         content = gen_const_xmlChar_ptr(n_content, 1);
44893
44894         ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
44895         desret_int(ret_val);
44896         call_tests++;
44897         des_xmlTextWriterPtr(n_writer, writer, 0);
44898         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44899         xmlResetLastError();
44900         if (mem_base != xmlMemBlocks()) {
44901             printf("Leak of %d blocks found in xmlTextWriterWriteComment",
44902                    xmlMemBlocks() - mem_base);
44903             test_ret++;
44904             printf(" %d", n_writer);
44905             printf(" %d", n_content);
44906             printf("\n");
44907         }
44908     }
44909     }
44910     function_tests++;
44911 #endif
44912
44913     return(test_ret);
44914 }
44915
44916
44917 static int
44918 test_xmlTextWriterWriteDTD(void) {
44919     int test_ret = 0;
44920
44921 #if defined(LIBXML_WRITER_ENABLED)
44922     int mem_base;
44923     int ret_val;
44924     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44925     int n_writer;
44926     xmlChar * name; /* the name of the DTD */
44927     int n_name;
44928     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44929     int n_pubid;
44930     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44931     int n_sysid;
44932     xmlChar * subset; /* string content of the DTD */
44933     int n_subset;
44934
44935     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44936     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44937     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44938     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44939     for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
44940         mem_base = xmlMemBlocks();
44941         writer = gen_xmlTextWriterPtr(n_writer, 0);
44942         name = gen_const_xmlChar_ptr(n_name, 1);
44943         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44944         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44945         subset = gen_const_xmlChar_ptr(n_subset, 4);
44946
44947         ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
44948         desret_int(ret_val);
44949         call_tests++;
44950         des_xmlTextWriterPtr(n_writer, writer, 0);
44951         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44952         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44953         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44954         des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
44955         xmlResetLastError();
44956         if (mem_base != xmlMemBlocks()) {
44957             printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
44958                    xmlMemBlocks() - mem_base);
44959             test_ret++;
44960             printf(" %d", n_writer);
44961             printf(" %d", n_name);
44962             printf(" %d", n_pubid);
44963             printf(" %d", n_sysid);
44964             printf(" %d", n_subset);
44965             printf("\n");
44966         }
44967     }
44968     }
44969     }
44970     }
44971     }
44972     function_tests++;
44973 #endif
44974
44975     return(test_ret);
44976 }
44977
44978
44979 static int
44980 test_xmlTextWriterWriteDTDAttlist(void) {
44981     int test_ret = 0;
44982
44983 #if defined(LIBXML_WRITER_ENABLED)
44984     int mem_base;
44985     int ret_val;
44986     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44987     int n_writer;
44988     xmlChar * name; /* the name of the DTD ATTLIST */
44989     int n_name;
44990     xmlChar * content; /* content of the ATTLIST */
44991     int n_content;
44992
44993     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44994     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44995     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44996         mem_base = xmlMemBlocks();
44997         writer = gen_xmlTextWriterPtr(n_writer, 0);
44998         name = gen_const_xmlChar_ptr(n_name, 1);
44999         content = gen_const_xmlChar_ptr(n_content, 2);
45000
45001         ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
45002         desret_int(ret_val);
45003         call_tests++;
45004         des_xmlTextWriterPtr(n_writer, writer, 0);
45005         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45006         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45007         xmlResetLastError();
45008         if (mem_base != xmlMemBlocks()) {
45009             printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
45010                    xmlMemBlocks() - mem_base);
45011             test_ret++;
45012             printf(" %d", n_writer);
45013             printf(" %d", n_name);
45014             printf(" %d", n_content);
45015             printf("\n");
45016         }
45017     }
45018     }
45019     }
45020     function_tests++;
45021 #endif
45022
45023     return(test_ret);
45024 }
45025
45026
45027 static int
45028 test_xmlTextWriterWriteDTDElement(void) {
45029     int test_ret = 0;
45030
45031 #if defined(LIBXML_WRITER_ENABLED)
45032     int mem_base;
45033     int ret_val;
45034     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45035     int n_writer;
45036     xmlChar * name; /* the name of the DTD element */
45037     int n_name;
45038     xmlChar * content; /* content of the element */
45039     int n_content;
45040
45041     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45042     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45043     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45044         mem_base = xmlMemBlocks();
45045         writer = gen_xmlTextWriterPtr(n_writer, 0);
45046         name = gen_const_xmlChar_ptr(n_name, 1);
45047         content = gen_const_xmlChar_ptr(n_content, 2);
45048
45049         ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
45050         desret_int(ret_val);
45051         call_tests++;
45052         des_xmlTextWriterPtr(n_writer, writer, 0);
45053         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45054         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45055         xmlResetLastError();
45056         if (mem_base != xmlMemBlocks()) {
45057             printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
45058                    xmlMemBlocks() - mem_base);
45059             test_ret++;
45060             printf(" %d", n_writer);
45061             printf(" %d", n_name);
45062             printf(" %d", n_content);
45063             printf("\n");
45064         }
45065     }
45066     }
45067     }
45068     function_tests++;
45069 #endif
45070
45071     return(test_ret);
45072 }
45073
45074
45075 static int
45076 test_xmlTextWriterWriteDTDEntity(void) {
45077     int test_ret = 0;
45078
45079 #if defined(LIBXML_WRITER_ENABLED)
45080     int mem_base;
45081     int ret_val;
45082     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45083     int n_writer;
45084     int pe; /* TRUE if this is a parameter entity, FALSE if not */
45085     int n_pe;
45086     xmlChar * name; /* the name of the DTD entity */
45087     int n_name;
45088     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45089     int n_pubid;
45090     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45091     int n_sysid;
45092     xmlChar * ndataid; /* the xml notation name. */
45093     int n_ndataid;
45094     xmlChar * content; /* content of the entity */
45095     int n_content;
45096
45097     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45098     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
45099     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45100     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45101     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45102     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
45103     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45104         mem_base = xmlMemBlocks();
45105         writer = gen_xmlTextWriterPtr(n_writer, 0);
45106         pe = gen_int(n_pe, 1);
45107         name = gen_const_xmlChar_ptr(n_name, 2);
45108         pubid = gen_const_xmlChar_ptr(n_pubid, 3);
45109         sysid = gen_const_xmlChar_ptr(n_sysid, 4);
45110         ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
45111         content = gen_const_xmlChar_ptr(n_content, 6);
45112
45113         ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
45114         desret_int(ret_val);
45115         call_tests++;
45116         des_xmlTextWriterPtr(n_writer, writer, 0);
45117         des_int(n_pe, pe, 1);
45118         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45119         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
45120         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
45121         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
45122         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
45123         xmlResetLastError();
45124         if (mem_base != xmlMemBlocks()) {
45125             printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
45126                    xmlMemBlocks() - mem_base);
45127             test_ret++;
45128             printf(" %d", n_writer);
45129             printf(" %d", n_pe);
45130             printf(" %d", n_name);
45131             printf(" %d", n_pubid);
45132             printf(" %d", n_sysid);
45133             printf(" %d", n_ndataid);
45134             printf(" %d", n_content);
45135             printf("\n");
45136         }
45137     }
45138     }
45139     }
45140     }
45141     }
45142     }
45143     }
45144     function_tests++;
45145 #endif
45146
45147     return(test_ret);
45148 }
45149
45150
45151 static int
45152 test_xmlTextWriterWriteDTDExternalEntity(void) {
45153     int test_ret = 0;
45154
45155 #if defined(LIBXML_WRITER_ENABLED)
45156     int mem_base;
45157     int ret_val;
45158     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45159     int n_writer;
45160     int pe; /* TRUE if this is a parameter entity, FALSE if not */
45161     int n_pe;
45162     xmlChar * name; /* the name of the DTD entity */
45163     int n_name;
45164     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45165     int n_pubid;
45166     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45167     int n_sysid;
45168     xmlChar * ndataid; /* the xml notation name. */
45169     int n_ndataid;
45170
45171     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45172     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
45173     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45174     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45175     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45176     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
45177         mem_base = xmlMemBlocks();
45178         writer = gen_xmlTextWriterPtr(n_writer, 0);
45179         pe = gen_int(n_pe, 1);
45180         name = gen_const_xmlChar_ptr(n_name, 2);
45181         pubid = gen_const_xmlChar_ptr(n_pubid, 3);
45182         sysid = gen_const_xmlChar_ptr(n_sysid, 4);
45183         ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
45184
45185         ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
45186         desret_int(ret_val);
45187         call_tests++;
45188         des_xmlTextWriterPtr(n_writer, writer, 0);
45189         des_int(n_pe, pe, 1);
45190         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45191         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
45192         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
45193         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
45194         xmlResetLastError();
45195         if (mem_base != xmlMemBlocks()) {
45196             printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
45197                    xmlMemBlocks() - mem_base);
45198             test_ret++;
45199             printf(" %d", n_writer);
45200             printf(" %d", n_pe);
45201             printf(" %d", n_name);
45202             printf(" %d", n_pubid);
45203             printf(" %d", n_sysid);
45204             printf(" %d", n_ndataid);
45205             printf("\n");
45206         }
45207     }
45208     }
45209     }
45210     }
45211     }
45212     }
45213     function_tests++;
45214 #endif
45215
45216     return(test_ret);
45217 }
45218
45219
45220 static int
45221 test_xmlTextWriterWriteDTDExternalEntityContents(void) {
45222     int test_ret = 0;
45223
45224 #if defined(LIBXML_WRITER_ENABLED)
45225     int mem_base;
45226     int ret_val;
45227     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45228     int n_writer;
45229     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45230     int n_pubid;
45231     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45232     int n_sysid;
45233     xmlChar * ndataid; /* the xml notation name. */
45234     int n_ndataid;
45235
45236     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45237     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45238     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45239     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
45240         mem_base = xmlMemBlocks();
45241         writer = gen_xmlTextWriterPtr(n_writer, 0);
45242         pubid = gen_const_xmlChar_ptr(n_pubid, 1);
45243         sysid = gen_const_xmlChar_ptr(n_sysid, 2);
45244         ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
45245
45246         ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
45247         desret_int(ret_val);
45248         call_tests++;
45249         des_xmlTextWriterPtr(n_writer, writer, 0);
45250         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
45251         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
45252         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
45253         xmlResetLastError();
45254         if (mem_base != xmlMemBlocks()) {
45255             printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
45256                    xmlMemBlocks() - mem_base);
45257             test_ret++;
45258             printf(" %d", n_writer);
45259             printf(" %d", n_pubid);
45260             printf(" %d", n_sysid);
45261             printf(" %d", n_ndataid);
45262             printf("\n");
45263         }
45264     }
45265     }
45266     }
45267     }
45268     function_tests++;
45269 #endif
45270
45271     return(test_ret);
45272 }
45273
45274
45275 static int
45276 test_xmlTextWriterWriteDTDInternalEntity(void) {
45277     int test_ret = 0;
45278
45279 #if defined(LIBXML_WRITER_ENABLED)
45280     int mem_base;
45281     int ret_val;
45282     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45283     int n_writer;
45284     int pe; /* TRUE if this is a parameter entity, FALSE if not */
45285     int n_pe;
45286     xmlChar * name; /* the name of the DTD entity */
45287     int n_name;
45288     xmlChar * content; /* content of the entity */
45289     int n_content;
45290
45291     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45292     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
45293     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45294     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45295         mem_base = xmlMemBlocks();
45296         writer = gen_xmlTextWriterPtr(n_writer, 0);
45297         pe = gen_int(n_pe, 1);
45298         name = gen_const_xmlChar_ptr(n_name, 2);
45299         content = gen_const_xmlChar_ptr(n_content, 3);
45300
45301         ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
45302         desret_int(ret_val);
45303         call_tests++;
45304         des_xmlTextWriterPtr(n_writer, writer, 0);
45305         des_int(n_pe, pe, 1);
45306         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45307         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
45308         xmlResetLastError();
45309         if (mem_base != xmlMemBlocks()) {
45310             printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
45311                    xmlMemBlocks() - mem_base);
45312             test_ret++;
45313             printf(" %d", n_writer);
45314             printf(" %d", n_pe);
45315             printf(" %d", n_name);
45316             printf(" %d", n_content);
45317             printf("\n");
45318         }
45319     }
45320     }
45321     }
45322     }
45323     function_tests++;
45324 #endif
45325
45326     return(test_ret);
45327 }
45328
45329
45330 static int
45331 test_xmlTextWriterWriteDTDNotation(void) {
45332     int test_ret = 0;
45333
45334 #if defined(LIBXML_WRITER_ENABLED)
45335     int mem_base;
45336     int ret_val;
45337     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45338     int n_writer;
45339     xmlChar * name; /* the name of the xml notation */
45340     int n_name;
45341     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45342     int n_pubid;
45343     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45344     int n_sysid;
45345
45346     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45347     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45348     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45349     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45350         mem_base = xmlMemBlocks();
45351         writer = gen_xmlTextWriterPtr(n_writer, 0);
45352         name = gen_const_xmlChar_ptr(n_name, 1);
45353         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
45354         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
45355
45356         ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
45357         desret_int(ret_val);
45358         call_tests++;
45359         des_xmlTextWriterPtr(n_writer, writer, 0);
45360         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45361         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
45362         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
45363         xmlResetLastError();
45364         if (mem_base != xmlMemBlocks()) {
45365             printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
45366                    xmlMemBlocks() - mem_base);
45367             test_ret++;
45368             printf(" %d", n_writer);
45369             printf(" %d", n_name);
45370             printf(" %d", n_pubid);
45371             printf(" %d", n_sysid);
45372             printf("\n");
45373         }
45374     }
45375     }
45376     }
45377     }
45378     function_tests++;
45379 #endif
45380
45381     return(test_ret);
45382 }
45383
45384
45385 static int
45386 test_xmlTextWriterWriteElement(void) {
45387     int test_ret = 0;
45388
45389 #if defined(LIBXML_WRITER_ENABLED)
45390     int mem_base;
45391     int ret_val;
45392     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45393     int n_writer;
45394     xmlChar * name; /* element name */
45395     int n_name;
45396     xmlChar * content; /* element content */
45397     int n_content;
45398
45399     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45400     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45401     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45402         mem_base = xmlMemBlocks();
45403         writer = gen_xmlTextWriterPtr(n_writer, 0);
45404         name = gen_const_xmlChar_ptr(n_name, 1);
45405         content = gen_const_xmlChar_ptr(n_content, 2);
45406
45407         ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
45408         desret_int(ret_val);
45409         call_tests++;
45410         des_xmlTextWriterPtr(n_writer, writer, 0);
45411         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45412         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45413         xmlResetLastError();
45414         if (mem_base != xmlMemBlocks()) {
45415             printf("Leak of %d blocks found in xmlTextWriterWriteElement",
45416                    xmlMemBlocks() - mem_base);
45417             test_ret++;
45418             printf(" %d", n_writer);
45419             printf(" %d", n_name);
45420             printf(" %d", n_content);
45421             printf("\n");
45422         }
45423     }
45424     }
45425     }
45426     function_tests++;
45427 #endif
45428
45429     return(test_ret);
45430 }
45431
45432
45433 static int
45434 test_xmlTextWriterWriteElementNS(void) {
45435     int test_ret = 0;
45436
45437 #if defined(LIBXML_WRITER_ENABLED)
45438     int mem_base;
45439     int ret_val;
45440     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45441     int n_writer;
45442     xmlChar * prefix; /* namespace prefix */
45443     int n_prefix;
45444     xmlChar * name; /* element local name */
45445     int n_name;
45446     xmlChar * namespaceURI; /* namespace URI */
45447     int n_namespaceURI;
45448     xmlChar * content; /* element content */
45449     int n_content;
45450
45451     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45452     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
45453     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45454     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
45455     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45456         mem_base = xmlMemBlocks();
45457         writer = gen_xmlTextWriterPtr(n_writer, 0);
45458         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
45459         name = gen_const_xmlChar_ptr(n_name, 2);
45460         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
45461         content = gen_const_xmlChar_ptr(n_content, 4);
45462
45463         ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
45464         desret_int(ret_val);
45465         call_tests++;
45466         des_xmlTextWriterPtr(n_writer, writer, 0);
45467         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
45468         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45469         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
45470         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
45471         xmlResetLastError();
45472         if (mem_base != xmlMemBlocks()) {
45473             printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
45474                    xmlMemBlocks() - mem_base);
45475             test_ret++;
45476             printf(" %d", n_writer);
45477             printf(" %d", n_prefix);
45478             printf(" %d", n_name);
45479             printf(" %d", n_namespaceURI);
45480             printf(" %d", n_content);
45481             printf("\n");
45482         }
45483     }
45484     }
45485     }
45486     }
45487     }
45488     function_tests++;
45489 #endif
45490
45491     return(test_ret);
45492 }
45493
45494
45495 static int
45496 test_xmlTextWriterWriteFormatAttribute(void) {
45497     int test_ret = 0;
45498
45499
45500     /* missing type support */
45501     return(test_ret);
45502 }
45503
45504
45505 static int
45506 test_xmlTextWriterWriteFormatAttributeNS(void) {
45507     int test_ret = 0;
45508
45509
45510     /* missing type support */
45511     return(test_ret);
45512 }
45513
45514
45515 static int
45516 test_xmlTextWriterWriteFormatCDATA(void) {
45517     int test_ret = 0;
45518
45519
45520     /* missing type support */
45521     return(test_ret);
45522 }
45523
45524
45525 static int
45526 test_xmlTextWriterWriteFormatComment(void) {
45527     int test_ret = 0;
45528
45529
45530     /* missing type support */
45531     return(test_ret);
45532 }
45533
45534
45535 static int
45536 test_xmlTextWriterWriteFormatDTD(void) {
45537     int test_ret = 0;
45538
45539
45540     /* missing type support */
45541     return(test_ret);
45542 }
45543
45544
45545 static int
45546 test_xmlTextWriterWriteFormatDTDAttlist(void) {
45547     int test_ret = 0;
45548
45549
45550     /* missing type support */
45551     return(test_ret);
45552 }
45553
45554
45555 static int
45556 test_xmlTextWriterWriteFormatDTDElement(void) {
45557     int test_ret = 0;
45558
45559
45560     /* missing type support */
45561     return(test_ret);
45562 }
45563
45564
45565 static int
45566 test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
45567     int test_ret = 0;
45568
45569
45570     /* missing type support */
45571     return(test_ret);
45572 }
45573
45574
45575 static int
45576 test_xmlTextWriterWriteFormatElement(void) {
45577     int test_ret = 0;
45578
45579
45580     /* missing type support */
45581     return(test_ret);
45582 }
45583
45584
45585 static int
45586 test_xmlTextWriterWriteFormatElementNS(void) {
45587     int test_ret = 0;
45588
45589
45590     /* missing type support */
45591     return(test_ret);
45592 }
45593
45594
45595 static int
45596 test_xmlTextWriterWriteFormatPI(void) {
45597     int test_ret = 0;
45598
45599
45600     /* missing type support */
45601     return(test_ret);
45602 }
45603
45604
45605 static int
45606 test_xmlTextWriterWriteFormatRaw(void) {
45607     int test_ret = 0;
45608
45609
45610     /* missing type support */
45611     return(test_ret);
45612 }
45613
45614
45615 static int
45616 test_xmlTextWriterWriteFormatString(void) {
45617     int test_ret = 0;
45618
45619
45620     /* missing type support */
45621     return(test_ret);
45622 }
45623
45624
45625 static int
45626 test_xmlTextWriterWritePI(void) {
45627     int test_ret = 0;
45628
45629 #if defined(LIBXML_WRITER_ENABLED)
45630     int mem_base;
45631     int ret_val;
45632     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45633     int n_writer;
45634     xmlChar * target; /* PI target */
45635     int n_target;
45636     xmlChar * content; /* PI content */
45637     int n_content;
45638
45639     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45640     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
45641     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45642         mem_base = xmlMemBlocks();
45643         writer = gen_xmlTextWriterPtr(n_writer, 0);
45644         target = gen_const_xmlChar_ptr(n_target, 1);
45645         content = gen_const_xmlChar_ptr(n_content, 2);
45646
45647         ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
45648         desret_int(ret_val);
45649         call_tests++;
45650         des_xmlTextWriterPtr(n_writer, writer, 0);
45651         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
45652         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45653         xmlResetLastError();
45654         if (mem_base != xmlMemBlocks()) {
45655             printf("Leak of %d blocks found in xmlTextWriterWritePI",
45656                    xmlMemBlocks() - mem_base);
45657             test_ret++;
45658             printf(" %d", n_writer);
45659             printf(" %d", n_target);
45660             printf(" %d", n_content);
45661             printf("\n");
45662         }
45663     }
45664     }
45665     }
45666     function_tests++;
45667 #endif
45668
45669     return(test_ret);
45670 }
45671
45672
45673 static int
45674 test_xmlTextWriterWriteRaw(void) {
45675     int test_ret = 0;
45676
45677 #if defined(LIBXML_WRITER_ENABLED)
45678     int mem_base;
45679     int ret_val;
45680     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45681     int n_writer;
45682     xmlChar * content; /* text string */
45683     int n_content;
45684
45685     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45686     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45687         mem_base = xmlMemBlocks();
45688         writer = gen_xmlTextWriterPtr(n_writer, 0);
45689         content = gen_const_xmlChar_ptr(n_content, 1);
45690
45691         ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
45692         desret_int(ret_val);
45693         call_tests++;
45694         des_xmlTextWriterPtr(n_writer, writer, 0);
45695         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45696         xmlResetLastError();
45697         if (mem_base != xmlMemBlocks()) {
45698             printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
45699                    xmlMemBlocks() - mem_base);
45700             test_ret++;
45701             printf(" %d", n_writer);
45702             printf(" %d", n_content);
45703             printf("\n");
45704         }
45705     }
45706     }
45707     function_tests++;
45708 #endif
45709
45710     return(test_ret);
45711 }
45712
45713
45714 static int
45715 test_xmlTextWriterWriteRawLen(void) {
45716     int test_ret = 0;
45717
45718 #if defined(LIBXML_WRITER_ENABLED)
45719     int mem_base;
45720     int ret_val;
45721     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45722     int n_writer;
45723     xmlChar * content; /* text string */
45724     int n_content;
45725     int len; /* length of the text string */
45726     int n_len;
45727
45728     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45729     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45730     for (n_len = 0;n_len < gen_nb_int;n_len++) {
45731         mem_base = xmlMemBlocks();
45732         writer = gen_xmlTextWriterPtr(n_writer, 0);
45733         content = gen_const_xmlChar_ptr(n_content, 1);
45734         len = gen_int(n_len, 2);
45735         if ((content != NULL) &&
45736             (len > (int) strlen((const char *) content) + 1))
45737             continue;
45738
45739         ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
45740         desret_int(ret_val);
45741         call_tests++;
45742         des_xmlTextWriterPtr(n_writer, writer, 0);
45743         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45744         des_int(n_len, len, 2);
45745         xmlResetLastError();
45746         if (mem_base != xmlMemBlocks()) {
45747             printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
45748                    xmlMemBlocks() - mem_base);
45749             test_ret++;
45750             printf(" %d", n_writer);
45751             printf(" %d", n_content);
45752             printf(" %d", n_len);
45753             printf("\n");
45754         }
45755     }
45756     }
45757     }
45758     function_tests++;
45759 #endif
45760
45761     return(test_ret);
45762 }
45763
45764
45765 static int
45766 test_xmlTextWriterWriteString(void) {
45767     int test_ret = 0;
45768
45769 #if defined(LIBXML_WRITER_ENABLED)
45770     int mem_base;
45771     int ret_val;
45772     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45773     int n_writer;
45774     xmlChar * content; /* text string */
45775     int n_content;
45776
45777     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45778     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45779         mem_base = xmlMemBlocks();
45780         writer = gen_xmlTextWriterPtr(n_writer, 0);
45781         content = gen_const_xmlChar_ptr(n_content, 1);
45782
45783         ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
45784         desret_int(ret_val);
45785         call_tests++;
45786         des_xmlTextWriterPtr(n_writer, writer, 0);
45787         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45788         xmlResetLastError();
45789         if (mem_base != xmlMemBlocks()) {
45790             printf("Leak of %d blocks found in xmlTextWriterWriteString",
45791                    xmlMemBlocks() - mem_base);
45792             test_ret++;
45793             printf(" %d", n_writer);
45794             printf(" %d", n_content);
45795             printf("\n");
45796         }
45797     }
45798     }
45799     function_tests++;
45800 #endif
45801
45802     return(test_ret);
45803 }
45804
45805
45806 static int
45807 test_xmlTextWriterWriteVFormatAttribute(void) {
45808     int test_ret = 0;
45809
45810
45811     /* missing type support */
45812     return(test_ret);
45813 }
45814
45815
45816 static int
45817 test_xmlTextWriterWriteVFormatAttributeNS(void) {
45818     int test_ret = 0;
45819
45820
45821     /* missing type support */
45822     return(test_ret);
45823 }
45824
45825
45826 static int
45827 test_xmlTextWriterWriteVFormatCDATA(void) {
45828     int test_ret = 0;
45829
45830
45831     /* missing type support */
45832     return(test_ret);
45833 }
45834
45835
45836 static int
45837 test_xmlTextWriterWriteVFormatComment(void) {
45838     int test_ret = 0;
45839
45840
45841     /* missing type support */
45842     return(test_ret);
45843 }
45844
45845
45846 static int
45847 test_xmlTextWriterWriteVFormatDTD(void) {
45848     int test_ret = 0;
45849
45850
45851     /* missing type support */
45852     return(test_ret);
45853 }
45854
45855
45856 static int
45857 test_xmlTextWriterWriteVFormatDTDAttlist(void) {
45858     int test_ret = 0;
45859
45860
45861     /* missing type support */
45862     return(test_ret);
45863 }
45864
45865
45866 static int
45867 test_xmlTextWriterWriteVFormatDTDElement(void) {
45868     int test_ret = 0;
45869
45870
45871     /* missing type support */
45872     return(test_ret);
45873 }
45874
45875
45876 static int
45877 test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
45878     int test_ret = 0;
45879
45880
45881     /* missing type support */
45882     return(test_ret);
45883 }
45884
45885
45886 static int
45887 test_xmlTextWriterWriteVFormatElement(void) {
45888     int test_ret = 0;
45889
45890
45891     /* missing type support */
45892     return(test_ret);
45893 }
45894
45895
45896 static int
45897 test_xmlTextWriterWriteVFormatElementNS(void) {
45898     int test_ret = 0;
45899
45900
45901     /* missing type support */
45902     return(test_ret);
45903 }
45904
45905
45906 static int
45907 test_xmlTextWriterWriteVFormatPI(void) {
45908     int test_ret = 0;
45909
45910
45911     /* missing type support */
45912     return(test_ret);
45913 }
45914
45915
45916 static int
45917 test_xmlTextWriterWriteVFormatRaw(void) {
45918     int test_ret = 0;
45919
45920
45921     /* missing type support */
45922     return(test_ret);
45923 }
45924
45925
45926 static int
45927 test_xmlTextWriterWriteVFormatString(void) {
45928     int test_ret = 0;
45929
45930
45931     /* missing type support */
45932     return(test_ret);
45933 }
45934
45935 static int
45936 test_xmlwriter(void) {
45937     int test_ret = 0;
45938
45939     if (quiet == 0) printf("Testing xmlwriter : 52 of 80 functions ...\n");
45940     test_ret += test_xmlNewTextWriter();
45941     test_ret += test_xmlNewTextWriterFilename();
45942     test_ret += test_xmlNewTextWriterMemory();
45943     test_ret += test_xmlNewTextWriterPushParser();
45944     test_ret += test_xmlNewTextWriterTree();
45945     test_ret += test_xmlTextWriterEndAttribute();
45946     test_ret += test_xmlTextWriterEndCDATA();
45947     test_ret += test_xmlTextWriterEndComment();
45948     test_ret += test_xmlTextWriterEndDTD();
45949     test_ret += test_xmlTextWriterEndDTDAttlist();
45950     test_ret += test_xmlTextWriterEndDTDElement();
45951     test_ret += test_xmlTextWriterEndDTDEntity();
45952     test_ret += test_xmlTextWriterEndDocument();
45953     test_ret += test_xmlTextWriterEndElement();
45954     test_ret += test_xmlTextWriterEndPI();
45955     test_ret += test_xmlTextWriterFlush();
45956     test_ret += test_xmlTextWriterFullEndElement();
45957     test_ret += test_xmlTextWriterSetIndent();
45958     test_ret += test_xmlTextWriterSetIndentString();
45959     test_ret += test_xmlTextWriterSetQuoteChar();
45960     test_ret += test_xmlTextWriterStartAttribute();
45961     test_ret += test_xmlTextWriterStartAttributeNS();
45962     test_ret += test_xmlTextWriterStartCDATA();
45963     test_ret += test_xmlTextWriterStartComment();
45964     test_ret += test_xmlTextWriterStartDTD();
45965     test_ret += test_xmlTextWriterStartDTDAttlist();
45966     test_ret += test_xmlTextWriterStartDTDElement();
45967     test_ret += test_xmlTextWriterStartDTDEntity();
45968     test_ret += test_xmlTextWriterStartDocument();
45969     test_ret += test_xmlTextWriterStartElement();
45970     test_ret += test_xmlTextWriterStartElementNS();
45971     test_ret += test_xmlTextWriterStartPI();
45972     test_ret += test_xmlTextWriterWriteAttribute();
45973     test_ret += test_xmlTextWriterWriteAttributeNS();
45974     test_ret += test_xmlTextWriterWriteBase64();
45975     test_ret += test_xmlTextWriterWriteBinHex();
45976     test_ret += test_xmlTextWriterWriteCDATA();
45977     test_ret += test_xmlTextWriterWriteComment();
45978     test_ret += test_xmlTextWriterWriteDTD();
45979     test_ret += test_xmlTextWriterWriteDTDAttlist();
45980     test_ret += test_xmlTextWriterWriteDTDElement();
45981     test_ret += test_xmlTextWriterWriteDTDEntity();
45982     test_ret += test_xmlTextWriterWriteDTDExternalEntity();
45983     test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
45984     test_ret += test_xmlTextWriterWriteDTDInternalEntity();
45985     test_ret += test_xmlTextWriterWriteDTDNotation();
45986     test_ret += test_xmlTextWriterWriteElement();
45987     test_ret += test_xmlTextWriterWriteElementNS();
45988     test_ret += test_xmlTextWriterWriteFormatAttribute();
45989     test_ret += test_xmlTextWriterWriteFormatAttributeNS();
45990     test_ret += test_xmlTextWriterWriteFormatCDATA();
45991     test_ret += test_xmlTextWriterWriteFormatComment();
45992     test_ret += test_xmlTextWriterWriteFormatDTD();
45993     test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
45994     test_ret += test_xmlTextWriterWriteFormatDTDElement();
45995     test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
45996     test_ret += test_xmlTextWriterWriteFormatElement();
45997     test_ret += test_xmlTextWriterWriteFormatElementNS();
45998     test_ret += test_xmlTextWriterWriteFormatPI();
45999     test_ret += test_xmlTextWriterWriteFormatRaw();
46000     test_ret += test_xmlTextWriterWriteFormatString();
46001     test_ret += test_xmlTextWriterWritePI();
46002     test_ret += test_xmlTextWriterWriteRaw();
46003     test_ret += test_xmlTextWriterWriteRawLen();
46004     test_ret += test_xmlTextWriterWriteString();
46005     test_ret += test_xmlTextWriterWriteVFormatAttribute();
46006     test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
46007     test_ret += test_xmlTextWriterWriteVFormatCDATA();
46008     test_ret += test_xmlTextWriterWriteVFormatComment();
46009     test_ret += test_xmlTextWriterWriteVFormatDTD();
46010     test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
46011     test_ret += test_xmlTextWriterWriteVFormatDTDElement();
46012     test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
46013     test_ret += test_xmlTextWriterWriteVFormatElement();
46014     test_ret += test_xmlTextWriterWriteVFormatElementNS();
46015     test_ret += test_xmlTextWriterWriteVFormatPI();
46016     test_ret += test_xmlTextWriterWriteVFormatRaw();
46017     test_ret += test_xmlTextWriterWriteVFormatString();
46018
46019     if (test_ret != 0)
46020         printf("Module xmlwriter: %d errors\n", test_ret);
46021     return(test_ret);
46022 }
46023
46024 static int
46025 test_xmlXPathCastBooleanToNumber(void) {
46026     int test_ret = 0;
46027
46028 #if defined(LIBXML_XPATH_ENABLED)
46029     int mem_base;
46030     double ret_val;
46031     int val; /* a boolean */
46032     int n_val;
46033
46034     for (n_val = 0;n_val < gen_nb_int;n_val++) {
46035         mem_base = xmlMemBlocks();
46036         val = gen_int(n_val, 0);
46037
46038         ret_val = xmlXPathCastBooleanToNumber(val);
46039         desret_double(ret_val);
46040         call_tests++;
46041         des_int(n_val, val, 0);
46042         xmlResetLastError();
46043         if (mem_base != xmlMemBlocks()) {
46044             printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
46045                    xmlMemBlocks() - mem_base);
46046             test_ret++;
46047             printf(" %d", n_val);
46048             printf("\n");
46049         }
46050     }
46051     function_tests++;
46052 #endif
46053
46054     return(test_ret);
46055 }
46056
46057
46058 static int
46059 test_xmlXPathCastBooleanToString(void) {
46060     int test_ret = 0;
46061
46062 #if defined(LIBXML_XPATH_ENABLED)
46063     int mem_base;
46064     xmlChar * ret_val;
46065     int val; /* a boolean */
46066     int n_val;
46067
46068     for (n_val = 0;n_val < gen_nb_int;n_val++) {
46069         mem_base = xmlMemBlocks();
46070         val = gen_int(n_val, 0);
46071
46072         ret_val = xmlXPathCastBooleanToString(val);
46073         desret_xmlChar_ptr(ret_val);
46074         call_tests++;
46075         des_int(n_val, val, 0);
46076         xmlResetLastError();
46077         if (mem_base != xmlMemBlocks()) {
46078             printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
46079                    xmlMemBlocks() - mem_base);
46080             test_ret++;
46081             printf(" %d", n_val);
46082             printf("\n");
46083         }
46084     }
46085     function_tests++;
46086 #endif
46087
46088     return(test_ret);
46089 }
46090
46091
46092 static int
46093 test_xmlXPathCastNodeSetToBoolean(void) {
46094     int test_ret = 0;
46095
46096 #if defined(LIBXML_XPATH_ENABLED)
46097     int mem_base;
46098     int ret_val;
46099     xmlNodeSetPtr ns; /* a node-set */
46100     int n_ns;
46101
46102     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
46103         mem_base = xmlMemBlocks();
46104         ns = gen_xmlNodeSetPtr(n_ns, 0);
46105
46106         ret_val = xmlXPathCastNodeSetToBoolean(ns);
46107         desret_int(ret_val);
46108         call_tests++;
46109         des_xmlNodeSetPtr(n_ns, ns, 0);
46110         xmlResetLastError();
46111         if (mem_base != xmlMemBlocks()) {
46112             printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
46113                    xmlMemBlocks() - mem_base);
46114             test_ret++;
46115             printf(" %d", n_ns);
46116             printf("\n");
46117         }
46118     }
46119     function_tests++;
46120 #endif
46121
46122     return(test_ret);
46123 }
46124
46125
46126 static int
46127 test_xmlXPathCastNodeSetToNumber(void) {
46128     int test_ret = 0;
46129
46130 #if defined(LIBXML_XPATH_ENABLED)
46131     int mem_base;
46132     double ret_val;
46133     xmlNodeSetPtr ns; /* a node-set */
46134     int n_ns;
46135
46136     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
46137         mem_base = xmlMemBlocks();
46138         ns = gen_xmlNodeSetPtr(n_ns, 0);
46139
46140         ret_val = xmlXPathCastNodeSetToNumber(ns);
46141         desret_double(ret_val);
46142         call_tests++;
46143         des_xmlNodeSetPtr(n_ns, ns, 0);
46144         xmlResetLastError();
46145         if (mem_base != xmlMemBlocks()) {
46146             printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
46147                    xmlMemBlocks() - mem_base);
46148             test_ret++;
46149             printf(" %d", n_ns);
46150             printf("\n");
46151         }
46152     }
46153     function_tests++;
46154 #endif
46155
46156     return(test_ret);
46157 }
46158
46159
46160 static int
46161 test_xmlXPathCastNodeSetToString(void) {
46162     int test_ret = 0;
46163
46164 #if defined(LIBXML_XPATH_ENABLED)
46165     int mem_base;
46166     xmlChar * ret_val;
46167     xmlNodeSetPtr ns; /* a node-set */
46168     int n_ns;
46169
46170     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
46171         mem_base = xmlMemBlocks();
46172         ns = gen_xmlNodeSetPtr(n_ns, 0);
46173
46174         ret_val = xmlXPathCastNodeSetToString(ns);
46175         desret_xmlChar_ptr(ret_val);
46176         call_tests++;
46177         des_xmlNodeSetPtr(n_ns, ns, 0);
46178         xmlResetLastError();
46179         if (mem_base != xmlMemBlocks()) {
46180             printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
46181                    xmlMemBlocks() - mem_base);
46182             test_ret++;
46183             printf(" %d", n_ns);
46184             printf("\n");
46185         }
46186     }
46187     function_tests++;
46188 #endif
46189
46190     return(test_ret);
46191 }
46192
46193
46194 static int
46195 test_xmlXPathCastNodeToNumber(void) {
46196     int test_ret = 0;
46197
46198 #if defined(LIBXML_XPATH_ENABLED)
46199     int mem_base;
46200     double ret_val;
46201     xmlNodePtr node; /* a node */
46202     int n_node;
46203
46204     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46205         mem_base = xmlMemBlocks();
46206         node = gen_xmlNodePtr(n_node, 0);
46207
46208         ret_val = xmlXPathCastNodeToNumber(node);
46209         desret_double(ret_val);
46210         call_tests++;
46211         des_xmlNodePtr(n_node, node, 0);
46212         xmlResetLastError();
46213         if (mem_base != xmlMemBlocks()) {
46214             printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
46215                    xmlMemBlocks() - mem_base);
46216             test_ret++;
46217             printf(" %d", n_node);
46218             printf("\n");
46219         }
46220     }
46221     function_tests++;
46222 #endif
46223
46224     return(test_ret);
46225 }
46226
46227
46228 static int
46229 test_xmlXPathCastNodeToString(void) {
46230     int test_ret = 0;
46231
46232 #if defined(LIBXML_XPATH_ENABLED)
46233     int mem_base;
46234     xmlChar * ret_val;
46235     xmlNodePtr node; /* a node */
46236     int n_node;
46237
46238     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46239         mem_base = xmlMemBlocks();
46240         node = gen_xmlNodePtr(n_node, 0);
46241
46242         ret_val = xmlXPathCastNodeToString(node);
46243         desret_xmlChar_ptr(ret_val);
46244         call_tests++;
46245         des_xmlNodePtr(n_node, node, 0);
46246         xmlResetLastError();
46247         if (mem_base != xmlMemBlocks()) {
46248             printf("Leak of %d blocks found in xmlXPathCastNodeToString",
46249                    xmlMemBlocks() - mem_base);
46250             test_ret++;
46251             printf(" %d", n_node);
46252             printf("\n");
46253         }
46254     }
46255     function_tests++;
46256 #endif
46257
46258     return(test_ret);
46259 }
46260
46261
46262 static int
46263 test_xmlXPathCastNumberToBoolean(void) {
46264     int test_ret = 0;
46265
46266 #if defined(LIBXML_XPATH_ENABLED)
46267     int mem_base;
46268     int ret_val;
46269     double val; /* a number */
46270     int n_val;
46271
46272     for (n_val = 0;n_val < gen_nb_double;n_val++) {
46273         mem_base = xmlMemBlocks();
46274         val = gen_double(n_val, 0);
46275
46276         ret_val = xmlXPathCastNumberToBoolean(val);
46277         desret_int(ret_val);
46278         call_tests++;
46279         des_double(n_val, val, 0);
46280         xmlResetLastError();
46281         if (mem_base != xmlMemBlocks()) {
46282             printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
46283                    xmlMemBlocks() - mem_base);
46284             test_ret++;
46285             printf(" %d", n_val);
46286             printf("\n");
46287         }
46288     }
46289     function_tests++;
46290 #endif
46291
46292     return(test_ret);
46293 }
46294
46295
46296 static int
46297 test_xmlXPathCastNumberToString(void) {
46298     int test_ret = 0;
46299
46300 #if defined(LIBXML_XPATH_ENABLED)
46301     int mem_base;
46302     xmlChar * ret_val;
46303     double val; /* a number */
46304     int n_val;
46305
46306     for (n_val = 0;n_val < gen_nb_double;n_val++) {
46307         mem_base = xmlMemBlocks();
46308         val = gen_double(n_val, 0);
46309
46310         ret_val = xmlXPathCastNumberToString(val);
46311         desret_xmlChar_ptr(ret_val);
46312         call_tests++;
46313         des_double(n_val, val, 0);
46314         xmlResetLastError();
46315         if (mem_base != xmlMemBlocks()) {
46316             printf("Leak of %d blocks found in xmlXPathCastNumberToString",
46317                    xmlMemBlocks() - mem_base);
46318             test_ret++;
46319             printf(" %d", n_val);
46320             printf("\n");
46321         }
46322     }
46323     function_tests++;
46324 #endif
46325
46326     return(test_ret);
46327 }
46328
46329
46330 static int
46331 test_xmlXPathCastStringToBoolean(void) {
46332     int test_ret = 0;
46333
46334 #if defined(LIBXML_XPATH_ENABLED)
46335     int mem_base;
46336     int ret_val;
46337     xmlChar * val; /* a string */
46338     int n_val;
46339
46340     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
46341         mem_base = xmlMemBlocks();
46342         val = gen_const_xmlChar_ptr(n_val, 0);
46343
46344         ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
46345         desret_int(ret_val);
46346         call_tests++;
46347         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
46348         xmlResetLastError();
46349         if (mem_base != xmlMemBlocks()) {
46350             printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
46351                    xmlMemBlocks() - mem_base);
46352             test_ret++;
46353             printf(" %d", n_val);
46354             printf("\n");
46355         }
46356     }
46357     function_tests++;
46358 #endif
46359
46360     return(test_ret);
46361 }
46362
46363
46364 static int
46365 test_xmlXPathCastStringToNumber(void) {
46366     int test_ret = 0;
46367
46368 #if defined(LIBXML_XPATH_ENABLED)
46369     int mem_base;
46370     double ret_val;
46371     xmlChar * val; /* a string */
46372     int n_val;
46373
46374     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
46375         mem_base = xmlMemBlocks();
46376         val = gen_const_xmlChar_ptr(n_val, 0);
46377
46378         ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
46379         desret_double(ret_val);
46380         call_tests++;
46381         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
46382         xmlResetLastError();
46383         if (mem_base != xmlMemBlocks()) {
46384             printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
46385                    xmlMemBlocks() - mem_base);
46386             test_ret++;
46387             printf(" %d", n_val);
46388             printf("\n");
46389         }
46390     }
46391     function_tests++;
46392 #endif
46393
46394     return(test_ret);
46395 }
46396
46397
46398 static int
46399 test_xmlXPathCastToBoolean(void) {
46400     int test_ret = 0;
46401
46402 #if defined(LIBXML_XPATH_ENABLED)
46403     int mem_base;
46404     int ret_val;
46405     xmlXPathObjectPtr val; /* an XPath object */
46406     int n_val;
46407
46408     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46409         mem_base = xmlMemBlocks();
46410         val = gen_xmlXPathObjectPtr(n_val, 0);
46411
46412         ret_val = xmlXPathCastToBoolean(val);
46413         desret_int(ret_val);
46414         call_tests++;
46415         des_xmlXPathObjectPtr(n_val, val, 0);
46416         xmlResetLastError();
46417         if (mem_base != xmlMemBlocks()) {
46418             printf("Leak of %d blocks found in xmlXPathCastToBoolean",
46419                    xmlMemBlocks() - mem_base);
46420             test_ret++;
46421             printf(" %d", n_val);
46422             printf("\n");
46423         }
46424     }
46425     function_tests++;
46426 #endif
46427
46428     return(test_ret);
46429 }
46430
46431
46432 static int
46433 test_xmlXPathCastToNumber(void) {
46434     int test_ret = 0;
46435
46436 #if defined(LIBXML_XPATH_ENABLED)
46437     int mem_base;
46438     double ret_val;
46439     xmlXPathObjectPtr val; /* an XPath object */
46440     int n_val;
46441
46442     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46443         mem_base = xmlMemBlocks();
46444         val = gen_xmlXPathObjectPtr(n_val, 0);
46445
46446         ret_val = xmlXPathCastToNumber(val);
46447         desret_double(ret_val);
46448         call_tests++;
46449         des_xmlXPathObjectPtr(n_val, val, 0);
46450         xmlResetLastError();
46451         if (mem_base != xmlMemBlocks()) {
46452             printf("Leak of %d blocks found in xmlXPathCastToNumber",
46453                    xmlMemBlocks() - mem_base);
46454             test_ret++;
46455             printf(" %d", n_val);
46456             printf("\n");
46457         }
46458     }
46459     function_tests++;
46460 #endif
46461
46462     return(test_ret);
46463 }
46464
46465
46466 static int
46467 test_xmlXPathCastToString(void) {
46468     int test_ret = 0;
46469
46470 #if defined(LIBXML_XPATH_ENABLED)
46471     int mem_base;
46472     xmlChar * ret_val;
46473     xmlXPathObjectPtr val; /* an XPath object */
46474     int n_val;
46475
46476     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46477         mem_base = xmlMemBlocks();
46478         val = gen_xmlXPathObjectPtr(n_val, 0);
46479
46480         ret_val = xmlXPathCastToString(val);
46481         desret_xmlChar_ptr(ret_val);
46482         call_tests++;
46483         des_xmlXPathObjectPtr(n_val, val, 0);
46484         xmlResetLastError();
46485         if (mem_base != xmlMemBlocks()) {
46486             printf("Leak of %d blocks found in xmlXPathCastToString",
46487                    xmlMemBlocks() - mem_base);
46488             test_ret++;
46489             printf(" %d", n_val);
46490             printf("\n");
46491         }
46492     }
46493     function_tests++;
46494 #endif
46495
46496     return(test_ret);
46497 }
46498
46499
46500 static int
46501 test_xmlXPathCmpNodes(void) {
46502     int test_ret = 0;
46503
46504 #if defined(LIBXML_XPATH_ENABLED)
46505     int mem_base;
46506     int ret_val;
46507     xmlNodePtr node1; /* the first node */
46508     int n_node1;
46509     xmlNodePtr node2; /* the second node */
46510     int n_node2;
46511
46512     for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
46513     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
46514         mem_base = xmlMemBlocks();
46515         node1 = gen_xmlNodePtr(n_node1, 0);
46516         node2 = gen_xmlNodePtr(n_node2, 1);
46517
46518         ret_val = xmlXPathCmpNodes(node1, node2);
46519         desret_int(ret_val);
46520         call_tests++;
46521         des_xmlNodePtr(n_node1, node1, 0);
46522         des_xmlNodePtr(n_node2, node2, 1);
46523         xmlResetLastError();
46524         if (mem_base != xmlMemBlocks()) {
46525             printf("Leak of %d blocks found in xmlXPathCmpNodes",
46526                    xmlMemBlocks() - mem_base);
46527             test_ret++;
46528             printf(" %d", n_node1);
46529             printf(" %d", n_node2);
46530             printf("\n");
46531         }
46532     }
46533     }
46534     function_tests++;
46535 #endif
46536
46537     return(test_ret);
46538 }
46539
46540
46541 static int
46542 test_xmlXPathCompile(void) {
46543     int test_ret = 0;
46544
46545
46546     /* missing type support */
46547     return(test_ret);
46548 }
46549
46550 #ifdef LIBXML_XPATH_ENABLED
46551
46552 #define gen_nb_xmlXPathCompExprPtr 1
46553 static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46554     return(NULL);
46555 }
46556 static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46557 }
46558 #endif
46559
46560 #ifdef LIBXML_XPATH_ENABLED
46561
46562 #define gen_nb_xmlXPathContextPtr 1
46563 static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46564     return(NULL);
46565 }
46566 static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46567 }
46568 #endif
46569
46570
46571 static int
46572 test_xmlXPathCompiledEval(void) {
46573     int test_ret = 0;
46574
46575 #if defined(LIBXML_XPATH_ENABLED)
46576     int mem_base;
46577     xmlXPathObjectPtr ret_val;
46578     xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46579     int n_comp;
46580     xmlXPathContextPtr ctx; /* the XPath context */
46581     int n_ctx;
46582
46583     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46584     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46585         mem_base = xmlMemBlocks();
46586         comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46587         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46588
46589         ret_val = xmlXPathCompiledEval(comp, ctx);
46590         desret_xmlXPathObjectPtr(ret_val);
46591         call_tests++;
46592         des_xmlXPathCompExprPtr(n_comp, comp, 0);
46593         des_xmlXPathContextPtr(n_ctx, ctx, 1);
46594         xmlResetLastError();
46595         if (mem_base != xmlMemBlocks()) {
46596             printf("Leak of %d blocks found in xmlXPathCompiledEval",
46597                    xmlMemBlocks() - mem_base);
46598             test_ret++;
46599             printf(" %d", n_comp);
46600             printf(" %d", n_ctx);
46601             printf("\n");
46602         }
46603     }
46604     }
46605     function_tests++;
46606 #endif
46607
46608     return(test_ret);
46609 }
46610
46611
46612 static int
46613 test_xmlXPathCompiledEvalToBoolean(void) {
46614     int test_ret = 0;
46615
46616 #if defined(LIBXML_XPATH_ENABLED)
46617     int mem_base;
46618     int ret_val;
46619     xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46620     int n_comp;
46621     xmlXPathContextPtr ctxt; /* the XPath context */
46622     int n_ctxt;
46623
46624     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46625     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46626         mem_base = xmlMemBlocks();
46627         comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46628         ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46629
46630         ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
46631         desret_int(ret_val);
46632         call_tests++;
46633         des_xmlXPathCompExprPtr(n_comp, comp, 0);
46634         des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46635         xmlResetLastError();
46636         if (mem_base != xmlMemBlocks()) {
46637             printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
46638                    xmlMemBlocks() - mem_base);
46639             test_ret++;
46640             printf(" %d", n_comp);
46641             printf(" %d", n_ctxt);
46642             printf("\n");
46643         }
46644     }
46645     }
46646     function_tests++;
46647 #endif
46648
46649     return(test_ret);
46650 }
46651
46652
46653 static int
46654 test_xmlXPathContextSetCache(void) {
46655     int test_ret = 0;
46656
46657 #if defined(LIBXML_XPATH_ENABLED)
46658     int mem_base;
46659     int ret_val;
46660     xmlXPathContextPtr ctxt; /* the XPath context */
46661     int n_ctxt;
46662     int active; /* enables/disables (creates/frees) the cache */
46663     int n_active;
46664     int value; /* a value with semantics dependant on @options */
46665     int n_value;
46666     int options; /* options (currently only the value 0 is used) */
46667     int n_options;
46668
46669     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46670     for (n_active = 0;n_active < gen_nb_int;n_active++) {
46671     for (n_value = 0;n_value < gen_nb_int;n_value++) {
46672     for (n_options = 0;n_options < gen_nb_int;n_options++) {
46673         mem_base = xmlMemBlocks();
46674         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46675         active = gen_int(n_active, 1);
46676         value = gen_int(n_value, 2);
46677         options = gen_int(n_options, 3);
46678
46679         ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
46680         desret_int(ret_val);
46681         call_tests++;
46682         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46683         des_int(n_active, active, 1);
46684         des_int(n_value, value, 2);
46685         des_int(n_options, options, 3);
46686         xmlResetLastError();
46687         if (mem_base != xmlMemBlocks()) {
46688             printf("Leak of %d blocks found in xmlXPathContextSetCache",
46689                    xmlMemBlocks() - mem_base);
46690             test_ret++;
46691             printf(" %d", n_ctxt);
46692             printf(" %d", n_active);
46693             printf(" %d", n_value);
46694             printf(" %d", n_options);
46695             printf("\n");
46696         }
46697     }
46698     }
46699     }
46700     }
46701     function_tests++;
46702 #endif
46703
46704     return(test_ret);
46705 }
46706
46707
46708 static int
46709 test_xmlXPathConvertBoolean(void) {
46710     int test_ret = 0;
46711
46712 #if defined(LIBXML_XPATH_ENABLED)
46713     int mem_base;
46714     xmlXPathObjectPtr ret_val;
46715     xmlXPathObjectPtr val; /* an XPath object */
46716     int n_val;
46717
46718     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46719         mem_base = xmlMemBlocks();
46720         val = gen_xmlXPathObjectPtr(n_val, 0);
46721
46722         ret_val = xmlXPathConvertBoolean(val);
46723         val = NULL;
46724         desret_xmlXPathObjectPtr(ret_val);
46725         call_tests++;
46726         des_xmlXPathObjectPtr(n_val, val, 0);
46727         xmlResetLastError();
46728         if (mem_base != xmlMemBlocks()) {
46729             printf("Leak of %d blocks found in xmlXPathConvertBoolean",
46730                    xmlMemBlocks() - mem_base);
46731             test_ret++;
46732             printf(" %d", n_val);
46733             printf("\n");
46734         }
46735     }
46736     function_tests++;
46737 #endif
46738
46739     return(test_ret);
46740 }
46741
46742
46743 static int
46744 test_xmlXPathConvertNumber(void) {
46745     int test_ret = 0;
46746
46747 #if defined(LIBXML_XPATH_ENABLED)
46748     int mem_base;
46749     xmlXPathObjectPtr ret_val;
46750     xmlXPathObjectPtr val; /* an XPath object */
46751     int n_val;
46752
46753     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46754         mem_base = xmlMemBlocks();
46755         val = gen_xmlXPathObjectPtr(n_val, 0);
46756
46757         ret_val = xmlXPathConvertNumber(val);
46758         val = NULL;
46759         desret_xmlXPathObjectPtr(ret_val);
46760         call_tests++;
46761         des_xmlXPathObjectPtr(n_val, val, 0);
46762         xmlResetLastError();
46763         if (mem_base != xmlMemBlocks()) {
46764             printf("Leak of %d blocks found in xmlXPathConvertNumber",
46765                    xmlMemBlocks() - mem_base);
46766             test_ret++;
46767             printf(" %d", n_val);
46768             printf("\n");
46769         }
46770     }
46771     function_tests++;
46772 #endif
46773
46774     return(test_ret);
46775 }
46776
46777
46778 static int
46779 test_xmlXPathConvertString(void) {
46780     int test_ret = 0;
46781
46782 #if defined(LIBXML_XPATH_ENABLED)
46783     int mem_base;
46784     xmlXPathObjectPtr ret_val;
46785     xmlXPathObjectPtr val; /* an XPath object */
46786     int n_val;
46787
46788     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46789         mem_base = xmlMemBlocks();
46790         val = gen_xmlXPathObjectPtr(n_val, 0);
46791
46792         ret_val = xmlXPathConvertString(val);
46793         val = NULL;
46794         desret_xmlXPathObjectPtr(ret_val);
46795         call_tests++;
46796         des_xmlXPathObjectPtr(n_val, val, 0);
46797         xmlResetLastError();
46798         if (mem_base != xmlMemBlocks()) {
46799             printf("Leak of %d blocks found in xmlXPathConvertString",
46800                    xmlMemBlocks() - mem_base);
46801             test_ret++;
46802             printf(" %d", n_val);
46803             printf("\n");
46804         }
46805     }
46806     function_tests++;
46807 #endif
46808
46809     return(test_ret);
46810 }
46811
46812
46813 static int
46814 test_xmlXPathCtxtCompile(void) {
46815     int test_ret = 0;
46816
46817
46818     /* missing type support */
46819     return(test_ret);
46820 }
46821
46822
46823 static int
46824 test_xmlXPathEval(void) {
46825     int test_ret = 0;
46826
46827 #if defined(LIBXML_XPATH_ENABLED)
46828     int mem_base;
46829     xmlXPathObjectPtr ret_val;
46830     xmlChar * str; /* the XPath expression */
46831     int n_str;
46832     xmlXPathContextPtr ctx; /* the XPath context */
46833     int n_ctx;
46834
46835     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46836     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46837         mem_base = xmlMemBlocks();
46838         str = gen_const_xmlChar_ptr(n_str, 0);
46839         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46840
46841         ret_val = xmlXPathEval((const xmlChar *)str, ctx);
46842         desret_xmlXPathObjectPtr(ret_val);
46843         call_tests++;
46844         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46845         des_xmlXPathContextPtr(n_ctx, ctx, 1);
46846         xmlResetLastError();
46847         if (mem_base != xmlMemBlocks()) {
46848             printf("Leak of %d blocks found in xmlXPathEval",
46849                    xmlMemBlocks() - mem_base);
46850             test_ret++;
46851             printf(" %d", n_str);
46852             printf(" %d", n_ctx);
46853             printf("\n");
46854         }
46855     }
46856     }
46857     function_tests++;
46858 #endif
46859
46860     return(test_ret);
46861 }
46862
46863
46864 static int
46865 test_xmlXPathEvalExpression(void) {
46866     int test_ret = 0;
46867
46868 #if defined(LIBXML_XPATH_ENABLED)
46869     int mem_base;
46870     xmlXPathObjectPtr ret_val;
46871     xmlChar * str; /* the XPath expression */
46872     int n_str;
46873     xmlXPathContextPtr ctxt; /* the XPath context */
46874     int n_ctxt;
46875
46876     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46877     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46878         mem_base = xmlMemBlocks();
46879         str = gen_const_xmlChar_ptr(n_str, 0);
46880         ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46881
46882         ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
46883         desret_xmlXPathObjectPtr(ret_val);
46884         call_tests++;
46885         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46886         des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46887         xmlResetLastError();
46888         if (mem_base != xmlMemBlocks()) {
46889             printf("Leak of %d blocks found in xmlXPathEvalExpression",
46890                    xmlMemBlocks() - mem_base);
46891             test_ret++;
46892             printf(" %d", n_str);
46893             printf(" %d", n_ctxt);
46894             printf("\n");
46895         }
46896     }
46897     }
46898     function_tests++;
46899 #endif
46900
46901     return(test_ret);
46902 }
46903
46904
46905 static int
46906 test_xmlXPathEvalPredicate(void) {
46907     int test_ret = 0;
46908
46909 #if defined(LIBXML_XPATH_ENABLED)
46910     int mem_base;
46911     int ret_val;
46912     xmlXPathContextPtr ctxt; /* the XPath context */
46913     int n_ctxt;
46914     xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46915     int n_res;
46916
46917     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46918     for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46919         mem_base = xmlMemBlocks();
46920         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46921         res = gen_xmlXPathObjectPtr(n_res, 1);
46922
46923         ret_val = xmlXPathEvalPredicate(ctxt, res);
46924         desret_int(ret_val);
46925         call_tests++;
46926         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46927         des_xmlXPathObjectPtr(n_res, res, 1);
46928         xmlResetLastError();
46929         if (mem_base != xmlMemBlocks()) {
46930             printf("Leak of %d blocks found in xmlXPathEvalPredicate",
46931                    xmlMemBlocks() - mem_base);
46932             test_ret++;
46933             printf(" %d", n_ctxt);
46934             printf(" %d", n_res);
46935             printf("\n");
46936         }
46937     }
46938     }
46939     function_tests++;
46940 #endif
46941
46942     return(test_ret);
46943 }
46944
46945
46946 static int
46947 test_xmlXPathInit(void) {
46948     int test_ret = 0;
46949
46950 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46951     int mem_base;
46952
46953         mem_base = xmlMemBlocks();
46954
46955         xmlXPathInit();
46956         call_tests++;
46957         xmlResetLastError();
46958         if (mem_base != xmlMemBlocks()) {
46959             printf("Leak of %d blocks found in xmlXPathInit",
46960                    xmlMemBlocks() - mem_base);
46961             test_ret++;
46962             printf("\n");
46963         }
46964     function_tests++;
46965 #endif
46966
46967     return(test_ret);
46968 }
46969
46970
46971 static int
46972 test_xmlXPathIsInf(void) {
46973     int test_ret = 0;
46974
46975 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46976     int mem_base;
46977     int ret_val;
46978     double val; /* a double value */
46979     int n_val;
46980
46981     for (n_val = 0;n_val < gen_nb_double;n_val++) {
46982         mem_base = xmlMemBlocks();
46983         val = gen_double(n_val, 0);
46984
46985         ret_val = xmlXPathIsInf(val);
46986         desret_int(ret_val);
46987         call_tests++;
46988         des_double(n_val, val, 0);
46989         xmlResetLastError();
46990         if (mem_base != xmlMemBlocks()) {
46991             printf("Leak of %d blocks found in xmlXPathIsInf",
46992                    xmlMemBlocks() - mem_base);
46993             test_ret++;
46994             printf(" %d", n_val);
46995             printf("\n");
46996         }
46997     }
46998     function_tests++;
46999 #endif
47000
47001     return(test_ret);
47002 }
47003
47004
47005 static int
47006 test_xmlXPathIsNaN(void) {
47007     int test_ret = 0;
47008
47009 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
47010     int mem_base;
47011     int ret_val;
47012     double val; /* a double value */
47013     int n_val;
47014
47015     for (n_val = 0;n_val < gen_nb_double;n_val++) {
47016         mem_base = xmlMemBlocks();
47017         val = gen_double(n_val, 0);
47018
47019         ret_val = xmlXPathIsNaN(val);
47020         desret_int(ret_val);
47021         call_tests++;
47022         des_double(n_val, val, 0);
47023         xmlResetLastError();
47024         if (mem_base != xmlMemBlocks()) {
47025             printf("Leak of %d blocks found in xmlXPathIsNaN",
47026                    xmlMemBlocks() - mem_base);
47027             test_ret++;
47028             printf(" %d", n_val);
47029             printf("\n");
47030         }
47031     }
47032     function_tests++;
47033 #endif
47034
47035     return(test_ret);
47036 }
47037
47038
47039 static int
47040 test_xmlXPathNewContext(void) {
47041     int test_ret = 0;
47042
47043
47044     /* missing type support */
47045     return(test_ret);
47046 }
47047
47048
47049 static int
47050 test_xmlXPathNodeEval(void) {
47051     int test_ret = 0;
47052
47053 #if defined(LIBXML_XPATH_ENABLED)
47054     int mem_base;
47055     xmlXPathObjectPtr ret_val;
47056     xmlNodePtr node; /* the node to to use as the context node */
47057     int n_node;
47058     xmlChar * str; /* the XPath expression */
47059     int n_str;
47060     xmlXPathContextPtr ctx; /* the XPath context */
47061     int n_ctx;
47062
47063     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
47064     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
47065     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
47066         mem_base = xmlMemBlocks();
47067         node = gen_xmlNodePtr(n_node, 0);
47068         str = gen_const_xmlChar_ptr(n_str, 1);
47069         ctx = gen_xmlXPathContextPtr(n_ctx, 2);
47070
47071         ret_val = xmlXPathNodeEval(node, (const xmlChar *)str, ctx);
47072         desret_xmlXPathObjectPtr(ret_val);
47073         call_tests++;
47074         des_xmlNodePtr(n_node, node, 0);
47075         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
47076         des_xmlXPathContextPtr(n_ctx, ctx, 2);
47077         xmlResetLastError();
47078         if (mem_base != xmlMemBlocks()) {
47079             printf("Leak of %d blocks found in xmlXPathNodeEval",
47080                    xmlMemBlocks() - mem_base);
47081             test_ret++;
47082             printf(" %d", n_node);
47083             printf(" %d", n_str);
47084             printf(" %d", n_ctx);
47085             printf("\n");
47086         }
47087     }
47088     }
47089     }
47090     function_tests++;
47091 #endif
47092
47093     return(test_ret);
47094 }
47095
47096
47097 static int
47098 test_xmlXPathNodeSetCreate(void) {
47099     int test_ret = 0;
47100
47101 #if defined(LIBXML_XPATH_ENABLED)
47102     int mem_base;
47103     xmlNodeSetPtr ret_val;
47104     xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
47105     int n_val;
47106
47107     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47108         mem_base = xmlMemBlocks();
47109         val = gen_xmlNodePtr(n_val, 0);
47110
47111         ret_val = xmlXPathNodeSetCreate(val);
47112         desret_xmlNodeSetPtr(ret_val);
47113         call_tests++;
47114         des_xmlNodePtr(n_val, val, 0);
47115         xmlResetLastError();
47116         if (mem_base != xmlMemBlocks()) {
47117             printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
47118                    xmlMemBlocks() - mem_base);
47119             test_ret++;
47120             printf(" %d", n_val);
47121             printf("\n");
47122         }
47123     }
47124     function_tests++;
47125 #endif
47126
47127     return(test_ret);
47128 }
47129
47130
47131 static int
47132 test_xmlXPathObjectCopy(void) {
47133     int test_ret = 0;
47134
47135 #if defined(LIBXML_XPATH_ENABLED)
47136     int mem_base;
47137     xmlXPathObjectPtr ret_val;
47138     xmlXPathObjectPtr val; /* the original object */
47139     int n_val;
47140
47141     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
47142         mem_base = xmlMemBlocks();
47143         val = gen_xmlXPathObjectPtr(n_val, 0);
47144
47145         ret_val = xmlXPathObjectCopy(val);
47146         desret_xmlXPathObjectPtr(ret_val);
47147         call_tests++;
47148         des_xmlXPathObjectPtr(n_val, val, 0);
47149         xmlResetLastError();
47150         if (mem_base != xmlMemBlocks()) {
47151             printf("Leak of %d blocks found in xmlXPathObjectCopy",
47152                    xmlMemBlocks() - mem_base);
47153             test_ret++;
47154             printf(" %d", n_val);
47155             printf("\n");
47156         }
47157     }
47158     function_tests++;
47159 #endif
47160
47161     return(test_ret);
47162 }
47163
47164
47165 static int
47166 test_xmlXPathOrderDocElems(void) {
47167     int test_ret = 0;
47168
47169 #if defined(LIBXML_XPATH_ENABLED)
47170     int mem_base;
47171     long ret_val;
47172     xmlDocPtr doc; /* an input document */
47173     int n_doc;
47174
47175     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
47176         mem_base = xmlMemBlocks();
47177         doc = gen_xmlDocPtr(n_doc, 0);
47178
47179         ret_val = xmlXPathOrderDocElems(doc);
47180         desret_long(ret_val);
47181         call_tests++;
47182         des_xmlDocPtr(n_doc, doc, 0);
47183         xmlResetLastError();
47184         if (mem_base != xmlMemBlocks()) {
47185             printf("Leak of %d blocks found in xmlXPathOrderDocElems",
47186                    xmlMemBlocks() - mem_base);
47187             test_ret++;
47188             printf(" %d", n_doc);
47189             printf("\n");
47190         }
47191     }
47192     function_tests++;
47193 #endif
47194
47195     return(test_ret);
47196 }
47197
47198
47199 static int
47200 test_xmlXPathSetContextNode(void) {
47201     int test_ret = 0;
47202
47203 #if defined(LIBXML_XPATH_ENABLED)
47204     int mem_base;
47205     int ret_val;
47206     xmlNodePtr node; /* the node to to use as the context node */
47207     int n_node;
47208     xmlXPathContextPtr ctx; /* the XPath context */
47209     int n_ctx;
47210
47211     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
47212     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
47213         mem_base = xmlMemBlocks();
47214         node = gen_xmlNodePtr(n_node, 0);
47215         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
47216
47217         ret_val = xmlXPathSetContextNode(node, ctx);
47218         desret_int(ret_val);
47219         call_tests++;
47220         des_xmlNodePtr(n_node, node, 0);
47221         des_xmlXPathContextPtr(n_ctx, ctx, 1);
47222         xmlResetLastError();
47223         if (mem_base != xmlMemBlocks()) {
47224             printf("Leak of %d blocks found in xmlXPathSetContextNode",
47225                    xmlMemBlocks() - mem_base);
47226             test_ret++;
47227             printf(" %d", n_node);
47228             printf(" %d", n_ctx);
47229             printf("\n");
47230         }
47231     }
47232     }
47233     function_tests++;
47234 #endif
47235
47236     return(test_ret);
47237 }
47238
47239 static int
47240 test_xpath(void) {
47241     int test_ret = 0;
47242
47243     if (quiet == 0) printf("Testing xpath : 32 of 40 functions ...\n");
47244     test_ret += test_xmlXPathCastBooleanToNumber();
47245     test_ret += test_xmlXPathCastBooleanToString();
47246     test_ret += test_xmlXPathCastNodeSetToBoolean();
47247     test_ret += test_xmlXPathCastNodeSetToNumber();
47248     test_ret += test_xmlXPathCastNodeSetToString();
47249     test_ret += test_xmlXPathCastNodeToNumber();
47250     test_ret += test_xmlXPathCastNodeToString();
47251     test_ret += test_xmlXPathCastNumberToBoolean();
47252     test_ret += test_xmlXPathCastNumberToString();
47253     test_ret += test_xmlXPathCastStringToBoolean();
47254     test_ret += test_xmlXPathCastStringToNumber();
47255     test_ret += test_xmlXPathCastToBoolean();
47256     test_ret += test_xmlXPathCastToNumber();
47257     test_ret += test_xmlXPathCastToString();
47258     test_ret += test_xmlXPathCmpNodes();
47259     test_ret += test_xmlXPathCompile();
47260     test_ret += test_xmlXPathCompiledEval();
47261     test_ret += test_xmlXPathCompiledEvalToBoolean();
47262     test_ret += test_xmlXPathContextSetCache();
47263     test_ret += test_xmlXPathConvertBoolean();
47264     test_ret += test_xmlXPathConvertNumber();
47265     test_ret += test_xmlXPathConvertString();
47266     test_ret += test_xmlXPathCtxtCompile();
47267     test_ret += test_xmlXPathEval();
47268     test_ret += test_xmlXPathEvalExpression();
47269     test_ret += test_xmlXPathEvalPredicate();
47270     test_ret += test_xmlXPathInit();
47271     test_ret += test_xmlXPathIsInf();
47272     test_ret += test_xmlXPathIsNaN();
47273     test_ret += test_xmlXPathNewContext();
47274     test_ret += test_xmlXPathNodeEval();
47275     test_ret += test_xmlXPathNodeSetCreate();
47276     test_ret += test_xmlXPathObjectCopy();
47277     test_ret += test_xmlXPathOrderDocElems();
47278     test_ret += test_xmlXPathSetContextNode();
47279
47280     if (test_ret != 0)
47281         printf("Module xpath: %d errors\n", test_ret);
47282     return(test_ret);
47283 }
47284 #ifdef LIBXML_XPATH_ENABLED
47285
47286 #define gen_nb_xmlXPathParserContextPtr 1
47287 static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47288     return(NULL);
47289 }
47290 static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47291 }
47292 #endif
47293
47294
47295 static int
47296 test_valuePop(void) {
47297     int test_ret = 0;
47298
47299 #if defined(LIBXML_XPATH_ENABLED)
47300     int mem_base;
47301     xmlXPathObjectPtr ret_val;
47302     xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
47303     int n_ctxt;
47304
47305     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47306         mem_base = xmlMemBlocks();
47307         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47308
47309         ret_val = valuePop(ctxt);
47310         desret_xmlXPathObjectPtr(ret_val);
47311         call_tests++;
47312         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47313         xmlResetLastError();
47314         if (mem_base != xmlMemBlocks()) {
47315             printf("Leak of %d blocks found in valuePop",
47316                    xmlMemBlocks() - mem_base);
47317             test_ret++;
47318             printf(" %d", n_ctxt);
47319             printf("\n");
47320         }
47321     }
47322     function_tests++;
47323 #endif
47324
47325     return(test_ret);
47326 }
47327
47328
47329 static int
47330 test_valuePush(void) {
47331     int test_ret = 0;
47332
47333 #if defined(LIBXML_XPATH_ENABLED)
47334     int mem_base;
47335     int ret_val;
47336     xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
47337     int n_ctxt;
47338     xmlXPathObjectPtr value; /* the XPath object */
47339     int n_value;
47340
47341     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47342     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
47343         mem_base = xmlMemBlocks();
47344         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47345         value = gen_xmlXPathObjectPtr(n_value, 1);
47346
47347         ret_val = valuePush(ctxt, value);
47348         desret_int(ret_val);
47349         call_tests++;
47350         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47351         des_xmlXPathObjectPtr(n_value, value, 1);
47352         xmlResetLastError();
47353         if (mem_base != xmlMemBlocks()) {
47354             printf("Leak of %d blocks found in valuePush",
47355                    xmlMemBlocks() - mem_base);
47356             test_ret++;
47357             printf(" %d", n_ctxt);
47358             printf(" %d", n_value);
47359             printf("\n");
47360         }
47361     }
47362     }
47363     function_tests++;
47364 #endif
47365
47366     return(test_ret);
47367 }
47368
47369
47370 static int
47371 test_xmlXPathAddValues(void) {
47372     int test_ret = 0;
47373
47374 #if defined(LIBXML_XPATH_ENABLED)
47375     int mem_base;
47376     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47377     int n_ctxt;
47378
47379     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47380         mem_base = xmlMemBlocks();
47381         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47382
47383         xmlXPathAddValues(ctxt);
47384         call_tests++;
47385         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47386         xmlResetLastError();
47387         if (mem_base != xmlMemBlocks()) {
47388             printf("Leak of %d blocks found in xmlXPathAddValues",
47389                    xmlMemBlocks() - mem_base);
47390             test_ret++;
47391             printf(" %d", n_ctxt);
47392             printf("\n");
47393         }
47394     }
47395     function_tests++;
47396 #endif
47397
47398     return(test_ret);
47399 }
47400
47401
47402 static int
47403 test_xmlXPathBooleanFunction(void) {
47404     int test_ret = 0;
47405
47406 #if defined(LIBXML_XPATH_ENABLED)
47407     int mem_base;
47408     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47409     int n_ctxt;
47410     int nargs; /* the number of arguments */
47411     int n_nargs;
47412
47413     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47414     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47415         mem_base = xmlMemBlocks();
47416         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47417         nargs = gen_int(n_nargs, 1);
47418
47419         xmlXPathBooleanFunction(ctxt, nargs);
47420         call_tests++;
47421         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47422         des_int(n_nargs, nargs, 1);
47423         xmlResetLastError();
47424         if (mem_base != xmlMemBlocks()) {
47425             printf("Leak of %d blocks found in xmlXPathBooleanFunction",
47426                    xmlMemBlocks() - mem_base);
47427             test_ret++;
47428             printf(" %d", n_ctxt);
47429             printf(" %d", n_nargs);
47430             printf("\n");
47431         }
47432     }
47433     }
47434     function_tests++;
47435 #endif
47436
47437     return(test_ret);
47438 }
47439
47440
47441 static int
47442 test_xmlXPathCeilingFunction(void) {
47443     int test_ret = 0;
47444
47445 #if defined(LIBXML_XPATH_ENABLED)
47446     int mem_base;
47447     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47448     int n_ctxt;
47449     int nargs; /* the number of arguments */
47450     int n_nargs;
47451
47452     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47453     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47454         mem_base = xmlMemBlocks();
47455         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47456         nargs = gen_int(n_nargs, 1);
47457
47458         xmlXPathCeilingFunction(ctxt, nargs);
47459         call_tests++;
47460         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47461         des_int(n_nargs, nargs, 1);
47462         xmlResetLastError();
47463         if (mem_base != xmlMemBlocks()) {
47464             printf("Leak of %d blocks found in xmlXPathCeilingFunction",
47465                    xmlMemBlocks() - mem_base);
47466             test_ret++;
47467             printf(" %d", n_ctxt);
47468             printf(" %d", n_nargs);
47469             printf("\n");
47470         }
47471     }
47472     }
47473     function_tests++;
47474 #endif
47475
47476     return(test_ret);
47477 }
47478
47479
47480 static int
47481 test_xmlXPathCompareValues(void) {
47482     int test_ret = 0;
47483
47484 #if defined(LIBXML_XPATH_ENABLED)
47485     int mem_base;
47486     int ret_val;
47487     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47488     int n_ctxt;
47489     int inf; /* less than (1) or greater than (0) */
47490     int n_inf;
47491     int strict; /* is the comparison strict */
47492     int n_strict;
47493
47494     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47495     for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
47496     for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
47497         mem_base = xmlMemBlocks();
47498         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47499         inf = gen_int(n_inf, 1);
47500         strict = gen_int(n_strict, 2);
47501
47502         ret_val = xmlXPathCompareValues(ctxt, inf, strict);
47503         desret_int(ret_val);
47504         call_tests++;
47505         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47506         des_int(n_inf, inf, 1);
47507         des_int(n_strict, strict, 2);
47508         xmlResetLastError();
47509         if (mem_base != xmlMemBlocks()) {
47510             printf("Leak of %d blocks found in xmlXPathCompareValues",
47511                    xmlMemBlocks() - mem_base);
47512             test_ret++;
47513             printf(" %d", n_ctxt);
47514             printf(" %d", n_inf);
47515             printf(" %d", n_strict);
47516             printf("\n");
47517         }
47518     }
47519     }
47520     }
47521     function_tests++;
47522 #endif
47523
47524     return(test_ret);
47525 }
47526
47527
47528 static int
47529 test_xmlXPathConcatFunction(void) {
47530     int test_ret = 0;
47531
47532 #if defined(LIBXML_XPATH_ENABLED)
47533     int mem_base;
47534     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47535     int n_ctxt;
47536     int nargs; /* the number of arguments */
47537     int n_nargs;
47538
47539     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47540     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47541         mem_base = xmlMemBlocks();
47542         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47543         nargs = gen_int(n_nargs, 1);
47544
47545         xmlXPathConcatFunction(ctxt, nargs);
47546         call_tests++;
47547         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47548         des_int(n_nargs, nargs, 1);
47549         xmlResetLastError();
47550         if (mem_base != xmlMemBlocks()) {
47551             printf("Leak of %d blocks found in xmlXPathConcatFunction",
47552                    xmlMemBlocks() - mem_base);
47553             test_ret++;
47554             printf(" %d", n_ctxt);
47555             printf(" %d", n_nargs);
47556             printf("\n");
47557         }
47558     }
47559     }
47560     function_tests++;
47561 #endif
47562
47563     return(test_ret);
47564 }
47565
47566
47567 static int
47568 test_xmlXPathContainsFunction(void) {
47569     int test_ret = 0;
47570
47571 #if defined(LIBXML_XPATH_ENABLED)
47572     int mem_base;
47573     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47574     int n_ctxt;
47575     int nargs; /* the number of arguments */
47576     int n_nargs;
47577
47578     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47579     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47580         mem_base = xmlMemBlocks();
47581         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47582         nargs = gen_int(n_nargs, 1);
47583
47584         xmlXPathContainsFunction(ctxt, nargs);
47585         call_tests++;
47586         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47587         des_int(n_nargs, nargs, 1);
47588         xmlResetLastError();
47589         if (mem_base != xmlMemBlocks()) {
47590             printf("Leak of %d blocks found in xmlXPathContainsFunction",
47591                    xmlMemBlocks() - mem_base);
47592             test_ret++;
47593             printf(" %d", n_ctxt);
47594             printf(" %d", n_nargs);
47595             printf("\n");
47596         }
47597     }
47598     }
47599     function_tests++;
47600 #endif
47601
47602     return(test_ret);
47603 }
47604
47605
47606 static int
47607 test_xmlXPathCountFunction(void) {
47608     int test_ret = 0;
47609
47610 #if defined(LIBXML_XPATH_ENABLED)
47611     int mem_base;
47612     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47613     int n_ctxt;
47614     int nargs; /* the number of arguments */
47615     int n_nargs;
47616
47617     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47618     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47619         mem_base = xmlMemBlocks();
47620         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47621         nargs = gen_int(n_nargs, 1);
47622
47623         xmlXPathCountFunction(ctxt, nargs);
47624         call_tests++;
47625         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47626         des_int(n_nargs, nargs, 1);
47627         xmlResetLastError();
47628         if (mem_base != xmlMemBlocks()) {
47629             printf("Leak of %d blocks found in xmlXPathCountFunction",
47630                    xmlMemBlocks() - mem_base);
47631             test_ret++;
47632             printf(" %d", n_ctxt);
47633             printf(" %d", n_nargs);
47634             printf("\n");
47635         }
47636     }
47637     }
47638     function_tests++;
47639 #endif
47640
47641     return(test_ret);
47642 }
47643
47644
47645 static int
47646 test_xmlXPathDebugDumpCompExpr(void) {
47647     int test_ret = 0;
47648
47649 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47650     int mem_base;
47651     FILE * output; /* the FILE * for the output */
47652     int n_output;
47653     xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
47654     int n_comp;
47655     int depth; /* the indentation level. */
47656     int n_depth;
47657
47658     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47659     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
47660     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47661         mem_base = xmlMemBlocks();
47662         output = gen_FILE_ptr(n_output, 0);
47663         comp = gen_xmlXPathCompExprPtr(n_comp, 1);
47664         depth = gen_int(n_depth, 2);
47665
47666         xmlXPathDebugDumpCompExpr(output, comp, depth);
47667         call_tests++;
47668         des_FILE_ptr(n_output, output, 0);
47669         des_xmlXPathCompExprPtr(n_comp, comp, 1);
47670         des_int(n_depth, depth, 2);
47671         xmlResetLastError();
47672         if (mem_base != xmlMemBlocks()) {
47673             printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
47674                    xmlMemBlocks() - mem_base);
47675             test_ret++;
47676             printf(" %d", n_output);
47677             printf(" %d", n_comp);
47678             printf(" %d", n_depth);
47679             printf("\n");
47680         }
47681     }
47682     }
47683     }
47684     function_tests++;
47685 #endif
47686
47687     return(test_ret);
47688 }
47689
47690
47691 static int
47692 test_xmlXPathDebugDumpObject(void) {
47693     int test_ret = 0;
47694
47695 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47696     int mem_base;
47697     FILE * output; /* the FILE * to dump the output */
47698     int n_output;
47699     xmlXPathObjectPtr cur; /* the object to inspect */
47700     int n_cur;
47701     int depth; /* indentation level */
47702     int n_depth;
47703
47704     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47705     for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
47706     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47707         mem_base = xmlMemBlocks();
47708         output = gen_FILE_ptr(n_output, 0);
47709         cur = gen_xmlXPathObjectPtr(n_cur, 1);
47710         depth = gen_int(n_depth, 2);
47711
47712         xmlXPathDebugDumpObject(output, cur, depth);
47713         call_tests++;
47714         des_FILE_ptr(n_output, output, 0);
47715         des_xmlXPathObjectPtr(n_cur, cur, 1);
47716         des_int(n_depth, depth, 2);
47717         xmlResetLastError();
47718         if (mem_base != xmlMemBlocks()) {
47719             printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
47720                    xmlMemBlocks() - mem_base);
47721             test_ret++;
47722             printf(" %d", n_output);
47723             printf(" %d", n_cur);
47724             printf(" %d", n_depth);
47725             printf("\n");
47726         }
47727     }
47728     }
47729     }
47730     function_tests++;
47731 #endif
47732
47733     return(test_ret);
47734 }
47735
47736
47737 static int
47738 test_xmlXPathDifference(void) {
47739     int test_ret = 0;
47740
47741 #if defined(LIBXML_XPATH_ENABLED)
47742     int mem_base;
47743     xmlNodeSetPtr ret_val;
47744     xmlNodeSetPtr nodes1; /* a node-set */
47745     int n_nodes1;
47746     xmlNodeSetPtr nodes2; /* a node-set */
47747     int n_nodes2;
47748
47749     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47750     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47751         mem_base = xmlMemBlocks();
47752         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47753         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47754
47755         ret_val = xmlXPathDifference(nodes1, nodes2);
47756         desret_xmlNodeSetPtr(ret_val);
47757         call_tests++;
47758         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47759         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47760         xmlResetLastError();
47761         if (mem_base != xmlMemBlocks()) {
47762             printf("Leak of %d blocks found in xmlXPathDifference",
47763                    xmlMemBlocks() - mem_base);
47764             test_ret++;
47765             printf(" %d", n_nodes1);
47766             printf(" %d", n_nodes2);
47767             printf("\n");
47768         }
47769     }
47770     }
47771     function_tests++;
47772 #endif
47773
47774     return(test_ret);
47775 }
47776
47777
47778 static int
47779 test_xmlXPathDistinct(void) {
47780     int test_ret = 0;
47781
47782 #if defined(LIBXML_XPATH_ENABLED)
47783     int mem_base;
47784     xmlNodeSetPtr ret_val;
47785     xmlNodeSetPtr nodes; /* a node-set */
47786     int n_nodes;
47787
47788     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47789         mem_base = xmlMemBlocks();
47790         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47791
47792         ret_val = xmlXPathDistinct(nodes);
47793         desret_xmlNodeSetPtr(ret_val);
47794         call_tests++;
47795         des_xmlNodeSetPtr(n_nodes, nodes, 0);
47796         xmlResetLastError();
47797         if (mem_base != xmlMemBlocks()) {
47798             printf("Leak of %d blocks found in xmlXPathDistinct",
47799                    xmlMemBlocks() - mem_base);
47800             test_ret++;
47801             printf(" %d", n_nodes);
47802             printf("\n");
47803         }
47804     }
47805     function_tests++;
47806 #endif
47807
47808     return(test_ret);
47809 }
47810
47811
47812 static int
47813 test_xmlXPathDistinctSorted(void) {
47814     int test_ret = 0;
47815
47816 #if defined(LIBXML_XPATH_ENABLED)
47817     int mem_base;
47818     xmlNodeSetPtr ret_val;
47819     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
47820     int n_nodes;
47821
47822     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47823         mem_base = xmlMemBlocks();
47824         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47825
47826         ret_val = xmlXPathDistinctSorted(nodes);
47827         desret_xmlNodeSetPtr(ret_val);
47828         call_tests++;
47829         des_xmlNodeSetPtr(n_nodes, nodes, 0);
47830         xmlResetLastError();
47831         if (mem_base != xmlMemBlocks()) {
47832             printf("Leak of %d blocks found in xmlXPathDistinctSorted",
47833                    xmlMemBlocks() - mem_base);
47834             test_ret++;
47835             printf(" %d", n_nodes);
47836             printf("\n");
47837         }
47838     }
47839     function_tests++;
47840 #endif
47841
47842     return(test_ret);
47843 }
47844
47845
47846 static int
47847 test_xmlXPathDivValues(void) {
47848     int test_ret = 0;
47849
47850 #if defined(LIBXML_XPATH_ENABLED)
47851     int mem_base;
47852     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47853     int n_ctxt;
47854
47855     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47856         mem_base = xmlMemBlocks();
47857         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47858
47859         xmlXPathDivValues(ctxt);
47860         call_tests++;
47861         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47862         xmlResetLastError();
47863         if (mem_base != xmlMemBlocks()) {
47864             printf("Leak of %d blocks found in xmlXPathDivValues",
47865                    xmlMemBlocks() - mem_base);
47866             test_ret++;
47867             printf(" %d", n_ctxt);
47868             printf("\n");
47869         }
47870     }
47871     function_tests++;
47872 #endif
47873
47874     return(test_ret);
47875 }
47876
47877
47878 static int
47879 test_xmlXPathEqualValues(void) {
47880     int test_ret = 0;
47881
47882 #if defined(LIBXML_XPATH_ENABLED)
47883     int mem_base;
47884     int ret_val;
47885     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47886     int n_ctxt;
47887
47888     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47889         mem_base = xmlMemBlocks();
47890         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47891
47892         ret_val = xmlXPathEqualValues(ctxt);
47893         desret_int(ret_val);
47894         call_tests++;
47895         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47896         xmlResetLastError();
47897         if (mem_base != xmlMemBlocks()) {
47898             printf("Leak of %d blocks found in xmlXPathEqualValues",
47899                    xmlMemBlocks() - mem_base);
47900             test_ret++;
47901             printf(" %d", n_ctxt);
47902             printf("\n");
47903         }
47904     }
47905     function_tests++;
47906 #endif
47907
47908     return(test_ret);
47909 }
47910
47911
47912 static int
47913 test_xmlXPathErr(void) {
47914     int test_ret = 0;
47915
47916 #if defined(LIBXML_XPATH_ENABLED)
47917     int mem_base;
47918     xmlXPathParserContextPtr ctxt; /* a XPath parser context */
47919     int n_ctxt;
47920     int error; /* the error code */
47921     int n_error;
47922
47923     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47924     for (n_error = 0;n_error < gen_nb_int;n_error++) {
47925         mem_base = xmlMemBlocks();
47926         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47927         error = gen_int(n_error, 1);
47928
47929         xmlXPathErr(ctxt, error);
47930         call_tests++;
47931         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47932         des_int(n_error, error, 1);
47933         xmlResetLastError();
47934         if (mem_base != xmlMemBlocks()) {
47935             printf("Leak of %d blocks found in xmlXPathErr",
47936                    xmlMemBlocks() - mem_base);
47937             test_ret++;
47938             printf(" %d", n_ctxt);
47939             printf(" %d", n_error);
47940             printf("\n");
47941         }
47942     }
47943     }
47944     function_tests++;
47945 #endif
47946
47947     return(test_ret);
47948 }
47949
47950
47951 static int
47952 test_xmlXPathEvalExpr(void) {
47953     int test_ret = 0;
47954
47955 #if defined(LIBXML_XPATH_ENABLED)
47956     int mem_base;
47957     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47958     int n_ctxt;
47959
47960     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47961         mem_base = xmlMemBlocks();
47962         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47963
47964         xmlXPathEvalExpr(ctxt);
47965         call_tests++;
47966         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47967         xmlResetLastError();
47968         if (mem_base != xmlMemBlocks()) {
47969             printf("Leak of %d blocks found in xmlXPathEvalExpr",
47970                    xmlMemBlocks() - mem_base);
47971             test_ret++;
47972             printf(" %d", n_ctxt);
47973             printf("\n");
47974         }
47975     }
47976     function_tests++;
47977 #endif
47978
47979     return(test_ret);
47980 }
47981
47982
47983 static int
47984 test_xmlXPathEvaluatePredicateResult(void) {
47985     int test_ret = 0;
47986
47987 #if defined(LIBXML_XPATH_ENABLED)
47988     int mem_base;
47989     int ret_val;
47990     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47991     int n_ctxt;
47992     xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
47993     int n_res;
47994
47995     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47996     for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
47997         mem_base = xmlMemBlocks();
47998         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47999         res = gen_xmlXPathObjectPtr(n_res, 1);
48000
48001         ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
48002         desret_int(ret_val);
48003         call_tests++;
48004         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48005         des_xmlXPathObjectPtr(n_res, res, 1);
48006         xmlResetLastError();
48007         if (mem_base != xmlMemBlocks()) {
48008             printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
48009                    xmlMemBlocks() - mem_base);
48010             test_ret++;
48011             printf(" %d", n_ctxt);
48012             printf(" %d", n_res);
48013             printf("\n");
48014         }
48015     }
48016     }
48017     function_tests++;
48018 #endif
48019
48020     return(test_ret);
48021 }
48022
48023
48024 static int
48025 test_xmlXPathFalseFunction(void) {
48026     int test_ret = 0;
48027
48028 #if defined(LIBXML_XPATH_ENABLED)
48029     int mem_base;
48030     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48031     int n_ctxt;
48032     int nargs; /* the number of arguments */
48033     int n_nargs;
48034
48035     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48036     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48037         mem_base = xmlMemBlocks();
48038         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48039         nargs = gen_int(n_nargs, 1);
48040
48041         xmlXPathFalseFunction(ctxt, nargs);
48042         call_tests++;
48043         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48044         des_int(n_nargs, nargs, 1);
48045         xmlResetLastError();
48046         if (mem_base != xmlMemBlocks()) {
48047             printf("Leak of %d blocks found in xmlXPathFalseFunction",
48048                    xmlMemBlocks() - mem_base);
48049             test_ret++;
48050             printf(" %d", n_ctxt);
48051             printf(" %d", n_nargs);
48052             printf("\n");
48053         }
48054     }
48055     }
48056     function_tests++;
48057 #endif
48058
48059     return(test_ret);
48060 }
48061
48062
48063 static int
48064 test_xmlXPathFloorFunction(void) {
48065     int test_ret = 0;
48066
48067 #if defined(LIBXML_XPATH_ENABLED)
48068     int mem_base;
48069     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48070     int n_ctxt;
48071     int nargs; /* the number of arguments */
48072     int n_nargs;
48073
48074     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48075     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48076         mem_base = xmlMemBlocks();
48077         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48078         nargs = gen_int(n_nargs, 1);
48079
48080         xmlXPathFloorFunction(ctxt, nargs);
48081         call_tests++;
48082         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48083         des_int(n_nargs, nargs, 1);
48084         xmlResetLastError();
48085         if (mem_base != xmlMemBlocks()) {
48086             printf("Leak of %d blocks found in xmlXPathFloorFunction",
48087                    xmlMemBlocks() - mem_base);
48088             test_ret++;
48089             printf(" %d", n_ctxt);
48090             printf(" %d", n_nargs);
48091             printf("\n");
48092         }
48093     }
48094     }
48095     function_tests++;
48096 #endif
48097
48098     return(test_ret);
48099 }
48100
48101
48102 static int
48103 test_xmlXPathFunctionLookup(void) {
48104     int test_ret = 0;
48105
48106
48107     /* missing type support */
48108     return(test_ret);
48109 }
48110
48111
48112 static int
48113 test_xmlXPathFunctionLookupNS(void) {
48114     int test_ret = 0;
48115
48116
48117     /* missing type support */
48118     return(test_ret);
48119 }
48120
48121
48122 static int
48123 test_xmlXPathHasSameNodes(void) {
48124     int test_ret = 0;
48125
48126 #if defined(LIBXML_XPATH_ENABLED)
48127     int mem_base;
48128     int ret_val;
48129     xmlNodeSetPtr nodes1; /* a node-set */
48130     int n_nodes1;
48131     xmlNodeSetPtr nodes2; /* a node-set */
48132     int n_nodes2;
48133
48134     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48135     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48136         mem_base = xmlMemBlocks();
48137         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48138         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48139
48140         ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
48141         desret_int(ret_val);
48142         call_tests++;
48143         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48144         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48145         xmlResetLastError();
48146         if (mem_base != xmlMemBlocks()) {
48147             printf("Leak of %d blocks found in xmlXPathHasSameNodes",
48148                    xmlMemBlocks() - mem_base);
48149             test_ret++;
48150             printf(" %d", n_nodes1);
48151             printf(" %d", n_nodes2);
48152             printf("\n");
48153         }
48154     }
48155     }
48156     function_tests++;
48157 #endif
48158
48159     return(test_ret);
48160 }
48161
48162
48163 static int
48164 test_xmlXPathIdFunction(void) {
48165     int test_ret = 0;
48166
48167 #if defined(LIBXML_XPATH_ENABLED)
48168     int mem_base;
48169     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48170     int n_ctxt;
48171     int nargs; /* the number of arguments */
48172     int n_nargs;
48173
48174     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48175     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48176         mem_base = xmlMemBlocks();
48177         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48178         nargs = gen_int(n_nargs, 1);
48179
48180         xmlXPathIdFunction(ctxt, nargs);
48181         call_tests++;
48182         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48183         des_int(n_nargs, nargs, 1);
48184         xmlResetLastError();
48185         if (mem_base != xmlMemBlocks()) {
48186             printf("Leak of %d blocks found in xmlXPathIdFunction",
48187                    xmlMemBlocks() - mem_base);
48188             test_ret++;
48189             printf(" %d", n_ctxt);
48190             printf(" %d", n_nargs);
48191             printf("\n");
48192         }
48193     }
48194     }
48195     function_tests++;
48196 #endif
48197
48198     return(test_ret);
48199 }
48200
48201
48202 static int
48203 test_xmlXPathIntersection(void) {
48204     int test_ret = 0;
48205
48206 #if defined(LIBXML_XPATH_ENABLED)
48207     int mem_base;
48208     xmlNodeSetPtr ret_val;
48209     xmlNodeSetPtr nodes1; /* a node-set */
48210     int n_nodes1;
48211     xmlNodeSetPtr nodes2; /* a node-set */
48212     int n_nodes2;
48213
48214     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48215     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48216         mem_base = xmlMemBlocks();
48217         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48218         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48219
48220         ret_val = xmlXPathIntersection(nodes1, nodes2);
48221         desret_xmlNodeSetPtr(ret_val);
48222         call_tests++;
48223         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48224         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48225         xmlResetLastError();
48226         if (mem_base != xmlMemBlocks()) {
48227             printf("Leak of %d blocks found in xmlXPathIntersection",
48228                    xmlMemBlocks() - mem_base);
48229             test_ret++;
48230             printf(" %d", n_nodes1);
48231             printf(" %d", n_nodes2);
48232             printf("\n");
48233         }
48234     }
48235     }
48236     function_tests++;
48237 #endif
48238
48239     return(test_ret);
48240 }
48241
48242
48243 static int
48244 test_xmlXPathIsNodeType(void) {
48245     int test_ret = 0;
48246
48247 #if defined(LIBXML_XPATH_ENABLED)
48248     int mem_base;
48249     int ret_val;
48250     xmlChar * name; /* a name string */
48251     int n_name;
48252
48253     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
48254         mem_base = xmlMemBlocks();
48255         name = gen_const_xmlChar_ptr(n_name, 0);
48256
48257         ret_val = xmlXPathIsNodeType((const xmlChar *)name);
48258         desret_int(ret_val);
48259         call_tests++;
48260         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
48261         xmlResetLastError();
48262         if (mem_base != xmlMemBlocks()) {
48263             printf("Leak of %d blocks found in xmlXPathIsNodeType",
48264                    xmlMemBlocks() - mem_base);
48265             test_ret++;
48266             printf(" %d", n_name);
48267             printf("\n");
48268         }
48269     }
48270     function_tests++;
48271 #endif
48272
48273     return(test_ret);
48274 }
48275
48276
48277 static int
48278 test_xmlXPathLangFunction(void) {
48279     int test_ret = 0;
48280
48281 #if defined(LIBXML_XPATH_ENABLED)
48282     int mem_base;
48283     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48284     int n_ctxt;
48285     int nargs; /* the number of arguments */
48286     int n_nargs;
48287
48288     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48289     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48290         mem_base = xmlMemBlocks();
48291         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48292         nargs = gen_int(n_nargs, 1);
48293
48294         xmlXPathLangFunction(ctxt, nargs);
48295         call_tests++;
48296         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48297         des_int(n_nargs, nargs, 1);
48298         xmlResetLastError();
48299         if (mem_base != xmlMemBlocks()) {
48300             printf("Leak of %d blocks found in xmlXPathLangFunction",
48301                    xmlMemBlocks() - mem_base);
48302             test_ret++;
48303             printf(" %d", n_ctxt);
48304             printf(" %d", n_nargs);
48305             printf("\n");
48306         }
48307     }
48308     }
48309     function_tests++;
48310 #endif
48311
48312     return(test_ret);
48313 }
48314
48315
48316 static int
48317 test_xmlXPathLastFunction(void) {
48318     int test_ret = 0;
48319
48320 #if defined(LIBXML_XPATH_ENABLED)
48321     int mem_base;
48322     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48323     int n_ctxt;
48324     int nargs; /* the number of arguments */
48325     int n_nargs;
48326
48327     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48328     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48329         mem_base = xmlMemBlocks();
48330         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48331         nargs = gen_int(n_nargs, 1);
48332
48333         xmlXPathLastFunction(ctxt, nargs);
48334         call_tests++;
48335         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48336         des_int(n_nargs, nargs, 1);
48337         xmlResetLastError();
48338         if (mem_base != xmlMemBlocks()) {
48339             printf("Leak of %d blocks found in xmlXPathLastFunction",
48340                    xmlMemBlocks() - mem_base);
48341             test_ret++;
48342             printf(" %d", n_ctxt);
48343             printf(" %d", n_nargs);
48344             printf("\n");
48345         }
48346     }
48347     }
48348     function_tests++;
48349 #endif
48350
48351     return(test_ret);
48352 }
48353
48354
48355 static int
48356 test_xmlXPathLeading(void) {
48357     int test_ret = 0;
48358
48359 #if defined(LIBXML_XPATH_ENABLED)
48360     int mem_base;
48361     xmlNodeSetPtr ret_val;
48362     xmlNodeSetPtr nodes1; /* a node-set */
48363     int n_nodes1;
48364     xmlNodeSetPtr nodes2; /* a node-set */
48365     int n_nodes2;
48366
48367     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48368     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48369         mem_base = xmlMemBlocks();
48370         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48371         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48372
48373         ret_val = xmlXPathLeading(nodes1, nodes2);
48374         desret_xmlNodeSetPtr(ret_val);
48375         call_tests++;
48376         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48377         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48378         xmlResetLastError();
48379         if (mem_base != xmlMemBlocks()) {
48380             printf("Leak of %d blocks found in xmlXPathLeading",
48381                    xmlMemBlocks() - mem_base);
48382             test_ret++;
48383             printf(" %d", n_nodes1);
48384             printf(" %d", n_nodes2);
48385             printf("\n");
48386         }
48387     }
48388     }
48389     function_tests++;
48390 #endif
48391
48392     return(test_ret);
48393 }
48394
48395
48396 static int
48397 test_xmlXPathLeadingSorted(void) {
48398     int test_ret = 0;
48399
48400 #if defined(LIBXML_XPATH_ENABLED)
48401     int mem_base;
48402     xmlNodeSetPtr ret_val;
48403     xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
48404     int n_nodes1;
48405     xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
48406     int n_nodes2;
48407
48408     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48409     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48410         mem_base = xmlMemBlocks();
48411         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48412         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48413
48414         ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
48415         desret_xmlNodeSetPtr(ret_val);
48416         call_tests++;
48417         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48418         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48419         xmlResetLastError();
48420         if (mem_base != xmlMemBlocks()) {
48421             printf("Leak of %d blocks found in xmlXPathLeadingSorted",
48422                    xmlMemBlocks() - mem_base);
48423             test_ret++;
48424             printf(" %d", n_nodes1);
48425             printf(" %d", n_nodes2);
48426             printf("\n");
48427         }
48428     }
48429     }
48430     function_tests++;
48431 #endif
48432
48433     return(test_ret);
48434 }
48435
48436
48437 static int
48438 test_xmlXPathLocalNameFunction(void) {
48439     int test_ret = 0;
48440
48441 #if defined(LIBXML_XPATH_ENABLED)
48442     int mem_base;
48443     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48444     int n_ctxt;
48445     int nargs; /* the number of arguments */
48446     int n_nargs;
48447
48448     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48449     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48450         mem_base = xmlMemBlocks();
48451         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48452         nargs = gen_int(n_nargs, 1);
48453
48454         xmlXPathLocalNameFunction(ctxt, nargs);
48455         call_tests++;
48456         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48457         des_int(n_nargs, nargs, 1);
48458         xmlResetLastError();
48459         if (mem_base != xmlMemBlocks()) {
48460             printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
48461                    xmlMemBlocks() - mem_base);
48462             test_ret++;
48463             printf(" %d", n_ctxt);
48464             printf(" %d", n_nargs);
48465             printf("\n");
48466         }
48467     }
48468     }
48469     function_tests++;
48470 #endif
48471
48472     return(test_ret);
48473 }
48474
48475
48476 static int
48477 test_xmlXPathModValues(void) {
48478     int test_ret = 0;
48479
48480 #if defined(LIBXML_XPATH_ENABLED)
48481     int mem_base;
48482     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48483     int n_ctxt;
48484
48485     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48486         mem_base = xmlMemBlocks();
48487         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48488
48489         xmlXPathModValues(ctxt);
48490         call_tests++;
48491         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48492         xmlResetLastError();
48493         if (mem_base != xmlMemBlocks()) {
48494             printf("Leak of %d blocks found in xmlXPathModValues",
48495                    xmlMemBlocks() - mem_base);
48496             test_ret++;
48497             printf(" %d", n_ctxt);
48498             printf("\n");
48499         }
48500     }
48501     function_tests++;
48502 #endif
48503
48504     return(test_ret);
48505 }
48506
48507
48508 static int
48509 test_xmlXPathMultValues(void) {
48510     int test_ret = 0;
48511
48512 #if defined(LIBXML_XPATH_ENABLED)
48513     int mem_base;
48514     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48515     int n_ctxt;
48516
48517     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48518         mem_base = xmlMemBlocks();
48519         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48520
48521         xmlXPathMultValues(ctxt);
48522         call_tests++;
48523         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48524         xmlResetLastError();
48525         if (mem_base != xmlMemBlocks()) {
48526             printf("Leak of %d blocks found in xmlXPathMultValues",
48527                    xmlMemBlocks() - mem_base);
48528             test_ret++;
48529             printf(" %d", n_ctxt);
48530             printf("\n");
48531         }
48532     }
48533     function_tests++;
48534 #endif
48535
48536     return(test_ret);
48537 }
48538
48539
48540 static int
48541 test_xmlXPathNamespaceURIFunction(void) {
48542     int test_ret = 0;
48543
48544 #if defined(LIBXML_XPATH_ENABLED)
48545     int mem_base;
48546     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48547     int n_ctxt;
48548     int nargs; /* the number of arguments */
48549     int n_nargs;
48550
48551     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48552     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48553         mem_base = xmlMemBlocks();
48554         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48555         nargs = gen_int(n_nargs, 1);
48556
48557         xmlXPathNamespaceURIFunction(ctxt, nargs);
48558         call_tests++;
48559         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48560         des_int(n_nargs, nargs, 1);
48561         xmlResetLastError();
48562         if (mem_base != xmlMemBlocks()) {
48563             printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
48564                    xmlMemBlocks() - mem_base);
48565             test_ret++;
48566             printf(" %d", n_ctxt);
48567             printf(" %d", n_nargs);
48568             printf("\n");
48569         }
48570     }
48571     }
48572     function_tests++;
48573 #endif
48574
48575     return(test_ret);
48576 }
48577
48578
48579 static int
48580 test_xmlXPathNewBoolean(void) {
48581     int test_ret = 0;
48582
48583 #if defined(LIBXML_XPATH_ENABLED)
48584     int mem_base;
48585     xmlXPathObjectPtr ret_val;
48586     int val; /* the boolean value */
48587     int n_val;
48588
48589     for (n_val = 0;n_val < gen_nb_int;n_val++) {
48590         mem_base = xmlMemBlocks();
48591         val = gen_int(n_val, 0);
48592
48593         ret_val = xmlXPathNewBoolean(val);
48594         desret_xmlXPathObjectPtr(ret_val);
48595         call_tests++;
48596         des_int(n_val, val, 0);
48597         xmlResetLastError();
48598         if (mem_base != xmlMemBlocks()) {
48599             printf("Leak of %d blocks found in xmlXPathNewBoolean",
48600                    xmlMemBlocks() - mem_base);
48601             test_ret++;
48602             printf(" %d", n_val);
48603             printf("\n");
48604         }
48605     }
48606     function_tests++;
48607 #endif
48608
48609     return(test_ret);
48610 }
48611
48612
48613 static int
48614 test_xmlXPathNewCString(void) {
48615     int test_ret = 0;
48616
48617 #if defined(LIBXML_XPATH_ENABLED)
48618     int mem_base;
48619     xmlXPathObjectPtr ret_val;
48620     char * val; /* the char * value */
48621     int n_val;
48622
48623     for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
48624         mem_base = xmlMemBlocks();
48625         val = gen_const_char_ptr(n_val, 0);
48626
48627         ret_val = xmlXPathNewCString((const char *)val);
48628         desret_xmlXPathObjectPtr(ret_val);
48629         call_tests++;
48630         des_const_char_ptr(n_val, (const char *)val, 0);
48631         xmlResetLastError();
48632         if (mem_base != xmlMemBlocks()) {
48633             printf("Leak of %d blocks found in xmlXPathNewCString",
48634                    xmlMemBlocks() - mem_base);
48635             test_ret++;
48636             printf(" %d", n_val);
48637             printf("\n");
48638         }
48639     }
48640     function_tests++;
48641 #endif
48642
48643     return(test_ret);
48644 }
48645
48646
48647 static int
48648 test_xmlXPathNewFloat(void) {
48649     int test_ret = 0;
48650
48651 #if defined(LIBXML_XPATH_ENABLED)
48652     int mem_base;
48653     xmlXPathObjectPtr ret_val;
48654     double val; /* the double value */
48655     int n_val;
48656
48657     for (n_val = 0;n_val < gen_nb_double;n_val++) {
48658         mem_base = xmlMemBlocks();
48659         val = gen_double(n_val, 0);
48660
48661         ret_val = xmlXPathNewFloat(val);
48662         desret_xmlXPathObjectPtr(ret_val);
48663         call_tests++;
48664         des_double(n_val, val, 0);
48665         xmlResetLastError();
48666         if (mem_base != xmlMemBlocks()) {
48667             printf("Leak of %d blocks found in xmlXPathNewFloat",
48668                    xmlMemBlocks() - mem_base);
48669             test_ret++;
48670             printf(" %d", n_val);
48671             printf("\n");
48672         }
48673     }
48674     function_tests++;
48675 #endif
48676
48677     return(test_ret);
48678 }
48679
48680
48681 static int
48682 test_xmlXPathNewNodeSet(void) {
48683     int test_ret = 0;
48684
48685 #if defined(LIBXML_XPATH_ENABLED)
48686     int mem_base;
48687     xmlXPathObjectPtr ret_val;
48688     xmlNodePtr val; /* the NodePtr value */
48689     int n_val;
48690
48691     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48692         mem_base = xmlMemBlocks();
48693         val = gen_xmlNodePtr(n_val, 0);
48694
48695         ret_val = xmlXPathNewNodeSet(val);
48696         desret_xmlXPathObjectPtr(ret_val);
48697         call_tests++;
48698         des_xmlNodePtr(n_val, val, 0);
48699         xmlResetLastError();
48700         if (mem_base != xmlMemBlocks()) {
48701             printf("Leak of %d blocks found in xmlXPathNewNodeSet",
48702                    xmlMemBlocks() - mem_base);
48703             test_ret++;
48704             printf(" %d", n_val);
48705             printf("\n");
48706         }
48707     }
48708     function_tests++;
48709 #endif
48710
48711     return(test_ret);
48712 }
48713
48714
48715 static int
48716 test_xmlXPathNewNodeSetList(void) {
48717     int test_ret = 0;
48718
48719 #if defined(LIBXML_XPATH_ENABLED)
48720     int mem_base;
48721     xmlXPathObjectPtr ret_val;
48722     xmlNodeSetPtr val; /* an existing NodeSet */
48723     int n_val;
48724
48725     for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
48726         mem_base = xmlMemBlocks();
48727         val = gen_xmlNodeSetPtr(n_val, 0);
48728
48729         ret_val = xmlXPathNewNodeSetList(val);
48730         desret_xmlXPathObjectPtr(ret_val);
48731         call_tests++;
48732         des_xmlNodeSetPtr(n_val, val, 0);
48733         xmlResetLastError();
48734         if (mem_base != xmlMemBlocks()) {
48735             printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
48736                    xmlMemBlocks() - mem_base);
48737             test_ret++;
48738             printf(" %d", n_val);
48739             printf("\n");
48740         }
48741     }
48742     function_tests++;
48743 #endif
48744
48745     return(test_ret);
48746 }
48747
48748
48749 static int
48750 test_xmlXPathNewParserContext(void) {
48751     int test_ret = 0;
48752
48753
48754     /* missing type support */
48755     return(test_ret);
48756 }
48757
48758
48759 static int
48760 test_xmlXPathNewString(void) {
48761     int test_ret = 0;
48762
48763 #if defined(LIBXML_XPATH_ENABLED)
48764     int mem_base;
48765     xmlXPathObjectPtr ret_val;
48766     xmlChar * val; /* the xmlChar * value */
48767     int n_val;
48768
48769     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
48770         mem_base = xmlMemBlocks();
48771         val = gen_const_xmlChar_ptr(n_val, 0);
48772
48773         ret_val = xmlXPathNewString((const xmlChar *)val);
48774         desret_xmlXPathObjectPtr(ret_val);
48775         call_tests++;
48776         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
48777         xmlResetLastError();
48778         if (mem_base != xmlMemBlocks()) {
48779             printf("Leak of %d blocks found in xmlXPathNewString",
48780                    xmlMemBlocks() - mem_base);
48781             test_ret++;
48782             printf(" %d", n_val);
48783             printf("\n");
48784         }
48785     }
48786     function_tests++;
48787 #endif
48788
48789     return(test_ret);
48790 }
48791
48792
48793 static int
48794 test_xmlXPathNextAncestor(void) {
48795     int test_ret = 0;
48796
48797 #if defined(LIBXML_XPATH_ENABLED)
48798     int mem_base;
48799     xmlNodePtr ret_val;
48800     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48801     int n_ctxt;
48802     xmlNodePtr cur; /* the current node in the traversal */
48803     int n_cur;
48804
48805     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48806     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48807         mem_base = xmlMemBlocks();
48808         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48809         cur = gen_xmlNodePtr(n_cur, 1);
48810
48811         ret_val = xmlXPathNextAncestor(ctxt, cur);
48812         desret_xmlNodePtr(ret_val);
48813         call_tests++;
48814         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48815         des_xmlNodePtr(n_cur, cur, 1);
48816         xmlResetLastError();
48817         if (mem_base != xmlMemBlocks()) {
48818             printf("Leak of %d blocks found in xmlXPathNextAncestor",
48819                    xmlMemBlocks() - mem_base);
48820             test_ret++;
48821             printf(" %d", n_ctxt);
48822             printf(" %d", n_cur);
48823             printf("\n");
48824         }
48825     }
48826     }
48827     function_tests++;
48828 #endif
48829
48830     return(test_ret);
48831 }
48832
48833
48834 static int
48835 test_xmlXPathNextAncestorOrSelf(void) {
48836     int test_ret = 0;
48837
48838 #if defined(LIBXML_XPATH_ENABLED)
48839     int mem_base;
48840     xmlNodePtr ret_val;
48841     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48842     int n_ctxt;
48843     xmlNodePtr cur; /* the current node in the traversal */
48844     int n_cur;
48845
48846     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48847     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48848         mem_base = xmlMemBlocks();
48849         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48850         cur = gen_xmlNodePtr(n_cur, 1);
48851
48852         ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
48853         desret_xmlNodePtr(ret_val);
48854         call_tests++;
48855         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48856         des_xmlNodePtr(n_cur, cur, 1);
48857         xmlResetLastError();
48858         if (mem_base != xmlMemBlocks()) {
48859             printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
48860                    xmlMemBlocks() - mem_base);
48861             test_ret++;
48862             printf(" %d", n_ctxt);
48863             printf(" %d", n_cur);
48864             printf("\n");
48865         }
48866     }
48867     }
48868     function_tests++;
48869 #endif
48870
48871     return(test_ret);
48872 }
48873
48874
48875 static int
48876 test_xmlXPathNextAttribute(void) {
48877     int test_ret = 0;
48878
48879 #if defined(LIBXML_XPATH_ENABLED)
48880     int mem_base;
48881     xmlNodePtr ret_val;
48882     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48883     int n_ctxt;
48884     xmlNodePtr cur; /* the current attribute in the traversal */
48885     int n_cur;
48886
48887     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48888     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48889         mem_base = xmlMemBlocks();
48890         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48891         cur = gen_xmlNodePtr(n_cur, 1);
48892
48893         ret_val = xmlXPathNextAttribute(ctxt, cur);
48894         desret_xmlNodePtr(ret_val);
48895         call_tests++;
48896         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48897         des_xmlNodePtr(n_cur, cur, 1);
48898         xmlResetLastError();
48899         if (mem_base != xmlMemBlocks()) {
48900             printf("Leak of %d blocks found in xmlXPathNextAttribute",
48901                    xmlMemBlocks() - mem_base);
48902             test_ret++;
48903             printf(" %d", n_ctxt);
48904             printf(" %d", n_cur);
48905             printf("\n");
48906         }
48907     }
48908     }
48909     function_tests++;
48910 #endif
48911
48912     return(test_ret);
48913 }
48914
48915
48916 static int
48917 test_xmlXPathNextChild(void) {
48918     int test_ret = 0;
48919
48920 #if defined(LIBXML_XPATH_ENABLED)
48921     int mem_base;
48922     xmlNodePtr ret_val;
48923     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48924     int n_ctxt;
48925     xmlNodePtr cur; /* the current node in the traversal */
48926     int n_cur;
48927
48928     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48929     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48930         mem_base = xmlMemBlocks();
48931         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48932         cur = gen_xmlNodePtr(n_cur, 1);
48933
48934         ret_val = xmlXPathNextChild(ctxt, cur);
48935         desret_xmlNodePtr(ret_val);
48936         call_tests++;
48937         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48938         des_xmlNodePtr(n_cur, cur, 1);
48939         xmlResetLastError();
48940         if (mem_base != xmlMemBlocks()) {
48941             printf("Leak of %d blocks found in xmlXPathNextChild",
48942                    xmlMemBlocks() - mem_base);
48943             test_ret++;
48944             printf(" %d", n_ctxt);
48945             printf(" %d", n_cur);
48946             printf("\n");
48947         }
48948     }
48949     }
48950     function_tests++;
48951 #endif
48952
48953     return(test_ret);
48954 }
48955
48956
48957 static int
48958 test_xmlXPathNextDescendant(void) {
48959     int test_ret = 0;
48960
48961 #if defined(LIBXML_XPATH_ENABLED)
48962     int mem_base;
48963     xmlNodePtr ret_val;
48964     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48965     int n_ctxt;
48966     xmlNodePtr cur; /* the current node in the traversal */
48967     int n_cur;
48968
48969     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48970     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48971         mem_base = xmlMemBlocks();
48972         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48973         cur = gen_xmlNodePtr(n_cur, 1);
48974
48975         ret_val = xmlXPathNextDescendant(ctxt, cur);
48976         desret_xmlNodePtr(ret_val);
48977         call_tests++;
48978         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48979         des_xmlNodePtr(n_cur, cur, 1);
48980         xmlResetLastError();
48981         if (mem_base != xmlMemBlocks()) {
48982             printf("Leak of %d blocks found in xmlXPathNextDescendant",
48983                    xmlMemBlocks() - mem_base);
48984             test_ret++;
48985             printf(" %d", n_ctxt);
48986             printf(" %d", n_cur);
48987             printf("\n");
48988         }
48989     }
48990     }
48991     function_tests++;
48992 #endif
48993
48994     return(test_ret);
48995 }
48996
48997
48998 static int
48999 test_xmlXPathNextDescendantOrSelf(void) {
49000     int test_ret = 0;
49001
49002 #if defined(LIBXML_XPATH_ENABLED)
49003     int mem_base;
49004     xmlNodePtr ret_val;
49005     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49006     int n_ctxt;
49007     xmlNodePtr cur; /* the current node in the traversal */
49008     int n_cur;
49009
49010     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49011     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49012         mem_base = xmlMemBlocks();
49013         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49014         cur = gen_xmlNodePtr(n_cur, 1);
49015
49016         ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
49017         desret_xmlNodePtr(ret_val);
49018         call_tests++;
49019         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49020         des_xmlNodePtr(n_cur, cur, 1);
49021         xmlResetLastError();
49022         if (mem_base != xmlMemBlocks()) {
49023             printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
49024                    xmlMemBlocks() - mem_base);
49025             test_ret++;
49026             printf(" %d", n_ctxt);
49027             printf(" %d", n_cur);
49028             printf("\n");
49029         }
49030     }
49031     }
49032     function_tests++;
49033 #endif
49034
49035     return(test_ret);
49036 }
49037
49038
49039 static int
49040 test_xmlXPathNextFollowing(void) {
49041     int test_ret = 0;
49042
49043 #if defined(LIBXML_XPATH_ENABLED)
49044     int mem_base;
49045     xmlNodePtr ret_val;
49046     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49047     int n_ctxt;
49048     xmlNodePtr cur; /* the current node in the traversal */
49049     int n_cur;
49050
49051     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49052     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49053         mem_base = xmlMemBlocks();
49054         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49055         cur = gen_xmlNodePtr(n_cur, 1);
49056
49057         ret_val = xmlXPathNextFollowing(ctxt, cur);
49058         desret_xmlNodePtr(ret_val);
49059         call_tests++;
49060         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49061         des_xmlNodePtr(n_cur, cur, 1);
49062         xmlResetLastError();
49063         if (mem_base != xmlMemBlocks()) {
49064             printf("Leak of %d blocks found in xmlXPathNextFollowing",
49065                    xmlMemBlocks() - mem_base);
49066             test_ret++;
49067             printf(" %d", n_ctxt);
49068             printf(" %d", n_cur);
49069             printf("\n");
49070         }
49071     }
49072     }
49073     function_tests++;
49074 #endif
49075
49076     return(test_ret);
49077 }
49078
49079
49080 static int
49081 test_xmlXPathNextFollowingSibling(void) {
49082     int test_ret = 0;
49083
49084 #if defined(LIBXML_XPATH_ENABLED)
49085     int mem_base;
49086     xmlNodePtr ret_val;
49087     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49088     int n_ctxt;
49089     xmlNodePtr cur; /* the current node in the traversal */
49090     int n_cur;
49091
49092     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49093     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49094         mem_base = xmlMemBlocks();
49095         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49096         cur = gen_xmlNodePtr(n_cur, 1);
49097
49098         ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
49099         desret_xmlNodePtr(ret_val);
49100         call_tests++;
49101         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49102         des_xmlNodePtr(n_cur, cur, 1);
49103         xmlResetLastError();
49104         if (mem_base != xmlMemBlocks()) {
49105             printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
49106                    xmlMemBlocks() - mem_base);
49107             test_ret++;
49108             printf(" %d", n_ctxt);
49109             printf(" %d", n_cur);
49110             printf("\n");
49111         }
49112     }
49113     }
49114     function_tests++;
49115 #endif
49116
49117     return(test_ret);
49118 }
49119
49120
49121 static int
49122 test_xmlXPathNextNamespace(void) {
49123     int test_ret = 0;
49124
49125 #if defined(LIBXML_XPATH_ENABLED)
49126     int mem_base;
49127     xmlNodePtr ret_val;
49128     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49129     int n_ctxt;
49130     xmlNodePtr cur; /* the current attribute in the traversal */
49131     int n_cur;
49132
49133     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49134     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49135         mem_base = xmlMemBlocks();
49136         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49137         cur = gen_xmlNodePtr(n_cur, 1);
49138
49139         ret_val = xmlXPathNextNamespace(ctxt, cur);
49140         desret_xmlNodePtr(ret_val);
49141         call_tests++;
49142         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49143         des_xmlNodePtr(n_cur, cur, 1);
49144         xmlResetLastError();
49145         if (mem_base != xmlMemBlocks()) {
49146             printf("Leak of %d blocks found in xmlXPathNextNamespace",
49147                    xmlMemBlocks() - mem_base);
49148             test_ret++;
49149             printf(" %d", n_ctxt);
49150             printf(" %d", n_cur);
49151             printf("\n");
49152         }
49153     }
49154     }
49155     function_tests++;
49156 #endif
49157
49158     return(test_ret);
49159 }
49160
49161
49162 static int
49163 test_xmlXPathNextParent(void) {
49164     int test_ret = 0;
49165
49166 #if defined(LIBXML_XPATH_ENABLED)
49167     int mem_base;
49168     xmlNodePtr ret_val;
49169     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49170     int n_ctxt;
49171     xmlNodePtr cur; /* the current node in the traversal */
49172     int n_cur;
49173
49174     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49175     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49176         mem_base = xmlMemBlocks();
49177         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49178         cur = gen_xmlNodePtr(n_cur, 1);
49179
49180         ret_val = xmlXPathNextParent(ctxt, cur);
49181         desret_xmlNodePtr(ret_val);
49182         call_tests++;
49183         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49184         des_xmlNodePtr(n_cur, cur, 1);
49185         xmlResetLastError();
49186         if (mem_base != xmlMemBlocks()) {
49187             printf("Leak of %d blocks found in xmlXPathNextParent",
49188                    xmlMemBlocks() - mem_base);
49189             test_ret++;
49190             printf(" %d", n_ctxt);
49191             printf(" %d", n_cur);
49192             printf("\n");
49193         }
49194     }
49195     }
49196     function_tests++;
49197 #endif
49198
49199     return(test_ret);
49200 }
49201
49202
49203 static int
49204 test_xmlXPathNextPreceding(void) {
49205     int test_ret = 0;
49206
49207 #if defined(LIBXML_XPATH_ENABLED)
49208     int mem_base;
49209     xmlNodePtr ret_val;
49210     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49211     int n_ctxt;
49212     xmlNodePtr cur; /* the current node in the traversal */
49213     int n_cur;
49214
49215     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49216     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49217         mem_base = xmlMemBlocks();
49218         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49219         cur = gen_xmlNodePtr(n_cur, 1);
49220
49221         ret_val = xmlXPathNextPreceding(ctxt, cur);
49222         desret_xmlNodePtr(ret_val);
49223         call_tests++;
49224         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49225         des_xmlNodePtr(n_cur, cur, 1);
49226         xmlResetLastError();
49227         if (mem_base != xmlMemBlocks()) {
49228             printf("Leak of %d blocks found in xmlXPathNextPreceding",
49229                    xmlMemBlocks() - mem_base);
49230             test_ret++;
49231             printf(" %d", n_ctxt);
49232             printf(" %d", n_cur);
49233             printf("\n");
49234         }
49235     }
49236     }
49237     function_tests++;
49238 #endif
49239
49240     return(test_ret);
49241 }
49242
49243
49244 static int
49245 test_xmlXPathNextPrecedingSibling(void) {
49246     int test_ret = 0;
49247
49248 #if defined(LIBXML_XPATH_ENABLED)
49249     int mem_base;
49250     xmlNodePtr ret_val;
49251     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49252     int n_ctxt;
49253     xmlNodePtr cur; /* the current node in the traversal */
49254     int n_cur;
49255
49256     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49257     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49258         mem_base = xmlMemBlocks();
49259         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49260         cur = gen_xmlNodePtr(n_cur, 1);
49261
49262         ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
49263         desret_xmlNodePtr(ret_val);
49264         call_tests++;
49265         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49266         des_xmlNodePtr(n_cur, cur, 1);
49267         xmlResetLastError();
49268         if (mem_base != xmlMemBlocks()) {
49269             printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
49270                    xmlMemBlocks() - mem_base);
49271             test_ret++;
49272             printf(" %d", n_ctxt);
49273             printf(" %d", n_cur);
49274             printf("\n");
49275         }
49276     }
49277     }
49278     function_tests++;
49279 #endif
49280
49281     return(test_ret);
49282 }
49283
49284
49285 static int
49286 test_xmlXPathNextSelf(void) {
49287     int test_ret = 0;
49288
49289 #if defined(LIBXML_XPATH_ENABLED)
49290     int mem_base;
49291     xmlNodePtr ret_val;
49292     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49293     int n_ctxt;
49294     xmlNodePtr cur; /* the current node in the traversal */
49295     int n_cur;
49296
49297     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49298     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49299         mem_base = xmlMemBlocks();
49300         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49301         cur = gen_xmlNodePtr(n_cur, 1);
49302
49303         ret_val = xmlXPathNextSelf(ctxt, cur);
49304         desret_xmlNodePtr(ret_val);
49305         call_tests++;
49306         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49307         des_xmlNodePtr(n_cur, cur, 1);
49308         xmlResetLastError();
49309         if (mem_base != xmlMemBlocks()) {
49310             printf("Leak of %d blocks found in xmlXPathNextSelf",
49311                    xmlMemBlocks() - mem_base);
49312             test_ret++;
49313             printf(" %d", n_ctxt);
49314             printf(" %d", n_cur);
49315             printf("\n");
49316         }
49317     }
49318     }
49319     function_tests++;
49320 #endif
49321
49322     return(test_ret);
49323 }
49324
49325
49326 static int
49327 test_xmlXPathNodeLeading(void) {
49328     int test_ret = 0;
49329
49330 #if defined(LIBXML_XPATH_ENABLED)
49331     int mem_base;
49332     xmlNodeSetPtr ret_val;
49333     xmlNodeSetPtr nodes; /* a node-set */
49334     int n_nodes;
49335     xmlNodePtr node; /* a node */
49336     int n_node;
49337
49338     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49339     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49340         mem_base = xmlMemBlocks();
49341         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49342         node = gen_xmlNodePtr(n_node, 1);
49343
49344         ret_val = xmlXPathNodeLeading(nodes, node);
49345         desret_xmlNodeSetPtr(ret_val);
49346         call_tests++;
49347         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49348         des_xmlNodePtr(n_node, node, 1);
49349         xmlResetLastError();
49350         if (mem_base != xmlMemBlocks()) {
49351             printf("Leak of %d blocks found in xmlXPathNodeLeading",
49352                    xmlMemBlocks() - mem_base);
49353             test_ret++;
49354             printf(" %d", n_nodes);
49355             printf(" %d", n_node);
49356             printf("\n");
49357         }
49358     }
49359     }
49360     function_tests++;
49361 #endif
49362
49363     return(test_ret);
49364 }
49365
49366
49367 static int
49368 test_xmlXPathNodeLeadingSorted(void) {
49369     int test_ret = 0;
49370
49371 #if defined(LIBXML_XPATH_ENABLED)
49372     int mem_base;
49373     xmlNodeSetPtr ret_val;
49374     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49375     int n_nodes;
49376     xmlNodePtr node; /* a node */
49377     int n_node;
49378
49379     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49380     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49381         mem_base = xmlMemBlocks();
49382         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49383         node = gen_xmlNodePtr(n_node, 1);
49384
49385         ret_val = xmlXPathNodeLeadingSorted(nodes, node);
49386         desret_xmlNodeSetPtr(ret_val);
49387         call_tests++;
49388         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49389         des_xmlNodePtr(n_node, node, 1);
49390         xmlResetLastError();
49391         if (mem_base != xmlMemBlocks()) {
49392             printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
49393                    xmlMemBlocks() - mem_base);
49394             test_ret++;
49395             printf(" %d", n_nodes);
49396             printf(" %d", n_node);
49397             printf("\n");
49398         }
49399     }
49400     }
49401     function_tests++;
49402 #endif
49403
49404     return(test_ret);
49405 }
49406
49407
49408 static int
49409 test_xmlXPathNodeSetAdd(void) {
49410     int test_ret = 0;
49411
49412 #if defined(LIBXML_XPATH_ENABLED)
49413     int mem_base;
49414     int ret_val;
49415     xmlNodeSetPtr cur; /* the initial node set */
49416     int n_cur;
49417     xmlNodePtr val; /* a new xmlNodePtr */
49418     int n_val;
49419
49420     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49421     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49422         mem_base = xmlMemBlocks();
49423         cur = gen_xmlNodeSetPtr(n_cur, 0);
49424         val = gen_xmlNodePtr(n_val, 1);
49425
49426         ret_val = xmlXPathNodeSetAdd(cur, val);
49427         desret_int(ret_val);
49428         call_tests++;
49429         des_xmlNodeSetPtr(n_cur, cur, 0);
49430         des_xmlNodePtr(n_val, val, 1);
49431         xmlResetLastError();
49432         if (mem_base != xmlMemBlocks()) {
49433             printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
49434                    xmlMemBlocks() - mem_base);
49435             test_ret++;
49436             printf(" %d", n_cur);
49437             printf(" %d", n_val);
49438             printf("\n");
49439         }
49440     }
49441     }
49442     function_tests++;
49443 #endif
49444
49445     return(test_ret);
49446 }
49447
49448
49449 static int
49450 test_xmlXPathNodeSetAddNs(void) {
49451     int test_ret = 0;
49452
49453 #if defined(LIBXML_XPATH_ENABLED)
49454     int mem_base;
49455     int ret_val;
49456     xmlNodeSetPtr cur; /* the initial node set */
49457     int n_cur;
49458     xmlNodePtr node; /* the hosting node */
49459     int n_node;
49460     xmlNsPtr ns; /* a the namespace node */
49461     int n_ns;
49462
49463     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49464     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49465     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
49466         mem_base = xmlMemBlocks();
49467         cur = gen_xmlNodeSetPtr(n_cur, 0);
49468         node = gen_xmlNodePtr(n_node, 1);
49469         ns = gen_xmlNsPtr(n_ns, 2);
49470
49471         ret_val = xmlXPathNodeSetAddNs(cur, node, ns);
49472         desret_int(ret_val);
49473         call_tests++;
49474         des_xmlNodeSetPtr(n_cur, cur, 0);
49475         des_xmlNodePtr(n_node, node, 1);
49476         des_xmlNsPtr(n_ns, ns, 2);
49477         xmlResetLastError();
49478         if (mem_base != xmlMemBlocks()) {
49479             printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
49480                    xmlMemBlocks() - mem_base);
49481             test_ret++;
49482             printf(" %d", n_cur);
49483             printf(" %d", n_node);
49484             printf(" %d", n_ns);
49485             printf("\n");
49486         }
49487     }
49488     }
49489     }
49490     function_tests++;
49491 #endif
49492
49493     return(test_ret);
49494 }
49495
49496
49497 static int
49498 test_xmlXPathNodeSetAddUnique(void) {
49499     int test_ret = 0;
49500
49501 #if defined(LIBXML_XPATH_ENABLED)
49502     int mem_base;
49503     int ret_val;
49504     xmlNodeSetPtr cur; /* the initial node set */
49505     int n_cur;
49506     xmlNodePtr val; /* a new xmlNodePtr */
49507     int n_val;
49508
49509     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49510     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49511         mem_base = xmlMemBlocks();
49512         cur = gen_xmlNodeSetPtr(n_cur, 0);
49513         val = gen_xmlNodePtr(n_val, 1);
49514
49515         ret_val = xmlXPathNodeSetAddUnique(cur, val);
49516         desret_int(ret_val);
49517         call_tests++;
49518         des_xmlNodeSetPtr(n_cur, cur, 0);
49519         des_xmlNodePtr(n_val, val, 1);
49520         xmlResetLastError();
49521         if (mem_base != xmlMemBlocks()) {
49522             printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
49523                    xmlMemBlocks() - mem_base);
49524             test_ret++;
49525             printf(" %d", n_cur);
49526             printf(" %d", n_val);
49527             printf("\n");
49528         }
49529     }
49530     }
49531     function_tests++;
49532 #endif
49533
49534     return(test_ret);
49535 }
49536
49537
49538 static int
49539 test_xmlXPathNodeSetContains(void) {
49540     int test_ret = 0;
49541
49542 #if defined(LIBXML_XPATH_ENABLED)
49543     int mem_base;
49544     int ret_val;
49545     xmlNodeSetPtr cur; /* the node-set */
49546     int n_cur;
49547     xmlNodePtr val; /* the node */
49548     int n_val;
49549
49550     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49551     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49552         mem_base = xmlMemBlocks();
49553         cur = gen_xmlNodeSetPtr(n_cur, 0);
49554         val = gen_xmlNodePtr(n_val, 1);
49555
49556         ret_val = xmlXPathNodeSetContains(cur, val);
49557         desret_int(ret_val);
49558         call_tests++;
49559         des_xmlNodeSetPtr(n_cur, cur, 0);
49560         des_xmlNodePtr(n_val, val, 1);
49561         xmlResetLastError();
49562         if (mem_base != xmlMemBlocks()) {
49563             printf("Leak of %d blocks found in xmlXPathNodeSetContains",
49564                    xmlMemBlocks() - mem_base);
49565             test_ret++;
49566             printf(" %d", n_cur);
49567             printf(" %d", n_val);
49568             printf("\n");
49569         }
49570     }
49571     }
49572     function_tests++;
49573 #endif
49574
49575     return(test_ret);
49576 }
49577
49578
49579 static int
49580 test_xmlXPathNodeSetDel(void) {
49581     int test_ret = 0;
49582
49583 #if defined(LIBXML_XPATH_ENABLED)
49584     int mem_base;
49585     xmlNodeSetPtr cur; /* the initial node set */
49586     int n_cur;
49587     xmlNodePtr val; /* an xmlNodePtr */
49588     int n_val;
49589
49590     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49591     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49592         mem_base = xmlMemBlocks();
49593         cur = gen_xmlNodeSetPtr(n_cur, 0);
49594         val = gen_xmlNodePtr(n_val, 1);
49595
49596         xmlXPathNodeSetDel(cur, val);
49597         call_tests++;
49598         des_xmlNodeSetPtr(n_cur, cur, 0);
49599         des_xmlNodePtr(n_val, val, 1);
49600         xmlResetLastError();
49601         if (mem_base != xmlMemBlocks()) {
49602             printf("Leak of %d blocks found in xmlXPathNodeSetDel",
49603                    xmlMemBlocks() - mem_base);
49604             test_ret++;
49605             printf(" %d", n_cur);
49606             printf(" %d", n_val);
49607             printf("\n");
49608         }
49609     }
49610     }
49611     function_tests++;
49612 #endif
49613
49614     return(test_ret);
49615 }
49616
49617
49618 static int
49619 test_xmlXPathNodeSetMerge(void) {
49620     int test_ret = 0;
49621
49622 #if defined(LIBXML_XPATH_ENABLED)
49623     int mem_base;
49624     xmlNodeSetPtr ret_val;
49625     xmlNodeSetPtr val1; /* the first NodeSet or NULL */
49626     int n_val1;
49627     xmlNodeSetPtr val2; /* the second NodeSet */
49628     int n_val2;
49629
49630     for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
49631     for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
49632         mem_base = xmlMemBlocks();
49633         val1 = gen_xmlNodeSetPtr(n_val1, 0);
49634         val2 = gen_xmlNodeSetPtr(n_val2, 1);
49635
49636         ret_val = xmlXPathNodeSetMerge(val1, val2);
49637         desret_xmlNodeSetPtr(ret_val);
49638         call_tests++;
49639         des_xmlNodeSetPtr(n_val1, val1, 0);
49640         des_xmlNodeSetPtr(n_val2, val2, 1);
49641         xmlResetLastError();
49642         if (mem_base != xmlMemBlocks()) {
49643             printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
49644                    xmlMemBlocks() - mem_base);
49645             test_ret++;
49646             printf(" %d", n_val1);
49647             printf(" %d", n_val2);
49648             printf("\n");
49649         }
49650     }
49651     }
49652     function_tests++;
49653 #endif
49654
49655     return(test_ret);
49656 }
49657
49658
49659 static int
49660 test_xmlXPathNodeSetRemove(void) {
49661     int test_ret = 0;
49662
49663 #if defined(LIBXML_XPATH_ENABLED)
49664     int mem_base;
49665     xmlNodeSetPtr cur; /* the initial node set */
49666     int n_cur;
49667     int val; /* the index to remove */
49668     int n_val;
49669
49670     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49671     for (n_val = 0;n_val < gen_nb_int;n_val++) {
49672         mem_base = xmlMemBlocks();
49673         cur = gen_xmlNodeSetPtr(n_cur, 0);
49674         val = gen_int(n_val, 1);
49675
49676         xmlXPathNodeSetRemove(cur, val);
49677         call_tests++;
49678         des_xmlNodeSetPtr(n_cur, cur, 0);
49679         des_int(n_val, val, 1);
49680         xmlResetLastError();
49681         if (mem_base != xmlMemBlocks()) {
49682             printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
49683                    xmlMemBlocks() - mem_base);
49684             test_ret++;
49685             printf(" %d", n_cur);
49686             printf(" %d", n_val);
49687             printf("\n");
49688         }
49689     }
49690     }
49691     function_tests++;
49692 #endif
49693
49694     return(test_ret);
49695 }
49696
49697
49698 static int
49699 test_xmlXPathNodeSetSort(void) {
49700     int test_ret = 0;
49701
49702 #if defined(LIBXML_XPATH_ENABLED)
49703     int mem_base;
49704     xmlNodeSetPtr set; /* the node set */
49705     int n_set;
49706
49707     for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
49708         mem_base = xmlMemBlocks();
49709         set = gen_xmlNodeSetPtr(n_set, 0);
49710
49711         xmlXPathNodeSetSort(set);
49712         call_tests++;
49713         des_xmlNodeSetPtr(n_set, set, 0);
49714         xmlResetLastError();
49715         if (mem_base != xmlMemBlocks()) {
49716             printf("Leak of %d blocks found in xmlXPathNodeSetSort",
49717                    xmlMemBlocks() - mem_base);
49718             test_ret++;
49719             printf(" %d", n_set);
49720             printf("\n");
49721         }
49722     }
49723     function_tests++;
49724 #endif
49725
49726     return(test_ret);
49727 }
49728
49729
49730 static int
49731 test_xmlXPathNodeTrailing(void) {
49732     int test_ret = 0;
49733
49734 #if defined(LIBXML_XPATH_ENABLED)
49735     int mem_base;
49736     xmlNodeSetPtr ret_val;
49737     xmlNodeSetPtr nodes; /* a node-set */
49738     int n_nodes;
49739     xmlNodePtr node; /* a node */
49740     int n_node;
49741
49742     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49743     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49744         mem_base = xmlMemBlocks();
49745         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49746         node = gen_xmlNodePtr(n_node, 1);
49747
49748         ret_val = xmlXPathNodeTrailing(nodes, node);
49749         desret_xmlNodeSetPtr(ret_val);
49750         call_tests++;
49751         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49752         des_xmlNodePtr(n_node, node, 1);
49753         xmlResetLastError();
49754         if (mem_base != xmlMemBlocks()) {
49755             printf("Leak of %d blocks found in xmlXPathNodeTrailing",
49756                    xmlMemBlocks() - mem_base);
49757             test_ret++;
49758             printf(" %d", n_nodes);
49759             printf(" %d", n_node);
49760             printf("\n");
49761         }
49762     }
49763     }
49764     function_tests++;
49765 #endif
49766
49767     return(test_ret);
49768 }
49769
49770
49771 static int
49772 test_xmlXPathNodeTrailingSorted(void) {
49773     int test_ret = 0;
49774
49775 #if defined(LIBXML_XPATH_ENABLED)
49776     int mem_base;
49777     xmlNodeSetPtr ret_val;
49778     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49779     int n_nodes;
49780     xmlNodePtr node; /* a node */
49781     int n_node;
49782
49783     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49784     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49785         mem_base = xmlMemBlocks();
49786         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49787         node = gen_xmlNodePtr(n_node, 1);
49788
49789         ret_val = xmlXPathNodeTrailingSorted(nodes, node);
49790         desret_xmlNodeSetPtr(ret_val);
49791         call_tests++;
49792         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49793         des_xmlNodePtr(n_node, node, 1);
49794         xmlResetLastError();
49795         if (mem_base != xmlMemBlocks()) {
49796             printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
49797                    xmlMemBlocks() - mem_base);
49798             test_ret++;
49799             printf(" %d", n_nodes);
49800             printf(" %d", n_node);
49801             printf("\n");
49802         }
49803     }
49804     }
49805     function_tests++;
49806 #endif
49807
49808     return(test_ret);
49809 }
49810
49811
49812 static int
49813 test_xmlXPathNormalizeFunction(void) {
49814     int test_ret = 0;
49815
49816 #if defined(LIBXML_XPATH_ENABLED)
49817     int mem_base;
49818     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49819     int n_ctxt;
49820     int nargs; /* the number of arguments */
49821     int n_nargs;
49822
49823     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49824     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49825         mem_base = xmlMemBlocks();
49826         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49827         nargs = gen_int(n_nargs, 1);
49828
49829         xmlXPathNormalizeFunction(ctxt, nargs);
49830         call_tests++;
49831         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49832         des_int(n_nargs, nargs, 1);
49833         xmlResetLastError();
49834         if (mem_base != xmlMemBlocks()) {
49835             printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
49836                    xmlMemBlocks() - mem_base);
49837             test_ret++;
49838             printf(" %d", n_ctxt);
49839             printf(" %d", n_nargs);
49840             printf("\n");
49841         }
49842     }
49843     }
49844     function_tests++;
49845 #endif
49846
49847     return(test_ret);
49848 }
49849
49850
49851 static int
49852 test_xmlXPathNotEqualValues(void) {
49853     int test_ret = 0;
49854
49855 #if defined(LIBXML_XPATH_ENABLED)
49856     int mem_base;
49857     int ret_val;
49858     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49859     int n_ctxt;
49860
49861     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49862         mem_base = xmlMemBlocks();
49863         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49864
49865         ret_val = xmlXPathNotEqualValues(ctxt);
49866         desret_int(ret_val);
49867         call_tests++;
49868         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49869         xmlResetLastError();
49870         if (mem_base != xmlMemBlocks()) {
49871             printf("Leak of %d blocks found in xmlXPathNotEqualValues",
49872                    xmlMemBlocks() - mem_base);
49873             test_ret++;
49874             printf(" %d", n_ctxt);
49875             printf("\n");
49876         }
49877     }
49878     function_tests++;
49879 #endif
49880
49881     return(test_ret);
49882 }
49883
49884
49885 static int
49886 test_xmlXPathNotFunction(void) {
49887     int test_ret = 0;
49888
49889 #if defined(LIBXML_XPATH_ENABLED)
49890     int mem_base;
49891     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49892     int n_ctxt;
49893     int nargs; /* the number of arguments */
49894     int n_nargs;
49895
49896     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49897     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49898         mem_base = xmlMemBlocks();
49899         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49900         nargs = gen_int(n_nargs, 1);
49901
49902         xmlXPathNotFunction(ctxt, nargs);
49903         call_tests++;
49904         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49905         des_int(n_nargs, nargs, 1);
49906         xmlResetLastError();
49907         if (mem_base != xmlMemBlocks()) {
49908             printf("Leak of %d blocks found in xmlXPathNotFunction",
49909                    xmlMemBlocks() - mem_base);
49910             test_ret++;
49911             printf(" %d", n_ctxt);
49912             printf(" %d", n_nargs);
49913             printf("\n");
49914         }
49915     }
49916     }
49917     function_tests++;
49918 #endif
49919
49920     return(test_ret);
49921 }
49922
49923
49924 static int
49925 test_xmlXPathNsLookup(void) {
49926     int test_ret = 0;
49927
49928 #if defined(LIBXML_XPATH_ENABLED)
49929     int mem_base;
49930     const xmlChar * ret_val;
49931     xmlXPathContextPtr ctxt; /* the XPath context */
49932     int n_ctxt;
49933     xmlChar * prefix; /* the namespace prefix value */
49934     int n_prefix;
49935
49936     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49937     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49938         mem_base = xmlMemBlocks();
49939         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49940         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49941
49942         ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
49943         desret_const_xmlChar_ptr(ret_val);
49944         call_tests++;
49945         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49946         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49947         xmlResetLastError();
49948         if (mem_base != xmlMemBlocks()) {
49949             printf("Leak of %d blocks found in xmlXPathNsLookup",
49950                    xmlMemBlocks() - mem_base);
49951             test_ret++;
49952             printf(" %d", n_ctxt);
49953             printf(" %d", n_prefix);
49954             printf("\n");
49955         }
49956     }
49957     }
49958     function_tests++;
49959 #endif
49960
49961     return(test_ret);
49962 }
49963
49964
49965 static int
49966 test_xmlXPathNumberFunction(void) {
49967     int test_ret = 0;
49968
49969 #if defined(LIBXML_XPATH_ENABLED)
49970     int mem_base;
49971     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49972     int n_ctxt;
49973     int nargs; /* the number of arguments */
49974     int n_nargs;
49975
49976     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49977     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49978         mem_base = xmlMemBlocks();
49979         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49980         nargs = gen_int(n_nargs, 1);
49981
49982         xmlXPathNumberFunction(ctxt, nargs);
49983         call_tests++;
49984         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49985         des_int(n_nargs, nargs, 1);
49986         xmlResetLastError();
49987         if (mem_base != xmlMemBlocks()) {
49988             printf("Leak of %d blocks found in xmlXPathNumberFunction",
49989                    xmlMemBlocks() - mem_base);
49990             test_ret++;
49991             printf(" %d", n_ctxt);
49992             printf(" %d", n_nargs);
49993             printf("\n");
49994         }
49995     }
49996     }
49997     function_tests++;
49998 #endif
49999
50000     return(test_ret);
50001 }
50002
50003
50004 static int
50005 test_xmlXPathParseNCName(void) {
50006     int test_ret = 0;
50007
50008 #if defined(LIBXML_XPATH_ENABLED)
50009     int mem_base;
50010     xmlChar * ret_val;
50011     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50012     int n_ctxt;
50013
50014     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50015         mem_base = xmlMemBlocks();
50016         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50017
50018         ret_val = xmlXPathParseNCName(ctxt);
50019         desret_xmlChar_ptr(ret_val);
50020         call_tests++;
50021         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50022         xmlResetLastError();
50023         if (mem_base != xmlMemBlocks()) {
50024             printf("Leak of %d blocks found in xmlXPathParseNCName",
50025                    xmlMemBlocks() - mem_base);
50026             test_ret++;
50027             printf(" %d", n_ctxt);
50028             printf("\n");
50029         }
50030     }
50031     function_tests++;
50032 #endif
50033
50034     return(test_ret);
50035 }
50036
50037
50038 static int
50039 test_xmlXPathParseName(void) {
50040     int test_ret = 0;
50041
50042 #if defined(LIBXML_XPATH_ENABLED)
50043     int mem_base;
50044     xmlChar * ret_val;
50045     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50046     int n_ctxt;
50047
50048     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50049         mem_base = xmlMemBlocks();
50050         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50051
50052         ret_val = xmlXPathParseName(ctxt);
50053         desret_xmlChar_ptr(ret_val);
50054         call_tests++;
50055         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50056         xmlResetLastError();
50057         if (mem_base != xmlMemBlocks()) {
50058             printf("Leak of %d blocks found in xmlXPathParseName",
50059                    xmlMemBlocks() - mem_base);
50060             test_ret++;
50061             printf(" %d", n_ctxt);
50062             printf("\n");
50063         }
50064     }
50065     function_tests++;
50066 #endif
50067
50068     return(test_ret);
50069 }
50070
50071
50072 static int
50073 test_xmlXPathPopBoolean(void) {
50074     int test_ret = 0;
50075
50076 #if defined(LIBXML_XPATH_ENABLED)
50077     int mem_base;
50078     int ret_val;
50079     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50080     int n_ctxt;
50081
50082     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50083         mem_base = xmlMemBlocks();
50084         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50085
50086         ret_val = xmlXPathPopBoolean(ctxt);
50087         desret_int(ret_val);
50088         call_tests++;
50089         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50090         xmlResetLastError();
50091         if (mem_base != xmlMemBlocks()) {
50092             printf("Leak of %d blocks found in xmlXPathPopBoolean",
50093                    xmlMemBlocks() - mem_base);
50094             test_ret++;
50095             printf(" %d", n_ctxt);
50096             printf("\n");
50097         }
50098     }
50099     function_tests++;
50100 #endif
50101
50102     return(test_ret);
50103 }
50104
50105
50106 static int
50107 test_xmlXPathPopExternal(void) {
50108     int test_ret = 0;
50109
50110 #if defined(LIBXML_XPATH_ENABLED)
50111     int mem_base;
50112     void * ret_val;
50113     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50114     int n_ctxt;
50115
50116     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50117         mem_base = xmlMemBlocks();
50118         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50119
50120         ret_val = xmlXPathPopExternal(ctxt);
50121         desret_void_ptr(ret_val);
50122         call_tests++;
50123         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50124         xmlResetLastError();
50125         if (mem_base != xmlMemBlocks()) {
50126             printf("Leak of %d blocks found in xmlXPathPopExternal",
50127                    xmlMemBlocks() - mem_base);
50128             test_ret++;
50129             printf(" %d", n_ctxt);
50130             printf("\n");
50131         }
50132     }
50133     function_tests++;
50134 #endif
50135
50136     return(test_ret);
50137 }
50138
50139
50140 static int
50141 test_xmlXPathPopNodeSet(void) {
50142     int test_ret = 0;
50143
50144 #if defined(LIBXML_XPATH_ENABLED)
50145     int mem_base;
50146     xmlNodeSetPtr ret_val;
50147     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50148     int n_ctxt;
50149
50150     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50151         mem_base = xmlMemBlocks();
50152         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50153
50154         ret_val = xmlXPathPopNodeSet(ctxt);
50155         desret_xmlNodeSetPtr(ret_val);
50156         call_tests++;
50157         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50158         xmlResetLastError();
50159         if (mem_base != xmlMemBlocks()) {
50160             printf("Leak of %d blocks found in xmlXPathPopNodeSet",
50161                    xmlMemBlocks() - mem_base);
50162             test_ret++;
50163             printf(" %d", n_ctxt);
50164             printf("\n");
50165         }
50166     }
50167     function_tests++;
50168 #endif
50169
50170     return(test_ret);
50171 }
50172
50173
50174 static int
50175 test_xmlXPathPopNumber(void) {
50176     int test_ret = 0;
50177
50178 #if defined(LIBXML_XPATH_ENABLED)
50179     int mem_base;
50180     double ret_val;
50181     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50182     int n_ctxt;
50183
50184     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50185         mem_base = xmlMemBlocks();
50186         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50187
50188         ret_val = xmlXPathPopNumber(ctxt);
50189         desret_double(ret_val);
50190         call_tests++;
50191         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50192         xmlResetLastError();
50193         if (mem_base != xmlMemBlocks()) {
50194             printf("Leak of %d blocks found in xmlXPathPopNumber",
50195                    xmlMemBlocks() - mem_base);
50196             test_ret++;
50197             printf(" %d", n_ctxt);
50198             printf("\n");
50199         }
50200     }
50201     function_tests++;
50202 #endif
50203
50204     return(test_ret);
50205 }
50206
50207
50208 static int
50209 test_xmlXPathPopString(void) {
50210     int test_ret = 0;
50211
50212 #if defined(LIBXML_XPATH_ENABLED)
50213     int mem_base;
50214     xmlChar * ret_val;
50215     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50216     int n_ctxt;
50217
50218     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50219         mem_base = xmlMemBlocks();
50220         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50221
50222         ret_val = xmlXPathPopString(ctxt);
50223         desret_xmlChar_ptr(ret_val);
50224         call_tests++;
50225         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50226         xmlResetLastError();
50227         if (mem_base != xmlMemBlocks()) {
50228             printf("Leak of %d blocks found in xmlXPathPopString",
50229                    xmlMemBlocks() - mem_base);
50230             test_ret++;
50231             printf(" %d", n_ctxt);
50232             printf("\n");
50233         }
50234     }
50235     function_tests++;
50236 #endif
50237
50238     return(test_ret);
50239 }
50240
50241
50242 static int
50243 test_xmlXPathPositionFunction(void) {
50244     int test_ret = 0;
50245
50246 #if defined(LIBXML_XPATH_ENABLED)
50247     int mem_base;
50248     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50249     int n_ctxt;
50250     int nargs; /* the number of arguments */
50251     int n_nargs;
50252
50253     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50254     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50255         mem_base = xmlMemBlocks();
50256         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50257         nargs = gen_int(n_nargs, 1);
50258
50259         xmlXPathPositionFunction(ctxt, nargs);
50260         call_tests++;
50261         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50262         des_int(n_nargs, nargs, 1);
50263         xmlResetLastError();
50264         if (mem_base != xmlMemBlocks()) {
50265             printf("Leak of %d blocks found in xmlXPathPositionFunction",
50266                    xmlMemBlocks() - mem_base);
50267             test_ret++;
50268             printf(" %d", n_ctxt);
50269             printf(" %d", n_nargs);
50270             printf("\n");
50271         }
50272     }
50273     }
50274     function_tests++;
50275 #endif
50276
50277     return(test_ret);
50278 }
50279
50280
50281 static int
50282 test_xmlXPathRegisterAllFunctions(void) {
50283     int test_ret = 0;
50284
50285 #if defined(LIBXML_XPATH_ENABLED)
50286     int mem_base;
50287     xmlXPathContextPtr ctxt; /* the XPath context */
50288     int n_ctxt;
50289
50290     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50291         mem_base = xmlMemBlocks();
50292         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50293
50294         xmlXPathRegisterAllFunctions(ctxt);
50295         call_tests++;
50296         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50297         xmlResetLastError();
50298         if (mem_base != xmlMemBlocks()) {
50299             printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
50300                    xmlMemBlocks() - mem_base);
50301             test_ret++;
50302             printf(" %d", n_ctxt);
50303             printf("\n");
50304         }
50305     }
50306     function_tests++;
50307 #endif
50308
50309     return(test_ret);
50310 }
50311
50312
50313 static int
50314 test_xmlXPathRegisterFunc(void) {
50315     int test_ret = 0;
50316
50317
50318     /* missing type support */
50319     return(test_ret);
50320 }
50321
50322
50323 static int
50324 test_xmlXPathRegisterFuncLookup(void) {
50325     int test_ret = 0;
50326
50327
50328     /* missing type support */
50329     return(test_ret);
50330 }
50331
50332
50333 static int
50334 test_xmlXPathRegisterFuncNS(void) {
50335     int test_ret = 0;
50336
50337
50338     /* missing type support */
50339     return(test_ret);
50340 }
50341
50342
50343 static int
50344 test_xmlXPathRegisterNs(void) {
50345     int test_ret = 0;
50346
50347 #if defined(LIBXML_XPATH_ENABLED)
50348     int mem_base;
50349     int ret_val;
50350     xmlXPathContextPtr ctxt; /* the XPath context */
50351     int n_ctxt;
50352     xmlChar * prefix; /* the namespace prefix cannot be NULL or empty string */
50353     int n_prefix;
50354     xmlChar * ns_uri; /* the namespace name */
50355     int n_ns_uri;
50356
50357     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50358     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
50359     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50360         mem_base = xmlMemBlocks();
50361         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50362         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
50363         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50364
50365         ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
50366         desret_int(ret_val);
50367         call_tests++;
50368         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50369         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
50370         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50371         xmlResetLastError();
50372         if (mem_base != xmlMemBlocks()) {
50373             printf("Leak of %d blocks found in xmlXPathRegisterNs",
50374                    xmlMemBlocks() - mem_base);
50375             test_ret++;
50376             printf(" %d", n_ctxt);
50377             printf(" %d", n_prefix);
50378             printf(" %d", n_ns_uri);
50379             printf("\n");
50380         }
50381     }
50382     }
50383     }
50384     function_tests++;
50385 #endif
50386
50387     return(test_ret);
50388 }
50389
50390
50391 static int
50392 test_xmlXPathRegisterVariable(void) {
50393     int test_ret = 0;
50394
50395 #if defined(LIBXML_XPATH_ENABLED)
50396     int mem_base;
50397     int ret_val;
50398     xmlXPathContextPtr ctxt; /* the XPath context */
50399     int n_ctxt;
50400     xmlChar * name; /* the variable name */
50401     int n_name;
50402     xmlXPathObjectPtr value; /* the variable value or NULL */
50403     int n_value;
50404
50405     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50406     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50407     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
50408         mem_base = xmlMemBlocks();
50409         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50410         name = gen_const_xmlChar_ptr(n_name, 1);
50411         value = gen_xmlXPathObjectPtr(n_value, 2);
50412
50413         ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
50414         desret_int(ret_val);
50415         call_tests++;
50416         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50417         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50418         des_xmlXPathObjectPtr(n_value, value, 2);
50419         xmlResetLastError();
50420         if (mem_base != xmlMemBlocks()) {
50421             printf("Leak of %d blocks found in xmlXPathRegisterVariable",
50422                    xmlMemBlocks() - mem_base);
50423             test_ret++;
50424             printf(" %d", n_ctxt);
50425             printf(" %d", n_name);
50426             printf(" %d", n_value);
50427             printf("\n");
50428         }
50429     }
50430     }
50431     }
50432     function_tests++;
50433 #endif
50434
50435     return(test_ret);
50436 }
50437
50438
50439 static int
50440 test_xmlXPathRegisterVariableLookup(void) {
50441     int test_ret = 0;
50442
50443
50444     /* missing type support */
50445     return(test_ret);
50446 }
50447
50448
50449 static int
50450 test_xmlXPathRegisterVariableNS(void) {
50451     int test_ret = 0;
50452
50453 #if defined(LIBXML_XPATH_ENABLED)
50454     int mem_base;
50455     int ret_val;
50456     xmlXPathContextPtr ctxt; /* the XPath context */
50457     int n_ctxt;
50458     xmlChar * name; /* the variable name */
50459     int n_name;
50460     xmlChar * ns_uri; /* the variable namespace URI */
50461     int n_ns_uri;
50462     xmlXPathObjectPtr value; /* the variable value or NULL */
50463     int n_value;
50464
50465     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50466     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50467     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50468     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
50469         mem_base = xmlMemBlocks();
50470         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50471         name = gen_const_xmlChar_ptr(n_name, 1);
50472         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50473         value = gen_xmlXPathObjectPtr(n_value, 3);
50474
50475         ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
50476         desret_int(ret_val);
50477         call_tests++;
50478         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50479         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50480         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50481         des_xmlXPathObjectPtr(n_value, value, 3);
50482         xmlResetLastError();
50483         if (mem_base != xmlMemBlocks()) {
50484             printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
50485                    xmlMemBlocks() - mem_base);
50486             test_ret++;
50487             printf(" %d", n_ctxt);
50488             printf(" %d", n_name);
50489             printf(" %d", n_ns_uri);
50490             printf(" %d", n_value);
50491             printf("\n");
50492         }
50493     }
50494     }
50495     }
50496     }
50497     function_tests++;
50498 #endif
50499
50500     return(test_ret);
50501 }
50502
50503
50504 static int
50505 test_xmlXPathRegisteredFuncsCleanup(void) {
50506     int test_ret = 0;
50507
50508 #if defined(LIBXML_XPATH_ENABLED)
50509     int mem_base;
50510     xmlXPathContextPtr ctxt; /* the XPath context */
50511     int n_ctxt;
50512
50513     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50514         mem_base = xmlMemBlocks();
50515         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50516
50517         xmlXPathRegisteredFuncsCleanup(ctxt);
50518         call_tests++;
50519         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50520         xmlResetLastError();
50521         if (mem_base != xmlMemBlocks()) {
50522             printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
50523                    xmlMemBlocks() - mem_base);
50524             test_ret++;
50525             printf(" %d", n_ctxt);
50526             printf("\n");
50527         }
50528     }
50529     function_tests++;
50530 #endif
50531
50532     return(test_ret);
50533 }
50534
50535
50536 static int
50537 test_xmlXPathRegisteredNsCleanup(void) {
50538     int test_ret = 0;
50539
50540 #if defined(LIBXML_XPATH_ENABLED)
50541     int mem_base;
50542     xmlXPathContextPtr ctxt; /* the XPath context */
50543     int n_ctxt;
50544
50545     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50546         mem_base = xmlMemBlocks();
50547         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50548
50549         xmlXPathRegisteredNsCleanup(ctxt);
50550         call_tests++;
50551         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50552         xmlResetLastError();
50553         if (mem_base != xmlMemBlocks()) {
50554             printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
50555                    xmlMemBlocks() - mem_base);
50556             test_ret++;
50557             printf(" %d", n_ctxt);
50558             printf("\n");
50559         }
50560     }
50561     function_tests++;
50562 #endif
50563
50564     return(test_ret);
50565 }
50566
50567
50568 static int
50569 test_xmlXPathRegisteredVariablesCleanup(void) {
50570     int test_ret = 0;
50571
50572 #if defined(LIBXML_XPATH_ENABLED)
50573     int mem_base;
50574     xmlXPathContextPtr ctxt; /* the XPath context */
50575     int n_ctxt;
50576
50577     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50578         mem_base = xmlMemBlocks();
50579         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50580
50581         xmlXPathRegisteredVariablesCleanup(ctxt);
50582         call_tests++;
50583         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50584         xmlResetLastError();
50585         if (mem_base != xmlMemBlocks()) {
50586             printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
50587                    xmlMemBlocks() - mem_base);
50588             test_ret++;
50589             printf(" %d", n_ctxt);
50590             printf("\n");
50591         }
50592     }
50593     function_tests++;
50594 #endif
50595
50596     return(test_ret);
50597 }
50598
50599
50600 static int
50601 test_xmlXPathRoot(void) {
50602     int test_ret = 0;
50603
50604 #if defined(LIBXML_XPATH_ENABLED)
50605     int mem_base;
50606     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50607     int n_ctxt;
50608
50609     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50610         mem_base = xmlMemBlocks();
50611         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50612
50613         xmlXPathRoot(ctxt);
50614         call_tests++;
50615         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50616         xmlResetLastError();
50617         if (mem_base != xmlMemBlocks()) {
50618             printf("Leak of %d blocks found in xmlXPathRoot",
50619                    xmlMemBlocks() - mem_base);
50620             test_ret++;
50621             printf(" %d", n_ctxt);
50622             printf("\n");
50623         }
50624     }
50625     function_tests++;
50626 #endif
50627
50628     return(test_ret);
50629 }
50630
50631
50632 static int
50633 test_xmlXPathRoundFunction(void) {
50634     int test_ret = 0;
50635
50636 #if defined(LIBXML_XPATH_ENABLED)
50637     int mem_base;
50638     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50639     int n_ctxt;
50640     int nargs; /* the number of arguments */
50641     int n_nargs;
50642
50643     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50644     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50645         mem_base = xmlMemBlocks();
50646         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50647         nargs = gen_int(n_nargs, 1);
50648
50649         xmlXPathRoundFunction(ctxt, nargs);
50650         call_tests++;
50651         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50652         des_int(n_nargs, nargs, 1);
50653         xmlResetLastError();
50654         if (mem_base != xmlMemBlocks()) {
50655             printf("Leak of %d blocks found in xmlXPathRoundFunction",
50656                    xmlMemBlocks() - mem_base);
50657             test_ret++;
50658             printf(" %d", n_ctxt);
50659             printf(" %d", n_nargs);
50660             printf("\n");
50661         }
50662     }
50663     }
50664     function_tests++;
50665 #endif
50666
50667     return(test_ret);
50668 }
50669
50670
50671 static int
50672 test_xmlXPathStartsWithFunction(void) {
50673     int test_ret = 0;
50674
50675 #if defined(LIBXML_XPATH_ENABLED)
50676     int mem_base;
50677     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50678     int n_ctxt;
50679     int nargs; /* the number of arguments */
50680     int n_nargs;
50681
50682     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50683     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50684         mem_base = xmlMemBlocks();
50685         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50686         nargs = gen_int(n_nargs, 1);
50687
50688         xmlXPathStartsWithFunction(ctxt, nargs);
50689         call_tests++;
50690         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50691         des_int(n_nargs, nargs, 1);
50692         xmlResetLastError();
50693         if (mem_base != xmlMemBlocks()) {
50694             printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
50695                    xmlMemBlocks() - mem_base);
50696             test_ret++;
50697             printf(" %d", n_ctxt);
50698             printf(" %d", n_nargs);
50699             printf("\n");
50700         }
50701     }
50702     }
50703     function_tests++;
50704 #endif
50705
50706     return(test_ret);
50707 }
50708
50709
50710 static int
50711 test_xmlXPathStringEvalNumber(void) {
50712     int test_ret = 0;
50713
50714 #if defined(LIBXML_XPATH_ENABLED)
50715     int mem_base;
50716     double ret_val;
50717     xmlChar * str; /* A string to scan */
50718     int n_str;
50719
50720     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50721         mem_base = xmlMemBlocks();
50722         str = gen_const_xmlChar_ptr(n_str, 0);
50723
50724         ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
50725         desret_double(ret_val);
50726         call_tests++;
50727         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50728         xmlResetLastError();
50729         if (mem_base != xmlMemBlocks()) {
50730             printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
50731                    xmlMemBlocks() - mem_base);
50732             test_ret++;
50733             printf(" %d", n_str);
50734             printf("\n");
50735         }
50736     }
50737     function_tests++;
50738 #endif
50739
50740     return(test_ret);
50741 }
50742
50743
50744 static int
50745 test_xmlXPathStringFunction(void) {
50746     int test_ret = 0;
50747
50748 #if defined(LIBXML_XPATH_ENABLED)
50749     int mem_base;
50750     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50751     int n_ctxt;
50752     int nargs; /* the number of arguments */
50753     int n_nargs;
50754
50755     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50756     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50757         mem_base = xmlMemBlocks();
50758         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50759         nargs = gen_int(n_nargs, 1);
50760
50761         xmlXPathStringFunction(ctxt, nargs);
50762         call_tests++;
50763         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50764         des_int(n_nargs, nargs, 1);
50765         xmlResetLastError();
50766         if (mem_base != xmlMemBlocks()) {
50767             printf("Leak of %d blocks found in xmlXPathStringFunction",
50768                    xmlMemBlocks() - mem_base);
50769             test_ret++;
50770             printf(" %d", n_ctxt);
50771             printf(" %d", n_nargs);
50772             printf("\n");
50773         }
50774     }
50775     }
50776     function_tests++;
50777 #endif
50778
50779     return(test_ret);
50780 }
50781
50782
50783 static int
50784 test_xmlXPathStringLengthFunction(void) {
50785     int test_ret = 0;
50786
50787 #if defined(LIBXML_XPATH_ENABLED)
50788     int mem_base;
50789     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50790     int n_ctxt;
50791     int nargs; /* the number of arguments */
50792     int n_nargs;
50793
50794     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50795     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50796         mem_base = xmlMemBlocks();
50797         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50798         nargs = gen_int(n_nargs, 1);
50799
50800         xmlXPathStringLengthFunction(ctxt, nargs);
50801         call_tests++;
50802         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50803         des_int(n_nargs, nargs, 1);
50804         xmlResetLastError();
50805         if (mem_base != xmlMemBlocks()) {
50806             printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
50807                    xmlMemBlocks() - mem_base);
50808             test_ret++;
50809             printf(" %d", n_ctxt);
50810             printf(" %d", n_nargs);
50811             printf("\n");
50812         }
50813     }
50814     }
50815     function_tests++;
50816 #endif
50817
50818     return(test_ret);
50819 }
50820
50821
50822 static int
50823 test_xmlXPathSubValues(void) {
50824     int test_ret = 0;
50825
50826 #if defined(LIBXML_XPATH_ENABLED)
50827     int mem_base;
50828     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50829     int n_ctxt;
50830
50831     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50832         mem_base = xmlMemBlocks();
50833         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50834
50835         xmlXPathSubValues(ctxt);
50836         call_tests++;
50837         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50838         xmlResetLastError();
50839         if (mem_base != xmlMemBlocks()) {
50840             printf("Leak of %d blocks found in xmlXPathSubValues",
50841                    xmlMemBlocks() - mem_base);
50842             test_ret++;
50843             printf(" %d", n_ctxt);
50844             printf("\n");
50845         }
50846     }
50847     function_tests++;
50848 #endif
50849
50850     return(test_ret);
50851 }
50852
50853
50854 static int
50855 test_xmlXPathSubstringAfterFunction(void) {
50856     int test_ret = 0;
50857
50858 #if defined(LIBXML_XPATH_ENABLED)
50859     int mem_base;
50860     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50861     int n_ctxt;
50862     int nargs; /* the number of arguments */
50863     int n_nargs;
50864
50865     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50866     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50867         mem_base = xmlMemBlocks();
50868         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50869         nargs = gen_int(n_nargs, 1);
50870
50871         xmlXPathSubstringAfterFunction(ctxt, nargs);
50872         call_tests++;
50873         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50874         des_int(n_nargs, nargs, 1);
50875         xmlResetLastError();
50876         if (mem_base != xmlMemBlocks()) {
50877             printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
50878                    xmlMemBlocks() - mem_base);
50879             test_ret++;
50880             printf(" %d", n_ctxt);
50881             printf(" %d", n_nargs);
50882             printf("\n");
50883         }
50884     }
50885     }
50886     function_tests++;
50887 #endif
50888
50889     return(test_ret);
50890 }
50891
50892
50893 static int
50894 test_xmlXPathSubstringBeforeFunction(void) {
50895     int test_ret = 0;
50896
50897 #if defined(LIBXML_XPATH_ENABLED)
50898     int mem_base;
50899     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50900     int n_ctxt;
50901     int nargs; /* the number of arguments */
50902     int n_nargs;
50903
50904     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50905     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50906         mem_base = xmlMemBlocks();
50907         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50908         nargs = gen_int(n_nargs, 1);
50909
50910         xmlXPathSubstringBeforeFunction(ctxt, nargs);
50911         call_tests++;
50912         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50913         des_int(n_nargs, nargs, 1);
50914         xmlResetLastError();
50915         if (mem_base != xmlMemBlocks()) {
50916             printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
50917                    xmlMemBlocks() - mem_base);
50918             test_ret++;
50919             printf(" %d", n_ctxt);
50920             printf(" %d", n_nargs);
50921             printf("\n");
50922         }
50923     }
50924     }
50925     function_tests++;
50926 #endif
50927
50928     return(test_ret);
50929 }
50930
50931
50932 static int
50933 test_xmlXPathSubstringFunction(void) {
50934     int test_ret = 0;
50935
50936 #if defined(LIBXML_XPATH_ENABLED)
50937     int mem_base;
50938     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50939     int n_ctxt;
50940     int nargs; /* the number of arguments */
50941     int n_nargs;
50942
50943     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50944     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50945         mem_base = xmlMemBlocks();
50946         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50947         nargs = gen_int(n_nargs, 1);
50948
50949         xmlXPathSubstringFunction(ctxt, nargs);
50950         call_tests++;
50951         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50952         des_int(n_nargs, nargs, 1);
50953         xmlResetLastError();
50954         if (mem_base != xmlMemBlocks()) {
50955             printf("Leak of %d blocks found in xmlXPathSubstringFunction",
50956                    xmlMemBlocks() - mem_base);
50957             test_ret++;
50958             printf(" %d", n_ctxt);
50959             printf(" %d", n_nargs);
50960             printf("\n");
50961         }
50962     }
50963     }
50964     function_tests++;
50965 #endif
50966
50967     return(test_ret);
50968 }
50969
50970
50971 static int
50972 test_xmlXPathSumFunction(void) {
50973     int test_ret = 0;
50974
50975 #if defined(LIBXML_XPATH_ENABLED)
50976     int mem_base;
50977     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50978     int n_ctxt;
50979     int nargs; /* the number of arguments */
50980     int n_nargs;
50981
50982     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50983     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50984         mem_base = xmlMemBlocks();
50985         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50986         nargs = gen_int(n_nargs, 1);
50987
50988         xmlXPathSumFunction(ctxt, nargs);
50989         call_tests++;
50990         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50991         des_int(n_nargs, nargs, 1);
50992         xmlResetLastError();
50993         if (mem_base != xmlMemBlocks()) {
50994             printf("Leak of %d blocks found in xmlXPathSumFunction",
50995                    xmlMemBlocks() - mem_base);
50996             test_ret++;
50997             printf(" %d", n_ctxt);
50998             printf(" %d", n_nargs);
50999             printf("\n");
51000         }
51001     }
51002     }
51003     function_tests++;
51004 #endif
51005
51006     return(test_ret);
51007 }
51008
51009
51010 static int
51011 test_xmlXPathTrailing(void) {
51012     int test_ret = 0;
51013
51014 #if defined(LIBXML_XPATH_ENABLED)
51015     int mem_base;
51016     xmlNodeSetPtr ret_val;
51017     xmlNodeSetPtr nodes1; /* a node-set */
51018     int n_nodes1;
51019     xmlNodeSetPtr nodes2; /* a node-set */
51020     int n_nodes2;
51021
51022     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
51023     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
51024         mem_base = xmlMemBlocks();
51025         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
51026         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
51027
51028         ret_val = xmlXPathTrailing(nodes1, nodes2);
51029         desret_xmlNodeSetPtr(ret_val);
51030         call_tests++;
51031         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
51032         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
51033         xmlResetLastError();
51034         if (mem_base != xmlMemBlocks()) {
51035             printf("Leak of %d blocks found in xmlXPathTrailing",
51036                    xmlMemBlocks() - mem_base);
51037             test_ret++;
51038             printf(" %d", n_nodes1);
51039             printf(" %d", n_nodes2);
51040             printf("\n");
51041         }
51042     }
51043     }
51044     function_tests++;
51045 #endif
51046
51047     return(test_ret);
51048 }
51049
51050
51051 static int
51052 test_xmlXPathTrailingSorted(void) {
51053     int test_ret = 0;
51054
51055 #if defined(LIBXML_XPATH_ENABLED)
51056     int mem_base;
51057     xmlNodeSetPtr ret_val;
51058     xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
51059     int n_nodes1;
51060     xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
51061     int n_nodes2;
51062
51063     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
51064     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
51065         mem_base = xmlMemBlocks();
51066         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
51067         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
51068
51069         ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
51070         desret_xmlNodeSetPtr(ret_val);
51071         call_tests++;
51072         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
51073         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
51074         xmlResetLastError();
51075         if (mem_base != xmlMemBlocks()) {
51076             printf("Leak of %d blocks found in xmlXPathTrailingSorted",
51077                    xmlMemBlocks() - mem_base);
51078             test_ret++;
51079             printf(" %d", n_nodes1);
51080             printf(" %d", n_nodes2);
51081             printf("\n");
51082         }
51083     }
51084     }
51085     function_tests++;
51086 #endif
51087
51088     return(test_ret);
51089 }
51090
51091
51092 static int
51093 test_xmlXPathTranslateFunction(void) {
51094     int test_ret = 0;
51095
51096 #if defined(LIBXML_XPATH_ENABLED)
51097     int mem_base;
51098     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51099     int n_ctxt;
51100     int nargs; /* the number of arguments */
51101     int n_nargs;
51102
51103     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51104     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51105         mem_base = xmlMemBlocks();
51106         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51107         nargs = gen_int(n_nargs, 1);
51108
51109         xmlXPathTranslateFunction(ctxt, nargs);
51110         call_tests++;
51111         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51112         des_int(n_nargs, nargs, 1);
51113         xmlResetLastError();
51114         if (mem_base != xmlMemBlocks()) {
51115             printf("Leak of %d blocks found in xmlXPathTranslateFunction",
51116                    xmlMemBlocks() - mem_base);
51117             test_ret++;
51118             printf(" %d", n_ctxt);
51119             printf(" %d", n_nargs);
51120             printf("\n");
51121         }
51122     }
51123     }
51124     function_tests++;
51125 #endif
51126
51127     return(test_ret);
51128 }
51129
51130
51131 static int
51132 test_xmlXPathTrueFunction(void) {
51133     int test_ret = 0;
51134
51135 #if defined(LIBXML_XPATH_ENABLED)
51136     int mem_base;
51137     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51138     int n_ctxt;
51139     int nargs; /* the number of arguments */
51140     int n_nargs;
51141
51142     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51143     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51144         mem_base = xmlMemBlocks();
51145         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51146         nargs = gen_int(n_nargs, 1);
51147
51148         xmlXPathTrueFunction(ctxt, nargs);
51149         call_tests++;
51150         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51151         des_int(n_nargs, nargs, 1);
51152         xmlResetLastError();
51153         if (mem_base != xmlMemBlocks()) {
51154             printf("Leak of %d blocks found in xmlXPathTrueFunction",
51155                    xmlMemBlocks() - mem_base);
51156             test_ret++;
51157             printf(" %d", n_ctxt);
51158             printf(" %d", n_nargs);
51159             printf("\n");
51160         }
51161     }
51162     }
51163     function_tests++;
51164 #endif
51165
51166     return(test_ret);
51167 }
51168
51169
51170 static int
51171 test_xmlXPathValueFlipSign(void) {
51172     int test_ret = 0;
51173
51174 #if defined(LIBXML_XPATH_ENABLED)
51175     int mem_base;
51176     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51177     int n_ctxt;
51178
51179     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51180         mem_base = xmlMemBlocks();
51181         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51182
51183         xmlXPathValueFlipSign(ctxt);
51184         call_tests++;
51185         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51186         xmlResetLastError();
51187         if (mem_base != xmlMemBlocks()) {
51188             printf("Leak of %d blocks found in xmlXPathValueFlipSign",
51189                    xmlMemBlocks() - mem_base);
51190             test_ret++;
51191             printf(" %d", n_ctxt);
51192             printf("\n");
51193         }
51194     }
51195     function_tests++;
51196 #endif
51197
51198     return(test_ret);
51199 }
51200
51201
51202 static int
51203 test_xmlXPathVariableLookup(void) {
51204     int test_ret = 0;
51205
51206 #if defined(LIBXML_XPATH_ENABLED)
51207     int mem_base;
51208     xmlXPathObjectPtr ret_val;
51209     xmlXPathContextPtr ctxt; /* the XPath context */
51210     int n_ctxt;
51211     xmlChar * name; /* the variable name */
51212     int n_name;
51213
51214     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51215     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
51216         mem_base = xmlMemBlocks();
51217         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51218         name = gen_const_xmlChar_ptr(n_name, 1);
51219
51220         ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
51221         desret_xmlXPathObjectPtr(ret_val);
51222         call_tests++;
51223         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51224         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
51225         xmlResetLastError();
51226         if (mem_base != xmlMemBlocks()) {
51227             printf("Leak of %d blocks found in xmlXPathVariableLookup",
51228                    xmlMemBlocks() - mem_base);
51229             test_ret++;
51230             printf(" %d", n_ctxt);
51231             printf(" %d", n_name);
51232             printf("\n");
51233         }
51234     }
51235     }
51236     function_tests++;
51237 #endif
51238
51239     return(test_ret);
51240 }
51241
51242
51243 static int
51244 test_xmlXPathVariableLookupNS(void) {
51245     int test_ret = 0;
51246
51247 #if defined(LIBXML_XPATH_ENABLED)
51248     int mem_base;
51249     xmlXPathObjectPtr ret_val;
51250     xmlXPathContextPtr ctxt; /* the XPath context */
51251     int n_ctxt;
51252     xmlChar * name; /* the variable name */
51253     int n_name;
51254     xmlChar * ns_uri; /* the variable namespace URI */
51255     int n_ns_uri;
51256
51257     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51258     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
51259     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
51260         mem_base = xmlMemBlocks();
51261         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51262         name = gen_const_xmlChar_ptr(n_name, 1);
51263         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
51264
51265         ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
51266         desret_xmlXPathObjectPtr(ret_val);
51267         call_tests++;
51268         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51269         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
51270         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
51271         xmlResetLastError();
51272         if (mem_base != xmlMemBlocks()) {
51273             printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
51274                    xmlMemBlocks() - mem_base);
51275             test_ret++;
51276             printf(" %d", n_ctxt);
51277             printf(" %d", n_name);
51278             printf(" %d", n_ns_uri);
51279             printf("\n");
51280         }
51281     }
51282     }
51283     }
51284     function_tests++;
51285 #endif
51286
51287     return(test_ret);
51288 }
51289
51290
51291 static int
51292 test_xmlXPathWrapCString(void) {
51293     int test_ret = 0;
51294
51295 #if defined(LIBXML_XPATH_ENABLED)
51296     int mem_base;
51297     xmlXPathObjectPtr ret_val;
51298     char * val; /* the char * value */
51299     int n_val;
51300
51301     for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
51302         mem_base = xmlMemBlocks();
51303         val = gen_char_ptr(n_val, 0);
51304
51305         ret_val = xmlXPathWrapCString(val);
51306         desret_xmlXPathObjectPtr(ret_val);
51307         call_tests++;
51308         des_char_ptr(n_val, val, 0);
51309         xmlResetLastError();
51310         if (mem_base != xmlMemBlocks()) {
51311             printf("Leak of %d blocks found in xmlXPathWrapCString",
51312                    xmlMemBlocks() - mem_base);
51313             test_ret++;
51314             printf(" %d", n_val);
51315             printf("\n");
51316         }
51317     }
51318     function_tests++;
51319 #endif
51320
51321     return(test_ret);
51322 }
51323
51324
51325 static int
51326 test_xmlXPathWrapExternal(void) {
51327     int test_ret = 0;
51328
51329 #if defined(LIBXML_XPATH_ENABLED)
51330     int mem_base;
51331     xmlXPathObjectPtr ret_val;
51332     void * val; /* the user data */
51333     int n_val;
51334
51335     for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
51336         mem_base = xmlMemBlocks();
51337         val = gen_void_ptr(n_val, 0);
51338
51339         ret_val = xmlXPathWrapExternal(val);
51340         desret_xmlXPathObjectPtr(ret_val);
51341         call_tests++;
51342         des_void_ptr(n_val, val, 0);
51343         xmlResetLastError();
51344         if (mem_base != xmlMemBlocks()) {
51345             printf("Leak of %d blocks found in xmlXPathWrapExternal",
51346                    xmlMemBlocks() - mem_base);
51347             test_ret++;
51348             printf(" %d", n_val);
51349             printf("\n");
51350         }
51351     }
51352     function_tests++;
51353 #endif
51354
51355     return(test_ret);
51356 }
51357
51358
51359 static int
51360 test_xmlXPathWrapNodeSet(void) {
51361     int test_ret = 0;
51362
51363 #if defined(LIBXML_XPATH_ENABLED)
51364     int mem_base;
51365     xmlXPathObjectPtr ret_val;
51366     xmlNodeSetPtr val; /* the NodePtr value */
51367     int n_val;
51368
51369     for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
51370         mem_base = xmlMemBlocks();
51371         val = gen_xmlNodeSetPtr(n_val, 0);
51372
51373         ret_val = xmlXPathWrapNodeSet(val);
51374         desret_xmlXPathObjectPtr(ret_val);
51375         call_tests++;
51376         des_xmlNodeSetPtr(n_val, val, 0);
51377         xmlResetLastError();
51378         if (mem_base != xmlMemBlocks()) {
51379             printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
51380                    xmlMemBlocks() - mem_base);
51381             test_ret++;
51382             printf(" %d", n_val);
51383             printf("\n");
51384         }
51385     }
51386     function_tests++;
51387 #endif
51388
51389     return(test_ret);
51390 }
51391
51392
51393 static int
51394 test_xmlXPatherror(void) {
51395     int test_ret = 0;
51396
51397 #if defined(LIBXML_XPATH_ENABLED)
51398     int mem_base;
51399     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51400     int n_ctxt;
51401     const char * file; /* the file name */
51402     int n_file;
51403     int line; /* the line number */
51404     int n_line;
51405     int no; /* the error number */
51406     int n_no;
51407
51408     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51409     for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
51410     for (n_line = 0;n_line < gen_nb_int;n_line++) {
51411     for (n_no = 0;n_no < gen_nb_int;n_no++) {
51412         mem_base = xmlMemBlocks();
51413         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51414         file = gen_filepath(n_file, 1);
51415         line = gen_int(n_line, 2);
51416         no = gen_int(n_no, 3);
51417
51418         xmlXPatherror(ctxt, file, line, no);
51419         call_tests++;
51420         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51421         des_filepath(n_file, file, 1);
51422         des_int(n_line, line, 2);
51423         des_int(n_no, no, 3);
51424         xmlResetLastError();
51425         if (mem_base != xmlMemBlocks()) {
51426             printf("Leak of %d blocks found in xmlXPatherror",
51427                    xmlMemBlocks() - mem_base);
51428             test_ret++;
51429             printf(" %d", n_ctxt);
51430             printf(" %d", n_file);
51431             printf(" %d", n_line);
51432             printf(" %d", n_no);
51433             printf("\n");
51434         }
51435     }
51436     }
51437     }
51438     }
51439     function_tests++;
51440 #endif
51441
51442     return(test_ret);
51443 }
51444
51445 static int
51446 test_xpathInternals(void) {
51447     int test_ret = 0;
51448
51449     if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
51450     test_ret += test_valuePop();
51451     test_ret += test_valuePush();
51452     test_ret += test_xmlXPathAddValues();
51453     test_ret += test_xmlXPathBooleanFunction();
51454     test_ret += test_xmlXPathCeilingFunction();
51455     test_ret += test_xmlXPathCompareValues();
51456     test_ret += test_xmlXPathConcatFunction();
51457     test_ret += test_xmlXPathContainsFunction();
51458     test_ret += test_xmlXPathCountFunction();
51459     test_ret += test_xmlXPathDebugDumpCompExpr();
51460     test_ret += test_xmlXPathDebugDumpObject();
51461     test_ret += test_xmlXPathDifference();
51462     test_ret += test_xmlXPathDistinct();
51463     test_ret += test_xmlXPathDistinctSorted();
51464     test_ret += test_xmlXPathDivValues();
51465     test_ret += test_xmlXPathEqualValues();
51466     test_ret += test_xmlXPathErr();
51467     test_ret += test_xmlXPathEvalExpr();
51468     test_ret += test_xmlXPathEvaluatePredicateResult();
51469     test_ret += test_xmlXPathFalseFunction();
51470     test_ret += test_xmlXPathFloorFunction();
51471     test_ret += test_xmlXPathFunctionLookup();
51472     test_ret += test_xmlXPathFunctionLookupNS();
51473     test_ret += test_xmlXPathHasSameNodes();
51474     test_ret += test_xmlXPathIdFunction();
51475     test_ret += test_xmlXPathIntersection();
51476     test_ret += test_xmlXPathIsNodeType();
51477     test_ret += test_xmlXPathLangFunction();
51478     test_ret += test_xmlXPathLastFunction();
51479     test_ret += test_xmlXPathLeading();
51480     test_ret += test_xmlXPathLeadingSorted();
51481     test_ret += test_xmlXPathLocalNameFunction();
51482     test_ret += test_xmlXPathModValues();
51483     test_ret += test_xmlXPathMultValues();
51484     test_ret += test_xmlXPathNamespaceURIFunction();
51485     test_ret += test_xmlXPathNewBoolean();
51486     test_ret += test_xmlXPathNewCString();
51487     test_ret += test_xmlXPathNewFloat();
51488     test_ret += test_xmlXPathNewNodeSet();
51489     test_ret += test_xmlXPathNewNodeSetList();
51490     test_ret += test_xmlXPathNewParserContext();
51491     test_ret += test_xmlXPathNewString();
51492     test_ret += test_xmlXPathNextAncestor();
51493     test_ret += test_xmlXPathNextAncestorOrSelf();
51494     test_ret += test_xmlXPathNextAttribute();
51495     test_ret += test_xmlXPathNextChild();
51496     test_ret += test_xmlXPathNextDescendant();
51497     test_ret += test_xmlXPathNextDescendantOrSelf();
51498     test_ret += test_xmlXPathNextFollowing();
51499     test_ret += test_xmlXPathNextFollowingSibling();
51500     test_ret += test_xmlXPathNextNamespace();
51501     test_ret += test_xmlXPathNextParent();
51502     test_ret += test_xmlXPathNextPreceding();
51503     test_ret += test_xmlXPathNextPrecedingSibling();
51504     test_ret += test_xmlXPathNextSelf();
51505     test_ret += test_xmlXPathNodeLeading();
51506     test_ret += test_xmlXPathNodeLeadingSorted();
51507     test_ret += test_xmlXPathNodeSetAdd();
51508     test_ret += test_xmlXPathNodeSetAddNs();
51509     test_ret += test_xmlXPathNodeSetAddUnique();
51510     test_ret += test_xmlXPathNodeSetContains();
51511     test_ret += test_xmlXPathNodeSetDel();
51512     test_ret += test_xmlXPathNodeSetMerge();
51513     test_ret += test_xmlXPathNodeSetRemove();
51514     test_ret += test_xmlXPathNodeSetSort();
51515     test_ret += test_xmlXPathNodeTrailing();
51516     test_ret += test_xmlXPathNodeTrailingSorted();
51517     test_ret += test_xmlXPathNormalizeFunction();
51518     test_ret += test_xmlXPathNotEqualValues();
51519     test_ret += test_xmlXPathNotFunction();
51520     test_ret += test_xmlXPathNsLookup();
51521     test_ret += test_xmlXPathNumberFunction();
51522     test_ret += test_xmlXPathParseNCName();
51523     test_ret += test_xmlXPathParseName();
51524     test_ret += test_xmlXPathPopBoolean();
51525     test_ret += test_xmlXPathPopExternal();
51526     test_ret += test_xmlXPathPopNodeSet();
51527     test_ret += test_xmlXPathPopNumber();
51528     test_ret += test_xmlXPathPopString();
51529     test_ret += test_xmlXPathPositionFunction();
51530     test_ret += test_xmlXPathRegisterAllFunctions();
51531     test_ret += test_xmlXPathRegisterFunc();
51532     test_ret += test_xmlXPathRegisterFuncLookup();
51533     test_ret += test_xmlXPathRegisterFuncNS();
51534     test_ret += test_xmlXPathRegisterNs();
51535     test_ret += test_xmlXPathRegisterVariable();
51536     test_ret += test_xmlXPathRegisterVariableLookup();
51537     test_ret += test_xmlXPathRegisterVariableNS();
51538     test_ret += test_xmlXPathRegisteredFuncsCleanup();
51539     test_ret += test_xmlXPathRegisteredNsCleanup();
51540     test_ret += test_xmlXPathRegisteredVariablesCleanup();
51541     test_ret += test_xmlXPathRoot();
51542     test_ret += test_xmlXPathRoundFunction();
51543     test_ret += test_xmlXPathStartsWithFunction();
51544     test_ret += test_xmlXPathStringEvalNumber();
51545     test_ret += test_xmlXPathStringFunction();
51546     test_ret += test_xmlXPathStringLengthFunction();
51547     test_ret += test_xmlXPathSubValues();
51548     test_ret += test_xmlXPathSubstringAfterFunction();
51549     test_ret += test_xmlXPathSubstringBeforeFunction();
51550     test_ret += test_xmlXPathSubstringFunction();
51551     test_ret += test_xmlXPathSumFunction();
51552     test_ret += test_xmlXPathTrailing();
51553     test_ret += test_xmlXPathTrailingSorted();
51554     test_ret += test_xmlXPathTranslateFunction();
51555     test_ret += test_xmlXPathTrueFunction();
51556     test_ret += test_xmlXPathValueFlipSign();
51557     test_ret += test_xmlXPathVariableLookup();
51558     test_ret += test_xmlXPathVariableLookupNS();
51559     test_ret += test_xmlXPathWrapCString();
51560     test_ret += test_xmlXPathWrapExternal();
51561     test_ret += test_xmlXPathWrapNodeSet();
51562     test_ret += test_xmlXPatherror();
51563
51564     if (test_ret != 0)
51565         printf("Module xpathInternals: %d errors\n", test_ret);
51566     return(test_ret);
51567 }
51568
51569 static int
51570 test_xmlXPtrBuildNodeList(void) {
51571     int test_ret = 0;
51572
51573 #if defined(LIBXML_XPTR_ENABLED)
51574     int mem_base;
51575     xmlNodePtr ret_val;
51576     xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
51577     int n_obj;
51578
51579     for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
51580         mem_base = xmlMemBlocks();
51581         obj = gen_xmlXPathObjectPtr(n_obj, 0);
51582
51583         ret_val = xmlXPtrBuildNodeList(obj);
51584         desret_xmlNodePtr(ret_val);
51585         call_tests++;
51586         des_xmlXPathObjectPtr(n_obj, obj, 0);
51587         xmlResetLastError();
51588         if (mem_base != xmlMemBlocks()) {
51589             printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
51590                    xmlMemBlocks() - mem_base);
51591             test_ret++;
51592             printf(" %d", n_obj);
51593             printf("\n");
51594         }
51595     }
51596     function_tests++;
51597 #endif
51598
51599     return(test_ret);
51600 }
51601
51602
51603 static int
51604 test_xmlXPtrEval(void) {
51605     int test_ret = 0;
51606
51607 #if defined(LIBXML_XPTR_ENABLED)
51608     int mem_base;
51609     xmlXPathObjectPtr ret_val;
51610     xmlChar * str; /* the XPointer expression */
51611     int n_str;
51612     xmlXPathContextPtr ctx; /* the XPointer context */
51613     int n_ctx;
51614
51615     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
51616     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
51617         mem_base = xmlMemBlocks();
51618         str = gen_const_xmlChar_ptr(n_str, 0);
51619         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
51620
51621         ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
51622         desret_xmlXPathObjectPtr(ret_val);
51623         call_tests++;
51624         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
51625         des_xmlXPathContextPtr(n_ctx, ctx, 1);
51626         xmlResetLastError();
51627         if (mem_base != xmlMemBlocks()) {
51628             printf("Leak of %d blocks found in xmlXPtrEval",
51629                    xmlMemBlocks() - mem_base);
51630             test_ret++;
51631             printf(" %d", n_str);
51632             printf(" %d", n_ctx);
51633             printf("\n");
51634         }
51635     }
51636     }
51637     function_tests++;
51638 #endif
51639
51640     return(test_ret);
51641 }
51642
51643
51644 static int
51645 test_xmlXPtrEvalRangePredicate(void) {
51646     int test_ret = 0;
51647
51648 #if defined(LIBXML_XPTR_ENABLED)
51649     int mem_base;
51650     xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51651     int n_ctxt;
51652
51653     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51654         mem_base = xmlMemBlocks();
51655         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51656
51657         xmlXPtrEvalRangePredicate(ctxt);
51658         call_tests++;
51659         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51660         xmlResetLastError();
51661         if (mem_base != xmlMemBlocks()) {
51662             printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
51663                    xmlMemBlocks() - mem_base);
51664             test_ret++;
51665             printf(" %d", n_ctxt);
51666             printf("\n");
51667         }
51668     }
51669     function_tests++;
51670 #endif
51671
51672     return(test_ret);
51673 }
51674
51675 #ifdef LIBXML_XPTR_ENABLED
51676
51677 #define gen_nb_xmlLocationSetPtr 1
51678 static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51679     return(NULL);
51680 }
51681 static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51682 }
51683 #endif
51684
51685
51686 static int
51687 test_xmlXPtrLocationSetAdd(void) {
51688     int test_ret = 0;
51689
51690 #if defined(LIBXML_XPTR_ENABLED)
51691     int mem_base;
51692     xmlLocationSetPtr cur; /* the initial range set */
51693     int n_cur;
51694     xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
51695     int n_val;
51696
51697     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51698     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51699         mem_base = xmlMemBlocks();
51700         cur = gen_xmlLocationSetPtr(n_cur, 0);
51701         val = gen_xmlXPathObjectPtr(n_val, 1);
51702
51703         xmlXPtrLocationSetAdd(cur, val);
51704         call_tests++;
51705         des_xmlLocationSetPtr(n_cur, cur, 0);
51706         des_xmlXPathObjectPtr(n_val, val, 1);
51707         xmlResetLastError();
51708         if (mem_base != xmlMemBlocks()) {
51709             printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
51710                    xmlMemBlocks() - mem_base);
51711             test_ret++;
51712             printf(" %d", n_cur);
51713             printf(" %d", n_val);
51714             printf("\n");
51715         }
51716     }
51717     }
51718     function_tests++;
51719 #endif
51720
51721     return(test_ret);
51722 }
51723
51724
51725 static int
51726 test_xmlXPtrLocationSetCreate(void) {
51727     int test_ret = 0;
51728
51729
51730     /* missing type support */
51731     return(test_ret);
51732 }
51733
51734
51735 static int
51736 test_xmlXPtrLocationSetDel(void) {
51737     int test_ret = 0;
51738
51739 #if defined(LIBXML_XPTR_ENABLED)
51740     int mem_base;
51741     xmlLocationSetPtr cur; /* the initial range set */
51742     int n_cur;
51743     xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
51744     int n_val;
51745
51746     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51747     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51748         mem_base = xmlMemBlocks();
51749         cur = gen_xmlLocationSetPtr(n_cur, 0);
51750         val = gen_xmlXPathObjectPtr(n_val, 1);
51751
51752         xmlXPtrLocationSetDel(cur, val);
51753         call_tests++;
51754         des_xmlLocationSetPtr(n_cur, cur, 0);
51755         des_xmlXPathObjectPtr(n_val, val, 1);
51756         xmlResetLastError();
51757         if (mem_base != xmlMemBlocks()) {
51758             printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
51759                    xmlMemBlocks() - mem_base);
51760             test_ret++;
51761             printf(" %d", n_cur);
51762             printf(" %d", n_val);
51763             printf("\n");
51764         }
51765     }
51766     }
51767     function_tests++;
51768 #endif
51769
51770     return(test_ret);
51771 }
51772
51773
51774 static int
51775 test_xmlXPtrLocationSetMerge(void) {
51776     int test_ret = 0;
51777
51778
51779     /* missing type support */
51780     return(test_ret);
51781 }
51782
51783
51784 static int
51785 test_xmlXPtrLocationSetRemove(void) {
51786     int test_ret = 0;
51787
51788 #if defined(LIBXML_XPTR_ENABLED)
51789     int mem_base;
51790     xmlLocationSetPtr cur; /* the initial range set */
51791     int n_cur;
51792     int val; /* the index to remove */
51793     int n_val;
51794
51795     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51796     for (n_val = 0;n_val < gen_nb_int;n_val++) {
51797         mem_base = xmlMemBlocks();
51798         cur = gen_xmlLocationSetPtr(n_cur, 0);
51799         val = gen_int(n_val, 1);
51800
51801         xmlXPtrLocationSetRemove(cur, val);
51802         call_tests++;
51803         des_xmlLocationSetPtr(n_cur, cur, 0);
51804         des_int(n_val, val, 1);
51805         xmlResetLastError();
51806         if (mem_base != xmlMemBlocks()) {
51807             printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
51808                    xmlMemBlocks() - mem_base);
51809             test_ret++;
51810             printf(" %d", n_cur);
51811             printf(" %d", n_val);
51812             printf("\n");
51813         }
51814     }
51815     }
51816     function_tests++;
51817 #endif
51818
51819     return(test_ret);
51820 }
51821
51822
51823 static int
51824 test_xmlXPtrNewCollapsedRange(void) {
51825     int test_ret = 0;
51826
51827 #if defined(LIBXML_XPTR_ENABLED)
51828     int mem_base;
51829     xmlXPathObjectPtr ret_val;
51830     xmlNodePtr start; /* the starting and ending node */
51831     int n_start;
51832
51833     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51834         mem_base = xmlMemBlocks();
51835         start = gen_xmlNodePtr(n_start, 0);
51836
51837         ret_val = xmlXPtrNewCollapsedRange(start);
51838         desret_xmlXPathObjectPtr(ret_val);
51839         call_tests++;
51840         des_xmlNodePtr(n_start, start, 0);
51841         xmlResetLastError();
51842         if (mem_base != xmlMemBlocks()) {
51843             printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
51844                    xmlMemBlocks() - mem_base);
51845             test_ret++;
51846             printf(" %d", n_start);
51847             printf("\n");
51848         }
51849     }
51850     function_tests++;
51851 #endif
51852
51853     return(test_ret);
51854 }
51855
51856
51857 static int
51858 test_xmlXPtrNewContext(void) {
51859     int test_ret = 0;
51860
51861
51862     /* missing type support */
51863     return(test_ret);
51864 }
51865
51866
51867 static int
51868 test_xmlXPtrNewLocationSetNodeSet(void) {
51869     int test_ret = 0;
51870
51871 #if defined(LIBXML_XPTR_ENABLED)
51872     int mem_base;
51873     xmlXPathObjectPtr ret_val;
51874     xmlNodeSetPtr set; /* a node set */
51875     int n_set;
51876
51877     for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
51878         mem_base = xmlMemBlocks();
51879         set = gen_xmlNodeSetPtr(n_set, 0);
51880
51881         ret_val = xmlXPtrNewLocationSetNodeSet(set);
51882         desret_xmlXPathObjectPtr(ret_val);
51883         call_tests++;
51884         des_xmlNodeSetPtr(n_set, set, 0);
51885         xmlResetLastError();
51886         if (mem_base != xmlMemBlocks()) {
51887             printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
51888                    xmlMemBlocks() - mem_base);
51889             test_ret++;
51890             printf(" %d", n_set);
51891             printf("\n");
51892         }
51893     }
51894     function_tests++;
51895 #endif
51896
51897     return(test_ret);
51898 }
51899
51900
51901 static int
51902 test_xmlXPtrNewLocationSetNodes(void) {
51903     int test_ret = 0;
51904
51905 #if defined(LIBXML_XPTR_ENABLED)
51906     int mem_base;
51907     xmlXPathObjectPtr ret_val;
51908     xmlNodePtr start; /* the start NodePtr value */
51909     int n_start;
51910     xmlNodePtr end; /* the end NodePtr value or NULL */
51911     int n_end;
51912
51913     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51914     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51915         mem_base = xmlMemBlocks();
51916         start = gen_xmlNodePtr(n_start, 0);
51917         end = gen_xmlNodePtr(n_end, 1);
51918
51919         ret_val = xmlXPtrNewLocationSetNodes(start, end);
51920         desret_xmlXPathObjectPtr(ret_val);
51921         call_tests++;
51922         des_xmlNodePtr(n_start, start, 0);
51923         des_xmlNodePtr(n_end, end, 1);
51924         xmlResetLastError();
51925         if (mem_base != xmlMemBlocks()) {
51926             printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
51927                    xmlMemBlocks() - mem_base);
51928             test_ret++;
51929             printf(" %d", n_start);
51930             printf(" %d", n_end);
51931             printf("\n");
51932         }
51933     }
51934     }
51935     function_tests++;
51936 #endif
51937
51938     return(test_ret);
51939 }
51940
51941
51942 static int
51943 test_xmlXPtrNewRange(void) {
51944     int test_ret = 0;
51945
51946 #if defined(LIBXML_XPTR_ENABLED)
51947     int mem_base;
51948     xmlXPathObjectPtr ret_val;
51949     xmlNodePtr start; /* the starting node */
51950     int n_start;
51951     int startindex; /* the start index */
51952     int n_startindex;
51953     xmlNodePtr end; /* the ending point */
51954     int n_end;
51955     int endindex; /* the ending index */
51956     int n_endindex;
51957
51958     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51959     for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
51960     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51961     for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
51962         mem_base = xmlMemBlocks();
51963         start = gen_xmlNodePtr(n_start, 0);
51964         startindex = gen_int(n_startindex, 1);
51965         end = gen_xmlNodePtr(n_end, 2);
51966         endindex = gen_int(n_endindex, 3);
51967
51968         ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
51969         desret_xmlXPathObjectPtr(ret_val);
51970         call_tests++;
51971         des_xmlNodePtr(n_start, start, 0);
51972         des_int(n_startindex, startindex, 1);
51973         des_xmlNodePtr(n_end, end, 2);
51974         des_int(n_endindex, endindex, 3);
51975         xmlResetLastError();
51976         if (mem_base != xmlMemBlocks()) {
51977             printf("Leak of %d blocks found in xmlXPtrNewRange",
51978                    xmlMemBlocks() - mem_base);
51979             test_ret++;
51980             printf(" %d", n_start);
51981             printf(" %d", n_startindex);
51982             printf(" %d", n_end);
51983             printf(" %d", n_endindex);
51984             printf("\n");
51985         }
51986     }
51987     }
51988     }
51989     }
51990     function_tests++;
51991 #endif
51992
51993     return(test_ret);
51994 }
51995
51996
51997 static int
51998 test_xmlXPtrNewRangeNodeObject(void) {
51999     int test_ret = 0;
52000
52001 #if defined(LIBXML_XPTR_ENABLED)
52002     int mem_base;
52003     xmlXPathObjectPtr ret_val;
52004     xmlNodePtr start; /* the starting node */
52005     int n_start;
52006     xmlXPathObjectPtr end; /* the ending object */
52007     int n_end;
52008
52009     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
52010     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
52011         mem_base = xmlMemBlocks();
52012         start = gen_xmlNodePtr(n_start, 0);
52013         end = gen_xmlXPathObjectPtr(n_end, 1);
52014
52015         ret_val = xmlXPtrNewRangeNodeObject(start, end);
52016         desret_xmlXPathObjectPtr(ret_val);
52017         call_tests++;
52018         des_xmlNodePtr(n_start, start, 0);
52019         des_xmlXPathObjectPtr(n_end, end, 1);
52020         xmlResetLastError();
52021         if (mem_base != xmlMemBlocks()) {
52022             printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
52023                    xmlMemBlocks() - mem_base);
52024             test_ret++;
52025             printf(" %d", n_start);
52026             printf(" %d", n_end);
52027             printf("\n");
52028         }
52029     }
52030     }
52031     function_tests++;
52032 #endif
52033
52034     return(test_ret);
52035 }
52036
52037
52038 static int
52039 test_xmlXPtrNewRangeNodePoint(void) {
52040     int test_ret = 0;
52041
52042 #if defined(LIBXML_XPTR_ENABLED)
52043     int mem_base;
52044     xmlXPathObjectPtr ret_val;
52045     xmlNodePtr start; /* the starting node */
52046     int n_start;
52047     xmlXPathObjectPtr end; /* the ending point */
52048     int n_end;
52049
52050     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
52051     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
52052         mem_base = xmlMemBlocks();
52053         start = gen_xmlNodePtr(n_start, 0);
52054         end = gen_xmlXPathObjectPtr(n_end, 1);
52055
52056         ret_val = xmlXPtrNewRangeNodePoint(start, end);
52057         desret_xmlXPathObjectPtr(ret_val);
52058         call_tests++;
52059         des_xmlNodePtr(n_start, start, 0);
52060         des_xmlXPathObjectPtr(n_end, end, 1);
52061         xmlResetLastError();
52062         if (mem_base != xmlMemBlocks()) {
52063             printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
52064                    xmlMemBlocks() - mem_base);
52065             test_ret++;
52066             printf(" %d", n_start);
52067             printf(" %d", n_end);
52068             printf("\n");
52069         }
52070     }
52071     }
52072     function_tests++;
52073 #endif
52074
52075     return(test_ret);
52076 }
52077
52078
52079 static int
52080 test_xmlXPtrNewRangeNodes(void) {
52081     int test_ret = 0;
52082
52083 #if defined(LIBXML_XPTR_ENABLED)
52084     int mem_base;
52085     xmlXPathObjectPtr ret_val;
52086     xmlNodePtr start; /* the starting node */
52087     int n_start;
52088     xmlNodePtr end; /* the ending node */
52089     int n_end;
52090
52091     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
52092     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
52093         mem_base = xmlMemBlocks();
52094         start = gen_xmlNodePtr(n_start, 0);
52095         end = gen_xmlNodePtr(n_end, 1);
52096
52097         ret_val = xmlXPtrNewRangeNodes(start, end);
52098         desret_xmlXPathObjectPtr(ret_val);
52099         call_tests++;
52100         des_xmlNodePtr(n_start, start, 0);
52101         des_xmlNodePtr(n_end, end, 1);
52102         xmlResetLastError();
52103         if (mem_base != xmlMemBlocks()) {
52104             printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
52105                    xmlMemBlocks() - mem_base);
52106             test_ret++;
52107             printf(" %d", n_start);
52108             printf(" %d", n_end);
52109             printf("\n");
52110         }
52111     }
52112     }
52113     function_tests++;
52114 #endif
52115
52116     return(test_ret);
52117 }
52118
52119
52120 static int
52121 test_xmlXPtrNewRangePointNode(void) {
52122     int test_ret = 0;
52123
52124 #if defined(LIBXML_XPTR_ENABLED)
52125     int mem_base;
52126     xmlXPathObjectPtr ret_val;
52127     xmlXPathObjectPtr start; /* the starting point */
52128     int n_start;
52129     xmlNodePtr end; /* the ending node */
52130     int n_end;
52131
52132     for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
52133     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
52134         mem_base = xmlMemBlocks();
52135         start = gen_xmlXPathObjectPtr(n_start, 0);
52136         end = gen_xmlNodePtr(n_end, 1);
52137
52138         ret_val = xmlXPtrNewRangePointNode(start, end);
52139         desret_xmlXPathObjectPtr(ret_val);
52140         call_tests++;
52141         des_xmlXPathObjectPtr(n_start, start, 0);
52142         des_xmlNodePtr(n_end, end, 1);
52143         xmlResetLastError();
52144         if (mem_base != xmlMemBlocks()) {
52145             printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
52146                    xmlMemBlocks() - mem_base);
52147             test_ret++;
52148             printf(" %d", n_start);
52149             printf(" %d", n_end);
52150             printf("\n");
52151         }
52152     }
52153     }
52154     function_tests++;
52155 #endif
52156
52157     return(test_ret);
52158 }
52159
52160
52161 static int
52162 test_xmlXPtrNewRangePoints(void) {
52163     int test_ret = 0;
52164
52165 #if defined(LIBXML_XPTR_ENABLED)
52166     int mem_base;
52167     xmlXPathObjectPtr ret_val;
52168     xmlXPathObjectPtr start; /* the starting point */
52169     int n_start;
52170     xmlXPathObjectPtr end; /* the ending point */
52171     int n_end;
52172
52173     for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
52174     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
52175         mem_base = xmlMemBlocks();
52176         start = gen_xmlXPathObjectPtr(n_start, 0);
52177         end = gen_xmlXPathObjectPtr(n_end, 1);
52178
52179         ret_val = xmlXPtrNewRangePoints(start, end);
52180         desret_xmlXPathObjectPtr(ret_val);
52181         call_tests++;
52182         des_xmlXPathObjectPtr(n_start, start, 0);
52183         des_xmlXPathObjectPtr(n_end, end, 1);
52184         xmlResetLastError();
52185         if (mem_base != xmlMemBlocks()) {
52186             printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
52187                    xmlMemBlocks() - mem_base);
52188             test_ret++;
52189             printf(" %d", n_start);
52190             printf(" %d", n_end);
52191             printf("\n");
52192         }
52193     }
52194     }
52195     function_tests++;
52196 #endif
52197
52198     return(test_ret);
52199 }
52200
52201
52202 static int
52203 test_xmlXPtrRangeToFunction(void) {
52204     int test_ret = 0;
52205
52206 #if defined(LIBXML_XPTR_ENABLED)
52207     int mem_base;
52208     xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
52209     int n_ctxt;
52210     int nargs; /* the number of args */
52211     int n_nargs;
52212
52213     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52214     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
52215         mem_base = xmlMemBlocks();
52216         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52217         nargs = gen_int(n_nargs, 1);
52218
52219         xmlXPtrRangeToFunction(ctxt, nargs);
52220         call_tests++;
52221         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52222         des_int(n_nargs, nargs, 1);
52223         xmlResetLastError();
52224         if (mem_base != xmlMemBlocks()) {
52225             printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
52226                    xmlMemBlocks() - mem_base);
52227             test_ret++;
52228             printf(" %d", n_ctxt);
52229             printf(" %d", n_nargs);
52230             printf("\n");
52231         }
52232     }
52233     }
52234     function_tests++;
52235 #endif
52236
52237     return(test_ret);
52238 }
52239
52240
52241 static int
52242 test_xmlXPtrWrapLocationSet(void) {
52243     int test_ret = 0;
52244
52245 #if defined(LIBXML_XPTR_ENABLED)
52246     int mem_base;
52247     xmlXPathObjectPtr ret_val;
52248     xmlLocationSetPtr val; /* the LocationSet value */
52249     int n_val;
52250
52251     for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
52252         mem_base = xmlMemBlocks();
52253         val = gen_xmlLocationSetPtr(n_val, 0);
52254
52255         ret_val = xmlXPtrWrapLocationSet(val);
52256         desret_xmlXPathObjectPtr(ret_val);
52257         call_tests++;
52258         des_xmlLocationSetPtr(n_val, val, 0);
52259         xmlResetLastError();
52260         if (mem_base != xmlMemBlocks()) {
52261             printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
52262                    xmlMemBlocks() - mem_base);
52263             test_ret++;
52264             printf(" %d", n_val);
52265             printf("\n");
52266         }
52267     }
52268     function_tests++;
52269 #endif
52270
52271     return(test_ret);
52272 }
52273
52274 static int
52275 test_xpointer(void) {
52276     int test_ret = 0;
52277
52278     if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
52279     test_ret += test_xmlXPtrBuildNodeList();
52280     test_ret += test_xmlXPtrEval();
52281     test_ret += test_xmlXPtrEvalRangePredicate();
52282     test_ret += test_xmlXPtrLocationSetAdd();
52283     test_ret += test_xmlXPtrLocationSetCreate();
52284     test_ret += test_xmlXPtrLocationSetDel();
52285     test_ret += test_xmlXPtrLocationSetMerge();
52286     test_ret += test_xmlXPtrLocationSetRemove();
52287     test_ret += test_xmlXPtrNewCollapsedRange();
52288     test_ret += test_xmlXPtrNewContext();
52289     test_ret += test_xmlXPtrNewLocationSetNodeSet();
52290     test_ret += test_xmlXPtrNewLocationSetNodes();
52291     test_ret += test_xmlXPtrNewRange();
52292     test_ret += test_xmlXPtrNewRangeNodeObject();
52293     test_ret += test_xmlXPtrNewRangeNodePoint();
52294     test_ret += test_xmlXPtrNewRangeNodes();
52295     test_ret += test_xmlXPtrNewRangePointNode();
52296     test_ret += test_xmlXPtrNewRangePoints();
52297     test_ret += test_xmlXPtrRangeToFunction();
52298     test_ret += test_xmlXPtrWrapLocationSet();
52299
52300     if (test_ret != 0)
52301         printf("Module xpointer: %d errors\n", test_ret);
52302     return(test_ret);
52303 }
52304 static int
52305 test_module(const char *module) {
52306     if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
52307     if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
52308     if (!strcmp(module, "SAX2")) return(test_SAX2());
52309     if (!strcmp(module, "c14n")) return(test_c14n());
52310     if (!strcmp(module, "catalog")) return(test_catalog());
52311     if (!strcmp(module, "chvalid")) return(test_chvalid());
52312     if (!strcmp(module, "debugXML")) return(test_debugXML());
52313     if (!strcmp(module, "dict")) return(test_dict());
52314     if (!strcmp(module, "encoding")) return(test_encoding());
52315     if (!strcmp(module, "entities")) return(test_entities());
52316     if (!strcmp(module, "hash")) return(test_hash());
52317     if (!strcmp(module, "list")) return(test_list());
52318     if (!strcmp(module, "nanoftp")) return(test_nanoftp());
52319     if (!strcmp(module, "nanohttp")) return(test_nanohttp());
52320     if (!strcmp(module, "parser")) return(test_parser());
52321     if (!strcmp(module, "parserInternals")) return(test_parserInternals());
52322     if (!strcmp(module, "pattern")) return(test_pattern());
52323     if (!strcmp(module, "relaxng")) return(test_relaxng());
52324     if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
52325     if (!strcmp(module, "schematron")) return(test_schematron());
52326     if (!strcmp(module, "tree")) return(test_tree());
52327     if (!strcmp(module, "uri")) return(test_uri());
52328     if (!strcmp(module, "valid")) return(test_valid());
52329     if (!strcmp(module, "xinclude")) return(test_xinclude());
52330     if (!strcmp(module, "xmlIO")) return(test_xmlIO());
52331     if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
52332     if (!strcmp(module, "xmlerror")) return(test_xmlerror());
52333     if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
52334     if (!strcmp(module, "xmlreader")) return(test_xmlreader());
52335     if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
52336     if (!strcmp(module, "xmlsave")) return(test_xmlsave());
52337     if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
52338     if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
52339     if (!strcmp(module, "xmlstring")) return(test_xmlstring());
52340     if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
52341     if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
52342     if (!strcmp(module, "xpath")) return(test_xpath());
52343     if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
52344     if (!strcmp(module, "xpointer")) return(test_xpointer());
52345     return(0);
52346 }